@arcgis/core 5.1.0-next.111 → 5.1.0-next.112

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 (266) hide show
  1. package/analysis/ElevationProfile/ElevationProfileGroup.d.ts +3 -0
  2. package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -0
  3. package/analysis/ElevationProfileAnalysis.d.ts +5 -0
  4. package/analysis/ShadowCast/DiscreteOptions.d.ts +2 -2
  5. package/analysis/ShadowCast/TotalDurationOptions.d.ts +13 -4
  6. package/analysis/ShadowCastAnalysis.d.ts +8 -5
  7. package/arcade/Dictionary.js +1 -1
  8. package/arcade/Feature.js +1 -1
  9. package/arcade/Pixel.js +1 -1
  10. package/arcade/Voxel.js +1 -1
  11. package/arcade/arcade.js +1 -1
  12. package/arcade/arcadeAsyncRuntime.js +1 -1
  13. package/arcade/arcadeCompiler.js +1 -1
  14. package/arcade/arcadeEnvironment.js +1 -1
  15. package/arcade/arcadeRuntime.js +1 -1
  16. package/arcade/compilerUtils.js +1 -1
  17. package/arcade/containerUtils.js +1 -1
  18. package/arcade/debug.js +1 -1
  19. package/arcade/enum.js +1 -1
  20. package/arcade/executionError.js +1 -1
  21. package/arcade/functions/convertdirection.js +1 -1
  22. package/arcade/functions/date.js +1 -1
  23. package/arcade/functions/feature.js +1 -1
  24. package/arcade/functions/featuresetbase.js +1 -1
  25. package/arcade/functions/featuresetgeom.js +1 -1
  26. package/arcade/functions/featuresetstats.js +1 -1
  27. package/arcade/functions/featuresetstring.js +1 -1
  28. package/arcade/functions/geomasync.js +1 -1
  29. package/arcade/functions/geometry.js +1 -1
  30. package/arcade/functions/geomsync.js +1 -1
  31. package/arcade/functions/knowledgegraph.js +1 -1
  32. package/arcade/functions/maths.js +1 -1
  33. package/arcade/functions/stats.js +1 -1
  34. package/arcade/functions/string.js +1 -1
  35. package/arcade/functions/track.js +1 -1
  36. package/arcade/geometry/constructors.js +1 -1
  37. package/arcade/geometry/functions.js +1 -1
  38. package/arcade/geometry/unitConversion.js +1 -1
  39. package/arcade.js +1 -1
  40. package/assets/components/assets/icon/returnToDefault16.json +1 -0
  41. package/assets/components/assets/icon/returnToDefault24.json +1 -0
  42. package/assets/components/assets/icon/returnToDefault32.json +1 -0
  43. package/assets/components/assets/icon/reviewMap16.json +1 -0
  44. package/assets/components/assets/icon/reviewMap24.json +1 -0
  45. package/assets/components/assets/icon/reviewMap32.json +1 -0
  46. package/assets/esri/core/workers/RemoteClient.js +1 -1
  47. package/assets/esri/core/workers/chunks/03babc21d1781142a974.js +1 -0
  48. package/assets/esri/core/workers/chunks/08efd64acdfe46985293.js +1 -0
  49. package/assets/esri/core/workers/chunks/0b76534b60014d74ecb9.js +1 -0
  50. package/assets/esri/core/workers/chunks/{622bdd1b9d5d292ec12b.js → 0e6a388d51d9dbae46ba.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{34e026549ba2822b8ebd.js → 13d43a0683c42b94feb6.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{4f9ea7544b2d0e88a05c.js → 13f0e08de2dfab07d212.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{35bbd63319d8aa9f31cc.js → 169c9eb6cd000e067c4b.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{d4014213c476bf8099af.js → 18c4207b1cb0777560ba.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{58c15c42e6a618386a2f.js → 1c8c8050d60205cf2156.js} +1 -1
  56. package/assets/esri/core/workers/chunks/1f537c05c2f643acb5e7.js +1 -0
  57. package/assets/esri/core/workers/chunks/241aeff6afd074ce105b.js +1 -0
  58. package/assets/esri/core/workers/chunks/{ddebc1dc10a2d207389f.js → 282f3d364411efac7b80.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{d6d5ee9d0d998d730f81.js → 2bd334f9ab89334df713.js} +1 -1
  60. package/assets/esri/core/workers/chunks/340c68d09d2e8bef6727.js +2 -0
  61. package/assets/esri/core/workers/chunks/{17604cbd4d24158e2c16.js → 3835097520296b0517af.js} +1 -1
  62. package/assets/esri/core/workers/chunks/481dc7503587972a6bd2.js +2 -0
  63. package/assets/esri/core/workers/chunks/{9f4a9b193485f88d4461.js → 4afe76de6e82e86fe697.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{ac408c62565e2c8b5975.js → 4c5cdd2712c938fafc5d.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{ece30bfd5c49b8d99752.js → 5e5c7cc74ff1c9603aff.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{502c3da8c49bf885f51d.js → 63ea9035dcf9ce45560c.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{33ec193e6d7a0cb9d8dd.js → 6b66a6f69aa03338c346.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{56b6b68d9459b1edea43.js → 6c97b5bc408f051606d2.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{94eab215bab3e4e0e5b5.js → 711d1873c760313e287f.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{4e13d639419ac64f7563.js → 7c077e1a63ab97bf3e87.js} +1 -1
  71. package/assets/esri/core/workers/chunks/86f2de7dda7992ae706c.js +1 -0
  72. package/assets/esri/core/workers/chunks/{a29cd1f5c7bb4f6a5a4f.js → 8d4881c879c86b353e08.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{6e21675bbd7a44070771.js → 8ff83c59462dea6e3427.js} +1 -1
  74. package/assets/esri/core/workers/chunks/979bab62cad788180770.js +1 -0
  75. package/assets/esri/core/workers/chunks/9890c85a238879490926.js +1 -0
  76. package/assets/esri/core/workers/chunks/9ebc461529d5286fa2c2.js +2 -0
  77. package/assets/esri/core/workers/chunks/a95398214e530f896a2d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{fc1fe1f58a65a1694c09.js → b02a68bbab07557cf02d.js} +1 -1
  79. package/assets/esri/core/workers/chunks/ba31616de9d73d83d867.js +1 -0
  80. package/assets/esri/core/workers/chunks/c7662455252b48531da1.js +1 -0
  81. package/assets/esri/core/workers/chunks/ca92176d5348e2c533d7.js +1 -0
  82. package/assets/esri/core/workers/chunks/cd5206e19d86c60e3cf0.js +1 -0
  83. package/assets/esri/core/workers/chunks/{bfb417d72d0c90e116fe.js → cedf3e316d6f89cf7005.js} +1 -1
  84. package/assets/esri/core/workers/chunks/d02aa7438f46c1c2167a.js +2 -0
  85. package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +1 -0
  86. package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +1 -0
  87. package/assets/esri/core/workers/chunks/e0036fa0324a96a88248.js +1 -0
  88. package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js → e5854a3f69dffaf9464d.js} +2 -2
  89. package/assets/esri/core/workers/chunks/ed939fd5d3827a3f70e0.js +1 -0
  90. package/assets/esri/core/workers/chunks/fe8334352d256d691a95.js +1 -0
  91. package/assets/esri/themes/dark/main.css +1 -1
  92. package/assets/esri/themes/light/main.css +1 -1
  93. package/assets/esri/themes/light/view.css +1 -1
  94. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
  95. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
  96. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
  97. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  99. package/chunks/aiServices.js +1 -1
  100. package/chunks/arcade.js +1 -1
  101. package/chunks/array.js +1 -1
  102. package/chunks/languageUtils.js +1 -1
  103. package/config.js +1 -1
  104. package/identity/IdentityModal.js +1 -1
  105. package/kernel.js +1 -1
  106. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  107. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  108. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  109. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
  110. package/layers/support/SceneModification.js +1 -1
  111. package/layers/support/SceneModifications.js +1 -1
  112. package/layers/support/parquetUtils.js +1 -1
  113. package/package.json +2 -2
  114. package/renderers/ClassBreaksRenderer.js +1 -1
  115. package/renderers/UniqueValueRenderer.js +1 -1
  116. package/rest/support/TranslateContent.js +1 -1
  117. package/rest/support/TranslateParameters.js +1 -1
  118. package/rest/support/TranslateResult.js +1 -1
  119. package/rest/translate.js +1 -1
  120. package/rest/utils.js +1 -1
  121. package/support/arcadeUtils.js +1 -1
  122. package/support/revision.js +1 -1
  123. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  124. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  125. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  126. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  127. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  128. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  129. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  130. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  131. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  132. package/views/3d/state/utils/navigationUtils.js +1 -1
  133. package/views/3d/support/QualityProfile.js +1 -1
  134. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  135. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
  136. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  137. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  138. package/views/3d/webgl-engine/lib/PathEvaluator.js +2 -0
  139. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  140. package/views/3d/webgl-engine/lib/PathFrame2D.js +2 -0
  141. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  142. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  143. package/views/3d/webgl-engine/lib/PathVertexInfo.js +2 -0
  144. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  145. package/views/DOMContainer.d.ts +2 -0
  146. package/views/LinkChartView.d.ts +47 -0
  147. package/views/MapView.d.ts +1 -85
  148. package/views/VideoView.d.ts +8 -1
  149. package/views/View2D.d.ts +78 -2
  150. package/views/draw/support/Reshape.js +1 -1
  151. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  152. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  153. package/views/types.d.ts +2 -3
  154. package/views/ui/DefaultUI.d.ts +1 -0
  155. package/widgets/Attachments.js +1 -1
  156. package/widgets/BasemapGallery.js +1 -1
  157. package/widgets/BasemapLayerList.js +1 -1
  158. package/widgets/BasemapToggle.js +1 -1
  159. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  160. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  161. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  162. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  163. package/widgets/BatchAttributeForm.js +1 -1
  164. package/widgets/Bookmarks.js +1 -1
  165. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  166. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  167. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  168. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  169. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  170. package/widgets/CatalogLayerList.js +1 -1
  171. package/widgets/Compass.js +1 -1
  172. package/widgets/CoordinateConversion.js +1 -1
  173. package/widgets/Daylight.js +1 -1
  174. package/widgets/DirectionalPad.js +1 -1
  175. package/widgets/Directions.js +1 -1
  176. package/widgets/Editor/components/FeatureList.js +1 -1
  177. package/widgets/Editor/components/FooterActions.js +1 -1
  178. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  179. package/widgets/Editor/components/Prompt.js +1 -1
  180. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  181. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  182. package/widgets/ElevationProfile.js +1 -1
  183. package/widgets/Expand.js +1 -1
  184. package/widgets/Feature/FeatureMedia.js +1 -1
  185. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  186. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  187. package/widgets/FeatureForm.js +1 -1
  188. package/widgets/FeatureTable.js +1 -1
  189. package/widgets/Features/FeaturesDrillIn.js +1 -1
  190. package/widgets/Features.js +1 -1
  191. package/widgets/FloorFilter.js +1 -1
  192. package/widgets/FovOverlay.js +1 -1
  193. package/widgets/Fullscreen.js +1 -1
  194. package/widgets/Home.js +1 -1
  195. package/widgets/LayerList/LayerListItem.js +1 -1
  196. package/widgets/LayerList.js +1 -1
  197. package/widgets/Locate.js +1 -1
  198. package/widgets/NavigationToggle.js +1 -1
  199. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  200. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  201. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  202. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  203. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  204. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  205. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  206. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  207. package/widgets/OrientedImageryViewer.js +1 -1
  208. package/widgets/PanoramicVideoViewer.js +1 -1
  209. package/widgets/Print.js +1 -1
  210. package/widgets/Search.js +1 -1
  211. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  212. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  213. package/widgets/Sketch.js +1 -1
  214. package/widgets/Slice.js +1 -1
  215. package/widgets/Slider.js +1 -1
  216. package/widgets/Swipe.js +1 -1
  217. package/widgets/TableList.js +1 -1
  218. package/widgets/TimeSlider.js +1 -1
  219. package/widgets/TimeZoneLabel.js +1 -1
  220. package/widgets/Track.js +1 -1
  221. package/widgets/UtilityNetworkAssociations.js +1 -1
  222. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  223. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  224. package/widgets/UtilityNetworkTrace.js +1 -1
  225. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  226. package/widgets/ValuePicker.js +1 -1
  227. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  228. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  229. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  230. package/widgets/Weather.js +1 -1
  231. package/widgets/Zoom.js +1 -1
  232. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  233. package/widgets/support/ColorPicker.js +1 -1
  234. package/widgets/support/ContingentValuesManager.js +1 -1
  235. package/widgets/support/FilterBuilder.js +1 -1
  236. package/widgets/support/GridControls.js +1 -1
  237. package/widgets/support/ItemList.js +1 -1
  238. package/widgets/support/LabeledSwitch.js +1 -1
  239. package/widgets/support/SelectionList.js +1 -1
  240. package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +0 -2
  241. package/assets/esri/core/workers/chunks/286bf3be9f524bde9529.js +0 -1
  242. package/assets/esri/core/workers/chunks/36ecb0082b8804b10fbf.js +0 -1
  243. package/assets/esri/core/workers/chunks/41a95ad470ec42ecd5a2.js +0 -1
  244. package/assets/esri/core/workers/chunks/547dc6ccb989bd962661.js +0 -1
  245. package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +0 -2
  246. package/assets/esri/core/workers/chunks/56d9d3f108ff6e719dd4.js +0 -1
  247. package/assets/esri/core/workers/chunks/5c44638670e40e092ce3.js +0 -1
  248. package/assets/esri/core/workers/chunks/63934843c9f4ef779a07.js +0 -1
  249. package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +0 -2
  250. package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +0 -1
  251. package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +0 -1
  252. package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +0 -1
  253. package/assets/esri/core/workers/chunks/9da2f2b67837b491cfa3.js +0 -1
  254. package/assets/esri/core/workers/chunks/a913a1c83a667ed0e711.js +0 -1
  255. package/assets/esri/core/workers/chunks/b69d1d528e271568cbd8.js +0 -2
  256. package/assets/esri/core/workers/chunks/bc249bb667f0564ad093.js +0 -1
  257. package/assets/esri/core/workers/chunks/c8b96104641cb4afd4df.js +0 -1
  258. package/assets/esri/core/workers/chunks/cdb48d198145493f76f3.js +0 -1
  259. package/assets/esri/core/workers/chunks/e2bb95d601789bbda73b.js +0 -1
  260. package/assets/esri/core/workers/chunks/f1bb426400dac02880f1.js +0 -1
  261. package/assets/esri/core/workers/chunks/f3f984c62311c20a9db8.js +0 -1
  262. /package/assets/esri/core/workers/chunks/{69c9eb93553b006b640d.js.LICENSE.txt → 340c68d09d2e8bef6727.js.LICENSE.txt} +0 -0
  263. /package/assets/esri/core/workers/chunks/{549d348ca181d06aefb7.js.LICENSE.txt → 481dc7503587972a6bd2.js.LICENSE.txt} +0 -0
  264. /package/assets/esri/core/workers/chunks/{1d1929f98d941179be29.js.LICENSE.txt → 9ebc461529d5286fa2c2.js.LICENSE.txt} +0 -0
  265. /package/assets/esri/core/workers/chunks/{b69d1d528e271568cbd8.js.LICENSE.txt → d02aa7438f46c1c2167a.js.LICENSE.txt} +0 -0
  266. /package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js.LICENSE.txt → e5854a3f69dffaf9464d.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 e}from"tslib";import{substitute as t,formatNumber as i}from"../intl.js";import o from"../core/Collection.js";import{deprecateWidget as s}from"../core/deprecate.js";import n from"../core/Logger.js";import{ignoreAbortErrors as r}from"../core/promiseUtils.js";import{watch as l,initial as a,when as d}from"../core/reactiveUtils.js";import{waitAnimationFrame as c}from"../core/scheduling.js";import{throttle as u}from"../core/throttle.js";import{property as h,subclass as p}from"../core/accessorSupport/decorators.js";import{loadActionUtilsComponents as v,substituteActionImage as m,getActionStyles as g,renderAction as w}from"../support/actions/actionUtils.js";import _ from"./Feature.js";import M from"./Spinner.js";import f from"./Widget.js";import{css as F}from"./Feature/resources.js";import{FeatureContentMixin as y}from"./Feature/support/FeatureContentMixin.js";import{css as b}from"./Features/css.js";import I from"./Features/FeaturesDrillIn.js";import C from"./Features/FeaturesViewModel.js";import A from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as x}from"./Popup/actions.js";import{zoomToLocation as T}from"./Popup/actionUtils.js";import{loadCalciteComponents as N}from"./support/componentsUtils.js";import{globalCss as k}from"./support/globalCss.js";import{Heading as O}from"./support/Heading.js";import{tsx as E,messageBundle as W,vmEvent as D}from"./support/widget.js";import{setFocus as L}from"./support/widgetUtils.js";const B="selected-index",S=0,j="features-spinner";function R(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let H=class extends(y(f)){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new o,this._drillInWidget=new I({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new x,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new C({suppressDeprecationWarning:!0}),this.visibleElements=new A,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=u(()=>this._displaySpinner(),S),!0!==e?.suppressDeprecationWarning&&s(n.getLogger(this),"Features","arcgis-features",{version:"4.34"}),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,l(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),l(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),l(()=>this.visibleElements?.closeButton,e=>this._drillInWidget.closable=e),l(()=>this.visibleElements?.spinner,e=>this._spinnerEnabledChange(e)),l(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),l(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),l(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),l(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),l(()=>this.selectedFeatureWidget?.viewModel,()=>this._destroyDrillInFlowItemWidgets()),l(()=>this.featureMenuOpen,()=>this._drillInWidget.selectLastFlowItem="list"===this.initialDisplayMode||!this.featureMenuOpen,a),l(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),l(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),l(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),l(()=>this._drillInFlowItems.length,()=>this._focusFlowItemNode()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on("zoom-to-feature",({featureWidget:e})=>T(this.viewModel,e))])}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}loadDependencies(){return Promise.all([v(),N({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&("list"===this.initialDisplayMode||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new _({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l,suppressDeprecationWarning:!0}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():n.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode():n.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(B);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(d(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return E("div",{afterCreate:this._storeRootNode,bind:this,class:this.classes(b.base,k.widget,k.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),"list"===this.initialDisplayMode?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?E("div",{class:b.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?E("div",{class:b.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){const{messages:e,viewModel:o}=this,{featureCount:s,selectedFeatureIndex:n}=o;return E("div",{class:b.paginationText,key:"feature-pagination-text"},t(e.pageText,{index:i(n+1),total:i(s)}))}_renderFeatureMenuButton(){const{messages:e,viewModel:o}=this,{featureCount:s,selectedFeatureIndex:n,pendingPromisesCount:r}=o;return E("calcite-action",{bind:this,class:b.paginationMenuButton,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:r>0,onclick:this._handlePaginationMenuButton,text:t(e.pageText,{index:i(n+1),total:i(s)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return E("calcite-action-bar",{class:b.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},E("calcite-action-group",{scale:"s"},E("calcite-action",{class:b.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,text:e,title:e}),E("calcite-action",{icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,text:t,title:t})))}_renderFeatureMenuItem(e){const{initialDisplayMode:t}=this,{selectedFeatureViewModel:i,featureViewModels:o}=this.viewModel,s=e===i,n=o.indexOf(e);return E("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:s,onCalciteListItemSelect:this._selectFeature},E("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}),"list"===t?E("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}):null)}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(R(o)?o:null)||(R(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])}),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer(),o="list"===this.initialDisplayMode?"none":"single";return t.featureViewModels.length?E("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:o},Array.from(i.keys(),e=>{const t=i.get(e)?.map(e=>this._renderFeatureMenuItem(e)),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?E("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?E("calcite-action",{active:"toggle"===e.type&&e.value,bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:s,_drillInFlowItems:n,initialDisplayMode:r,selectedFeature:l,featureMenuOpen:a}=this,{title:d,active:c}=this.viewModel,u=t.heading&&d?d:"";if("list"===r&&!l)return null;const h=0===n.length&&("list"===r?!!l:!a);return E("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[b.contentFeature]:!0,[b.flowItemCollapsed]:i}),closable:t.closeButton,closed:!c,collapsed:i,collapseDirection:s?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:h,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},u?E(O,{class:this.classes(b.featuresHeading,k.heading),innerHTML:u,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),E("div",{class:this.classes(b.container,b.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,visibleElements:i,featureMenuTitle:o,messages:s,messagesCommon:n,initialDisplayMode:r,featureMenuOpen:l,selectedFeature:a,_collapseEnabled:d,_isCollapsed:c,featureNavigationTop:u,headingLevel:h}=this,{active:p,featureViewModels:v,pendingPromisesCount:m}=e,{featureMenuHeading:g}=i,w=o??s.selectFeature;if("feature"===r&&!l)return null;const _="list"===r?!a:l;return E("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[b.flowItemCollapsed]:c}),closable:"list"===r&&i.closeButton,closed:!p,collapsed:"list"===r&&c,collapseDirection:u?"down":"up",collapsible:"list"===r&&d,description:g?t(s.total,{total:v.length}):void 0,heading:g?w:void 0,headingLevel:h,key:"feature-menu",loading:e.waitingForContents,selected:_,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},"list"===r?this._renderHeaderActions():null,m>0?E("calcite-loader",{class:b.loader,inline:!0,key:"feature-menu-loader",label:n.loading,slot:"header-actions-end"}):null,E("div",{class:b.container},this._renderFeatureMenu()),E("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:b.featureMenuObserver}),"feature"===r?E("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-start",width:"full"},n.back):null)}_renderContentContainer(){const e="list"===this.initialDisplayMode?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?E("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=m({action:e,feature:this.selectedFeature}),s={[b.icon]:!!t,[b.actionImage]:!!o};return t&&(s[t]=!0),o||t?E("span",{"aria-hidden":"true",class:this.classes(b.icon,s),key:"icon",styles:g(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?E("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},E("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map((e,t)=>{const i=this._getActionTitle(e);return w(e,{key:`action-${t}`,title:i,text:i,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))})}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?E("div",{class:F.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=(await import("../geometry/operators/labelPointOperator.js")).execute(i);this.open({features:[t],location:null!=o?o:void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await r(c(e));const t=this._rootNode?.querySelector("calcite-flow-item[selected]");L(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),"feature"===this.initialDisplayMode?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){const{messages:i,selectedFeature:o,messagesCommon:s}=this,{id:n}=e,r=o?.attributes,l=e.title??"",a="zoom-to-feature"===n?t(l,{messages:i}):"remove-selected-feature"===n?t(l,{messages:s}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?t(l,{messages:i}):e.title;return a&&r?t(a,r):a??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=l(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(e,B)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode?.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:e})=>e===i);o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex(e=>e.uid===i),n=o.at(s);"toggle"===n?.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new M({view:e}),e.ui.add(this._spinner,{key:j,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),"activeCategory"in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e}=this;e&&(e.view?.ui?.remove(e,j),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([h()],H.prototype,"_drillInFlowItems",void 0),e([h()],H.prototype,"_hideActionText",null),e([h()],H.prototype,"_featureNavigationVisible",null),e([h()],H.prototype,"_isCollapsed",null),e([h()],H.prototype,"_collapseEnabled",null),e([h({readOnly:!0})],H.prototype,"active",null),e([h()],H.prototype,"collapsed",void 0),e([h()],H.prototype,"content",null),e([h()],H.prototype,"icon",null),e([h()],H.prototype,"featureMenuOpen",null),e([h()],H.prototype,"featureMenuTitle",null),e([h()],H.prototype,"featureNavigationTop",void 0),e([h()],H.prototype,"features",null),e([h()],H.prototype,"goToOverride",null),e([h({type:x})],H.prototype,"headerActions",void 0),e([h()],H.prototype,"headingLevel",void 0),e([h()],H.prototype,"initialDisplayMode",null),e([h()],H.prototype,"location",null),e([h()],H.prototype,"label",null),e([h()],H.prototype,"map",null),e([h(),W("esri/widgets/Features/t9n/Features")],H.prototype,"messages",void 0),e([h(),W("esri/t9n/common")],H.prototype,"messagesCommon",void 0),e([h()],H.prototype,"promises",null),e([h()],H.prototype,"responsiveActionsEnabled",void 0),e([h({readOnly:!0})],H.prototype,"selectedFeature",null),e([h({readOnly:!0})],H.prototype,"selectedDrillInFeature",null),e([h()],H.prototype,"selectedFeatureIndex",null),e([h({readOnly:!0})],H.prototype,"selectedFeatureWidget",null),e([h()],H.prototype,"spatialReference",null),e([h()],H.prototype,"title",null),e([h()],H.prototype,"timeZone",null),e([h()],H.prototype,"updateLocationEnabled",null),e([h()],H.prototype,"view",null),e([h({type:C}),D(["triggerAction","trigger-action"])],H.prototype,"viewModel",void 0),e([h({type:A,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([h()],H.prototype,"visible",null),H=e([p("esri.widgets.Features")],H);export{H as default};
2
+ import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../intl.js";import o from"../core/Collection.js";import{deprecateWidget as s}from"../core/deprecate.js";import n from"../core/Logger.js";import{ignoreAbortErrors as r}from"../core/promiseUtils.js";import{watch as l,initial as a,when as d}from"../core/reactiveUtils.js";import{waitAnimationFrame as c}from"../core/scheduling.js";import{throttle as u}from"../core/throttle.js";import{property as h,subclass as p}from"../core/accessorSupport/decorators.js";import{loadActionUtilsComponents as v,substituteActionImage as m,getActionStyles as g,renderAction as w}from"../support/actions/actionUtils.js";import _ from"./Feature.js";import M from"./Spinner.js";import f from"./Widget.js";import{css as F}from"./Feature/resources.js";import{FeatureContentMixin as y}from"./Feature/support/FeatureContentMixin.js";import{css as b}from"./Features/css.js";import I from"./Features/FeaturesDrillIn.js";import C from"./Features/FeaturesViewModel.js";import A from"./Features/FeaturesVisibleElements.js";import{ActionsCollection as x}from"./Popup/actions.js";import{zoomToLocation as T}from"./Popup/actionUtils.js";import{loadCalciteComponents as N}from"./support/componentsUtils.js";import{globalCss as k}from"./support/globalCss.js";import{Heading as O}from"./support/Heading.js";import{tsx as E,messageBundle as W,vmEvent as D}from"./support/widget.js";import{setFocus as L}from"./support/widgetUtils.js";const B="selected-index",S=0,j="features-spinner";function R(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let H=class extends(y(f)){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new o,this._drillInWidget=new I({flowItems:this._drillInFlowItems}),this._rootNode=null,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new x,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new C({suppressDeprecationWarning:!0}),this.visibleElements=new A,this._previousFeature=()=>{this.viewModel.previous()},this._nextFeature=()=>{this.viewModel.next()},this._handleFeatureBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this._openFeatureMenu()},this._handleFeatureMenuBack=()=>{"list"===this.initialDisplayMode?(this.selectedFeatureIndex=-1,this._focusFlowItemNode()):this.featureMenuOpen&&this._closeFeatureMenu()},this._storeRootNode=e=>{this._rootNode=e},this._displaySpinnerThrottled=u(()=>this._displaySpinner(),S),!0!==e?.suppressDeprecationWarning&&s(n.getLogger(this),"Features","arcgis-features",{version:"4.34"}),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,l(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),l(()=>this.viewModel?.active,e=>this._drillInWidget.closed=!e),l(()=>this.visibleElements?.closeButton,e=>this._drillInWidget.closable=e),l(()=>this.visibleElements?.spinner,e=>this._spinnerEnabledChange(e)),l(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),l(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),l(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),l(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),l(()=>this.selectedFeatureWidget?.viewModel,()=>this._destroyDrillInFlowItemWidgets()),l(()=>this.featureMenuOpen,()=>this._drillInWidget.selectLastFlowItem="list"===this.initialDisplayMode||!this.featureMenuOpen,a),l(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]},()=>this._setTitleFromFeatureWidget()),l(()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]},()=>this._setContentFromFeatureWidget()),l(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),l(()=>this._drillInFlowItems.length,()=>this._focusFlowItemNode()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:e})=>this._openRelatedFeature(e)),this._drillInWidget.on("zoom-to-feature",({featureWidget:e})=>T(this.viewModel,e))])}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}loadDependencies(){return Promise.all([v(),N({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})])}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return"xsmall"===e||"small"===e||"medium"===e}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&("list"===this.initialDisplayMode||!!this.title&&!!this.content)}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get featureMenuTitle(){return this.viewModel.featureMenuTitle}set featureMenuTitle(e){this.viewModel.featureMenuTitle=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get initialDisplayMode(){return this.viewModel.initialDisplayMode}set initialDisplayMode(e){this.viewModel.initialDisplayMode=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return"feature-association"===t||"feature-relationship"===t?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:s,map:n}=this,{selectedFeatureViewModel:r}=this.viewModel,l={title:!1};return r?(e?(e.viewModel=r,e.visibleElements=l):this._feature=new _({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:s,map:n,viewModel:r,visibleElements:l,suppressDeprecationWarning:!0}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():n.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode():n.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(B);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(d(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return E("div",{afterCreate:this._storeRootNode,bind:this,class:this.classes(b.base,k.widget,k.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),"list"===this.initialDisplayMode?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?E("div",{class:b.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?E("div",{class:b.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation()):null}_renderFeaturePaginationText(){const{messages:e,viewModel:o}=this,{featureCount:s,selectedFeatureIndex:n}=o;return E("div",{class:b.paginationText,key:"feature-pagination-text"},t(e.pageText,{index:i(n+1),total:i(s)}))}_renderFeatureMenuButton(){const{messages:e,viewModel:o}=this,{featureCount:s,selectedFeatureIndex:n,pendingPromisesCount:r}=o;return E("calcite-action",{bind:this,class:b.paginationMenuButton,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:r>0,text:t(e.pageText,{index:i(n+1),total:i(s)}),textEnabled:!0,title:e.selectFeature,onclick:this._handlePaginationMenuButton})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return E("calcite-action-bar",{class:b.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},E("calcite-action-group",{scale:"s"},E("calcite-action",{class:b.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,text:e,title:e,onclick:this._previousFeature}),E("calcite-action",{icon:"chevron-right",iconFlipRtl:!0,label:t,text:t,title:t,onclick:this._nextFeature})))}_renderFeatureMenuItem(e){const{initialDisplayMode:t}=this,{selectedFeatureViewModel:i,featureViewModels:o}=this.viewModel,s=e===i,n=o.indexOf(e);return E("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,selected:s,onblur:this._removeActiveFeature,onCalciteListItemSelect:this._selectFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature},E("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}),"list"===t?E("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}):null)}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(e=>{const i=e?.graphic;if(!i)return;const{layer:o,sourceLayer:s}=i,n=(R(o)?o:null)||(R(s)?s:null),r=t.get(n)??[];t.set(n,[...r,e])}),t}_renderFeatureMenu(){const{messages:e,viewModel:t}=this,i=this._groupResultsByLayer(),o="list"===this.initialDisplayMode?"none":"single";return t.featureViewModels.length?E("calcite-list",{displayMode:"flat",label:e?.featuresList,selectionAppearance:"icon",selectionMode:o},Array.from(i.keys(),e=>{const t=i.get(e)?.map(e=>this._renderFeatureMenuItem(e)),o=e?e.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&null!==o?E("calcite-list-item-group",{heading:o,key:e?.uid||"map-graphics"},t):t})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?E("calcite-action",{active:"toggle"===e.type&&e.value,bind:this,"data-action-id":e.id,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,slot:"header-actions-end",text:i,title:i,onclick:this._triggerHeaderAction}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:s,_drillInFlowItems:n,initialDisplayMode:r,selectedFeature:l,featureMenuOpen:a}=this,{title:d,active:c}=this.viewModel,u=t.heading&&d?d:"";if("list"===r&&!l)return null;const h=0===n.length&&("list"===r?!!l:!a);return E("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[b.contentFeature]:!0,[b.flowItemCollapsed]:i}),closable:t.closeButton,closed:!c,collapsed:i,collapseDirection:s?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",selected:h,onCalciteFlowItemBack:this._handleFeatureBack,onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},u?E(O,{class:this.classes(b.featuresHeading,k.heading),innerHTML:u,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),E("div",{class:this.classes(b.container,b.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,visibleElements:i,featureMenuTitle:o,messages:s,messagesCommon:n,initialDisplayMode:r,featureMenuOpen:l,selectedFeature:a,_collapseEnabled:d,_isCollapsed:c,featureNavigationTop:u,headingLevel:h}=this,{active:p,featureViewModels:v,pendingPromisesCount:m}=e,{featureMenuHeading:g}=i,w=o??s.selectFeature;if("feature"===r&&!l)return null;const _="list"===r?!a:l;return E("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,class:this.classes({[b.flowItemCollapsed]:c}),closable:"list"===r&&i.closeButton,closed:!p,collapsed:"list"===r&&c,collapseDirection:u?"down":"up",collapsible:"list"===r&&d,description:g?t(s.total,{total:v.length}):void 0,heading:g?w:void 0,headingLevel:h,key:"feature-menu",loading:e.waitingForContents,selected:_,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleFeatureMenuBack()},onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},"list"===r?this._renderHeaderActions():null,m>0?E("calcite-loader",{class:b.loader,inline:!0,key:"feature-menu-loader",label:n.loading,slot:"header-actions-end"}):null,E("div",{class:b.container},this._renderFeatureMenu()),E("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:b.featureMenuObserver}),"feature"===r?E("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:this._handleFeatureMenuBack},n.back):null)}_renderContentContainer(){const e="list"===this.initialDisplayMode?[this._renderFeatureMenuContainer(),this._renderContentFeature(),this._drillInWidget.render()]:[this._renderContentFeature(),this._drillInWidget.render(),this._renderFeatureMenuContainer()];return this.visibleElements.flow?E("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=m({action:e,feature:this.selectedFeature}),s={[b.icon]:!!t,[b.actionImage]:!!o};return t&&(s[t]=!0),o||t?E("span",{"aria-hidden":"true",class:this.classes(b.icon,s),key:"icon",styles:g(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?E("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},E("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map((e,t)=>{const i=this._getActionTitle(e);return w(e,{key:`action-${t}`,title:i,text:i,textEnabled:!this._hideActionText,onclick:this._triggerAction,bind:this},this._getFallbackIcon(e))})}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?E("div",{class:F.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=(await import("../geometry/operators/labelPointOperator.js")).execute(i);this.open({features:[t],location:null!=o?o:void 0}),this._focusFlowItemNode()}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e,this._focusFlowItemNode()}async _focusFlowItemNode(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await r(c(e));const t=this._rootNode?.querySelector("calcite-flow-item[selected]");L(t)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),"feature"===this.initialDisplayMode?this._handleFeatureMenuBack():this._focusFlowItemNode()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){const{messages:i,selectedFeature:o,messagesCommon:s}=this,{id:n}=e,r=o?.attributes,l=e.title??"",a="zoom-to-feature"===n?t(l,{messages:i}):"remove-selected-feature"===n?t(l,{messages:s}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?t(l,{messages:i}):e.title;return a&&r?t(a,r):a??""}_onMainKeydown(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode?.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=l(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(e,B)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode?.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:e})=>e===i);o&&!o.disabled&&("toggle"===o?.type&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex(e=>e.uid===i),n=o.at(s);"toggle"===n?.type&&(n.value=!n.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new M({view:e}),e.ui.add(this._spinner,{key:j,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),"activeCategory"in e.viewModel&&(e.viewModel.activeCategory=null),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e}=this;e&&(e.view?.ui?.remove(e,j),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([h()],H.prototype,"_drillInFlowItems",void 0),e([h()],H.prototype,"_hideActionText",null),e([h()],H.prototype,"_featureNavigationVisible",null),e([h()],H.prototype,"_isCollapsed",null),e([h()],H.prototype,"_collapseEnabled",null),e([h({readOnly:!0})],H.prototype,"active",null),e([h()],H.prototype,"collapsed",void 0),e([h()],H.prototype,"content",null),e([h()],H.prototype,"icon",null),e([h()],H.prototype,"featureMenuOpen",null),e([h()],H.prototype,"featureMenuTitle",null),e([h()],H.prototype,"featureNavigationTop",void 0),e([h()],H.prototype,"features",null),e([h()],H.prototype,"goToOverride",null),e([h({type:x})],H.prototype,"headerActions",void 0),e([h()],H.prototype,"headingLevel",void 0),e([h()],H.prototype,"initialDisplayMode",null),e([h()],H.prototype,"location",null),e([h()],H.prototype,"label",null),e([h()],H.prototype,"map",null),e([h(),W("esri/widgets/Features/t9n/Features")],H.prototype,"messages",void 0),e([h(),W("esri/t9n/common")],H.prototype,"messagesCommon",void 0),e([h()],H.prototype,"promises",null),e([h()],H.prototype,"responsiveActionsEnabled",void 0),e([h({readOnly:!0})],H.prototype,"selectedFeature",null),e([h({readOnly:!0})],H.prototype,"selectedDrillInFeature",null),e([h()],H.prototype,"selectedFeatureIndex",null),e([h({readOnly:!0})],H.prototype,"selectedFeatureWidget",null),e([h()],H.prototype,"spatialReference",null),e([h()],H.prototype,"title",null),e([h()],H.prototype,"timeZone",null),e([h()],H.prototype,"updateLocationEnabled",null),e([h()],H.prototype,"view",null),e([h({type:C}),D(["triggerAction","trigger-action"])],H.prototype,"viewModel",void 0),e([h({type:A,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([h()],H.prototype,"visible",null),H=e([p("esri.widgets.Features")],H);export{H 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{deprecateWidget as i}from"../core/deprecate.js";import s from"../core/Logger.js";import{watch as l}from"../core/reactiveUtils.js";import{property as n,subclass as o}from"../core/accessorSupport/decorators.js";import r from"./Widget.js";import{css as a}from"./FloorFilter/css.js";import c from"./FloorFilter/FloorFilterViewModel.js";import{loadCalciteComponents as h}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{Heading as u,incrementHeadingLevel as v}from"./support/Heading.js";import{messageBundle as m,tsx as g}from"./support/widget.js";import{isRTL as M,storeNode as f}from"./support/widgetUtils.js";const p=new Set(["ArrowUp","ArrowDown","End","Home"]);let _=class extends r{constructor(e,t){super(e,t),this._activeMenu=null,this._activeMenuIndex={levels:-1,menuItems:-1},this._baseNode=null,this._facilitiesListNode=null,this._levelsListNode=null,this._sitesListNode=null,this._searchInput=null,this.viewModel=new c,this.messages=null,this.messagesCommon=null,this.headingLevel=2,this.announceDeprecation=()=>{i(s.getLogger(this),"Floor Filter","arcgis-floor-filter",{version:"5.0"})},this._resizeObserver=new ResizeObserver(()=>this.scheduleRender()),this.addHandles(l(()=>this._searchInput,()=>this._focusSearch()))}loadDependencies(){return h({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._resizeObserver?.disconnect()}get enabled(){return this.viewModel.enabled}set enabled(e){this.viewModel.enabled=e}get longNames(){return this.viewModel.longNames}set longNames(e){this.viewModel.longNames=e}get minimized(){return this.viewModel.minimized}set minimized(e){this.viewModel.minimized=e}get pinnedLevels(){return this.viewModel.pinnedLevels}set pinnedLevels(e){this.viewModel.pinnedLevels=e}get site(){return this.viewModel.site}set site(e){this.viewModel.site=e}get facility(){return this.viewModel.facility}set facility(e){this.viewModel.facility=e}get level(){return this.viewModel.level}set level(e){this.viewModel.level=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"urban-model"}set icon(e){this._overrideIfSome("icon",e)}updateWebDocument(e){return this.viewModel.updateWebDocument(e)}render(){const{longNames:e}=this,t=e&&this.viewModel.isNormalMode?"expanded":"collapsed",i=this._renderButtons(),s=this._renderFilterMenu(),l=g("div",{class:this.classes(a.separator)}),n=this._getComponentPosition(),o=this._getPosition(n),r="top-right"===n||"bottom-right"===n,c="top-left"===n||"bottom-left"===n,h=M(this.container),u=h&&c||!h&&r?s:i,v=h&&c||!h&&r?i:s;return g("div",{afterCreate:this._afterBaseNodeCreate,class:this.classes(a.floorFilter,d.widget,`${a.floorFilterLayout}${t}`,`${a.floorFilterPosition}${o}`),key:"floor-filter-menu"},u,this.viewModel?.filterMenuOpen?l:null,v)}_renderButtons(){const e=this._getComponentPosition(),t=[];return"top"===this._getPosition(e)?(t.push(this._renderBrowseButton()),t.push(this._renderLevelButtons()),t.push(this._renderCloseLevelsButton()),t.push(this._renderZoomButton()),t.push(this._renderCollapseToggleButton())):(t.push(this._renderCollapseToggleButton()),t.push(this._renderZoomButton()),t.push(this._renderCloseLevelsButton()),t.push(this._renderLevelButtons()),t.push(this._renderBrowseButton())),g("div",{class:this.classes(d.widget,a.buttonContainer),key:"button-container"},t)}_renderBrowseButton(){const{longNames:e,messages:t}=this;return g("button",{"aria-expanded":this.viewModel.filterMenuOpen.toString(),"aria-label":t.buttons.browse,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,("loading"===this.viewModel.state||"disabled"===this.viewModel.state)&&d.buttonDisabled,a.browseButton,this.viewModel?.filterMenuOpen&&d.widgetButtonActive),key:"browse-button",onclick:this._toggleFilterMenu,title:t.buttons.browse,type:"button"},g("div",{class:this.classes(a.buttonInfo)},g("calcite-icon",{icon:this.icon,scale:"s"}),g("span",{class:this.classes(a.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.browse:null)))}_renderLevelButtons(){if(!this.viewModel?.filterFeatures?.levels?.levelsInfo||!this.facility)return null;const{facility:e,messagesCommon:i,messages:s}=this,l=this.viewModel?.getFacility(e),n=this.viewModel?.getFacilityLevels(e),o=n.map(e=>this._renderLevelButton(e));if(!o.length)return null;const r=l&&t(s.selector.levelsLabel,{name:`"${l.name}"`});if(this._isWebScene(this.view?.map)&&o?.length>1){const t={id:`all--${e}`,facilityId:e,shortName:i.all,longName:i.all,levelNumber:null,verticalOrder:null},s=this._renderLevelButton(t);o.push(s)}return g("ul",{afterCreate:f,"aria-label":r,bind:this,class:this.classes(a.levelsContainer),"data-id":"levels","data-node-ref":"_levelsListNode",key:"levels-button-container",onkeydown:this._handleListKeydown},o)}_renderLevelButton(e){const{longNames:t}=this,{shortName:i,longName:s,id:l}=e,n=`levels--${l}`,o=this.level===l,r=t&&this.viewModel.isNormalMode?s:i;return this.viewModel.isNormalMode||o||this.viewModel.levelsExpanded?g("li",{key:n},g("button",{bind:this,class:this.classes(d.widgetButton,o?d.widgetButtonActive:null,d.interactive,a.levelButton),"data-id":l,"data-list-id":"levels",onclick:this._levelSelected,onfocus:this._onItemFocus,type:"button"},r)):null}_renderCloseLevelsButton(){if(!this.level||this.viewModel.isNormalMode||!this.viewModel.levelsExpanded)return null;const{messagesCommon:e}=this;return g("button",{"aria-label":e.close,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,a.closeLevelsButton),key:"close-levels-button",onclick:this._closeLevels,title:e.close,type:"button"},g("div",{class:this.classes(a.buttonInfo)},g("calcite-icon",{icon:"x"})))}_renderZoomButton(){const{longNames:e,messages:t,facility:i,site:s}=this,l=this.viewModel?.filterMenuType,n=this.viewModel?.filterMenuOpen,o=this.viewModel?.getSite(s),r=this.viewModel?.getFacility(i),c="site"===l&&n?!o:!r;return g("button",{"aria-label":t.buttons.zoomTo,bind:this,class:this.classes(d.widget,d.widgetButton,c&&d.buttonDisabled,d.interactive,this.viewModel?.getFacilityLevels(i).length>0?a.zoomButtonLevels:a.zoomButton),key:"zoom-button",onclick:this._zoomToClicked,title:t.buttons.zoomTo,type:"button"},g("div",{class:this.classes(a.buttonInfo)},g("calcite-icon",{icon:"zoom-to-object",scale:"s"}),g("span",{class:this.classes(a.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.zoomTo:null)))}_renderCollapseToggleButton(){const{longNames:e,messagesCommon:t}=this,i=e?"chevrons-right":"chevrons-left",s=e?t.collapse:t.expand;return g("button",{"aria-label":s,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,a.minimizeToggleButton),key:"minimize-toggle-button",onclick:this._toggleCollapsed,title:s,type:"button"},g("div",{class:this.classes(a.buttonInfo)},g("calcite-icon",{class:this.classes(a.iconFlip),icon:i,scale:"s"}),g("span",{class:this.classes(a.buttonLabel)},e&&this.viewModel.isNormalMode?t.collapse:null)))}_renderFilterMenu(){return this.viewModel?.filterMenuOpen?"site"===this.viewModel?.filterMenuType?this._renderSiteFilterMenu():"facility"===this.viewModel?.filterMenuType?this._renderFacilityFilterMenu():null:null}_renderSiteFilterMenu(){const{messages:e,messagesCommon:t}=this,i=this.site?this.viewModel?.getSite(this.site)?.name:e.selector.selectSite,s=g("div",{class:this.classes(`${a.filterMenuHeader}`),key:"filter-menu-site-header"},g("div",{class:this.classes(a.filterMenuHeaderTextGroup)},g(u,{class:this.classes(a.filterMenuHeaderText),level:this.headingLevel},i)),g("button",{bind:this,class:this.classes(a.iconClose),onclick:this._closeClicked,title:t.close,type:"button"},g("calcite-icon",{icon:"x"}))),l=this._renderSearchInput(),n=this._renderSiteItems();return g("div",{class:this.classes(a.filterMenu),key:"filter-menu-site"},s,l,n)}_renderFacilityFilterMenu(){const{messages:e,messagesCommon:t,site:i}=this,s=this.viewModel?.getSite(i)?.name,l=this.facility&&this.viewModel?.getFacility(this.facility)?.name||e.selector.selectFacility,n=this.viewModel.hasMultipleSites?g("button",{bind:this,class:this.classes(a.filterMenuHeaderBack),onclick:this._backClicked,title:t.back,type:"button"},g("calcite-icon",{class:this.classes(M(this.container)?a.iconRight:a.iconLeft),icon:M(this.container)?"chevron-right":"chevron-left"})):null,o=this.viewModel.hasMultipleSites?g(u,{class:this.classes(a.filterMenuHeaderSubtext),level:v(this.headingLevel)},s):null,r=g("div",{class:this.classes(a.filterMenuHeader),key:"filter-menu-site-header"},n,g("div",{class:this.classes(a.filterMenuHeaderTextGroup)},g(u,{class:this.classes(a.filterMenuHeaderText),level:this.headingLevel},l),o),g("button",{bind:this,class:this.classes(a.iconClose),onclick:this._closeClicked,title:t.close,type:"button"},g("calcite-icon",{icon:"x"}))),c=this._renderSearchInput(),h=this._renderFacilityItems();return g("div",{class:this.classes(a.filterMenu),key:"filter-menu-facility"},r,c,h)}_renderSearchInput(){const{messagesCommon:e}=this,t=!!(this.viewModel.searchTerm&&this.viewModel.searchTerm?.length>0);return g("div",{class:this.classes(a.filterMenuSearch),key:"filter-menu-search"},g("calcite-icon",{icon:"search",key:"filter-menu-search-icon"}),g("input",{afterCreate:f,bind:this,class:this.classes(a.filterMenuSearchInput),"data-node-ref":"_searchInput",oninput:this._onSearchChange,onpaste:this._onSearchChange,placeholder:e.search,value:this.viewModel.searchTerm??void 0}),t?g("calcite-icon",{bind:this,class:this.classes(a.iconClose),icon:"x",key:"filter-menu-search-clear",onclick:this._onSearchClear,title:e.clear}):null)}_renderBlueCircle(){return g("span",{class:this.classes(a.selectedItemCircle),key:"floor-filter__selected-item-circle"})}_renderSiteItems(){if(!this.viewModel?.filterFeatures?.sites?.sitesInfo)return null;const{messages:e}=this,t=this.viewModel.filterFeatures.sites.sitesInfo,i=this.viewModel.filterSites(t).map(e=>this._renderSiteItem(e)),s=0===i.length&&this.viewModel?.searchTerm&&g("div",{class:this.classes(d.empty)},e.noResults);return g("ul",{afterCreate:f,"aria-label":e.selector.sitesLabel,bind:this,class:this.classes(a.filterMenuItems),"data-id":"sites","data-node-ref":"_sitesListNode",key:"filter-menu-items--sites",onkeydown:this._handleListKeydown,tabIndex:-1},i,s)}_renderSiteItem(e){const{name:t,id:i}=e,s=`filter-menu-site--${i}`,l=this.site===i;return g("li",{key:s},g("button",{bind:this,class:this.classes(a.filterMenuSite),"data-id":i,"data-list-id":"sites",onclick:this._siteSelected,onfocus:this._onItemFocus,type:"button"},l?this._renderBlueCircle():null,g("span",{class:this.classes(l?a.filterMenuSelectedItem:a.filterMenuItemName)},t),g("calcite-icon",{class:this.classes(M(this.container)?a.iconLeft:a.iconRight),icon:"chevron-right",scale:"s"})))}_renderFacilityItems(){if(!this.viewModel?.filterFeatures?.facilities?.facilitiesInfo)return null;const{messages:e,site:i}=this,s=this.viewModel.getSite(i),l=this.viewModel.filterFeatures.facilities.facilitiesInfo,n=this.viewModel.filterFacilities(l).map(e=>this._renderFacilityItem(e)),o=0===n.length&&this.viewModel?.searchTerm&&g("div",{class:this.classes(d.empty)},e.noResults),r=s?t(e.selector.siteFacilitiesLabel,{name:`"${s.name}"`}):e.selector.facilitiesLabel;return g("ul",{afterCreate:f,"aria-label":r,bind:this,class:this.classes(a.filterMenuItems),"data-id":"facilities","data-node-ref":"_facilitiesListNode",key:"filter-menu-items--facilities",onkeydown:this._handleListKeydown,tabIndex:-1},n,o)}_renderFacilityItem(e){const{name:t,id:i}=e,s=`filter-menu-facility--${i}`,l=this.facility===i;return g("li",{key:s},g("button",{bind:this,class:this.classes(a.filterMenuFacility),"data-id":i,"data-list-id":"facilities",onclick:this._facilitySelected,onfocus:this._onItemFocus,type:"button"},l?this._renderBlueCircle():null,g("span",{class:this.classes(l?a.filterMenuSelectedItem:a.filterMenuItemName)},t)))}_afterBaseNodeCreate(e){this._baseNode&&this._resizeObserver?.unobserve(this._baseNode),this._baseNode=e,this._resizeObserver?.observe(this._baseNode)}_toggleCollapsed(){this.longNames=!this.longNames}_toggleFilterMenu(){const e=this.viewModel?.filterMenuOpen??!1;this.viewModel.filterMenuOpen=!e}_setFilterMenuType(e){this.viewModel.filterMenuType=e}_zoomToClicked(){if(this.site&&"site"===this.viewModel?.filterMenuType&&this.viewModel?.filterMenuOpen){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}else if(this.facility){const e=this.viewModel?.getFacility(this.facility);this.viewModel.goTo(e)}else if(this.site){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}}_onSearchChange(e){const t=e.target;""===t.value?this.viewModel.searchTerm=null:t.value&&this.viewModel?.searchTerm!==t.value&&(this.viewModel.searchTerm=t.value)}_onSearchClear(){this.viewModel.searchTerm=null}_closeClicked(){this.viewModel.searchTerm=null,this.viewModel.filterMenuOpen=!1}_backClicked(){this._setFilterMenuType("site"),this.viewModel.searchTerm=null}_siteSelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getSite(t);let s=!1;this.site!==t&&(this.facility=null,this.level=null,s=!0,this.viewModel.levelsExpanded=!1),this.site=t,this.viewModel.searchTerm=null,this._setFilterMenuType("facility"),this.viewModel.goTo(i),s&&this.viewModel.setFloors(null)}_facilitySelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getFacility(t);let s=!1;if(this.facility!==t){if("base-floors"===this.viewModel.filterMode){const e=this.viewModel?.getBaseLevel(i);this.level=e?e.id:null}else this.level=null;s=!0,this.viewModel.levelsExpanded=!1}if(this.facility=t,this.viewModel.goTo(i),s){const e=this.viewModel.getLevel(this.level);this.viewModel.setFloors(e)}if(!this.viewModel.isNormalMode){const e=this.viewModel.getFacilityLevels(t);e?.length>1&&(this.viewModel.levelsExpanded=!0)}setTimeout(()=>this._focusActiveLevel(),50)}_levelSelected(e){const t=e.currentTarget.getAttribute("data-id");this.level=t}_closeLevels(){this.viewModel.levelsExpanded=!1}_isWebScene(e){return"esri.WebScene"===e?.declaredClass}_getComponentPosition(){return null!=this.container?this.view?.ui?.getPosition(this.container):null}_getPosition(e){switch(e){case"bottom-right":case"bottom-left":return"bottom";default:return"top"}}_handleListKeydown(e){const t=e.currentTarget.getAttribute("data-id");let i=null;"sites"===t||"facilities"===t?(this._activeMenu!==t&&(this._activeMenuIndex.menuItems=-1),this._activeMenu=t,i="menuItems"):"levels"===t&&(i="levels");const s="sites"===t?this._sitesListNode:"facilities"===t?this._facilitiesListNode:"levels"===t?this._levelsListNode:null,{key:l}=e,n="Tab"===l,o=p.has(l);o&&e.preventDefault();const r=s?.getElementsByTagName("li");r&&0!==r.length&&(o||n)&&this._handleItemNavigation(l,e.shiftKey,r,n,i)}_handleItemNavigation(e,t,i,s,l){if(!l)return;this._activeMenuIndex[l]===i.length&&this._activeMenuIndex[l]--,-1===this._activeMenuIndex[l]&&this._activeMenuIndex[l]++;const n=this._activeMenuIndex[l];switch(e){case"Home":this._activeMenuIndex[l]=0;break;case"End":this._activeMenuIndex[l]=i.length-1;break;case"ArrowUp":this._activeMenuIndex[l]=this._activeMenuIndex[l]<=0?i.length-1:this._activeMenuIndex[l]-1;break;case"ArrowDown":this._activeMenuIndex[l]=this._activeMenuIndex[l]===i.length-1?0:this._activeMenuIndex[l]+1}if("Tab"===e&&t&&this._activeMenuIndex[l]>=0&&this._activeMenuIndex[l]--,"Tab"===e&&!t&&this._activeMenuIndex[l]<i.length&&this._activeMenuIndex[l]++,n!==this._activeMenuIndex[l]&&this._activeMenuIndex[l]>-1&&this._activeMenuIndex[l]<i.length&&!s){const e=i[this._activeMenuIndex[l]].getElementsByTagName("button"),t=1===e?.length?e[0]:null;t?.focus()}}_focusSearch(){this._searchInput?.focus()}_focusActiveLevel(){const{level:e}=this,t=this._levelsListNode,i=t?.getElementsByTagName("li");if(!e||!t||!i)return;const s=this._facilitiesListNode?.getElementsByTagName("li");this._activeMenuIndex.menuItems=s?s.length-1:-1;const l=[];for(let n=0;n<i.length;n++){const e=i[n].getElementsByTagName("button");1===e?.length&&l.push(e[0])}l.forEach((t,i)=>{t.getAttribute("data-id")===e&&(t.focus(),this._activeMenuIndex.levels=i)})}_onItemFocus(e){const t=e.currentTarget,i=t.getAttribute("data-list-id"),s=t.getAttribute("data-id"),l="sites"===i?this._sitesListNode:"facilities"===i?this._facilitiesListNode:"levels"===i?this._levelsListNode:null;if(!l)return;const n=l?.getElementsByTagName("li");if(!n)return;const o=[];Array.from(n).forEach(e=>{const t=e.getElementsByTagName("button");1===t?.length&&o.push(t[0])});let r=null;switch(i){case"sites":case"facilities":r="menuItems";break;case"levels":r="levels"}if(!r)return;const a=r;o.forEach((e,t)=>{e.getAttribute("data-id")===s&&this._activeMenuIndex[a]!==t&&(this._activeMenuIndex[a]=t)})}};e([n()],_.prototype,"_searchInput",void 0),e([n()],_.prototype,"enabled",null),e([n()],_.prototype,"longNames",null),e([n()],_.prototype,"minimized",null),e([n()],_.prototype,"pinnedLevels",null),e([n()],_.prototype,"site",null),e([n()],_.prototype,"facility",null),e([n()],_.prototype,"level",null),e([n()],_.prototype,"view",null),e([n({type:c})],_.prototype,"viewModel",void 0),e([n(),m("esri/widgets/FloorFilter/t9n/FloorFilter")],_.prototype,"messages",void 0),e([n(),m("esri/t9n/common")],_.prototype,"messagesCommon",void 0),e([n()],_.prototype,"goToOverride",null),e([n()],_.prototype,"headingLevel",void 0),e([n()],_.prototype,"icon",null),_=e([o("esri.widgets.FloorFilter")],_);const w=_;export{w as default};
2
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as i}from"../core/deprecate.js";import s from"../core/Logger.js";import{watch as l}from"../core/reactiveUtils.js";import{property as n,subclass as o}from"../core/accessorSupport/decorators.js";import r from"./Widget.js";import{css as a}from"./FloorFilter/css.js";import c from"./FloorFilter/FloorFilterViewModel.js";import{loadCalciteComponents as h}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{Heading as u,incrementHeadingLevel as v}from"./support/Heading.js";import{messageBundle as m,tsx as g}from"./support/widget.js";import{isRTL as M,storeNode as f}from"./support/widgetUtils.js";const p=new Set(["ArrowUp","ArrowDown","End","Home"]);let _=class extends r{constructor(e,t){super(e,t),this._activeMenu=null,this._activeMenuIndex={levels:-1,menuItems:-1},this._baseNode=null,this._facilitiesListNode=null,this._levelsListNode=null,this._sitesListNode=null,this._searchInput=null,this.viewModel=new c,this.messages=null,this.messagesCommon=null,this.headingLevel=2,this.announceDeprecation=()=>{i(s.getLogger(this),"Floor Filter","arcgis-floor-filter",{version:"5.0"})},this._resizeObserver=new ResizeObserver(()=>this.scheduleRender()),this.addHandles(l(()=>this._searchInput,()=>this._focusSearch()))}loadDependencies(){return h({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._resizeObserver?.disconnect()}get enabled(){return this.viewModel.enabled}set enabled(e){this.viewModel.enabled=e}get longNames(){return this.viewModel.longNames}set longNames(e){this.viewModel.longNames=e}get minimized(){return this.viewModel.minimized}set minimized(e){this.viewModel.minimized=e}get pinnedLevels(){return this.viewModel.pinnedLevels}set pinnedLevels(e){this.viewModel.pinnedLevels=e}get site(){return this.viewModel.site}set site(e){this.viewModel.site=e}get facility(){return this.viewModel.facility}set facility(e){this.viewModel.facility=e}get level(){return this.viewModel.level}set level(e){this.viewModel.level=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"urban-model"}set icon(e){this._overrideIfSome("icon",e)}updateWebDocument(e){return this.viewModel.updateWebDocument(e)}render(){const{longNames:e}=this,t=e&&this.viewModel.isNormalMode?"expanded":"collapsed",i=this._renderButtons(),s=this._renderFilterMenu(),l=g("div",{class:this.classes(a.separator)}),n=this._getComponentPosition(),o=this._getPosition(n),r="top-right"===n||"bottom-right"===n,c="top-left"===n||"bottom-left"===n,h=M(this.container),u=h&&c||!h&&r?s:i,v=h&&c||!h&&r?i:s;return g("div",{afterCreate:this._afterBaseNodeCreate,class:this.classes(a.floorFilter,d.widget,`${a.floorFilterLayout}${t}`,`${a.floorFilterPosition}${o}`),key:"floor-filter-menu"},u,this.viewModel?.filterMenuOpen?l:null,v)}_renderButtons(){const e=this._getComponentPosition(),t=[];return"top"===this._getPosition(e)?(t.push(this._renderBrowseButton()),t.push(this._renderLevelButtons()),t.push(this._renderCloseLevelsButton()),t.push(this._renderZoomButton()),t.push(this._renderCollapseToggleButton())):(t.push(this._renderCollapseToggleButton()),t.push(this._renderZoomButton()),t.push(this._renderCloseLevelsButton()),t.push(this._renderLevelButtons()),t.push(this._renderBrowseButton())),g("div",{class:this.classes(d.widget,a.buttonContainer),key:"button-container"},t)}_renderBrowseButton(){const{longNames:e,messages:t}=this;return g("button",{"aria-expanded":this.viewModel.filterMenuOpen.toString(),"aria-label":t.buttons.browse,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,("loading"===this.viewModel.state||"disabled"===this.viewModel.state)&&d.buttonDisabled,a.browseButton,this.viewModel?.filterMenuOpen&&d.widgetButtonActive),key:"browse-button",title:t.buttons.browse,type:"button",onclick:this._toggleFilterMenu},g("div",{class:this.classes(a.buttonInfo)},g("calcite-icon",{icon:this.icon,scale:"s"}),g("span",{class:this.classes(a.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.browse:null)))}_renderLevelButtons(){if(!this.viewModel?.filterFeatures?.levels?.levelsInfo||!this.facility)return null;const{facility:e,messagesCommon:i,messages:s}=this,l=this.viewModel?.getFacility(e),n=this.viewModel?.getFacilityLevels(e),o=n.map(e=>this._renderLevelButton(e));if(!o.length)return null;const r=l&&t(s.selector.levelsLabel,{name:`"${l.name}"`});if(this._isWebScene(this.view?.map)&&o?.length>1){const t={id:`all--${e}`,facilityId:e,shortName:i.all,longName:i.all,levelNumber:null,verticalOrder:null},s=this._renderLevelButton(t);o.push(s)}return g("ul",{afterCreate:f,"aria-label":r,bind:this,class:this.classes(a.levelsContainer),"data-id":"levels","data-node-ref":"_levelsListNode",key:"levels-button-container",onkeydown:this._handleListKeydown},o)}_renderLevelButton(e){const{longNames:t}=this,{shortName:i,longName:s,id:l}=e,n=`levels--${l}`,o=this.level===l,r=t&&this.viewModel.isNormalMode?s:i;return this.viewModel.isNormalMode||o||this.viewModel.levelsExpanded?g("li",{key:n},g("button",{bind:this,class:this.classes(d.widgetButton,o?d.widgetButtonActive:null,d.interactive,a.levelButton),"data-id":l,"data-list-id":"levels",type:"button",onclick:this._levelSelected,onfocus:this._onItemFocus},r)):null}_renderCloseLevelsButton(){if(!this.level||this.viewModel.isNormalMode||!this.viewModel.levelsExpanded)return null;const{messagesCommon:e}=this;return g("button",{"aria-label":e.close,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,a.closeLevelsButton),key:"close-levels-button",title:e.close,type:"button",onclick:this._closeLevels},g("div",{class:this.classes(a.buttonInfo)},g("calcite-icon",{icon:"x"})))}_renderZoomButton(){const{longNames:e,messages:t,facility:i,site:s}=this,l=this.viewModel?.filterMenuType,n=this.viewModel?.filterMenuOpen,o=this.viewModel?.getSite(s),r=this.viewModel?.getFacility(i),c="site"===l&&n?!o:!r;return g("button",{"aria-label":t.buttons.zoomTo,bind:this,class:this.classes(d.widget,d.widgetButton,c&&d.buttonDisabled,d.interactive,this.viewModel?.getFacilityLevels(i).length>0?a.zoomButtonLevels:a.zoomButton),key:"zoom-button",title:t.buttons.zoomTo,type:"button",onclick:this._zoomToClicked},g("div",{class:this.classes(a.buttonInfo)},g("calcite-icon",{icon:"zoom-to-object",scale:"s"}),g("span",{class:this.classes(a.buttonLabel)},e&&this.viewModel.isNormalMode?t.buttons.zoomTo:null)))}_renderCollapseToggleButton(){const{longNames:e,messagesCommon:t}=this,i=e?"chevrons-right":"chevrons-left",s=e?t.collapse:t.expand;return g("button",{"aria-label":s,bind:this,class:this.classes(d.widget,d.widgetButton,d.interactive,a.minimizeToggleButton),key:"minimize-toggle-button",title:s,type:"button",onclick:this._toggleCollapsed},g("div",{class:this.classes(a.buttonInfo)},g("calcite-icon",{class:this.classes(a.iconFlip),icon:i,scale:"s"}),g("span",{class:this.classes(a.buttonLabel)},e&&this.viewModel.isNormalMode?t.collapse:null)))}_renderFilterMenu(){return this.viewModel?.filterMenuOpen?"site"===this.viewModel?.filterMenuType?this._renderSiteFilterMenu():"facility"===this.viewModel?.filterMenuType?this._renderFacilityFilterMenu():null:null}_renderSiteFilterMenu(){const{messages:e,messagesCommon:t}=this,i=this.site?this.viewModel?.getSite(this.site)?.name:e.selector.selectSite,s=g("div",{class:this.classes(`${a.filterMenuHeader}`),key:"filter-menu-site-header"},g("div",{class:this.classes(a.filterMenuHeaderTextGroup)},g(u,{class:this.classes(a.filterMenuHeaderText),level:this.headingLevel},i)),g("button",{bind:this,class:this.classes(a.iconClose),title:t.close,type:"button",onclick:this._closeClicked},g("calcite-icon",{icon:"x"}))),l=this._renderSearchInput(),n=this._renderSiteItems();return g("div",{class:this.classes(a.filterMenu),key:"filter-menu-site"},s,l,n)}_renderFacilityFilterMenu(){const{messages:e,messagesCommon:t,site:i}=this,s=this.viewModel?.getSite(i)?.name,l=this.facility&&this.viewModel?.getFacility(this.facility)?.name||e.selector.selectFacility,n=this.viewModel.hasMultipleSites?g("button",{bind:this,class:this.classes(a.filterMenuHeaderBack),title:t.back,type:"button",onclick:this._backClicked},g("calcite-icon",{class:this.classes(M(this.container)?a.iconRight:a.iconLeft),icon:M(this.container)?"chevron-right":"chevron-left"})):null,o=this.viewModel.hasMultipleSites?g(u,{class:this.classes(a.filterMenuHeaderSubtext),level:v(this.headingLevel)},s):null,r=g("div",{class:this.classes(a.filterMenuHeader),key:"filter-menu-site-header"},n,g("div",{class:this.classes(a.filterMenuHeaderTextGroup)},g(u,{class:this.classes(a.filterMenuHeaderText),level:this.headingLevel},l),o),g("button",{bind:this,class:this.classes(a.iconClose),title:t.close,type:"button",onclick:this._closeClicked},g("calcite-icon",{icon:"x"}))),c=this._renderSearchInput(),h=this._renderFacilityItems();return g("div",{class:this.classes(a.filterMenu),key:"filter-menu-facility"},r,c,h)}_renderSearchInput(){const{messagesCommon:e}=this,t=!!(this.viewModel.searchTerm&&this.viewModel.searchTerm?.length>0);return g("div",{class:this.classes(a.filterMenuSearch),key:"filter-menu-search"},g("calcite-icon",{icon:"search",key:"filter-menu-search-icon"}),g("input",{afterCreate:f,bind:this,class:this.classes(a.filterMenuSearchInput),"data-node-ref":"_searchInput",placeholder:e.search,value:this.viewModel.searchTerm??void 0,oninput:this._onSearchChange,onpaste:this._onSearchChange}),t?g("calcite-icon",{bind:this,class:this.classes(a.iconClose),icon:"x",key:"filter-menu-search-clear",title:e.clear,onclick:this._onSearchClear}):null)}_renderBlueCircle(){return g("span",{class:this.classes(a.selectedItemCircle),key:"floor-filter__selected-item-circle"})}_renderSiteItems(){if(!this.viewModel?.filterFeatures?.sites?.sitesInfo)return null;const{messages:e}=this,t=this.viewModel.filterFeatures.sites.sitesInfo,i=this.viewModel.filterSites(t).map(e=>this._renderSiteItem(e)),s=0===i.length&&this.viewModel?.searchTerm&&g("div",{class:this.classes(d.empty)},e.noResults);return g("ul",{afterCreate:f,"aria-label":e.selector.sitesLabel,bind:this,class:this.classes(a.filterMenuItems),"data-id":"sites","data-node-ref":"_sitesListNode",key:"filter-menu-items--sites",tabIndex:-1,onkeydown:this._handleListKeydown},i,s)}_renderSiteItem(e){const{name:t,id:i}=e,s=`filter-menu-site--${i}`,l=this.site===i;return g("li",{key:s},g("button",{bind:this,class:this.classes(a.filterMenuSite),"data-id":i,"data-list-id":"sites",type:"button",onclick:this._siteSelected,onfocus:this._onItemFocus},l?this._renderBlueCircle():null,g("span",{class:this.classes(l?a.filterMenuSelectedItem:a.filterMenuItemName)},t),g("calcite-icon",{class:this.classes(M(this.container)?a.iconLeft:a.iconRight),icon:"chevron-right",scale:"s"})))}_renderFacilityItems(){if(!this.viewModel?.filterFeatures?.facilities?.facilitiesInfo)return null;const{messages:e,site:i}=this,s=this.viewModel.getSite(i),l=this.viewModel.filterFeatures.facilities.facilitiesInfo,n=this.viewModel.filterFacilities(l).map(e=>this._renderFacilityItem(e)),o=0===n.length&&this.viewModel?.searchTerm&&g("div",{class:this.classes(d.empty)},e.noResults),r=s?t(e.selector.siteFacilitiesLabel,{name:`"${s.name}"`}):e.selector.facilitiesLabel;return g("ul",{afterCreate:f,"aria-label":r,bind:this,class:this.classes(a.filterMenuItems),"data-id":"facilities","data-node-ref":"_facilitiesListNode",key:"filter-menu-items--facilities",tabIndex:-1,onkeydown:this._handleListKeydown},n,o)}_renderFacilityItem(e){const{name:t,id:i}=e,s=`filter-menu-facility--${i}`,l=this.facility===i;return g("li",{key:s},g("button",{bind:this,class:this.classes(a.filterMenuFacility),"data-id":i,"data-list-id":"facilities",type:"button",onclick:this._facilitySelected,onfocus:this._onItemFocus},l?this._renderBlueCircle():null,g("span",{class:this.classes(l?a.filterMenuSelectedItem:a.filterMenuItemName)},t)))}_afterBaseNodeCreate(e){this._baseNode&&this._resizeObserver?.unobserve(this._baseNode),this._baseNode=e,this._resizeObserver?.observe(this._baseNode)}_toggleCollapsed(){this.longNames=!this.longNames}_toggleFilterMenu(){const e=this.viewModel?.filterMenuOpen??!1;this.viewModel.filterMenuOpen=!e}_setFilterMenuType(e){this.viewModel.filterMenuType=e}_zoomToClicked(){if(this.site&&"site"===this.viewModel?.filterMenuType&&this.viewModel?.filterMenuOpen){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}else if(this.facility){const e=this.viewModel?.getFacility(this.facility);this.viewModel.goTo(e)}else if(this.site){const e=this.viewModel?.getSite(this.site);this.viewModel.goTo(e)}}_onSearchChange(e){const t=e.target;""===t.value?this.viewModel.searchTerm=null:t.value&&this.viewModel?.searchTerm!==t.value&&(this.viewModel.searchTerm=t.value)}_onSearchClear(){this.viewModel.searchTerm=null}_closeClicked(){this.viewModel.searchTerm=null,this.viewModel.filterMenuOpen=!1}_backClicked(){this._setFilterMenuType("site"),this.viewModel.searchTerm=null}_siteSelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getSite(t);let s=!1;this.site!==t&&(this.facility=null,this.level=null,s=!0,this.viewModel.levelsExpanded=!1),this.site=t,this.viewModel.searchTerm=null,this._setFilterMenuType("facility"),this.viewModel.goTo(i),s&&this.viewModel.setFloors(null)}_facilitySelected(e){const t=e.currentTarget.getAttribute("data-id"),i=this.viewModel.getFacility(t);let s=!1;if(this.facility!==t){if("base-floors"===this.viewModel.filterMode){const e=this.viewModel?.getBaseLevel(i);this.level=e?e.id:null}else this.level=null;s=!0,this.viewModel.levelsExpanded=!1}if(this.facility=t,this.viewModel.goTo(i),s){const e=this.viewModel.getLevel(this.level);this.viewModel.setFloors(e)}if(!this.viewModel.isNormalMode){const e=this.viewModel.getFacilityLevels(t);e?.length>1&&(this.viewModel.levelsExpanded=!0)}setTimeout(()=>this._focusActiveLevel(),50)}_levelSelected(e){const t=e.currentTarget.getAttribute("data-id");this.level=t}_closeLevels(){this.viewModel.levelsExpanded=!1}_isWebScene(e){return"esri.WebScene"===e?.declaredClass}_getComponentPosition(){return null!=this.container?this.view?.ui?.getPosition(this.container):null}_getPosition(e){switch(e){case"bottom-right":case"bottom-left":return"bottom";default:return"top"}}_handleListKeydown(e){const t=e.currentTarget.getAttribute("data-id");let i=null;"sites"===t||"facilities"===t?(this._activeMenu!==t&&(this._activeMenuIndex.menuItems=-1),this._activeMenu=t,i="menuItems"):"levels"===t&&(i="levels");const s="sites"===t?this._sitesListNode:"facilities"===t?this._facilitiesListNode:"levels"===t?this._levelsListNode:null,{key:l}=e,n="Tab"===l,o=p.has(l);o&&e.preventDefault();const r=s?.getElementsByTagName("li");r&&0!==r.length&&(o||n)&&this._handleItemNavigation(l,e.shiftKey,r,n,i)}_handleItemNavigation(e,t,i,s,l){if(!l)return;this._activeMenuIndex[l]===i.length&&this._activeMenuIndex[l]--,-1===this._activeMenuIndex[l]&&this._activeMenuIndex[l]++;const n=this._activeMenuIndex[l];switch(e){case"Home":this._activeMenuIndex[l]=0;break;case"End":this._activeMenuIndex[l]=i.length-1;break;case"ArrowUp":this._activeMenuIndex[l]=this._activeMenuIndex[l]<=0?i.length-1:this._activeMenuIndex[l]-1;break;case"ArrowDown":this._activeMenuIndex[l]=this._activeMenuIndex[l]===i.length-1?0:this._activeMenuIndex[l]+1}if("Tab"===e&&t&&this._activeMenuIndex[l]>=0&&this._activeMenuIndex[l]--,"Tab"===e&&!t&&this._activeMenuIndex[l]<i.length&&this._activeMenuIndex[l]++,n!==this._activeMenuIndex[l]&&this._activeMenuIndex[l]>-1&&this._activeMenuIndex[l]<i.length&&!s){const e=i[this._activeMenuIndex[l]].getElementsByTagName("button"),t=1===e?.length?e[0]:null;t?.focus()}}_focusSearch(){this._searchInput?.focus()}_focusActiveLevel(){const{level:e}=this,t=this._levelsListNode,i=t?.getElementsByTagName("li");if(!e||!t||!i)return;const s=this._facilitiesListNode?.getElementsByTagName("li");this._activeMenuIndex.menuItems=s?s.length-1:-1;const l=[];for(let n=0;n<i.length;n++){const e=i[n].getElementsByTagName("button");1===e?.length&&l.push(e[0])}l.forEach((t,i)=>{t.getAttribute("data-id")===e&&(t.focus(),this._activeMenuIndex.levels=i)})}_onItemFocus(e){const t=e.currentTarget,i=t.getAttribute("data-list-id"),s=t.getAttribute("data-id"),l="sites"===i?this._sitesListNode:"facilities"===i?this._facilitiesListNode:"levels"===i?this._levelsListNode:null;if(!l)return;const n=l?.getElementsByTagName("li");if(!n)return;const o=[];Array.from(n).forEach(e=>{const t=e.getElementsByTagName("button");1===t?.length&&o.push(t[0])});let r=null;switch(i){case"sites":case"facilities":r="menuItems";break;case"levels":r="levels"}if(!r)return;const a=r;o.forEach((e,t)=>{e.getAttribute("data-id")===s&&this._activeMenuIndex[a]!==t&&(this._activeMenuIndex[a]=t)})}};e([n()],_.prototype,"_searchInput",void 0),e([n()],_.prototype,"enabled",null),e([n()],_.prototype,"longNames",null),e([n()],_.prototype,"minimized",null),e([n()],_.prototype,"pinnedLevels",null),e([n()],_.prototype,"site",null),e([n()],_.prototype,"facility",null),e([n()],_.prototype,"level",null),e([n()],_.prototype,"view",null),e([n({type:c})],_.prototype,"viewModel",void 0),e([n(),m("esri/widgets/FloorFilter/t9n/FloorFilter")],_.prototype,"messages",void 0),e([n(),m("esri/t9n/common")],_.prototype,"messagesCommon",void 0),e([n()],_.prototype,"goToOverride",null),e([n()],_.prototype,"headingLevel",void 0),e([n()],_.prototype,"icon",null),_=e([o("esri.widgets.FloorFilter")],_);const w=_;export{w as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{rad2deg as e}from"../core/mathUtils.js";import{formatAngleDegrees as s,formatDecimal as o}from"../core/unitFormatUtils.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import n from"./Widget.js";import{messageBundle as m,tsx as l}from"./support/widget.js";const a="esri-fov-overlay",p={base:a,outer:`${a}-outer`,reset:`${a}-reset`,text:`${a}-text`};let c=class extends n{constructor(t){super(t),this.onReset=()=>{},this._messagesCommon=null,this._messagesUnits=null,this.fov=null}render(){return l("div",{class:p.outer},l("div",{class:p.base},l("p",{class:p.text},this._overlay),l("p",{class:p.reset,onclick:this.onReset,title:this._messagesCommon.reset},this._reset)))}get _overlay(){const{fov:t,_messagesUnits:r}=this;if(!r||null==t)return"";const i=s(e(t),"degrees","arithmetic","arithmetic",0),n=u/(2*Math.tan(t/2));return`${i} | ${o(r,n,"millimeters",0,"abbr")} |`}get _reset(){return this._messagesUnits&&null!=this.fov?"↺":""}};t([r()],c.prototype,"onReset",void 0),t([r(),m("esri/t9n/common")],c.prototype,"_messagesCommon",void 0),t([r(),m("esri/core/t9n/Units")],c.prototype,"_messagesUnits",void 0),t([r()],c.prototype,"fov",void 0),t([r()],c.prototype,"_overlay",null),t([r()],c.prototype,"_reset",null),c=t([i("esri.widgets.FovOverlay")],c);const u=Math.sqrt(1872);export{c as FovOverlay,a as base,p as css};
2
+ import{__decorate as t}from"tslib";import{rad2deg as e}from"../core/mathUtils.js";import{formatAngleDegrees as s,formatDecimal as o}from"../core/unitFormatUtils.js";import{property as r,subclass as i}from"../core/accessorSupport/decorators.js";import n from"./Widget.js";import{messageBundle as m,tsx as l}from"./support/widget.js";const a="esri-fov-overlay",p={base:a,outer:`${a}-outer`,reset:`${a}-reset`,text:`${a}-text`};let c=class extends n{constructor(t){super(t),this.onReset=()=>{},this._messagesCommon=null,this._messagesUnits=null,this.fov=null}render(){return l("div",{class:p.outer},l("div",{class:p.base},l("p",{class:p.text},this._overlay),l("p",{class:p.reset,title:this._messagesCommon.reset,onclick:this.onReset},this._reset)))}get _overlay(){const{fov:t,_messagesUnits:r}=this;if(!r||null==t)return"";const i=s(e(t),"degrees","arithmetic","arithmetic",0),n=u/(2*Math.tan(t/2));return`${i} | ${o(r,n,"millimeters",0,"abbr")} |`}get _reset(){return this._messagesUnits&&null!=this.fov?"↺":""}};t([r()],c.prototype,"onReset",void 0),t([r(),m("esri/t9n/common")],c.prototype,"_messagesCommon",void 0),t([r(),m("esri/core/t9n/Units")],c.prototype,"_messagesUnits",void 0),t([r()],c.prototype,"fov",void 0),t([r()],c.prototype,"_overlay",null),t([r()],c.prototype,"_reset",null),c=t([i("esri.widgets.FovOverlay")],c);const u=Math.sqrt(1872);export{c as FovOverlay,a as base,p as css};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import r from"./Widget.js";import l from"./Fullscreen/FullscreenViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{messageBundle as p,tsx as d}from"./support/widget.js";const a={base:"esri-fullscreen"};let u=class extends r{constructor(e,o){super(e,o),this.messages=null,this.viewModel=new l({suppressDeprecationWarning:!0}),this._toggle=()=>{this.viewModel.toggle()},t(s.getLogger(this),"Fullscreen","arcgis-fullscreen",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get element(){return this.viewModel.element}set element(e){this.viewModel.element=e}get fullscreenTitle(){const e=this.viewModel?.state;return"active"===e?this.messages.exit:"ready"===e?this.messages.enter:""}get icon(){const e=this.viewModel?.state;return"ready"===e||"disabled"===e||"feature-unsupported"===e?"zoom-out-fixed":"zoom-in-fixed"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{fullscreenTitle:e,icon:t}=this,s=this.viewModel?.state,o="feature-unsupported"===s;return d("div",{class:this.classes(a.base,c.widget)},!o&&d("calcite-button",{class:c.widgetButton,disabled:"disabled"===s,iconStart:t,kind:"neutral",label:e,onclick:this._toggle,title:e}))}};e([o()],u.prototype,"element",null),e([o({readOnly:!0})],u.prototype,"fullscreenTitle",null),e([o()],u.prototype,"icon",null),e([o()],u.prototype,"label",null),e([o(),p("esri/widgets/Fullscreen/t9n/Fullscreen")],u.prototype,"messages",void 0),e([o()],u.prototype,"view",null),e([o({type:l})],u.prototype,"viewModel",void 0),u=e([i("esri.widgets.Fullscreen")],u);const m=u;export{m as default};
2
+ import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import r from"./Widget.js";import l from"./Fullscreen/FullscreenViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{messageBundle as p,tsx as d}from"./support/widget.js";const a={base:"esri-fullscreen"};let u=class extends r{constructor(e,o){super(e,o),this.messages=null,this.viewModel=new l({suppressDeprecationWarning:!0}),this._toggle=()=>{this.viewModel.toggle()},t(s.getLogger(this),"Fullscreen","arcgis-fullscreen",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get element(){return this.viewModel.element}set element(e){this.viewModel.element=e}get fullscreenTitle(){const e=this.viewModel?.state;return"active"===e?this.messages.exit:"ready"===e?this.messages.enter:""}get icon(){const e=this.viewModel?.state;return"ready"===e||"disabled"===e||"feature-unsupported"===e?"zoom-out-fixed":"zoom-in-fixed"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{fullscreenTitle:e,icon:t}=this,s=this.viewModel?.state,o="feature-unsupported"===s;return d("div",{class:this.classes(a.base,c.widget)},!o&&d("calcite-button",{class:c.widgetButton,disabled:"disabled"===s,iconStart:t,kind:"neutral",label:e,title:e,onclick:this._toggle}))}};e([o()],u.prototype,"element",null),e([o({readOnly:!0})],u.prototype,"fullscreenTitle",null),e([o()],u.prototype,"icon",null),e([o()],u.prototype,"label",null),e([o(),p("esri/widgets/Fullscreen/t9n/Fullscreen")],u.prototype,"messages",void 0),e([o()],u.prototype,"view",null),e([o({type:l})],u.prototype,"viewModel",void 0),u=e([i("esri.widgets.Fullscreen")],u);const m=u;export{m as default};
package/widgets/Home.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import o from"../Viewpoint.js";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as s,subclass as r}from"../core/accessorSupport/decorators.js";import n from"./Widget.js";import l from"./Home/HomeViewModel.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import{messageBundle as c,vmEvent as d,tsx as a}from"./support/widget.js";const g={base:"esri-home"};let v=class extends n{constructor(e,o){super(e,o),this.messages=null,this.messagesCommon=null,this.uiStrings=void 0,this.viewModel=new l({suppressDeprecationWarning:!0}),this._go=()=>{const{viewModel:e}=this;"going-home"===e.state?e.cancelGo():e.go()},t(i.getLogger(this),"Home","arcgis-home",{version:"4.32"})}loadDependencies(){return p({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"home"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewpoint(){return this.viewModel.viewpoint}set viewpoint(e){this.viewModel.viewpoint=e}cancelGo(){this.viewModel.cancelGo()}go(){return this.viewModel.go()}render(){const{messagesCommon:e,messages:o,icon:t}=this,i=this.viewModel?.state,s="going-home"===i;return a("div",{class:this.classes(g.base,m.widget)},a("calcite-button",{class:m.widgetButton,disabled:"disabled"===i,iconStart:s?void 0:t,kind:"neutral",label:o.widgetLabel,onclick:this._go,scale:s?"s":"m",title:"going-home"===i?e.cancel:o.title},s?a("calcite-loader",{inline:!0,label:""}):null))}};e([s()],v.prototype,"goToOverride",null),e([s()],v.prototype,"icon",null),e([s()],v.prototype,"label",null),e([s(),c("esri/widgets/Home/t9n/Home")],v.prototype,"messages",void 0),e([s(),c("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([s()],v.prototype,"uiStrings",void 0),e([s()],v.prototype,"view",null),e([s({type:l}),d("go")],v.prototype,"viewModel",void 0),e([s({type:o})],v.prototype,"viewpoint",null),v=e([r("esri.widgets.Home")],v);const w=v;export{w as default};
2
+ import{__decorate as e}from"tslib";import o from"../Viewpoint.js";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as s,subclass as r}from"../core/accessorSupport/decorators.js";import n from"./Widget.js";import l from"./Home/HomeViewModel.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import{messageBundle as c,vmEvent as d,tsx as a}from"./support/widget.js";const g={base:"esri-home"};let v=class extends n{constructor(e,o){super(e,o),this.messages=null,this.messagesCommon=null,this.uiStrings=void 0,this.viewModel=new l({suppressDeprecationWarning:!0}),this._go=()=>{const{viewModel:e}=this;"going-home"===e.state?e.cancelGo():e.go()},t(i.getLogger(this),"Home","arcgis-home",{version:"4.32"})}loadDependencies(){return p({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"home"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewpoint(){return this.viewModel.viewpoint}set viewpoint(e){this.viewModel.viewpoint=e}cancelGo(){this.viewModel.cancelGo()}go(){return this.viewModel.go()}render(){const{messagesCommon:e,messages:o,icon:t}=this,i=this.viewModel?.state,s="going-home"===i;return a("div",{class:this.classes(g.base,m.widget)},a("calcite-button",{class:m.widgetButton,disabled:"disabled"===i,iconStart:s?void 0:t,kind:"neutral",label:o.widgetLabel,scale:s?"s":"m",title:"going-home"===i?e.cancel:o.title,onclick:this._go},s?a("calcite-loader",{inline:!0,label:""}):null))}};e([s()],v.prototype,"goToOverride",null),e([s()],v.prototype,"icon",null),e([s()],v.prototype,"label",null),e([s(),c("esri/widgets/Home/t9n/Home")],v.prototype,"messages",void 0),e([s(),c("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([s()],v.prototype,"uiStrings",void 0),e([s()],v.prototype,"view",null),e([s({type:l}),d("go")],v.prototype,"viewModel",void 0),e([s({type:o})],v.prototype,"viewpoint",null),v=e([r("esri.widgets.Home")],v);const w=v;export{w 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{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};
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,slot:d?"actions-start":"actions-end",text:p,title:m,onclick:()=>this._toggleVisibility(i,n)},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}`,slot:"actions-end",text:i??"",title:i??void 0,onclick:()=>this._togglePanel(e)},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,slot:"actions-end",text:e,onclick:()=>this._triggerOnCatalogOpen(t)}):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,slot:n?void 0:"actions-end",text:a??"",textEnabled:n,title:a??void 0,onclick:()=>this._triggerAction(t,i)},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};
@@ -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/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import s from"../core/Logger.js";import l from"../core/ReactiveMap.js";import{on as r,initial as a,watch as n}from"../core/reactiveUtils.js";import{property as d,subclass as p}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import{css as m}from"./LayerList/css.js";import h from"./LayerList/LayerListItem.js";import y from"./LayerList/LayerListViewModel.js";import u from"./LayerList/LayerListVisibleElements.js";import g from"./LayerList/ListItem.js";import{minDragEnabledItems as L,minFilterItems as _,getItem as f,getLayerType as v,removeDestroyedListItems as I,setFilterPredicate as w,sortLayersToIds as b,sortChildLayersToIds as C}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as F}from"./support/globalCss.js";import{calciteListFilterProps as M}from"./support/listUtils.js";import{tsx as O,messageBundle as T,vmEvent as P}from"./support/widget.js";import{setFocus as A}from"./support/widgetUtils.js";const D=t.ofType(g),R="nested";let k=class extends(o(c)){constructor(e,o){super(e,o),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new l,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new l,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=L,this.minFilterItems=_,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new D,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new y,this.visibilityAppearance="default",this.visibleElements=new u,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=f(e);if(!l?.sortable)return!1;const r=f(t),a=v(t),n=f(i),d=v(i),p=!!a&&!!d&&a===d,c={selected:l,from:r,to:n},m=t.group,h=i.group,y=r?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),L="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==L},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(m.item));this._activeItem=f(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)){if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o===i){const e=Array.from(o.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);return void this._sortLayers(o,e)}this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l})}},this.announceDeprecation=()=>{i(s.getLogger(this),"Layer List","arcgis-layer-list",{version:"5.0"})}}initialize(){this.addHandles([r(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),a),r(()=>this.viewModel.operationalItems,"change",()=>I(this.selectedItems),a),n(()=>[this.filterPredicate,this._rootListEl],()=>w(this._rootListEl,this.filterPredicate))])}loadDependencies(){return E({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _visibleItems(){return this.operationalItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[F.hidden]:"loading"===e,[F.disabled]:"disabled"===e};return O("div",{class:this.classes(m.base,F.widget,F.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?O("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid),topLayerDisabled:this.topLayerDisabled},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return O("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return O("div",{class:m.itemMessage,key:"esri-layer-list__no-items"},O("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return O("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return O("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),O("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-start",width:"full"},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,A(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,A(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,A(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:r,collapseButton:a,heading:n,flow:d},_dragEnabled:p,selectionMode:c,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,L=[O("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:r,closed:!e,collapsed:t,collapsible:a,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),O("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:R,dragEnabled:p,filterEnabled:s,filterPlaceholder:u,filterProps:M,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:c,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},i.toArray().map(e=>this._renderItem(e)),s?O("div",{class:m.filterNoResults,slot:"filter-no-results"},O("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?O("calcite-flow",{key:"root-flow"},L):L:null}_renderItem(e,t,i){return O(h,{activeItem:this._activeItem,canMove:this._canMove,css:m,displayMode:R,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.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._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=f(i),l=f(e),r=f(t);this.viewModel.moveListItem(s,r,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e===this._rootListEl)b(this.view?.map?.layers,t);else{const i=f(e);if(!i)return;C(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>f(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([d()],k.prototype,"_rootListEl",void 0),e([d()],k.prototype,"_activeItem",void 0),e([d()],k.prototype,"_tooltipReferenceMap",void 0),e([d()],k.prototype,"_focusRootFlowItem",void 0),e([d()],k.prototype,"_focusPanelFlowItem",void 0),e([d()],k.prototype,"_focusLayerFlowItem",void 0),e([d()],k.prototype,"_layerListMap",void 0),e([d()],k.prototype,"_totalItems",null),e([d()],k.prototype,"_visibleItems",null),e([d()],k.prototype,"_openedPanelItems",null),e([d()],k.prototype,"_dragEnabled",null),e([d()],k.prototype,"_filterEnabled",null),e([d()],k.prototype,"_renderedOpenLayerFlowItems",null),e([d({readOnly:!0})],k.prototype,"catalogLayerList",void 0),e([d()],k.prototype,"catalogOptions",void 0),e([d()],k.prototype,"collapsed",void 0),e([d()],k.prototype,"dragEnabled",void 0),e([d()],k.prototype,"filterPlaceholder",void 0),e([d()],k.prototype,"filterPredicate",void 0),e([d()],k.prototype,"filterText",void 0),e([d()],k.prototype,"headingLevel",void 0),e([d()],k.prototype,"icon",null),e([d()],k.prototype,"knowledgeGraphOptions",void 0),e([d()],k.prototype,"label",null),e([d()],k.prototype,"layerTablesEnabled",void 0),e([d()],k.prototype,"listItemCanGiveFunction",void 0),e([d()],k.prototype,"listItemCanReceiveFunction",void 0),e([d()],k.prototype,"listItemCreatedFunction",null),e([d()],k.prototype,"mapImageOptions",void 0),e([d(),T("esri/widgets/LayerList/t9n/LayerList")],k.prototype,"messages",void 0),e([d(),T("esri/t9n/common")],k.prototype,"messagesCommon",void 0),e([d()],k.prototype,"minDragEnabledItems",void 0),e([d()],k.prototype,"minFilterItems",void 0),e([d({readOnly:!0})],k.prototype,"openedLayers",void 0),e([d({readOnly:!0})],k.prototype,"openedLayerLists",void 0),e([d()],k.prototype,"operationalItems",null),e([d()],k.prototype,"selectedItems",void 0),e([d()],k.prototype,"selectionMode",void 0),e([d({readOnly:!0})],k.prototype,"tableList",void 0),e([d()],k.prototype,"tileOptions",void 0),e([d()],k.prototype,"view",null),e([P("trigger-action"),d({type:y})],k.prototype,"viewModel",void 0),e([d()],k.prototype,"visibilityAppearance",void 0),e([d({type:u,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=e([p("esri.widgets.LayerList")],k);const j=k;export{j as default};
2
+ import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as i}from"../core/deprecate.js";import{IdentifiableMixin as o}from"../core/Identifiable.js";import s from"../core/Logger.js";import l from"../core/ReactiveMap.js";import{on as r,initial as a,watch as n}from"../core/reactiveUtils.js";import{property as d,subclass as p}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import{css as m}from"./LayerList/css.js";import h from"./LayerList/LayerListItem.js";import y from"./LayerList/LayerListViewModel.js";import u from"./LayerList/LayerListVisibleElements.js";import g from"./LayerList/ListItem.js";import{minDragEnabledItems as L,minFilterItems as _,getItem as f,getLayerType as v,removeDestroyedListItems as I,setFilterPredicate as w,sortLayersToIds as b,sortChildLayersToIds as C}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as F}from"./support/globalCss.js";import{calciteListFilterProps as M}from"./support/listUtils.js";import{tsx as O,messageBundle as T,vmEvent as P}from"./support/widget.js";import{setFocus as A}from"./support/widgetUtils.js";const D=t.ofType(g),R="nested";let k=class extends(o(c)){constructor(e,o){super(e,o),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new l,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new l,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=L,this.minFilterItems=_,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new D,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new y,this.visibilityAppearance="default",this.visibleElements=new u,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=f(e);if(!l?.sortable)return!1;const r=f(t),a=v(t),n=f(i),d=v(i),p=!!a&&!!d&&a===d,c={selected:l,from:r,to:n},m=t.group,h=i.group,y=r?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),L="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==L},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(m.item));this._activeItem=f(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)){if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o===i){const e=Array.from(o.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);return void this._sortLayers(o,e)}this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l})}},this.announceDeprecation=()=>{i(s.getLogger(this),"Layer List","arcgis-layer-list",{version:"5.0"})}}initialize(){this.addHandles([r(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),a),r(()=>this.viewModel.operationalItems,"change",()=>I(this.selectedItems),a),n(()=>[this.filterPredicate,this._rootListEl],()=>w(this._rootListEl,this.filterPredicate))])}loadDependencies(){return E({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _visibleItems(){return this.operationalItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[F.hidden]:"loading"===e,[F.disabled]:"disabled"===e};return O("div",{class:this.classes(m.base,F.widget,F.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?O("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid),topLayerDisabled:this.topLayerDisabled},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return O("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return O("div",{class:m.itemMessage,key:"esri-layer-list__no-items"},O("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return O("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return O("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),O("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:l},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,A(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,A(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,A(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:r,collapseButton:a,heading:n,flow:d},_dragEnabled:p,selectionMode:c,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,L=[O("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:r,closed:!e,collapsed:t,collapsible:a,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),O("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:R,dragEnabled:p,filterEnabled:s,filterPlaceholder:u,filterProps:M,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,selectionAppearance:"border",selectionMode:c,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail),onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem},i.toArray().map(e=>this._renderItem(e)),s?O("div",{class:m.filterNoResults,slot:"filter-no-results"},O("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?O("calcite-flow",{key:"root-flow"},L):L:null}_renderItem(e,t,i){return O(h,{activeItem:this._activeItem,canMove:this._canMove,css:m,displayMode:R,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.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._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=f(i),l=f(e),r=f(t);this.viewModel.moveListItem(s,r,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e===this._rootListEl)b(this.view?.map?.layers,t);else{const i=f(e);if(!i)return;C(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>f(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([d()],k.prototype,"_rootListEl",void 0),e([d()],k.prototype,"_activeItem",void 0),e([d()],k.prototype,"_tooltipReferenceMap",void 0),e([d()],k.prototype,"_focusRootFlowItem",void 0),e([d()],k.prototype,"_focusPanelFlowItem",void 0),e([d()],k.prototype,"_focusLayerFlowItem",void 0),e([d()],k.prototype,"_layerListMap",void 0),e([d()],k.prototype,"_totalItems",null),e([d()],k.prototype,"_visibleItems",null),e([d()],k.prototype,"_openedPanelItems",null),e([d()],k.prototype,"_dragEnabled",null),e([d()],k.prototype,"_filterEnabled",null),e([d()],k.prototype,"_renderedOpenLayerFlowItems",null),e([d({readOnly:!0})],k.prototype,"catalogLayerList",void 0),e([d()],k.prototype,"catalogOptions",void 0),e([d()],k.prototype,"collapsed",void 0),e([d()],k.prototype,"dragEnabled",void 0),e([d()],k.prototype,"filterPlaceholder",void 0),e([d()],k.prototype,"filterPredicate",void 0),e([d()],k.prototype,"filterText",void 0),e([d()],k.prototype,"headingLevel",void 0),e([d()],k.prototype,"icon",null),e([d()],k.prototype,"knowledgeGraphOptions",void 0),e([d()],k.prototype,"label",null),e([d()],k.prototype,"layerTablesEnabled",void 0),e([d()],k.prototype,"listItemCanGiveFunction",void 0),e([d()],k.prototype,"listItemCanReceiveFunction",void 0),e([d()],k.prototype,"listItemCreatedFunction",null),e([d()],k.prototype,"mapImageOptions",void 0),e([d(),T("esri/widgets/LayerList/t9n/LayerList")],k.prototype,"messages",void 0),e([d(),T("esri/t9n/common")],k.prototype,"messagesCommon",void 0),e([d()],k.prototype,"minDragEnabledItems",void 0),e([d()],k.prototype,"minFilterItems",void 0),e([d({readOnly:!0})],k.prototype,"openedLayers",void 0),e([d({readOnly:!0})],k.prototype,"openedLayerLists",void 0),e([d()],k.prototype,"operationalItems",null),e([d()],k.prototype,"selectedItems",void 0),e([d()],k.prototype,"selectionMode",void 0),e([d({readOnly:!0})],k.prototype,"tableList",void 0),e([d()],k.prototype,"tileOptions",void 0),e([d()],k.prototype,"view",null),e([P("trigger-action"),d({type:y})],k.prototype,"viewModel",void 0),e([d()],k.prototype,"visibilityAppearance",void 0),e([d({type:u,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=e([p("esri.widgets.LayerList")],k);const j=k;export{j as default};
package/widgets/Locate.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import o from"../Graphic.js";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as s,subclass as r}from"../core/accessorSupport/decorators.js";import l from"./Widget.js";import n from"./Locate/LocateViewModel.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{messageBundle as p,vmEvent as d,tsx as g}from"./support/widget.js";const m={base:"esri-locate"};let u=class extends l{constructor(e,o){super(e,o),this.messages=null,this.messagesCommon=null,this.viewModel=new n({suppressDeprecationWarning:!0}),this._locate=()=>{const{viewModel:e}=this;"locating"===e.state?e.cancelLocate():e.locate().catch(()=>{})},t(i.getLogger(this),"Locate","arcgis-locate",{version:"4.32"})}loadDependencies(){return a({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get geolocationOptions(){return this.viewModel.geolocationOptions}set geolocationOptions(e){this.viewModel.geolocationOptions=e}get goToLocationEnabled(){return this.viewModel.goToLocationEnabled}set goToLocationEnabled(e){this.viewModel.goToLocationEnabled=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"gps-off"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get popupEnabled(){return this.viewModel.popupEnabled}set popupEnabled(e){this.viewModel.popupEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}cancelLocate(){this.viewModel.cancelLocate()}locate(){return this.viewModel.locate()}render(){const{viewModel:e,icon:o}=this,{state:t}=e,i="locating"===t,s=i?this.messagesCommon.cancel:this.messages.title,r="feature-unsupported"===t,l=this._localizeError(this.viewModel?.error);return g("div",{class:this.classes(m.base,c.widget)},!r&&g("calcite-button",{class:c.widgetButton,disabled:"disabled"===t,iconStart:i?void 0:o,kind:"neutral",label:s,onclick:this._locate,title:s},i?g("calcite-loader",{inline:!0,label:""}):null),l?g("calcite-tooltip",{open:!0,overlayPositioning:"fixed",placement:this._getPlacement(),referenceElement:this.container,topLayerDisabled:this.topLayerDisabled},l):null)}_getPlacement(){const{container:e,view:o}=this,t=e&&o?o.ui.getPosition(e):null;if(!t||"manual"===t)return"auto";const[i,s]=t.split("-");return`${"right"===s?"left":"right"}-${"bottom"===i?"end":"start"}`}_localizeError(e){return e instanceof GeolocationPositionError?e.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:e.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable:e instanceof Error?e.message:void 0}};e([s()],u.prototype,"geolocationOptions",null),e([s()],u.prototype,"goToLocationEnabled",null),e([s()],u.prototype,"goToOverride",null),e([s({type:o})],u.prototype,"graphic",null),e([s()],u.prototype,"icon",null),e([s()],u.prototype,"label",null),e([s(),p("esri/widgets/Locate/t9n/Locate")],u.prototype,"messages",void 0),e([s(),p("esri/t9n/common")],u.prototype,"messagesCommon",void 0),e([s()],u.prototype,"popupEnabled",null),e([s()],u.prototype,"scale",null),e([s()],u.prototype,"view",null),e([s({type:n}),d(["locate","locate-error"])],u.prototype,"viewModel",void 0),u=e([r("esri.widgets.Locate")],u);const h=u;export{h as default};
2
+ import{__decorate as e}from"tslib";import o from"../Graphic.js";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as s,subclass as r}from"../core/accessorSupport/decorators.js";import l from"./Widget.js";import n from"./Locate/LocateViewModel.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{messageBundle as p,vmEvent as d,tsx as g}from"./support/widget.js";const m={base:"esri-locate"};let u=class extends l{constructor(e,o){super(e,o),this.messages=null,this.messagesCommon=null,this.viewModel=new n({suppressDeprecationWarning:!0}),this._locate=()=>{const{viewModel:e}=this;"locating"===e.state?e.cancelLocate():e.locate().catch(()=>{})},t(i.getLogger(this),"Locate","arcgis-locate",{version:"4.32"})}loadDependencies(){return a({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get geolocationOptions(){return this.viewModel.geolocationOptions}set geolocationOptions(e){this.viewModel.geolocationOptions=e}get goToLocationEnabled(){return this.viewModel.goToLocationEnabled}set goToLocationEnabled(e){this.viewModel.goToLocationEnabled=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"gps-off"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get popupEnabled(){return this.viewModel.popupEnabled}set popupEnabled(e){this.viewModel.popupEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}cancelLocate(){this.viewModel.cancelLocate()}locate(){return this.viewModel.locate()}render(){const{viewModel:e,icon:o}=this,{state:t}=e,i="locating"===t,s=i?this.messagesCommon.cancel:this.messages.title,r="feature-unsupported"===t,l=this._localizeError(this.viewModel?.error);return g("div",{class:this.classes(m.base,c.widget)},!r&&g("calcite-button",{class:c.widgetButton,disabled:"disabled"===t,iconStart:i?void 0:o,kind:"neutral",label:s,title:s,onclick:this._locate},i?g("calcite-loader",{inline:!0,label:""}):null),l?g("calcite-tooltip",{open:!0,overlayPositioning:"fixed",placement:this._getPlacement(),referenceElement:this.container,topLayerDisabled:this.topLayerDisabled},l):null)}_getPlacement(){const{container:e,view:o}=this,t=e&&o?o.ui.getPosition(e):null;if(!t||"manual"===t)return"auto";const[i,s]=t.split("-");return`${"right"===s?"left":"right"}-${"bottom"===i?"end":"start"}`}_localizeError(e){return e instanceof GeolocationPositionError?e.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:e.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable:e instanceof Error?e.message:void 0}};e([s()],u.prototype,"geolocationOptions",null),e([s()],u.prototype,"goToLocationEnabled",null),e([s()],u.prototype,"goToOverride",null),e([s({type:o})],u.prototype,"graphic",null),e([s()],u.prototype,"icon",null),e([s()],u.prototype,"label",null),e([s(),p("esri/widgets/Locate/t9n/Locate")],u.prototype,"messages",void 0),e([s(),p("esri/t9n/common")],u.prototype,"messagesCommon",void 0),e([s()],u.prototype,"popupEnabled",null),e([s()],u.prototype,"scale",null),e([s()],u.prototype,"view",null),e([s({type:n}),d(["locate","locate-error"])],u.prototype,"viewModel",void 0),u=e([r("esri.widgets.Locate")],u);const h=u;export{h as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{deprecateWidget as e}from"../core/deprecate.js";import o from"../core/Logger.js";import{property as i,subclass as s}from"../core/accessorSupport/decorators.js";import l from"./Widget.js";import{css as r}from"./NavigationToggle/css.js";import a from"./NavigationToggle/NavigationToggleViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{messageBundle as p,tsx as c}from"./support/widget.js";import{setFocus as d}from"./support/widgetUtils.js";let u=class extends l{constructor(t,i){super(t,i),this.messages=null,this.viewModel=new a({suppressDeprecationWarning:!0}),this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const t="pan"===this.viewModel?.navigationMode?this._rotateButton:this._panButton;d(t),this.toggle()},t?.isDefaultUI||e(o.getLogger(this),"Navigation Toggle","arcgis-navigation-toggle",{version:"4.32"})}normalizeCtorArgs(t={}){const{isDefaultUI:e,...o}=t;return o}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){"horizontal"!==t&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t="disabled"===this.viewModel?.state,e="pan"===this.viewModel?.navigationMode,o=this.messages.toggle;return c("div",{class:this.classes(r.base,g.widget,{[r.isLayoutHorizontal]:"horizontal"===this.layout})},c("calcite-button",{afterCreate:t=>{this._panButton=t},appearance:e?"outline-fill":"solid",class:g.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?void 0:-1,title:o}),c("calcite-button",{afterCreate:t=>{this._rotateButton=t},appearance:e?"solid":"outline-fill",class:g.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?-1:void 0,title:o}))}};t([i()],u.prototype,"icon",null),t([i()],u.prototype,"label",null),t([i({value:"vertical"})],u.prototype,"layout",null),t([i(),p("esri/widgets/NavigationToggle/t9n/NavigationToggle")],u.prototype,"messages",void 0),t([i()],u.prototype,"view",null),t([i({type:a})],u.prototype,"viewModel",void 0),u=t([s("esri.widgets.NavigationToggle")],u);const v=u;export{v as default};
2
+ import{__decorate as t}from"tslib";import{deprecateWidget as e}from"../core/deprecate.js";import o from"../core/Logger.js";import{property as i,subclass as s}from"../core/accessorSupport/decorators.js";import l from"./Widget.js";import{css as r}from"./NavigationToggle/css.js";import a from"./NavigationToggle/NavigationToggleViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{messageBundle as p,tsx as c}from"./support/widget.js";import{setFocus as d}from"./support/widgetUtils.js";let u=class extends l{constructor(t,i){super(t,i),this.messages=null,this.viewModel=new a({suppressDeprecationWarning:!0}),this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const t="pan"===this.viewModel?.navigationMode?this._rotateButton:this._panButton;d(t),this.toggle()},t?.isDefaultUI||e(o.getLogger(this),"Navigation Toggle","arcgis-navigation-toggle",{version:"4.32"})}normalizeCtorArgs(t={}){const{isDefaultUI:e,...o}=t;return o}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){"horizontal"!==t&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t="disabled"===this.viewModel?.state,e="pan"===this.viewModel?.navigationMode,o=this.messages.toggle;return c("div",{class:this.classes(r.base,g.widget,{[r.isLayoutHorizontal]:"horizontal"===this.layout})},c("calcite-button",{afterCreate:t=>{this._panButton=t},appearance:e?"outline-fill":"solid",class:g.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:o,tabIndex:e?void 0:-1,title:o,onclick:this._toggle}),c("calcite-button",{afterCreate:t=>{this._rotateButton=t},appearance:e?"solid":"outline-fill",class:g.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:o,tabIndex:e?-1:void 0,title:o,onclick:this._toggle}))}};t([i()],u.prototype,"icon",null),t([i()],u.prototype,"label",null),t([i({value:"vertical"})],u.prototype,"layout",null),t([i(),p("esri/widgets/NavigationToggle/t9n/NavigationToggle")],u.prototype,"messages",void 0),t([i()],u.prototype,"view",null),t([i({type:a})],u.prototype,"viewModel",void 0),u=t([s("esri.widgets.NavigationToggle")],u);const v=u;export{v 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{property as t,subclass as c}from"../../../core/accessorSupport/decorators.js";import{substitute as o}from"../../../intl/substitute.js";import n from"../../Widget.js";import{css as a}from"../css.js";import{copyToClipboard as l}from"../imageMeasurementUtils.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{tsx as r}from"../../support/widget.js";import{messageBundle as s}from"../../support/decorators/messageBundle.js";let d=class extends n{constructor(e){super(e),this.messages=null,this.messagesCommon=null,this.accuracy=null,this._selectedSystem="Basemap",this._handleSystemSelection=e=>{this._selectedSystem=e.target.value}}loadDependencies(){return i({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),table:()=>import("@esri/calcite-components/dist/components/calcite-table"),"table-row":()=>import("@esri/calcite-components/dist/components/calcite-table-row"),"table-header":()=>import("@esri/calcite-components/dist/components/calcite-table-header"),"table-cell":()=>import("@esri/calcite-components/dist/components/calcite-table-cell")})}get _renderLocationBlock(){const{groundCoordinates:e,_selectedSystem:t}=this;return e&&"XY"===t?r("calcite-block",{heading:this.getLocation(),headingLevel:6}):null}get _renderLocationTable(){const{groundCoordinates:e,messages:t,_selectedSystem:c,accuracy:o}=this,n={groundX:e.x.toFixed(3),accuracyX:null!=o?.x?o.x.toFixed(3):"",groundY:e.y.toFixed(3),accuracyY:null!=o?.y?o.y.toFixed(3):"",groundZ:e.z?e.z.toFixed(3):"",accuracyZ:null!=o?.z?o.z.toFixed(3):""};return e&&"Basemap"===c?r("calcite-table",{bordered:!0,caption:t.measurementTable,class:a.measurementsTable,scale:"s"},r("calcite-table-row",{slot:"table-header"},r("calcite-table-header",{alignment:"center",heading:t.type}),r("calcite-table-header",{alignment:"center",heading:t.value}),r("calcite-table-header",{alignment:"center",heading:t.accuracy})),r("calcite-table-row",null,r("calcite-table-cell",{alignment:"center"},t.x),r("calcite-table-cell",{alignment:"center"},n.groundX),r("calcite-table-cell",{alignment:"center"},n.accuracyX)),r("calcite-table-row",null,r("calcite-table-cell",{alignment:"center"},t.y),r("calcite-table-cell",{alignment:"center"},n.groundY),r("calcite-table-cell",{alignment:"center"},n.accuracyY)),r("calcite-table-row",null,r("calcite-table-cell",{alignment:"center"},t.z),r("calcite-table-cell",{alignment:"center"},n.groundZ),r("calcite-table-cell",{alignment:"center"},n.accuracyZ))):null}get _renderSystemSelect(){const{messages:e,messagesCommon:t,groundCoordinates:c}=this,o="feet"===c.spatialReference.unit?e.xyzFeet:e.xyz;return r("div",{class:a.measurementsBar},r("calcite-select",{bind:this,label:e.selectUnitSystem,scale:"m",width:"full",onCalciteSelectChange:this._handleSystemSelection},r("calcite-option",{value:"Basemap"},o),r("calcite-option",{value:"XY"},e.decimalDegrees)),r("calcite-action",{icon:"copy-to-clipboard",onclick:()=>this.copyLocation(),scale:"s",slot:"control",text:"Copy",title:t.copy}))}copyLocation(){const{groundCoordinates:e}=this;if(!e)return;const t=this.getLocation();t&&l(t)}getLocation(){const{_selectedSystem:e,groundCoordinates:t,accuracy:c}=this;return"Basemap"===e?this.getBasemapLocation(t,c):this.getXYLocation(t)}getXYLocation(e){if(null==e?.longitude||null==e?.latitude)return"";const t={groundX:e.longitude.toFixed(6),groundY:e.latitude.toFixed(6)};return o("{groundX}° , {groundY}°",t)}getBasemapLocation(e,t){if(null==e?.x||null==e?.y)return"";const c={groundX:e.x.toFixed(3),accuracyX:t?.x?t.x.toFixed(3):0,groundY:e.y.toFixed(3),accuracyY:t?.y?t.y.toFixed(3):0,groundZ:e.z?e.z.toFixed(3):0,accuracyZ:t?.z?t.z.toFixed(3):0};return o("{groundX} ± {accuracyX}, {groundY} ± {accuracyY}, {groundZ} ± {accuracyZ}",c)}render(){return r("calcite-panel",{class:a.measurementResults,key:"ground-location-container"},this._renderSystemSelect,this._renderLocationBlock,this._renderLocationTable)}};e([t()],d.prototype,"messages",void 0),e([t(),s("esri/t9n/common")],d.prototype,"messagesCommon",void 0),e([t()],d.prototype,"groundCoordinates",void 0),e([t()],d.prototype,"accuracy",void 0),e([t()],d.prototype,"_selectedSystem",void 0),e([t()],d.prototype,"_renderLocationBlock",null),e([t()],d.prototype,"_renderLocationTable",null),e([t()],d.prototype,"_renderSystemSelect",null),d=e([c("esri.widgets.OrientedImageryViewer.components.ImageLocationWidget")],d);const m=d;export{m as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as c}from"../../../core/accessorSupport/decorators.js";import{substitute as o}from"../../../intl/substitute.js";import n from"../../Widget.js";import{css as a}from"../css.js";import{copyToClipboard as l}from"../imageMeasurementUtils.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{tsx as r}from"../../support/widget.js";import{messageBundle as s}from"../../support/decorators/messageBundle.js";let d=class extends n{constructor(e){super(e),this.messages=null,this.messagesCommon=null,this.accuracy=null,this._selectedSystem="Basemap",this._handleSystemSelection=e=>{this._selectedSystem=e.target.value}}loadDependencies(){return i({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),table:()=>import("@esri/calcite-components/dist/components/calcite-table"),"table-row":()=>import("@esri/calcite-components/dist/components/calcite-table-row"),"table-header":()=>import("@esri/calcite-components/dist/components/calcite-table-header"),"table-cell":()=>import("@esri/calcite-components/dist/components/calcite-table-cell")})}get _renderLocationBlock(){const{groundCoordinates:e,_selectedSystem:t}=this;return e&&"XY"===t?r("calcite-block",{heading:this.getLocation(),headingLevel:6}):null}get _renderLocationTable(){const{groundCoordinates:e,messages:t,_selectedSystem:c,accuracy:o}=this,n={groundX:e.x.toFixed(3),accuracyX:null!=o?.x?o.x.toFixed(3):"",groundY:e.y.toFixed(3),accuracyY:null!=o?.y?o.y.toFixed(3):"",groundZ:e.z?e.z.toFixed(3):"",accuracyZ:null!=o?.z?o.z.toFixed(3):""};return e&&"Basemap"===c?r("calcite-table",{bordered:!0,caption:t.measurementTable,class:a.measurementsTable,scale:"s"},r("calcite-table-row",{slot:"table-header"},r("calcite-table-header",{alignment:"center",heading:t.type}),r("calcite-table-header",{alignment:"center",heading:t.value}),r("calcite-table-header",{alignment:"center",heading:t.accuracy})),r("calcite-table-row",null,r("calcite-table-cell",{alignment:"center"},t.x),r("calcite-table-cell",{alignment:"center"},n.groundX),r("calcite-table-cell",{alignment:"center"},n.accuracyX)),r("calcite-table-row",null,r("calcite-table-cell",{alignment:"center"},t.y),r("calcite-table-cell",{alignment:"center"},n.groundY),r("calcite-table-cell",{alignment:"center"},n.accuracyY)),r("calcite-table-row",null,r("calcite-table-cell",{alignment:"center"},t.z),r("calcite-table-cell",{alignment:"center"},n.groundZ),r("calcite-table-cell",{alignment:"center"},n.accuracyZ))):null}get _renderSystemSelect(){const{messages:e,messagesCommon:t,groundCoordinates:c}=this,o="feet"===c.spatialReference.unit?e.xyzFeet:e.xyz;return r("div",{class:a.measurementsBar},r("calcite-select",{bind:this,label:e.selectUnitSystem,scale:"m",width:"full",onCalciteSelectChange:this._handleSystemSelection},r("calcite-option",{value:"Basemap"},o),r("calcite-option",{value:"XY"},e.decimalDegrees)),r("calcite-action",{icon:"copy-to-clipboard",scale:"s",slot:"control",text:"Copy",title:t.copy,onclick:()=>this.copyLocation()}))}copyLocation(){const{groundCoordinates:e}=this;if(!e)return;const t=this.getLocation();t&&l(t)}getLocation(){const{_selectedSystem:e,groundCoordinates:t,accuracy:c}=this;return"Basemap"===e?this.getBasemapLocation(t,c):this.getXYLocation(t)}getXYLocation(e){if(null==e?.longitude||null==e?.latitude)return"";const t={groundX:e.longitude.toFixed(6),groundY:e.latitude.toFixed(6)};return o("{groundX}° , {groundY}°",t)}getBasemapLocation(e,t){if(null==e?.x||null==e?.y)return"";const c={groundX:e.x.toFixed(3),accuracyX:t?.x?t.x.toFixed(3):0,groundY:e.y.toFixed(3),accuracyY:t?.y?t.y.toFixed(3):0,groundZ:e.z?e.z.toFixed(3):0,accuracyZ:t?.z?t.z.toFixed(3):0};return o("{groundX} ± {accuracyX}, {groundY} ± {accuracyY}, {groundZ} ± {accuracyZ}",c)}render(){return r("calcite-panel",{class:a.measurementResults,key:"ground-location-container"},this._renderSystemSelect,this._renderLocationBlock,this._renderLocationTable)}};e([t()],d.prototype,"messages",void 0),e([t(),s("esri/t9n/common")],d.prototype,"messagesCommon",void 0),e([t()],d.prototype,"groundCoordinates",void 0),e([t()],d.prototype,"accuracy",void 0),e([t()],d.prototype,"_selectedSystem",void 0),e([t()],d.prototype,"_renderLocationBlock",null),e([t()],d.prototype,"_renderLocationTable",null),e([t()],d.prototype,"_renderSystemSelect",null),d=e([c("esri.widgets.OrientedImageryViewer.components.ImageLocationWidget")],d);const m=d;export{m 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{measurementLengthUnits as t,measurementAreaUnits as a}from"../../../core/units.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import s from"../../Widget.js";import{css as c}from"../css.js";import{TriangulatedImageMeasurementMixin as i}from"../mixins/TriangulatedImageMeasurementMixin.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import{UnitSelect as u}from"../../support/UnitSelect.js";import{tsx as o}from"../../support/widget.js";import{messageBundle as m}from"../../support/decorators/messageBundle.js";let g=class extends(i(s)){constructor(e){super(e),this.messagesCommon=null}loadDependencies(){return l({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),table:()=>import("@esri/calcite-components/dist/components/calcite-table"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"table-row":()=>import("@esri/calcite-components/dist/components/calcite-table-row"),"table-header":()=>import("@esri/calcite-components/dist/components/calcite-table-header"),"table-cell":()=>import("@esri/calcite-components/dist/components/calcite-table-cell")})}get _measurementResult(){const{measurementType:e,oiViewModel:t}=this,{areaMeasurementResult:a,heightMeasurementResult:n,distanceMeasurementResult:r}=t;switch(e){case"area":return a;case"height":return n;case"distance":return r}}get _measurementAccuracy(){const{measurementType:e,oiViewModel:t}=this,{areaMeasurementAccuracy:a,heightMeasurementAccuracy:n,distanceAccuracyArray:r}=t;switch(e){case"area":return a;case"height":return n;case"distance":return r}}get _measurementUnit(){const{measurementType:e,pixelAreaMeasurementUnit:t,pixelMeasurementUnit:a}=this;return"area"===e?t:a}get _measurementUnitOptions(){const{measurementType:e}=this;return"area"===e?a:t}_convertedMeasurement(){const{measurementType:e}=this;switch(e){case"area":return this.getConvertedAreaString("measurement");case"height":return this.getConvertedHeightString("measurement");case"distance":return this.getConvertedDistanceString("measurement")}}_measurementUnitChangeHandler(e){const{measurementType:t}=this;if("area"===t)this.pixelAreaMeasurementUnit=e;else this.pixelMeasurementUnit=e}_renderUnitSelect(){const{_measurementUnit:e,_measurementResult:t,_measurementUnitOptions:a,oiViewModel:n,messagesCommon:r}=this,{triangularMeasurementActive:s}=n;return t?o("div",{class:c.measurementsBar},o(u,{options:a,selectLabel:"",value:e,onChange:e=>this._measurementUnitChangeHandler(e)}),t?o("calcite-action",{bind:this,icon:"copy-to-clipboard",label:"copy",onclick:()=>this.copyActiveMeasurementResults(this.measurementType,s),scale:"s",text:"",title:r.copy}):null):null}_renderMeasurementResults(){const{_measurementResult:e,_measurementAccuracy:t,messages:a,measurementType:n}=this,{measurementTable:r,value:s,accuracy:i}=a;return e?o("calcite-table",{bordered:!0,caption:r,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:s}),o("calcite-table-header",{alignment:"center",heading:i})),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},this._convertedMeasurement()),o("calcite-table-cell",{alignment:"center"},"distance"===n&&Array.isArray(t)&&t?.length||"area"===n&&t||"height"===n&&t?this.getAccuracy(this.measurementType):o("calcite-icon",{icon:"hourglass-active",scale:"s"})))):null}_renderActiveMeasurementResults(){const{oiViewModel:e}=this,{triangularMeasurementActive:t,measureType:a}=e;if(t)switch(a){case"area":return this._renderTriangularAreaMeasurementResults();case"distance":return this._renderTriangularDistanceMeasurementResults()}return this._renderMeasurementResults()}_renderNewMeasurementButton(){const{messages:e,measurementType:t}=this;return o("calcite-button",{class:c.measurementsButton,onclick:()=>this.oiViewModel.initializeMeasurement(t)},e.newMeasurement)}_renderStartMeasurementMessage(){const{oiViewModel:{displayNewMeasurementButton:e},messages:t,_measurementResult:a}=this;return!e&&!a&&o("div",{class:c.measurementDisplay,key:`start-measurement-${this.measurementType}`},t.startMeasurement)}_renderTriangularAreaMeasurementResults(){const{messages:e,oiViewModel:t}=this,{measurementTable:a,value:n,accuracy:r}=e,{triangulatedAreaMeasurement:s}=t;return s?o("calcite-table",{bordered:!0,caption:a,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:n}),o("calcite-table-header",{alignment:"center",heading:r})),o("calcite-table-row",null,this._renderTriangularAreaCell("measurement"),this._renderTriangularAreaCell("accuracy"))):null}_renderTriangularDistanceAccuracyCell(){const{oiViewModel:e}=this,{triangulatedDistanceAccuracy:t}=e;return o("calcite-table-cell",{alignment:"center"},t?.distanceAccuracy?this.getConvertedTriangularDistanceMeasurementString(t.distanceAccuracy):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularAreaCell(e){const{oiViewModel:t}=this,{triangulatedAreaMeasurement:a}=t;return o("calcite-table-cell",{alignment:"center"},a?this.getConvertedTriangularAreaString(e):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularDistanceAngleAccuracyCell(){const{oiViewModel:e}=this,{triangulatedDistanceAccuracy:t}=e;return o("calcite-table-cell",{alignment:"center"},t?.angleAccuracy?this.getConvertedTriangularDistanceAngularResultsString(t.angleAccuracy):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularDistanceMeasurementResults(){const{oiViewModel:e,messages:t}=this,{distance:a,horizontal:n,vertical:r,slope:s,aspect:i,measurementTable:l,value:u,accuracy:m,type:g}=t,{triangulatedDistanceMeasurement:d,triangularMeasurementActive:h,measureType:p}=e;return h&&"distance"===p&&d?o("calcite-table",{bordered:!0,caption:l,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:g}),o("calcite-table-header",{alignment:"center",heading:u}),o("calcite-table-header",{alignment:"center",heading:m})),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},a),o("calcite-table-cell",{alignment:"center"},d?.distance?this.getConvertedTriangularDistanceMeasurementString(d.distance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},n),o("calcite-table-cell",{alignment:"center"},d?.horizontalDistance?this.getConvertedTriangularDistanceMeasurementString(d.horizontalDistance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},r),o("calcite-table-cell",{alignment:"center"},d?.verticalDistance?this.getConvertedTriangularDistanceMeasurementString(d.verticalDistance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},s),o("calcite-table-cell",{alignment:"center"},d?.slope?this.getConvertedTriangularDistanceAngularResultsString(d.slope):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAngleAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},i),o("calcite-table-cell",{alignment:"center"},d?.aspect?this.getConvertedTriangularDistanceAngularResultsString(d.aspect):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAngleAccuracyCell())):null}render(){return o("calcite-panel",{class:c.measurementResults,key:`measurement-result-container-${this.measurementType}`},this._renderStartMeasurementMessage(),this._renderNewMeasurementButton(),this._renderUnitSelect(),this._renderActiveMeasurementResults())}};e([n(),m("esri/t9n/common")],g.prototype,"messagesCommon",void 0),e([n()],g.prototype,"_measurementResult",null),e([n()],g.prototype,"_measurementAccuracy",null),e([n()],g.prototype,"_measurementUnit",null),e([n()],g.prototype,"_measurementUnitOptions",null),g=e([r("esri.widgets.OrientedImageryViewer.components.ImageMeasurementWidget")],g);const d=g;export{d as default};
2
+ import{__decorate as e}from"tslib";import{measurementLengthUnits as t,measurementAreaUnits as a}from"../../../core/units.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import s from"../../Widget.js";import{css as c}from"../css.js";import{TriangulatedImageMeasurementMixin as i}from"../mixins/TriangulatedImageMeasurementMixin.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import{UnitSelect as u}from"../../support/UnitSelect.js";import{tsx as o}from"../../support/widget.js";import{messageBundle as m}from"../../support/decorators/messageBundle.js";let g=class extends(i(s)){constructor(e){super(e),this.messagesCommon=null}loadDependencies(){return l({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),table:()=>import("@esri/calcite-components/dist/components/calcite-table"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"table-row":()=>import("@esri/calcite-components/dist/components/calcite-table-row"),"table-header":()=>import("@esri/calcite-components/dist/components/calcite-table-header"),"table-cell":()=>import("@esri/calcite-components/dist/components/calcite-table-cell")})}get _measurementResult(){const{measurementType:e,oiViewModel:t}=this,{areaMeasurementResult:a,heightMeasurementResult:n,distanceMeasurementResult:r}=t;switch(e){case"area":return a;case"height":return n;case"distance":return r}}get _measurementAccuracy(){const{measurementType:e,oiViewModel:t}=this,{areaMeasurementAccuracy:a,heightMeasurementAccuracy:n,distanceAccuracyArray:r}=t;switch(e){case"area":return a;case"height":return n;case"distance":return r}}get _measurementUnit(){const{measurementType:e,pixelAreaMeasurementUnit:t,pixelMeasurementUnit:a}=this;return"area"===e?t:a}get _measurementUnitOptions(){const{measurementType:e}=this;return"area"===e?a:t}_convertedMeasurement(){const{measurementType:e}=this;switch(e){case"area":return this.getConvertedAreaString("measurement");case"height":return this.getConvertedHeightString("measurement");case"distance":return this.getConvertedDistanceString("measurement")}}_measurementUnitChangeHandler(e){const{measurementType:t}=this;if("area"===t)this.pixelAreaMeasurementUnit=e;else this.pixelMeasurementUnit=e}_renderUnitSelect(){const{_measurementUnit:e,_measurementResult:t,_measurementUnitOptions:a,oiViewModel:n,messagesCommon:r}=this,{triangularMeasurementActive:s}=n;return t?o("div",{class:c.measurementsBar},o(u,{options:a,selectLabel:"",value:e,onChange:e=>this._measurementUnitChangeHandler(e)}),t?o("calcite-action",{bind:this,icon:"copy-to-clipboard",label:"copy",scale:"s",text:"",title:r.copy,onclick:()=>this.copyActiveMeasurementResults(this.measurementType,s)}):null):null}_renderMeasurementResults(){const{_measurementResult:e,_measurementAccuracy:t,messages:a,measurementType:n}=this,{measurementTable:r,value:s,accuracy:i}=a;return e?o("calcite-table",{bordered:!0,caption:r,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:s}),o("calcite-table-header",{alignment:"center",heading:i})),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},this._convertedMeasurement()),o("calcite-table-cell",{alignment:"center"},"distance"===n&&Array.isArray(t)&&t?.length||"area"===n&&t||"height"===n&&t?this.getAccuracy(this.measurementType):o("calcite-icon",{icon:"hourglass-active",scale:"s"})))):null}_renderActiveMeasurementResults(){const{oiViewModel:e}=this,{triangularMeasurementActive:t,measureType:a}=e;if(t)switch(a){case"area":return this._renderTriangularAreaMeasurementResults();case"distance":return this._renderTriangularDistanceMeasurementResults()}return this._renderMeasurementResults()}_renderNewMeasurementButton(){const{messages:e,measurementType:t}=this;return o("calcite-button",{class:c.measurementsButton,onclick:()=>this.oiViewModel.initializeMeasurement(t)},e.newMeasurement)}_renderStartMeasurementMessage(){const{oiViewModel:{displayNewMeasurementButton:e},messages:t,_measurementResult:a}=this;return!e&&!a&&o("div",{class:c.measurementDisplay,key:`start-measurement-${this.measurementType}`},t.startMeasurement)}_renderTriangularAreaMeasurementResults(){const{messages:e,oiViewModel:t}=this,{measurementTable:a,value:n,accuracy:r}=e,{triangulatedAreaMeasurement:s}=t;return s?o("calcite-table",{bordered:!0,caption:a,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:n}),o("calcite-table-header",{alignment:"center",heading:r})),o("calcite-table-row",null,this._renderTriangularAreaCell("measurement"),this._renderTriangularAreaCell("accuracy"))):null}_renderTriangularDistanceAccuracyCell(){const{oiViewModel:e}=this,{triangulatedDistanceAccuracy:t}=e;return o("calcite-table-cell",{alignment:"center"},t?.distanceAccuracy?this.getConvertedTriangularDistanceMeasurementString(t.distanceAccuracy):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularAreaCell(e){const{oiViewModel:t}=this,{triangulatedAreaMeasurement:a}=t;return o("calcite-table-cell",{alignment:"center"},a?this.getConvertedTriangularAreaString(e):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularDistanceAngleAccuracyCell(){const{oiViewModel:e}=this,{triangulatedDistanceAccuracy:t}=e;return o("calcite-table-cell",{alignment:"center"},t?.angleAccuracy?this.getConvertedTriangularDistanceAngularResultsString(t.angleAccuracy):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularDistanceMeasurementResults(){const{oiViewModel:e,messages:t}=this,{distance:a,horizontal:n,vertical:r,slope:s,aspect:i,measurementTable:l,value:u,accuracy:m,type:g}=t,{triangulatedDistanceMeasurement:d,triangularMeasurementActive:h,measureType:p}=e;return h&&"distance"===p&&d?o("calcite-table",{bordered:!0,caption:l,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:g}),o("calcite-table-header",{alignment:"center",heading:u}),o("calcite-table-header",{alignment:"center",heading:m})),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},a),o("calcite-table-cell",{alignment:"center"},d?.distance?this.getConvertedTriangularDistanceMeasurementString(d.distance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},n),o("calcite-table-cell",{alignment:"center"},d?.horizontalDistance?this.getConvertedTriangularDistanceMeasurementString(d.horizontalDistance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},r),o("calcite-table-cell",{alignment:"center"},d?.verticalDistance?this.getConvertedTriangularDistanceMeasurementString(d.verticalDistance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},s),o("calcite-table-cell",{alignment:"center"},d?.slope?this.getConvertedTriangularDistanceAngularResultsString(d.slope):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAngleAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},i),o("calcite-table-cell",{alignment:"center"},d?.aspect?this.getConvertedTriangularDistanceAngularResultsString(d.aspect):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAngleAccuracyCell())):null}render(){return o("calcite-panel",{class:c.measurementResults,key:`measurement-result-container-${this.measurementType}`},this._renderStartMeasurementMessage(),this._renderNewMeasurementButton(),this._renderUnitSelect(),this._renderActiveMeasurementResults())}};e([n(),m("esri/t9n/common")],g.prototype,"messagesCommon",void 0),e([n()],g.prototype,"_measurementResult",null),e([n()],g.prototype,"_measurementAccuracy",null),e([n()],g.prototype,"_measurementUnit",null),e([n()],g.prototype,"_measurementUnitOptions",null),g=e([r("esri.widgets.OrientedImageryViewer.components.ImageMeasurementWidget")],g);const d=g;export{d as default};