@arcgis/core 5.1.0-next.105 → 5.1.0-next.106

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 (383) hide show
  1. package/analysis/AreaMeasurementAnalysis.d.ts +5 -5
  2. package/analysis/DimensionAnalysis.d.ts +3 -3
  3. package/analysis/DimensionSimpleStyle.d.ts +2 -2
  4. package/analysis/DirectLineMeasurementAnalysis.d.ts +4 -4
  5. package/analysis/DistanceMeasurementAnalysis.d.ts +4 -4
  6. package/analysis/ElevationProfileAnalysis.d.ts +3 -3
  7. package/analysis/LengthDimension.d.ts +2 -2
  8. package/analysis/LineOfSightAnalysis.d.ts +4 -4
  9. package/analysis/ShadowCast/DiscreteOptions.d.ts +7 -3
  10. package/analysis/ShadowCast/MinDurationOptions.d.ts +5 -1
  11. package/analysis/ShadowCast/TotalDurationOptions.d.ts +7 -3
  12. package/analysis/ShadowCast/types.d.ts +1 -1
  13. package/analysis/ShadowCastAnalysis.d.ts +11 -6
  14. package/analysis/SliceAnalysis.d.ts +4 -4
  15. package/analysis/SlicePlane.d.ts +3 -3
  16. package/analysis/Viewshed.d.ts +2 -2
  17. package/analysis/ViewshedAnalysis.d.ts +3 -3
  18. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -1
  19. package/analysis/VolumeMeasurementAnalysis.d.ts +3 -3
  20. package/applications/Components/imageryUtils.d.ts +24 -0
  21. package/applications/Components/layerUtils.d.ts +21 -0
  22. package/applications/Components/layerUtils.js +2 -0
  23. package/applications/Components/templateUtils.d.ts +11 -1
  24. package/applications/Components/templateUtils.js +1 -1
  25. package/arcgisGlobal.d.ts +1 -0
  26. package/assets/components/assets/icon/buttons16.json +1 -0
  27. package/assets/components/assets/icon/buttons24.json +1 -0
  28. package/assets/components/assets/icon/buttons32.json +1 -0
  29. package/assets/components/assets/icon/entityTypes16.json +1 -0
  30. package/assets/components/assets/icon/entityTypes24.json +1 -0
  31. package/assets/components/assets/icon/entityTypes32.json +1 -0
  32. package/assets/esri/core/t9n/Units_ar.json +1 -1
  33. package/assets/esri/core/t9n/Units_bg.json +1 -1
  34. package/assets/esri/core/t9n/Units_bs.json +1 -1
  35. package/assets/esri/core/t9n/Units_ca.json +1 -1
  36. package/assets/esri/core/t9n/Units_cs.json +1 -1
  37. package/assets/esri/core/t9n/Units_da.json +1 -1
  38. package/assets/esri/core/t9n/Units_de.json +1 -1
  39. package/assets/esri/core/t9n/Units_el.json +1 -1
  40. package/assets/esri/core/t9n/Units_es.json +1 -1
  41. package/assets/esri/core/t9n/Units_et.json +1 -1
  42. package/assets/esri/core/t9n/Units_fi.json +1 -1
  43. package/assets/esri/core/t9n/Units_fr.json +1 -1
  44. package/assets/esri/core/t9n/Units_he.json +1 -1
  45. package/assets/esri/core/t9n/Units_hr.json +1 -1
  46. package/assets/esri/core/t9n/Units_hu.json +1 -1
  47. package/assets/esri/core/t9n/Units_id.json +1 -1
  48. package/assets/esri/core/t9n/Units_it.json +1 -1
  49. package/assets/esri/core/t9n/Units_ja.json +1 -1
  50. package/assets/esri/core/t9n/Units_ko.json +1 -1
  51. package/assets/esri/core/t9n/Units_lt.json +1 -1
  52. package/assets/esri/core/t9n/Units_lv.json +1 -1
  53. package/assets/esri/core/t9n/Units_nl.json +1 -1
  54. package/assets/esri/core/t9n/Units_no.json +1 -1
  55. package/assets/esri/core/t9n/Units_pl.json +1 -1
  56. package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
  57. package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
  58. package/assets/esri/core/t9n/Units_ro.json +1 -1
  59. package/assets/esri/core/t9n/Units_ru.json +1 -1
  60. package/assets/esri/core/t9n/Units_sk.json +1 -1
  61. package/assets/esri/core/t9n/Units_sl.json +1 -1
  62. package/assets/esri/core/t9n/Units_sr.json +1 -1
  63. package/assets/esri/core/t9n/Units_sv.json +1 -1
  64. package/assets/esri/core/t9n/Units_th.json +1 -1
  65. package/assets/esri/core/t9n/Units_tr.json +1 -1
  66. package/assets/esri/core/t9n/Units_uk.json +1 -1
  67. package/assets/esri/core/t9n/Units_vi.json +1 -1
  68. package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
  69. package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
  70. package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
  71. package/assets/esri/core/workers/RemoteClient.js +1 -1
  72. package/assets/esri/core/workers/chunks/{6854b28853f5dd195110.js → 01c70c27aa3a955e2928.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{2dced41ff2aa1bd86665.js → 065dd2fdc834146423c7.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{a0e72b107991ba38a9f0.js → 15920af0c4f46773b06e.js} +1 -1
  75. package/assets/esri/core/workers/chunks/179c9fe4ac83b42e5976.js +1 -0
  76. package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +2 -0
  77. package/assets/esri/core/workers/chunks/{24247ee93f43fff5e596.js.LICENSE.txt → 1d1929f98d941179be29.js.LICENSE.txt} +1 -3
  78. package/assets/esri/core/workers/chunks/1ebb613bbe09fcf274d8.js +1 -0
  79. package/assets/esri/core/workers/chunks/24b43fb12fc3009fdc30.js +1 -0
  80. package/assets/esri/core/workers/chunks/2b9661700743d1f9717e.js +1 -0
  81. package/assets/esri/core/workers/chunks/2f0a3b22fc46d832e240.js +1 -0
  82. package/assets/esri/core/workers/chunks/340f2c996f62f7f5ceae.js +1 -0
  83. package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +2 -0
  84. package/assets/esri/core/workers/chunks/{7485d59d60d61737d662.js → 55b765c72d13b3b911f9.js} +1 -1
  85. package/assets/esri/core/workers/chunks/5cdf87e7a59ace38df87.js +1 -0
  86. package/assets/esri/core/workers/chunks/622bdd1b9d5d292ec12b.js +1 -0
  87. package/assets/esri/core/workers/chunks/{359dbfbfb9acfb18bc6e.js → 63ea4191d441efd2f146.js} +1 -1
  88. package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +2 -0
  89. package/assets/esri/core/workers/chunks/6d20d741b8ae1a45b422.js +1 -0
  90. package/assets/esri/core/workers/chunks/702a3ef9e1b3442cbee7.js +1 -0
  91. package/assets/esri/core/workers/chunks/762e23466308f22d7076.js +1 -0
  92. package/assets/esri/core/workers/chunks/{52219561c144e5cb4442.js → 770611659b38066a6228.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{e90afd914f2ccd4f5374.js → 7ce60331f94ee0a5d674.js} +6 -6
  94. package/assets/esri/core/workers/chunks/7e02e5c6979090fe3ea7.js +1 -0
  95. package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +1 -0
  96. package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +1 -0
  97. package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +1 -0
  98. package/assets/esri/core/workers/chunks/{79dc7045d9a2d43ba8df.js → 890b7a1153b7f65eba9a.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{44636ef119c6a576470b.js → 94eab215bab3e4e0e5b5.js} +1 -1
  100. package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +1 -0
  101. package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +1 -0
  102. package/assets/esri/core/workers/chunks/{fb415b01f0f1d644832d.js → a8ae00e06f98e04aee8e.js} +1 -1
  103. package/assets/esri/core/workers/chunks/aaad0d3e82ed917d3886.js +1 -0
  104. package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +1 -0
  105. package/assets/esri/core/workers/chunks/{39a8e6c9d710d3faea3c.js → b9850fe7dcdaed0c327c.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{f7e386ece75afb6e4be5.js → bc249bb667f0564ad093.js} +1 -1
  107. package/assets/esri/core/workers/chunks/{9b89cc85c1b5d561df7c.js → bd59cb5abc67e46f1b2c.js} +2 -2
  108. package/assets/esri/core/workers/chunks/{a943bd2e6fb7443c2b66.js → be817be7c81fb630122f.js} +1 -1
  109. package/assets/esri/core/workers/chunks/c4872cf3b71d00f450e1.js +1 -0
  110. package/assets/esri/core/workers/chunks/c5ab346a226df1894302.js +1 -0
  111. package/assets/esri/core/workers/chunks/{1e8d5bfc5f8c2664190c.js → d859c046a3ea42530bff.js} +1 -1
  112. package/assets/esri/core/workers/chunks/da29cf0e64065631a470.js +1 -0
  113. package/assets/esri/core/workers/chunks/{7617bd0f3a70dfe61637.js → dcba6c766eee8b90381a.js} +1 -1
  114. package/assets/esri/core/workers/chunks/ddebc1dc10a2d207389f.js +1 -0
  115. package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +1 -0
  116. package/assets/esri/core/workers/chunks/ea2bf7c543cc536400b7.js +30 -0
  117. package/assets/esri/core/workers/chunks/ece30bfd5c49b8d99752.js +1 -0
  118. package/assets/esri/core/workers/chunks/ecf4d07917efc97eb991.js +1 -0
  119. package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +1 -0
  120. package/assets/esri/core/workers/chunks/f52c6efc5a2abf5ac845.js +1 -0
  121. package/assets/esri/core/workers/chunks/f7fe17a22390a24d6df8.js +2 -0
  122. package/assets/esri/core/workers/chunks/f9324420f2c6ac240f63.js +1 -0
  123. package/assets/esri/core/workers/chunks/{855bf811cd79b97c169a.js → fae2c8f053927559fff0.js} +1 -1
  124. package/assets/esri/core/workers/chunks/fc1fe1f58a65a1694c09.js +1 -0
  125. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +84 -1
  126. package/assets/esri/themes/dark/main.css +1 -1
  127. package/assets/esri/themes/light/main.css +1 -1
  128. package/assets/esri/themes/light/view.css +1 -1
  129. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  130. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  131. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  132. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  133. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  134. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  135. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  136. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  137. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  138. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  139. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  140. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  141. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  142. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  143. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  144. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  145. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  146. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  147. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  148. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  149. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  150. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  151. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  152. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  153. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  154. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  155. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  156. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  157. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  158. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  159. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  160. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  161. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  162. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  163. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  164. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  165. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  166. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  167. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  168. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  169. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  170. package/chunks/ComponentShader.glsl.js +11 -15
  171. package/config.js +1 -1
  172. package/core/generatorUtils.js +2 -0
  173. package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
  174. package/core/libs/gl-matrix-2/math/vec2.js +1 -1
  175. package/core/mathUtils.js +1 -1
  176. package/core/typedArrayUtil.js +1 -1
  177. package/geometry/HeightModelInfo.js +1 -1
  178. package/geometry/geometryEngine.d.ts +2 -2
  179. package/geometry/support/buffer/BufferView.js +1 -1
  180. package/geometry/support/vcsData.js +1 -1
  181. package/geometry/support/vcsLookup.js +1 -1
  182. package/kernel.js +1 -1
  183. package/layers/DimensionLayer.d.ts +5 -5
  184. package/layers/FeatureLayer.d.ts +2 -2
  185. package/layers/GaussianSplatLayer.d.ts +3 -3
  186. package/layers/LineOfSightLayer.d.ts +5 -5
  187. package/layers/ParquetLayer.d.ts +6 -4
  188. package/layers/SubtypeGroupLayer.d.ts +2 -2
  189. package/layers/ViewshedLayer.d.ts +3 -3
  190. package/layers/graphics/sources/ParquetSource.js +1 -1
  191. package/layers/graphics/sources/parquet/FileProvider.js +2 -0
  192. package/layers/graphics/sources/parquet/PortalParquetFileProvider.js +2 -0
  193. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +2 -0
  194. package/layers/graphics/sources/parquet/UrlsFileProvider.js +2 -0
  195. package/layers/graphics/sources/parquet/createFileProvider.js +2 -0
  196. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  197. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
  198. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  199. package/layers/raster/datasets/pixelReader.js +1 -1
  200. package/layers/raster/formats/JpgPlus.js +1 -1
  201. package/layers/raster/formats/RasterCodec.js +1 -1
  202. package/layers/raster/functions/clipUtils.js +1 -1
  203. package/layers/support/AggregateField.d.ts +2 -1
  204. package/layers/support/LayerContingentValuesCache.js +1 -1
  205. package/layers/support/SubtypeSublayer.d.ts +4 -4
  206. package/layers/support/parquetUtils.d.ts +18 -7
  207. package/layers/support/parquetUtils.js +1 -1
  208. package/layers/support/rasterFunctionUtils.d.ts +2 -2
  209. package/layers/video/VideoController.js +1 -1
  210. package/libs/parquet/parquet.js +1 -1
  211. package/linkChart/ChronologicalLayoutSettings.d.ts +1 -1
  212. package/networks/CircuitManager.d.ts +3 -3
  213. package/networks/UnitIdentifierManager.d.ts +1 -1
  214. package/networks/UnitIdentifierManager.js +1 -1
  215. package/networks/UtilityNetwork.d.ts +2 -2
  216. package/networks/UtilityNetwork.js +1 -1
  217. package/networks/support/Circuit.d.ts +1 -1
  218. package/networks/support/CircuitLocation.d.ts +1 -1
  219. package/networks/support/CircuitSection.d.ts +1 -1
  220. package/networks/support/Subcircuit.d.ts +1 -1
  221. package/networks/support/TraceJobInfo.js +1 -1
  222. package/networks/support/jsonTypes.d.ts +10 -3
  223. package/package.json +2 -2
  224. package/popup/FieldInfo.d.ts +4 -2
  225. package/popup/support/FieldInfoFormat.d.ts +3 -2
  226. package/rest/featureService/FeatureService.d.ts +1 -1
  227. package/rest/knowledgeGraph/FieldIndex.d.ts +1 -1
  228. package/rest/knowledgeGraph/GraphObjectType.d.ts +2 -2
  229. package/rest/knowledgeGraph/GraphSearch.d.ts +1 -1
  230. package/rest/knowledgeGraph/GraphSearchStreaming.d.ts +1 -1
  231. package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +19 -1
  232. package/rest/networks/circuits/support/ExportCircuitsResult.js +1 -1
  233. package/rest/networks/circuits/support/VerifyCircuitsParameters.d.ts +18 -10
  234. package/rest/networks/circuits/support/VerifyCircuitsParameters.js +1 -1
  235. package/rest/networks/support/TraceParameters.js +1 -1
  236. package/rest/networks/support/TraceResult.js +1 -1
  237. package/rest/networks/trace.js +1 -1
  238. package/rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParameters.js +1 -1
  239. package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
  240. package/rest/support/GeneralizeParameters.d.ts +1 -1
  241. package/rest/support/Query.d.ts +1 -1
  242. package/rest/support/RelationParameters.d.ts +1 -1
  243. package/rest/support/types.d.ts +1 -1
  244. package/support/revision.js +1 -1
  245. package/symbols/CIMSymbol.d.ts +1 -1
  246. package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +1 -0
  247. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  248. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  249. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  250. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  251. package/views/2d/layers/features/sources/strategies/chunks/ParquetSnapshotSourceChunk.js +1 -1
  252. package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +1 -1
  253. package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +1 -0
  254. package/views/3d/analysis/DimensionAnalysisView3D.d.ts +7 -6
  255. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.d.ts +2 -0
  256. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +2 -1
  257. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +5 -1
  258. package/views/3d/analysis/SliceAnalysisView3D.d.ts +4 -3
  259. package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +2 -0
  260. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  261. package/views/3d/analysis/Viewshed/ViewshedInteractionVisuals.js +2 -0
  262. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +2 -0
  263. package/views/3d/analysis/Viewshed/ViewshedPlacementOperation.js +2 -0
  264. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +2 -0
  265. package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +2 -0
  266. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +2 -0
  267. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  268. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  269. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  270. package/views/3d/analysis/Viewshed/ViewshedTool2.js +1 -1
  271. package/views/3d/analysis/Viewshed/analysisViewRegister.js +1 -1
  272. package/views/3d/analysis/Viewshed/placementUtils.js +2 -0
  273. package/views/3d/analysis/Viewshed/toolLifecycleUtils.js +2 -0
  274. package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +1 -1
  275. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  276. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +4 -3
  277. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  278. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  279. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  280. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  281. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  282. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  283. package/views/3d/layers/support/UVWorkspace.js +2 -0
  284. package/views/3d/layers/support/patternUtils.js +1 -1
  285. package/views/3d/layers/support/uvUtils.js +1 -1
  286. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  287. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  288. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  289. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  290. package/views/3d/support/meshProcessing.js +1 -1
  291. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  292. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +8 -8
  293. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +13 -9
  294. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +63 -49
  295. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  296. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  297. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  298. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  299. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  300. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  301. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  302. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  303. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  304. package/views/3d/webgl-engine/materials/PathLayouts.js +2 -0
  305. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  306. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  307. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  308. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  309. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  310. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +2 -3
  311. package/views/PopupView.d.ts +77 -1
  312. package/views/PopupView.js +1 -1
  313. package/views/layers/DimensionLayerView.d.ts +2 -1
  314. package/views/layers/LineOfSightLayerView.d.ts +2 -1
  315. package/views/layers/ViewshedLayerView.d.ts +2 -1
  316. package/webscene/Slide.js +1 -1
  317. package/widgets/Attachments/types.d.ts +1 -1
  318. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +38 -5
  319. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  320. package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +2 -0
  321. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  322. package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
  323. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  324. package/widgets/BatchAttributeForm/css.js +1 -1
  325. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +11 -0
  326. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  327. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +77 -0
  328. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  329. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  330. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  331. package/widgets/BatchAttributeForm/interfaceUtils.js +2 -0
  332. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  333. package/widgets/BatchAttributeForm/types.d.ts +30 -2
  334. package/widgets/BatchAttributeForm.d.ts +52 -1
  335. package/widgets/BatchAttributeForm.js +1 -1
  336. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  337. package/widgets/Editor.d.ts +1 -1
  338. package/widgets/FeatureTable/FieldColumn.js +1 -1
  339. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  340. package/widgets/LayerList/LayerListItem.js +1 -1
  341. package/widgets/TimeSlider.d.ts +3 -3
  342. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +10 -0
  343. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  344. package/widgets/support/ContingentValuesManager.js +1 -1
  345. package/widgets/support/forms/formUtils.js +1 -1
  346. package/assets/esri/core/workers/chunks/11b0d3a825fe50dd1e84.js +0 -1
  347. package/assets/esri/core/workers/chunks/130851b81f04e6a008cd.js +0 -1
  348. package/assets/esri/core/workers/chunks/1a3426276dc82a8a80f2.js +0 -1
  349. package/assets/esri/core/workers/chunks/1c8a21b7b60c0709e6b2.js +0 -1
  350. package/assets/esri/core/workers/chunks/24247ee93f43fff5e596.js +0 -2
  351. package/assets/esri/core/workers/chunks/276cb6a1cdd26d0e1444.js +0 -1
  352. package/assets/esri/core/workers/chunks/2f903bd3a2611e7f0946.js +0 -30
  353. package/assets/esri/core/workers/chunks/2fda38219d778f0447b5.js +0 -1
  354. package/assets/esri/core/workers/chunks/38d7430d2370b69334d7.js +0 -1
  355. package/assets/esri/core/workers/chunks/39d6032d79720935910d.js +0 -1
  356. package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +0 -1
  357. package/assets/esri/core/workers/chunks/642be1619c0e76355cb6.js +0 -1
  358. package/assets/esri/core/workers/chunks/6d66dc77af8d112c33c6.js +0 -1
  359. package/assets/esri/core/workers/chunks/7b3642195d6d3ea9b830.js +0 -1
  360. package/assets/esri/core/workers/chunks/7b66691d133dabd87ce6.js +0 -1
  361. package/assets/esri/core/workers/chunks/7e57029ec958f6423d5d.js +0 -2
  362. package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +0 -1
  363. package/assets/esri/core/workers/chunks/881234f25c7814de8753.js +0 -1
  364. package/assets/esri/core/workers/chunks/8a7682071941c35f05c1.js +0 -1
  365. package/assets/esri/core/workers/chunks/8fdd57e2a0af647f1e3e.js +0 -1
  366. package/assets/esri/core/workers/chunks/90ea570f6b6ce8ca693b.js +0 -1
  367. package/assets/esri/core/workers/chunks/9373daa677dc767d7cf0.js +0 -1
  368. package/assets/esri/core/workers/chunks/95df6d2ebacc43ac5fa3.js +0 -1
  369. package/assets/esri/core/workers/chunks/a02ebdcb802d128c8eee.js +0 -1
  370. package/assets/esri/core/workers/chunks/adf72d87f0114aeade0e.js +0 -1
  371. package/assets/esri/core/workers/chunks/aec4a4cd7044fdbbbe34.js +0 -1
  372. package/assets/esri/core/workers/chunks/b1a21a4d7d73ad7d0e47.js +0 -1
  373. package/assets/esri/core/workers/chunks/b262478da29470abb72b.js +0 -2
  374. package/assets/esri/core/workers/chunks/b75e090a7e935ff870a3.js +0 -1
  375. package/assets/esri/core/workers/chunks/bacf0c9d5d3e084dea61.js +0 -1
  376. package/assets/esri/core/workers/chunks/c0e4fd6fa1d765275248.js +0 -2
  377. package/assets/esri/core/workers/chunks/cfaa6e205bfc0c94a1b1.js +0 -1
  378. package/assets/esri/core/workers/chunks/d3f08f1a9a250cd8a2c8.js +0 -1
  379. package/assets/esri/core/workers/chunks/dcb7a3ff59677b1cf0f1.js +0 -1
  380. /package/assets/esri/core/workers/chunks/{7e57029ec958f6423d5d.js.LICENSE.txt → 549d348ca181d06aefb7.js.LICENSE.txt} +0 -0
  381. /package/assets/esri/core/workers/chunks/{b262478da29470abb72b.js.LICENSE.txt → 69c9eb93553b006b640d.js.LICENSE.txt} +0 -0
  382. /package/assets/esri/core/workers/chunks/{9b89cc85c1b5d561df7c.js.LICENSE.txt → bd59cb5abc67e46f1b2c.js.LICENSE.txt} +0 -0
  383. /package/assets/esri/core/workers/chunks/{c0e4fd6fa1d765275248.js.LICENSE.txt → f7fe17a22390a24d6df8.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import{onLocaleChange as i,getLocale as s,fetchMessageBundle as r}from"../../intl.js";import n from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as h}from"../../core/Evented.js";import c from"../../core/Logger.js";import{watch as d,initial as l,when as m,whenOnce as v}from"../../core/reactiveUtils.js";import{property as p,subclass as u}from"../../core/accessorSupport/decorators.js";import{ensureType as g}from"../../core/accessorSupport/ensureType.js";import f from"../../geometry/Point.js";import{load as w}from"../../geometry/projectionUtils.js";import _ from"../../symbols/PictureMarkerSymbol.js";import{pointSymbolTypes as y}from"../../symbols/support/typeUtils.js";import C from"./support/Conversion.js";import{isValidPoint as b,isSupportedNotation as L}from"./support/coordinateConversionUtils.js";import P from"./support/Format.js";import{generateDefaultFormats as M,setDefaultPatterns as F}from"./support/formatUtils.js";import{GoTo as S}from"../support/GoTo.js";const j=new f([0,0,500]),H="xy",x=["mgrs","utm","usng","dd","dms","ddm"],G="esri__coordinateConversionWidgetState",E={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change",cursor:"cursor"},W="esri/images/search/search-symbol-32.png";let U=class extends(S(h)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.calculateCoordinatePrecision=!0,this.formats=new n,this.formatterAvailable=!1,this.formatterLoading=!0,this.messages=null,this.filteredFormats=new n,this.locationSymbol=new _({url:e(W),width:24,height:24}),this.removeLeadingZeros=!1,this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this.conversions=new n}initialize(){const t=async()=>this.messages=await r("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(M()),t().then(()=>{this.destroyed||(F(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(t=>{t.viewModel=this,this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),E.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),E.formats),this.addHandles(i(()=>{t().then(()=>{F(this.messages,this.formats)})})),w().then(()=>{this.formatterAvailable=!0}).catch(t=>{c.getLogger(this).error(new a("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(d(()=>this.view,this._handleViewChange,l),E.viewChange)).finally(()=>this.formatterLoading=!1),0===this.conversions.length&&this._addDefaultConversion())})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}get conversions(){return this._get("conversions")}set conversions(t){const e=new n;t.forEach(t=>{let o=null;if("string"==typeof t){const e=this.formats.find(e=>e.name===t);e&&(o=new C({format:e}))}else o=g(C,t);o&&e.add(o)}),this._set("conversions",e)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t);break;case"idle":this.removeHandles(E.view),this.removeHandles(E.cursor),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){return"session"===this.storageType?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),t&&(this._locationGraphic=new o({geometry:t.clone(),symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic))}async convert(t,e){if(!b(e))throw new a("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return await this._waitForFormatter(),Promise.resolve().then(()=>t.convert(e))}async goToLocation(t){const{view:e}=this;if(!e)throw new a("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new a("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(E.view),this.view&&(this.removeHandles(E.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||j){return(await A(t,e)).displayCoordinate}resume(){const{mode:t}=this;"capture"===t?this._startCaptureMode():this._startLiveMode()}async reverseConvert(t,e){return await this._waitForFormatter(),e.reverseConvert(t)}async updateConversions(t,e){if(await this._waitForFormatter(),"point"!==e?.type)throw this._clearConversions(this.conversions),new a("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_addDefaultConversion(){const t=this.formats.find(t=>t.name===H)||this.formats.at(0);t&&this.conversions.add(new C({format:t}))}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(E.view),this.removeHandles(E.cursor))}_clearConversions(t){t.forEach(t=>{t.position={location:null,coordinate:null}})}async _convertMany(t,e){return Promise.all(t.map(t=>A(t,e)))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then(t=>{e.position=t,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach(t=>{this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this}),t.removed.forEach(t=>{t.viewModel=null;const e=this.conversions.filter(e=>e.format===t);this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)}),0===this.conversions.length&&this._addDefaultConversion()}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(G));t&&this._setWidgetState(t)}catch(t){c.getLogger(this).error(new a("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(E.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(E.cursor),this.addHandles(this.view.acquireCursor("crosshair","high"),E.cursor),this.addHandles(this.view.on("click",this._onClick),E.view))}_startLiveMode(){this._pointerCount=0,this.removeHandles(E.view),this.view&&(this.removeHandles(E.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],E.view))}_handleViewChange(t,e){e&&e!==t&&this._cleanUpView(e),t&&("capture"===this.mode?this._startCaptureMode():"live"===this.mode&&this._startLiveMode(),e&&this._filterFormatsAndConversions())}_onClick(t){if(0===t.button){const e=this.view?.toMap(t,{exclude:[]}),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{t.formats.forEach(e=>{const o=this.formats.find(t=>t.name===e.name);o&&t.locale===s()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new C({format:o}))})}catch(e){c.getLogger(this).warn(new a("coordinate-conversion:session-storage-read-error","Could not get state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._toJSON();try{this.storage.setItem(G,JSON.stringify({formats:t,locale:s()}))}catch(e){c.getLogger(this).error(new a("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_toJSON(){return this.formats.filter(t=>{const e=t.name;return"xy"===e||"basemap"===e||L(e)}).map(t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex(e=>e.format===t)})).sort((t,e)=>t.index-e.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(m(()=>this.view?.spatialReference,t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter(t=>{const{name:e}=t;return!!T(e)||"xy"===e&&!i}),r=this.filteredFormats.filter(t=>"xy"===t.name&&i&&!this.formats.includes(t)),n=e.filter(t=>s.includes(t.format));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter(t=>!this.filteredFormats.includes(t))),o.addMany(r)},{once:!0,initial:!0}),E.view)}async _waitForFormatter(){this.formatterLoading&&await v(()=>!1===this.formatterLoading)}};async function A(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function T(t){return x.includes(t)}t([p()],U.prototype,"calculateCoordinatePrecision",void 0),t([p()],U.prototype,"conversions",null),t([p({type:f})],U.prototype,"currentLocation",null),t([p({type:n.ofType(P)})],U.prototype,"formats",void 0),t([p()],U.prototype,"formatterLoading",void 0),t([p()],U.prototype,"messages",void 0),t([p()],U.prototype,"mode",null),t([p()],U.prototype,"filteredFormats",void 0),t([p({readOnly:!0})],U.prototype,"state",null),t([p({types:y})],U.prototype,"locationSymbol",void 0),t([p()],U.prototype,"removeLeadingZeros",void 0),t([p({readOnly:!0})],U.prototype,"storage",null),t([p()],U.prototype,"storageEnabled",void 0),t([p()],U.prototype,"storageType",void 0),t([p({readOnly:!0})],U.prototype,"waitingForConversions",null),t([p()],U.prototype,"view",void 0),U=t([u("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],U);const k=U;export{k as default};
2
+ import{__decorate as t}from"tslib";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import{onLocaleChange as i,getLocale as s,fetchMessageBundle as r}from"../../intl.js";import n from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as h}from"../../core/Evented.js";import c from"../../core/Logger.js";import{watch as d,initial as l,when as m,whenOnce as v}from"../../core/reactiveUtils.js";import{property as p,subclass as u}from"../../core/accessorSupport/decorators.js";import{ensureType as g}from"../../core/accessorSupport/ensureType.js";import f from"../../geometry/Point.js";import{load as w}from"../../geometry/projectionUtils.js";import _ from"../../symbols/PictureMarkerSymbol.js";import{pointSymbolTypes as y}from"../../symbols/support/typeUtils.js";import C from"./support/Conversion.js";import{isValidPoint as L,isSupportedNotation as b}from"./support/coordinateConversionUtils.js";import M from"./support/Format.js";import{generateDefaultFormats as P,setDefaultPatterns as F}from"./support/formatUtils.js";import{GoTo as H}from"../support/GoTo.js";const S=new f([0,0,500]),j="xy",U=["mgrs","utm","usng","dd","dms","ddm"],x="esri__coordinateConversionWidgetState",G={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change",cursor:"cursor"},W="esri/images/search/search-symbol-32.png";let E=class extends(H(h)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.calculateCoordinatePrecision=!0,this.formats=new n,this.formatterAvailable=!1,this.formatterLoading=!0,this.messages=null,this.filteredFormats=new n,this.locationSymbol=new _({url:e(W),width:24,height:24}),this.removeLeadingZeros=!1,this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this.conversions=new n}initialize(){const t=async()=>this.messages=await r("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(P()),t().then(()=>{this.destroyed||(F(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(t=>{t.viewModel=this,this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),G.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),G.formats),this.addHandles(d(()=>this.verticalUnit,this._saveWidgetState)),this.addHandles(i(()=>{t().then(()=>{F(this.messages,this.formats)})})),w().then(()=>{this.formatterAvailable=!0}).catch(t=>{c.getLogger(this).error(new a("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(d(()=>this.view,this._handleViewChange,l),G.viewChange)).finally(()=>this.formatterLoading=!1),0===this.conversions.length&&this._addDefaultConversion())})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}get conversions(){return this._get("conversions")}set conversions(t){const e=new n;t.forEach(t=>{let o=null;if("string"==typeof t){const e=this.formats.find(e=>e.name===t);e&&(o=new C({format:e}))}else o=g(C,t);o&&e.add(o)}),this._set("conversions",e)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t);break;case"idle":this.removeHandles(G.view),this.removeHandles(G.cursor),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){return"session"===this.storageType?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),t&&(this._locationGraphic=new o({geometry:t.clone(),symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic))}async convert(t,e){if(!L(e))throw new a("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return await this._waitForFormatter(),Promise.resolve().then(()=>t.convert(e))}async goToLocation(t){const{view:e}=this;if(!e)throw new a("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new a("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(G.view),this.view&&(this.removeHandles(G.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||S){return(await A(t,e)).displayCoordinate}resume(){const{mode:t}=this;"capture"===t?this._startCaptureMode():this._startLiveMode()}async reverseConvert(t,e){return await this._waitForFormatter(),e.reverseConvert(t)}async updateConversions(t,e){if(await this._waitForFormatter(),"point"!==e?.type)throw this._clearConversions(this.conversions),new a("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_addDefaultConversion(){const t=this.formats.find(t=>t.name===j)||this.formats.at(0);t&&this.conversions.add(new C({format:t}))}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(G.view),this.removeHandles(G.cursor))}_clearConversions(t){t.forEach(t=>{t.position={location:null,coordinate:null}})}async _convertMany(t,e){return Promise.all(t.map(t=>A(t,e)))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then(t=>{e.position=t,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach(t=>{this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this}),t.removed.forEach(t=>{t.viewModel=null;const e=this.conversions.filter(e=>e.format===t);this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)}),0===this.conversions.length&&this._addDefaultConversion()}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(x));t&&this._setWidgetState(t)}catch(t){c.getLogger(this).error(new a("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(G.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(G.cursor),this.addHandles(this.view.acquireCursor("crosshair","high"),G.cursor),this.addHandles(this.view.on("click",this._onClick),G.view))}_startIdleMode(){this.removeHandles(G.view),this.removeHandles(G.cursor),this.view&&this.currentLocation&&this.setLocation(this.currentLocation)}_startLiveMode(){this._pointerCount=0,this.removeHandles(G.view),this.view&&(this.removeHandles(G.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],G.view))}_handleViewChange(t,e){if(e&&e!==t&&this._cleanUpView(e),t){const{mode:t}=this;"capture"===t?this._startCaptureMode():"live"===t?this._startLiveMode():"idle"===t&&this._startIdleMode(),e&&this._filterFormatsAndConversions()}}_onClick(t){if(0===t.button){const e=this.view?.toMap(t,{exclude:[]}),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{this.verticalUnit=t.verticalUnit,t.formats.forEach(e=>{const o=this.formats.find(t=>t.name===e.name);o&&t.locale===s()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new C({format:o}))})}catch(e){c.getLogger(this).warn(new a("coordinate-conversion:session-storage-read-error","Could not get state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._getFormatsJson();try{this.storage.setItem(x,JSON.stringify({formats:t,locale:s(),verticalUnit:this.verticalUnit}))}catch(e){c.getLogger(this).error(new a("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_getFormatsJson(){return this.formats.filter(t=>{const e=t.name;return"xy"===e||"basemap"===e||b(e)}).map(t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex(e=>e.format===t)})).sort((t,e)=>t.index-e.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(m(()=>this.view?.spatialReference,t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter(t=>{const{name:e}=t;return!!T(e)||"xy"===e&&!i}),r=this.filteredFormats.filter(t=>"xy"===t.name&&i&&!this.formats.includes(t)),n=e.filter(t=>s.includes(t.format));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter(t=>!this.filteredFormats.includes(t))),o.addMany(r)},{once:!0,initial:!0}),G.view)}async _waitForFormatter(){this.formatterLoading&&await v(()=>!1===this.formatterLoading)}};async function A(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function T(t){return U.includes(t)}t([p()],E.prototype,"calculateCoordinatePrecision",void 0),t([p()],E.prototype,"conversions",null),t([p({type:f})],E.prototype,"currentLocation",null),t([p({type:n.ofType(M)})],E.prototype,"formats",void 0),t([p()],E.prototype,"formatterLoading",void 0),t([p()],E.prototype,"messages",void 0),t([p()],E.prototype,"mode",null),t([p()],E.prototype,"filteredFormats",void 0),t([p({readOnly:!0})],E.prototype,"state",null),t([p({types:y})],E.prototype,"locationSymbol",void 0),t([p()],E.prototype,"removeLeadingZeros",void 0),t([p({readOnly:!0})],E.prototype,"storage",null),t([p()],E.prototype,"storageEnabled",void 0),t([p()],E.prototype,"storageType",void 0),t([p()],E.prototype,"verticalUnit",void 0),t([p({readOnly:!0})],E.prototype,"waitingForConversions",null),t([p()],E.prototype,"view",void 0),E=t([u("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],E);const k=E;export{k as default};
@@ -237,7 +237,7 @@ export interface EditorEvents extends EditorViewModelEvents {}
237
237
  * Select the layer containing the feature to form an association with, then select a feature within that layer.
238
238
  *
239
239
  * The layers and features shown in the list are those that are compatible with the selected feature and
240
- * association type based on [utility network rules](https://pro.arcgis.com/en/pro-app/latest/help/data/utility-network/network-rules.htm).
240
+ * association type based on [utility network rules](https://doc.esri.com/en/arcgis-pro/latest/help/data/utility-network/network-rules.html).
241
241
  *
242
242
  * After choosing a feature to form the association with, settings specific to the association type can be
243
243
  * configured, e.g., midspan location for [connectivity associations](https://pro.arcgis.com/en/pro-app/latest/help/data/utility-network/connectivity.htm).
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{on as i,sync as n}from"../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as a}from"../../editing/fieldUtils.js";import{convertDateFormatToIntlOptions as r,defaultFormatterOptionsNoTime as s,convertDateTimeFieldFormatToIntlOptions as u,defaultFormatterOptions as d}from"../../intl/date.js";import{formatNumber as p,convertNumberFormatToIntlOptions as m,convertNumberFieldFormatToIntlOptions as c}from"../../intl/number.js";import{isEditableLayer as h}from"../../layers/support/editableLayers.js";import{computeDomainFromTypes as f}from"../../layers/support/featureLayerUtils.js";import g from"../../layers/support/Field.js";import{defaultFieldFormat as y}from"../../layers/support/fieldFormatUtils.js";import{validateFieldValue as v,isDateField as F,isTimeOnlyField as b,isIntegerField as _,isNumericField as C,isStringField as D,isDateOnlyField as I,isTimestampOffsetField as x}from"../../layers/support/fieldUtils.js";import{isAnyDateField as V}from"../../smartMapping/support/utils.js";import{system as O}from"../../time/constants.js";import{getTimeZoneFormattingOptions as T}from"../../time/timeZoneUtils.js";import w from"../FeatureForm/FieldInput.js";import E from"./Grid/EditorColumn.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as Z,isEmptyStringOrWhitespace as L}from"./support/tableUtils.js";import{valueIsInRange as j,dateTimeIsInRange as R,getUnixFieldValueFromDateComponents as N,getISOFieldValueFromDateComponents as S,normalizeTimeOnlyString as U,getLabelForDateFieldValue as A,prepareISOFieldValueForDateComponents as q,prepareUnixFieldValueForDateComponents as B}from"../support/dateUtils.js";import{setFocus as H,selectText as k}from"../support/widgetUtils.js";const P={cancelEdit:"Escape"},z=Symbol(),G="esri-column",W={input:`${G}__cell-input`,inputContainer:`${G}__cell__input-container`};let M=class extends E{constructor(e){super(e),this._activeFieldInput=null,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this;if(n&&t){const{index:o,item:{attachments:l,feature:a,relatedRecords:r}}=t;return n({attachments:l,column:this,feature:a,field:this.field,index:o,relatedRecords:r,value:this.sanitizeContent(i),virtualIndex:this.getVirtualRowIndex(e)})}if(null===i)return"&nbsp;";const o=this._getDomainForFeature(t?.item?.feature),l=this._getComputedDomain(i,o)||i;return this._isAnyDateOrTimeField&&"coded-value"!==o?.type?this._formatDateValueForDisplay(this.field,l):this._isNumericField&&"coded-value"!==o?.type?p(parseFloat(l),this._numberFormatOptions):this.sanitizeContent(l)},this.cellValueValidatorFunction=({oldValue:e,value:i})=>{const{_effectiveRange:n,field:o}=this,{max:l,min:a}=n;if(this.effectiveRequired&&(null==i||""===i))return!1;if(this._isNumericField&&(v(o,i)||!j({max:l,min:a,value:i})))return t.getLogger(this).warn("value-exceeds-valid-range","Field value exceeds valid range. Attempted edit was rejected."),!1;if(this._isAnyDateOrTimeField){const e=o.type;if(!R({type:e,range:n,value:i}))return!1}return e!==i},this.field=null,this.formatFunction=null,this.inputRenderFunction=async({root:e,column:i,rowData:n})=>{if(this.editInfo||!this.effectiveEditable||!n)return;const o=n.item.feature,l=o.getObjectId();if(!o||null==l)return;if(this.tableHasInvalidPendingEdits&&!this.itemHasInvalidPendingEdits(l))return void t.getLogger(this).warn("editing-disabled:fix-invalid-pending-edits","Editing is disabled for this row. Table has existing invalid pending edits that must be addressed.");const a=this.getCellValue(n),{field:r}=this;if("big-integer"===r.type&&v(r,a))return void t.getLogger(this).warn("value-exceeds-valid-range","Field value is beyond supported limit. Editing is disabled for this field value.");this._activeFieldInput=this._setUpFieldInput(o,a);const s=document.createElement("div");s.classList.add(W.inputContainer);const u=[],d="coded-value"===this._effectiveDomain?.type;if(this._isAnyDateOrTimeField&&!d){const e=document.createElement("div"),t=this._setUpDateComponents(a),i=this._setUpDateActionBar();t.forEach(t=>e.appendChild(t)),s.appendChild(e),s.appendChild(i),u.push(...t)}else{const e=this.createInputElement({rowData:n,value:a});s.appendChild(e),u.push(e)}this._set("editInfo",{column:i,inputs:u,root:e,rowData:n,oldValue:a}),this.removeCellContent(e),e.appendChild(s),this._syncRowEditingState(e,!0),this.grid?.generateCellPartNames();const p=u[0];await H(p),await k(p)},this.layer=null,this.parseInputValueFunction=({inputs:e})=>{const{editInfo:t,field:i,includeTime:n}=this;if(!t||!e.length)return null;const o=e[0];if(this._isAnyDateOrTimeField){if("coded-value"===this._effectiveDomain?.type){if(null==o.value||""===o.value)return null;const e=String(o.value);return F(i)?parseFloat(e):e}const{timeZone:l}=this.effectiveTimeZoneOptions,a=t.oldValue??void 0;switch(i.type){case"date-only":{const e=o.value;return""!==e?e:null}case"time-only":{const e=U(o.value);return""!==e?e:null}case"timestamp-offset":{const t=n?e[1]:void 0,i=e.at(-1);return S({oldValue:a,dateComponent:o,timeComponent:t,timeZoneComponent:i,defaultTimeZone:l})}case"date":{const{max:t,min:i}=this._effectiveRange;return N({oldValue:a,dateComponent:o,timeComponent:e[1],timeZone:l,max:t,min:i})}}return null}const l=o.value,{effectiveRequired:a}=this;return a||null!=l&&""!==l?this._isNumericField?parseFloat(l):this._isStringField?l.trim():l:null},this.sortable=!0,this.store=null,this.template=null,this.view=null}get _effectiveDomain(){const e=this._activeFieldInput?.feature;return e?this._getDomainForFeature(e):null}get _effectiveRange(){return this._activeFieldInput?.range??{max:null,min:null}}get _isAnyDateOrTimeField(){const{field:e}=this;return V(e)||b(e)}get _isIntegerField(){return _(this.field)}get _isNumericField(){return C(this.field)}get _isStringField(){return D(this.field)}get _isSubtypeField(){const{layer:e}=this;if(e?.subtypeField){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}get _layerWithFieldConfigurations(){const{layer:e}=this;return Z(e)?e:null}get _dateTimeFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?.dateFormat?r(t.format.dateFormat):t?.input&&"includeTime"in t.input&&!1===t.input.includeTime?s:"date-time"===e?.type?u(e):this._isAnyDateOrTimeField?d:void 0}get _numberFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?m(t.format):"number"===e?.type?c(e):this._isNumericField?{useGrouping:!0,maximumFractionDigits:20}:void 0}get alias(){return a(this.field,this._layerWithFieldConfigurations)}get defaultValue(){return this.field?.defaultValue}get effectiveDescription(){const{description:e,field:t}=this,i=t.description,n=L(e)?L(i)?null:i:e;return null==n?null:this.sanitizeLabel(n)}get effectiveEditable(){const{editable:e,field:t,layer:i,tableEditingEnabled:n}=this;if(!t||!i)return!1;const o=h(i),l=i.effectiveCapabilities??i.capabilities,a=l?.operations?.supportsUpdate;return!!(t.editable&&o&&a&&"oid"!==t.type&&n)&&e}get effectiveLabel(){return this.sanitizeLabel(this.label||this.alias||this.fieldName)}get effectiveRequired(){return!this.nullable||this._isSubtypeField||this._activeFieldInput?.required||this.required}get effectiveSortable(){return!(!this.layer?.capabilities?.query?.supportsOrderBy||!this.sortable)}get effectiveTimeZoneOptions(){const{layer:e,field:t}=this;if(!e||"date"!==t?.type&&"timestamp-offset"!==t?.type)return{timeZone:void 0,timeZoneName:void 0};const{tableTimeZone:i,timeZone:n,view:o}=this;return T(e.preferredTimeZone||null,!!e.datesInUnknownTimezone,n??i??o?.timeZone??O,this._dateTimeFormatOptions??d,t.type)}get includeTime(){const{field:e,template:t}=this;return"time-only"===e.type||"date-only"!==e.type&&(!t?.input||"includeTime"in t.input&&!1!==t.input.includeTime)}get hasContingentValues(){return!!this.store.fieldsWithContingentValues?.has(this.fieldName)}get layerFieldConfigurationFormat(){const{_layerWithFieldConfigurations:e}=this;if(e)return e.getFieldConfiguration(this.fieldName)?.fieldFormat??y(this.field)}get maxLength(){const{field:e,template:t}=this,i=e?.length??-1,n=t?.input&&"maxLength"in t.input?t.input.maxLength:null;return null!=n&&!isNaN(n)&&n>=-1&&(-1===i||n<=i)?n:i}get minLength(){const{template:e,maxLength:t}=this,i=e?.input&&"minLength"in e.input?e.input.minLength:null;return t&&i<=t?i:null}get name(){return this.field?.name}get nullable(){return!1!==this.field.nullable}get shouldShowPrompt(){return this._isSubtypeField}createInputElement({rowData:e,value:t}){const{_effectiveDomain:o,maxLength:l,minLength:a,effectiveRequired:r}=this;let s;if("coded-value"===o?.type){const o=e.item.feature,l=this.getFieldValueOptions(o,this.fieldName);this.hasContingentValues?(s=this._setUpComboboxComponent(l,t),this.addHandles([i(()=>s,"calciteComboboxChange",()=>this.onInputBlur(),n),i(()=>s,"pointerdown",e=>e.preventDefault(),n)],z)):(s=this.createCalciteSelect(t,l.recommended),this.addHandles(i(()=>s,"calciteSelectChange",()=>this.onInputBlur(),n),z))}else{if(this._isNumericField){const{_effectiveRange:{max:e,min:i}}=this;s=document.createElement("calcite-input"),s.type="number",this._isIntegerField&&(s.step=1),null!=e&&(s.max=e),null!=i&&(s.min=i),s.status=j({max:e,min:i,value:t})?"idle":"invalid"}else s=document.createElement("calcite-input"),this.addHandles(i(()=>s,"calciteInputChange",()=>this.onInputBlur(),n),z),l>-1&&(s.maxLength=l),a>0&&(s.minLength=a);s.value=null!=t?t.toString():""}return s.classList.add(W.input),s.required=r,this.addHandles([i(()=>s,"keydown",e=>{e.key===P.cancelEdit&&this.onInputBlur(!0)},n),i(()=>s,"blur",()=>this.onInputBlur(),n)],z),s}onInputBlur(e=!1){this.removeHandles(z),super.onInputBlur(e)}onEditComplete(){const e=this.editInfo?.root;e&&this._syncRowEditingState(e,!1),this._activeFieldInput=null,super.onEditComplete()}get test(){}_clearActiveEditValues(){this.editInfo?.inputs?.forEach(e=>e.value="")}_setUpDateActionBar(){const{messagesCommon:e}=this,t=e?.cancel??"",i=e?.clear??"",n=e?.save??"",o=document.createElement("calcite-action-bar");return o.expandDisabled=!0,o.layout="horizontal",o.appendChild(this.createCalciteAction({text:n,icon:"save",onclick:()=>this.submit()})),this.effectiveRequired||o.appendChild(this.createCalciteAction({text:i,icon:"trash",onclick:()=>{this._clearActiveEditValues(),this.submit()}})),o.appendChild(this.createCalciteAction({text:t,icon:"x",onclick:()=>this.cancel()})),o}_formatDateValueForDisplay(e,t){const{timeZone:i,timeZoneName:n}=this.effectiveTimeZoneOptions;return null!=t?A(e,t,{...this._dateTimeFormatOptions,timeZone:i,timeZoneName:n}):null}_fieldValueOptionToComboboxItem({disabled:e,name:t,value:i},n){const o=n===i||null==n&&""===i;return this.createCalciteComboboxItem({disabled:e,heading:t,selected:o,value:i})}_setUpComboboxComponent(e,t){const{recommended:i,other:n,unsupported:o}=e,l=this.effectiveRequired,a=this.messages,r=this.createCalciteCombobox({label:this.effectiveLabel,required:l}),s=i.map(e=>this._fieldValueOptionToComboboxItem(e,t));if(!l||null==t||""===t){const e=this._fieldValueOptionToComboboxItem({disabled:l,name:a?.noValue,value:""},t);r.appendChild(e)}if(0===n.length&&0===o.length)return s.forEach(e=>r.appendChild(e)),r;const u=this.createCalciteComboboxItemGroup({label:a.contingentValues.recommended});if(s.forEach(e=>u.appendChild(e)),r.appendChild(u),n.length){const e=this.createCalciteComboboxItemGroup({label:a.contingentValues.other});n.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}if(o.length){const e=this.createCalciteComboboxItemGroup({label:a.subtypes.unsupportedDomainGroupTitle});o.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}return r}_setUpDateComponents(e){const{_effectiveRange:{max:t,min:n,rawMax:o,rawMin:l},field:a,effectiveRequired:r}=this,s=this._getDateFieldValuesForComponents(a,e),u=[];if(V(a)){const e=this.createDateComponent(),d=I(a)||x(a)?o:t,p=I(a)||x(a)?l:n,m=this._getDateFieldValuesForComponents(a,d??null),c=this._getDateFieldValuesForComponents(a,p??null);e.value=s.date??"",e.max=m.date??"",e.min=c.date??"",e.required=r,this.addHandles([i(()=>e,"calciteInputDatePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if(this.includeTime){const e=this.createTimeComponent();e.value=s.time??"",e.required=r,this.addHandles([i(()=>e,"calciteInputTimePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if("timestamp-offset"===a.type){const e=this.createTimeZoneComponent();e.value=s.timeZoneOffset??"0",this.addHandles([i(()=>e,"calciteInputTimeZoneOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}return u}_onDateComponentOpen(e){this.editInfo?.inputs.forEach(t=>{t!==e&&"open"in t&&(t.open=!1)})}_syncRowEditingState(e,t=!1){const i=this.grid?.getRowContainingNode(e);i&&(t?i.setAttribute("editing","true"):i.removeAttribute("editing"))}_getDateFieldValuesForComponents(e,t){switch(e.type){case"date":return B(t,this.effectiveTimeZoneOptions.timeZone);case"date-only":return{date:t};case"time-only":return{time:t};case"timestamp-offset":return q(t);default:return{}}}_setUpFieldInput(e,t){const{field:i,layer:n,effectiveTimeZoneOptions:{timeZone:o}}=this,l=new w({feature:e,field:i,initialFeature:e.clone(),layer:n,timeZone:o});return l.set("value",t),l}_isDomainCompatible(e){if(!e)return!1;const{_isNumericField:t,_isStringField:i}=this,{type:n}=e;if("coded-value"===n){const n=typeof e.codedValues[0].code;if("string"===n&&i||"number"===n&&t)return!0}return!("range"!==n||!t)}_getDomainForFeature(e){const{fieldName:t,layer:i,template:n}=this;if(!e||!i?.getFieldDomain)return null;if("wfs"===i.type||"geojson"===i.type||"csv"===i.type)return null;if(n?.domain&&this._isDomainCompatible(n.domain))return n.domain;if("feature"!==i.type&&"subtype-group"!==i.type&&null==i.getField(t)?.domain){const e=f(i,t);if(e)return e}return i.getFieldDomain(t,{feature:e})}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const i=t.codedValues.filter(t=>t.hasOwnProperty("code")&&t.code===e);return i&&i.length?i[0].name:e}return null}getFieldValueOptions(e,t){return this.store.getFieldValueOptions({feature:e,fieldName:t,layer:this.layer,emptyString:this.messages?.noValue})}};e([o()],M.prototype,"_effectiveDomain",null),e([o()],M.prototype,"_activeFieldInput",void 0),e([o()],M.prototype,"_effectiveRange",null),e([o()],M.prototype,"_isAnyDateOrTimeField",null),e([o()],M.prototype,"_isIntegerField",null),e([o()],M.prototype,"_isNumericField",null),e([o()],M.prototype,"_isStringField",null),e([o()],M.prototype,"_isSubtypeField",null),e([o()],M.prototype,"_layerWithFieldConfigurations",null),e([o()],M.prototype,"_dateTimeFormatOptions",null),e([o()],M.prototype,"_numberFormatOptions",null),e([o({readOnly:!0})],M.prototype,"alias",null),e([o()],M.prototype,"cellValueFormatFunction",void 0),e([o()],M.prototype,"cellValueValidatorFunction",void 0),e([o({readOnly:!0})],M.prototype,"defaultValue",null),e([o()],M.prototype,"effectiveDescription",null),e([o()],M.prototype,"effectiveEditable",null),e([o()],M.prototype,"effectiveLabel",null),e([o()],M.prototype,"effectiveRequired",null),e([o()],M.prototype,"effectiveSortable",null),e([o()],M.prototype,"effectiveTimeZoneOptions",null),e([o({type:g})],M.prototype,"field",void 0),e([o()],M.prototype,"formatFunction",void 0),e([o()],M.prototype,"includeTime",null),e([o()],M.prototype,"inputRenderFunction",void 0),e([o()],M.prototype,"hasContingentValues",null),e([o()],M.prototype,"layer",void 0),e([o()],M.prototype,"layerFieldConfigurationFormat",null),e([o()],M.prototype,"maxLength",null),e([o()],M.prototype,"minLength",null),e([o({readOnly:!0})],M.prototype,"name",null),e([o({readOnly:!0})],M.prototype,"nullable",null),e([o()],M.prototype,"parseInputValueFunction",void 0),e([o()],M.prototype,"shouldShowPrompt",null),e([o()],M.prototype,"sortable",void 0),e([o()],M.prototype,"store",void 0),e([o()],M.prototype,"template",void 0),e([o()],M.prototype,"view",void 0),M=e([l("esri.widgets.FeatureTable.FieldColumn")],M);const $=M;export{$ as default};
2
+ import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{on as i,sync as n}from"../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as a}from"../../editing/fieldUtils.js";import{convertDateFormatToIntlOptions as r,defaultFormatterOptionsNoTime as s,convertDateTimeFieldFormatToIntlOptions as u,defaultFormatterOptions as d}from"../../intl/date.js";import{formatNumber as p,convertNumberFormatToIntlOptions as m,convertNumberFieldFormatToIntlOptions as c}from"../../intl/number.js";import{isEditableLayer as h}from"../../layers/support/editableLayers.js";import{computeDomainFromTypes as f}from"../../layers/support/featureLayerUtils.js";import g from"../../layers/support/Field.js";import{defaultFieldFormat as y}from"../../layers/support/fieldFormatUtils.js";import{validateFieldValue as v,isDateField as F,isTimeOnlyField as b,isIntegerField as _,isNumericField as C,isStringField as D,isDateOnlyField as I,isTimestampOffsetField as x}from"../../layers/support/fieldUtils.js";import{isAnyDateField as V}from"../../smartMapping/support/utils.js";import{system as O}from"../../time/constants.js";import{getTimeZoneFormattingOptions as T}from"../../time/timeZoneUtils.js";import w from"../FeatureForm/FieldInput.js";import E from"./Grid/EditorColumn.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as Z,isEmptyStringOrWhitespace as L}from"./support/tableUtils.js";import{valueIsInRange as j,dateTimeIsInRange as R,getUnixFieldValueFromDateComponents as N,getISOFieldValueFromDateComponents as S,normalizeTimeOnlyString as U,getLabelForDateFieldValue as A,prepareISOFieldValueForDateComponents as q,prepareUnixFieldValueForDateComponents as B}from"../support/dateUtils.js";import{setFocus as H,selectText as k}from"../support/widgetUtils.js";const P={cancelEdit:"Escape"},z=Symbol(),G="esri-column",W={input:`${G}__cell-input`,inputContainer:`${G}__cell__input-container`};let M=class extends E{constructor(e){super(e),this._activeFieldInput=null,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this;if(n&&t){const{index:o,item:{attachments:l,feature:a,relatedRecords:r}}=t;return n({attachments:l,column:this,feature:a,field:this.field,index:o,relatedRecords:r,value:this.sanitizeContent(i),virtualIndex:this.getVirtualRowIndex(e)})}if(null===i)return"&nbsp;";const o=this._getDomainForFeature(t?.item?.feature),l=this._getComputedDomain(i,o)||i;return this._isAnyDateOrTimeField&&"coded-value"!==o?.type?this._formatDateValueForDisplay(this.field,l):this._isNumericField&&"coded-value"!==o?.type?p(parseFloat(l),this._numberFormatOptions):this.sanitizeContent(l)},this.cellValueValidatorFunction=({oldValue:e,value:i})=>{const{_effectiveRange:n,field:o}=this,{max:l,min:a}=n;if(this.effectiveRequired&&(null==i||""===i))return!1;if(this._isNumericField&&(v(o,i)||!j({max:l,min:a,value:i})))return t.getLogger(this).warn("value-exceeds-valid-range","Field value exceeds valid range. Attempted edit was rejected."),!1;if(this._isAnyDateOrTimeField){const e=o.type;if(!R({type:e,range:n,value:i}))return!1}return e!==i},this.field=null,this.formatFunction=null,this.inputRenderFunction=async({root:e,column:i,rowData:n})=>{if(this.editInfo||!this.effectiveEditable||!n)return;const o=n.item.feature,l=o.getObjectId();if(!o||null==l)return;if(this.tableHasInvalidPendingEdits&&!this.itemHasInvalidPendingEdits(l))return void t.getLogger(this).warn("editing-disabled:fix-invalid-pending-edits","Editing is disabled for this row. Table has existing invalid pending edits that must be addressed.");const a=this.getCellValue(n),{field:r}=this;if("big-integer"===r.type&&v(r,a))return void t.getLogger(this).warn("value-exceeds-valid-range","Field value is beyond supported limit. Editing is disabled for this field value.");this._activeFieldInput=this._setUpFieldInput(o,a);const s=document.createElement("div");s.classList.add(W.inputContainer);const u=[],d="coded-value"===this._effectiveDomain?.type;if(this._isAnyDateOrTimeField&&!d){const e=document.createElement("div"),t=this._setUpDateComponents(a),i=this._setUpDateActionBar();t.forEach(t=>e.appendChild(t)),s.appendChild(e),s.appendChild(i),u.push(...t)}else{const e=this.createInputElement({rowData:n,value:a});s.appendChild(e),u.push(e)}this._set("editInfo",{column:i,inputs:u,root:e,rowData:n,oldValue:a}),this.removeCellContent(e),e.appendChild(s),this._syncRowEditingState(e,!0),this.grid?.generateCellPartNames();const p=u[0];await H(p),await k(p)},this.layer=null,this.parseInputValueFunction=({inputs:e})=>{const{editInfo:t,field:i,includeTime:n}=this;if(!t||!e.length)return null;const o=e[0];if(this._isAnyDateOrTimeField){if("coded-value"===this._effectiveDomain?.type){if(null==o.value||""===o.value)return null;const e=String(o.value);return F(i)?parseFloat(e):e}const{timeZone:l}=this.effectiveTimeZoneOptions,a=t.oldValue??void 0;switch(i.type){case"date-only":{const e=o.value;return""!==e?e:null}case"time-only":{const e=U(o.value);return""!==e?e:null}case"timestamp-offset":{const t=n?e[1]:void 0,i=e.at(-1);return S({oldValue:a,dateComponent:o,timeComponent:t,timeZoneComponent:i,defaultTimeZone:l})}case"date":{const{max:t,min:i}=this._effectiveRange;return N({oldValue:a,dateComponent:o,timeComponent:e[1],timeZone:l,max:t,min:i})}}return null}const l=o.value,{effectiveRequired:a}=this;return a||null!=l&&""!==l?this._isNumericField?parseFloat(l):this._isStringField?l.trim():l:null},this.sortable=!0,this.store=null,this.template=null,this.view=null}get _effectiveDomain(){const e=this._activeFieldInput?.feature;return e?this._getDomainForFeature(e):null}get _effectiveRange(){return this._activeFieldInput?.range??{max:null,min:null}}get _isAnyDateOrTimeField(){const{field:e}=this;return V(e)||b(e)}get _isIntegerField(){return _(this.field)}get _isNumericField(){return C(this.field)}get _isStringField(){return D(this.field)}get _isSubtypeField(){const{layer:e}=this;if(e?.subtypeField){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}get _layerWithFieldConfigurations(){const{layer:e}=this;return Z(e)?e:null}get _dateTimeFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?.dateFormat?r(t.format.dateFormat):t?.input&&"includeTime"in t.input&&!1===t.input.includeTime?s:"date-time"===e?.type?u(e):this._isAnyDateOrTimeField?d:void 0}get _numberFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?m(t.format):"number"===e?.type?c(e):this._isNumericField?{useGrouping:!0,maximumFractionDigits:20}:void 0}get alias(){return a(this.field,this._layerWithFieldConfigurations)}get defaultValue(){return this.field?.defaultValue}get effectiveDescription(){const{description:e,field:t}=this,i=t.description,n=L(e)?L(i)?null:i:e;return null==n?null:this.sanitizeLabel(n)}get effectiveEditable(){const{editable:e,field:t,layer:i,tableEditingEnabled:n}=this;if(!t||!i)return!1;const o=h(i),l=i.effectiveCapabilities??i.capabilities,a=l?.operations?.supportsUpdate;return!!(t.editable&&o&&a&&"oid"!==t.type&&n)&&e}get effectiveLabel(){return this.sanitizeLabel(this.label||this.alias||this.fieldName)}get effectiveRequired(){return!this.nullable||this._isSubtypeField||this._activeFieldInput?.required||this.required}get effectiveSortable(){return!(!this.layer?.capabilities?.query?.supportsOrderBy||!this.sortable)}get effectiveTimeZoneOptions(){const{layer:e,field:t}=this;if(!e||"date"!==t?.type&&"timestamp-offset"!==t?.type)return{timeZone:void 0,timeZoneName:void 0};const{tableTimeZone:i,timeZone:n,view:o}=this;return T(e.preferredTimeZone||null,!!e.datesInUnknownTimezone,n??i??o?.timeZone??O,this._dateTimeFormatOptions??d,t.type)}get includeTime(){const{field:e,template:t}=this;return"time-only"===e.type||"date-only"!==e.type&&(!t?.input||"includeTime"in t.input&&!1!==t.input.includeTime)}get hasContingentValues(){return!!this.store.fieldsWithContingentValues.has(this.fieldName)}get layerFieldConfigurationFormat(){const{_layerWithFieldConfigurations:e}=this;if(e)return e.getFieldConfiguration(this.fieldName)?.fieldFormat??y(this.field)}get maxLength(){const{field:e,template:t}=this,i=e?.length??-1,n=t?.input&&"maxLength"in t.input?t.input.maxLength:null;return null!=n&&!isNaN(n)&&n>=-1&&(-1===i||n<=i)?n:i}get minLength(){const{template:e,maxLength:t}=this,i=e?.input&&"minLength"in e.input?e.input.minLength:null;return t&&i<=t?i:null}get name(){return this.field?.name}get nullable(){return!1!==this.field.nullable}get shouldShowPrompt(){return this._isSubtypeField}createInputElement({rowData:e,value:t}){const{_effectiveDomain:o,maxLength:l,minLength:a,effectiveRequired:r}=this;let s;if("coded-value"===o?.type){const o=e.item.feature,l=this.getFieldValueOptions(o,this.fieldName);this.hasContingentValues?(s=this._setUpComboboxComponent(l,t),this.addHandles([i(()=>s,"calciteComboboxChange",()=>this.onInputBlur(),n),i(()=>s,"pointerdown",e=>e.preventDefault(),n)],z)):(s=this.createCalciteSelect(t,l.recommended),this.addHandles(i(()=>s,"calciteSelectChange",()=>this.onInputBlur(),n),z))}else{if(this._isNumericField){const{_effectiveRange:{max:e,min:i}}=this;s=document.createElement("calcite-input"),s.type="number",this._isIntegerField&&(s.step=1),null!=e&&(s.max=e),null!=i&&(s.min=i),s.status=j({max:e,min:i,value:t})?"idle":"invalid"}else s=document.createElement("calcite-input"),this.addHandles(i(()=>s,"calciteInputChange",()=>this.onInputBlur(),n),z),l>-1&&(s.maxLength=l),a>0&&(s.minLength=a);s.value=null!=t?t.toString():""}return s.classList.add(W.input),s.required=r,this.addHandles([i(()=>s,"keydown",e=>{e.key===P.cancelEdit&&this.onInputBlur(!0)},n),i(()=>s,"blur",()=>this.onInputBlur(),n)],z),s}onInputBlur(e=!1){this.removeHandles(z),super.onInputBlur(e)}onEditComplete(){const e=this.editInfo?.root;e&&this._syncRowEditingState(e,!1),this._activeFieldInput=null,super.onEditComplete()}get test(){}_clearActiveEditValues(){this.editInfo?.inputs?.forEach(e=>e.value="")}_setUpDateActionBar(){const{messagesCommon:e}=this,t=e?.cancel??"",i=e?.clear??"",n=e?.save??"",o=document.createElement("calcite-action-bar");return o.expandDisabled=!0,o.layout="horizontal",o.appendChild(this.createCalciteAction({text:n,icon:"save",onclick:()=>this.submit()})),this.effectiveRequired||o.appendChild(this.createCalciteAction({text:i,icon:"trash",onclick:()=>{this._clearActiveEditValues(),this.submit()}})),o.appendChild(this.createCalciteAction({text:t,icon:"x",onclick:()=>this.cancel()})),o}_formatDateValueForDisplay(e,t){const{timeZone:i,timeZoneName:n}=this.effectiveTimeZoneOptions;return null!=t?A(e,t,{...this._dateTimeFormatOptions,timeZone:i,timeZoneName:n}):null}_fieldValueOptionToComboboxItem({disabled:e,name:t,value:i},n){const o=n===i||null==n&&""===i;return this.createCalciteComboboxItem({disabled:e,heading:t,selected:o,value:i})}_setUpComboboxComponent(e,t){const{recommended:i,other:n,unsupported:o}=e,l=this.effectiveRequired,a=this.messages,r=this.createCalciteCombobox({label:this.effectiveLabel,required:l}),s=i.map(e=>this._fieldValueOptionToComboboxItem(e,t));if(!l||null==t||""===t){const e=this._fieldValueOptionToComboboxItem({disabled:l,name:a?.noValue,value:""},t);r.appendChild(e)}if(0===n.length&&0===o.length)return s.forEach(e=>r.appendChild(e)),r;const u=this.createCalciteComboboxItemGroup({label:a.contingentValues.recommended});if(s.forEach(e=>u.appendChild(e)),r.appendChild(u),n.length){const e=this.createCalciteComboboxItemGroup({label:a.contingentValues.other});n.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}if(o.length){const e=this.createCalciteComboboxItemGroup({label:a.subtypes.unsupportedDomainGroupTitle});o.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}return r}_setUpDateComponents(e){const{_effectiveRange:{max:t,min:n,rawMax:o,rawMin:l},field:a,effectiveRequired:r}=this,s=this._getDateFieldValuesForComponents(a,e),u=[];if(V(a)){const e=this.createDateComponent(),d=I(a)||x(a)?o:t,p=I(a)||x(a)?l:n,m=this._getDateFieldValuesForComponents(a,d??null),c=this._getDateFieldValuesForComponents(a,p??null);e.value=s.date??"",e.max=m.date??"",e.min=c.date??"",e.required=r,this.addHandles([i(()=>e,"calciteInputDatePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if(this.includeTime){const e=this.createTimeComponent();e.value=s.time??"",e.required=r,this.addHandles([i(()=>e,"calciteInputTimePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if("timestamp-offset"===a.type){const e=this.createTimeZoneComponent();e.value=s.timeZoneOffset??"0",this.addHandles([i(()=>e,"calciteInputTimeZoneOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}return u}_onDateComponentOpen(e){this.editInfo?.inputs.forEach(t=>{t!==e&&"open"in t&&(t.open=!1)})}_syncRowEditingState(e,t=!1){const i=this.grid?.getRowContainingNode(e);i&&(t?i.setAttribute("editing","true"):i.removeAttribute("editing"))}_getDateFieldValuesForComponents(e,t){switch(e.type){case"date":return B(t,this.effectiveTimeZoneOptions.timeZone);case"date-only":return{date:t};case"time-only":return{time:t};case"timestamp-offset":return q(t);default:return{}}}_setUpFieldInput(e,t){const{field:i,layer:n,effectiveTimeZoneOptions:{timeZone:o}}=this,l=new w({feature:e,field:i,initialFeature:e.clone(),layer:n,timeZone:o});return l.set("value",t),l}_isDomainCompatible(e){if(!e)return!1;const{_isNumericField:t,_isStringField:i}=this,{type:n}=e;if("coded-value"===n){const n=typeof e.codedValues[0].code;if("string"===n&&i||"number"===n&&t)return!0}return!("range"!==n||!t)}_getDomainForFeature(e){const{fieldName:t,layer:i,template:n}=this;if(!e||!i?.getFieldDomain)return null;if("wfs"===i.type||"geojson"===i.type||"csv"===i.type)return null;if(n?.domain&&this._isDomainCompatible(n.domain))return n.domain;if("feature"!==i.type&&"subtype-group"!==i.type&&null==i.getField(t)?.domain){const e=f(i,t);if(e)return e}return i.getFieldDomain(t,{feature:e})}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const i=t.codedValues.filter(t=>t.hasOwnProperty("code")&&t.code===e);return i&&i.length?i[0].name:e}return null}getFieldValueOptions(e,t){return this.store.getFieldValueOptions({feature:e,fieldName:t,layer:this.layer,emptyString:this.messages?.noValue})}};e([o()],M.prototype,"_effectiveDomain",null),e([o()],M.prototype,"_activeFieldInput",void 0),e([o()],M.prototype,"_effectiveRange",null),e([o()],M.prototype,"_isAnyDateOrTimeField",null),e([o()],M.prototype,"_isIntegerField",null),e([o()],M.prototype,"_isNumericField",null),e([o()],M.prototype,"_isStringField",null),e([o()],M.prototype,"_isSubtypeField",null),e([o()],M.prototype,"_layerWithFieldConfigurations",null),e([o()],M.prototype,"_dateTimeFormatOptions",null),e([o()],M.prototype,"_numberFormatOptions",null),e([o({readOnly:!0})],M.prototype,"alias",null),e([o()],M.prototype,"cellValueFormatFunction",void 0),e([o()],M.prototype,"cellValueValidatorFunction",void 0),e([o({readOnly:!0})],M.prototype,"defaultValue",null),e([o()],M.prototype,"effectiveDescription",null),e([o()],M.prototype,"effectiveEditable",null),e([o()],M.prototype,"effectiveLabel",null),e([o()],M.prototype,"effectiveRequired",null),e([o()],M.prototype,"effectiveSortable",null),e([o()],M.prototype,"effectiveTimeZoneOptions",null),e([o({type:g})],M.prototype,"field",void 0),e([o()],M.prototype,"formatFunction",void 0),e([o()],M.prototype,"includeTime",null),e([o()],M.prototype,"inputRenderFunction",void 0),e([o()],M.prototype,"hasContingentValues",null),e([o()],M.prototype,"layer",void 0),e([o()],M.prototype,"layerFieldConfigurationFormat",null),e([o()],M.prototype,"maxLength",null),e([o()],M.prototype,"minLength",null),e([o({readOnly:!0})],M.prototype,"name",null),e([o({readOnly:!0})],M.prototype,"nullable",null),e([o()],M.prototype,"parseInputValueFunction",void 0),e([o()],M.prototype,"shouldShowPrompt",null),e([o()],M.prototype,"sortable",void 0),e([o()],M.prototype,"store",void 0),e([o()],M.prototype,"template",void 0),e([o()],M.prototype,"view",void 0),M=e([l("esri.widgets.FeatureTable.FieldColumn")],M);const $=M;export{$ as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as i,isSome as s}from"../../../core/arrayUtils.js";import n from"../../../core/Collection.js";import a from"../../../core/Error.js";import{clone as o}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{getOrCreateMapValue as h}from"../../../core/MapUtils.js";import{removeMaybe as u,abortMaybe as d}from"../../../core/maybe.js";import{ignoreAbortErrors as p,throwIfAborted as c}from"../../../core/promiseUtils.js";import y from"../../../core/ReactiveMap.js";import{watch as g,when as _,syncAndInitial as m,sync as f}from"../../../core/reactiveUtils.js";import{property as b,subclass as E}from"../../../core/accessorSupport/decorators.js";import{geometryTypes as v}from"../../../geometry/support/typeUtils.js";import{isFeatureLayer as C,isSubtypeGroupLayer as I,isSubtypeSublayer as w}from"../../../layers/support/layerUtils.js";import O from"../../../rest/support/AttachmentQuery.js";import F from"../../../rest/support/RelationshipQuery.js";import A from"../../../time/TimeExtent.js";import j from"../../../views/SelectionManager.js";import{temporaryHighlightName as S}from"../../../views/support/HighlightDefaults.js";import{highlightsSupported as q}from"../../../views/support/layerViewUtils.js";import{isSelectableLayerWithObjectIds as M,isSelectableLayer as R}from"../../../views/support/selectionUtils.js";import{isIFeatureTableSupportedLayerWithAttachments as Q,isIFeatureTableSupportedLayerWithAttachmentsEditing as V,isIFeatureTableSupportedLayerWithEditing as H,isIFeatureTableSupportedLayerWithRelationships as W,isPageIndexValid as P,findRelatedLayer as z}from"./tableUtils.js";import L from"../../support/ContingentValuesManager.js";let B=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new n,this._contingentValuesManager=new L,this._defaultOutFields=["*"],this._editOperationQueue=new n,this.featureTitleMap=new y,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new n,this._pendingEditsCache=new y,this._queryOperationQueue=new n,this._size=0,this._temporaryHighlight=null,this._temporaryHighlightAbortController=null,this.attachmentsEnabled=!1,this.autoSaveEnabled=!0,this.defaultSelectionManager=new j,this.editingEnabled=!1,this.failures=new n,this.filterByViewExtent=!1,this.filterGeometry=null,this.highlightEnabled=!0,this.initialSize=null,this.layer=null,this.maxSize=null,this.objectIds=null,this.outFields=null,this.pageCache=new y,this.pageSize=50,this.paginationEnabled=!1,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.selectionManager=null,this.sortOrders=[],this.syncViewSelection=!1,this.temporaryHighlightId=void 0,this.timeExtent=null,this.timeZone=null,this.view=null,this.where=null}initialize(){this.addHandles([g(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),g(()=>this.orderByFields,()=>this._clearCaches(),{equals:i}),_(()=>this.attachmentsEnabled,()=>this._reset()),_(()=>this.relatedRecordsEnabled,()=>this._reset()),g(()=>this._layerWithContingentValues,e=>{const t=this._contingentValuesManager;e&&!t.layers.includes(e)&&t.layers.add(e)}),g(()=>[this.view?.extent,this.view?.stationary,this.filterByViewExtent],([e,t,r])=>{r&&(e?t&&(this.filterGeometry=e):this.filterGeometry=null)},m),g(()=>this.maxSize,(e,t)=>{0===t&&this._reset()}),g(()=>[this.layer,this.view],()=>this.syncSelectionSources(),m),g(()=>this.highlightEnabled,e=>this.defaultSelectionManager.highlightEnabled=e,m),g(()=>this.temporaryHighlightId,e=>{this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController;const t=this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal);p(this.view?.addUpdatingPromise(t)??t)},f)])}destroy(){this.layer=null,this.itemCache.destroy(),this.failures.destroy(),this.defaultSelectionManager.destroy(),this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=d(this._temporaryHighlightAbortController)}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _canSavePendingEdits(){return this.supportsEditing&&this.hasPendingEdits&&!this.hasInvalidPendingEdits}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&Q(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&V(e)&&this.supportsEditing?e:null}get _layerWithContingentValues(){const{layer:e}=this;return C(e)||I(e)?e:null}get _layerWithEditing(){const e=this.layer;return H(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return W(e)&&this.supportsQueryRelated?e:null}get _pendingEditsAreInvalid(){const e=this._pendingEditsCache,t=this._layerWithContingentValues;if(!t)return!1;for(const r of e.keys()){const i=e.get(r),s=this._getFeatureWithPendingEdits(r,i);for(const e of i.changes.keys()){if(this._contingentValuesManager.getViolationForField(t,s,e))return!0}}return!1}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return I(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:i}=this;if("loaded"!==e||!t||!r||!i)return!1;const{cardinality:s,role:n}=t,a=this.size>0;return("one-to-one"!==s||!a)&&("one-to-many"!==s||"origin"!==n||!a)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const i=e.fieldsIndex.normalizeFieldName(t);i&&r.push(i)});const{objectIdField:i}=e,s=e.fieldsIndex.normalizeFieldName(i)??i;return s&&!r.includes(s)&&r.unshift(s),r}get effectiveSelectionManager(){const{layer:e,view:t}=this;return e&&this.syncViewSelection&&M(e)&&t?.selectionManager?.sources.includes(e)?t.selectionManager:this.selectionManager??this.defaultSelectionManager}get effectiveSize(){const{_size:e,maxSize:t}=this;return null!=t?Math.min(t,e):e}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:w(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get fieldsWithContingentValues(){const e=this._layerWithContingentValues;return e?this._contingentValuesManager.fieldsWithContingentValues.get(e):void 0}get hasContingentValues(){const e=this.fieldsWithContingentValues;return!!(e&&e.size>0)}get hasInvalidPendingEdits(){return this.hasPendingEdits&&this._pendingEditsAreInvalid}get hasPendingEdits(){return this.pendingEditsCount>0}get highlightableLayerView(){const e=this.layerView;return q(e)?e:null}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new n({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||w(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,i=r.filter(({fieldName:t,direction:r},i)=>e.indexOf(t)===i&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!i.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&i.push(`${r} ASC`)}}return i}get pageCount(){const{effectiveSize:e,pageSize:t}=this;return 0===e||0===t?1:Math.ceil(e/t)}get pageIndex(){return this._get("pageIndex")||0}set pageIndex(e){const{pageCount:t}=this;P(e,t)&&this._set("pageIndex",e)}get pendingEditsCount(){let e=0;return this._pendingEditsCache.forEach(t=>e+=t.changes.size),e}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:i}=this,s=[];return t&&e?.loaded&&i?.map&&r?.length?(r.forEach(t=>{const r=z(e,i,t);r&&(r.load(),s.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),s):s}get relationships(){return this._layerWithRelationships?.relationships}get size(){return this._size}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:i}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":i?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(i)}addPendingEdits(e){const t=this._ensureLayerAndUpdateSupport();this.editingEnabled?(this.autoSaveEnabled&&this._logWarning("store:pending-edit","Edit will be cached, but 'autoSaveEnabled' is true.",!0),this._stashPendingEdits(t,e)):this._logWarning("store:editing-disabled","Editing is disabled.")}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsUpdateAttachments||!t.length)return[];const i=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(i)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new a("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(s),i=this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}));return e.forEach(e=>this.featureTitleMap.delete(e)),i}discardPendingEdits(e){if(e?.length)e.forEach(e=>this._discardPendingEdit(e));else{for(const[e,t]of this._pendingEditsCache){const r=this.getItemByObjectId(e);r&&(r.feature=t.originalFeature)}this._pendingEditsCache.clear(),this._clearOptionsAndViolations()}}itemHasInvalidPendingEdits(e,t){if(!this.hasInvalidPendingEdits)return!1;const r=this._layerWithContingentValues,i=this._pendingEditsCache.get(e);if(!r||!i)return!1;const s=this._getFeatureWithPendingEdits(e,i),n=this._contingentValuesManager;return t?!!n.getViolationForField(r,s,t):!!n.getAllViolations(r,s)}itemHasPendingEdits(e,t){const r=this._pendingEditsCache.get(e);return!!r&&(!t||r.changes.has(t))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,i=t*r,s=i+r,{layer:n,state:a}=this;return n&&"loaded"===a&&0!==this.maxSize?this._query({layer:n,start:i,num:s,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getFieldValueOptions(e){return this._contingentValuesManager.getFieldValueOptions(e)}async getFeatureTitle(e,r=!1){const{layer:i}=this,s=this.featureTitleMap.get(e),n=`${e}`;if(!i)return s||n;if(s&&!r)return s;if(!("getFeatureTitle"in i)||!i.getFeatureTitle)return n;const a=this.getItemByObjectId(e);let o=a?.feature;o||(o=new t({attributes:{[i.objectIdField]:e},origin:i.graphicOrigin}));const l=await i.getFeatureTitle(o,{fetchMissingFields:!0,removeHTML:!0});return l?(this.featureTitleMap.set(e,l),l):n}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,i=t.entries();let s=-1;for(const[n,a]of i)if(a.some((t,i)=>{const a=t.objectId===e;return a&&(s=n*r+i),a}),s>-1)break;return s}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&I(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncSize(e),await this._syncObjectIdCache(),this._syncPendingEdits()}reset(){this._reset()}async savePendingEdits(){if(!this.hasPendingEdits)return;if(!this._canSavePendingEdits)return void this._logError("store:update-error","An error occurred. Unable to save pending edits.");const e=[];for(const[t]of this._pendingEditsCache){const r=this.getItemByObjectId(t);r?.feature&&e.push(r.feature)}await this._savePendingEdits(e),this._clearOptionsAndViolations()}syncSelectionSources(){const{defaultSelectionManager:e,layer:t,view:r}=this;e.view=r,e.sources.removeAll(),R(t)&&(e.sources.items=[t])}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:i}=this;if(!i||!this.supportsUpdateAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>i.updateAttachment(this._createBaseGraphic(i,e),t,r));return this._ensureArrayContent(s)}async updateItem(e){const t=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled)return void this._logWarning("store:editing-disabled","Editing is disabled.");if(this.hasContingentValues){const t=e.updates.some(e=>this.fieldsWithContingentValues?.has(e.fieldName)),r=this.itemHasPendingEdits(e.objectId);if(r||t){const t=this._layerWithContingentValues,i=this.getItemByObjectId(e.objectId)?.feature?.clone();if(i){const s=this._contingentValuesManager.getAllViolations(t,i);e.updates.forEach(({fieldName:e,value:r})=>{const s=t.getField(e);s&&(i.attributes[s.name]=r)});if(this._contingentValuesManager.validateContingencyConstraints(t,i).length||s.length||r)return this._stashPendingEdits(t,[e]),void this._contingentValuesManager.resetOptionsForLayer(t)}}}if(!this.autoSaveEnabled)return void this._stashPendingEdits(t,[e]);const{_sortedFieldNames:r}=this,i=e.updates.map(({fieldName:e})=>e);!(await this._update(t,e)).updateFeatureResults.find(e=>e.error)&&i.some(e=>r.includes(e))&&this._clearCaches()}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:i}=t,s=await this._queryFeaturesByObjectId(e);return e.map(e=>s.some(t=>{const r=t.getObjectId()??t.attributes[i];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const i=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(i.attributes[this._subtypeField]=this._subtypeCode),i}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){l.getLogger(this).error(e,t)}_logWarning(e,t,r=!1){r?l.getLogger(this).warnOnce(e,t):l.getLogger(this).warn(e,t)}_reset(){this._clearCaches(),this._pendingEditsCache.clear(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this.featureTitleMap.clear(),this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=d(this._temporaryHighlightAbortController),this._loading=!1,this._loaded=!1,this._loadError=!1,this._size=0}async _syncSize(e){0!==this.maxSize?this._size=e??await this._queryCount():this._size=0}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _queryFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new a("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:i,orderByFields:s,supportsCacheHint:n,supportsOrderBy:o}=this,l=t.createQuery();l.where=i,l.timeExtent=r,l.returnGeometry=!1,l.objectIds=e.length?e:void 0,l.outFields=[t.objectIdField],o&&(l.orderByFields=s),n&&(l.cacheHint=!0);return(await t.queryFeatures(l)).features}async _syncTemporaryHighlight(e,t){const{highlightEnabled:r,highlightableLayerView:i}=this;i&&r&&null!=e&&(c(t),this._temporaryHighlight={id:e,handle:i.highlight(e,{name:S})})}_ensureLayerAndUpdateSupport(){const e=this._layerWithEditing;if(!this.supportsUpdate||!e)throw new a("store:update-error","Update is not supported.");return e}_stashPendingEdits(e,t){t.forEach(({objectId:t,updates:r})=>{const i=this.getItemByObjectId(t)?.feature;if(!i)throw new a("store:update-error","Feature with provided 'objectId' not found.");const s=i.clone(),n=h(this._pendingEditsCache,t,()=>({originalFeature:s,changes:new y}));r.forEach(({fieldName:t,value:r})=>{const s=e.getField(t);s?(n.changes.set(s.name,r),i.attributes[s.name]=r):this._logWarning("store:pending-edit-unknown-field","The provided field does not belong to this layer.")}),n.changes.size>0&&this._pendingEditsCache.set(t,n)})}_syncPendingEdits(){for(const[e,t]of this._pendingEditsCache){const r=this.getItemByObjectId(e)?.feature;if(r){const e=r.clone();for(const[i,s]of t.changes)r.attributes[i]=s;t.originalFeature=e}}}_getFeatureWithPendingEdits(e,t){let r=this.getItemByObjectId(e)?.feature;if(!r){r=t.originalFeature.clone();for(const[e,i]of t.changes)r.attributes[e]=i}return r}_discardPendingEdit({objectId:e,fieldName:t}){const r=this._pendingEditsCache.get(e);if(!r)return void this._logWarning("store:pending-edit-not-found","Could not find a pending edit with the given information");const i=this.getItemByObjectId(e);t?(i&&(i.feature.attributes[t]=r.originalFeature.attributes[t]),r.changes.delete(t),0===r.changes.size&&this._pendingEditsCache.delete(e)):(i&&(i.feature=r.originalFeature),this._pendingEditsCache.delete(e))}_clearOptionsAndViolations(){const{_layerWithContingentValues:e,_contingentValuesManager:t}=this;e&&(t.resetOptionsForLayer(e),t.resetViolationsForLayer(e))}async _update(e,r){const{objectId:i,updates:s}=r,n=this.getItemByObjectId(i)?.feature;if(!n)throw new a("store:update-error","Feature with provided 'objectId' not found.");const l=o(n.attributes);s.forEach(({fieldName:e,value:t})=>l[e]=t);const h=new t({attributes:l,sourceLayer:n.sourceLayer}),u=e.applyEdits({updateFeatures:[h]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(n.attributes=l,this.featureTitleMap.has(i)&&this.getFeatureTitle(i,!0)),e});return this._queueEditOperation(()=>u)}async _savePendingEdits(e){const{_layerWithEditing:t}=this;if(!this.supportsUpdate||!t)throw new a("store:update-error","Update is not supported.");const r=t.applyEdits({updateFeatures:e}).then(e=>{const{updateFeatureResults:t}=e,r=t.filter(e=>!!e.error);if(r.length)throw this.discardPendingEdits(),r[0].error;return e});return this._queueEditOperation(()=>r,!0)}_createFeatureStoreItems(e){const{attachments:t,features:r,layer:i,relatedRecords:s}=e,n=i.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[n],a=[];e.layer||e.sourceLayer||(e.layer=i,e.sourceLayer=i);const o=this._pendingEditsCache.get(r);if(o){const t=e.clone(),r=o.changes;for(const[i,s]of r)e.attributes[i]=s;o.originalFeature=t}return s.forEach((e,t)=>{a.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:a}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const i=this.pageCache.get(t);if(i)return i;const s=await this._queryPage(e);return this.pageCache.set(t,s),s}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new a("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new O({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:i}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:i,relationshipId:s}=r;return(await i.queryRelatedFeaturesCount(new F({cacheHint:e,relationshipId:s,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:s,effectiveWhere:n,filterGeometry:a,objectIds:o}=this,l=t.createQuery();return l.geometry=a,l.returnGeometry=!1,l.where=n,l.timeExtent=s,l.objectIds=o?.length?o:void 0,i&&(l.cacheHint=!0),t.queryFeatureCount(l)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:i,effectiveOutFields:s,effectiveTimeExtent:n,effectiveWhere:a,filterGeometry:o,objectIds:l,orderByFields:h,pageSize:u,returnGeometry:d,supportsCacheHint:p,supportsOrderBy:c,supportsPagination:y}=this,{layer:g,start:_}=e,m=l?.length,f=g.createQuery();f.returnGeometry=d,f.outFields=s,f.returnM=r,f.returnZ=i,y?(f.start=_,f.num=u,f.where=a,f.timeExtent=n,f.objectIds=m?l:void 0):f.objectIds=m?l:this._getObjectIdsForPage(_,u??0),c&&(f.orderByFields=h),o&&(f.geometry=o),p&&(f.cacheHint=!0);return(await g.queryFeatures(f)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:i,objectIds:s,orderByFields:n,supportsCacheHint:a,supportsOrderBy:o}=this;if(!i)return Promise.resolve([]);const l=i.createQuery();return l.geometry=r,l.outFields=[i.objectIdField],l.returnGeometry=!1,l.where=t,l.timeExtent=e,l.objectIds=s?.length?s:void 0,o&&(l.orderByFields=n),a&&(l.cacheHint=!0),i.queryObjectIds(l)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),i=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),s=await this._queryAttachments(i),n=await this._queryRelatedCounts(i);return this._createFeatureStoreItems({layer:t,features:r,attachments:s,relatedRecords:n})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:i}=this,s=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const n=await t.queryRelatedFeaturesCount(new F({cacheHint:i,relationshipId:r,objectIds:e}));s.set(r,n)})),s):s}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:i,_effectiveReturnZ:s,orderByFields:n,pageSize:a,returnGeometry:o,supportsCacheHint:l}=this,{layer:h,start:u}=e,{objectId:d,relatedLayer:p,relationshipId:c}=t,y=h.createQuery(),g=new F({cacheHint:l,num:a,objectIds:[d],orderByFields:n,outFields:r,relationshipId:c,returnGeometry:o,returnM:i,returnZ:s,start:u,where:y.where??void 0}),_=await p.queryRelatedFeatures(g);return _[d]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const i=this._ensureArray(r),s=i.some(e=>e.error),n=this.getItemByObjectId(e);if(n&&(!s||i.length>1)){const t=await this._queryAttachments([e]);n.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const i={error:r,retry:()=>{this.failures.remove(i),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(i)};throw this.failures.add(i),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e,t=!1){return this._editOperationQueue.push(e),e().then(r=>(this._editOperationQueue.remove(e),t&&this._pendingEditsCache.clear(),r)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([b()],B.prototype,"_attachmentsOperationQueue",void 0),e([b({readOnly:!0})],B.prototype,"_capabilities",null),e([b()],B.prototype,"_canSavePendingEdits",null),e([b()],B.prototype,"_contingentValuesManager",void 0),e([b()],B.prototype,"_defaultOutFields",void 0),e([b()],B.prototype,"_editOperationQueue",void 0),e([b()],B.prototype,"_effectiveReturnZ",null),e([b()],B.prototype,"_effectiveReturnM",null),e([b()],B.prototype,"featureTitleMap",void 0),e([b({readOnly:!0})],B.prototype,"_layerWithAttachments",null),e([b({readOnly:!0})],B.prototype,"_layerWithAttachmentsEditing",null),e([b()],B.prototype,"_layerWithContingentValues",null),e([b({readOnly:!0})],B.prototype,"_layerWithEditing",null),e([b({readOnly:!0})],B.prototype,"_layerWithRelationships",null),e([b()],B.prototype,"_loaded",void 0),e([b()],B.prototype,"_loadError",void 0),e([b()],B.prototype,"_loading",void 0),e([b()],B.prototype,"_objectIdCache",void 0),e([b()],B.prototype,"_pendingEditsCache",void 0),e([b()],B.prototype,"_pendingEditsAreInvalid",null),e([b()],B.prototype,"_queryOperationQueue",void 0),e([b({readOnly:!0})],B.prototype,"_relatedLayer",null),e([b({readOnly:!0})],B.prototype,"_relatedLayerCapabilities",null),e([b({readOnly:!0})],B.prototype,"_relatedLayerSupportsCacheHint",null),e([b()],B.prototype,"_relatedLayerSupportsQuery",null),e([b()],B.prototype,"_relatedLayerSupportsQueryRelated",null),e([b()],B.prototype,"_size",void 0),e([b()],B.prototype,"_sortedFieldNames",null),e([b()],B.prototype,"_subtypeCode",null),e([b()],B.prototype,"_subtypeField",null),e([b()],B.prototype,"_canUseRelatedLayer",null),e([b()],B.prototype,"attachmentsEnabled",void 0),e([b()],B.prototype,"autoSaveEnabled",void 0),e([b()],B.prototype,"canAddRelatedFeature",null),e([b()],B.prototype,"defaultSelectionManager",void 0),e([b()],B.prototype,"editingEnabled",void 0),e([b()],B.prototype,"effectiveOutFields",null),e([b()],B.prototype,"effectiveSelectionManager",null),e([b()],B.prototype,"effectiveSize",null),e([b()],B.prototype,"effectiveTimeExtent",null),e([b()],B.prototype,"effectiveWhere",null),e([b({readOnly:!0})],B.prototype,"failures",void 0),e([b()],B.prototype,"fieldsWithContingentValues",null),e([b()],B.prototype,"filterByViewExtent",void 0),e([b({types:v})],B.prototype,"filterGeometry",void 0),e([b()],B.prototype,"hasContingentValues",null),e([b()],B.prototype,"hasInvalidPendingEdits",null),e([b()],B.prototype,"hasPendingEdits",null),e([b()],B.prototype,"highlightEnabled",void 0),e([b()],B.prototype,"highlightableLayerView",null),e([b()],B.prototype,"initialSize",void 0),e([b({readOnly:!0})],B.prototype,"isQuerying",null),e([b({readOnly:!0})],B.prototype,"isSyncing",null),e([b({readOnly:!0})],B.prototype,"isSyncingAttachmentEdits",null),e([b({readOnly:!0})],B.prototype,"isSyncingFeatureEdits",null),e([b({readOnly:!0})],B.prototype,"itemCache",null),e([b()],B.prototype,"layer",void 0),e([b()],B.prototype,"layerView",null),e([b()],B.prototype,"maxSize",void 0),e([b()],B.prototype,"objectIds",void 0),e([b()],B.prototype,"orderByFields",null),e([b()],B.prototype,"outFields",void 0),e([b({readOnly:!0})],B.prototype,"pageCache",void 0),e([b()],B.prototype,"pageCount",null),e([b()],B.prototype,"pageIndex",null),e([b()],B.prototype,"pageSize",void 0),e([b()],B.prototype,"paginationEnabled",void 0),e([b()],B.prototype,"pendingEditsCount",null),e([b()],B.prototype,"relationship",null),e([b()],B.prototype,"relationshipConfig",void 0),e([b()],B.prototype,"relationshipIds",null),e([b()],B.prototype,"relationshipInfos",null),e([b()],B.prototype,"relationships",null),e([b()],B.prototype,"relatedRecordsEnabled",void 0),e([b()],B.prototype,"returnGeometry",void 0),e([b()],B.prototype,"returnZ",void 0),e([b()],B.prototype,"returnM",void 0),e([b()],B.prototype,"selectionManager",void 0),e([b({readOnly:!0})],B.prototype,"size",null),e([b()],B.prototype,"sortOrders",void 0),e([b({readOnly:!0})],B.prototype,"state",null),e([b()],B.prototype,"supportsAdd",null),e([b()],B.prototype,"supportsAddAttachments",null),e([b()],B.prototype,"supportsAttachments",null),e([b()],B.prototype,"supportsCacheHint",null),e([b()],B.prototype,"supportsCacheHintQueryRelated",null),e([b()],B.prototype,"supportsDelete",null),e([b()],B.prototype,"supportsEditing",null),e([b()],B.prototype,"supportsM",null),e([b()],B.prototype,"supportsOrderBy",null),e([b()],B.prototype,"supportsPagination",null),e([b()],B.prototype,"supportsQuery",null),e([b()],B.prototype,"supportsQueryRelated",null),e([b()],B.prototype,"supportsResizeAttachments",null),e([b()],B.prototype,"supportsUpdate",null),e([b()],B.prototype,"supportsUpdateAttachments",null),e([b()],B.prototype,"supportsZ",null),e([b()],B.prototype,"syncViewSelection",void 0),e([b()],B.prototype,"temporaryHighlightId",void 0),e([b({type:A})],B.prototype,"timeExtent",void 0),e([b()],B.prototype,"timeZone",void 0),e([b()],B.prototype,"view",void 0),e([b()],B.prototype,"where",void 0),B=e([E("esri.widgets.FeatureTable.support.FeatureStore")],B);const x=B;export{x as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as i,isSome as s}from"../../../core/arrayUtils.js";import n from"../../../core/Collection.js";import a from"../../../core/Error.js";import{clone as o}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{getOrCreateMapValue as h}from"../../../core/MapUtils.js";import{removeMaybe as u,abortMaybe as d}from"../../../core/maybe.js";import{ignoreAbortErrors as p,throwIfAborted as c}from"../../../core/promiseUtils.js";import y from"../../../core/ReactiveMap.js";import{watch as g,when as _,syncAndInitial as m,sync as f}from"../../../core/reactiveUtils.js";import{property as b,subclass as E}from"../../../core/accessorSupport/decorators.js";import{geometryTypes as v}from"../../../geometry/support/typeUtils.js";import{isFeatureLayer as C,isSubtypeGroupLayer as I,isSubtypeSublayer as w}from"../../../layers/support/layerUtils.js";import O from"../../../rest/support/AttachmentQuery.js";import F from"../../../rest/support/RelationshipQuery.js";import A from"../../../time/TimeExtent.js";import j from"../../../views/SelectionManager.js";import{temporaryHighlightName as S}from"../../../views/support/HighlightDefaults.js";import{highlightsSupported as q}from"../../../views/support/layerViewUtils.js";import{isSelectableLayerWithObjectIds as M,isSelectableLayer as R}from"../../../views/support/selectionUtils.js";import{isIFeatureTableSupportedLayerWithAttachments as Q,isIFeatureTableSupportedLayerWithAttachmentsEditing as V,isIFeatureTableSupportedLayerWithEditing as H,isIFeatureTableSupportedLayerWithRelationships as W,isPageIndexValid as P,findRelatedLayer as z}from"./tableUtils.js";import{ContingentValuesManager as L}from"../../support/ContingentValuesManager.js";let B=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new n,this._contingentValuesManager=new L,this._defaultOutFields=["*"],this._editOperationQueue=new n,this.featureTitleMap=new y,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new n,this._pendingEditsCache=new y,this._queryOperationQueue=new n,this._size=0,this._temporaryHighlight=null,this._temporaryHighlightAbortController=null,this.attachmentsEnabled=!1,this.autoSaveEnabled=!0,this.defaultSelectionManager=new j,this.editingEnabled=!1,this.failures=new n,this.filterByViewExtent=!1,this.filterGeometry=null,this.highlightEnabled=!0,this.initialSize=null,this.layer=null,this.maxSize=null,this.objectIds=null,this.outFields=null,this.pageCache=new y,this.pageSize=50,this.paginationEnabled=!1,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.selectionManager=null,this.sortOrders=[],this.syncViewSelection=!1,this.temporaryHighlightId=void 0,this.timeExtent=null,this.timeZone=null,this.view=null,this.where=null}initialize(){this.addHandles([g(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),g(()=>this.orderByFields,()=>this._clearCaches(),{equals:i}),_(()=>this.attachmentsEnabled,()=>this._reset()),_(()=>this.relatedRecordsEnabled,()=>this._reset()),g(()=>this._layerWithContingentValues,e=>{const t=this._contingentValuesManager;e&&!t.layers.includes(e)&&t.layers.add(e)}),g(()=>[this.view?.extent,this.view?.stationary,this.filterByViewExtent],([e,t,r])=>{r&&(e?t&&(this.filterGeometry=e):this.filterGeometry=null)},m),g(()=>this.maxSize,(e,t)=>{0===t&&this._reset()}),g(()=>[this.layer,this.view],()=>this.syncSelectionSources(),m),g(()=>this.highlightEnabled,e=>this.defaultSelectionManager.highlightEnabled=e,m),g(()=>this.temporaryHighlightId,e=>{this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController;const t=this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal);p(this.view?.addUpdatingPromise(t)??t)},f)])}destroy(){this.layer=null,this.itemCache.destroy(),this.failures.destroy(),this.defaultSelectionManager.destroy(),this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=d(this._temporaryHighlightAbortController)}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _canSavePendingEdits(){return this.supportsEditing&&this.hasPendingEdits&&!this.hasInvalidPendingEdits}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&Q(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&V(e)&&this.supportsEditing?e:null}get _layerWithContingentValues(){const{layer:e}=this;return C(e)||I(e)?e:null}get _layerWithEditing(){const e=this.layer;return H(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return W(e)&&this.supportsQueryRelated?e:null}get _pendingEditsAreInvalid(){const e=this._pendingEditsCache,t=this._layerWithContingentValues;if(!t)return!1;for(const r of e.keys()){const i=e.get(r),s=this._getFeatureWithPendingEdits(r,i);for(const e of i.changes.keys()){if(this._contingentValuesManager.getViolationForField(t,s,e))return!0}}return!1}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return I(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:i}=this;if("loaded"!==e||!t||!r||!i)return!1;const{cardinality:s,role:n}=t,a=this.size>0;return("one-to-one"!==s||!a)&&("one-to-many"!==s||"origin"!==n||!a)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const i=e.fieldsIndex.normalizeFieldName(t);i&&r.push(i)});const{objectIdField:i}=e,s=e.fieldsIndex.normalizeFieldName(i)??i;return s&&!r.includes(s)&&r.unshift(s),r}get effectiveSelectionManager(){const{layer:e,view:t}=this;return e&&this.syncViewSelection&&M(e)&&t?.selectionManager?.sources.includes(e)?t.selectionManager:this.selectionManager??this.defaultSelectionManager}get effectiveSize(){const{_size:e,maxSize:t}=this;return null!=t?Math.min(t,e):e}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:w(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get fieldsWithContingentValues(){return this._contingentValuesManager.getFieldsWithContingentValues(this.layer)}get hasContingentValues(){return this.fieldsWithContingentValues.size>0}get hasInvalidPendingEdits(){return this.hasPendingEdits&&this._pendingEditsAreInvalid}get hasPendingEdits(){return this.pendingEditsCount>0}get highlightableLayerView(){const e=this.layerView;return q(e)?e:null}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new n({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||w(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,i=r.filter(({fieldName:t,direction:r},i)=>e.indexOf(t)===i&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!i.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&i.push(`${r} ASC`)}}return i}get pageCount(){const{effectiveSize:e,pageSize:t}=this;return 0===e||0===t?1:Math.ceil(e/t)}get pageIndex(){return this._get("pageIndex")||0}set pageIndex(e){const{pageCount:t}=this;P(e,t)&&this._set("pageIndex",e)}get pendingEditsCount(){let e=0;return this._pendingEditsCache.forEach(t=>e+=t.changes.size),e}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:i}=this,s=[];return t&&e?.loaded&&i?.map&&r?.length?(r.forEach(t=>{const r=z(e,i,t);r&&(r.load(),s.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),s):s}get relationships(){return this._layerWithRelationships?.relationships}get size(){return this._size}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:i}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":i?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(i)}addPendingEdits(e){const t=this._ensureLayerAndUpdateSupport();this.editingEnabled?(this.autoSaveEnabled&&this._logWarning("store:pending-edit","Edit will be cached, but 'autoSaveEnabled' is true.",!0),this._stashPendingEdits(t,e)):this._logWarning("store:editing-disabled","Editing is disabled.")}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsUpdateAttachments||!t.length)return[];const i=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(i)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new a("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(s),i=this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}));return e.forEach(e=>this.featureTitleMap.delete(e)),i}discardPendingEdits(e){if(e?.length)e.forEach(e=>this._discardPendingEdit(e));else{for(const[e,t]of this._pendingEditsCache){const r=this.getItemByObjectId(e);r&&(r.feature=t.originalFeature)}this._pendingEditsCache.clear(),this._clearOptionsAndViolations()}}itemHasInvalidPendingEdits(e,t){if(!this.hasInvalidPendingEdits)return!1;const r=this._layerWithContingentValues,i=this._pendingEditsCache.get(e);if(!r||!i)return!1;const s=this._getFeatureWithPendingEdits(e,i),n=this._contingentValuesManager;return t?!!n.getViolationForField(r,s,t):!!n.getAllViolations(r,s)}itemHasPendingEdits(e,t){const r=this._pendingEditsCache.get(e);return!!r&&(!t||r.changes.has(t))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,i=t*r,s=i+r,{layer:n,state:a}=this;return n&&"loaded"===a&&0!==this.maxSize?this._query({layer:n,start:i,num:s,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getFieldValueOptions(e){return this._contingentValuesManager.getFieldValueOptions(e)}async getFeatureTitle(e,r=!1){const{layer:i}=this,s=this.featureTitleMap.get(e),n=`${e}`;if(!i)return s||n;if(s&&!r)return s;if(!("getFeatureTitle"in i)||!i.getFeatureTitle)return n;const a=this.getItemByObjectId(e);let o=a?.feature;o||(o=new t({attributes:{[i.objectIdField]:e},origin:i.graphicOrigin}));const l=await i.getFeatureTitle(o,{fetchMissingFields:!0,removeHTML:!0});return l?(this.featureTitleMap.set(e,l),l):n}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,i=t.entries();let s=-1;for(const[n,a]of i)if(a.some((t,i)=>{const a=t.objectId===e;return a&&(s=n*r+i),a}),s>-1)break;return s}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&I(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncSize(e),await this._syncObjectIdCache(),this._syncPendingEdits()}reset(){this._reset()}async savePendingEdits(){if(!this.hasPendingEdits)return;if(!this._canSavePendingEdits)return void this._logError("store:update-error","An error occurred. Unable to save pending edits.");const e=[];for(const[t]of this._pendingEditsCache){const r=this.getItemByObjectId(t);r?.feature&&e.push(r.feature)}await this._savePendingEdits(e),this._clearOptionsAndViolations()}syncSelectionSources(){const{defaultSelectionManager:e,layer:t,view:r}=this;e.view=r,e.sources.removeAll(),R(t)&&(e.sources.items=[t])}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:i}=this;if(!i||!this.supportsUpdateAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>i.updateAttachment(this._createBaseGraphic(i,e),t,r));return this._ensureArrayContent(s)}async updateItem(e){const t=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled)return void this._logWarning("store:editing-disabled","Editing is disabled.");if(this.hasContingentValues){const t=e.updates.some(e=>this.fieldsWithContingentValues.has(e.fieldName)),r=this.itemHasPendingEdits(e.objectId);if(r||t){const t=this._layerWithContingentValues,i=this.getItemByObjectId(e.objectId)?.feature?.clone();if(i){const s=this._contingentValuesManager.getAllViolations(t,i);e.updates.forEach(({fieldName:e,value:r})=>{const s=t.getField(e);s&&(i.attributes[s.name]=r)});if(this._contingentValuesManager.validateContingencyConstraints(t,i).length||s.length||r)return this._stashPendingEdits(t,[e]),void this._contingentValuesManager.resetOptionsForLayer(t)}}}if(!this.autoSaveEnabled)return void this._stashPendingEdits(t,[e]);const{_sortedFieldNames:r}=this,i=e.updates.map(({fieldName:e})=>e);!(await this._update(t,e)).updateFeatureResults.find(e=>e.error)&&i.some(e=>r.includes(e))&&this._clearCaches()}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:i}=t,s=await this._queryFeaturesByObjectId(e);return e.map(e=>s.some(t=>{const r=t.getObjectId()??t.attributes[i];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const i=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(i.attributes[this._subtypeField]=this._subtypeCode),i}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){l.getLogger(this).error(e,t)}_logWarning(e,t,r=!1){r?l.getLogger(this).warnOnce(e,t):l.getLogger(this).warn(e,t)}_reset(){this._clearCaches(),this._pendingEditsCache.clear(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this.featureTitleMap.clear(),this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=d(this._temporaryHighlightAbortController),this._loading=!1,this._loaded=!1,this._loadError=!1,this._size=0}async _syncSize(e){0!==this.maxSize?this._size=e??await this._queryCount():this._size=0}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _queryFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new a("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:i,orderByFields:s,supportsCacheHint:n,supportsOrderBy:o}=this,l=t.createQuery();l.where=i,l.timeExtent=r,l.returnGeometry=!1,l.objectIds=e.length?e:void 0,l.outFields=[t.objectIdField],o&&(l.orderByFields=s),n&&(l.cacheHint=!0);return(await t.queryFeatures(l)).features}async _syncTemporaryHighlight(e,t){const{highlightEnabled:r,highlightableLayerView:i}=this;i&&r&&null!=e&&(c(t),this._temporaryHighlight={id:e,handle:i.highlight(e,{name:S})})}_ensureLayerAndUpdateSupport(){const e=this._layerWithEditing;if(!this.supportsUpdate||!e)throw new a("store:update-error","Update is not supported.");return e}_stashPendingEdits(e,t){t.forEach(({objectId:t,updates:r})=>{const i=this.getItemByObjectId(t)?.feature;if(!i)throw new a("store:update-error","Feature with provided 'objectId' not found.");const s=i.clone(),n=h(this._pendingEditsCache,t,()=>({originalFeature:s,changes:new y}));r.forEach(({fieldName:t,value:r})=>{const s=e.getField(t);s?(n.changes.set(s.name,r),i.attributes[s.name]=r):this._logWarning("store:pending-edit-unknown-field","The provided field does not belong to this layer.")}),n.changes.size>0&&this._pendingEditsCache.set(t,n)})}_syncPendingEdits(){for(const[e,t]of this._pendingEditsCache){const r=this.getItemByObjectId(e)?.feature;if(r){const e=r.clone();for(const[i,s]of t.changes)r.attributes[i]=s;t.originalFeature=e}}}_getFeatureWithPendingEdits(e,t){let r=this.getItemByObjectId(e)?.feature;if(!r){r=t.originalFeature.clone();for(const[e,i]of t.changes)r.attributes[e]=i}return r}_discardPendingEdit({objectId:e,fieldName:t}){const r=this._pendingEditsCache.get(e);if(!r)return void this._logWarning("store:pending-edit-not-found","Could not find a pending edit with the given information");const i=this.getItemByObjectId(e);t?(i&&(i.feature.attributes[t]=r.originalFeature.attributes[t]),r.changes.delete(t),0===r.changes.size&&this._pendingEditsCache.delete(e)):(i&&(i.feature=r.originalFeature),this._pendingEditsCache.delete(e))}_clearOptionsAndViolations(){const{_layerWithContingentValues:e,_contingentValuesManager:t}=this;e&&(t.resetOptionsForLayer(e),t.resetViolationsForLayer(e))}async _update(e,r){const{objectId:i,updates:s}=r,n=this.getItemByObjectId(i)?.feature;if(!n)throw new a("store:update-error","Feature with provided 'objectId' not found.");const l=o(n.attributes);s.forEach(({fieldName:e,value:t})=>l[e]=t);const h=new t({attributes:l,sourceLayer:n.sourceLayer}),u=e.applyEdits({updateFeatures:[h]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(n.attributes=l,this.featureTitleMap.has(i)&&this.getFeatureTitle(i,!0)),e});return this._queueEditOperation(()=>u)}async _savePendingEdits(e){const{_layerWithEditing:t}=this;if(!this.supportsUpdate||!t)throw new a("store:update-error","Update is not supported.");const r=t.applyEdits({updateFeatures:e}).then(e=>{const{updateFeatureResults:t}=e,r=t.filter(e=>!!e.error);if(r.length)throw this.discardPendingEdits(),r[0].error;return e});return this._queueEditOperation(()=>r,!0)}_createFeatureStoreItems(e){const{attachments:t,features:r,layer:i,relatedRecords:s}=e,n=i.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[n],a=[];e.layer||e.sourceLayer||(e.layer=i,e.sourceLayer=i);const o=this._pendingEditsCache.get(r);if(o){const t=e.clone(),r=o.changes;for(const[i,s]of r)e.attributes[i]=s;o.originalFeature=t}return s.forEach((e,t)=>{a.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:a}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const i=this.pageCache.get(t);if(i)return i;const s=await this._queryPage(e);return this.pageCache.set(t,s),s}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new a("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new O({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:i}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:i,relationshipId:s}=r;return(await i.queryRelatedFeaturesCount(new F({cacheHint:e,relationshipId:s,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:s,effectiveWhere:n,filterGeometry:a,objectIds:o}=this,l=t.createQuery();return l.geometry=a,l.returnGeometry=!1,l.where=n,l.timeExtent=s,l.objectIds=o?.length?o:void 0,i&&(l.cacheHint=!0),t.queryFeatureCount(l)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:i,effectiveOutFields:s,effectiveTimeExtent:n,effectiveWhere:a,filterGeometry:o,objectIds:l,orderByFields:h,pageSize:u,returnGeometry:d,supportsCacheHint:p,supportsOrderBy:c,supportsPagination:y}=this,{layer:g,start:_}=e,m=l?.length,f=g.createQuery();f.returnGeometry=d,f.outFields=s,f.returnM=r,f.returnZ=i,y?(f.start=_,f.num=u,f.where=a,f.timeExtent=n,f.objectIds=m?l:void 0):f.objectIds=m?l:this._getObjectIdsForPage(_,u??0),c&&(f.orderByFields=h),o&&(f.geometry=o),p&&(f.cacheHint=!0);return(await g.queryFeatures(f)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:i,objectIds:s,orderByFields:n,supportsCacheHint:a,supportsOrderBy:o}=this;if(!i)return Promise.resolve([]);const l=i.createQuery();return l.geometry=r,l.outFields=[i.objectIdField],l.returnGeometry=!1,l.where=t,l.timeExtent=e,l.objectIds=s?.length?s:void 0,o&&(l.orderByFields=n),a&&(l.cacheHint=!0),i.queryObjectIds(l)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),i=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),s=await this._queryAttachments(i),n=await this._queryRelatedCounts(i);return this._createFeatureStoreItems({layer:t,features:r,attachments:s,relatedRecords:n})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:i}=this,s=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const n=await t.queryRelatedFeaturesCount(new F({cacheHint:i,relationshipId:r,objectIds:e}));s.set(r,n)})),s):s}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:i,_effectiveReturnZ:s,orderByFields:n,pageSize:a,returnGeometry:o,supportsCacheHint:l}=this,{layer:h,start:u}=e,{objectId:d,relatedLayer:p,relationshipId:c}=t,y=h.createQuery(),g=new F({cacheHint:l,num:a,objectIds:[d],orderByFields:n,outFields:r,relationshipId:c,returnGeometry:o,returnM:i,returnZ:s,start:u,where:y.where??void 0}),_=await p.queryRelatedFeatures(g);return _[d]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const i=this._ensureArray(r),s=i.some(e=>e.error),n=this.getItemByObjectId(e);if(n&&(!s||i.length>1)){const t=await this._queryAttachments([e]);n.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const i={error:r,retry:()=>{this.failures.remove(i),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(i)};throw this.failures.add(i),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e,t=!1){return this._editOperationQueue.push(e),e().then(r=>(this._editOperationQueue.remove(e),t&&this._pendingEditsCache.clear(),r)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([b()],B.prototype,"_attachmentsOperationQueue",void 0),e([b({readOnly:!0})],B.prototype,"_capabilities",null),e([b()],B.prototype,"_canSavePendingEdits",null),e([b()],B.prototype,"_contingentValuesManager",void 0),e([b()],B.prototype,"_defaultOutFields",void 0),e([b()],B.prototype,"_editOperationQueue",void 0),e([b()],B.prototype,"_effectiveReturnZ",null),e([b()],B.prototype,"_effectiveReturnM",null),e([b()],B.prototype,"featureTitleMap",void 0),e([b({readOnly:!0})],B.prototype,"_layerWithAttachments",null),e([b({readOnly:!0})],B.prototype,"_layerWithAttachmentsEditing",null),e([b()],B.prototype,"_layerWithContingentValues",null),e([b({readOnly:!0})],B.prototype,"_layerWithEditing",null),e([b({readOnly:!0})],B.prototype,"_layerWithRelationships",null),e([b()],B.prototype,"_loaded",void 0),e([b()],B.prototype,"_loadError",void 0),e([b()],B.prototype,"_loading",void 0),e([b()],B.prototype,"_objectIdCache",void 0),e([b()],B.prototype,"_pendingEditsCache",void 0),e([b()],B.prototype,"_pendingEditsAreInvalid",null),e([b()],B.prototype,"_queryOperationQueue",void 0),e([b({readOnly:!0})],B.prototype,"_relatedLayer",null),e([b({readOnly:!0})],B.prototype,"_relatedLayerCapabilities",null),e([b({readOnly:!0})],B.prototype,"_relatedLayerSupportsCacheHint",null),e([b()],B.prototype,"_relatedLayerSupportsQuery",null),e([b()],B.prototype,"_relatedLayerSupportsQueryRelated",null),e([b()],B.prototype,"_size",void 0),e([b()],B.prototype,"_sortedFieldNames",null),e([b()],B.prototype,"_subtypeCode",null),e([b()],B.prototype,"_subtypeField",null),e([b()],B.prototype,"_canUseRelatedLayer",null),e([b()],B.prototype,"attachmentsEnabled",void 0),e([b()],B.prototype,"autoSaveEnabled",void 0),e([b()],B.prototype,"canAddRelatedFeature",null),e([b()],B.prototype,"defaultSelectionManager",void 0),e([b()],B.prototype,"editingEnabled",void 0),e([b()],B.prototype,"effectiveOutFields",null),e([b()],B.prototype,"effectiveSelectionManager",null),e([b()],B.prototype,"effectiveSize",null),e([b()],B.prototype,"effectiveTimeExtent",null),e([b()],B.prototype,"effectiveWhere",null),e([b({readOnly:!0})],B.prototype,"failures",void 0),e([b()],B.prototype,"fieldsWithContingentValues",null),e([b()],B.prototype,"filterByViewExtent",void 0),e([b({types:v})],B.prototype,"filterGeometry",void 0),e([b()],B.prototype,"hasContingentValues",null),e([b()],B.prototype,"hasInvalidPendingEdits",null),e([b()],B.prototype,"hasPendingEdits",null),e([b()],B.prototype,"highlightEnabled",void 0),e([b()],B.prototype,"highlightableLayerView",null),e([b()],B.prototype,"initialSize",void 0),e([b({readOnly:!0})],B.prototype,"isQuerying",null),e([b({readOnly:!0})],B.prototype,"isSyncing",null),e([b({readOnly:!0})],B.prototype,"isSyncingAttachmentEdits",null),e([b({readOnly:!0})],B.prototype,"isSyncingFeatureEdits",null),e([b({readOnly:!0})],B.prototype,"itemCache",null),e([b()],B.prototype,"layer",void 0),e([b()],B.prototype,"layerView",null),e([b()],B.prototype,"maxSize",void 0),e([b()],B.prototype,"objectIds",void 0),e([b()],B.prototype,"orderByFields",null),e([b()],B.prototype,"outFields",void 0),e([b({readOnly:!0})],B.prototype,"pageCache",void 0),e([b()],B.prototype,"pageCount",null),e([b()],B.prototype,"pageIndex",null),e([b()],B.prototype,"pageSize",void 0),e([b()],B.prototype,"paginationEnabled",void 0),e([b()],B.prototype,"pendingEditsCount",null),e([b()],B.prototype,"relationship",null),e([b()],B.prototype,"relationshipConfig",void 0),e([b()],B.prototype,"relationshipIds",null),e([b()],B.prototype,"relationshipInfos",null),e([b()],B.prototype,"relationships",null),e([b()],B.prototype,"relatedRecordsEnabled",void 0),e([b()],B.prototype,"returnGeometry",void 0),e([b()],B.prototype,"returnZ",void 0),e([b()],B.prototype,"returnM",void 0),e([b()],B.prototype,"selectionManager",void 0),e([b({readOnly:!0})],B.prototype,"size",null),e([b()],B.prototype,"sortOrders",void 0),e([b({readOnly:!0})],B.prototype,"state",null),e([b()],B.prototype,"supportsAdd",null),e([b()],B.prototype,"supportsAddAttachments",null),e([b()],B.prototype,"supportsAttachments",null),e([b()],B.prototype,"supportsCacheHint",null),e([b()],B.prototype,"supportsCacheHintQueryRelated",null),e([b()],B.prototype,"supportsDelete",null),e([b()],B.prototype,"supportsEditing",null),e([b()],B.prototype,"supportsM",null),e([b()],B.prototype,"supportsOrderBy",null),e([b()],B.prototype,"supportsPagination",null),e([b()],B.prototype,"supportsQuery",null),e([b()],B.prototype,"supportsQueryRelated",null),e([b()],B.prototype,"supportsResizeAttachments",null),e([b()],B.prototype,"supportsUpdate",null),e([b()],B.prototype,"supportsUpdateAttachments",null),e([b()],B.prototype,"supportsZ",null),e([b()],B.prototype,"syncViewSelection",void 0),e([b()],B.prototype,"temporaryHighlightId",void 0),e([b({type:A})],B.prototype,"timeExtent",void 0),e([b()],B.prototype,"timeZone",void 0),e([b()],B.prototype,"view",void 0),e([b()],B.prototype,"where",void 0),B=e([E("esri.widgets.FeatureTable.support.FeatureStore")],B);const x=B;export{x as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{property as i,subclass as n}from"../../core/accessorSupport/decorators.js";import{isLayerFromCatalog as o,isCatalogSublayer as s}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as l,getActionStyles as a}from"../../support/actions/actionUtils.js";import r from"../Widget.js";import{getStatusIcon as c,listItemHasChildren as d,areChildrenHidden as p,canSortSublayers as m,getSingleAction as u,getItem as g,getVisibilityIcon as y}from"./support/layerListUtils.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{tsx as b}from"../support/widget.js";import{setFocus as v}from"../support/widgetUtils.js";var _;let I=class extends r{static{_=this}constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return h({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}static{this.vnodeSelector="calcite-list-item"}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:l,parent:a,css:r,dragDisabled:c}=this,d="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in l&&!i.visibleAtCurrentTimeExtent?`${t} (${l.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in l&&!i.visibleAtCurrentScale?`${t} (${l.layerInvisibleAtScale})`:t,p="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:m}=i,u="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return b("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":m?.id,dragDisabled:!i.sortable||p||c,expanded:"open"in i&&i.open,id:m?.uid,key:`list-item-${m?.uid}`,label:t,metadata:{parentTitles:e,_title:t},selected:"none"!==o&&s.includes(i),title:d,unavailable:u,value:m?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,a),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,l="connectionStatus"in e?e.connectionStatus:void 0,a=!!l;return o||s||a?b("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:a},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:a&&"connected"===l}),icon:c({connectionStatus:l,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"}):null}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:n}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,l="temporaryTableIndicators"in t&&t.temporaryTableIndicators,a=n&&"persistenceEnabled"in n&&(o(n)||!n.persistenceEnabled);return(s||l)&&a?b("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{_title:e,item:i,parent:n,messages:o,visibilityAppearance:s,css:l}=this;if(!("visible"in i&&"layerVisibility"in o&&"showLayer"in o&&"hideLayer"in o&&"visibleToggle"in l&&s))return null;const{visible:a}=i,r=this._getParentVisibilityMode(n);if("inherited"===r)return null;const c=y({visible:a,exclusive:"exclusive"===r,visibilityAppearance:s}),d="checkbox"===s,p=o.layerVisibility,m=t(a?o.hideLayer:o.showLayer,{layerName:e});return b("calcite-action",{class:l.visibleToggle,icon:d?c:void 0,key:"visibility-toggle",label:m,onclick:()=>this._toggleVisibility(i,n),slot:d?"actions-start":"actions-end",text:p,title:m},d?null:b("calcite-icon",{class:this.classes({[l.visibleIcon]:"exclusive"!==r&&a}),icon:c,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:b("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return b("calcite-action",{active:t,disabled:n,icon:l(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return b("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},b("calcite-action",{icon:"ellipsis",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>b("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map(e=>this._renderAction({action:e,textEnabled:!0}))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&s(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?b("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&s(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?b("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?b("calcite-action",{disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("children"in t))return;const l=[...this.parentTitles??[],t.title],{children:a,layer:r}=t,c="catalog-dynamic-group"!==r?.type&&d(t),u=!n&&p(r),g="group"===r?.type,y=!u&&!c&&e&&g,h=!!e&&("childrenSortable"in t&&t.childrenSortable&&m(t));return c||y?b("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:h,group:g?i:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},a?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error)).toArray().map(e=>this._renderItem(e,t,l)),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?b("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,label:t.tables,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},b("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),b("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?b("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},b("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},b("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?b("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},b("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},b("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:u(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(e=>e.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:s,title:a,type:r,indicator:c}=i;return b("calcite-action",{active:"toggle"===r&&i.value,"data-action-id":i.id,disabled:s,icon:l(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),slot:n?void 0:"actions-end",text:a??"",textEnabled:n,title:a??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{icon:i}=e,n="className"in e?e.className:void 0;if(i)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!n,[t.itemActionImage]:!!o};return n&&(s[n]=!0),o||n?b("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return b(_,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(v(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(g(e.target)!==t)return;const n=this._getParentVisibilityMode(i);"none"===this.selectionMode&&"inherited"!==n&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e||!("visible"in e))return;"exclusive"===this._getParentVisibilityMode(t)&&e.visible||(e.visible=!e.visible)}};e([i()],I.prototype,"activeItem",void 0),e([i()],I.prototype,"canMove",void 0),e([i()],I.prototype,"css",void 0),e([i()],I.prototype,"displayMode",void 0),e([i()],I.prototype,"dragEnabled",void 0),e([i()],I.prototype,"dragDisabled",void 0),e([i()],I.prototype,"item",void 0),e([i()],I.prototype,"layerTablesEnabled",void 0),e([i()],I.prototype,"listModeDisabled",void 0),e([i()],I.prototype,"messages",void 0),e([i()],I.prototype,"messagesCommon",void 0),e([i()],I.prototype,"onAction",void 0),e([i()],I.prototype,"onPanelOpen",void 0),e([i()],I.prototype,"onCatalogOpen",void 0),e([i()],I.prototype,"onTablesOpen",void 0),e([i()],I.prototype,"onSelectedDragItemLayerUidChange",void 0),e([i()],I.prototype,"onTooltipReferenceChange",void 0),e([i()],I.prototype,"parent",void 0),e([i()],I.prototype,"parentTitles",void 0),e([i()],I.prototype,"rootGroupUid",void 0),e([i()],I.prototype,"selectionMode",void 0),e([i()],I.prototype,"selectedItems",void 0),e([i()],I.prototype,"selectedDragItemLayerUid",void 0),e([i()],I.prototype,"visibleElements",void 0),e([i()],I.prototype,"visibilityAppearance",void 0),e([i()],I.prototype,"_title",null),e([i()],I.prototype,"_renderedItemStatus",null),e([i()],I.prototype,"_renderedItemTemporaryIcon",null),e([i()],I.prototype,"_renderedItemToggle",null),e([i()],I.prototype,"_renderedPanel",null),e([i()],I.prototype,"_renderedPanelAction",null),e([i()],I.prototype,"_renderedActions",null),e([i()],I.prototype,"_renderedActionMenu",null),e([i()],I.prototype,"_renderedActionMenuContent",null),e([i()],I.prototype,"_renderedCatalogFootprintIcon",null),e([i()],I.prototype,"_renderedCatalogDynamicIcon",null),e([i()],I.prototype,"_renderedCatalogSelectNode",null),e([i()],I.prototype,"_renderedChildList",null),e([i()],I.prototype,"_hasTables",null),e([i()],I.prototype,"_renderedTablesItem",null),e([i()],I.prototype,"_renderedItemMessage",null),e([i()],I.prototype,"_singleAction",null),e([i()],I.prototype,"_filteredSections",null),e([i()],I.prototype,"_actionsCount",null),I=_=e([n("esri.widgets.LayerList.LayerListItem")],I);const C=I;export{C as default};
2
+ import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{property as i,subclass as n}from"../../core/accessorSupport/decorators.js";import{isLayerFromCatalog as o,isCatalogSublayer as s}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as l,getActionStyles as a}from"../../support/actions/actionUtils.js";import r from"../Widget.js";import{listItemHasChildren as c,areChildrenHidden as d,canSortSublayers as p,getSingleAction as m,getItem as u,getStatusIcon as g,getVisibilityIcon as y}from"./support/layerListUtils.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{tsx as b}from"../support/widget.js";import{setFocus as v}from"../support/widgetUtils.js";var _;let I=class extends r{static{_=this}constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return h({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}static{this.vnodeSelector="calcite-list-item"}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:l,parent:a,css:r,dragDisabled:c}=this,d="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in l&&!i.visibleAtCurrentTimeExtent?`${t} (${l.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in l&&!i.visibleAtCurrentScale?`${t} (${l.layerInvisibleAtScale})`:t,p="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:m}=i,u="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return b("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":m?.id,dragDisabled:!i.sortable||p||c,expanded:"open"in i&&i.open,id:m?.uid,key:`list-item-${m?.uid}`,label:t,metadata:{parentTitles:e,_title:t},selected:"none"!==o&&s.includes(i),title:d,unavailable:u,value:m?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,a),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,l="connectionStatus"in e?e.connectionStatus:void 0,a=!!l,r=o||s||a?g({connectionStatus:l,publishing:o}):"blank";return b("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:a},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:a&&"connected"===l}),icon:r,key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:n}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,l="temporaryTableIndicators"in t&&t.temporaryTableIndicators,a=n&&"persistenceEnabled"in n&&(o(n)||!n.persistenceEnabled);return(s||l)&&a?b("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{_title:e,item:i,parent:n,messages:o,visibilityAppearance:s,css:l}=this;if(!("visible"in i&&"layerVisibility"in o&&"showLayer"in o&&"hideLayer"in o&&"visibleToggle"in l&&s))return null;const{visible:a}=i,r=this._getParentVisibilityMode(n);if("inherited"===r)return null;const c=y({visible:a,exclusive:"exclusive"===r,visibilityAppearance:s}),d="checkbox"===s,p=o.layerVisibility,m=t(a?o.hideLayer:o.showLayer,{layerName:e});return b("calcite-action",{class:l.visibleToggle,icon:d?c:void 0,key:"visibility-toggle",label:m,onclick:()=>this._toggleVisibility(i,n),slot:d?"actions-start":"actions-end",text:p,title:m},d?null:b("calcite-icon",{class:this.classes({[l.visibleIcon]:"exclusive"!==r&&a}),icon:c,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:b("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return b("calcite-action",{active:t,disabled:n,icon:l(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return b("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},b("calcite-action",{icon:"ellipsis",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>b("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map(e=>this._renderAction({action:e,textEnabled:!0}))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&s(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?b("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&s(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?b("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?b("calcite-action",{disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("children"in t))return;const l=[...this.parentTitles??[],t.title],{children:a,layer:r}=t,m="catalog-dynamic-group"!==r?.type&&c(t),u=!n&&d(r),g="group"===r?.type,y=!u&&!m&&e&&g,h=!!e&&("childrenSortable"in t&&t.childrenSortable&&p(t));return m||y?b("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:h,group:g?i:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},a?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error)).toArray().map(e=>this._renderItem(e,t,l)),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?b("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,label:t.tables,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},b("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),b("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?b("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},b("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},b("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?b("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},b("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},b("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:m(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(e=>e.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:s,title:a,type:r,indicator:c}=i;return b("calcite-action",{active:"toggle"===r&&i.value,"data-action-id":i.id,disabled:s,icon:l(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),slot:n?void 0:"actions-end",text:a??"",textEnabled:n,title:a??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{icon:i}=e,n="className"in e?e.className:void 0;if(i)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!n,[t.itemActionImage]:!!o};return n&&(s[n]=!0),o||n?b("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return b(_,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(v(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(u(e.target)!==t)return;const n=this._getParentVisibilityMode(i);"none"===this.selectionMode&&"inherited"!==n&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e||!("visible"in e))return;"exclusive"===this._getParentVisibilityMode(t)&&e.visible||(e.visible=!e.visible)}};e([i()],I.prototype,"activeItem",void 0),e([i()],I.prototype,"canMove",void 0),e([i()],I.prototype,"css",void 0),e([i()],I.prototype,"displayMode",void 0),e([i()],I.prototype,"dragEnabled",void 0),e([i()],I.prototype,"dragDisabled",void 0),e([i()],I.prototype,"item",void 0),e([i()],I.prototype,"layerTablesEnabled",void 0),e([i()],I.prototype,"listModeDisabled",void 0),e([i()],I.prototype,"messages",void 0),e([i()],I.prototype,"messagesCommon",void 0),e([i()],I.prototype,"onAction",void 0),e([i()],I.prototype,"onPanelOpen",void 0),e([i()],I.prototype,"onCatalogOpen",void 0),e([i()],I.prototype,"onTablesOpen",void 0),e([i()],I.prototype,"onSelectedDragItemLayerUidChange",void 0),e([i()],I.prototype,"onTooltipReferenceChange",void 0),e([i()],I.prototype,"parent",void 0),e([i()],I.prototype,"parentTitles",void 0),e([i()],I.prototype,"rootGroupUid",void 0),e([i()],I.prototype,"selectionMode",void 0),e([i()],I.prototype,"selectedItems",void 0),e([i()],I.prototype,"selectedDragItemLayerUid",void 0),e([i()],I.prototype,"visibleElements",void 0),e([i()],I.prototype,"visibilityAppearance",void 0),e([i()],I.prototype,"_title",null),e([i()],I.prototype,"_renderedItemStatus",null),e([i()],I.prototype,"_renderedItemTemporaryIcon",null),e([i()],I.prototype,"_renderedItemToggle",null),e([i()],I.prototype,"_renderedPanel",null),e([i()],I.prototype,"_renderedPanelAction",null),e([i()],I.prototype,"_renderedActions",null),e([i()],I.prototype,"_renderedActionMenu",null),e([i()],I.prototype,"_renderedActionMenuContent",null),e([i()],I.prototype,"_renderedCatalogFootprintIcon",null),e([i()],I.prototype,"_renderedCatalogDynamicIcon",null),e([i()],I.prototype,"_renderedCatalogSelectNode",null),e([i()],I.prototype,"_renderedChildList",null),e([i()],I.prototype,"_hasTables",null),e([i()],I.prototype,"_renderedTablesItem",null),e([i()],I.prototype,"_renderedItemMessage",null),e([i()],I.prototype,"_singleAction",null),e([i()],I.prototype,"_filteredSections",null),e([i()],I.prototype,"_actionsCount",null),I=_=e([n("esri.widgets.LayerList.LayerListItem")],I);const C=I;export{C as default};
@@ -263,7 +263,7 @@ export interface TimeSliderEvents extends TimeSliderViewModelEvents {}
263
263
  *
264
264
  * With this approach, whenever a TimeSlider's [timeExtent](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/#timeExtent) is updated, the assigned view's
265
265
  * [View.timeExtent](https://developers.arcgis.com/javascript/latest/references/core/views/View/#timeExtent) will also be updated. All time-aware layers will automatically update to conform to the view's timeExtent.
266
- * Check out the [Set time properties on data (ArcGIS Pro)](https://pro.arcgis.com/en/pro-app/help/mapping/time/set-the-time-properties-on-data.htm) and
266
+ * Check out the [Set time properties on data (ArcGIS Pro)](https://doc.esri.com/en/arcgis-pro/latest/help/mapping/time/set-the-time-properties-on-data.html) and
267
267
  * [Configure time settings on a layer (ArcGIS Online)](https://doc.arcgis.com/en/arcgis-online/create-maps/configure-time-mv.htm) documents to learn how to enable time on your service.
268
268
  *
269
269
  * ```js
@@ -421,8 +421,8 @@ export interface TimeSliderEvents extends TimeSliderViewModelEvents {}
421
421
  * @see [Sample - Filter features with TimeSlider component](https://developers.arcgis.com/javascript/latest/sample-code/timeslider-component-filter/)
422
422
  * @see [Sample - TimeSlider with offset](https://developers.arcgis.com/javascript/latest/sample-code/widgets-timeslider-offset/)
423
423
  * @see [Sample - Visualizing wind data with VectorFieldRenderer](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-vfrenderer/)
424
- * @see [Temporal data (ArcGIS Pro)](https://pro.arcgis.com/en/pro-app/help/mapping/time/temporal-data.htm)
425
- * @see [Set time properties on data (ArcGIS Pro)](https://pro.arcgis.com/en/pro-app/help/mapping/time/set-the-time-properties-on-data.htm)
424
+ * @see [Temporal data (ArcGIS Pro)](https://doc.esri.com/en/arcgis-pro/latest/help/mapping/time/temporal-data.html)
425
+ * @see [Set time properties on data (ArcGIS Pro)](https://doc.esri.com/en/arcgis-pro/latest/help/mapping/time/set-the-time-properties-on-data.html)
426
426
  * @see [Configure time settings on a layer (ArcGIS Online)](https://doc.arcgis.com/en/arcgis-online/create-maps/configure-time-mv.htm)
427
427
  * @see [Set GeoJSONLayer timeInfo](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/#timeInfo)
428
428
  * @see [Set CSVLayer timeInfo](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/#timeInfo)
@@ -178,6 +178,16 @@ export default class VideoPlayerViewModel extends Accessor {
178
178
  * videoPlayerViewModel.toggleFrameOutlineDisplay();
179
179
  */
180
180
  toggleFrameOutlineDisplay(): void;
181
+ /**
182
+ * Toggles the loop playback setting.
183
+ *
184
+ * @since 5.1
185
+ * @example
186
+ * ```js
187
+ * videoPlayerViewModel.toggleLoopPlayback();
188
+ * ```
189
+ */
190
+ toggleLoopPlayback(): void;
181
191
  /**
182
192
  * Toggles the sensor display.
183
193
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{watch as r,initial as l}from"../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";import{videoMetadataEntryId as s}from"../../layers/video/videoUtils.js";function o(e,t){const r={};for(const l of t){const t=e.get(l);t&&(r[t.name]=t.value)}return r}let y=class extends t{constructor(e){super(e),this.followingMode="follow-both",this.layer=null,this.seekLength=10,this.view=null}initialize(){this.addHandles([r(()=>this.layer,(e,t)=>{t&&t.pause(),e&&e.load().then(()=>this._followTelemetry()).catch(()=>{})},l),r(()=>[this.followingMode],()=>this._followTelemetry(),l)])}get buffered(){return this.layer?.buffered||0}get currentTime(){return this.layer?.currentTime||0}get duration(){return this.layer?.duration||0}get ended(){return this.layer?.ended??!0}get metadata(){const e=this.layer?.metadata;return e?{missionInfo:o(e,[s.MissionId,s.PrecisionTimeStamp]),platformInfo:o(e,[s.PlatformTailNumber,s.PlatformTrueAirspeed,s.PlatformCallSign,s.PlatformDesignation,s.PlatformGroundRange]),frameInfo:o(e,[s.FrameCenterElevation,s.FrameCenterLatitude,s.FrameCenterLongitude])}:null}get playing(){return this.layer?.playing??!1}get state(){return this.layer?.loadError?"error":this.layer?.state??"not-ready"}play(){this.layer?.play()}pause(){this.layer?.pause()}seekBackward(){if(this.layer){const e=this.layer.currentTime-this.seekLength;e<=0?this.layer.reset():this.layer.setCurrentTime(e)}}seekForward(){if(this.layer){const e=this.layer.currentTime+this.seekLength;e>=this.layer.duration?this.layer.reset():this.layer.setCurrentTime(e)}}seekToBeginning(){this.layer?.setCurrentTime(0)}seekToEnding(){this.layer?.setCurrentTime(this.layer.duration)}seekTo(e){this.layer?.setCurrentTime(e)}toggleSensorDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorLocation=!this.layer.telemetryDisplay.sensorLocation)}toggleSensorPathDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorPath=!this.layer.telemetryDisplay.sensorPath)}toggleSensorSightLineDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.lineOfSight=!this.layer.telemetryDisplay.lineOfSight)}toggleFrameDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frame=!this.layer.telemetryDisplay.frame)}toggleSensorTrailDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorTrail=!this.layer.telemetryDisplay.sensorTrail)}toggleFrameCenterDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frameCenter=!this.layer.telemetryDisplay.frameCenter)}toggleFrameOutlineDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frameOutline=!this.layer.telemetryDisplay.frameOutline)}changePlaybackSpeed(e){this.layer&&(this.layer.playbackRate=e)}changeGraphicsColor(e){e&&this.layer.updateTelemetryColor(e)}_followTelemetry(){this.removeHandles("follow"),this.view&&this.layer&&this.addHandles(r(()=>this.layer?.telemetry,()=>{const e=[],t="follow-sensor"===this.followingMode||"follow-both"===this.followingMode,r="follow-frame"===this.followingMode||"follow-both"===this.followingMode;t&&this.layer?.telemetry.sensorLocation&&e.push(this.layer.telemetry.sensorLocation),r&&this.layer?.telemetry.frameCenter&&e.push(this.layer.telemetry.frameCenter),e.length?this.view?.goTo(e).catch(()=>{}):this.layer?.initialExtent&&"none"!==this.followingMode&&this.view?.goTo(this.layer.initialExtent).catch(()=>{})},l),"follow")}};e([i({readOnly:!0})],y.prototype,"buffered",null),e([i({readOnly:!0})],y.prototype,"currentTime",null),e([i({readOnly:!0})],y.prototype,"duration",null),e([i({readOnly:!0})],y.prototype,"ended",null),e([i()],y.prototype,"followingMode",void 0),e([i()],y.prototype,"layer",void 0),e([i({readOnly:!0})],y.prototype,"metadata",null),e([i({readOnly:!0})],y.prototype,"playing",null),e([i()],y.prototype,"seekLength",void 0),e([i({readOnly:!0})],y.prototype,"state",null),e([i()],y.prototype,"view",void 0),y=e([a("esri.widgets.VideoPlayer.VideoPlayerViewModel")],y);const n=y;export{n as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{watch as r,initial as l}from"../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";import{videoMetadataEntryId as s}from"../../layers/video/videoUtils.js";function o(e,t){const r={};for(const l of t){const t=e.get(l);t&&(r[t.name]=t.value)}return r}let y=class extends t{constructor(e){super(e),this.followingMode="follow-both",this.layer=null,this.seekLength=10,this.view=null}initialize(){this.addHandles([r(()=>this.layer,(e,t)=>{t&&t.pause(),e&&e.load().then(()=>this._followTelemetry()).catch(()=>{})},l),r(()=>[this.followingMode],()=>this._followTelemetry(),l)])}get buffered(){return this.layer?.buffered||0}get currentTime(){return this.layer?.currentTime||0}get duration(){return this.layer?.duration||0}get ended(){return this.layer?.ended??!0}get metadata(){const e=this.layer?.metadata;return e?{missionInfo:o(e,[s.MissionId,s.PrecisionTimeStamp]),platformInfo:o(e,[s.PlatformTailNumber,s.PlatformTrueAirspeed,s.PlatformCallSign,s.PlatformDesignation,s.PlatformGroundRange]),frameInfo:o(e,[s.FrameCenterElevation,s.FrameCenterLatitude,s.FrameCenterLongitude])}:null}get playing(){return this.layer?.playing??!1}get state(){return this.layer?.loadError?"error":this.layer?.state??"not-ready"}play(){this.layer?.play()}pause(){this.layer?.pause()}seekBackward(){if(this.layer){const e=this.layer.currentTime-this.seekLength;e<=0?this.layer.reset():this.layer.setCurrentTime(e)}}seekForward(){if(this.layer){const e=this.layer.currentTime+this.seekLength;e>=this.layer.duration?this.layer.reset():this.layer.setCurrentTime(e)}}seekToBeginning(){this.layer?.setCurrentTime(0)}seekToEnding(){this.layer?.setCurrentTime(this.layer.duration)}seekTo(e){this.layer?.setCurrentTime(e)}toggleSensorDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorLocation=!this.layer.telemetryDisplay.sensorLocation)}toggleSensorPathDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorPath=!this.layer.telemetryDisplay.sensorPath)}toggleSensorSightLineDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.lineOfSight=!this.layer.telemetryDisplay.lineOfSight)}toggleFrameDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frame=!this.layer.telemetryDisplay.frame)}toggleSensorTrailDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorTrail=!this.layer.telemetryDisplay.sensorTrail)}toggleFrameCenterDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frameCenter=!this.layer.telemetryDisplay.frameCenter)}toggleFrameOutlineDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frameOutline=!this.layer.telemetryDisplay.frameOutline)}toggleLoopPlayback(){this.layer&&(this.layer.loop=!this.layer.loop)}changePlaybackSpeed(e){this.layer&&(this.layer.playbackRate=e)}changeGraphicsColor(e){e&&this.layer.updateTelemetryColor(e)}_followTelemetry(){this.removeHandles("follow"),this.view&&this.layer&&this.addHandles(r(()=>this.layer?.telemetry,()=>{const e=[],t="follow-sensor"===this.followingMode||"follow-both"===this.followingMode,r="follow-frame"===this.followingMode||"follow-both"===this.followingMode;t&&this.layer?.telemetry.sensorLocation&&e.push(this.layer.telemetry.sensorLocation),r&&this.layer?.telemetry.frameCenter&&e.push(this.layer.telemetry.frameCenter),e.length?this.view?.goTo(e).catch(()=>{}):this.layer?.initialExtent&&"none"!==this.followingMode&&this.view?.goTo(this.layer.initialExtent).catch(()=>{})},l),"follow")}};e([i({readOnly:!0})],y.prototype,"buffered",null),e([i({readOnly:!0})],y.prototype,"currentTime",null),e([i({readOnly:!0})],y.prototype,"duration",null),e([i({readOnly:!0})],y.prototype,"ended",null),e([i()],y.prototype,"followingMode",void 0),e([i()],y.prototype,"layer",void 0),e([i({readOnly:!0})],y.prototype,"metadata",null),e([i({readOnly:!0})],y.prototype,"playing",null),e([i()],y.prototype,"seekLength",void 0),e([i({readOnly:!0})],y.prototype,"state",null),e([i()],y.prototype,"view",void 0),y=e([a("esri.widgets.VideoPlayer.VideoPlayerViewModel")],y);const n=y;export{n as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{Y as t}from"../../chunks/languageUtils.js";import n from"../../core/Accessor.js";import s from"../../core/Collection.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{destroyMaybe as i}from"../../core/maybe.js";import{EsriPromiseMixin as a}from"../../core/Promise.js";import r from"../../core/ReactiveMap.js";import{on as l}from"../../core/reactiveUtils.js";import{property as c,subclass as u}from"../../core/accessorSupport/decorators.js";import f from"../../layers/support/ContingentValue.js";import d from"../../layers/support/LayerContingentValuesCache.js";import{isFeatureLayer as p,isSubtypeGroupLayer as h}from"../../layers/support/layerUtils.js";import{valueIsValidContingentValue as g}from"../FeatureForm/featureFormUtils.js";const m="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",y="#JSAPI_CONTINGENT_VALUE_ANY_HASH",_="#JSAPI_CONTINGENT_VALUE_NULL_HASH",v={_any:"any",_code:"code",_null:"null",_range:"range"};let V=class extends(a(n)){constructor(e){super(e),this._cacheMap=new r,this._joinedContingenciesMap=new Map,this._optionsMap=new Map,this._violationsMap=new Map,this.layers=new s}initialize(){this.layers.length&&this._onLayersChange(this.layers.toArray()),this.addHandles([l(()=>this.layers,"change",({added:e})=>this._onLayersChange(e))])}destroy(){this.reset()}get fieldsWithContingentValues(){const e=new r;return this._cacheMap.forEach((t,n)=>{e.set(n,new Set(t.fieldGroups.flatMap(e=>e.fields)))}),e}clear(){this._joinedContingenciesMap.clear(),this.resetOptions(),this.resetViolations()}getViolationForField(e,t,n){const s=this._violationsMap.get(e),o=I(e,t),i=s?.get(o);return i?.get(n)||null}getAllViolations(e,t){const n=this._violationsMap.get(e),s=I(e,t),o=n?.get(s);return o?Array.from(o.values()):[]}getFieldValueOptions(e){const{feature:t,layer:n,fieldName:s,emptyString:o}=e,i=A(n,t,s),a=t.getAttribute(s),l=this._optionsMap.get(n),c=I(n,t),u=l?.get(c);if(u){const e=u.get(s);if(e)return e}const f="coded-value"===i?.type?i.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[],d=null==a||f.some(e=>e.value===a)?[]:[{name:`${a}`,value:a}],p=S(n)&&this.fieldsWithContingentValues.get(n)?.has(s)?this._getContingentValueOptionsForField(n,t,s,o):[];let h=null;if(p.length>0){const e=new Set(p.map(e=>e.value));h={recommended:p,other:f.filter(t=>!e.has(t.value)),unsupported:d}}else h={recommended:f,other:[],unsupported:d};if(u)u.set(s,h);else{const e=new r([[s,h]]);l?l.set(c,e):this._optionsMap.set(n,new r([[c,e]]))}return h}getJoinedContingentValues(e,t){return this._joinContingentValues(e,t)}reset(){this.clear(),this._cacheMap.forEach(i),this._cacheMap.clear()}resetOptions(){this._optionsMap.clear()}resetOptionsForFeature(e,t){this._optionsMap.get(e)?.get(t)?.clear()}resetOptionsForLayer(e){this._optionsMap.get(e)?.clear()}resetViolations(){this._violationsMap.clear()}resetViolationsForFeature(e,t){this._violationsMap.get(e)?.get(t)?.clear()}resetViolationsForLayer(e){this._violationsMap.get(e)?.clear()}validateContingencyConstraints(e,t,n){const s=this._cacheMap.get(e);if(!s)return[];const i=F(t),{invalid:a,incomplete:l}=s.validateContingencyConstraints(i),c=[...a,...n?.includeIncompleteViolations?l:[]],u=new r;for(const o of c)for(const e of o.fieldGroup.fields)u.set(e,o);const f=I(e,t);return o(this._violationsMap,e,()=>new r).set(f,u),c}validateContingenciesForNonNullFields(e,t){const n=t.clone();n.attributes=Object.fromEntries(Object.entries(F(t)).filter(([e,t])=>null!=t)),this.validateContingencyConstraints(e,n)}_onLayersChange(e){e.forEach(e=>{let n=null;t(e)?n=e.parent:(p(e)||h(e))&&(n=e),n&&!this._cacheMap.get(n)&&this.addResolvingPromise(d.createLoadedLayerContingentValuesCache(n).then(e=>{e&&this._cacheMap.set(n,e)}))})}_getContingentValueOptionsForField(e,t,n,s){const o=this.getJoinedContingentValues(e,t),i=new Map,a={code:"",name:s??"No value"},{_code:r,_null:l}=v;for(const c of o){const s=c.values[n];if(s?.objectType===r||s?.objectType===l){const{code:o,name:r}=s.codedValue&&s.objectType!==l?s.codedValue:a;!i.has(o)&&this._isValidContingency(e,t,n,c)&&i.set(o,{name:r,value:o})}}return[...i.values()]}_isValidContingency(e,t,n,s){const o={};for(const[i,a]of Object.entries(F(t)))this.fieldsWithContingentValues.get(e)?.has(i)&&null!=a&&i!==n&&(o[i]=a);return Object.entries(o).every(([e,t])=>!s.values.hasOwnProperty(e)||g(t,s.values[e]))}_joinContingentValues(e,t){const n=this._cacheMap.get(e);if(!t||!n)return[];const s=this._joinedContingenciesMap.get(e),o=I(e,t),i=s?.get(o);if(i)return i;const a=n.subtypeFieldName,l=a?t.attributes[a]:null,c=[];for(const r of n.fieldGroups){const{contingencies:e,fields:t,name:n}=r,s=[];for(const o of e)o.isRetired||null!=o.subtype&&o.subtype.code!==l||s.push({values:o.values});s.length>0&&c.push({name:n,fields:t,contingencies:s})}const[u,f]=C(c),d=u.flatMap(n=>L(e,t,n)),p=f.flatMap(e=>e.contingencies),h=[...d,...p];return s?s.set(o,h):this._joinedContingenciesMap.set(e,new r([[o,h]])),[...d,...p]}};function M(e,t){const{_any:n,_null:s,_range:o}=v;return{leftIsNull:e===s,rightIsNull:t===s,bothAreNull:e===s&&t===s,leftIsAny:e===n,rightIsAny:t===n,bothAreAny:e===n&&t===n,leftIsRange:e===o,rightIsRange:t===o}}function j(e,t,n){const{_any:s}=v,o=Array.from(n);return t.filter(t=>o.every(n=>{const o=t.values[n],i=e.values[n];return o.objectType===s||i.objectType===s||o.codedValue?.code===i.codedValue?.code}))}function b(e,t){const n=new RegExp(`${t}$`),s=[];for(const[o,i]of e){if(o===y)break;n.test(o)&&s.push(...i)}return s}function w(e,t,n,s){const o=Array.isArray(n)?new Set(n):n,i=Array.isArray(s)?new Set(s):s,a=o.size<i.size?o:i,r=a===o?i:o,l=new Set,c=new Set;for(const u of a)if(r.has(u)){const n=A(e,t,u,!0);if(null==n)continue;switch(n.type){case"coded-value":l.add(u);break;case"range":c.add(u)}}return{codedValueFields:l,rangeFields:c}}function C(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const o=t.get(e),i=l,a=[o.name,i.name].sort().join("|");if(s.has(a))continue;n.push([o,i]),s.add(a),t.set(e,i)}else t.set(e,l);const o=new Set(n.flat()),i=new Set(e);for(const l of o)i.delete(l);const a=new Map,r=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);a.set(e,new Set([l])),r.set(l,e)}for(const[l,c]of n){const e=r.get(l),t=r.get(c);if(e===t)continue;const n=a.get(e),s=a.get(t);for(const o of s)n.add(o),r.set(o,e);a.delete(t)}return[[...a.values()].map(e=>[...e]),[...i]]}function F(e){return e.attributes}function A(e,t,n,s=!1){return e.getFieldDomain(n,{feature:t,excludeImpliedDomains:s})}function I(e,t){return t.getObjectId()??t.attributes[e.objectIdField]??t}function N(e,t,n=!1){if(t.size<1)return[m,!1];const{_any:s,_null:o}=v,i=[];let a=!1;for(const r of t.values()){const t=e.values[r];if(t.objectType===s){if(n)return[y,!0];a=!0,i.push(`${r}:.*`)}else t.objectType===o?i.push(`${r}:${_}`):i.push(`${r}:${t.codedValue?.code}`)}return[i.sort().join("&"),a]}function S(e){return p(e)||h(e)}function T(e,t){const n={values:{...e.values,...t.values}};for(const[s,o]of Object.entries(n.values))o.objectType===v._any&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}function O(e,t,n){const s=T(e,t),{_null:o,_range:i}=v;for(const a of n.values()){const n=e.values[a],r=t.values[a],{leftIsNull:l,rightIsNull:c,bothAreNull:u,leftIsAny:d,rightIsAny:p,bothAreAny:h,leftIsRange:g,rightIsRange:m}=M(n.objectType,r.objectType);if(u||h)continue;if(l&&p||c&&d){s.values[a]=new f({objectType:o});continue}if(l&&m||c&&g)return null;d?(n.minValue=-1/0,n.maxValue=1/0):p&&(r.minValue=-1/0,r.maxValue=1/0);const y=Math.max(n.minValue,r.minValue),_=Math.min(n.maxValue,r.maxValue);if(y>_)return null;s.values[a]=new f({objectType:i,minValue:y,maxValue:_})}return s}function L(e,t,n){const s=n.slice(),o=s.shift();let i=s.shift(),a=w(e,t,o.fields,i.fields),r=new Set([...o.fields,...i.fields]),l=new Map;for(const u of o.contingencies){const[e]=N(u,a.codedValueFields,!0);l.has(e)?l.get(e)?.push(u):l.set(e,[u])}for(;s.length>0;){const n=new Map,o=s.shift(),c=w(e,t,r,o.fields);for(const e of i.contingencies){const[t,s]=N(e,a.codedValueFields),o=s?b(l,t):l.get(t);if(l.has(y)&&o?.push(...j(e,l.get(y),a.codedValueFields)),null!=o)for(const i of o){const t=a.rangeFields.size>0?O(i,e,a.rangeFields):T(i,e);if(null==t)break;const[s]=N(t,c.codedValueFields,!0);n.has(s)?n.get(s)?.push(t):n.set(s,[t])}}l=n,i=o,a=c,r=new Set([...r,...i.fields])}const c=[];for(const u of i.contingencies){const[e,t]=N(u,a.codedValueFields),n=t?b(l,e):l.get(e);if(l.has(y)&&n.push(...j(u,l.get(y),a.codedValueFields)),null!=n)for(const s of n){const e=a.rangeFields.size>0?O(s,u,a.rangeFields):T(s,u);null!=e&&c.push(e)}}return c}e([c()],V.prototype,"fieldsWithContingentValues",null),e([c()],V.prototype,"layers",void 0),V=e([u("esri.widgets.support.ContingentValuesManager")],V);const E=V;export{E as default};
2
+ import{__decorate as e}from"tslib";import{Y as t}from"../../chunks/languageUtils.js";import n from"../../core/Accessor.js";import s from"../../core/Collection.js";import{abortHandle as o}from"../../core/handleUtils.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import r from"../../core/ReactiveMap.js";import{on as l}from"../../core/reactiveUtils.js";import{property as c,subclass as u}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../core/support/UpdatingHandles.js";import p from"../../layers/support/ContingentValue.js";import{getFeatureSubtype as f}from"../../layers/support/featureLayerUtils.js";import h from"../../layers/support/LayerContingentValuesCache.js";import{isFeatureLayer as g,isSubtypeGroupLayer as m}from"../../layers/support/layerUtils.js";import{valueIsValidContingentValue as y}from"../FeatureForm/featureFormUtils.js";const _="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",V="#JSAPI_CONTINGENT_VALUE_ANY_HASH",v="#JSAPI_CONTINGENT_VALUE_NULL_HASH",b={_any:"any",_code:"code",_null:"null",_range:"range"};let C=class extends n{constructor(e){super(e),this._cacheMap=new r,this._joinedContingenciesMap=new Map,this._optionsMap=new Map,this._pendingCacheLoad=new Set,this._updatingHandles=new d,this._violationsMap=new Map,this.layers=new s}initialize(){this.layers.length&&this._onLayersChange(this.layers.toArray()),this.addHandles([l(()=>this.layers,"change",({added:e})=>this._onLayersChange(e))])}destroy(){this.reset()}get _fieldsWithContingentValues(){const e=new r;return this._cacheMap.forEach((t,n)=>{e.set(n,new Set(t.fieldGroups.flatMap(e=>e.fields)))}),e}get updating(){return this._updatingHandles.updating}clear(){this._joinedContingenciesMap.clear(),this.resetOptions(),this.resetViolations()}getViolationForField(e,t,n){const s=this._violationsMap.get(e),o=N(e,t),i=s?.get(o);return i?.get(n)||null}getAllViolations(e,t){const n=this._violationsMap.get(e),s=N(e,t),o=n?.get(s);return o?Array.from(o.values()):[]}getFieldsWithContingentValues(e){return T(e)?this._fieldsWithContingentValues.get(e)??new Set:new Set}getFieldValueOptions(e){const{feature:t,layer:n,fieldName:s,emptyString:o}=e,i=I(n,t,s),a=t.getAttribute(s),l=this._optionsMap.get(n),c=N(n,t),u=l?.get(c);if(u){const e=u.get(s);if(e)return e}const d="coded-value"===i?.type?i.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[],p=null==a||d.some(e=>e.value===a)?[]:[{name:`${a}`,value:a}],f=T(n)&&this._fieldsWithContingentValues.get(n)?.has(s)?this._getContingentValueOptionsForField(n,t,s,o):[];let h=null;if(f.length>0){const e=new Set(f.map(e=>e.value));h={recommended:f,other:d.filter(t=>!e.has(t.value)),unsupported:p}}else h={recommended:d,other:[],unsupported:p};if(u)u.set(s,h);else{const e=new r([[s,h]]);l?l.set(c,e):this._optionsMap.set(n,new r([[c,e]]))}return h}getJoinedContingentValues(e,t){const n=U(e,t),s=this._joinedContingenciesMap.get(n);if(s)return s;const o=this._cacheMap.get(e);if(!o)return[];const i=this._joinContingentValues(o,t);return this._joinedContingenciesMap.set(n,i),i}getRelatedFields(e,t){return this._cacheMap.get(e)?.getRelatedFields(t)??new Set}hasFieldsWithContingentValues(e){return this.getFieldsWithContingentValues(e).size>0}reset(){this.clear(),this._cacheMap.forEach(a),this._cacheMap.clear()}resetOptions(){this._optionsMap.clear()}resetOptionsForFeature(e,t){this._optionsMap.get(e)?.get(N(e,t))?.clear()}resetOptionsForField(e,t,n){this._optionsMap.get(e)?.get(N(e,t))?.delete(n)}resetOptionsForLayer(e){this._optionsMap.get(e)?.clear()}resetViolations(){this._violationsMap.clear()}resetViolationsForFeature(e,t){this._violationsMap.get(e)?.get(t)?.clear()}resetViolationsForLayer(e){this._violationsMap.get(e)?.clear()}validateContingencyConstraints(e,t,n){const s=this._cacheMap.get(e);if(!s)return[];const o=S(t),{invalid:a,incomplete:l}=s.validateContingencyConstraints(o),c=[...a,...n?.includeIncompleteViolations?l:[]],u=new r;for(const i of c)for(const e of i.fieldGroup.fields)u.set(e,i);const d=N(e,t);return i(this._violationsMap,e,()=>new r).set(d,u),c}validateContingenciesForNonNullFields(e,t){const n=t.clone();n.attributes=Object.fromEntries(Object.entries(S(t)).filter(([e,t])=>null!=t)),this.validateContingencyConstraints(e,n)}_onLayersChange(e){e.forEach(e=>{let n=null;if(t(e)?n=e.parent:(g(e)||m(e))&&(n=e),!n||this._cacheMap.get(n)||this._pendingCacheLoad.has(n))return;const s=new AbortController,i=o(s),a=Symbol();this.addHandles(i,a),this._pendingCacheLoad.add(n),this._updatingHandles.addPromise(h.createLoadedLayerContingentValuesCache(n,s).then(t=>{t&&!s.signal.aborted&&(this.removeHandles(a),this._cacheMap.set(n,t),this.resetOptionsForLayer(e))}).finally(()=>this._pendingCacheLoad.delete(n)))})}_getContingentValueOptionsForField(e,t,n,s){const o=this.getJoinedContingentValues(e,t),i=new Map,a={code:"",name:s??"No value"},{_code:r,_null:l}=b;for(const c of o){const s=c.values[n];if(s?.objectType===r||s?.objectType===l){const{code:o,name:r}=s.codedValue&&s.objectType!==l?s.codedValue:a;!i.has(o)&&this._isValidContingency(e,t,n,c)&&i.set(o,{name:r,value:o})}}return[...i.values()]}_isValidContingency(e,t,n,s){const o=this._fieldsWithContingentValues.get(e);for(const i of o??[]){const e=t.attributes[i];if(i!==n&&null!=e&&s.values.hasOwnProperty(i)&&!y(e,s.values[i]))return!1}return!0}_joinContingentValues(e,t){const n=e.subtypeFieldName,s=n?t.attributes[n]:null,o=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:n}=r,i=[];for(const o of e)o.isRetired||null!=o.subtype&&o.subtype.code!==s||i.push({values:o.values});i.length>0&&o.push({name:n,fields:t,contingencies:i})}const[i,a]=A(o);return[...i.flatMap(n=>E(e.layer,t,n)),...a.flatMap(e=>e.contingencies)]}};function M(e,t){const{_any:n,_null:s,_range:o}=b;return{leftIsNull:e===s,rightIsNull:t===s,bothAreNull:e===s&&t===s,leftIsAny:e===n,rightIsAny:t===n,bothAreAny:e===n&&t===n,leftIsRange:e===o,rightIsRange:t===o}}function F(e,t,n){const{_any:s}=b,o=Array.from(n);return t.filter(t=>o.every(n=>{const o=t.values[n],i=e.values[n];return o.objectType===s||i.objectType===s||o.codedValue?.code===i.codedValue?.code}))}function j(e,t){const n=new RegExp(`${t}$`),s=[];for(const[o,i]of e){if(o===V)break;n.test(o)&&s.push(...i)}return s}function w(e,t,n,s){const o=Array.isArray(n)?new Set(n):n,i=Array.isArray(s)?new Set(s):s,a=o.size<i.size?o:i,r=a===o?i:o,l=new Set,c=new Set;for(const u of a)if(r.has(u)){const n=I(e,t,u,!0);if(null==n)continue;switch(n.type){case"coded-value":l.add(u);break;case"range":c.add(u)}}return{codedValueFields:l,rangeFields:c}}function A(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const o=t.get(e),i=l,a=[o.name,i.name].sort().join("|");if(s.has(a))continue;n.push([o,i]),s.add(a),t.set(e,i)}else t.set(e,l);const o=new Set(n.flat()),i=new Set(e);for(const l of o)i.delete(l);const a=new Map,r=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);a.set(e,new Set([l])),r.set(l,e)}for(const[l,c]of n){const e=r.get(l),t=r.get(c);if(e===t)continue;const n=a.get(e),s=a.get(t);for(const o of s)n.add(o),r.set(o,e);a.delete(t)}return[[...a.values()].map(e=>[...e]),[...i]]}function S(e){return e.attributes}function I(e,t,n,s=!1){return e.getFieldDomain(n,{feature:t,excludeImpliedDomains:s})}function N(e,t){return t.getObjectId()??t.attributes[e.objectIdField]??t}function L(e,t,n=!1){if(t.size<1)return[_,!1];const{_any:s,_null:o}=b,i=[];let a=!1;for(const r of t.values()){const t=e.values[r];if(t.objectType===s){if(n)return[V,!0];a=!0,i.push(`${r}:.*`)}else t.objectType===o?i.push(`${r}:${v}`):i.push(`${r}:${t.codedValue?.code}`)}return[i.sort().join("&"),a]}function T(e){return g(e)||m(e)}function O(e,t){const n={values:{...e.values,...t.values}};for(const[s,o]of Object.entries(n.values))o.objectType===b._any&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}function H(e,t,n){const s=O(e,t),{_null:o,_range:i}=b;for(const a of n.values()){const n=e.values[a],r=t.values[a],{leftIsNull:l,rightIsNull:c,bothAreNull:u,leftIsAny:d,rightIsAny:f,bothAreAny:h,leftIsRange:g,rightIsRange:m}=M(n.objectType,r.objectType);if(u||h)continue;if(l&&f||c&&d){s.values[a]=new p({objectType:o});continue}if(l&&m||c&&g)return null;d?(n.minValue=-1/0,n.maxValue=1/0):f&&(r.minValue=-1/0,r.maxValue=1/0);const y=Math.max(n.minValue,r.minValue),_=Math.min(n.maxValue,r.maxValue);if(y>_)return null;s.values[a]=new p({objectType:i,minValue:y,maxValue:_})}return s}function E(e,t,n){const s=n.slice(),o=s.shift();let i=s.shift(),a=w(e,t,o.fields,i.fields),r=new Set([...o.fields,...i.fields]),l=new Map;for(const u of o.contingencies){const[e]=L(u,a.codedValueFields,!0);l.has(e)?l.get(e)?.push(u):l.set(e,[u])}for(;s.length>0;){const n=new Map,o=s.shift(),c=w(e,t,r,o.fields);for(const e of i.contingencies){const[t,s]=L(e,a.codedValueFields),o=s?j(l,t):l.get(t);if(l.has(V)&&o?.push(...F(e,l.get(V),a.codedValueFields)),null!=o)for(const i of o){const t=a.rangeFields.size>0?H(i,e,a.rangeFields):O(i,e);if(null==t)break;const[s]=L(t,c.codedValueFields,!0);n.has(s)?n.get(s)?.push(t):n.set(s,[t])}}l=n,i=o,a=c,r=new Set([...r,...i.fields])}const c=[];for(const u of i.contingencies){const[e,t]=L(u,a.codedValueFields),n=t?j(l,e):l.get(e);if(l.has(V)&&n.push(...F(u,l.get(V),a.codedValueFields)),null!=n)for(const s of n){const e=a.rangeFields.size>0?H(s,u,a.rangeFields):O(s,u);null!=e&&c.push(e)}}return c}function U(e,t){let n=e.url??e.uid;if(e.subtypes&&e.subtypes.length>0){const s=f(e,t);n+=`|${s?`subtype:${s.code}`:"subtype:null"}`}if(g(e)&&e.types&&e.typeIdField&&e.types.some(e=>Object.keys(e.domains).length>0)){n+=`|${`type:${t.getAttribute(e.typeIdField)}`}`}return n}e([c()],C.prototype,"_fieldsWithContingentValues",null),e([c()],C.prototype,"layers",void 0),e([c()],C.prototype,"updating",null),C=e([u("esri.widgets.support.ContingentValuesManager")],C);export{C as ContingentValuesManager,T as isLayerWithContingentValues};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isTextInput as t}from"../../../form/support/formUtils.js";import{validateDomainValue as e}from"../../../layers/support/domainUtils.js";import{validateFieldValue as n}from"../../../layers/support/fieldUtils.js";import{dateTimeIsInRange as r}from"../dateUtils.js";const i=(t,e)=>{if(!t)return!0;const{operations:n}=t;switch(e){case"INSERT":return n.supportsAdd;case"UPDATE":case"DELETE":return n.supportsUpdate;default:return!0}};function o(t,i){const{dataType:o,domain:u,field:l,maxLength:a,minLength:s,multipleChoice:c,range:m,required:f}=i;if(null==t)return f?"input-validation-error::cannot-be-empty":null;if("text"===o&&"string"==typeof t){if(s>-1&&t.length<s)return"length-validation-error::too-short";if(a>-1&&t.length>a)return"length-validation-error::too-long";if(c){const e=g(t,c.choiceDelimiter);if(null!=c.maximumChoices&&e>c.maximumChoices)return"multiple-choice-validation-error::too-many-selected-choices";if(null!=c.minimumChoices&&e<c.minimumChoices)return"multiple-choice-validation-error::too-few-selected-choices"}}return"date"!==o||r({type:l.type,range:m,value:t})?u?e(l,t,u):n(l,t):"numeric-range-validation-error::out-of-range"}function u(t,e){return!(!l(t)||!l(e))||t===e}function l(t){return null==t||""===t}function a({dataType:e,field:n,input:r}){const i=-1;if("date"===e)return i;const o=c(n.length);if(!r||!t(r))return o;const u=c(r.maxLength);return u===i?o:o===i?u:Math.min(o,u)}function s({dataType:e,field:n,input:r}){const i=-1;if("date"===e)return i;if(!r||!t(r))return i;const o=c(r.minLength);if(o<0)return i;const u=c(n.length);return u>i&&u<o?i:o}function c(t){return"number"==typeof t&&t>-1?t:-1}const m={type:"number"},f={type:"number",intlOptions:{notation:"scientific"}};function p(t){return t>=1e7||t<=-1e7}function d(t,e){return null!=t.max&&null!=t.min?e.outsideRange:null!=t.max?e.outsideRangeMax:e.outsideRangeMin}const h=t=>t&&!Number.isNaN(t.valueOf());function g(t,e){return""===t?0:t.split(e).map(t=>t.trim()).filter(t=>""!==t).length}export{i as capabilitiesAllowEditType,h as dateIsValid,c as ensureMinOrMaxLength,a as getMaxLength,s as getMinLength,d as getRangeErrorMessage,l as isEmptyValue,m as numberFormatOptions,f as scientificNumberFormatOptions,p as shouldUseScientificNotation,o as validateFormValue,u as valuesAreEquivalent};
2
+ import{isTextInput as t}from"../../../form/support/formUtils.js";import{validateDomainValue as e}from"../../../layers/support/domainUtils.js";import{validateFieldValue as n}from"../../../layers/support/fieldUtils.js";import{dateTimeIsInRange as i}from"../dateUtils.js";const r=(t,e)=>{if(!t)return!0;const{operations:n}=t;switch(e){case"INSERT":return n.supportsAdd;case"UPDATE":case"DELETE":return n.supportsUpdate;default:return!0}};function o(t,r){const{dataType:o,domain:u,field:l,maxLength:a,minLength:s,multipleChoice:c,range:m,required:f}=r;if(null==t)return f?"input-validation-error::cannot-be-empty":"text"===o&&null!=c?.minimumChoices&&0<c.minimumChoices?"multiple-choice-validation-error::too-few-selected-choices":null;if("text"===o&&"string"==typeof t){if(s>-1&&t.length<s)return"length-validation-error::too-short";if(a>-1&&t.length>a)return"length-validation-error::too-long";if(c){const e=g(t,c.choiceDelimiter);if(null!=c.maximumChoices&&e>c.maximumChoices)return"multiple-choice-validation-error::too-many-selected-choices";if(null!=c.minimumChoices&&e<c.minimumChoices)return"multiple-choice-validation-error::too-few-selected-choices"}}return"date"!==o||i({type:l.type,range:m,value:t})?u?e(l,t,u):n(l,t):"numeric-range-validation-error::out-of-range"}function u(t,e){return!(!l(t)||!l(e))||t===e}function l(t){return null==t||""===t}function a({dataType:e,field:n,input:i}){const r=-1;if("date"===e)return r;const o=c(n.length);if(!i||!t(i))return o;const u=c(i.maxLength);return u===r?o:o===r?u:Math.min(o,u)}function s({dataType:e,field:n,input:i}){const r=-1;if("date"===e)return r;if(!i||!t(i))return r;const o=c(i.minLength);if(o<0)return r;const u=c(n.length);return u>r&&u<o?r:o}function c(t){return"number"==typeof t&&t>-1?t:-1}const m={type:"number"},f={type:"number",intlOptions:{notation:"scientific"}};function p(t){return t>=1e7||t<=-1e7}function d(t,e){return null!=t.max&&null!=t.min?e.outsideRange:null!=t.max?e.outsideRangeMax:e.outsideRangeMin}const h=t=>t&&!Number.isNaN(t.valueOf());function g(t,e){return""===t?0:t.split(e).map(t=>t.trim()).filter(t=>""!==t).length}export{r as capabilitiesAllowEditType,h as dateIsValid,c as ensureMinOrMaxLength,a as getMaxLength,s as getMinLength,d as getRangeErrorMessage,l as isEmptyValue,m as numberFormatOptions,f as scientificNumberFormatOptions,p as shouldUseScientificNotation,o as validateFormValue,u as valuesAreEquivalent};