@arcgis/core 5.0.0-next.14 → 5.0.0-next.16

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 (366) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/applications/Components/QuantityFormatter.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{5299ec59c86022ca37e2.js → 080268f78436a2f0d996.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{a6ee40dfc471d6612f3c.js → 1585298168c200d65c2f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{34bb4852ebef0f529c96.js → 1a98e35837c6279fd8ee.js} +1 -1
  7. package/assets/esri/core/workers/chunks/5608e1eeec887295dc7c.js +1 -0
  8. package/assets/esri/core/workers/chunks/57262321c51096ef885f.js +1 -0
  9. package/assets/esri/core/workers/chunks/58d891779f04b6d12fc0.js +1 -0
  10. package/assets/esri/core/workers/chunks/{7c14f99e6cfff2a8ef4a.js → 5a7bb13ccb9188f90dfd.js} +1 -1
  11. package/assets/esri/core/workers/chunks/607beb12592f99871bf9.js +1 -0
  12. package/assets/esri/core/workers/chunks/71d9e9b0a7f8c0edd32d.js +1 -0
  13. package/assets/esri/core/workers/chunks/{8be16b03caa947ac7631.js → 79326e3ebd5081046f79.js} +1 -1
  14. package/assets/esri/core/workers/chunks/7c08c0824ad354177787.js +1 -0
  15. package/assets/esri/core/workers/chunks/{54c49a768147720c3c56.js → 8208dfa8f7fae7e616b9.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{d7755c4c8d1d3059efca.js → 847f4fc39100fac1df01.js} +1 -1
  17. package/assets/esri/core/workers/chunks/8b73db0f4d6714396eb0.js +1 -0
  18. package/assets/esri/core/workers/chunks/{9cdd087c43a601ec331d.js → 9a7f7de06dbc37661ffb.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{55adbd7481f8dfb1067e.js → a174c9f6bc687349e563.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{38fa50336983265c73a4.js → bc318b6fef192cee2a72.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{57806a01f33074b601e7.js → cdb4664fd59860ddeb5a.js} +1 -1
  22. package/assets/esri/core/workers/chunks/d98203c932a60f9f809d.js +1 -0
  23. package/assets/esri/core/workers/chunks/{5e08b19e6d7202ea38d7.js → db900e8949cc75e72b18.js} +1 -1
  24. package/assets/esri/core/workers/chunks/de831a9cb542a09db5c3.js +1 -0
  25. package/assets/esri/core/workers/chunks/{2166238a7ad63a2d43c7.js → e05ce6f91ca59e34da7c.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{f28ffda9a95c6568503d.js → e07dda45281439e6582e.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{d888ae5ac1810a486919.js → ff8752dbcb014ea66806.js} +1 -1
  28. package/chunks/GaussianSplat.glsl.js +2 -2
  29. package/config.js +1 -1
  30. package/copyright.txt +0 -60
  31. package/core/SetUtils.js +1 -1
  32. package/core/accessorSupport/ensureType.js +1 -1
  33. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  34. package/core/workers/workerFactory.js +1 -1
  35. package/identity/IdentityModal.js +1 -1
  36. package/interfaces.d.ts +107 -11
  37. package/intl.js +1 -1
  38. package/kernel.js +1 -1
  39. package/layers/ImageryTileLayer.js +1 -1
  40. package/layers/ParquetLayer.js +1 -1
  41. package/layers/graphics/sources/ParquetSource.js +1 -1
  42. package/layers/graphics/sources/support/QueryTask.js +1 -1
  43. package/layers/mixins/ArcGISImageService.js +1 -1
  44. package/layers/mixins/ImageryTileMixin.js +1 -1
  45. package/layers/support/NumberFieldFormat.js +1 -1
  46. package/layers/support/Sublayer.js +1 -1
  47. package/layers/support/SubtypeSublayer.js +1 -1
  48. package/layers/support/featureLayerUtils.js +1 -1
  49. package/layers/support/fieldUtils.js +1 -1
  50. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  51. package/layers/support/rasterFunctionUtils.js +1 -1
  52. package/package.json +1 -1
  53. package/popup/content.js +1 -1
  54. package/portal/schemas/definitions.js +1 -1
  55. package/renderers/support/numberUtils.js +1 -1
  56. package/rest/geometryService.js +1 -1
  57. package/rest/geoprocessor.js +1 -1
  58. package/rest/imageService.js +1 -1
  59. package/rest/locator.js +1 -1
  60. package/rest/query.js +1 -1
  61. package/smartMapping/labels/bins.js +1 -1
  62. package/smartMapping/popup/support/clusterUtils.js +1 -1
  63. package/smartMapping/popup/support/utils.js +1 -1
  64. package/smartMapping/renderers/support/utils.js +1 -1
  65. package/support/BasemapStyle.js +1 -1
  66. package/support/actions/actionUtils.js +1 -1
  67. package/support/revision.js +1 -1
  68. package/symbols/support/svgUtils.js +1 -1
  69. package/tables/elements.js +1 -1
  70. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  71. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  72. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  73. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  74. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  75. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  76. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  77. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  78. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  79. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  80. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  81. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  82. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  83. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  84. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +14 -32
  85. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +17 -0
  86. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +10 -0
  87. package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
  88. package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +26 -0
  89. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  90. package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
  91. package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
  92. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  93. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +5 -0
  94. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +5 -0
  95. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  96. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  97. package/views/draw/support/Reshape.js +1 -1
  98. package/views/input/gamepad/GamepadInputDevice.js +1 -1
  99. package/views/input/gamepad/GamepadSource.js +1 -1
  100. package/views/interactive/SegmentLabels.js +1 -1
  101. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  102. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  103. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  104. package/views/interactive/tooltip/components/TooltipField.js +1 -1
  105. package/views/interactive/tooltip/components/ValueByValue.js +1 -1
  106. package/views/interactive/tooltip/content/Fields.js +1 -1
  107. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  108. package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
  109. package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
  110. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  111. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  112. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  113. package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
  114. package/views/interactive/tooltip/content/TooltipContentElevation.js +1 -1
  115. package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
  116. package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
  117. package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
  118. package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
  119. package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
  120. package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
  121. package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
  122. package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
  123. package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
  124. package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
  125. package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
  126. package/views/overlay/BoxOverlayItem.js +1 -1
  127. package/views/overlay/CrosshairOverlayItem.js +1 -1
  128. package/views/overlay/OutlineOverlayItem.js +1 -1
  129. package/views/ui/UI.js +1 -1
  130. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  131. package/widgets/AreaMeasurement2D.js +1 -1
  132. package/widgets/AreaMeasurement3D.js +1 -1
  133. package/widgets/Attachments.js +1 -1
  134. package/widgets/Attribution.js +1 -1
  135. package/widgets/BasemapGallery.js +1 -1
  136. package/widgets/BasemapLayerList.js +1 -1
  137. package/widgets/BasemapToggle.js +1 -1
  138. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  139. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  140. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  141. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  142. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  143. package/widgets/BatchAttributeForm.js +1 -1
  144. package/widgets/Bookmarks.js +1 -1
  145. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  146. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  147. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  148. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  149. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  150. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  151. package/widgets/BuildingExplorer.js +1 -1
  152. package/widgets/CatalogLayerList.js +1 -1
  153. package/widgets/Compass.js +1 -1
  154. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  155. package/widgets/CoordinateConversion.js +1 -1
  156. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  157. package/widgets/Daylight.js +1 -1
  158. package/widgets/DirectLineMeasurement3D.js +1 -1
  159. package/widgets/DirectionalPad.js +1 -1
  160. package/widgets/Directions.js +1 -1
  161. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  162. package/widgets/DistanceMeasurement2D.js +1 -1
  163. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  164. package/widgets/Editor/EditorViewModel.js +1 -1
  165. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  166. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  167. package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
  168. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  169. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  170. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  171. package/widgets/Editor/UpdateWorkflow.js +1 -1
  172. package/widgets/Editor/Workflow.js +1 -1
  173. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  174. package/widgets/Editor/components/FeatureList.js +1 -1
  175. package/widgets/Editor/components/FooterActions.js +1 -1
  176. package/widgets/Editor/components/MergeFeaturesList.js +1 -1
  177. package/widgets/Editor/components/Notices.js +1 -1
  178. package/widgets/Editor/components/PanelContent.js +1 -1
  179. package/widgets/Editor/components/PanelToolbar.js +1 -1
  180. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  181. package/widgets/Editor/components/Prompt.js +1 -1
  182. package/widgets/Editor/components/Settings.js +1 -1
  183. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  184. package/widgets/Editor/components/UploadDetails.js +1 -1
  185. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +1 -1
  186. package/widgets/Editor/support/errors.js +1 -1
  187. package/widgets/Editor.js +1 -1
  188. package/widgets/ElevationProfile/components/Legend.js +1 -1
  189. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  190. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  191. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  192. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  193. package/widgets/ElevationProfile.js +1 -1
  194. package/widgets/Expand.js +1 -1
  195. package/widgets/Feature/FeatureAttachments.js +1 -1
  196. package/widgets/Feature/FeatureContent.js +1 -1
  197. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  198. package/widgets/Feature/FeatureExpression.js +1 -1
  199. package/widgets/Feature/FeatureFields.js +1 -1
  200. package/widgets/Feature/FeatureMedia.js +1 -1
  201. package/widgets/Feature/FeatureRelationship.js +1 -1
  202. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  203. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  204. package/widgets/Feature/support/FeatureContentMixin.js +1 -1
  205. package/widgets/Feature/support/FeatureElementInfo.js +1 -1
  206. package/widgets/Feature.js +1 -1
  207. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
  208. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  209. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  210. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  211. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  212. package/widgets/FeatureForm.js +1 -1
  213. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  214. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  215. package/widgets/FeatureTable.js +1 -1
  216. package/widgets/FeatureTemplates.js +1 -1
  217. package/widgets/Features/FeaturesDrillIn.js +1 -1
  218. package/widgets/Features.js +1 -1
  219. package/widgets/FloorFilter.js +1 -1
  220. package/widgets/FovOverlay.js +1 -1
  221. package/widgets/Fullscreen.js +1 -1
  222. package/widgets/Histogram.js +1 -1
  223. package/widgets/HistogramRangeSlider.js +1 -1
  224. package/widgets/Home.js +1 -1
  225. package/widgets/LayerList/LayerListItem.js +1 -1
  226. package/widgets/LayerList/ListItemPanel.js +1 -1
  227. package/widgets/LayerList.js +1 -1
  228. package/widgets/Legend/LegendViewModel.js +1 -1
  229. package/widgets/Legend/styles/card/CardView.js +1 -1
  230. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  231. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  232. package/widgets/Legend/styles/card/SizeRamp.js +1 -1
  233. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  234. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  235. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  236. package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
  237. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  238. package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
  239. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  240. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  241. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  242. package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
  243. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  244. package/widgets/Legend/styles/support/utils.js +1 -1
  245. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  246. package/widgets/Legend/support/styleUtils.js +1 -1
  247. package/widgets/Legend/support/utils.js +1 -1
  248. package/widgets/Legend.js +1 -1
  249. package/widgets/LineOfSight.js +1 -1
  250. package/widgets/Locate/LocateViewModel.js +1 -1
  251. package/widgets/Locate.js +1 -1
  252. package/widgets/Measurement.js +1 -1
  253. package/widgets/NavigationToggle.js +1 -1
  254. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  255. package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
  256. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  257. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  258. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  259. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  260. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  261. package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
  262. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  263. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  264. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  265. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  266. package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
  267. package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
  268. package/widgets/OrientedImageryViewer.js +1 -1
  269. package/widgets/PanoramicVideoViewer.js +1 -1
  270. package/widgets/PanoramicViewer.js +1 -1
  271. package/widgets/Popup.js +1 -1
  272. package/widgets/Print/FileLink.js +1 -1
  273. package/widgets/Print.js +1 -1
  274. package/widgets/ScaleBar.js +1 -1
  275. package/widgets/ScaleRangeSlider.js +1 -1
  276. package/widgets/Search/SearchResultRenderer.js +1 -1
  277. package/widgets/Search/support/layerSearchUtils.js +1 -1
  278. package/widgets/Search.js +1 -1
  279. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  280. package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
  281. package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
  282. package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
  283. package/widgets/ShadowCast.js +1 -1
  284. package/widgets/Sketch/SketchViewModel.js +1 -1
  285. package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
  286. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  287. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  288. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  289. package/widgets/Sketch.js +1 -1
  290. package/widgets/Slice.js +1 -1
  291. package/widgets/Slider.js +1 -1
  292. package/widgets/Spinner.js +1 -1
  293. package/widgets/Swipe.js +1 -1
  294. package/widgets/TableList/ListItemPanel.js +1 -1
  295. package/widgets/TableList.js +1 -1
  296. package/widgets/TimeSlider.js +1 -1
  297. package/widgets/TimeZoneLabel.js +1 -1
  298. package/widgets/Track.js +1 -1
  299. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
  300. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  301. package/widgets/UtilityNetworkAssociations.js +1 -1
  302. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  303. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  304. package/widgets/UtilityNetworkTrace.js +1 -1
  305. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  306. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  307. package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
  308. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  309. package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
  310. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  311. package/widgets/ValuePicker.js +1 -1
  312. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  313. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  314. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  315. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  316. package/widgets/VideoPlayer.js +1 -1
  317. package/widgets/Weather/LabeledSlider.js +1 -1
  318. package/widgets/Weather.js +1 -1
  319. package/widgets/Widget.js +1 -1
  320. package/widgets/Zoom.js +1 -1
  321. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  322. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  323. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  324. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  325. package/widgets/smartMapping/ColorSlider.js +1 -1
  326. package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
  327. package/widgets/smartMapping/HeatmapSlider.js +1 -1
  328. package/widgets/smartMapping/OpacitySlider.js +1 -1
  329. package/widgets/smartMapping/SizeSlider.js +1 -1
  330. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  331. package/widgets/support/ColorPicker.js +1 -1
  332. package/widgets/support/FilterBuilder.js +1 -1
  333. package/widgets/support/FilterCondition.js +1 -1
  334. package/widgets/support/GridControls.js +1 -1
  335. package/widgets/support/Heading.js +1 -1
  336. package/widgets/support/ItemList.js +1 -1
  337. package/widgets/support/LabeledSwitch.js +1 -1
  338. package/widgets/support/MeasurementWidgetContent.js +1 -1
  339. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  340. package/widgets/support/SelectionList/LayerItem.js +1 -1
  341. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  342. package/widgets/support/SelectionList/selectionListUtils.js +1 -1
  343. package/widgets/support/SelectionList.js +1 -1
  344. package/widgets/support/SelectionToolbar.js +1 -1
  345. package/widgets/support/SketchTooltipControls.js +1 -1
  346. package/widgets/support/SnappingControls.js +1 -1
  347. package/widgets/support/TimezonePicker.js +1 -1
  348. package/widgets/support/UnitSelect.js +1 -1
  349. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  350. package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +1 -1
  351. package/widgets/support/chartUtilsAm5.js +1 -1
  352. package/widgets/support/dateUtils.js +1 -1
  353. package/widgets/support/iconUtils.js +1 -1
  354. package/widgets/support/widget.js +1 -1
  355. package/assets/esri/core/workers/chunks/097e5deb51ee7e25e654.js +0 -1
  356. package/assets/esri/core/workers/chunks/3edffdb0e282ed562ac7.js +0 -1
  357. package/assets/esri/core/workers/chunks/8fc82fe1fcbcedf35400.js +0 -1
  358. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +0 -1
  359. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +0 -1
  360. package/assets/esri/core/workers/chunks/c4dfd897bcab20dee43b.js +0 -1
  361. package/assets/esri/core/workers/chunks/c68935ed44eb0702a6ba.js +0 -1
  362. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +0 -1
  363. package/assets/esri/core/workers/chunks/fd88e07cba5964f80e9e.js +0 -1
  364. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +0 -5
  365. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +0 -5
  366. package/widgets/support/jsxFactory.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{on as s,watch as l,initial as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./LayerList/css.js";import c from"./LayerList/LayerListItem.js";import m from"./LayerList/LayerListViewModel.js";import h from"./LayerList/LayerListVisibleElements.js";import y from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as g,getItem as _,getLayerType as L,removeDestroyedListItems as f,setFilterPredicate as v,sortLayersToIds as I,sortChildLayersToIds as w}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{calciteListFilterProps as E}from"./support/listUtils.js";import{setFocus as F}from"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as O}from"./support/decorators/vmEvent.js";import{tsx as T}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const P=t.ofType(y),A="nested";let j=class extends(i(d)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new o,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=u,this.minFilterItems=g,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=_(e);if(!l?.sortable)return!1;const r=_(t),a=L(t),n=_(i),d=L(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"]),f="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==f},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(p.item));this._activeItem=_(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})}}}initialize(){this.addHandles([s(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),r),s(()=>this.viewModel.operationalItems,"change",()=>f(this.selectedItems),r),l(()=>[this.filterPredicate,this._rootListEl],()=>v(this._rootListEl,this.filterPredicate))])}loadDependencies(){return b({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={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return T("div",{class:this.classes(p.base,C.widget,C.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?T("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid)},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 T("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return T("div",{class:p.itemMessage,key:"esri-layer-list__no-items"},T("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 T("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 T("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(),T("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,F(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,F(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,F(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:c,selectionMode:m,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,_=[T("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(),T("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:A,dragEnabled:c,filterEnabled:s,filterPlaceholder:u,filterProps:E,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:m,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?T("div",{class:p.filterNoResults,slot:"filter-no-results"},T("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?T("calcite-flow",{key:"root-flow"},_):_:null}_renderItem(e,t,i){return T(c,{activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:A,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=_(i),l=_(e),r=_(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)I(this.view?.map?.layers,t);else{const i=_(e);if(!i)return;w(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>_(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([a()],j.prototype,"_rootListEl",void 0),e([a()],j.prototype,"_activeItem",void 0),e([a()],j.prototype,"_tooltipReferenceMap",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_focusLayerFlowItem",void 0),e([a()],j.prototype,"_layerListMap",void 0),e([a()],j.prototype,"_totalItems",null),e([a()],j.prototype,"_visibleItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"_dragEnabled",null),e([a()],j.prototype,"_filterEnabled",null),e([a()],j.prototype,"_renderedOpenLayerFlowItems",null),e([a({readOnly:!0})],j.prototype,"catalogLayerList",void 0),e([a()],j.prototype,"catalogOptions",void 0),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"filterPredicate",void 0),e([a()],j.prototype,"filterText",void 0),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"knowledgeGraphOptions",void 0),e([a()],j.prototype,"label",null),e([a()],j.prototype,"layerTablesEnabled",void 0),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"listItemCreatedFunction",null),e([a()],j.prototype,"mapImageOptions",void 0),e([a(),M("esri/widgets/LayerList/t9n/LayerList")],j.prototype,"messages",void 0),e([a(),M("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minDragEnabledItems",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],j.prototype,"openedLayers",void 0),e([a({readOnly:!0})],j.prototype,"openedLayerLists",void 0),e([a()],j.prototype,"operationalItems",null),e([a()],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a({readOnly:!0})],j.prototype,"tableList",void 0),e([a()],j.prototype,"tileOptions",void 0),e([a()],j.prototype,"view",null),e([O("trigger-action"),a({type:m})],j.prototype,"viewModel",void 0),e([a()],j.prototype,"visibilityAppearance",void 0),e([a({type:h,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([n("esri.widgets.LayerList")],j);const D=j;export{D as default};
5
+ import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{on as s,watch as l,initial as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./LayerList/css.js";import c from"./LayerList/LayerListItem.js";import m from"./LayerList/LayerListViewModel.js";import h from"./LayerList/LayerListVisibleElements.js";import y from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as g,getItem as _,getLayerType as L,removeDestroyedListItems as f,setFilterPredicate as v,sortLayersToIds as I,sortChildLayersToIds as w}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{calciteListFilterProps as E}from"./support/listUtils.js";import{tsx as F,messageBundle as M,vmEvent as O}from"./support/widget.js";import{setFocus as T}from"./support/widgetUtils.js";const P=t.ofType(y),A="nested";let D=class extends(i(d)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new o,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=u,this.minFilterItems=g,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=_(e);if(!l?.sortable)return!1;const r=_(t),a=L(t),n=_(i),d=L(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"]),f="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==f},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(p.item));this._activeItem=_(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})}}}initialize(){this.addHandles([s(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),r),s(()=>this.viewModel.operationalItems,"change",()=>f(this.selectedItems),r),l(()=>[this.filterPredicate,this._rootListEl],()=>v(this._rootListEl,this.filterPredicate))])}loadDependencies(){return b({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={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return F("div",{class:this.classes(p.base,C.widget,C.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?F("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid)},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 F("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return F("div",{class:p.itemMessage,key:"esri-layer-list__no-items"},F("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 F("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 F("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(),F("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,T(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,T(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,T(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:c,selectionMode:m,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,_=[F("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(),F("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:A,dragEnabled:c,filterEnabled:s,filterPlaceholder:u,filterProps:E,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:m,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?F("div",{class:p.filterNoResults,slot:"filter-no-results"},F("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?F("calcite-flow",{key:"root-flow"},_):_:null}_renderItem(e,t,i){return F(c,{activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:A,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=_(i),l=_(e),r=_(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)I(this.view?.map?.layers,t);else{const i=_(e);if(!i)return;w(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>_(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([a()],D.prototype,"_rootListEl",void 0),e([a()],D.prototype,"_activeItem",void 0),e([a()],D.prototype,"_tooltipReferenceMap",void 0),e([a()],D.prototype,"_focusRootFlowItem",void 0),e([a()],D.prototype,"_focusPanelFlowItem",void 0),e([a()],D.prototype,"_focusLayerFlowItem",void 0),e([a()],D.prototype,"_layerListMap",void 0),e([a()],D.prototype,"_totalItems",null),e([a()],D.prototype,"_visibleItems",null),e([a()],D.prototype,"_openedPanelItems",null),e([a()],D.prototype,"_dragEnabled",null),e([a()],D.prototype,"_filterEnabled",null),e([a()],D.prototype,"_renderedOpenLayerFlowItems",null),e([a({readOnly:!0})],D.prototype,"catalogLayerList",void 0),e([a()],D.prototype,"catalogOptions",void 0),e([a()],D.prototype,"collapsed",void 0),e([a()],D.prototype,"dragEnabled",void 0),e([a()],D.prototype,"filterPlaceholder",void 0),e([a()],D.prototype,"filterPredicate",void 0),e([a()],D.prototype,"filterText",void 0),e([a()],D.prototype,"headingLevel",void 0),e([a()],D.prototype,"icon",null),e([a()],D.prototype,"knowledgeGraphOptions",void 0),e([a()],D.prototype,"label",null),e([a()],D.prototype,"layerTablesEnabled",void 0),e([a()],D.prototype,"listItemCanGiveFunction",void 0),e([a()],D.prototype,"listItemCanReceiveFunction",void 0),e([a()],D.prototype,"listItemCreatedFunction",null),e([a()],D.prototype,"mapImageOptions",void 0),e([a(),M("esri/widgets/LayerList/t9n/LayerList")],D.prototype,"messages",void 0),e([a(),M("esri/t9n/common")],D.prototype,"messagesCommon",void 0),e([a()],D.prototype,"minDragEnabledItems",void 0),e([a()],D.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],D.prototype,"openedLayers",void 0),e([a({readOnly:!0})],D.prototype,"openedLayerLists",void 0),e([a()],D.prototype,"operationalItems",null),e([a()],D.prototype,"selectedItems",void 0),e([a()],D.prototype,"selectionMode",void 0),e([a({readOnly:!0})],D.prototype,"tableList",void 0),e([a()],D.prototype,"tileOptions",void 0),e([a()],D.prototype,"view",null),e([O("trigger-action"),a({type:m})],D.prototype,"viewModel",void 0),e([a()],D.prototype,"visibilityAppearance",void 0),e([a({type:h,nonNullable:!0})],D.prototype,"visibleElements",void 0),D=e([n("esri.widgets.LayerList")],D);const R=D;export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../intl.js";import i from"../../core/Accessor.js";import r from"../../core/Collection.js";import{watch as t,initial as s,when as a}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{get as l}from"../../core/accessorSupport/get.js";import{getEffectiveFeatureReduction as y}from"../../views/2d/layers/features/layerAdapters/featureReductionUtils.js";import d from"./support/ActiveLayerInfo.js";import{onLocaleChange as h}from"../../intl/locale.js";const c={state:"state",view:"view",allLayerViews:"all-layer-views",legendProperties:"legend-properties"},L=r.ofType(d),f=new Set(["esri.layers.BuildingSceneLayer","esri.layers.CatalogLayer","esri.layers.CSVLayer","esri.layers.FeatureLayer","esri.layers.GeoJSONLayer","esri.layers.GeoRSSLayer","esri.layers.GroupLayer","esri.layers.HeatmapLayer","esri.layers.ImageryLayer","esri.layers.ImageryTileLayer","esri.layers.MapImageLayer","esri.layers.OGCFeatureLayer","esri.layers.OrientedImageryLayer","esri.layers.ParquetLayer","esri.layers.PointCloudLayer","esri.layers.StreamLayer","esri.layers.SceneLayer","esri.layers.SubtypeGroupLayer","esri.layers.TileLayer","esri.layers.VoxelLayer","esri.layers.WFSLayer","esri.layers.WMSLayer","esri.layers.WMTSLayer","esri.layers.WCSLayer","esri.layers.LinkChartLayer","esri.layers.catalog.CatalogFootprintLayer","esri.layers.catalog.CatalogDynamicGroupLayer","esri.layers.knowledgeGraph.KnowledgeGraphSublayer","esri.layers.KnowledgeGraphLayer"]),u="view.basemapView.baseLayerViews",p="view.groundView.layerViews",v="view.basemapView.referenceLayerViews",w=[u,p,"view.layerViews",v];let _=class extends i{constructor(e){super(e),this._layerViewByLayerId={},this._layerInfosByLayerViewId={},this._activeLayerInfosByLayerViewId={},this._activeLayerInfosWithNoParent=new r,this._activeLayerInfosPromises=new WeakMap,this.activeLayerInfos=new L,this.basemapLegendVisible=!1,this.groundLegendVisible=!1,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.respectLayerDefinitionExpression=!1,this.respectLayerVisibility=!0,this.layerInfos=[],this.view=null}initialize(){this.addHandles(t(()=>this.view,()=>this._viewHandles(),s),c.view),this.addHandles(h(()=>this._refresh()))}destroy(){this._destroyViewActiveLayerInfos(),this.view=null}get loading(){return this.activeLayerInfos.some(e=>e.loading)}get state(){return this.view?.ready?"ready":"disabled"}_viewHandles(){this.removeHandles(c.state),this.view&&this.addHandles(t(()=>this.state,()=>this._stateHandles(),s),c.state)}_stateHandles(){this._resetAll(),"ready"===this.state&&this._watchPropertiesAndAllLayerViews()}_resetAll(){this.removeHandles([c.allLayerViews,c.legendProperties]),this._destroyViewActiveLayerInfos(),this.activeLayerInfos.removeAll()}_destroyViewActiveLayerInfos(){Object.keys(this._activeLayerInfosByLayerViewId).forEach(this._destroyViewActiveLayerInfo,this)}_destroyViewActiveLayerInfo(e){this.removeHandles(e);const i=this._activeLayerInfosByLayerViewId[e];i&&this._activeLayerInfosPromises.delete(i),delete this._activeLayerInfosByLayerViewId[e],i?.parent?.children.remove(i)}_watchPropertiesAndAllLayerViews(){const{view:e}=this;if(!e)return;const{allLayerViews:i}=e;i.length&&this._refresh(),this.addHandles(i.on("change",e=>this._allLayerViewsChangeHandle(e)),c.allLayerViews),this.addHandles(t(()=>[this.basemapLegendVisible,this.groundLegendVisible,this.hideLayersNotInCurrentView,this.keepCacheOnDestroy,this.layerInfos,this.respectLayerDefinitionExpression,this.respectLayerVisibility],()=>this._refresh()),c.legendProperties)}_allLayerViewsChangeHandle(e){if(e.added.length&&this._generateActiveLayerInfosForLayerViews(e.added),e.moved.length)return this._destroyViewActiveLayerInfos(),void this._refresh();if(e.removed.length){for(const{uid:i}of e.removed)this._destroyViewActiveLayerInfo(i);this._refresh()}}_refresh(){this._layerInfosByLayerViewId={},this.activeLayerInfos.drain(e=>this._activeLayerInfosPromises.delete(e)),this._generateActiveLayerInfosForLayerViews(this._generateLayerViews())}_generateActiveLayerInfosForLayerViews(e){e.filter(this._filterBasemapLayerViews,this).filter(this._filterLayerViewsByLayerInfos,this).filter(this._isLayerViewSupported,this).forEach(this._generateActiveLayerInfo,this)}_filterBasemapLayerViews(e){if(!this.view?.basemapView)return!0;const{baseLayerViews:i,groundLayerViews:r,referenceLayerViews:t}=this.view.basemapView,s=!this.basemapLegendVisible&&(i?.includes(e)||t?.includes(e)),a=!this.groundLegendVisible&&r?.includes(e);return!s&&!a}_sortActiveLayerInfos(e){const i=this.view;if(e.length<2||!i)return;const r=[];e.forEach(i=>{if(!i.parent){const t=i.layer.parent,s=t&&"uid"in t&&this._layerViewByLayerId[t.uid],a=s&&this._activeLayerInfosByLayerViewId[s.uid];a&&e.includes(a)&&(r.push(i),i.parent=a,a.children.add(i),this._sortActiveLayerInfos(a.children))}}),e.removeMany(r);const t={};i.allLayerViews.forEach((e,i)=>t[e.layer.uid]=i),e.sort((e,i)=>{const r=t[e.layer.uid]||0;return(t[i.layer.uid]||0)-r})}_generateLayerViews(){const e=[];return w.filter(this._filterLayerViews,this).map(e=>l(this,e)).filter(e=>null!=e).forEach(this._collectLayerViews("layerViews",e)),e}_filterLayerViews(e){const i=!this.basemapLegendVisible&&(e===u||e===v),r=!this.groundLegendVisible&&e===p;return!i&&!r}_collectLayerViews(e,i){const r=t=>(t&&t.forEach(t=>{i.push(t),r(t[e])}),i);return r}_filterLayerViewsByLayerInfos(e){const i=this.layerInfos;return!i||!i.length||i.some(i=>this._hasLayerInfo(i,e))}_hasLayerInfo(e,i){const r=this._isLayerUIDMatching(e.layer,i.layer.uid);return r&&(this._layerInfosByLayerViewId[i.uid]=e),r}_isLayerUIDMatching(e,i){return e&&(e.uid===i||this._hasLayerUID(e.layers,i))}_hasLayerUID(e,i){return e&&e.some(e=>this._isLayerUIDMatching(e,i))}_isLayerViewSupported(e){return!!f.has(e.layer.declaredClass)&&(this._layerViewByLayerId[e.layer.uid]=e,!0)}_generateActiveLayerInfo(e){this._isLayerActive(e)?this._buildActiveLayerInfo(e):(this.removeHandles(e.uid),this.addHandles(t(()=>[e.legendEnabled,e.layer?.legendEnabled],()=>this._layerActiveHandle(e)),e.uid))}_layerActiveHandle(e){this._isLayerActive(e)&&(this.removeHandles(e.uid),this._buildActiveLayerInfo(e))}_isLayerActive(e){return!this.respectLayerVisibility||e.legendEnabled&&e.layer?.legendEnabled}async _buildActiveLayerInfo(e){const i=e.layer,r=e.uid,t=this._layerInfosByLayerViewId[r];let s=this._activeLayerInfosByLayerViewId[r];s||(s=new d({layer:i,layerView:e,view:this.view??void 0}),this._activeLayerInfosByLayerViewId[r]=s);const a=void 0!==t?.title&&t.layer.uid===i.uid;s.title=a?t.title:i.title,s.respectLayerDefinitionExpression=this.respectLayerDefinitionExpression,s.respectLayerVisibility=this.respectLayerVisibility,s.hideLayersNotInCurrentView=this.hideLayersNotInCurrentView,s.keepCacheOnDestroy=this.keepCacheOnDestroy,s.sublayerIds=t?.sublayerIds||[];const n=i.parent&&"uid"in i.parent?this._layerViewByLayerId[i.parent?.uid]:null;s.parent=this._activeLayerInfosByLayerViewId[n?.uid],this._addActiveLayerInfo(s),this._constructLegendElements(s),this._attachHandlesToActiveLayerInfo(s)}_attachHandlesToActiveLayerInfo(e){const{layer:i,layerView:r}=e,n=r.uid;this.removeHandles(n),this.addHandles([t(()=>i.title,i=>this._titleHandle(i,e)),t(()=>[i.opacity,"renderer"in i&&i.renderer,"pointSymbol"in i&&i.pointSymbol,"lineSymbol"in i&&i.lineSymbol,"polygonSymbol"in i&&i.polygonSymbol,"effect"in i&&i.effect,"featureReduction"in i&&y(i,r.view),this.view?.timeZone],()=>this._constructLegendElements(e)),t(()=>"filter"in r&&r.filter,()=>{null!=y(r.layer,r.view)&&this._constructLegendElements(e)}),a(()=>!!this.view?.stationary,()=>this._scaleHandle(e)),t(()=>e.loading,()=>this.notifyChange("loading"),s)],n),this.respectLayerVisibility&&this.addHandles([t(()=>i.legendEnabled,i=>this._legendEnabledHandle(i,e)),t(()=>r.legendEnabled,i=>{this.view?.suspended||this._legendEnabledHandle(i,e)})],n),this.respectLayerDefinitionExpression&&"definitionExpression"in i&&this.addHandles(t(()=>i.definitionExpression,()=>this._constructLegendElements(e)),n)}_titleHandle(e,i){i.title=e,this._constructLegendElements(i)}_legendEnabledHandle(e,i){e?this._addActiveLayerInfo(i):this._removeActiveLayerInfo(i)}_scaleHandle(e){(e.isScaleDriven||e.hideLayersNotInCurrentView)&&this._constructLegendElements(e)}_addActiveLayerInfo(e){const{layerView:i,layer:r}=e;if(this._isLayerActive(i)&&!this.activeLayerInfos.includes(e)){const i=e.parent;if(i)i.children.includes(e)||i.children.push(e),this._sortActiveLayerInfos(i.children);else{const i=this.layerInfos?.some(e=>e.layer.uid===r.uid),t=r.parent;(t&&"uid"in t?this._layerViewByLayerId[t.uid]:null)&&!i?this._activeLayerInfosWithNoParent.add(e):(this.activeLayerInfos.add(e),this._sortActiveLayerInfos(this.activeLayerInfos))}if(this._activeLayerInfosWithNoParent.length){const e=[];this._activeLayerInfosWithNoParent.forEach(i=>{const r=i.layer.parent,t=r&&"uid"in r?this._layerViewByLayerId[r?.uid]:null,s=this._activeLayerInfosByLayerViewId[t?.uid];s&&(e.push(i),i.parent=s)}),e.length&&(this._activeLayerInfosWithNoParent.removeMany(e),e.forEach(e=>this._addActiveLayerInfo(e)))}}}_removeActiveLayerInfo(e){const i=e.parent;i?i.children.remove(e):this.activeLayerInfos.remove(e)}async _getBuildLegendPromise(e){const{layer:i}=e;if("featureCollections"in i&&i.featureCollections)return e.buildLegendElementsForFeatureCollections(i.featureCollections);if("featureReduction"in i&&i.featureReduction&&"renderer"in i.featureReduction&&("binning"===i.featureReduction.type||"cluster"===i.featureReduction.type)&&(!this.view||i.featureReduction.maxScale<=this.view.scale))return e.buildLegendElementsForFeatureReduction(i.featureReduction);if("renderer"in i&&i.renderer&&!("sublayers"in i))return e.buildLegendElementsForRenderer(i.renderer);if("url"in i&&i.url&&"catalog"!==i.type&&"knowledge-graph"!==i.type)return e.buildLegendElementsForTools();const r=e.children.map(e=>this._constructLegendElements(e));return Promise.all(r).then(()=>{})}async _constructLegendElements(e){const i=this._activeLayerInfosPromises.get(e);i&&await i.catch(()=>{});const r=this._getBuildLegendPromise(e);this._activeLayerInfosPromises.set(e,r),r.finally(()=>{this._activeLayerInfosPromises.delete(e)})}};e([n({type:L})],_.prototype,"activeLayerInfos",void 0),e([n()],_.prototype,"basemapLegendVisible",void 0),e([n()],_.prototype,"groundLegendVisible",void 0),e([n()],_.prototype,"hideLayersNotInCurrentView",void 0),e([n()],_.prototype,"keepCacheOnDestroy",void 0),e([n({readOnly:!0})],_.prototype,"loading",null),e([n()],_.prototype,"respectLayerDefinitionExpression",void 0),e([n()],_.prototype,"respectLayerVisibility",void 0),e([n()],_.prototype,"layerInfos",void 0),e([n({readOnly:!0})],_.prototype,"state",null),e([n()],_.prototype,"view",void 0),_=e([o("esri.widgets.Legend.LegendViewModel")],_);export{_ as default};
5
+ import{__decorate as e}from"tslib";import{onLocaleChange as i}from"../../intl.js";import r from"../../core/Accessor.js";import t from"../../core/Collection.js";import{watch as s,initial as a,when as n}from"../../core/reactiveUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{get as y}from"../../core/accessorSupport/get.js";import{getEffectiveFeatureReduction as d}from"../../views/2d/layers/features/layerAdapters/featureReductionUtils.js";import h from"./support/ActiveLayerInfo.js";const c={state:"state",view:"view",allLayerViews:"all-layer-views",legendProperties:"legend-properties"},L=t.ofType(h),f=new Set(["esri.layers.BuildingSceneLayer","esri.layers.CatalogLayer","esri.layers.CSVLayer","esri.layers.FeatureLayer","esri.layers.GeoJSONLayer","esri.layers.GeoRSSLayer","esri.layers.GroupLayer","esri.layers.HeatmapLayer","esri.layers.ImageryLayer","esri.layers.ImageryTileLayer","esri.layers.MapImageLayer","esri.layers.OGCFeatureLayer","esri.layers.OrientedImageryLayer","esri.layers.ParquetLayer","esri.layers.PointCloudLayer","esri.layers.StreamLayer","esri.layers.SceneLayer","esri.layers.SubtypeGroupLayer","esri.layers.TileLayer","esri.layers.VoxelLayer","esri.layers.WFSLayer","esri.layers.WMSLayer","esri.layers.WMTSLayer","esri.layers.WCSLayer","esri.layers.LinkChartLayer","esri.layers.catalog.CatalogFootprintLayer","esri.layers.catalog.CatalogDynamicGroupLayer","esri.layers.knowledgeGraph.KnowledgeGraphSublayer","esri.layers.KnowledgeGraphLayer"]),u="view.basemapView.baseLayerViews",p="view.groundView.layerViews",v="view.basemapView.referenceLayerViews",w=[u,p,"view.layerViews",v];let _=class extends r{constructor(e){super(e),this._layerViewByLayerId={},this._layerInfosByLayerViewId={},this._activeLayerInfosByLayerViewId={},this._activeLayerInfosWithNoParent=new t,this._activeLayerInfosPromises=new WeakMap,this.activeLayerInfos=new L,this.basemapLegendVisible=!1,this.groundLegendVisible=!1,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.respectLayerDefinitionExpression=!1,this.respectLayerVisibility=!0,this.layerInfos=[],this.view=null}initialize(){this.addHandles(s(()=>this.view,()=>this._viewHandles(),a),c.view),this.addHandles(i(()=>this._refresh()))}destroy(){this._destroyViewActiveLayerInfos(),this.view=null}get loading(){return this.activeLayerInfos.some(e=>e.loading)}get state(){return this.view?.ready?"ready":"disabled"}_viewHandles(){this.removeHandles(c.state),this.view&&this.addHandles(s(()=>this.state,()=>this._stateHandles(),a),c.state)}_stateHandles(){this._resetAll(),"ready"===this.state&&this._watchPropertiesAndAllLayerViews()}_resetAll(){this.removeHandles([c.allLayerViews,c.legendProperties]),this._destroyViewActiveLayerInfos(),this.activeLayerInfos.removeAll()}_destroyViewActiveLayerInfos(){Object.keys(this._activeLayerInfosByLayerViewId).forEach(this._destroyViewActiveLayerInfo,this)}_destroyViewActiveLayerInfo(e){this.removeHandles(e);const i=this._activeLayerInfosByLayerViewId[e];i&&this._activeLayerInfosPromises.delete(i),delete this._activeLayerInfosByLayerViewId[e],i?.parent?.children.remove(i)}_watchPropertiesAndAllLayerViews(){const{view:e}=this;if(!e)return;const{allLayerViews:i}=e;i.length&&this._refresh(),this.addHandles(i.on("change",e=>this._allLayerViewsChangeHandle(e)),c.allLayerViews),this.addHandles(s(()=>[this.basemapLegendVisible,this.groundLegendVisible,this.hideLayersNotInCurrentView,this.keepCacheOnDestroy,this.layerInfos,this.respectLayerDefinitionExpression,this.respectLayerVisibility],()=>this._refresh()),c.legendProperties)}_allLayerViewsChangeHandle(e){if(e.added.length&&this._generateActiveLayerInfosForLayerViews(e.added),e.moved.length)return this._destroyViewActiveLayerInfos(),void this._refresh();if(e.removed.length){for(const{uid:i}of e.removed)this._destroyViewActiveLayerInfo(i);this._refresh()}}_refresh(){this._layerInfosByLayerViewId={},this.activeLayerInfos.drain(e=>this._activeLayerInfosPromises.delete(e)),this._generateActiveLayerInfosForLayerViews(this._generateLayerViews())}_generateActiveLayerInfosForLayerViews(e){e.filter(this._filterBasemapLayerViews,this).filter(this._filterLayerViewsByLayerInfos,this).filter(this._isLayerViewSupported,this).forEach(this._generateActiveLayerInfo,this)}_filterBasemapLayerViews(e){if(!this.view?.basemapView)return!0;const{baseLayerViews:i,groundLayerViews:r,referenceLayerViews:t}=this.view.basemapView,s=!this.basemapLegendVisible&&(i?.includes(e)||t?.includes(e)),a=!this.groundLegendVisible&&r?.includes(e);return!s&&!a}_sortActiveLayerInfos(e){const i=this.view;if(e.length<2||!i)return;const r=[];e.forEach(i=>{if(!i.parent){const t=i.layer.parent,s=t&&"uid"in t&&this._layerViewByLayerId[t.uid],a=s&&this._activeLayerInfosByLayerViewId[s.uid];a&&e.includes(a)&&(r.push(i),i.parent=a,a.children.add(i),this._sortActiveLayerInfos(a.children))}}),e.removeMany(r);const t={};i.allLayerViews.forEach((e,i)=>t[e.layer.uid]=i),e.sort((e,i)=>{const r=t[e.layer.uid]||0;return(t[i.layer.uid]||0)-r})}_generateLayerViews(){const e=[];return w.filter(this._filterLayerViews,this).map(e=>y(this,e)).filter(e=>null!=e).forEach(this._collectLayerViews("layerViews",e)),e}_filterLayerViews(e){const i=!this.basemapLegendVisible&&(e===u||e===v),r=!this.groundLegendVisible&&e===p;return!i&&!r}_collectLayerViews(e,i){const r=t=>(t&&t.forEach(t=>{i.push(t),r(t[e])}),i);return r}_filterLayerViewsByLayerInfos(e){const i=this.layerInfos;return!i||!i.length||i.some(i=>this._hasLayerInfo(i,e))}_hasLayerInfo(e,i){const r=this._isLayerUIDMatching(e.layer,i.layer.uid);return r&&(this._layerInfosByLayerViewId[i.uid]=e),r}_isLayerUIDMatching(e,i){return e&&(e.uid===i||this._hasLayerUID(e.layers,i))}_hasLayerUID(e,i){return e&&e.some(e=>this._isLayerUIDMatching(e,i))}_isLayerViewSupported(e){return!!f.has(e.layer.declaredClass)&&(this._layerViewByLayerId[e.layer.uid]=e,!0)}_generateActiveLayerInfo(e){this._isLayerActive(e)?this._buildActiveLayerInfo(e):(this.removeHandles(e.uid),this.addHandles(s(()=>[e.legendEnabled,e.layer?.legendEnabled],()=>this._layerActiveHandle(e)),e.uid))}_layerActiveHandle(e){this._isLayerActive(e)&&(this.removeHandles(e.uid),this._buildActiveLayerInfo(e))}_isLayerActive(e){return!this.respectLayerVisibility||e.legendEnabled&&e.layer?.legendEnabled}async _buildActiveLayerInfo(e){const i=e.layer,r=e.uid,t=this._layerInfosByLayerViewId[r];let s=this._activeLayerInfosByLayerViewId[r];s||(s=new h({layer:i,layerView:e,view:this.view??void 0}),this._activeLayerInfosByLayerViewId[r]=s);const a=void 0!==t?.title&&t.layer.uid===i.uid;s.title=a?t.title:i.title,s.respectLayerDefinitionExpression=this.respectLayerDefinitionExpression,s.respectLayerVisibility=this.respectLayerVisibility,s.hideLayersNotInCurrentView=this.hideLayersNotInCurrentView,s.keepCacheOnDestroy=this.keepCacheOnDestroy,s.sublayerIds=t?.sublayerIds||[];const n=i.parent&&"uid"in i.parent?this._layerViewByLayerId[i.parent?.uid]:null;s.parent=this._activeLayerInfosByLayerViewId[n?.uid],this._addActiveLayerInfo(s),this._constructLegendElements(s),this._attachHandlesToActiveLayerInfo(s)}_attachHandlesToActiveLayerInfo(e){const{layer:i,layerView:r}=e,t=r.uid;this.removeHandles(t),this.addHandles([s(()=>i.title,i=>this._titleHandle(i,e)),s(()=>[i.opacity,"renderer"in i&&i.renderer,"pointSymbol"in i&&i.pointSymbol,"lineSymbol"in i&&i.lineSymbol,"polygonSymbol"in i&&i.polygonSymbol,"effect"in i&&i.effect,"featureReduction"in i&&d(i,r.view),this.view?.timeZone],()=>this._constructLegendElements(e)),s(()=>"filter"in r&&r.filter,()=>{null!=d(r.layer,r.view)&&this._constructLegendElements(e)}),n(()=>!!this.view?.stationary,()=>this._scaleHandle(e)),s(()=>e.loading,()=>this.notifyChange("loading"),a)],t),this.respectLayerVisibility&&this.addHandles([s(()=>i.legendEnabled,i=>this._legendEnabledHandle(i,e)),s(()=>r.legendEnabled,i=>{this.view?.suspended||this._legendEnabledHandle(i,e)})],t),this.respectLayerDefinitionExpression&&"definitionExpression"in i&&this.addHandles(s(()=>i.definitionExpression,()=>this._constructLegendElements(e)),t)}_titleHandle(e,i){i.title=e,this._constructLegendElements(i)}_legendEnabledHandle(e,i){e?this._addActiveLayerInfo(i):this._removeActiveLayerInfo(i)}_scaleHandle(e){(e.isScaleDriven||e.hideLayersNotInCurrentView)&&this._constructLegendElements(e)}_addActiveLayerInfo(e){const{layerView:i,layer:r}=e;if(this._isLayerActive(i)&&!this.activeLayerInfos.includes(e)){const i=e.parent;if(i)i.children.includes(e)||i.children.push(e),this._sortActiveLayerInfos(i.children);else{const i=this.layerInfos?.some(e=>e.layer.uid===r.uid),t=r.parent;(t&&"uid"in t?this._layerViewByLayerId[t.uid]:null)&&!i?this._activeLayerInfosWithNoParent.add(e):(this.activeLayerInfos.add(e),this._sortActiveLayerInfos(this.activeLayerInfos))}if(this._activeLayerInfosWithNoParent.length){const e=[];this._activeLayerInfosWithNoParent.forEach(i=>{const r=i.layer.parent,t=r&&"uid"in r?this._layerViewByLayerId[r?.uid]:null,s=this._activeLayerInfosByLayerViewId[t?.uid];s&&(e.push(i),i.parent=s)}),e.length&&(this._activeLayerInfosWithNoParent.removeMany(e),e.forEach(e=>this._addActiveLayerInfo(e)))}}}_removeActiveLayerInfo(e){const i=e.parent;i?i.children.remove(e):this.activeLayerInfos.remove(e)}async _getBuildLegendPromise(e){const{layer:i}=e;if("featureCollections"in i&&i.featureCollections)return e.buildLegendElementsForFeatureCollections(i.featureCollections);if("featureReduction"in i&&i.featureReduction&&"renderer"in i.featureReduction&&("binning"===i.featureReduction.type||"cluster"===i.featureReduction.type)&&(!this.view||i.featureReduction.maxScale<=this.view.scale))return e.buildLegendElementsForFeatureReduction(i.featureReduction);if("renderer"in i&&i.renderer&&!("sublayers"in i))return e.buildLegendElementsForRenderer(i.renderer);if("url"in i&&i.url&&"catalog"!==i.type&&"knowledge-graph"!==i.type)return e.buildLegendElementsForTools();const r=e.children.map(e=>this._constructLegendElements(e));return Promise.all(r).then(()=>{})}async _constructLegendElements(e){const i=this._activeLayerInfosPromises.get(e);i&&await i.catch(()=>{});const r=this._getBuildLegendPromise(e);this._activeLayerInfosPromises.set(e,r),r.finally(()=>{this._activeLayerInfosPromises.delete(e)})}};e([o({type:L})],_.prototype,"activeLayerInfos",void 0),e([o()],_.prototype,"basemapLegendVisible",void 0),e([o()],_.prototype,"groundLegendVisible",void 0),e([o()],_.prototype,"hideLayersNotInCurrentView",void 0),e([o()],_.prototype,"keepCacheOnDestroy",void 0),e([o({readOnly:!0})],_.prototype,"loading",null),e([o()],_.prototype,"respectLayerDefinitionExpression",void 0),e([o()],_.prototype,"respectLayerVisibility",void 0),e([o()],_.prototype,"layerInfos",void 0),e([o({readOnly:!0})],_.prototype,"state",null),e([o()],_.prototype,"view",void 0),_=e([l("esri.widgets.Legend.LegendViewModel")],_);export{_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import i from"./LegendElement.js";import{loadCalciteComponents as a}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{messageBundle as n}from"../../../support/decorators/messageBundle.js";import{tsx as l}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as c}from"../../../../intl/substitute.js";const d=768;let m=class extends r{constructor(e,s){super(e,s),this._hasIndicators=!1,this.activeLayerInfos=null,this.headingLevel=3,this.layout="stack",this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}loadDependencies(){return a({carousel:()=>import("@esri/calcite-components/dist/components/calcite-carousel"),"carousel-item":()=>import("@esri/calcite-components/dist/components/calcite-carousel-item")})}render(){this._hasIndicators="auto"===this.layout&&this.view&&this.view.container.clientWidth<=d||"stack"===this.layout;const e=this._hasIndicators?this._renderCarousel():this._renderLayers(),s={[o.stacked]:this._hasIndicators};return l("div",{class:this.classes(o.base,s)},e||l("div",{class:o.message},this.messages.noLegend))}_renderCarousel(){const e=[],s=this.activeLayerInfos;if(s)for(const t of s)this._renderSections(t,e);return e?.length?l("calcite-carousel",{class:o.carousel,label:this.messages.carousel},e.map((s,t)=>l("calcite-carousel-item",{class:o.carouselItem,key:t,label:c(this.messagesCommon.pagination.pageText,{index:t+1,total:e.length})},s))):null}_renderLayers(){const e=this.activeLayerInfos,s=e?.toArray()?.map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?s:null}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const s=e.children.toArray().map(this._renderLegendForLayer,this);return l("section",{class:this.classes(o.service,o.groupLayer),key:e.layer.uid},l("div",{class:o.serviceCaptionContainer},e.title),s)}return this._renderLegendElementsForLayer(e)}_renderLegendElementsForLayer(e){const s=e.legendElements?.filter(Boolean);if(!s?.length)return null;const t=s.map(s=>l(i,{activeLayerInfo:e,cssEffectFilter:e.cssEffectFilter,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),r={[o.groupLayerChild]:!!e.parent};return l("section",{class:this.classes(o.service,r),key:e.layer.uid},l("div",{class:o.serviceCaptionContainer},l("div",{class:o.serviceCaptionText},e.title)),l("div",{class:o.serviceContent},t))}_renderSections(e,s){if(!e.ready)return;if(e.children.length)for(const r of e.children)this._renderSections(r,s);const t=e.legendElements;if(t?.length)for(const r of t){const t=l(i,{activeLayerInfo:e,cssEffectFilter:e.cssEffectFilter,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${r.type}`,layer:e.layer,legendElement:r,messages:this.messages});t&&s.push(t)}}};e([s()],m.prototype,"activeLayerInfos",void 0),e([s()],m.prototype,"headingLevel",void 0),e([s()],m.prototype,"layout",void 0),e([s(),n("esri/widgets/Legend/t9n/Legend")],m.prototype,"messages",void 0),e([s(),n("esri/t9n/common")],m.prototype,"messagesCommon",void 0),e([s({readOnly:!0})],m.prototype,"type",void 0),e([s()],m.prototype,"view",void 0),m=e([t("esri.widgets.Legend.styles.card.CardView")],m);export{m as default};
5
+ import{__decorate as e}from"tslib";import{substitute as s}from"../../../../intl.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import i from"../../../Widget.js";import{css as o}from"./css.js";import n from"./LegendElement.js";import{loadCalciteComponents as a}from"../../../support/componentsUtils.js";import{tsx as l,messageBundle as c}from"../../../support/widget.js";const d=768;let h=class extends i{constructor(e,s){super(e,s),this._hasIndicators=!1,this.activeLayerInfos=null,this.headingLevel=3,this.layout="stack",this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}loadDependencies(){return a({carousel:()=>import("@esri/calcite-components/dist/components/calcite-carousel"),"carousel-item":()=>import("@esri/calcite-components/dist/components/calcite-carousel-item")})}render(){this._hasIndicators="auto"===this.layout&&this.view&&this.view.container.clientWidth<=d||"stack"===this.layout;const e=this._hasIndicators?this._renderCarousel():this._renderLayers(),s={[o.stacked]:this._hasIndicators};return l("div",{class:this.classes(o.base,s)},e||l("div",{class:o.message},this.messages.noLegend))}_renderCarousel(){const e=[],t=this.activeLayerInfos;if(t)for(const s of t)this._renderSections(s,e);return e?.length?l("calcite-carousel",{class:o.carousel,label:this.messages.carousel},e.map((t,r)=>l("calcite-carousel-item",{class:o.carouselItem,key:r,label:s(this.messagesCommon.pagination.pageText,{index:r+1,total:e.length})},t))):null}_renderLayers(){const e=this.activeLayerInfos,s=e?.toArray()?.map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?s:null}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const s=e.children.toArray().map(this._renderLegendForLayer,this);return l("section",{class:this.classes(o.service,o.groupLayer),key:e.layer.uid},l("div",{class:o.serviceCaptionContainer},e.title),s)}return this._renderLegendElementsForLayer(e)}_renderLegendElementsForLayer(e){const s=e.legendElements?.filter(Boolean);if(!s?.length)return null;const t=s.map(s=>l(n,{activeLayerInfo:e,cssEffectFilter:e.cssEffectFilter,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),r={[o.groupLayerChild]:!!e.parent};return l("section",{class:this.classes(o.service,r),key:e.layer.uid},l("div",{class:o.serviceCaptionContainer},l("div",{class:o.serviceCaptionText},e.title)),l("div",{class:o.serviceContent},t))}_renderSections(e,s){if(!e.ready)return;if(e.children.length)for(const r of e.children)this._renderSections(r,s);const t=e.legendElements;if(t?.length)for(const r of t){const t=l(n,{activeLayerInfo:e,cssEffectFilter:e.cssEffectFilter,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${r.type}`,layer:e.layer,legendElement:r,messages:this.messages});t&&s.push(t)}}};e([t()],h.prototype,"activeLayerInfos",void 0),e([t()],h.prototype,"headingLevel",void 0),e([t()],h.prototype,"layout",void 0),e([t(),c("esri/widgets/Legend/t9n/Legend")],h.prototype,"messages",void 0),e([t(),c("esri/t9n/common")],h.prototype,"messagesCommon",void 0),e([t({readOnly:!0})],h.prototype,"type",void 0),e([t()],h.prototype,"view",void 0),h=e([r("esri.widgets.Legend.styles.card.CardView")],h);export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{renderSVG as s}from"../../../../symbols/support/svgUtils.js";import o from"../../../Widget.js";import{css as i}from"./css.js";import{getRampStopLabel as l}from"../support/utils.js";import"../../../support/widgetUtils.js";import{tsx as p}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const a=25,n=25,c=100;let d=class extends o{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const e=this.legendElement.infos.slice().reverse();return p("div",{class:this.classes(i.layerRow,i.colorRampContainer)},this._renderRampLabel(e[0]),p("div",{class:i.symbolContainer},this._renderPreview(e),this._renderMiddleStopRampLabel(e)),this._renderRampLabel(e.at(-1)))}_renderPreview(e){const{opacity:t}=this,r="heatmap-ramp"===this.legendElement.type,o=e.length-1,i=n,l=o>2&&!r?a*o:c,d=l+20,m=10,h=[[{shape:{type:"path",path:`M0 ${i/2} L${m} 0 L${m} ${i} Z`},fill:e[0].color,stroke:{width:0}},{shape:{type:"rect",x:m,y:0,width:l,height:i},fill:{type:"linear",x1:m,y1:0,x2:l+m,y2:0,colors:e.map((e,t)=>({color:e.color,offset:r&&"ratio"in e?e.ratio:t/o}))},stroke:{width:0}},{shape:{type:"path",path:`M${l+m} 0 L${d} ${i/2} L${l+m} ${i} Z`},fill:e[e.length-1].color,stroke:{width:0}}]],y=s(h,d,i),f={filter:this.cssEffectFilter??void 0,opacity:null==t?void 0:`${t}`};return p("div",{styles:f},y)}_renderMiddleStopRampLabel(e){const t=e.length%2!=0?e[e.length/2|0]:null;return t?p("div",{class:i.intervalSeparatorsContainer},p("div",{class:i.intervalSeparator},"|"),this._renderRampLabel(t)):null}_renderRampLabel(e){return p("div",{class:i.rampLabel},l(e,this.legendElement.type,this.messages))}};e([t()],d.prototype,"cssEffectFilter",void 0),e([t()],d.prototype,"legendElement",void 0),e([t()],d.prototype,"messages",void 0),e([t()],d.prototype,"opacity",void 0),d=e([r("esri.widgets.Legend.styles.card.ColorRamp")],d);export{d as default};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{renderSVG as s}from"../../../../symbols/support/svgUtils.js";import o from"../../../Widget.js";import{css as i}from"./css.js";import{getRampStopLabel as l}from"../support/utils.js";import{tsx as p}from"../../../support/widget.js";const a=25,n=25,c=100;let d=class extends o{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const e=this.legendElement.infos.slice().reverse();return p("div",{class:this.classes(i.layerRow,i.colorRampContainer)},this._renderRampLabel(e[0]),p("div",{class:i.symbolContainer},this._renderPreview(e),this._renderMiddleStopRampLabel(e)),this._renderRampLabel(e.at(-1)))}_renderPreview(e){const{opacity:t}=this,r="heatmap-ramp"===this.legendElement.type,o=e.length-1,i=n,l=o>2&&!r?a*o:c,d=l+20,m=10,h=[[{shape:{type:"path",path:`M0 ${i/2} L${m} 0 L${m} ${i} Z`},fill:e[0].color,stroke:{width:0}},{shape:{type:"rect",x:m,y:0,width:l,height:i},fill:{type:"linear",x1:m,y1:0,x2:l+m,y2:0,colors:e.map((e,t)=>({color:e.color,offset:r&&"ratio"in e?e.ratio:t/o}))},stroke:{width:0}},{shape:{type:"path",path:`M${l+m} 0 L${d} ${i/2} L${l+m} ${i} Z`},fill:e[e.length-1].color,stroke:{width:0}}]],y=s(h,d,i),f={filter:this.cssEffectFilter??void 0,opacity:null==t?void 0:`${t}`};return p("div",{styles:f},y)}_renderMiddleStopRampLabel(e){const t=e.length%2!=0?e[e.length/2|0]:null;return t?p("div",{class:i.intervalSeparatorsContainer},p("div",{class:i.intervalSeparator},"|"),this._renderRampLabel(t)):null}_renderRampLabel(e){return p("div",{class:i.rampLabel},l(e,this.legendElement.type,this.messages))}};e([t()],d.prototype,"cssEffectFilter",void 0),e([t()],d.prototype,"legendElement",void 0),e([t()],d.prototype,"messages",void 0),e([t()],d.prototype,"opacity",void 0),d=e([r("esri.widgets.Legend.styles.card.ColorRamp")],d);export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import s from"../../../../Color.js";import"../../../../intl.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import l from"./ColorRamp.js";import{css as a}from"./css.js";import o from"./SizeRamp.js";import n from"./UnivariateAboveAndBelowRamp.js";import c from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as p}from"../support/relationshipUtils.js";import{getLegendElementTitle as h,getPreviewAriaLabelIntl as m}from"../support/utils.js";import{attachToNode as d,isImageryStretchedLegend as y,getTitle as g}from"../../support/styleUtils.js";import{Heading as f,incrementHeadingLevel as u}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{tsx as b}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as v}from"../../../../intl/substitute.js";var E;let w=E=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.hasIndicators=!1,this.headingLevel=3,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=h(this.legendElement,this.messages),t=this.hasIndicators&&!this.isChild?b("div",null,b(f,{class:a.carouselTitle,level:this.headingLevel},this.activeLayerInfo.title),b(f,{class:a.layerCaption,level:u(this.headingLevel)},s)):s?b(f,{class:a.layerCaption,level:this.headingLevel},s):null;return b("section",{"aria-labelledby":this.key,class:a.section,id:`${this.key}-panel`,key:this.key,role:"tabpanel",tabIndex:0},t,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return b(o,{hasIndicators:this.hasIndicators,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return b(l,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return p(this.legendElement,this.id,{opacity:this.layer.opacity,cssEffectFilter:this.cssEffectFilter,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":{const{preview:e}=this.legendElement;if(!e)return null;const s=v(this.messages.previewPieChartAriaLabel,{label:null});return s&&e.querySelector("svg")?.setAttribute("aria-label",s),b("div",{afterCreate:d,bind:e,class:a.pieChartRampPreview,key:`${this.key}-preview`})}case"univariate-above-and-below-ramp":return b(n,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return b(c,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);if(!s.length)return null;const t=this.activeLayerInfo.legendElements.some(({type:e})=>"relationship-ramp"===e),i=s[0]?.properties?.classes?.[a.symbolRow],r={[a.labelContainer]:!i&&!t,[a.relationshipLabelContainer]:t};return b("div",{class:this.classes(r)},s)}_renderElementInfo(e,s){const{layer:t}=this,i="label"in e?e.label:null,r=`${this.key}-${i}`;if("type"in e&&e.type)return b(E,{activeLayerInfo:this.activeLayerInfo,cssEffectFilter:this.cssEffectFilter,hasIndicators:this.hasIndicators,headingLevel:this.headingLevel,isChild:!0,key:r,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const l=y(t,s),o=g(this.messages,i,!1)||"";if("src"in e&&e.src)return b("div",{class:a.layerRow,key:`${r}-row`},this._renderImage(e,t,l),b("div",{class:a.imageLabel},o));if("symbol"in e&&e.preview){if(!e.symbol?.type.includes("simple-fill")){if(!e.label)return b("div",{afterCreate:d,bind:e.preview,key:`${r}-row`});const s={[a.symbolCell]:this.hasIndicators},{preview:t}=e,i="previewAriaLabel"in e?e.previewAriaLabel:null,l="label"in e?g(this.messages,e.label,!1):null,n=t.querySelector("svg"),c=m(this.messages,i||l);return c&&n&&n.setAttribute("aria-label",c),b("div",{class:this.classes(a.layerRow,{[a.symbolRow]:this.hasIndicators}),key:`${r}-row`},b("div",{afterCreate:d,bind:t,class:this.classes(s)}),b("div",{class:this.classes(a.imageLabel,{[a.labelCell]:this.hasIndicators})},o))}return b("div",{class:a.layerRow,key:`${r}-row`},b("div",{class:a.labelElement,styles:this._getBackgroundStyles(e)},o))}return null}_getBackgroundStyles(e){const t=e.symbol,i=t.color,r=!!i?.a,l="outline"in t?t.outline:null,a=!!l?.color?.a,o=new s(r&&i?[i.r,i.g,i.b,i.a*this.layer.opacity]:[255,255,255,0]),n=a&&l.color?new s([l.color.r,l.color.g,l.color.b,l.color.a*this.layer.opacity]):new s([255,255,255,0]),c=e.symbol.color?.isBright??!0,p=c?"black":"white",h=c?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)";return{background:r?o.toCss(!0):"none",color:p,textShadow:`-1px -1px 0 ${h},\n 1px -1px 0 ${h},\n -1px 1px 0 ${h},\n 1px 1px 0 ${h}`,border:a?`1px solid ${n.toCss(!0)}`:"none",filter:this.cssEffectFilter??void 0}}_renderImage(e,s,t){const{previewAriaLabel:i,src:r,opacity:l}=e,o=g(this.messages,e.label,!1),n={[a.imageryLayerStretchedImage]:t,[a.symbol]:!t},c={opacity:`${l??s.opacity}`},p=m(this.messages,i||o);return b("img",{alt:p,"aria-label":p,border:0,class:this.classes(n),height:e.height,src:r,styles:c,width:e.width})}};e([t()],w.prototype,"activeLayerInfo",void 0),e([t()],w.prototype,"cssEffectFilter",void 0),e([t()],w.prototype,"hasIndicators",void 0),e([t()],w.prototype,"headingLevel",void 0),e([t()],w.prototype,"isChild",void 0),e([t()],w.prototype,"layer",void 0),e([t()],w.prototype,"legendElement",void 0),e([t()],w.prototype,"messages",void 0),w=E=e([i("esri.widgets.Legend.styles.card.LegendElement")],w);export{w as default};
5
+ import{__decorate as e}from"tslib";import s from"../../../../Color.js";import{substitute as t}from"../../../../intl.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import l from"../../../Widget.js";import a from"./ColorRamp.js";import{css as o}from"./css.js";import n from"./SizeRamp.js";import c from"./UnivariateAboveAndBelowRamp.js";import p from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as h}from"../support/relationshipUtils.js";import{getLegendElementTitle as m,getPreviewAriaLabelIntl as d}from"../support/utils.js";import{attachToNode as y,isImageryStretchedLegend as g,getTitle as f}from"../../support/styleUtils.js";import{Heading as u,incrementHeadingLevel as b}from"../../../support/Heading.js";import{tsx as v}from"../../../support/widget.js";var E;let w=E=class extends l{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.hasIndicators=!1,this.headingLevel=3,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=m(this.legendElement,this.messages),t=this.hasIndicators&&!this.isChild?v("div",null,v(u,{class:o.carouselTitle,level:this.headingLevel},this.activeLayerInfo.title),v(u,{class:o.layerCaption,level:b(this.headingLevel)},s)):s?v(u,{class:o.layerCaption,level:this.headingLevel},s):null;return v("section",{"aria-labelledby":this.key,class:o.section,id:`${this.key}-panel`,key:this.key,role:"tabpanel",tabIndex:0},t,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return v(n,{hasIndicators:this.hasIndicators,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return v(a,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return h(this.legendElement,this.id,{opacity:this.layer.opacity,cssEffectFilter:this.cssEffectFilter,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":{const{preview:e}=this.legendElement;if(!e)return null;const s=t(this.messages.previewPieChartAriaLabel,{label:null});return s&&e.querySelector("svg")?.setAttribute("aria-label",s),v("div",{afterCreate:y,bind:e,class:o.pieChartRampPreview,key:`${this.key}-preview`})}case"univariate-above-and-below-ramp":return v(c,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return v(p,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);if(!s.length)return null;const t=this.activeLayerInfo.legendElements.some(({type:e})=>"relationship-ramp"===e),i=s[0]?.properties?.classes?.[o.symbolRow],r={[o.labelContainer]:!i&&!t,[o.relationshipLabelContainer]:t};return v("div",{class:this.classes(r)},s)}_renderElementInfo(e,s){const{layer:t}=this,i="label"in e?e.label:null,r=`${this.key}-${i}`;if("type"in e&&e.type)return v(E,{activeLayerInfo:this.activeLayerInfo,cssEffectFilter:this.cssEffectFilter,hasIndicators:this.hasIndicators,headingLevel:this.headingLevel,isChild:!0,key:r,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const l=g(t,s),a=f(this.messages,i,!1)||"";if("src"in e&&e.src)return v("div",{class:o.layerRow,key:`${r}-row`},this._renderImage(e,t,l),v("div",{class:o.imageLabel},a));if("symbol"in e&&e.preview){if(!e.symbol?.type.includes("simple-fill")){if(!e.label)return v("div",{afterCreate:y,bind:e.preview,key:`${r}-row`});const s={[o.symbolCell]:this.hasIndicators},{preview:t}=e,i="previewAriaLabel"in e?e.previewAriaLabel:null,l="label"in e?f(this.messages,e.label,!1):null,n=t.querySelector("svg"),c=d(this.messages,i||l);return c&&n&&n.setAttribute("aria-label",c),v("div",{class:this.classes(o.layerRow,{[o.symbolRow]:this.hasIndicators}),key:`${r}-row`},v("div",{afterCreate:y,bind:t,class:this.classes(s)}),v("div",{class:this.classes(o.imageLabel,{[o.labelCell]:this.hasIndicators})},a))}return v("div",{class:o.layerRow,key:`${r}-row`},v("div",{class:o.labelElement,styles:this._getBackgroundStyles(e)},a))}return null}_getBackgroundStyles(e){const t=e.symbol,i=t.color,r=!!i?.a,l="outline"in t?t.outline:null,a=!!l?.color?.a,o=new s(r&&i?[i.r,i.g,i.b,i.a*this.layer.opacity]:[255,255,255,0]),n=a&&l.color?new s([l.color.r,l.color.g,l.color.b,l.color.a*this.layer.opacity]):new s([255,255,255,0]),c=e.symbol.color?.isBright??!0,p=c?"black":"white",h=c?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)";return{background:r?o.toCss(!0):"none",color:p,textShadow:`-1px -1px 0 ${h},\n 1px -1px 0 ${h},\n -1px 1px 0 ${h},\n 1px 1px 0 ${h}`,border:a?`1px solid ${n.toCss(!0)}`:"none",filter:this.cssEffectFilter??void 0}}_renderImage(e,s,t){const{previewAriaLabel:i,src:r,opacity:l}=e,a=f(this.messages,e.label,!1),n={[o.imageryLayerStretchedImage]:t,[o.symbol]:!t},c={opacity:`${l??s.opacity}`},p=d(this.messages,i||a);return v("img",{alt:p,"aria-label":p,border:0,class:this.classes(n),height:e.height,src:r,styles:c,width:e.width})}};e([i()],w.prototype,"activeLayerInfo",void 0),e([i()],w.prototype,"cssEffectFilter",void 0),e([i()],w.prototype,"hasIndicators",void 0),e([i()],w.prototype,"headingLevel",void 0),e([i()],w.prototype,"isChild",void 0),e([i()],w.prototype,"layer",void 0),e([i()],w.prototype,"legendElement",void 0),e([i()],w.prototype,"messages",void 0),w=E=e([r("esri.widgets.Legend.styles.card.LegendElement")],w);export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{pt2px as t}from"../../../../core/screenUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import{renderSpikeRamp as n}from"../support/sizeRampUtils.js";import{attachToNode as l}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as a}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const c="#ddd",p=window.devicePixelRatio;function d(e){if(!e)return;if(e.type.includes("3d")){if(!e.symbolLayers?.length)return;const t=e.symbolLayers.at(-1),s=t.resource?.primitive;return"circle"===s||"cross"===s||"kite"===s||"sphere"===s||"cube"===s||"diamond"===s}const t=e.style;return"circle"===t||"diamond"===t||"cross"===t}function m(e){if(e){if(e.type.includes("3d")){if(!e.symbolLayers?.length)return;const t=e.symbolLayers.at(-1),s=t?.resource?.primitive;return"triangle"===s||"cone"===s||"tetrahedron"===s}return"triangle"===e.style}}let y=class extends r{constructor(e,t){super(e,t),this.hasIndicators=!1,this.legendElement=null,this.opacity=1}render(){if("spike"===this.legendElement.theme)return a("div",{styles:{display:"flex",flex:"1",justifyContent:"center"}},n(this.legendElement));const{legendElement:e,hasIndicators:t,opacity:s}=this,i=e.infos,r=i.at(0),c=i.at(-1);if(!r||!c)return null;const{label:p,...d}=r,{label:m,...y}=c;let u=d.preview,f=y.preview;const h={"flex-direction":t?"column":"row-reverse"};if(!u||!f)return null;u=u.cloneNode(!0),u.style.display="flex",f=f.cloneNode(!0),f.style.display="flex";const g={opacity:`${s??""}`};return a("div",{class:this.classes(o.layerRow,{[o.sizeRampRow]:t})},a("div",{class:o.rampLabel},t?p:m),a("div",{class:o.sizeRampContainer,styles:h},a("div",{afterCreate:l,bind:u,class:o.sizeRampPreview,styles:g}),this._renderSizeRampLines(e),a("div",{afterCreate:l,bind:f,class:o.sizeRampPreview,styles:g})),a("div",{class:o.rampLabel},t?m:p))}_renderSizeRampLines(e){const s=e.infos,i=s.at(0),r=s.at(-1);if(!i||!r)return null;const o=i.symbol,n=this.hasIndicators,y=i.size&&"number"==typeof i.size?i.size:0,u=r.size&&"number"==typeof r.size?r.size:0,f=i.outlineSize||0,h=r.outlineSize||0,g=t(y+f)*p,v=t(u+h)*p,b=n?g:g+50*p,x=n?g/2+50*p:g,z=m(o),j=d(o),w=document.createElement("canvas");w.width=b,w.height=x,w.style.width=w.width/p+"px",w.style.height=w.height/p+"px";const R=w.getContext("2d");if(n){R.beginPath();const e=0,t=0,s=b/2-v/2,i=x;R.moveTo(e,t),R.lineTo(s,i);const r=b,o=0,n=b/2+v/2,l=x;R.moveTo(r,o),R.lineTo(n,l)}else{R.beginPath();const e=0,t=x/2-v/2,s=b,i=0;R.moveTo(e,t),R.lineTo(s,i);const r=0,o=x/2+v/2,n=b,l=x;R.moveTo(r,o),R.lineTo(n,l)}return R.strokeStyle=c,R.stroke(),a("div",{afterCreate:l,bind:w,styles:n?{display:"flex",marginTop:`-${z?0:j?g/2:0}px`,marginBottom:`-${z?v:j?v/2:0}px`}:{display:"flex",marginRight:`-${z?0:j?g/2:0}px`,marginLeft:`-${z?0:j?v/2:0}px`}})}};e([s()],y.prototype,"hasIndicators",void 0),e([s()],y.prototype,"legendElement",void 0),e([s()],y.prototype,"messages",void 0),e([s()],y.prototype,"opacity",void 0),y=e([i("esri.widgets.Legend.styles.card.SizeRamp")],y);export{y as default};
5
+ import{__decorate as e}from"tslib";import{pt2px as t}from"../../../../core/screenUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import{renderSpikeRamp as n}from"../support/sizeRampUtils.js";import{attachToNode as l}from"../../support/styleUtils.js";import{tsx as a}from"../../../support/widget.js";const c="#ddd",p=window.devicePixelRatio;function d(e){if(!e)return;if(e.type.includes("3d")){if(!e.symbolLayers?.length)return;const t=e.symbolLayers.at(-1),s=t.resource?.primitive;return"circle"===s||"cross"===s||"kite"===s||"sphere"===s||"cube"===s||"diamond"===s}const t=e.style;return"circle"===t||"diamond"===t||"cross"===t}function m(e){if(e){if(e.type.includes("3d")){if(!e.symbolLayers?.length)return;const t=e.symbolLayers.at(-1),s=t?.resource?.primitive;return"triangle"===s||"cone"===s||"tetrahedron"===s}return"triangle"===e.style}}let y=class extends r{constructor(e,t){super(e,t),this.hasIndicators=!1,this.legendElement=null,this.opacity=1}render(){if("spike"===this.legendElement.theme)return a("div",{styles:{display:"flex",flex:"1",justifyContent:"center"}},n(this.legendElement));const{legendElement:e,hasIndicators:t,opacity:s}=this,i=e.infos,r=i.at(0),c=i.at(-1);if(!r||!c)return null;const{label:p,...d}=r,{label:m,...y}=c;let u=d.preview,f=y.preview;const h={"flex-direction":t?"column":"row-reverse"};if(!u||!f)return null;u=u.cloneNode(!0),u.style.display="flex",f=f.cloneNode(!0),f.style.display="flex";const g={opacity:`${s??""}`};return a("div",{class:this.classes(o.layerRow,{[o.sizeRampRow]:t})},a("div",{class:o.rampLabel},t?p:m),a("div",{class:o.sizeRampContainer,styles:h},a("div",{afterCreate:l,bind:u,class:o.sizeRampPreview,styles:g}),this._renderSizeRampLines(e),a("div",{afterCreate:l,bind:f,class:o.sizeRampPreview,styles:g})),a("div",{class:o.rampLabel},t?m:p))}_renderSizeRampLines(e){const s=e.infos,i=s.at(0),r=s.at(-1);if(!i||!r)return null;const o=i.symbol,n=this.hasIndicators,y=i.size&&"number"==typeof i.size?i.size:0,u=r.size&&"number"==typeof r.size?r.size:0,f=i.outlineSize||0,h=r.outlineSize||0,g=t(y+f)*p,v=t(u+h)*p,b=n?g:g+50*p,x=n?g/2+50*p:g,z=m(o),w=d(o),R=document.createElement("canvas");R.width=b,R.height=x,R.style.width=R.width/p+"px",R.style.height=R.height/p+"px";const j=R.getContext("2d");if(n){j.beginPath();const e=0,t=0,s=b/2-v/2,i=x;j.moveTo(e,t),j.lineTo(s,i);const r=b,o=0,n=b/2+v/2,l=x;j.moveTo(r,o),j.lineTo(n,l)}else{j.beginPath();const e=0,t=x/2-v/2,s=b,i=0;j.moveTo(e,t),j.lineTo(s,i);const r=0,o=x/2+v/2,n=b,l=x;j.moveTo(r,o),j.lineTo(n,l)}return j.strokeStyle=c,j.stroke(),a("div",{afterCreate:l,bind:R,styles:n?{display:"flex",marginTop:`-${z?0:w?g/2:0}px`,marginBottom:`-${z?v:w?v/2:0}px`}:{display:"flex",marginRight:`-${z?0:w?g/2:0}px`,marginLeft:`-${z?0:w?v/2:0}px`}})}};e([s()],y.prototype,"hasIndicators",void 0),e([s()],y.prototype,"legendElement",void 0),e([s()],y.prototype,"messages",void 0),e([s()],y.prototype,"opacity",void 0),y=e([i("esri.widgets.Legend.styles.card.SizeRamp")],y);export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import{getUnivariateAboveAndBelowRampElements as s,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{isRTL as m}from"../../../support/widgetUtils.js";import{tsx as d}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";let f=class extends r{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:o,key:r}=this,{sizeRampElement:f,colorRampElement:y}=s(e,t,"horizontal");if(!f)return null;const h=l(f,"full",!0,"horizontal"),v=a(f,"above",!0,"horizontal"),u=a(f,"below",!0,"horizontal"),g=12,b=this.messages?.previewColorRampAriaLabel,w=p(y,{width:v,height:g,rampAlignment:"horizontal",opacity:t,type:"above",cssEffectFilter:o,ariaLabel:b}),x=p(y,{width:u,height:g,rampAlignment:"horizontal",opacity:t,type:"below",cssEffectFilter:o,ariaLabel:b}),j=n(f,"card"),E=f.infos.map(e=>e.label),z=E.length-1,C=E.map((e,t)=>0===t||t===z?d("div",{key:t},e):null),R={display:"flex",flexDirection:"column"},L={display:"flex",flexDirection:"row"},A={marginTop:"3px",display:"flex"};m(this.container)?A.marginRight=`${j}px`:A.marginLeft=`${j}px`;const k={width:`${h}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return d("div",{class:i.layerRow,key:`${r}-container`,styles:R},d("div",{class:this.classes(i.symbolContainer,i.sizeRampHorizontal),styles:L},f.infos.map((e,t)=>d("div",{afterCreate:c,bind:e.preview,class:i.symbol,key:t}))),w?d("div",{class:i.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:A},d("div",{afterCreate:c,bind:w}),d("div",{afterCreate:c,bind:x})):null,d("div",{class:i.layerInfo},d("div",{class:i.rampLabelsContainer,styles:k},C)))}};e([t()],f.prototype,"cssEffectFilter",void 0),e([t()],f.prototype,"legendElement",void 0),e([t()],f.prototype,"messages",void 0),e([t()],f.prototype,"opacity",void 0),f=e([o("esri.widgets.Legend.styles.card.UnivariateAboveAndBelowRamp")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import{getUnivariateAboveAndBelowRampElements as s,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{tsx as m,isRTL as d}from"../../../support/widget.js";let f=class extends r{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:o,key:r}=this,{sizeRampElement:f,colorRampElement:y}=s(e,t,"horizontal");if(!f)return null;const h=l(f,"full",!0,"horizontal"),v=a(f,"above",!0,"horizontal"),u=a(f,"below",!0,"horizontal"),g=12,b=this.messages?.previewColorRampAriaLabel,w=p(y,{width:v,height:g,rampAlignment:"horizontal",opacity:t,type:"above",cssEffectFilter:o,ariaLabel:b}),x=p(y,{width:u,height:g,rampAlignment:"horizontal",opacity:t,type:"below",cssEffectFilter:o,ariaLabel:b}),j=n(f,"card"),E=f.infos.map(e=>e.label),z=E.length-1,C=E.map((e,t)=>0===t||t===z?m("div",{key:t},e):null),R={display:"flex",flexDirection:"column"},L={display:"flex",flexDirection:"row"},A={marginTop:"3px",display:"flex"};d(this.container)?A.marginRight=`${j}px`:A.marginLeft=`${j}px`;const k={width:`${h}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return m("div",{class:i.layerRow,key:`${r}-container`,styles:R},m("div",{class:this.classes(i.symbolContainer,i.sizeRampHorizontal),styles:L},f.infos.map((e,t)=>m("div",{afterCreate:c,bind:e.preview,class:i.symbol,key:t}))),w?m("div",{class:i.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:A},m("div",{afterCreate:c,bind:w}),m("div",{afterCreate:c,bind:x})):null,m("div",{class:i.layerInfo},m("div",{class:i.rampLabelsContainer,styles:k},C)))}};e([t()],f.prototype,"cssEffectFilter",void 0),e([t()],f.prototype,"legendElement",void 0),e([t()],f.prototype,"messages",void 0),e([t()],f.prototype,"opacity",void 0),f=e([o("esri.widgets.Legend.styles.card.UnivariateAboveAndBelowRamp")],f);export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import{css as r}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{isRTL as m}from"../../../support/widgetUtils.js";import{tsx as d}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";let f=class extends s{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:o,key:s}=this,{sizeRampElement:f,colorRampElement:y}=i(e,"horizontal");if(!f)return null;const u=l(f,"full",!1,"horizontal"),g=a(f,"full",!1,"horizontal"),v=p(y,{width:g,height:12,rampAlignment:"horizontal",opacity:t,type:"full",cssEffectFilter:o,ariaLabel:this.messages?.previewColorRampAriaLabel}),h=n(f,"card"),x=f.infos.length-1,j=f.infos.map((e,t)=>0===t||t===x?d("div",{key:t},e.label):null),b={display:"flex",flexDirection:"column"},w={display:"flex",flexDirection:"row"},C={marginTop:"3px",display:"flex"};m(this.container)?C.marginRight=`${h}px`:C.marginLeft=`${h}px`;const E={width:`${u}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return d("div",{class:r.layerRow,key:`${s}-container`,styles:b},d("div",{class:this.classes(r.symbolContainer,r.sizeRampHorizontal),styles:w},f.infos.map((e,t)=>d("div",{afterCreate:c,bind:e.preview,class:r.symbol,key:t}))),d("div",{class:r.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:C},d("div",{afterCreate:c,bind:v})),d("div",{class:r.layerInfo},d("div",{class:r.rampLabelsContainer,styles:E},j)))}};e([t()],f.prototype,"cssEffectFilter",void 0),e([t()],f.prototype,"legendElement",void 0),e([t()],f.prototype,"messages",void 0),e([t()],f.prototype,"opacity",void 0),f=e([o("esri.widgets.Legend.styles.card.UnivariateColorSizeRamp")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import{css as r}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{tsx as m,isRTL as d}from"../../../support/widget.js";let f=class extends s{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:o,key:s}=this,{sizeRampElement:f,colorRampElement:y}=i(e,"horizontal");if(!f)return null;const u=l(f,"full",!1,"horizontal"),v=a(f,"full",!1,"horizontal"),g=p(y,{width:v,height:12,rampAlignment:"horizontal",opacity:t,type:"full",cssEffectFilter:o,ariaLabel:this.messages?.previewColorRampAriaLabel}),h=n(f,"card"),x=f.infos.length-1,b=f.infos.map((e,t)=>0===t||t===x?m("div",{key:t},e.label):null),w={display:"flex",flexDirection:"column"},j={display:"flex",flexDirection:"row"},C={marginTop:"3px",display:"flex"};d(this.container)?C.marginRight=`${h}px`:C.marginLeft=`${h}px`;const E={width:`${u}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return m("div",{class:r.layerRow,key:`${s}-container`,styles:w},m("div",{class:this.classes(r.symbolContainer,r.sizeRampHorizontal),styles:j},f.infos.map((e,t)=>m("div",{afterCreate:c,bind:e.preview,class:r.symbol,key:t}))),m("div",{class:r.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:C},m("div",{afterCreate:c,bind:g})),m("div",{class:r.layerInfo},m("div",{class:r.rampLabelsContainer,styles:E},b)))}};e([t()],f.prototype,"cssEffectFilter",void 0),e([t()],f.prototype,"legendElement",void 0),e([t()],f.prototype,"messages",void 0),e([t()],f.prototype,"opacity",void 0),f=e([o("esri.widgets.Legend.styles.card.UnivariateColorSizeRamp")],f);export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import t from"../../../Widget.js";import{css as o,legend as i}from"./css.js";import n from"./LegendElement.js";import{globalCss as l}from"../../../support/globalCss.js";import{Heading as a}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{messageBundle as c}from"../../../support/decorators/messageBundle.js";import{tsx as p}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const d=`${i}__`;let m=class extends t{constructor(e,s){super(e,s),this.activeLayerInfos=null,this.headingLevel=3,this.messages=null,this.type="classic"}render(){const e=this.activeLayerInfos,s=e?.toArray().map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?p("section",null,s):p("div",{class:o.message,key:"no-legend"},this.messages.noLegend)}_renderLegendForLayer(e,s){if(!e.ready)return null;const r=`${e.layer.uid}-version-${e.version}`,t=`${d}${s?`${s}-`:""}${r}`,i=e.title?a({level:this.headingLevel,class:this.classes(l.heading,o.label)},e.title):null;if(e.children.length){const s=e.children.toArray().map(e=>this._renderLegendForLayer(e,r));return p("section",{class:this.classes(o.service,o.groupLayer),key:t},i,s)}return this._renderLegendElementsForLayer(e,i,t)}_renderLegendElementsForLayer(e,s,r){const t=e.legendElements?.filter(Boolean);if(!t?.length)return null;const i=t.map(s=>p(n,{cssEffectFilter:e.cssEffectFilter,isChild:!1,key:`${r}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),l={[o.groupLayerChild]:!!e.parent};return p("section",{class:this.classes(o.service,l),key:r},s,p("div",{class:o.layer},i))}};e([s()],m.prototype,"activeLayerInfos",void 0),e([s()],m.prototype,"headingLevel",void 0),e([s(),c("esri/widgets/Legend/t9n/Legend")],m.prototype,"messages",void 0),e([s({readOnly:!0})],m.prototype,"type",void 0),m=e([r("esri.widgets.Legend.styles.classic.ClassicView")],m);export{m as default};
5
+ import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import t from"../../../Widget.js";import{css as o,legend as i}from"./css.js";import n from"./LegendElement.js";import{globalCss as l}from"../../../support/globalCss.js";import{Heading as a}from"../../../support/Heading.js";import{tsx as c,messageBundle as d}from"../../../support/widget.js";const p=`${i}__`;let g=class extends t{constructor(e,s){super(e,s),this.activeLayerInfos=null,this.headingLevel=3,this.messages=null,this.type="classic"}render(){const e=this.activeLayerInfos,s=e?.toArray().map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?c("section",null,s):c("div",{class:o.message,key:"no-legend"},this.messages.noLegend)}_renderLegendForLayer(e,s){if(!e.ready)return null;const r=`${e.layer.uid}-version-${e.version}`,t=`${p}${s?`${s}-`:""}${r}`,i=e.title?a({level:this.headingLevel,class:this.classes(l.heading,o.label)},e.title):null;if(e.children.length){const s=e.children.toArray().map(e=>this._renderLegendForLayer(e,r));return c("section",{class:this.classes(o.service,o.groupLayer),key:t},i,s)}return this._renderLegendElementsForLayer(e,i,t)}_renderLegendElementsForLayer(e,s,r){const t=e.legendElements?.filter(Boolean);if(!t?.length)return null;const i=t.map(s=>c(n,{cssEffectFilter:e.cssEffectFilter,isChild:!1,key:`${r}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),l={[o.groupLayerChild]:!!e.parent};return c("section",{class:this.classes(o.service,l),key:r},s,c("div",{class:o.layer},i))}};e([s()],g.prototype,"activeLayerInfos",void 0),e([s()],g.prototype,"headingLevel",void 0),e([s(),d("esri/widgets/Legend/t9n/Legend")],g.prototype,"messages",void 0),e([s({readOnly:!0})],g.prototype,"type",void 0),g=e([r("esri.widgets.Legend.styles.classic.ClassicView")],g);export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../../intl.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import{getRampStopLabel as i}from"../support/utils.js";import{attachToNode as l}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as p}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as a}from"../../../../intl/substitute.js";const m=24;let n=class extends r{constructor(e,t){super(e,t),this.legendElement=null,this.opacity=1}get _preview(){const e=this.legendElement.preview;if(!e)return null;const t="opacity-ramp"===this.legendElement.type?o.opacityRamp:"";return e.className=`${o.colorRamp} ${t}`,null!=this.opacity&&(e.style.opacity=this.opacity.toString()),e}render(){const{legendElement:e,_preview:t}=this;if(!t)return null;const s={width:`${m}px`},r={height:t.style.height},i=a(this.messages.previewColorRampAriaLabel,{label:null});return i&&t.querySelector("svg")?.setAttribute("aria-label",i),p("div",{class:o.layerRow,key:`${this.key}-row`},p("div",{class:o.symbolContainer,styles:s},p("div",{afterCreate:l,bind:t,class:o.rampContainer})),p("div",{class:o.layerInfo},p("div",{class:o.rampLabelsContainer,styles:r},e.infos.map((t,s)=>this._renderRampLabel(t,s,e.type)))))}_renderRampLabel(e,t,s){return p("div",{class:e.label?o.rampLabel:void 0,key:`${this.key}-stop-${e.label??t}-label`},i(e,s,this.messages))}};e([t()],n.prototype,"_preview",null),e([t()],n.prototype,"legendElement",void 0),e([t()],n.prototype,"messages",void 0),e([t()],n.prototype,"opacity",void 0),n=e([s("esri.widgets.Legend.styles.classic.ColorRamp")],n);export{n as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import o from"../../../Widget.js";import{css as i}from"./css.js";import{getRampStopLabel as l}from"../support/utils.js";import{attachToNode as p}from"../../support/styleUtils.js";import{tsx as a}from"../../../support/widget.js";const n=24;let m=class extends o{constructor(e,t){super(e,t),this.legendElement=null,this.opacity=1}get _preview(){const e=this.legendElement.preview;if(!e)return null;const t="opacity-ramp"===this.legendElement.type?i.opacityRamp:"";return e.className=`${i.colorRamp} ${t}`,null!=this.opacity&&(e.style.opacity=this.opacity.toString()),e}render(){const{legendElement:e,_preview:s}=this;if(!s)return null;const r={width:`${n}px`},o={height:s.style.height},l=t(this.messages.previewColorRampAriaLabel,{label:null});return l&&s.querySelector("svg")?.setAttribute("aria-label",l),a("div",{class:i.layerRow,key:`${this.key}-row`},a("div",{class:i.symbolContainer,styles:r},a("div",{afterCreate:p,bind:s,class:i.rampContainer})),a("div",{class:i.layerInfo},a("div",{class:i.rampLabelsContainer,styles:o},e.infos.map((t,s)=>this._renderRampLabel(t,s,e.type)))))}_renderRampLabel(e,t,s){return a("div",{class:e.label?i.rampLabel:void 0,key:`${this.key}-stop-${e.label??t}-label`},l(e,s,this.messages))}};e([s()],m.prototype,"_preview",null),e([s()],m.prototype,"legendElement",void 0),e([s()],m.prototype,"messages",void 0),e([s()],m.prototype,"opacity",void 0),m=e([r("esri.widgets.Legend.styles.classic.ColorRamp")],m);export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import i from"./ColorRamp.js";import{css as l}from"./css.js";import a from"./SizeRamp.js";import o from"./UnivariateAboveAndBelowRamp.js";import n from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as m}from"../support/relationshipUtils.js";import{getLegendElementTitle as c,getPreviewAriaLabelIntl as p}from"../support/utils.js";import{attachToNode as h,isImageryStretchedLegend as y,getTitle as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as g}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as u}from"../../../../intl/substitute.js";var f;let b=f=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=c(this.legendElement,this.messages),t=this.isChild?l.layerChildTable:l.layerTable,r=s?g("div",{class:l.layerCaption},s):null,i={[l.layerTableSizeRamp]:"size-ramp"===this.legendElement.type||!this.isChild};return g("section",{class:this.classes(t,i),key:`${this.key}-table`},r,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return g(a,{key:this.key,legendElement:this.legendElement,messages:this.messages});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return g(i,{key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return m(this.legendElement,this.id,{opacity:this.layer.opacity,cssEffectFilter:this.cssEffectFilter,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":{const{preview:e}=this.legendElement;if(!e)return null;const s=u(this.messages.previewPieChartAriaLabel,{label:null});return s&&e.querySelector("svg")?.setAttribute("aria-label",s),g("div",{afterCreate:h,bind:e,key:`${this.key}-preview`})}case"univariate-above-and-below-ramp":return g(o,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return g(n,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);return s.length?g("div",{class:l.layerBody},s):null}_renderElementInfo(e,s){const{layer:t}=this,r="label"in e?e.label:null,i=`${this.key}-${r}`;if("type"in e&&e.type)return g(f,{cssEffectFilter:this.cssEffectFilter,isChild:!0,key:i,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const a=y(t,s),o={[l.imageryLayerInfoStretched]:a},n={[l.imageryLayerInfoStretched]:a};return g("div",{class:l.layerRow,key:`${i}-row`},g("div",{class:this.classes(l.symbolContainer,n)},this._renderPreview(e,a)),g("div",{class:this.classes(l.layerInfo,o)},d(this.messages,r,!1)||""))}_renderPreview(e,s){const{layer:t}=this;if("preview"in e&&e.preview){const{preview:s}=e,t="previewAriaLabel"in e?e.previewAriaLabel:null,r="label"in e?d(this.messages,e.label,!1):null,i=s.querySelector("svg"),a=p(this.messages,t||r);return a&&i&&i.setAttribute("aria-label",a),g("div",{afterCreate:h,bind:s,class:l.symbol})}return"src"in e&&e.src?this._renderImage(e,t,s):null}_renderImage(e,s,t){const{previewAriaLabel:r,src:i,opacity:a}=e,o=d(this.messages,e.label,!1),n={[l.imageryLayerStretchedImage]:t,[l.symbol]:!t},m={opacity:`${a??s.opacity}`},c=p(this.messages,r||o);return g("img",{alt:c,"aria-label":c,border:0,class:this.classes(n),height:e.height,src:i,styles:m,width:e.width})}};e([s()],b.prototype,"cssEffectFilter",void 0),e([s()],b.prototype,"isChild",void 0),e([s()],b.prototype,"layer",void 0),e([s()],b.prototype,"legendElement",void 0),e([s()],b.prototype,"messages",void 0),b=f=e([t("esri.widgets.Legend.styles.classic.LegendElement")],b);export{b as default};
5
+ import{__decorate as e}from"tslib";import{substitute as s}from"../../../../intl.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import i from"../../../Widget.js";import l from"./ColorRamp.js";import{css as a}from"./css.js";import n from"./SizeRamp.js";import o from"./UnivariateAboveAndBelowRamp.js";import m from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as c}from"../support/relationshipUtils.js";import{getLegendElementTitle as p,getPreviewAriaLabelIntl as h}from"../support/utils.js";import{attachToNode as y,isImageryStretchedLegend as d,getTitle as g}from"../../support/styleUtils.js";import{tsx as f}from"../../../support/widget.js";var u;let b=u=class extends i{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=p(this.legendElement,this.messages),t=this.isChild?a.layerChildTable:a.layerTable,r=s?f("div",{class:a.layerCaption},s):null,i={[a.layerTableSizeRamp]:"size-ramp"===this.legendElement.type||!this.isChild};return f("section",{class:this.classes(t,i),key:`${this.key}-table`},r,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return f(n,{key:this.key,legendElement:this.legendElement,messages:this.messages});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return f(l,{key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return c(this.legendElement,this.id,{opacity:this.layer.opacity,cssEffectFilter:this.cssEffectFilter,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":{const{preview:e}=this.legendElement;if(!e)return null;const t=s(this.messages.previewPieChartAriaLabel,{label:null});return t&&e.querySelector("svg")?.setAttribute("aria-label",t),f("div",{afterCreate:y,bind:e,key:`${this.key}-preview`})}case"univariate-above-and-below-ramp":return f(o,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return f(m,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);return s.length?f("div",{class:a.layerBody},s):null}_renderElementInfo(e,s){const{layer:t}=this,r="label"in e?e.label:null,i=`${this.key}-${r}`;if("type"in e&&e.type)return f(u,{cssEffectFilter:this.cssEffectFilter,isChild:!0,key:i,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const l=d(t,s),n={[a.imageryLayerInfoStretched]:l},o={[a.imageryLayerInfoStretched]:l};return f("div",{class:a.layerRow,key:`${i}-row`},f("div",{class:this.classes(a.symbolContainer,o)},this._renderPreview(e,l)),f("div",{class:this.classes(a.layerInfo,n)},g(this.messages,r,!1)||""))}_renderPreview(e,s){const{layer:t}=this;if("preview"in e&&e.preview){const{preview:s}=e,t="previewAriaLabel"in e?e.previewAriaLabel:null,r="label"in e?g(this.messages,e.label,!1):null,i=s.querySelector("svg"),l=h(this.messages,t||r);return l&&i&&i.setAttribute("aria-label",l),f("div",{afterCreate:y,bind:s,class:a.symbol})}return"src"in e&&e.src?this._renderImage(e,t,s):null}_renderImage(e,s,t){const{previewAriaLabel:r,src:i,opacity:l}=e,n=g(this.messages,e.label,!1),o={[a.imageryLayerStretchedImage]:t,[a.symbol]:!t},m={opacity:`${l??s.opacity}`},c=h(this.messages,r||n);return f("img",{alt:c,"aria-label":c,border:0,class:this.classes(o),height:e.height,src:i,styles:m,width:e.width})}};e([t()],b.prototype,"cssEffectFilter",void 0),e([t()],b.prototype,"isChild",void 0),e([t()],b.prototype,"layer",void 0),e([t()],b.prototype,"legendElement",void 0),e([t()],b.prototype,"messages",void 0),b=u=e([r("esri.widgets.Legend.styles.classic.LegendElement")],b);export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import o from"../../../Widget.js";import{css as t}from"./css.js";import{renderSpikeRamp as i}from"../support/sizeRampUtils.js";import{getTitle as l,attachToNode as p}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as m}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";let a=class extends o{constructor(e,s){super(e,s),this.legendElement=null}render(){const e=this.legendElement.infos.map(e=>this._renderRow(e)).filter(Boolean);return e.length?"spike"===this.legendElement.theme?i(this.legendElement):m("div",{class:t.layerBody},e):null}_renderRow(e){return e.preview?m("div",{class:t.layerRow,key:`${this.key}-${e.label}-row`},m("div",{class:this.classes(t.symbolContainer,t.sizeRamp)},m("div",{afterCreate:p,bind:e.preview,class:t.symbol})),m("div",{class:t.layerInfo},l(this.messages,e.label,!1)||"")):null}};e([s()],a.prototype,"legendElement",void 0),e([s()],a.prototype,"messages",void 0),a=e([r("esri.widgets.Legend.styles.classic.SizeRamp")],a);export{a as default};
5
+ import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import o from"../../../Widget.js";import{css as t}from"./css.js";import{renderSpikeRamp as i}from"../support/sizeRampUtils.js";import{getTitle as l,attachToNode as p}from"../../support/styleUtils.js";import{tsx as m}from"../../../support/widget.js";let a=class extends o{constructor(e,s){super(e,s),this.legendElement=null}render(){const e=this.legendElement.infos.map(e=>this._renderRow(e)).filter(Boolean);return e.length?"spike"===this.legendElement.theme?i(this.legendElement):m("div",{class:t.layerBody},e):null}_renderRow(e){return e.preview?m("div",{class:t.layerRow,key:`${this.key}-${e.label}-row`},m("div",{class:this.classes(t.symbolContainer,t.sizeRamp)},m("div",{afterCreate:p,bind:e.preview,class:t.symbol})),m("div",{class:t.layerInfo},l(this.messages,e.label,!1)||"")):null}};e([s()],a.prototype,"legendElement",void 0),e([s()],a.prototype,"messages",void 0),a=e([r("esri.widgets.Legend.styles.classic.SizeRamp")],a);export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import{getUnivariateAboveAndBelowRampElements as l,getUnivariateColorRampSize as o,getUnivariateColorRampPreview as a,getUnivariateColorRampMargin as p,univariateColorRampContainerStyles as n,univariateColorRampStyles as c,univariateRampContainerStyles as m}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as v}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";let y=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:s,cssEffectFilter:t,key:r}=this,{sizeRampElement:y,colorRampElement:b}=l(e,s);if(!y)return null;const f=this.messages.previewColorRampAriaLabel,u=o(y,"above",!0),g=o(y,"below",!0),h=12,w=a(b,{width:h,height:u,rampAlignment:"vertical",opacity:s,type:"above",cssEffectFilter:t,ariaLabel:f}),j=a(b,{width:h,height:g,rampAlignment:"vertical",opacity:s,type:"below",cssEffectFilter:t,ariaLabel:f}),L=p(y),A=y.infos.map(e=>e.label),E=A.map((e,s)=>{const t=2===s;return 0===s?v("div",{class:e?w?i.univariateAboveAndBelowLabel:i.rampLabel:void 0,key:`${r}-color-ramp-above-label-${e??s}`},e):t?v("div",null):null}),$=A.length-1,C=Math.floor(A.length/2),R=A.map((e,s)=>s===C||s===$?v("div",{class:e?w?i.univariateAboveAndBelowLabel:i.rampLabel:void 0,key:`${r}-color-ramp-below-label-${e??s}`},e):null),k={display:"table-cell",verticalAlign:"middle"},x={marginTop:`${L}px`},F={height:`${u}px`},B={height:`${g}px`};return v("div",{key:`${r}-container`,styles:m},v("div",{class:i.layerBody},y.infos.map((e,s)=>v("div",{class:this.classes(i.layerRow,i.sizeRamp),key:`${r}-row-${s}`},v("div",{afterCreate:d,bind:e.preview,class:i.symbol,styles:k}),w||s%2!=0?null:v("div",{class:i.layerInfo},A[s])))),w?v("div",{styles:x},v("div",{styles:n},v("div",{styles:c},v("div",{afterCreate:d,bind:w,class:i.rampContainer})),v("div",{styles:c},v("div",{class:i.rampLabelsContainer,styles:F},E))),v("div",{styles:n},v("div",{styles:c},v("div",{afterCreate:d,bind:j,class:i.rampContainer})),v("div",{styles:c},v("div",{class:i.rampLabelsContainer,styles:B},R)))):null)}};e([s()],y.prototype,"cssEffectFilter",void 0),e([s()],y.prototype,"legendElement",void 0),e([s()],y.prototype,"messages",void 0),e([s()],y.prototype,"opacity",void 0),y=e([t("esri.widgets.Legend.styles.classic.UnivariateAboveAndBelowRamp")],y);export{y as default};
5
+ import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import l from"../../../Widget.js";import{css as r}from"./css.js";import{getUnivariateAboveAndBelowRampElements as i,getUnivariateColorRampSize as o,getUnivariateColorRampPreview as a,getUnivariateColorRampMargin as p,univariateColorRampContainerStyles as n,univariateColorRampStyles as c,univariateRampContainerStyles as m}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import{tsx as v}from"../../../support/widget.js";let y=class extends l{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:s,cssEffectFilter:t,key:l}=this,{sizeRampElement:y,colorRampElement:b}=i(e,s);if(!y)return null;const f=this.messages.previewColorRampAriaLabel,u=o(y,"above",!0),g=o(y,"below",!0),h=12,w=a(b,{width:h,height:u,rampAlignment:"vertical",opacity:s,type:"above",cssEffectFilter:t,ariaLabel:f}),L=a(b,{width:h,height:g,rampAlignment:"vertical",opacity:s,type:"below",cssEffectFilter:t,ariaLabel:f}),j=p(y),A=y.infos.map(e=>e.label),E=A.map((e,s)=>{const t=2===s;return 0===s?v("div",{class:e?w?r.univariateAboveAndBelowLabel:r.rampLabel:void 0,key:`${l}-color-ramp-above-label-${e??s}`},e):t?v("div",null):null}),$=A.length-1,C=Math.floor(A.length/2),R=A.map((e,s)=>s===C||s===$?v("div",{class:e?w?r.univariateAboveAndBelowLabel:r.rampLabel:void 0,key:`${l}-color-ramp-below-label-${e??s}`},e):null),k={display:"table-cell",verticalAlign:"middle"},x={marginTop:`${j}px`},F={height:`${u}px`},B={height:`${g}px`};return v("div",{key:`${l}-container`,styles:m},v("div",{class:r.layerBody},y.infos.map((e,s)=>v("div",{class:this.classes(r.layerRow,r.sizeRamp),key:`${l}-row-${s}`},v("div",{afterCreate:d,bind:e.preview,class:r.symbol,styles:k}),w||s%2!=0?null:v("div",{class:r.layerInfo},A[s])))),w?v("div",{styles:x},v("div",{styles:n},v("div",{styles:c},v("div",{afterCreate:d,bind:w,class:r.rampContainer})),v("div",{styles:c},v("div",{class:r.rampLabelsContainer,styles:F},E))),v("div",{styles:n},v("div",{styles:c},v("div",{afterCreate:d,bind:L,class:r.rampContainer})),v("div",{styles:c},v("div",{class:r.rampLabelsContainer,styles:B},R)))):null)}};e([s()],y.prototype,"cssEffectFilter",void 0),e([s()],y.prototype,"legendElement",void 0),e([s()],y.prototype,"messages",void 0),e([s()],y.prototype,"opacity",void 0),y=e([t("esri.widgets.Legend.styles.classic.UnivariateAboveAndBelowRamp")],y);export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateColorRampMargin as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,univariateColorRampContainerStyles as c,univariateColorRampStyles as m,univariateRampContainerStyles as n}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as y}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";let f=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:s,cssEffectFilter:t,key:r}=this,{sizeRampElement:f,colorRampElement:v}=i(e);if(!f)return null;const u=l(f),g=12,b=a(f,"full",!1),h=p(v,{width:g,height:b,rampAlignment:"vertical",opacity:s,type:"full",cssEffectFilter:t,ariaLabel:this.messages?.previewColorRampAriaLabel}),j=f.infos.length-1,E=f.infos.map((e,s)=>0===s||s===j?y("div",{class:e.label?v?o.univariateAboveAndBelowLabel:o.rampLabel:void 0,key:`${r}-color-ramp-label-${e.label??s}`},e.label):null),w={display:"table-cell",verticalAlign:"middle"},L={marginTop:`${u}px`},C={height:`${b}px`};return y("div",{key:`${r}-container`,styles:n},y("div",{class:o.layerBody},f.infos.map((e,s)=>y("div",{class:this.classes(o.layerRow,o.sizeRamp),key:`${r}-row-${s}`},y("div",{afterCreate:d,bind:e.preview,class:o.symbol,styles:w})))),y("div",{styles:L},y("div",{styles:c},y("div",{styles:m},y("div",{afterCreate:d,bind:h,class:o.rampContainer})),y("div",{styles:m},y("div",{class:o.rampLabelsContainer,styles:C},E)))))}};e([s()],f.prototype,"cssEffectFilter",void 0),e([s()],f.prototype,"legendElement",void 0),e([s()],f.prototype,"messages",void 0),e([s()],f.prototype,"opacity",void 0),f=e([t("esri.widgets.Legend.styles.classic.UnivariateColorSizeRamp")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import{getUnivariateColorSizeRampElements as o,getUnivariateColorRampMargin as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,univariateColorRampContainerStyles as c,univariateColorRampStyles as m,univariateRampContainerStyles as n}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import{tsx as y}from"../../../support/widget.js";let f=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:s,cssEffectFilter:t,key:r}=this,{sizeRampElement:f,colorRampElement:v}=o(e);if(!f)return null;const u=l(f),g=12,b=a(f,"full",!1),h=p(v,{width:g,height:b,rampAlignment:"vertical",opacity:s,type:"full",cssEffectFilter:t,ariaLabel:this.messages?.previewColorRampAriaLabel}),j=f.infos.length-1,E=f.infos.map((e,s)=>0===s||s===j?y("div",{class:e.label?v?i.univariateAboveAndBelowLabel:i.rampLabel:void 0,key:`${r}-color-ramp-label-${e.label??s}`},e.label):null),w={display:"table-cell",verticalAlign:"middle"},L={marginTop:`${u}px`},C={height:`${b}px`};return y("div",{key:`${r}-container`,styles:n},y("div",{class:i.layerBody},f.infos.map((e,s)=>y("div",{class:this.classes(i.layerRow,i.sizeRamp),key:`${r}-row-${s}`},y("div",{afterCreate:d,bind:e.preview,class:i.symbol,styles:w})))),y("div",{styles:L},y("div",{styles:c},y("div",{styles:m},y("div",{afterCreate:d,bind:h,class:i.rampContainer})),y("div",{styles:m},y("div",{class:i.rampLabelsContainer,styles:C},E)))))}};e([s()],f.prototype,"cssEffectFilter",void 0),e([s()],f.prototype,"legendElement",void 0),e([s()],f.prototype,"messages",void 0),e([s()],f.prototype,"opacity",void 0),f=e([t("esri.widgets.Legend.styles.classic.UnivariateColorSizeRamp")],f);export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{generateFillAttributes as e,renderDef as a,renderShape as l,getBoundingBox as r,computeBBox as t,getTransformMatrix as o,generateStrokeAttributes as s}from"../../../../symbols/support/svgUtils.js";import{isRTL as i,classes as n}from"../../../support/widgetUtils.js";import{tsx as d}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const m="esri-relationship-ramp",b=`${m}--diamond`,u=`${m}--square`,c="http://www.w3.org/2000/svg",f={diamondContainer:`${b}__container`,diamondLeftCol:`${b}__left-column`,diamondRightCol:`${b}__right-column`,diamondMidCol:`${b}__middle-column`,diamondMidColLabel:`${b}__middle-column--label`,diamondMidColRamp:`${b}__middle-column--ramp`,squareTable:`${u}__table`,squareTableRow:`${u}__table-row`,squareTableCell:`${u}__table-cell`,squareTableLabel:`${u}__table-label`,squareTableLabelLeftBottom:`${u}__table-label--left-bottom`,squareTableLabelRightBottom:`${u}__table-label--right-bottom`,squareTableLabelLeftTop:`${u}__table-label--left-top`,squareTableLabelRightTop:`${u}__table-label--right-top`};function k(e,a,l={}){const{focus:r,labels:t}=e,o=!!r,s=h(e,a,l),m={justifyContent:"center"},b=i(),u=l.key??a;return o?d("div",{class:f.diamondContainer,key:`${u}-container`,styles:m},d("div",{class:f.diamondLeftCol},b?t.right:t.left),d("div",{class:f.diamondMidCol},d("div",{class:f.diamondMidColLabel},t.top),s,d("div",{class:f.diamondMidColLabel},t.bottom)),d("div",{class:f.diamondRightCol},b?t.left:t.right)):d("div",{class:f.squareTable,key:`${u}-container`},d("div",{class:f.squareTableRow},d("div",{class:n(f.squareTableCell,f.squareTableLabel,f.squareTableLabelRightBottom)},b?t.top:t.left),d("div",{class:f.squareTableCell}),d("div",{class:n(f.squareTableCell,f.squareTableLabel,f.squareTableLabelLeftBottom)},b?t.left:t.top)),d("div",{class:f.squareTableRow},d("div",{class:f.squareTableCell}),s,d("div",{class:f.squareTableCell})),d("div",{class:f.squareTableRow},d("div",{class:n(f.squareTableCell,f.squareTableLabel,f.squareTableLabelRightTop)},b?t.right:t.bottom),d("div",{class:f.squareTableCell}),d("div",{class:n(f.squareTableCell,f.squareTableLabel,f.squareTableLabelLeftTop)},b?t.bottom:t.right)))}function p(e,a,l){const r=`${l}_arrowStart`,t=`${l}_arrowEnd`,o="left"===e,s={markerStart:null,markerEnd:null};switch(a){case"HL":o?s.markerStart=`url(#${t})`:s.markerEnd=`url(#${r})`;break;case"LL":s.markerStart=`url(#${t})`;break;case"LH":o?s.markerEnd=`url(#${r})`:s.markerStart=`url(#${t})`;break;default:s.markerEnd=`url(#${r})`}return s}function h(i,n,m={}){const{focus:b,numClasses:u,colors:k,rotation:h}=i,{opacity:T,cssEffectFilter:_,ariaLabel:q}=m,$=m.size??60,g=!!b,L=Math.sqrt($**2+$**2)+(g?0:5),C=[],v=[],w=[],y=($||75)/u;for(let t=0;t<u;t++){const o=t*y;for(let i=0;i<u;i++){const n=i*y,d=e(k[t][i]),m=s(null),b={type:"rect",x:n,y:o,width:y,height:y},u=a(d);u&&C.push(u);const c=l(b,d.fill,m,null);c&&v.push(c),w.push(r(b))}}const x=15,R=15,E=10;let M=null;g||(M="margin: -15px -15px -18px -15px");const S=p("left",b,n),j=p("right",b,n),B=t(w),H=o(B,L,L,0,!1,h,!1),U=o(B,L,L,0,!1,g?-45:null,!1),W={filter:_??void 0,opacity:null==T?"":`${T}`};return d("div",{class:g?f.diamondMidColRamp:f.squareTableCell,styles:W},d("svg",{"aria-label":q,focusable:!1,height:L,role:"image",style:M,width:L,xmlns:c},d("defs",null,d("marker",{id:`${n}_arrowStart`,markerHeight:"10",markerUnits:"strokeWidth",markerWidth:"10",orient:"auto",refX:"5",refY:"5"},d("polyline",{fill:"none",points:"0,0 5,5 0,10",stroke:"#555555","stroke-width":"1"})),d("marker",{id:`${n}_arrowEnd`,markerHeight:"10",markerUnits:"strokeWidth",markerWidth:"10",orient:"auto",refX:"0",refY:"5"},d("polyline",{fill:"none",points:"5,0 0,5 5,10",stroke:"#555555","stroke-width":"1"})),C),d("g",{transform:H},v),d("g",{transform:U},d("line",{fill:"none","marker-end":S.markerEnd,"marker-start":S.markerStart,stroke:"#555555","stroke-width":"1",x1:-10,x2:-10,y1:$-x,y2:x}),d("line",{fill:"none","marker-end":j.markerEnd,"marker-start":j.markerStart,stroke:"#555555","stroke-width":"1",x1:R,x2:$-R,y1:$+E,y2:$+E}))))}export{k as renderRelationshipRamp};
5
+ import{generateFillAttributes as e,renderDef as a,renderShape as l,getBoundingBox as r,computeBBox as t,getTransformMatrix as s,generateStrokeAttributes as o}from"../../../../symbols/support/svgUtils.js";import{isRTL as i,tsx as n,classes as d}from"../../../support/widget.js";const b="esri-relationship-ramp",m=`${b}--diamond`,u=`${b}--square`,c="http://www.w3.org/2000/svg",f={diamondContainer:`${m}__container`,diamondLeftCol:`${m}__left-column`,diamondRightCol:`${m}__right-column`,diamondMidCol:`${m}__middle-column`,diamondMidColLabel:`${m}__middle-column--label`,diamondMidColRamp:`${m}__middle-column--ramp`,squareTable:`${u}__table`,squareTableRow:`${u}__table-row`,squareTableCell:`${u}__table-cell`,squareTableLabel:`${u}__table-label`,squareTableLabelLeftBottom:`${u}__table-label--left-bottom`,squareTableLabelRightBottom:`${u}__table-label--right-bottom`,squareTableLabelLeftTop:`${u}__table-label--left-top`,squareTableLabelRightTop:`${u}__table-label--right-top`};function k(e,a,l={}){const{focus:r,labels:t}=e,s=!!r,o=p(e,a,l),b={justifyContent:"center"},m=i(),u=l.key??a;return s?n("div",{class:f.diamondContainer,key:`${u}-container`,styles:b},n("div",{class:f.diamondLeftCol},m?t.right:t.left),n("div",{class:f.diamondMidCol},n("div",{class:f.diamondMidColLabel},t.top),o,n("div",{class:f.diamondMidColLabel},t.bottom)),n("div",{class:f.diamondRightCol},m?t.left:t.right)):n("div",{class:f.squareTable,key:`${u}-container`},n("div",{class:f.squareTableRow},n("div",{class:d(f.squareTableCell,f.squareTableLabel,f.squareTableLabelRightBottom)},m?t.top:t.left),n("div",{class:f.squareTableCell}),n("div",{class:d(f.squareTableCell,f.squareTableLabel,f.squareTableLabelLeftBottom)},m?t.left:t.top)),n("div",{class:f.squareTableRow},n("div",{class:f.squareTableCell}),o,n("div",{class:f.squareTableCell})),n("div",{class:f.squareTableRow},n("div",{class:d(f.squareTableCell,f.squareTableLabel,f.squareTableLabelRightTop)},m?t.right:t.bottom),n("div",{class:f.squareTableCell}),n("div",{class:d(f.squareTableCell,f.squareTableLabel,f.squareTableLabelLeftTop)},m?t.bottom:t.right)))}function h(e,a,l){const r=`${l}_arrowStart`,t=`${l}_arrowEnd`,s="left"===e,o={markerStart:null,markerEnd:null};switch(a){case"HL":s?o.markerStart=`url(#${t})`:o.markerEnd=`url(#${r})`;break;case"LL":o.markerStart=`url(#${t})`;break;case"LH":s?o.markerEnd=`url(#${r})`:o.markerStart=`url(#${t})`;break;default:o.markerEnd=`url(#${r})`}return o}function p(i,d,b={}){const{focus:m,numClasses:u,colors:k,rotation:p}=i,{opacity:T,cssEffectFilter:_,ariaLabel:q}=b,$=b.size??60,g=!!m,L=Math.sqrt($**2+$**2)+(g?0:5),C=[],v=[],w=[],y=($||75)/u;for(let t=0;t<u;t++){const s=t*y;for(let i=0;i<u;i++){const n=i*y,d=e(k[t][i]),b=o(null),m={type:"rect",x:n,y:s,width:y,height:y},u=a(d);u&&C.push(u);const c=l(m,d.fill,b,null);c&&v.push(c),w.push(r(m))}}const R=15,x=15,E=10;let M=null;g||(M="margin: -15px -15px -18px -15px");const S=h("left",m,d),B=h("right",m,d),H=t(w),W=s(H,L,L,0,!1,p,!1),j=s(H,L,L,0,!1,g?-45:null,!1),U={filter:_??void 0,opacity:null==T?"":`${T}`};return n("div",{class:g?f.diamondMidColRamp:f.squareTableCell,styles:U},n("svg",{"aria-label":q,focusable:!1,height:L,role:"image",style:M,width:L,xmlns:c},n("defs",null,n("marker",{id:`${d}_arrowStart`,markerHeight:"10",markerUnits:"strokeWidth",markerWidth:"10",orient:"auto",refX:"5",refY:"5"},n("polyline",{fill:"none",points:"0,0 5,5 0,10",stroke:"#555555","stroke-width":"1"})),n("marker",{id:`${d}_arrowEnd`,markerHeight:"10",markerUnits:"strokeWidth",markerWidth:"10",orient:"auto",refX:"0",refY:"5"},n("polyline",{fill:"none",points:"5,0 0,5 5,10",stroke:"#555555","stroke-width":"1"})),C),n("g",{transform:W},v),n("g",{transform:j},n("line",{fill:"none","marker-end":S.markerEnd,"marker-start":S.markerStart,stroke:"#555555","stroke-width":"1",x1:-10,x2:-10,y1:$-R,y2:R}),n("line",{fill:"none","marker-end":B.markerEnd,"marker-start":B.markerStart,stroke:"#555555","stroke-width":"1",x1:x,x2:$-x,y1:$+E,y2:$+E}))))}export{k as renderRelationshipRamp};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{pt2px as e}from"../../../../core/screenUtils.js";import{isWidthAndHeight as i}from"./utils.js";import{attachToNode as t}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as s}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const o="#ddd",n=window.devicePixelRatio,a="esri-spike-ramp",r={spikeRampContainer:`${a}__container`,spikeRampPreviewContainer:`${a}__preview-container`,spikeRampPreview:`${a}__preview`,spikeRampSymbolPreview:`${a}__symbol-preview`,spikeRampLines:`${a}__lines`,spikeRampLabelsContainer:`${a}__labels-container`,spikeRampLabel:`${a}__label`};function p(e){return 5!==e.infos.length?null:s("div",{class:r.spikeRampContainer},s("div",{class:r.spikeRampPreviewContainer},l(e),m(e)),d(e))}function l(e){const[i,o,n]=h(e).map(({preview:e})=>{if(!e)return null;const i=e.cloneNode(!0);return i.classList.add(r.spikeRampSymbolPreview),i});return i&&o&&n?s("div",{class:r.spikeRampPreview},s("div",{afterCreate:t,bind:n}),s("div",{afterCreate:t,bind:o}),s("div",{afterCreate:t,bind:i})):null}function m(a){const[{width:p,height:l},{width:m},{width:d,height:c}]=h(a).map(({size:t})=>i(t)?{width:e(t.width),height:e(t.height)}:{width:0,height:0}),v=10,b=8,u=p+m+d+3*v,w=l,k=document.createElement("canvas");k.width=(u+v)*n,k.height=w*n,k.style.width=k.width/n+"px",k.style.height=k.height/n+"px";const f=k.getContext("2d");f.beginPath();const g=u-(p/2+v),R=0,_=u+b,y=0;f.moveTo(g*n,R*n),f.lineTo(_*n,y*n);const C=(u-b)/2,L=(l-c)/2,x=u+b,P=(l-c)/2;f.moveTo(C*n,L*n),f.lineTo(x*n,P*n);const $=d/2,j=w-c,T=u+b,S=w-c;return f.moveTo($*n,j*n),f.lineTo(T*n,S*n),f.strokeStyle=o,f.lineWidth=.5*n,f.stroke(),s("div",{afterCreate:t,bind:k,class:r.spikeRampLines})}function d(t){const[{label:o,height:n},{label:a},{label:p,height:l}]=h(t).map(({label:t,size:s})=>({label:t,height:i(s)?e(s.height):0})),m=n-l,d={position:"absolute",top:"0"},c={position:"absolute",top:m/2+"px"},v={position:"absolute",top:`${m}px`};return s("div",{class:r.spikeRampLabelsContainer},s("div",{class:r.spikeRampLabel,styles:d},o),s("div",{class:r.spikeRampLabel,styles:c},a),s("div",{class:r.spikeRampLabel,styles:v},p))}function h(e){return e.infos.filter((e,i)=>i%2==0)}export{p as renderSpikeRamp};
5
+ import{pt2px as e}from"../../../../core/screenUtils.js";import{isWidthAndHeight as i}from"./utils.js";import{attachToNode as t}from"../../support/styleUtils.js";import{tsx as s}from"../../../support/widget.js";const n="#ddd",o=window.devicePixelRatio,a="esri-spike-ramp",l={spikeRampContainer:`${a}__container`,spikeRampPreviewContainer:`${a}__preview-container`,spikeRampPreview:`${a}__preview`,spikeRampSymbolPreview:`${a}__symbol-preview`,spikeRampLines:`${a}__lines`,spikeRampLabelsContainer:`${a}__labels-container`,spikeRampLabel:`${a}__label`};function p(e){return 5!==e.infos.length?null:s("div",{class:l.spikeRampContainer},s("div",{class:l.spikeRampPreviewContainer},r(e),d(e)),h(e))}function r(e){const[i,n,o]=m(e).map(({preview:e})=>{if(!e)return null;const i=e.cloneNode(!0);return i.classList.add(l.spikeRampSymbolPreview),i});return i&&n&&o?s("div",{class:l.spikeRampPreview},s("div",{afterCreate:t,bind:o}),s("div",{afterCreate:t,bind:n}),s("div",{afterCreate:t,bind:i})):null}function d(a){const[{width:p,height:r},{width:d},{width:h,height:c}]=m(a).map(({size:t})=>i(t)?{width:e(t.width),height:e(t.height)}:{width:0,height:0}),v=10,b=8,u=p+d+h+3*v,w=r,k=document.createElement("canvas");k.width=(u+v)*o,k.height=w*o,k.style.width=k.width/o+"px",k.style.height=k.height/o+"px";const f=k.getContext("2d");f.beginPath();const R=u-(p/2+v),g=0,_=u+b,C=0;f.moveTo(R*o,g*o),f.lineTo(_*o,C*o);const y=(u-b)/2,L=(r-c)/2,P=u+b,$=(r-c)/2;f.moveTo(y*o,L*o),f.lineTo(P*o,$*o);const x=h/2,T=w-c,j=u+b,S=w-c;return f.moveTo(x*o,T*o),f.lineTo(j*o,S*o),f.strokeStyle=n,f.lineWidth=.5*o,f.stroke(),s("div",{afterCreate:t,bind:k,class:l.spikeRampLines})}function h(t){const[{label:n,height:o},{label:a},{label:p,height:r}]=m(t).map(({label:t,size:s})=>({label:t,height:i(s)?e(s.height):0})),d=o-r,h={position:"absolute",top:"0"},c={position:"absolute",top:d/2+"px"},v={position:"absolute",top:`${d}px`};return s("div",{class:l.spikeRampLabelsContainer},s("div",{class:l.spikeRampLabel,styles:h},n),s("div",{class:l.spikeRampLabel,styles:c},a),s("div",{class:l.spikeRampLabel,styles:v},p))}function m(e){return e.infos.filter((e,i)=>i%2==0)}export{p as renderSpikeRamp};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{pt2px as e}from"../../../../core/screenUtils.js";import"../../../../libs/maquette/projection.js";import{createProjector as t}from"../../../../libs/maquette/projector.js";import{isNumber as i}from"../../../../support/guards.js";import{renderColorRampPreviewHTML as o}from"../../../../symbols/support/symbolUtils.js";import"../../../support/widgetUtils.js";import{tsx as l}from"../../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const r=t(),n=10,s=20,a=10,c=20,f={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function p(e="vertical"){const t="stroke:rgb(200, 200, 200);stroke-width:1";return"vertical"===e?l("svg",{height:"4",width:"10"},l("line",{style:t,x1:"0",x2:"10",y1:"2",y2:"2"})):l("svg",{height:"10",width:"10"},l("line",{style:t,x1:"5",x2:"5",y1:"0",y2:"10"}))}function m(e,t="vertical"){const i=document.createElement("div");return i.style.height=`${s}px`,i.className=f.univariateAboveAndBelowSymbol,null!=e&&(i.style.opacity=e.toString()),r.append(i,p.bind(null,t)),i}function u(t,o,l="vertical",r){t.infos.forEach((t,n)=>{if(r&&2===n)t.preview=m(o,l);else{const o=(i(t.size)?e(t.size):0)+("horizontal"===l?c:a),r=t.preview,n="div"===r?.tagName.toLowerCase(),s=n?r:document.createElement("div");s.className=f.univariateAboveAndBelowSymbol,"horizontal"===l?s.style.width=`${o}px`:s.style.height=`${o}px`,!n&&r&&s.appendChild(r),t.preview=s}})}function v(t,o="classic"){const l=t.infos,r=l.at(0),n=l.at(-1),s=i(r.size)?e(r.size):0,c=i(n.size)?e(n.size):0;return"classic"===o?(s+a)/2:(s-c)/2}function h(e,t){if(!e)return null;const i=e.infos.map(e=>e.color),l=o("full"===t.type?i:"above"===t.type?i.slice(0,3):i.slice(2,5),{width:t.width,height:t.height,align:t.rampAlignment,cssEffectFilter:t.cssEffectFilter,ariaLabel:t.ariaLabel});return l.className=f.colorRamp,null!=t.opacity&&(l.style.opacity=t.opacity.toString()),l}function d(t,o,l,r="vertical"){let f=0;const p=t.infos,m=Math.floor(p.length/2),u="full"===o||"above"===o?0:m,v="full"===o||"below"===o?p.length-1:m;for(let h=u;h<=v;h++)if(l&&h===m)f+="horizontal"===r?n:s;else{const t=p[h].size;f+=(i(t)?e(t):0)+("horizontal"===r?c:a)}return Math.round(f)}function y(t,o,l,r="vertical"){const f=d(t,o,l,r),p=t.infos,m=Math.floor(p.length/2),u="full"===o||"above"===o?0:m,v="full"===o||"below"===o?p.length-1:m,h=i(p[u].size)?p[u].size:0,y=i(p[v].size)?p[v].size:0,g="full"===o?h+y:"above"===o?h:y,b=l?"vertical"===r?s:n:0,z="vertical"===r?a*("full"===o?2:1):c*("full"===o?2:1);return Math.round(f-(e(g)/2+b/2+z/2))}function g(e,t,i="vertical"){const o=e.infos;let l=o.find(({type:e})=>"size-ramp"===e),r=o.find(({type:e})=>"color-ramp"===e);return l&&(l={...l},l.infos=[...l.infos],u(l,t,i,!0)),r&&(r={...r},r.infos=[...r.infos]),"horizontal"===i&&(l?.infos.reverse(),r?.infos.reverse()),{sizeRampElement:l,colorRampElement:r}}function b(e,t="vertical"){const i=e.infos;let o=i.find(({type:e})=>"size-ramp"===e),l=i.find(({type:e})=>"color-ramp"===e);return o&&(o={...o},o.infos=[...o.infos],u(o,null,t,!1)),l&&(l={...l},l.infos=[...l.infos]),"horizontal"===t&&(o?.infos.reverse(),l?.infos.reverse()),{sizeRampElement:o,colorRampElement:l}}const z={marginLeft:"3px"},w={display:"table-cell",verticalAlign:"middle"},x={display:"flex",alignItems:"flex-start"};export{g as getUnivariateAboveAndBelowRampElements,v as getUnivariateColorRampMargin,h as getUnivariateColorRampPreview,y as getUnivariateColorRampSize,b as getUnivariateColorSizeRampElements,d as getUnivariateSizeRampSize,z as univariateColorRampContainerStyles,w as univariateColorRampStyles,x as univariateRampContainerStyles};
5
+ import{pt2px as e}from"../../../../core/screenUtils.js";import"../../../../libs/maquette/projection.js";import{createProjector as t}from"../../../../libs/maquette/projector.js";import{isNumber as i}from"../../../../support/guards.js";import{renderColorRampPreviewHTML as o}from"../../../../symbols/support/symbolUtils.js";import{tsx as l}from"../../../support/widget.js";const n=t(),r=10,s=20,a=10,c=20,f={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function p(e="vertical"){const t="stroke:rgb(200, 200, 200);stroke-width:1";return"vertical"===e?l("svg",{height:"4",width:"10"},l("line",{style:t,x1:"0",x2:"10",y1:"2",y2:"2"})):l("svg",{height:"10",width:"10"},l("line",{style:t,x1:"5",x2:"5",y1:"0",y2:"10"}))}function m(e,t="vertical"){const i=document.createElement("div");return i.style.height=`${s}px`,i.className=f.univariateAboveAndBelowSymbol,null!=e&&(i.style.opacity=e.toString()),n.append(i,p.bind(null,t)),i}function u(t,o,l="vertical",n){t.infos.forEach((t,r)=>{if(n&&2===r)t.preview=m(o,l);else{const o=(i(t.size)?e(t.size):0)+("horizontal"===l?c:a),n=t.preview,r="div"===n?.tagName.toLowerCase(),s=r?n:document.createElement("div");s.className=f.univariateAboveAndBelowSymbol,"horizontal"===l?s.style.width=`${o}px`:s.style.height=`${o}px`,!r&&n&&s.appendChild(n),t.preview=s}})}function v(t,o="classic"){const l=t.infos,n=l.at(0),r=l.at(-1),s=i(n.size)?e(n.size):0,c=i(r.size)?e(r.size):0;return"classic"===o?(s+a)/2:(s-c)/2}function h(e,t){if(!e)return null;const i=e.infos.map(e=>e.color),l=o("full"===t.type?i:"above"===t.type?i.slice(0,3):i.slice(2,5),{width:t.width,height:t.height,align:t.rampAlignment,cssEffectFilter:t.cssEffectFilter,ariaLabel:t.ariaLabel});return l.className=f.colorRamp,null!=t.opacity&&(l.style.opacity=t.opacity.toString()),l}function d(t,o,l,n="vertical"){let f=0;const p=t.infos,m=Math.floor(p.length/2),u="full"===o||"above"===o?0:m,v="full"===o||"below"===o?p.length-1:m;for(let h=u;h<=v;h++)if(l&&h===m)f+="horizontal"===n?r:s;else{const t=p[h].size;f+=(i(t)?e(t):0)+("horizontal"===n?c:a)}return Math.round(f)}function y(t,o,l,n="vertical"){const f=d(t,o,l,n),p=t.infos,m=Math.floor(p.length/2),u="full"===o||"above"===o?0:m,v="full"===o||"below"===o?p.length-1:m,h=i(p[u].size)?p[u].size:0,y=i(p[v].size)?p[v].size:0,b="full"===o?h+y:"above"===o?h:y,g=l?"vertical"===n?s:r:0,z="vertical"===n?a*("full"===o?2:1):c*("full"===o?2:1);return Math.round(f-(e(b)/2+g/2+z/2))}function b(e,t,i="vertical"){const o=e.infos;let l=o.find(({type:e})=>"size-ramp"===e),n=o.find(({type:e})=>"color-ramp"===e);return l&&(l={...l},l.infos=[...l.infos],u(l,t,i,!0)),n&&(n={...n},n.infos=[...n.infos]),"horizontal"===i&&(l?.infos.reverse(),n?.infos.reverse()),{sizeRampElement:l,colorRampElement:n}}function g(e,t="vertical"){const i=e.infos;let o=i.find(({type:e})=>"size-ramp"===e),l=i.find(({type:e})=>"color-ramp"===e);return o&&(o={...o},o.infos=[...o.infos],u(o,null,t,!1)),l&&(l={...l},l.infos=[...l.infos]),"horizontal"===t&&(o?.infos.reverse(),l?.infos.reverse()),{sizeRampElement:o,colorRampElement:l}}const z={marginLeft:"3px"},w={display:"table-cell",verticalAlign:"middle"},x={display:"flex",alignItems:"flex-start"};export{b as getUnivariateAboveAndBelowRampElements,v as getUnivariateColorRampMargin,h as getUnivariateColorRampPreview,y as getUnivariateColorRampSize,g as getUnivariateColorSizeRampElements,d as getUnivariateSizeRampSize,z as univariateColorRampContainerStyles,w as univariateColorRampStyles,x as univariateRampContainerStyles};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../intl.js";import{getTitle as t,isRendererTitle as e,getStretchStopLabel as r}from"../../support/styleUtils.js";import{substitute as i}from"../../../../intl/substitute.js";function l(t,e,i){switch(e){case"heatmap-ramp":return i[t.label]||t.label;case"stretch-ramp":return r(t,i);default:return t.label}}function n(r,i){if(!r.title||"string"==typeof r.title)return r.title;const l="color-ramp"===r.type||"opacity-ramp"===r.type,n=r.title,a=t(i,n,l);return e(n,l)&&n.title?`${n.title} (${a})`:a}function a(t){return!(!t||"object"!=typeof t)}function o(e,r){const l=t(e,r,!1),n=l?e.previewTemplateAriaLabel:e.previewAriaLabel;return i(n,{label:l})}export{n as getLegendElementTitle,o as getPreviewAriaLabelIntl,l as getRampStopLabel,a as isWidthAndHeight};
5
+ import{substitute as t}from"../../../../intl.js";import{getTitle as e,isRendererTitle as r,getStretchStopLabel as i}from"../../support/styleUtils.js";function l(t,e,r){switch(e){case"heatmap-ramp":return r[t.label]||t.label;case"stretch-ramp":return i(t,r);default:return t.label}}function a(t,i){if(!t.title||"string"==typeof t.title)return t.title;const l="color-ramp"===t.type||"opacity-ramp"===t.type,a=t.title,n=e(i,a,l);return r(a,l)&&a.title?`${a.title} (${n})`:n}function n(t){return!(!t||"object"!=typeof t)}function o(r,i){const l=e(r,i,!1),a=l?r.previewTemplateAriaLabel:r.previewAriaLabel;return t(a,{label:l})}export{a as getLegendElementTitle,o as getPreviewAriaLabelIntl,l as getRampStopLabel,n as isWidthAndHeight};