@arcgis/core 4.32.0-next.20250211 → 4.32.0-next.20250213

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 (251) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/04f9fb33fb2e33712290.js +1 -0
  3. package/assets/esri/core/workers/chunks/0b8bf1966653c326e95a.js +1 -0
  4. package/assets/esri/core/workers/chunks/{a4a9b4f792d47566fbf4.js → 17213c3fc63f580e5b73.js} +1 -1
  5. package/assets/esri/core/workers/chunks/1a6b6d43eda7986d2349.js +1 -0
  6. package/assets/esri/core/workers/chunks/{12d6baeffd55a98a7c75.js → 1bf646c9fc352f98d1ca.js} +1 -1
  7. package/assets/esri/core/workers/chunks/1c357cdb067e28aff3f0.js +1 -0
  8. package/assets/esri/core/workers/chunks/{9a237b396518b1c67f19.js → 24964548c6a3e2eb527d.js} +1 -1
  9. package/assets/esri/core/workers/chunks/272662e4e28341419b4f.js +1 -0
  10. package/assets/esri/core/workers/chunks/31f0dd191602b93c02c2.js +1 -0
  11. package/assets/esri/core/workers/chunks/{74844334b3a2100220fc.js → 37cfd102b6ab5b959f9d.js} +1 -1
  12. package/assets/esri/core/workers/chunks/3835c2884c55e73dc202.js +1 -0
  13. package/assets/esri/core/workers/chunks/{f429d95eb986f3d215f3.js → 391c200274bbeb92404c.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{8ddd4e2e50b8206564a7.js → 3ebdd0701e77bb28c75d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{c0af54cc5938176ce764.js → 3fe7be535affae31de7e.js} +1 -1
  16. package/assets/esri/core/workers/chunks/401b731c0601f4d84ead.js +1 -0
  17. package/assets/esri/core/workers/chunks/4565cfc85f60960e3ea1.js +1 -0
  18. package/assets/esri/core/workers/chunks/4848a3e31632d15dc4ce.js +1 -0
  19. package/assets/esri/core/workers/chunks/4a4739cda8aac510004b.js +1 -0
  20. package/assets/esri/core/workers/chunks/{d0656e9d30eb3a66a8db.js → 4be39bc2d2edd94bdb75.js} +1 -1
  21. package/assets/esri/core/workers/chunks/5328b2de0d1ac2536ecf.js +1 -0
  22. package/assets/esri/core/workers/chunks/{62a1d60ad4bf6469c4dd.js → 584216b52413cf85fecc.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{76794184ba8c2e66745e.js → 629f4621ba6ffdcaa2f9.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{8191dd3d7451b2e7b95e.js → 637e996209e0d241fbf7.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{77bfd4f819096cb754ae.js → 6e92569a4a82592b95dc.js} +1 -1
  26. package/assets/esri/core/workers/chunks/6f007703662e714b2f0a.js +1 -0
  27. package/assets/esri/core/workers/chunks/{50ae86c23efe709f41cc.js → 6fa1f1e431aae1794ce3.js} +1 -1
  28. package/assets/esri/core/workers/chunks/744bdf2bb0cc38e6a7b1.js +1 -0
  29. package/assets/esri/core/workers/chunks/802a390c67f4cdf3d8d9.js +1 -0
  30. package/assets/esri/core/workers/chunks/82facb23dfaba2819bc7.js +1 -0
  31. package/assets/esri/core/workers/chunks/{c26ffbff1115e76bcb0f.js → 86f3a004addc087ad6c6.js} +1 -1
  32. package/assets/esri/core/workers/chunks/8722d05ae9b0aa5162a4.js +1 -0
  33. package/assets/esri/core/workers/chunks/8de4280080296adb1757.js +1 -0
  34. package/assets/esri/core/workers/chunks/9306bfe7ab58e71b75ea.js +1 -0
  35. package/assets/esri/core/workers/chunks/95047f145ebda65c3d8e.js +1 -0
  36. package/assets/esri/core/workers/chunks/{1f443b99653708470f31.js → 96d7f47ea8fbf345101c.js} +1 -1
  37. package/assets/esri/core/workers/chunks/a01213d446be33d203e3.js +1 -0
  38. package/assets/esri/core/workers/chunks/a490a988896b0b02f96b.js +1 -0
  39. package/assets/esri/core/workers/chunks/a60db83cabdf689b923b.js +1 -0
  40. package/assets/esri/core/workers/chunks/{df3d1a8d3f11d52eb30d.js → afdbdc1569b56489c14d.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{89e3f7880abd014a62c0.js → b42d26123784997c66e8.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{b9d9a1dc3c5d799e2685.js → bd3487b587851b20ff2a.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{94490937dca566fe2640.js → bd5e0a11d2a688a65d23.js} +1 -1
  44. package/assets/esri/core/workers/chunks/c3806be4a760735e6082.js +1 -0
  45. package/assets/esri/core/workers/chunks/c9aed9a43d9935e7c768.js +314 -0
  46. package/assets/esri/core/workers/chunks/{8d8f5f08d730270e1165.js → cb9a27176bd5de2c34ca.js} +1 -1
  47. package/assets/esri/core/workers/chunks/ceb648604a4b6d316f4b.js +1 -0
  48. package/assets/esri/core/workers/chunks/d31e25a63f967fedb149.js +1 -0
  49. package/assets/esri/core/workers/chunks/{da1157e288dbc6ba842a.js → d3d0c7624eb139994213.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{f198f4ba7d3d52882d98.js → de8044dfab4ad253b126.js} +1 -1
  51. package/assets/esri/core/workers/chunks/ecd66dbc4ff446c64984.js +1 -0
  52. package/assets/esri/core/workers/chunks/f78b63620386b2676f1f.js +1 -0
  53. package/assets/esri/core/workers/chunks/{1cbeac3301b6943bb28a.js → fc07d47d44c04f123650.js} +1 -1
  54. package/assets/esri/core/workers/chunks/fca056536e46aeb98e98.js +1 -0
  55. package/assets/esri/themes/base/_core.scss +4 -0
  56. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +0 -5
  57. package/assets/esri/themes/base/widgets/_Directions.scss +30 -9
  58. package/assets/esri/themes/base/widgets/_Editor.scss +1 -0
  59. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +80 -0
  60. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationList.scss +14 -0
  61. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +41 -0
  62. package/assets/esri/themes/base/widgets/_FilterBuilder.scss +1 -6
  63. package/assets/esri/themes/dark/main.css +1 -1
  64. package/assets/esri/themes/light/main.css +1 -1
  65. package/assets/esri/themes/light/view.css +1 -1
  66. package/chunks/Bufferer-B-V7yYm-.js +5 -0
  67. package/chunks/ComponentShader.glsl.js +6 -6
  68. package/chunks/Distance2DCalculator-Coa0qAFt.js +5 -0
  69. package/chunks/Envelope.js +1 -1
  70. package/chunks/{GeodeticDistanceCalculator-BsWHOuqE.js → GeodeticDistanceCalculator-D4iQ-_NX.js} +1 -1
  71. package/chunks/Geometry.js +1 -1
  72. package/chunks/OperatorClip.js +1 -1
  73. package/chunks/OperatorCut.js +1 -1
  74. package/chunks/OperatorGeneralize.js +1 -1
  75. package/chunks/OperatorGeodesicBuffer.js +1 -1
  76. package/chunks/OperatorGeodeticArea.js +1 -1
  77. package/chunks/OperatorGeodeticDistance.js +1 -1
  78. package/chunks/OperatorProximityGeodesic.js +1 -1
  79. package/chunks/OperatorShapePreservingLength.js +1 -1
  80. package/chunks/OperatorShapePreservingProject.js +1 -1
  81. package/chunks/Point2D.js +1 -1
  82. package/chunks/ProjectionTransformation.js +1 -1
  83. package/chunks/QuadraticBezier.js +1 -1
  84. package/chunks/ShadowHighlight.glsl.js +2 -4
  85. package/chunks/distanceOperator.js +1 -1
  86. package/core/deprecate.js +1 -1
  87. package/editing/templateUtils.js +1 -1
  88. package/geometry/operators/extendOperator.js +1 -1
  89. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  90. package/geometry/operators/gx/operatorBuffer.js +1 -1
  91. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  92. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  93. package/geometry/operators/gx/operatorOffset.js +1 -1
  94. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  95. package/geometry/operators/isNearOperator.js +1 -1
  96. package/geometry/operators/projectOperator.js +1 -1
  97. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  98. package/geometry/operators/support/jsonConverter.js +1 -1
  99. package/interfaces.d.ts +616 -122
  100. package/layers/FeatureLayer.js +1 -1
  101. package/layers/GeoJSONLayer.js +1 -1
  102. package/layers/OGCFeatureLayer.js +1 -1
  103. package/layers/RouteLayer.js +1 -1
  104. package/layers/SubtypeGroupLayer.js +1 -1
  105. package/layers/WFSLayer.js +1 -1
  106. package/layers/graphics/data/queryUtils.js +1 -1
  107. package/layers/mixins/TrackableLayer.d.ts +4 -0
  108. package/layers/support/SubtypeSublayer.js +1 -1
  109. package/layers/support/TitleCreator.js +5 -0
  110. package/layers/support/TrackInfo.d.ts +4 -0
  111. package/layers/support/TrackPartInfo.d.ts +4 -0
  112. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  113. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  114. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  115. package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
  116. package/networks/Network.js +1 -1
  117. package/networks/RulesTable.js +1 -1
  118. package/networks/UtilityNetwork.js +1 -1
  119. package/networks/support/networkFieldUtils.js +5 -0
  120. package/networks/support/typeUtils.js +1 -1
  121. package/package.json +1 -1
  122. package/rest/query/executeForIds.js +1 -1
  123. package/rest/support/BinParametersBase.js +1 -1
  124. package/support/revision.js +1 -1
  125. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  126. package/symbols/cim/rasterizingUtils.js +1 -1
  127. package/symbols/support/previewCIMSymbol.js +1 -1
  128. package/symbols/support/previewSymbol2D.js +1 -1
  129. package/symbols/support/symbolUtils.js +1 -1
  130. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  131. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  132. package/views/2d/layers/RouteLayerView2D.js +1 -1
  133. package/views/2d/layers/features/FeatureContainer.js +1 -1
  134. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  135. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  136. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  137. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  138. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  139. package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
  140. package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
  141. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  142. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  143. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  144. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  145. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  146. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  147. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  148. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  149. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  150. package/views/SceneView.js +1 -1
  151. package/views/View.js +1 -1
  152. package/views/layers/FeatureLayerView.js +1 -1
  153. package/views/support/RequiredFieldsOptions.js +5 -0
  154. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  155. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  156. package/widgets/AreaMeasurement2D.js +1 -1
  157. package/widgets/BasemapGallery.js +1 -1
  158. package/widgets/BasemapToggle.js +1 -1
  159. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  160. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  161. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  162. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  163. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  164. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  165. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  166. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  167. package/widgets/BatchAttributeForm.js +1 -1
  168. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  169. package/widgets/Compass/CompassViewModel.js +1 -1
  170. package/widgets/DirectionalPad.js +1 -1
  171. package/widgets/Directions/DirectionsViewModel.js +1 -1
  172. package/widgets/Directions.js +1 -1
  173. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  174. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  175. package/widgets/DistanceMeasurement2D.js +1 -1
  176. package/widgets/Editor/AddAssociationWorkflow.js +5 -0
  177. package/widgets/Editor/AddAssociationWorkflowData.js +5 -0
  178. package/widgets/Editor/EditorViewModel.js +1 -1
  179. package/widgets/Editor/UpdateWorkflow.js +1 -1
  180. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  181. package/widgets/Editor.js +1 -1
  182. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  183. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  184. package/widgets/Feature/FeatureViewModel.js +1 -1
  185. package/widgets/Feature/support/featureUtils.js +1 -1
  186. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  187. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +5 -0
  188. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +5 -0
  189. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  190. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +5 -0
  191. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  192. package/widgets/FeatureForm.js +1 -1
  193. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  194. package/widgets/Fullscreen.js +1 -1
  195. package/widgets/Home.js +1 -1
  196. package/widgets/Legend/LegendViewModel.js +1 -1
  197. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  198. package/widgets/Legend.js +1 -1
  199. package/widgets/Locate.js +1 -1
  200. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  201. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  202. package/widgets/OrientedImageryViewer/symbols.js +1 -1
  203. package/widgets/ScaleBar.js +1 -1
  204. package/widgets/Swipe.js +1 -1
  205. package/widgets/Track.js +1 -1
  206. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +2 -2
  207. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  208. package/widgets/UtilityNetworkTrace.js +1 -1
  209. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
  210. package/widgets/support/FilterBuilder.js +1 -1
  211. package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
  212. package/widgets/support/FilterCondition.js +1 -1
  213. package/widgets/support/GoTo.js +1 -1
  214. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +5 -0
  215. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  216. package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
  217. package/widgets/support/goToUtils.js +5 -0
  218. package/assets/esri/core/workers/chunks/01c3507d78398baaf61b.js +0 -1
  219. package/assets/esri/core/workers/chunks/0ac1399d252f2df670b6.js +0 -1
  220. package/assets/esri/core/workers/chunks/177d4c2c10ef7369006f.js +0 -1
  221. package/assets/esri/core/workers/chunks/26a2bd432e7a1b3870c3.js +0 -1
  222. package/assets/esri/core/workers/chunks/3d5442055e01493efcb2.js +0 -1
  223. package/assets/esri/core/workers/chunks/44abd2cd17aae3299ede.js +0 -1
  224. package/assets/esri/core/workers/chunks/594d923400fd74881833.js +0 -1
  225. package/assets/esri/core/workers/chunks/61795bde00f2e16d04f1.js +0 -1
  226. package/assets/esri/core/workers/chunks/7058001bf66f9f3d5d45.js +0 -1
  227. package/assets/esri/core/workers/chunks/746c964cf07e4306f21f.js +0 -1
  228. package/assets/esri/core/workers/chunks/74f42e46bf551aab14dc.js +0 -1
  229. package/assets/esri/core/workers/chunks/7bf08823f861628144a1.js +0 -1
  230. package/assets/esri/core/workers/chunks/8c32cee395da0a7b9a8e.js +0 -1
  231. package/assets/esri/core/workers/chunks/91384398f01485631f70.js +0 -1
  232. package/assets/esri/core/workers/chunks/946a9890f3621d1dfbc5.js +0 -1
  233. package/assets/esri/core/workers/chunks/9fb45c006d790273e8c1.js +0 -1
  234. package/assets/esri/core/workers/chunks/a2409d4921c02614169a.js +0 -1
  235. package/assets/esri/core/workers/chunks/a6be1105a5e1f9597c5e.js +0 -1
  236. package/assets/esri/core/workers/chunks/af917f69d9c6e9937263.js +0 -1
  237. package/assets/esri/core/workers/chunks/cc75bbfd779f409943a3.js +0 -1
  238. package/assets/esri/core/workers/chunks/d0e9874eb304010305c6.js +0 -1
  239. package/assets/esri/core/workers/chunks/d27a199fd8e2ade69254.js +0 -1
  240. package/assets/esri/core/workers/chunks/d339dee99c4820b63f39.js +0 -1
  241. package/assets/esri/core/workers/chunks/d35efcbe439500bf18bc.js +0 -1
  242. package/assets/esri/core/workers/chunks/d44d210e94406509e980.js +0 -314
  243. package/assets/esri/core/workers/chunks/e5e3b6d00d27b5bb354f.js +0 -1
  244. package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +0 -1
  245. package/assets/esri/core/workers/chunks/f29715459ecd46180829.js +0 -1
  246. package/assets/esri/core/workers/chunks/f9070edd8e0b2a57af79.js +0 -1
  247. package/chunks/Bufferer-DjC-SKTJ.js +0 -5
  248. package/chunks/Distance2DCalculator-8-JrFGHH.js +0 -5
  249. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationSettings.js +0 -5
  250. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +0 -4
  251. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{id as t}from"../../kernel.js";import r from"../../core/Collection.js";import{deprecatedFunction as s}from"../../core/deprecate.js";import i from"../../core/Error.js";import a from"../../core/Evented.js";import l from"../../core/Logger.js";import{whenOnce as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{isPoint as h,isMultipoint as u}from"../../geometry/support/jsonUtils.js";import{fetchMessageBundle as p}from"../../intl/messages.js";import d from"../../layers/FeatureLayer.js";import g from"../../layers/GraphicsLayer.js";import y from"../../layers/support/CodedValueDomain.js";import{isFeatureLayer as m,getOwningPortalUrl as f}from"../../layers/support/layerUtils.js";import w from"../../networks/UtilityNetwork.js";import{getFeaturesFromLayers as _}from"../../networks/support/utils.js";import b from"../../portal/Portal.js";import{hasUserTypeExtension as A}from"../../portal/support/utils.js";import{trace as v}from"../../rest/networks/trace.js";import k from"../../rest/networks/support/TraceLocation.js";import I from"../../rest/networks/support/TraceParameters.js";import{addUniqueLayer as G}from"../../views/draw/support/layerUtils.js";import{GeometryHandler as R}from"./support/GeometryHandler.js";import{GraphicHandler as F,barrierColor as L,startingPointColor as T}from"./support/GraphicHandler.js";import{ResultAreaHandler as S}from"./support/ResultAreaHandler.js";import{UtilityHelper as N}from"./support/UtilityHelper.js";const H=()=>p("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace"),P=()=>p("esri/core/t9n/Units"),U=`utility-network-trace-flags-${Date.now()}`,B=`utility-network-trace-results-${Date.now()}`,C=`utility-network-trace-sketch-${Date.now()}`;function V(e){return e instanceof y}function E(e){return"feature"===e.layer.type||"subtype-group"===e.layer.type}function j(e){return"layer"in e}function D(e){return void 0!==e.layerViews}function O(e){return"graphics"===e.type}function M(e){return"feature"===e.type||"subtype-group"===e.type||"group"===e.type}async function x(e){const t=new d({url:e.networkSystemLayers.dirtyAreasLayerUrl});await t.load();const r=t.version;if(Number(r)<=11.1){const t=await f(e.layerUrl),r=new b({url:t});await r.load();const s=r?.user?.username;return!!s&&A(r,s,"utilityNetwork")}return!0}let q=class extends a.EventedAccessor{constructor(e){super(e),this._activeProgress=!1,this._clickHandler=null,this._flags=[],this._flagId=0,this._geometryHandler=null,this._highlightHandler=[],this._resultAreaHandler=null,this._sketchViewModel=null,this._traceTimeout=6e5,this._utilityHelper=new N,this._validUNLayers=[],this._watchHandler=null,this.traces=[],this.graphicHandler=null,this.defaultGraphicColor={color:[255,255,0,.6],haloOpacity:.9,fillOpacity:.2,hex:"#FFFF00"},this.enableResultArea=!1,this.flags=[],this.gdbVersion="sde.DEFAULT",this.messages=null,this.messagesUnits=null,this.defaultResultAreaProperties={type:"convexhull",distance:10,unit:"meters",areaUnit:"square-meters",color:{color:[255,165,0,.5],haloOpacity:.9,fillOpacity:.2,hex:"#ffa500"},show:!1},this.selectedTraces=[],this.selectOnComplete=!0,this.showGraphicsOnComplete=!0,this.showSelectionAttributes=!0,this.traceResults=[],this.utilityNetwork=null}initialize(){s(l.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this._geometryHandler=new R,this.graphicHandler=new F,this._resultAreaHandler=new S;(async()=>{const[e,t]=await Promise.all([H(),P()]);this.set({messages:e,messagesUnits:t})})()}destroy(){this.view=null}get resultAreaProperties(){return this.defaultResultAreaProperties}set resultAreaProperties(e){this._set("resultAreaProperties",{...this.defaultResultAreaProperties,...e}),this.graphicHandler.addCustomColor(this.resultAreaProperties.color),this.traceResults.forEach((t=>{const r=t.resultArea?.show;t.resultArea={...this.defaultResultAreaProperties,...e},this.removeResultAreaFromMap(t),this.enableResultArea&&this.createResultAreaGraphic(t).then((s=>{if(s){t.resultAreaGraphic=s;const i=e?.show??r;t.resultArea&&(t.resultArea.show=i),i&&this.addResultAreaToMap(t,s)}}))}))}get state(){return this.view?.ready?"ready":"loading"}get view(){return this._get("view")}set view(e){e&&"2d"!==e.type&&l.getLogger(this).error(new i("view:invalid-view","SceneView is not supported",{view:e})),this._set("view",e),this.utilityNetwork&&this.reset(),this.utilityNetwork=null,this.loadUtilityNetwork().then((e=>{e&&this.selectTracesOnLoad()}))}addFlagByHit(e,t){const r=e=>{this.view?.popup&&(this.view.popupEnabled=e)};return new Promise(((s,i)=>{r(!1),this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",(a=>{if("complete"===a.state){const l=this._getGraphicLayer(C);l&&a.graphic&&l.remove(a.graphic),this.queryFlagByHitTest(a,e,t).then((i=>{r(!0),this._clickHandler?.remove(),this.emit("add-flag-complete",{type:e,symbol:t}),s(i)})).catch((s=>{r(!0),this._clickHandler?.remove(),this.emit("add-flag-error",{type:e,symbol:t}),i(s)}))}})),this._sketchViewModel.create("point"),this.emit("add-flag",{type:e})}))}addNonspatialTraceLocation(e,t){const r=this._getDisplayField(e),s=this.utilityNetwork?.getTerminalConfiguration(e),i={terminalId:null,isFilterBarrier:!1,allTerminals:s,selectedTerminals:[s?s.terminals[0].id||null:1],displayValue:r};e.attributes={...e.attributes,...i};const a=e.attributes.hasOwnProperty("GLOBALID")?e.attributes.GLOBALID:e.attributes.globalid;if(!this._flags.some((e=>e.globalId===a&&e.type===t))){const r=this._createFlagProperty(e,t,null);this._flags.push(r),this.emit("add-flag-complete",{type:t})}this.emit("add-flag",{type:t})}async addFlagsOnLoad(){if(this._flags.length>0)return[];await o((()=>null!=this.view&&!this.view.updating));return(await Promise.all(this.flags.map((async e=>{if(!e.mapPoint)return null;const{type:t}=e,r=e.mapPoint.clone(),s="barrier"===t?L:T,i={graphic:this.graphicHandler.makeGraphic(r,s),state:"complete",tool:"point",toolEventInfo:null,type:"create"};try{return await this.queryFlagByHitTest(i,e.type,null),this.emit("add-flag-complete",{type:t}),null}catch(a){return this.emit("add-flag-error",{type:t}),"barrier"===t?"barrier":"starting-point"}})))).filter((e=>!e))}async addResultAreaToMap(e,t){if(this.view)if(e.resultArea.show=!0,t)this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t});else if(e.results){const t=await this.createResultAreaGraphic(e);t&&(e.resultAreaGraphic=t,this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t}))}}async addResultGraphicToView(e,t){const{view:r}=this,{results:s}=e;if(r&&s&&this.utilityNetwork)for(const i in s.aggregatedGeometry)if("line,multipoint,polygon".includes(i)){const a=i,l=s.aggregatedGeometry[a];if(null!=l){l.spatialReference=this.utilityNetwork.spatialReference,e.graphicEnabled=!0;const s=await this._geometryHandler.projectGeometry(l,r.spatialReference),i={globalid:e.trace.globalId};if(null!==s){const e=this.graphicHandler.makeGraphic(s,t.color,i,r.spatialReference);this._getGraphicLayer(B)?.add(e)}}}}addTerminal(e,t){const r=[...this._flags];r.forEach((r=>{r.globalId===t.globalId&&(t.selectedTerminals?.includes(parseInt(e,10))||r.selectedTerminals?.push(parseInt(e,10)))})),this._flags=r}async callTrace(){const e=this.traces.filter((e=>e.selected));return!!e.length&&(this.traceResults.length>0&&this.traceResults.forEach((e=>{this.removeResultGraphicFromView(e)})),this.traceResults=[],this.removeSelection(),await Promise.all(e.map((async(e,t)=>{const r=e,s=new I({gdbVersion:this.utilityNetwork?.gdbVersion,moment:this.utilityNetwork?.historicMoment,namedTraceConfigurationGlobalId:r.globalId,outSpatialReference:null,resultTypes:null,traceType:r.traceType,traceLocations:this._flags,traceConfiguration:null});await this.executeTrace(r,this.utilityNetwork?.networkServiceUrl,s).then((e=>{if(e.hasOwnProperty("results")){const r={...e};if(null!==r.results){r.resultArea={...this.resultAreaProperties};const e=[...r.results.elements];r.results.elements.length=0;const s=new Map;for(const t of e)s.has(t.globalId)||(s.set(t.globalId,!0),r.results.elements.push(t));const i=[...this.traceResults];i.splice(t,0,r),this.traceResults=i,null!==r.results&&(this.selectOnComplete&&this.mergeSelection(!0,r.trace),this.showGraphicsOnComplete&&this.addResultGraphicToView(r,r.graphicColor),this.enableResultArea&&this.createResultAreaGraphic(r).then((e=>{e&&(r.resultAreaGraphic=e,r.resultArea?.show&&this.addResultAreaToMap(r,r.resultAreaGraphic))})))}else{const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}this._activeProgress=!1}else{this._activeProgress=!1;const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}})).catch((e=>{throw this._activeProgress=!1,e}))}))),!0)}changeResultAreaColor(e,t){if(!e.resultArea)return;e.resultArea.color=t;const r=this._resultAreaHandler?.changeResultAreaColor(e.trace.globalId,t,this.view.map);e.resultAreaGraphic&&(e.resultAreaGraphic.symbol=r)}changeResultGraphicColor(e,t){const r=[...this.traceResults];r.length>0&&r.forEach((r=>{r.trace.globalId===t.trace.globalId&&(r.graphicColor=e,r.graphicEnabled=!0)})),this.traceResults=r,this.removeResultGraphicFromView(t),this.addResultGraphicToView(t,e)}changeFlagSymbol(e,t){this._flags.length>0&&this._flags.forEach((r=>{r.type===e&&t&&r.mapGraphic&&(r.mapGraphic.symbol=t)}))}checkCanTrace(){const e={status:!0,issues:[]},t=this.traces.filter((e=>e.selected));t.length||(e.status=!1,e.issues.push("noTracesSelected"));this._flags.some((e=>"starting-point"===e.type))||(e.status=!1,e.issues.push("noStartingPoints"));return this._flags.filter((e=>null!==e.allTerminals)).some((e=>!e.selectedTerminals.length))&&(e.status=!1,e.issues.push("noTerminalSelected")),e}checkSelectionExist(){return this._highlightHandler.some((e=>e))}clearResult(e){if(!this.view)return;let t=this.traceResults;if(t.length>0){const r=t.filter((t=>t.trace.globalId===e.globalId));r.length>0&&(this.removeResultGraphicFromView(r[0]),this.removeResultAreaFromMap(r[0])),t=t.filter((t=>t.trace.globalId!==e.globalId))}this.traceResults=t,0===t.length?(this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]})):this.mergeSelection(!1,e)}createResultAreaGeometries(e,t,r){if(!this.view||!this.resultAreaProperties)return;let s;if(s="convexhull"===this.resultAreaProperties?.type?1===t.length&&(h(t[0])||u(t[0])&&1===t[0].points.length)?this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0):this._resultAreaHandler?.createConvexHull(t,e.resultArea?.distance,e.resultArea?.unit):this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0),!s)return;if(Array.isArray(s)){for(const t of s){const r=this.getResultAreaAttributes(e,t),s=this._resultAreaHandler?.createResultAreaGraphic(t,r,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color);if(s)return s}return}const i=this.getResultAreaAttributes(e,s);return this._resultAreaHandler?.createResultAreaGraphic(s,i,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color)}async createResultAreaGraphic(e){if(e.results){const t=await this._createResultAreaInputGeometry(e.results);if(t.length>0){const r=Array(t.length).fill(e.resultArea?.distance),s=this.createResultAreaGeometries(e,t,r);return this.emit("create-result-area",{graphic:s}),s}}}executeTrace(e,t,r){const s=this._processFlags(r.traceLocations);return r.traceLocations=s,v(t,r,{timeout:this._traceTimeout}).then((t=>({trace:e,results:t,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:"success",date:new Date}))).catch((t=>({trace:e,results:null,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:t.message,date:new Date})))}getResultAreaAttributes(e,r){const{messages:s}=this,i=[],a=[];this._flags.forEach((e=>{const t=e.displayValue?.field+":"+e.displayValue?.value+";"+s.attributeStrings.globalid+":"+e.globalId+";"+s.attributeStrings.terminalid+":"+e.terminalId+";"+s.attributeStrings.x+":"+e.mapPoint?.x+";"+s.attributeStrings.y+":"+e.mapPoint?.y;"starting-point"===e.type?i.push(t):a.push(t)}));const l=this.utilityNetwork?this.utilityNetwork.gdbVersion:this.gdbVersion;return{traceId:e.trace.globalId,traceName:e.trace.title,traceDescription:e.trace.description??"",startingPoints:i.toString(),barriers:a.toString(),version:l??void 0,username:t.credentials[0].userId,date:e.date,elementCount:e.results?.elements.length,functionResult:JSON.stringify(e.results?.globalFunctionResults),areaStatistic:r?this._geometryHandler.calculateArea(r,e.resultArea?.areaUnit):0}}getValidSources(){let e=[];const t=this.utilityNetwork?.dataElement?.domainNetworks??[];for(const r of t)e=e.concat(r.junctionSources),e=e.concat(r.edgeSources);return e}groupResultsByNetworkSource(e){return 0===e.length?[]:this._groupBy(e,"networkSourceId")}async loadUtilityNetwork(){const{view:e}=this;if(!e)return null;if(await e.when(),this.utilityNetwork){if(this.utilityNetwork.loaded||await this.utilityNetwork.load(),this.utilityNetwork instanceof w){try{const t=e.map;await t.loadAll(),this._loadUNSupportItems()}catch(s){this._loadUNSupportItems()}return this.utilityNetwork}return null}const t=e.map,r=t.utilityNetworks?.at(0);if(r){if(await r.load(),this.utilityNetwork=r,!await x(r))throw new i("utility-network:no-user-type-extension","User type extension not found");try{await t.loadAll(),this._loadUNSupportItems()}catch(s){}finally{this._loadUNSupportItems()}return r}return null}manageFilterBarrier(e,t){const r=[...this._flags];r.forEach((r=>{r.globalId===t.globalId&&"barrier"===t.type&&r.id===t.id&&(r.isFilterBarrier=e)})),this._flags=r}mergeSelection(e,t){let r=[];const s=[...this.traceResults],i=t.globalId;s.forEach((t=>{i===t.trace.globalId&&(t.selectionEnabled=e),t.selectionEnabled&&null!==t.results?.elements&&(r=[...r,...t.results?.elements??[]])})),this.selectResults([...new Set(r)])}async queryFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return null;const s=this.utilityNetwork.getObjectIdsFromElements(e),i={layerUrl:s[0].layerUrl,objectIds:s[0].objectIds,outFields:["*"]},a=t.map?.allTables.toArray().filter((e=>e?.parsedUrl?.path===s[0].layerUrl)).filter(m)??[];this._getUniqueMapLayerViews(t).filter((({layer:e})=>e?.parsedUrl?.path===s[0].layerUrl)).forEach((({layer:e})=>{"feature"!==e.type&&"subtype-group"!==e.type||a.push(e)}));const l=(await Promise.all(a.map((async e=>{const s={layers:new r([e]),layerInfos:[i],returnGeometry:!0,outSpatialReference:t.spatialReference},[a]=await _(s,!1);return a})))).filter((({featureSet:e})=>e.features.length>0));return l.length>0?l:null}queryFlagByHitTest(e,t,r){return this._lookupFlagByHit(e).then((e=>{const{view:s}=this;if(!s)return!1;if(e.length>0){const s=[...this._flags],i=r;return e.forEach((e=>{const r=e.graphic,a=r.attributes.hasOwnProperty("GLOBALID")?r.attributes.GLOBALID:r.attributes.globalid;if(s.filter((e=>e.globalId===a)).length<=0){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(U)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}else if(null!==r.attributes.percentAlong){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(U)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}})),this._flags=s,!0}return!1}))}removeResultGraphicFromView(e){const{view:t}=this;if(!t)return;const r=this._getGraphicLayer(B)?.graphics;e.graphicEnabled=!1;const s=r?.filter((t=>t.attributes[t.attributes.hasOwnProperty("GLOBALID")?"GLOBALID":"globalid"]===e.trace.globalId));s?.forEach((e=>{this._getGraphicLayer(B)?.remove(e)}))}removeFlag(e){const t=this._flags.filter((t=>{if(t.id!==e.id)return t}));this._removeGraphic(e),this._flags=t}removeAllResultAreaGraphics(){this._resultAreaHandler?.removeAllResultAreaGraphics(this.view.map)}removeResultAreaFromMap(e){if(e.resultArea){e.resultArea.show=!1;const t=this._resultAreaHandler?.removeResultArea(e.trace.globalId,this.view?.map);t&&this.emit("remove-result-area",{graphic:t})}}removeSelection(){this._highlightHandler.forEach((e=>{e&&e.remove()})),this._highlightHandler=[]}removeTerminal(e,t){const r=[...this._flags];r.forEach((r=>{if(r.globalId===t.globalId&&t.selectedTerminals?.includes(parseInt(e,10))){const s=t.selectedTerminals.indexOf(parseInt(e,10));r.selectedTerminals?.splice(s,1)}})),this._flags=r}removeFlagsOnLoadWatcher(){this._watchHandler&&null!==this._watchHandler&&this._watchHandler.remove()}removeClickHandler(){this._clickHandler&&(this._sketchViewModel.cancel(),this._clickHandler.remove())}reset(){this._flags=[],this.traceResults=[];const e=[...this.traces];e.forEach((e=>{e.selected=!1})),this.traces=e,this.view&&(this._getGraphicLayer(C)?.removeAll(),this._getGraphicLayer(U)?.removeAll(),this._getGraphicLayer(B)?.removeAll(),this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]}),this.emit("reset"))}selectFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return;const r=this.utilityNetwork.getObjectIdsFromElements(e);this._getUniqueMapLayerViews(t).forEach((e=>{j(e)&&e.layer?.parsedUrl?.path===r[0].layerUrl&&E(e)&&this._highlightHandler.push(e.highlight(r[0].objectIds))}))}selectResults(e){if(e.length>0){this.removeSelection();const t=this.groupResultsByNetworkSource(e),r=[];for(const e in t)this.selectFeaturesById(t[e]),r.push(this.queryFeaturesById(t[e]));Promise.all(r).then((e=>{this.emit("select-features",{resultSet:e})}))}else this.removeSelection(),this.emit("clear-selection",{resultSet:[]})}selectTraces(e,t){const r=[...this.traces];r.forEach((r=>{t===r.globalId&&(r.selected=e)})),this.traces=r}selectTracesOnLoad(){this.utilityNetwork?.hasOwnProperty("sharedNamedTraceConfigurations")&&(this.traces=[...this.utilityNetwork.sharedNamedTraceConfigurations],this.traces.forEach((e=>{e.selected=!1,this.selectedTraces.includes(e.globalId)&&(e.selected=!0)})))}zoomToAsset(e){this.view?.goTo(e).catch((e=>console.error(e)))}async _createResultAreaInputGeometry(e){if(null!=e.aggregatedGeometry)return this._geometryHandler.mergeAggregatedToGeometries(e.aggregatedGeometry);const t=this.groupResultsByNetworkSource(e.elements),r=[];for(const s in t)r.push(this.queryFeaturesById(t[s]));try{const e=await Promise.all(r),t=[];for(const r of e)if(r)for(const e of r)for(const r of e.featureSet.features)r.geometry&&t.push(r.geometry);return t}catch{return[]}}_loadUNSupportItems(){if(!this.utilityNetwork)return;const{map:e}=this.view,{messages:t}=this;this._populateOutfields(),this._createGraphicLayer(C),this._createGraphicLayer(U),this._createGraphicLayer(B),this._resultAreaHandler?.createGraphicLayer(e,t?.alertsStrings.genericResultHeader),this._validUNLayers=this._utilityHelper.getValidUtilityNetworkLayers(e,this.utilityNetwork),this._sketchViewModel=this.graphicHandler.initializeSketch(this.view,this._getGraphicLayer(C),this._validUNLayers)}_getUniqueMapLayerViews(e){const t=[],r=e.layerViews.filter((({layer:{type:e}})=>"feature"===e||"group"===e||"subtype-group"===e)).toArray(),s=e=>{for(const r of e.layerViews)D(r)?s(r):t.push(r)};return r.forEach((e=>{switch(e.layer.type){case"group":D(e)&&s(e);break;case"subtype-group":t.push(e);break;default:t.some((t=>t.layer.id===e.layer.id))||t.push(e)}})),t}_processFlags(e){const t=[];return e.forEach((e=>{if(null!==e.selectedTerminals&&e.selectedTerminals.length>0)e.selectedTerminals.forEach((r=>{const s=new k({globalId:e.globalId,percentAlong:e.percentAlong,terminalId:r,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(s)}));else{const r=new k({globalId:e.globalId,percentAlong:e.percentAlong,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(r)}})),t}_getDisplayField(e){return"subtype-sublayer"===e?.layer?.type?this._getDisplayFieldBySublayer(e):this._getDisplayFieldByFeatureLayer(e)}_getDisplayFieldBySublayer(e){let t="",r="";const s=e.layer;t=this._checkParentForData(s,"displayField");for(const i in e.attributes){const a=i.toLowerCase();a===t?.toLowerCase()?(r=e.attributes[i],"assetgroup"===a||"assettype"===a?r=this._checkSubtype(s,s.subtypeCode):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))}return{field:t,value:r.toString()}}_getDisplayFieldByFeatureLayer(e){const t=e.layer;let r=t.displayField,s="";for(const i in e.attributes){const a=i.toLowerCase();if(a===r?.toLowerCase())if(s=e.attributes[i],"assetgroup"===a||"assettype"===a){let a=e.attributes[t.typeIdField.toUpperCase()];a||(a=e.attributes[t.typeIdField.toLowerCase()]),r=t.typeIdField,s=this._checkSubtype(t,a),""===r&&(t.templates&&t.templates.length>0?(r=t.templates[0]?.name,s=t.templates[0]?.name):(r=t.displayField,s=e.attributes[i]))}else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t));else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t))}return{field:r,value:s?s.toString():""}}_checkSubtype(e,t){let r=t;if("subtype-sublayer"===e.type){const s=this._checkParentForData(e,"subtypes");s?.length>0&&s.forEach((e=>{e.code===t&&(r=e.name)}))}else if(null!=e.types&&e.types.length>0){const s=e.types.filter((e=>e.id===t));s.length>0&&(r=s[0].name)}return r}_checkDomain(e,t,r){let s=r;const i=e.filter((e=>e.name.toLowerCase()===t.toLowerCase()));if(i.length>0&&V(i[0].domain)&&i[0].domain?.codedValues){const e=i[0].domain.codedValues.filter((({code:e})=>e===r));e.length>0&&(s=e[0].name)}return s}_checkParentForData(e,t){return e.parent?.[t]??null}_defaultDisplayField(e,t){return e.trim()?e:t.templates&&t.templates?.length>0?t.templates[0].name:t.title}get _uniqueFlagId(){return this._flagId++}_groupBy(e,t){return e.reduce(((e,r)=>((e[r[t]]=e[r[t]]||[]).push(r),e)),{})}async _lookupFlagByHit(e){const t=e.graphic?.geometry,r=[];if(t&&h(t)&&this.view){const s=this.view.toScreen(t);if(s){const t=await this.view.hitTest(s,{include:this._validUNLayers});if(t?.results.length){const s=t.results.find((e=>null!==e.layer));if(s.graphic?.geometry)if("polyline"===s.graphic.geometry.type){const t={terminalId:null,isFilterBarrier:!1,allTerminals:null,selectedTerminals:null,percentAlong:this._geometryHandler.getPercentageAlong(s.graphic.geometry,e.graphic?.geometry,s.graphic.geometry.spatialReference),displayValue:this._getDisplayField(s.graphic),mapPoint:s.mapPoint};s.graphic.attributes={...s.graphic.attributes,...t},r.push(s)}else if(("point"===s.graphic.geometry.type||"polygon"===s.graphic.geometry.type)&&this.utilityNetwork){const e=this.utilityNetwork.getTerminalConfiguration(s.graphic),t=this._getDisplayField(s.graphic),i={terminalId:e?e.terminals[0].id||null:1,isFilterBarrier:!1,allTerminals:e??null,selectedTerminals:[e?e.terminals[0].id||null:1],percentAlong:null,displayValue:t,mapPoint:s.mapPoint};s.graphic.attributes={...s.graphic.attributes,...i},r.push(s)}}}}return r}_createFlagProperty(e,t,r){const s=new k;s.terminalId=e.attributes.terminalId,s.isFilterBarrier=e.attributes.isFilterBarrier,s.percentAlong=e.attributes.percentAlong,s.globalId=e.attributes.globalid||e.attributes.GLOBALID,s.type=t;const i=s;return i.details=e,i.mapGraphic=r,i.id=this._uniqueFlagId,i.allTerminals=e.attributes.allTerminals,i.selectedTerminals=e.attributes.selectedTerminals,i.displayValue=e.attributes.displayValue,i.mapPoint=e.attributes.mapPoint,i}async _populateOutfields(){if(!this.view)return;const{map:e}=this.view,t=this.getValidSources(),r=e=>{"group"===e.type?e.layers.forEach((e=>{M(e)&&r(e)})):t.some((t=>t.layerId===e.layerId))&&e.fields.some((e=>"assetgroup"===e.name.toLowerCase()))&&(e.outFields=["assetgroup","assettype","globalid","objectid"])};for(const s of e.layers)M(s)&&r(s)}_removeGraphic(e){this._getGraphicLayer(U)?.remove(e.mapGraphic)}_createGraphicLayer(e){const{map:t}=this.view;if(!t.findLayerById(e)){const t=new g({id:e,internal:!0,listMode:"hide",title:e});G(this.view,t)}}_getGraphicLayer(e){const{map:t}=this.view;if(t){const r=t.findLayerById(e);if(r&&O(r))return r}return null}};e([n()],q.prototype,"_activeProgress",void 0),e([n()],q.prototype,"_flags",void 0),e([n()],q.prototype,"traces",void 0),e([n()],q.prototype,"defaultGraphicColor",void 0),e([n()],q.prototype,"enableResultArea",void 0),e([n()],q.prototype,"flags",void 0),e([n()],q.prototype,"gdbVersion",void 0),e([n()],q.prototype,"messages",void 0),e([n()],q.prototype,"messagesUnits",void 0),e([n()],q.prototype,"resultAreaProperties",null),e([n()],q.prototype,"selectedTraces",void 0),e([n()],q.prototype,"selectOnComplete",void 0),e([n()],q.prototype,"showGraphicsOnComplete",void 0),e([n()],q.prototype,"showSelectionAttributes",void 0),e([n({readOnly:!0})],q.prototype,"state",null),e([n()],q.prototype,"traceResults",void 0),e([n()],q.prototype,"utilityNetwork",void 0),e([n({value:null})],q.prototype,"view",null),q=e([c("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceViewModel")],q);const z=q;export{z as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{id as t}from"../../kernel.js";import r from"../../core/Collection.js";import{deprecatedFunction as s}from"../../core/deprecate.js";import i from"../../core/Error.js";import a from"../../core/Evented.js";import l from"../../core/Logger.js";import{whenOnce as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{isPoint as h,isMultipoint as u}from"../../geometry/support/jsonUtils.js";import{fetchMessageBundle as p}from"../../intl/messages.js";import d from"../../layers/FeatureLayer.js";import g from"../../layers/GraphicsLayer.js";import y from"../../layers/support/CodedValueDomain.js";import{isFeatureLayer as m,getOwningPortalUrl as f}from"../../layers/support/layerUtils.js";import w from"../../networks/UtilityNetwork.js";import{getFeaturesFromLayers as _}from"../../networks/support/utils.js";import b from"../../portal/Portal.js";import{hasUserTypeExtension as A}from"../../portal/support/utils.js";import{trace as v}from"../../rest/networks/trace.js";import k from"../../rest/networks/support/TraceLocation.js";import I from"../../rest/networks/support/TraceParameters.js";import{addUniqueLayer as G}from"../../views/draw/support/layerUtils.js";import{GeometryHandler as R}from"./support/GeometryHandler.js";import{GraphicHandler as F,barrierColor as L,startingPointColor as T}from"./support/GraphicHandler.js";import{ResultAreaHandler as N}from"./support/ResultAreaHandler.js";import{UtilityHelper as S}from"./support/UtilityHelper.js";const H=()=>p("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace"),P=()=>p("esri/core/t9n/Units"),U=`utility-network-trace-flags-${Date.now()}`,V=`utility-network-trace-results-${Date.now()}`,B=`utility-network-trace-sketch-${Date.now()}`;function C(e){return e instanceof y}function E(e){return"feature"===e.layer.type||"subtype-group"===e.layer.type}function j(e){return"layer"in e}function D(e){return void 0!==e.layerViews}function O(e){return"graphics"===e.type}function M(e){return"feature"===e.type||"subtype-group"===e.type||"group"===e.type}async function x(e){const t=new d({url:e.networkSystemLayers.dirtyAreasLayerUrl});await t.load();const r=t.version;if(Number(r)<=11.1){const t=await f(e.layerUrl),r=new b({url:t});await r.load();const s=r?.user?.username;return!!s&&A(r,s,"utilityNetwork")}return!0}let q=class extends a.EventedAccessor{constructor(e){super(e),this._activeProgress=!1,this._clickHandler=null,this._flags=[],this._flagId=0,this._geometryHandler=null,this._highlightHandler=[],this._resultAreaHandler=null,this._sketchViewModel=null,this._traceTimeout=6e5,this._utilityHelper=new S,this._validUNLayers=[],this._watchHandler=null,this.traces=[],this.graphicHandler=null,this.defaultGraphicColor={color:[255,255,0,.6],haloOpacity:.9,fillOpacity:.2,hex:"#FFFF00"},this.enableResultArea=!1,this.flags=[],this.gdbVersion="sde.DEFAULT",this.messages=null,this.messagesUnits=null,this.defaultResultAreaProperties={type:"convexhull",distance:10,unit:"meters",areaUnit:"square-meters",color:{color:[255,165,0,.5],haloOpacity:.9,fillOpacity:.2,hex:"#ffa500"},show:!1},this.selectedTraces=[],this.selectOnComplete=!0,this.showGraphicsOnComplete=!0,this.showSelectionAttributes=!0,this.traceResults=[],this.utilityNetwork=null}initialize(){s(l.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this._geometryHandler=new R,this.graphicHandler=new F,this._resultAreaHandler=new N;(async()=>{const[e,t]=await Promise.all([H(),P()]);this.set({messages:e,messagesUnits:t})})()}destroy(){this.view=null}get resultAreaProperties(){return this.defaultResultAreaProperties}set resultAreaProperties(e){this._set("resultAreaProperties",{...this.defaultResultAreaProperties,...e}),this.graphicHandler.addCustomColor(this.resultAreaProperties.color),this.traceResults.forEach((t=>{const r=t.resultArea?.show;t.resultArea={...this.defaultResultAreaProperties,...e},this.removeResultAreaFromMap(t),this.enableResultArea&&this.createResultAreaGraphic(t).then((s=>{if(s){t.resultAreaGraphic=s;const i=e?.show??r;t.resultArea&&(t.resultArea.show=i),i&&this.addResultAreaToMap(t,s)}}))}))}get state(){return this.view?.ready?"ready":"loading"}get view(){return this._get("view")}set view(e){e&&"2d"!==e.type&&l.getLogger(this).error(new i("view:invalid-view","SceneView is not supported",{view:e})),this._set("view",e),this.utilityNetwork&&this.reset(),this.utilityNetwork=null,this.loadUtilityNetwork().then((e=>{e&&this.selectTracesOnLoad()}))}addFlagByHit(e,t){const r=!!this.view&&this.view.popupEnabled,s=e=>{this.view?.popup&&(this.view.popupEnabled=e)};return new Promise(((i,a)=>{r&&s(!1),this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",(l=>{if("complete"===l.state){const o=this._getGraphicLayer(B);o&&l.graphic&&o.remove(l.graphic),this.queryFlagByHitTest(l,e,t).then((r=>{this.emit("add-flag-complete",{type:e,symbol:t}),i(r)})).catch((r=>{this.emit("add-flag-error",{type:e,symbol:t}),a(r)})).finally((()=>{r&&s(!0),this._clickHandler?.remove()}))}})),this._sketchViewModel.create("point"),this.emit("add-flag",{type:e})}))}addNonspatialTraceLocation(e,t){const r=this._getDisplayField(e),s=this.utilityNetwork?.getTerminalConfiguration(e),i={terminalId:null,isFilterBarrier:!1,allTerminals:s,selectedTerminals:[s?s.terminals[0].id||null:1],displayValue:r};e.attributes={...e.attributes,...i};const a=e.attributes.hasOwnProperty("GLOBALID")?e.attributes.GLOBALID:e.attributes.globalid;if(!this._flags.some((e=>e.globalId===a&&e.type===t))){const r=this._createFlagProperty(e,t,null);this._flags.push(r),this.emit("add-flag-complete",{type:t})}this.emit("add-flag",{type:t})}async addFlagsOnLoad(){if(this._flags.length>0)return[];await o((()=>null!=this.view&&!this.view.updating));return(await Promise.all(this.flags.map((async e=>{if(!e.mapPoint)return null;const{type:t}=e,r=e.mapPoint.clone(),s="barrier"===t?L:T,i={graphic:this.graphicHandler.makeGraphic(r,s),state:"complete",tool:"point",toolEventInfo:null,type:"create"};try{return await this.queryFlagByHitTest(i,e.type,null),this.emit("add-flag-complete",{type:t}),null}catch(a){return this.emit("add-flag-error",{type:t}),"barrier"===t?"barrier":"starting-point"}})))).filter((e=>!e))}async addResultAreaToMap(e,t){if(this.view)if(e.resultArea.show=!0,t)this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t});else if(e.results){const t=await this.createResultAreaGraphic(e);t&&(e.resultAreaGraphic=t,this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t}))}}async addResultGraphicToView(e,t){const{view:r}=this,{results:s}=e;if(r&&s&&this.utilityNetwork)for(const i in s.aggregatedGeometry)if("line,multipoint,polygon".includes(i)){const a=i,l=s.aggregatedGeometry[a];if(null!=l){l.spatialReference=this.utilityNetwork.spatialReference,e.graphicEnabled=!0;const s=await this._geometryHandler.projectGeometry(l,r.spatialReference),i={globalid:e.trace.globalId};if(null!==s){const e=this.graphicHandler.makeGraphic(s,t.color,i,r.spatialReference);this._getGraphicLayer(V)?.add(e)}}}}addTerminal(e,t){const r=[...this._flags];r.forEach((r=>{r.globalId===t.globalId&&(t.selectedTerminals?.includes(parseInt(e,10))||r.selectedTerminals?.push(parseInt(e,10)))})),this._flags=r}async callTrace(){const e=this.traces.filter((e=>e.selected));return!!e.length&&(this.traceResults.length>0&&this.traceResults.forEach((e=>{this.removeResultGraphicFromView(e)})),this.traceResults=[],this.removeSelection(),await Promise.all(e.map((async(e,t)=>{const r=e,s=new I({gdbVersion:this.utilityNetwork?.gdbVersion,moment:this.utilityNetwork?.historicMoment,namedTraceConfigurationGlobalId:r.globalId,outSpatialReference:null,resultTypes:null,traceType:r.traceType,traceLocations:this._flags,traceConfiguration:null});await this.executeTrace(r,this.utilityNetwork?.networkServiceUrl,s).then((e=>{if(e.hasOwnProperty("results")){const r={...e};if(null!==r.results){r.resultArea={...this.resultAreaProperties};const e=[...r.results.elements];r.results.elements.length=0;const s=new Map;for(const t of e)s.has(t.globalId)||(s.set(t.globalId,!0),r.results.elements.push(t));const i=[...this.traceResults];i.splice(t,0,r),this.traceResults=i,null!==r.results&&(this.selectOnComplete&&this.mergeSelection(!0,r.trace),this.showGraphicsOnComplete&&this.addResultGraphicToView(r,r.graphicColor),this.enableResultArea&&this.createResultAreaGraphic(r).then((e=>{e&&(r.resultAreaGraphic=e,r.resultArea?.show&&this.addResultAreaToMap(r,r.resultAreaGraphic))})))}else{const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}this._activeProgress=!1}else{this._activeProgress=!1;const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}})).catch((e=>{throw this._activeProgress=!1,e}))}))),!0)}changeResultAreaColor(e,t){if(!e.resultArea)return;e.resultArea.color=t;const r=this._resultAreaHandler?.changeResultAreaColor(e.trace.globalId,t,this.view.map);e.resultAreaGraphic&&(e.resultAreaGraphic.symbol=r)}changeResultGraphicColor(e,t){const r=[...this.traceResults];r.length>0&&r.forEach((r=>{r.trace.globalId===t.trace.globalId&&(r.graphicColor=e,r.graphicEnabled=!0)})),this.traceResults=r,this.removeResultGraphicFromView(t),this.addResultGraphicToView(t,e)}changeFlagSymbol(e,t){this._flags.length>0&&this._flags.forEach((r=>{r.type===e&&t&&r.mapGraphic&&(r.mapGraphic.symbol=t)}))}checkCanTrace(){const e={status:!0,issues:[]},t=this.traces.filter((e=>e.selected));t.length||(e.status=!1,e.issues.push("noTracesSelected"));this._flags.some((e=>"starting-point"===e.type))||(e.status=!1,e.issues.push("noStartingPoints"));return this._flags.filter((e=>null!==e.allTerminals)).some((e=>!e.selectedTerminals.length))&&(e.status=!1,e.issues.push("noTerminalSelected")),e}checkSelectionExist(){return this._highlightHandler.some((e=>e))}clearResult(e){if(!this.view)return;let t=this.traceResults;if(t.length>0){const r=t.filter((t=>t.trace.globalId===e.globalId));r.length>0&&(this.removeResultGraphicFromView(r[0]),this.removeResultAreaFromMap(r[0])),t=t.filter((t=>t.trace.globalId!==e.globalId))}this.traceResults=t,0===t.length?(this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]})):this.mergeSelection(!1,e)}createResultAreaGeometries(e,t,r){if(!this.view||!this.resultAreaProperties)return;let s;if(s="convexhull"===this.resultAreaProperties?.type?1===t.length&&(h(t[0])||u(t[0])&&1===t[0].points.length)?this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0):this._resultAreaHandler?.createConvexHull(t,e.resultArea?.distance,e.resultArea?.unit):this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0),!s)return;if(Array.isArray(s)){for(const t of s){const r=this.getResultAreaAttributes(e,t),s=this._resultAreaHandler?.createResultAreaGraphic(t,r,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color);if(s)return s}return}const i=this.getResultAreaAttributes(e,s);return this._resultAreaHandler?.createResultAreaGraphic(s,i,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color)}async createResultAreaGraphic(e){if(e.results){const t=await this._createResultAreaInputGeometry(e.results);if(t.length>0){const r=Array(t.length).fill(e.resultArea?.distance),s=this.createResultAreaGeometries(e,t,r);return this.emit("create-result-area",{graphic:s}),s}}}executeTrace(e,t,r){const s=this._processFlags(r.traceLocations);return r.traceLocations=s,v(t,r,{timeout:this._traceTimeout}).then((t=>({trace:e,results:t,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:"success",date:new Date}))).catch((t=>({trace:e,results:null,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:t.message,date:new Date})))}async getNonspatialTraceLocationInitialFeature(){return new Promise(((e,t)=>{this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",(async r=>{if("complete"!==r.state)return;const s=this._getGraphicLayer(B);s&&r.graphic&&s.remove(r.graphic);const i=this.view?.toScreen(r.graphic?.geometry);if(!i)return;const a=await(this.view?.hitTest(i));if(a?.results.length){const r=a.results.find((e=>"graphic"===e.type&&this.utilityNetwork?.isUtilityLayer(e.layer)));r?e(r):t(null)}})),this._sketchViewModel.create("point")}))}getResultAreaAttributes(e,r){const{messages:s}=this,i=[],a=[];this._flags.forEach((e=>{const t=e.displayValue?.field+":"+e.displayValue?.value+";"+s.attributeStrings.globalid+":"+e.globalId+";"+s.attributeStrings.terminalid+":"+e.terminalId+";"+s.attributeStrings.x+":"+e.mapPoint?.x+";"+s.attributeStrings.y+":"+e.mapPoint?.y;"starting-point"===e.type?i.push(t):a.push(t)}));const l=this.utilityNetwork?this.utilityNetwork.gdbVersion:this.gdbVersion;return{traceId:e.trace.globalId,traceName:e.trace.title,traceDescription:e.trace.description??"",startingPoints:i.toString(),barriers:a.toString(),version:l??void 0,username:t.credentials[0].userId,date:e.date,elementCount:e.results?.elements.length,functionResult:JSON.stringify(e.results?.globalFunctionResults),areaStatistic:r?this._geometryHandler.calculateArea(r,e.resultArea?.areaUnit):0}}getValidSources(){let e=[];const t=this.utilityNetwork?.dataElement?.domainNetworks??[];for(const r of t)e=e.concat(r.junctionSources),e=e.concat(r.edgeSources);return e}groupResultsByNetworkSource(e){return 0===e.length?[]:this._groupBy(e,"networkSourceId")}async loadUtilityNetwork(){const{view:e}=this;if(!e)return null;if(await e.when(),this.utilityNetwork){if(this.utilityNetwork.loaded||await this.utilityNetwork.load(),this.utilityNetwork instanceof w){try{const t=e.map;await t.loadAll()}finally{this._loadUNSupportItems()}return this.utilityNetwork}return null}const t=e.map,r=t.utilityNetworks?.at(0);if(r){if(await r.load(),this.utilityNetwork=r,!await x(r))throw new i("utility-network:no-user-type-extension","User type extension not found");try{await t.loadAll()}finally{this._loadUNSupportItems()}return r}return null}manageFilterBarrier(e,t){const r=[...this._flags];r.forEach((r=>{r.globalId===t.globalId&&"barrier"===t.type&&r.id===t.id&&(r.isFilterBarrier=e)})),this._flags=r}mergeSelection(e,t){let r=[];const s=[...this.traceResults],i=t.globalId;s.forEach((t=>{i===t.trace.globalId&&(t.selectionEnabled=e),t.selectionEnabled&&null!==t.results?.elements&&(r=[...r,...t.results?.elements??[]])})),this.selectResults([...new Set(r)])}async queryFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return null;const s=this.utilityNetwork.getObjectIdsFromElements(e),i={layerUrl:s[0].layerUrl,objectIds:s[0].objectIds,outFields:["*"]},a=t.map?.allTables.toArray().filter((e=>e?.parsedUrl?.path===s[0].layerUrl)).filter(m)??[];this._getUniqueMapLayerViews(t).filter((({layer:e})=>e?.parsedUrl?.path===s[0].layerUrl)).forEach((({layer:e})=>{"feature"!==e.type&&"subtype-group"!==e.type||a.push(e)}));const l=(await Promise.all(a.map((async e=>{const s={layers:new r([e]),layerInfos:[i],returnGeometry:!0,outSpatialReference:t.spatialReference},[a]=await _(s,!1);return a})))).filter((({featureSet:e})=>e.features.length>0));return l.length>0?l:null}queryFlagByHitTest(e,t,r){return this._lookupFlagByHit(e).then((e=>{const{view:s}=this;if(!s)return!1;if(e.length>0){const s=[...this._flags],i=r;return e.forEach((e=>{const r=e.graphic,a=r.attributes.hasOwnProperty("GLOBALID")?r.attributes.GLOBALID:r.attributes.globalid;if(s.filter((e=>e.globalId===a)).length<=0){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(U)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}else if(null!==r.attributes.percentAlong){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(U)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}})),this._flags=s,!0}return!1}))}removeResultGraphicFromView(e){const{view:t}=this;if(!t)return;const r=this._getGraphicLayer(V)?.graphics;e.graphicEnabled=!1;const s=r?.filter((t=>t.attributes[t.attributes.hasOwnProperty("GLOBALID")?"GLOBALID":"globalid"]===e.trace.globalId));s?.forEach((e=>{this._getGraphicLayer(V)?.remove(e)}))}removeFlag(e){const t=this._flags.filter((t=>{if(t.id!==e.id)return t}));this._removeGraphic(e),this._flags=t}removeAllResultAreaGraphics(){this._resultAreaHandler?.removeAllResultAreaGraphics(this.view.map)}removeResultAreaFromMap(e){if(e.resultArea){e.resultArea.show=!1;const t=this._resultAreaHandler?.removeResultArea(e.trace.globalId,this.view?.map);t&&this.emit("remove-result-area",{graphic:t})}}removeSelection(){this._highlightHandler.forEach((e=>{e&&e.remove()})),this._highlightHandler=[]}removeTerminal(e,t){const r=[...this._flags];r.forEach((r=>{if(r.globalId===t.globalId&&t.selectedTerminals?.includes(parseInt(e,10))){const s=t.selectedTerminals.indexOf(parseInt(e,10));r.selectedTerminals?.splice(s,1)}})),this._flags=r}removeFlagsOnLoadWatcher(){this._watchHandler&&null!==this._watchHandler&&this._watchHandler.remove()}removeClickHandler(){this._clickHandler&&(this._sketchViewModel.cancel(),this._clickHandler.remove())}reset(){this._flags=[],this.traceResults=[];const e=[...this.traces];e.forEach((e=>{e.selected=!1})),this.traces=e,this.view&&(this._getGraphicLayer(B)?.removeAll(),this._getGraphicLayer(U)?.removeAll(),this._getGraphicLayer(V)?.removeAll(),this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]}),this.emit("reset"))}selectFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return;const r=this.utilityNetwork.getObjectIdsFromElements(e);this._getUniqueMapLayerViews(t).forEach((e=>{j(e)&&e.layer?.parsedUrl?.path===r[0].layerUrl&&E(e)&&this._highlightHandler.push(e.highlight(r[0].objectIds))}))}selectResults(e){if(e.length>0){this.removeSelection();const t=this.groupResultsByNetworkSource(e),r=[];for(const e in t)this.selectFeaturesById(t[e]),r.push(this.queryFeaturesById(t[e]));Promise.all(r).then((e=>{this.emit("select-features",{resultSet:e})}))}else this.removeSelection(),this.emit("clear-selection",{resultSet:[]})}selectTraces(e,t){const r=[...this.traces];r.forEach((r=>{t===r.globalId&&(r.selected=e)})),this.traces=r}selectTracesOnLoad(){this.utilityNetwork?.hasOwnProperty("sharedNamedTraceConfigurations")&&(this.traces=[...this.utilityNetwork.sharedNamedTraceConfigurations],this.traces.forEach((e=>{e.selected=!1,this.selectedTraces.includes(e.globalId)&&(e.selected=!0)})))}zoomToAsset(e){this.view?.goTo(e).catch((e=>console.error(e)))}async _createResultAreaInputGeometry(e){if(null!=e.aggregatedGeometry)return this._geometryHandler.mergeAggregatedToGeometries(e.aggregatedGeometry);const t=this.groupResultsByNetworkSource(e.elements),r=[];for(const s in t)r.push(this.queryFeaturesById(t[s]));try{const e=await Promise.all(r),t=[];for(const r of e)if(r)for(const e of r)for(const r of e.featureSet.features)r.geometry&&t.push(r.geometry);return t}catch{return[]}}_loadUNSupportItems(){if(!this.utilityNetwork)return;const{map:e}=this.view,{messages:t}=this;this._populateOutfields(),this._createGraphicLayer(B),this._createGraphicLayer(U),this._createGraphicLayer(V),this._resultAreaHandler?.createGraphicLayer(e,t?.alertsStrings.genericResultHeader),this._validUNLayers=this._utilityHelper.getValidUtilityNetworkLayers(e,this.utilityNetwork),this._sketchViewModel=this.graphicHandler.initializeSketch(this.view,this._getGraphicLayer(B),this._validUNLayers)}_getUniqueMapLayerViews(e){const t=[],r=e.layerViews.filter((({layer:{type:e}})=>"feature"===e||"group"===e||"subtype-group"===e)).toArray(),s=e=>{for(const r of e.layerViews)D(r)?s(r):t.push(r)};return r.forEach((e=>{switch(e.layer.type){case"group":D(e)&&s(e);break;case"subtype-group":t.push(e);break;default:t.some((t=>t.layer.id===e.layer.id))||t.push(e)}})),t}_processFlags(e){const t=[];return e.forEach((e=>{if(null!==e.selectedTerminals&&e.selectedTerminals.length>0)e.selectedTerminals.forEach((r=>{const s=new k({globalId:e.globalId,percentAlong:e.percentAlong,terminalId:r,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(s)}));else{const r=new k({globalId:e.globalId,percentAlong:e.percentAlong,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(r)}})),t}_getDisplayField(e){return"subtype-sublayer"===e?.layer?.type?this._getDisplayFieldBySublayer(e):this._getDisplayFieldByFeatureLayer(e)}_getDisplayFieldBySublayer(e){let t="",r="";const s=e.layer;t=this._checkParentForData(s,"displayField");for(const i in e.attributes){const a=i.toLowerCase();a===t?.toLowerCase()?(r=e.attributes[i],"assetgroup"===a||"assettype"===a?r=this._checkSubtype(s,s.subtypeCode):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))}return{field:t,value:r.toString()}}_getDisplayFieldByFeatureLayer(e){const t=e.layer;let r=t.displayField,s="";for(const i in e.attributes){const a=i.toLowerCase();if(a===r?.toLowerCase())if(s=e.attributes[i],"assetgroup"===a||"assettype"===a){let a=e.attributes[t.typeIdField.toUpperCase()];a||(a=e.attributes[t.typeIdField.toLowerCase()]),r=t.typeIdField,s=this._checkSubtype(t,a),""===r&&(t.templates&&t.templates.length>0?(r=t.templates[0]?.name,s=t.templates[0]?.name):(r=t.displayField,s=e.attributes[i]))}else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t));else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t))}return{field:r,value:s?s.toString():""}}_checkSubtype(e,t){let r=t;if("subtype-sublayer"===e.type){const s=this._checkParentForData(e,"subtypes");s?.length>0&&s.forEach((e=>{e.code===t&&(r=e.name)}))}else if(null!=e.types&&e.types.length>0){const s=e.types.filter((e=>e.id===t));s.length>0&&(r=s[0].name)}return r}_checkDomain(e,t,r){let s=r;const i=e.filter((e=>e.name.toLowerCase()===t.toLowerCase()));if(i.length>0&&C(i[0].domain)&&i[0].domain?.codedValues){const e=i[0].domain.codedValues.filter((({code:e})=>e===r));e.length>0&&(s=e[0].name)}return s}_checkParentForData(e,t){return e.parent?.[t]??null}_defaultDisplayField(e,t){return e.trim()?e:t.templates&&t.templates?.length>0?t.templates[0].name:t.title}get _uniqueFlagId(){return this._flagId++}_groupBy(e,t){return e.reduce(((e,r)=>((e[r[t]]=e[r[t]]||[]).push(r),e)),{})}async _lookupFlagByHit(e){const t=e.graphic?.geometry,r=[];if(t&&h(t)&&this.view){const s=this.view.toScreen(t);if(s){const t=await this.view.hitTest(s,{include:this._validUNLayers});if(t?.results.length){const s=t.results.find((e=>null!==e.layer));if(s.graphic?.geometry)if("polyline"===s.graphic.geometry.type){const t={terminalId:null,isFilterBarrier:!1,allTerminals:null,selectedTerminals:null,percentAlong:this._geometryHandler.getPercentageAlong(s.graphic.geometry,e.graphic?.geometry,s.graphic.geometry.spatialReference),displayValue:this._getDisplayField(s.graphic),mapPoint:s.mapPoint};s.graphic.attributes={...s.graphic.attributes,...t},r.push(s)}else if(("point"===s.graphic.geometry.type||"polygon"===s.graphic.geometry.type)&&this.utilityNetwork){const e=this.utilityNetwork.getTerminalConfiguration(s.graphic),t=this._getDisplayField(s.graphic),i={terminalId:e?e.terminals[0].id||null:1,isFilterBarrier:!1,allTerminals:e??null,selectedTerminals:[e?e.terminals[0].id||null:1],percentAlong:null,displayValue:t,mapPoint:s.mapPoint};s.graphic.attributes={...s.graphic.attributes,...i},r.push(s)}}}}return r}_createFlagProperty(e,t,r){const s=new k;s.terminalId=e.attributes.terminalId,s.isFilterBarrier=e.attributes.isFilterBarrier,s.percentAlong=e.attributes.percentAlong,s.globalId=e.attributes.globalid||e.attributes.GLOBALID,s.type=t;const i=s;return i.details=e,i.mapGraphic=r,i.id=this._uniqueFlagId,i.allTerminals=e.attributes.allTerminals,i.selectedTerminals=e.attributes.selectedTerminals,i.displayValue=e.attributes.displayValue,i.mapPoint=e.attributes.mapPoint,i}async _populateOutfields(){if(!this.view)return;const{map:e}=this.view,t=this.getValidSources(),r=e=>{"group"===e.type?e.layers.forEach((e=>{M(e)&&r(e)})):t.some((t=>t.layerId===e.layerId))&&e.fields.some((e=>"assetgroup"===e.name.toLowerCase()))&&(e.outFields=["assetgroup","assettype","globalid","objectid"])};for(const s of e.layers)M(s)&&r(s)}_removeGraphic(e){this._getGraphicLayer(U)?.remove(e.mapGraphic)}_createGraphicLayer(e){const{map:t}=this.view;if(!t.findLayerById(e)){const t=new g({id:e,internal:!0,listMode:"hide",title:e});G(this.view,t)}}_getGraphicLayer(e){const{map:t}=this.view;if(t){const r=t.findLayerById(e);if(r&&O(r))return r}return null}};e([n()],q.prototype,"_activeProgress",void 0),e([n()],q.prototype,"_flags",void 0),e([n()],q.prototype,"traces",void 0),e([n()],q.prototype,"defaultGraphicColor",void 0),e([n()],q.prototype,"enableResultArea",void 0),e([n()],q.prototype,"flags",void 0),e([n()],q.prototype,"gdbVersion",void 0),e([n()],q.prototype,"messages",void 0),e([n()],q.prototype,"messagesUnits",void 0),e([n()],q.prototype,"resultAreaProperties",null),e([n()],q.prototype,"selectedTraces",void 0),e([n()],q.prototype,"selectOnComplete",void 0),e([n()],q.prototype,"showGraphicsOnComplete",void 0),e([n()],q.prototype,"showSelectionAttributes",void 0),e([n({readOnly:!0})],q.prototype,"state",null),e([n()],q.prototype,"traceResults",void 0),e([n()],q.prototype,"utilityNetwork",void 0),e([n({value:null})],q.prototype,"view",null),q=e([c("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceViewModel")],q);const z=q;export{z as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{deprecatedFunction as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{watch as i,on as r,when as o}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as n}from"../core/support/UpdatingHandles.js";import c from"../layers/support/CodedValueDomain.js";import{isSubtypeGroupLayer as d}from"../layers/support/layerUtils.js";import u from"../rest/support/Query.js";import h from"./Widget.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{storeNode as m}from"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{vmEvent as b}from"./support/decorators/vmEvent.js";import{tsx as w}from"./support/jsxFactory.js";import v from"./UtilityNetworkTrace/UtilityNetworkTraceFeature.js";import y from"./UtilityNetworkTrace/UtilityNetworkTraceViewModel.js";import{defaultSwatchColors as f}from"./UtilityNetworkTrace/support/GraphicHandler.js";const S="esri-utility-network-trace",T={base:S,addButtonContainer:`${S}__add-button-container`,blockContainer:`${S}__block-container`,blockContent:`${S}__block-content`,clearPrompt:`${S}__reset-prompt`,doublePaddingTop:`${S}__double-pad-top`,flow:`${S}__flow`,listContainer:`${S}__list-container`,noticeContainer:`${S}__notice-container`,numberInput:`${S}__number-input`,promptDivider:`${S}__divider`};function k(e){return{height:e+"px"}}function F(e){return{width:e+"px"}}function C(){return{width:"75%"}}function R(e){return{width:"100%",height:window.getComputedStyle(e).getPropertyValue("max-height")}}function A(e){return{display:"flex",flexDirection:e}}function M(e){return e instanceof c}const N={noExtension:-2147208474};let x=class extends h{constructor(e,t){super(e,t),this._activeTab="input",this._activeTrace=null,this._activeSwatch="",this._addNonspatialObjectActive=!1,this._alertRemoveModal=!1,this._assetGroupHeader="",this._assetTypeHeader="",this._confirmReset=!1,this._errorMessage="",this._swatchNode=null,this._selectToolActive=!1,this._showFeatureInfoActive=!1,this._traceHeaderForFlow="",this._traceResultsFunctions=[],this._traceResultsAssetGroup=[],this._traceResultsAssetType=[],this._traceResultsIndividual=[],this._traceResultsState="result",this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._findNonspatialFeatureWidget=new v({mode:"add-nso"}),this._individualResultNode=null,this._loadUnError=!0,this._resultDisplayField="objectid",this._resultFeatureWidget=new v({mode:"show-feature-info"}),this._resultObjectIdField="objectid",this._resultSortField="objectid",this._resultSortOrder="desc",this._showResultOptions=!1,this._symbolStartFlag=null,this._symbolBarrier=null,this._traceLocationType="starting-point",this._updatingHandles=new n,this._warningNoBarrierAssetFound=!1,this._warningNoStartAssetFound=!1,this._warningNoTerminal=!1,this._wasPopupEnabled=!1,this._watchHandler=null,this.disabled=!0,this.inputSettings=[],this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.viewModel=new y,this._afterComponentCreate=this._afterComponentCreate.bind(this)}initialize(){this._wasPopupEnabled=!!this.view&&this.view.popupEnabled,this._findNonspatialFeatureWidget.view=this.view,this._resultFeatureWidget.view=this.view,this._utilityNetworkTraceInitialized(),this.addHandles([i((()=>this.viewModel?.resultAreaProperties),(()=>this.scheduleRender())),i((()=>this._addNonspatialObjectActive),(e=>{this._findNonspatialFeatureWidget.feature=null,e||(this.view.popupEnabled=this._wasPopupEnabled)})),i((()=>this._showFeatureInfoActive),(e=>{e||(this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled)})),r((()=>this._findNonspatialFeatureWidget),"add-nso-trace-location",(({featureWidget:e})=>{this.viewModel.addNonspatialTraceLocation(e.graphic,this._traceLocationType),this._warningNoFlag=!1,this._addNonspatialObjectActive=!1})),r((()=>this._findNonspatialFeatureWidget),"close-un-trace-feature-block",(()=>{this._addNonspatialObjectActive=!1})),r((()=>this._resultFeatureWidget),"close-un-trace-feature-block",(()=>{this._showFeatureInfoActive=!1})),r((()=>this._resultFeatureWidget),"close",(()=>{this._resetResultFeatureWidget()})),r((()=>this.view),"click",(async e=>{if(!this._addNonspatialObjectActive)return;this._findNonspatialFeatureWidget.feature=null;const t=await(this.view?.hitTest(e.screenPoint));if(t?.results.length){const e=t.results.find((e=>"graphic"===e.type&&this.utilityNetwork?.isUtilityLayer(e.layer)));if(e){const t=e.graphic;this._findNonspatialFeatureWidget.open(t)}}}))])}destroy(){this._findNonspatialFeatureWidget?.destroy(),this._resultFeatureWidget?.destroy()}get defaultGraphicColor(){return this.viewModel.defaultGraphicColor}set defaultGraphicColor(e){this.viewModel.defaultGraphicColor=e}get enableResultArea(){return this.viewModel.enableResultArea}set enableResultArea(e){this.viewModel.enableResultArea=e}get flags(){return this.viewModel.flags}set flags(e){this.viewModel.flags=e}get gdbVersion(){return t(s.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this.viewModel.gdbVersion}set gdbVersion(e){t(s.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this.viewModel.gdbVersion=e}get icon(){return"utility-network-trace"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get resultAreaProperties(){return this.viewModel.resultAreaProperties}set resultAreaProperties(e){this.viewModel.resultAreaProperties=e}get selectedTraces(){return this.viewModel.selectedTraces}set selectedTraces(e){this.viewModel.selectedTraces=e}get selectOnComplete(){return this.viewModel.selectOnComplete}set selectOnComplete(e){this.viewModel.selectOnComplete=e}get showGraphicsOnComplete(){return this.viewModel.showGraphicsOnComplete}set showGraphicsOnComplete(e){this.viewModel.showGraphicsOnComplete=e}get showSelectionAttributes(){return this.viewModel.showSelectionAttributes}set showSelectionAttributes(e){this.viewModel.showSelectionAttributes=e}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(e){this.viewModel.utilityNetwork=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}async checkCanTrace(){this._confirmReset=!1,this._resetResultFeatureWidget();const e=this.viewModel.checkCanTrace();e.status?(this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._warningNoTerminal=!1,this._traceResultsState="result",this.switchTab("results"),this.viewModel._activeProgress=!0,this.viewModel.removeAllResultAreaGraphics(),await this.viewModel.callTrace(),this.viewModel._activeProgress=!1):e.issues.forEach((e=>{switch(e){case"noStartingPoints":this._warningNoFlag=!0;break;case"noTerminalSelected":this._warningNoTerminal=!0;break;default:this._warningNoTraceSelected=!0}}))}confirmReset(){this._confirmReset=!0}render(){return this._mixCustomStrings(),this._overrideFlagSymbol(),w("div",{class:this.classes(T.base,g.widget,g.panel,{[g.widgetDisabled]:this.disabled})},this._renderUtilityNetworkTrace())}loadDependencies(){return p({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-pad":()=>import("@esri/calcite-components/dist/components/calcite-action-pad"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),"color-picker-swatch":()=>import("@esri/calcite-components/dist/components/calcite-color-picker-swatch"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),fab:()=>import("@esri/calcite-components/dist/components/calcite-flow"),flow:()=>import("@esri/calcite-components/dist/components/calcite-fab"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),"split-button":()=>import("@esri/calcite-components/dist/components/calcite-split-button"),tab:()=>import("@esri/calcite-components/dist/components/calcite-tab"),"tab-nav":()=>import("@esri/calcite-components/dist/components/calcite-tab-nav"),"tab-title":()=>import("@esri/calcite-components/dist/components/calcite-tab-title"),tabs:()=>import("@esri/calcite-components/dist/components/calcite-tabs")})}switchTab(e){this._activeTab=e}switchToFromAssetGroup(e,t,s){this._traceHeaderForFlow=t,this._traceResultsAssetGroup=e,this._traceResultsState=s}switchToFromAssetType(e,t,s){this._assetGroupHeader=t,this._traceResultsAssetType=e,this._traceResultsState=s}switchToFromFunctions(e,t){this._traceResultsFunctions=e,this._traceResultsState=t}switchToFromIndividualRecords(e,t,s){this._assetTypeHeader=t,this._traceResultsIndividual=e,this._traceResultsState=s}_renderAddNonspatialLocationBlock(){const{messages:e}=this;return w("calcite-block",{key:`${this.id}__add-spatial-location-block`,label:e.inputsStrings.addNonspatialOption,open:!0},this._findNonspatialFeatureWidget.render())}_renderAddSpatialLocationBlock(){const{messages:e,messagesCommon:t}=this;return w("calcite-block",{class:T.blockContent,heading:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier,key:`${this.id}__add-nonspatial-location-block`,label:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier,open:!0},w("calcite-action",{icon:"x",onclick:()=>{this.viewModel.removeClickHandler(),this.view?.popup&&(this.view.popupEnabled=this._wasPopupEnabled),this._changeCursor("default"),this._selectToolActive=!1},slot:"control",text:t.close}),w("calcite-notice",{icon:"starting-point"===this._traceLocationType?"pin-plus":"x-circle-f",kind:"info",open:!0},w("div",{slot:"message"},e.inputsStrings.addPointHint)))}_renderClearTraceResultsBlock(){const{messages:e,messagesCommon:t}=this;return w("calcite-scrim",{key:"prompt"},w("div",{class:T.clearPrompt},w("h3",{slot:"header"},e.resultsStrings.startOverButton),w("div",{slot:"content"},e.resultsStrings.startOverValidation),w("div",{class:T.promptDivider}),w("div",{styles:A("row")},w("calcite-button",{appearance:"outline",onclick:()=>{this._confirmReset=!1},slot:"secondary",width:"full"},t.cancel),w("calcite-button",{onclick:()=>{this._confirmReset=!1,this.viewModel.reset(),this.switchTab("input")},slot:"primary",width:"full"},t.form.ok))))}_renderExecutingTraceBlock(){const{messages:e}=this;return w("calcite-loader",{label:e.alertsStrings.traceExecuting,text:e.alertsStrings.traceExecuting,type:"indeterminate"})}_renderInputBlock(){const{messages:e}=this;return w("calcite-block",{class:T.blockContainer,key:`${this.id}__inputs-block`,label:e.inputsStrings.headerTabInputs,open:!0},w("calcite-flow",{class:T.flow},w("calcite-flow-item",{key:`${this.id}__inputs-flow-item`,selected:!this._selectToolActive&&!this._addNonspatialObjectActive},this._warningNoFlag?this._renderWarningMessage("flag",!0):null,this._warningNoTerminal?this._renderWarningMessage("noTerminal",!0):null,this._warningNoTraceSelected?this._renderWarningMessage("trace",!0):null,this._renderTraceSelectorContainer(),this._renderStartFlagsContainer(),this._renderBarriersFlagsContainer(),this._warningNoFlag&&this._warningNoTraceSelected?w("div",{styles:k(10)}):null,w("calcite-fab",{appearance:"solid",icon:"utility-network-trace",kind:"brand",onclick:()=>{this.checkCanTrace()},slot:"fab",text:e.tracingStrings.runTrace,textEnabled:!0,title:e.tracingStrings.runTrace,type:"button"}))))}_renderInputsTab(){const{messagesCommon:e}=this;let t="input";return this._selectToolActive&&!this._addNonspatialObjectActive&&(t="add-spatial-location"),!this._selectToolActive&&this._addNonspatialObjectActive&&(t="add-nso-location"),this.disabled&&(t="loading"),w("calcite-tab",{key:`${this.id}__inputs-tab-item`,selected:"input"===this._activeTab},"loading"===t?w("calcite-loader",{label:e.loading,type:"indeterminate"}):null,"input"===t?this._renderInputBlock():null,"add-spatial-location"===t?this._renderAddSpatialLocationBlock():null,"add-nso-location"===t?this._renderAddNonspatialLocationBlock():null)}_renderBarriersFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter((e=>"barrier"===e.type)),s.forEach((e=>{e.displayValue&&t.push(this._renderFlagRow(e,"barrier"))}));let i=null;return this._symbolBarrier&&(i=this._getSymbolIcon(this._symbolBarrier)),w("calcite-block",{class:T.blockContent,collapsible:!0,heading:e.inputsStrings.headerBarrier+" ("+s.length+")",open:!0,overlayPositioning:"fixed"},w("div",{slot:"icon"},i||w("calcite-icon",{icon:"x-circle-f",scale:"s"})),w("div",null,e.inputsStrings.barrierPointHint),w("div",{class:T.listContainer},t),this._warningNoBarrierAssetFound?this._renderWarningMessage("noBarrierAsset",!0):null,w("div",{class:T.addButtonContainer},w("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("barrier")}},w("calcite-dropdown-group",{selectionMode:"none"},w("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("barrier")}},e.inputsStrings.addNonspatialOption)))))}_renderFlagRow(e,t){const{messages:s,messagesCommon:i}=this,r=[];let o=!1;return null!=e.allTerminals&&e.allTerminals.terminals.length>0&&(o=!0,e.allTerminals.terminals.forEach((t=>{let s=!1;e?.selectedTerminals?.includes(t.id)&&(s=!0),r.push(w("calcite-combobox-item",{key:t.name,selected:s,textLabel:t.name,value:t.id}))}))),w("calcite-block",{collapsible:null!==e.allTerminals||"barrier"===e.type,heading:e.displayValue?.value??"",key:"pop"+e.globalId+e.type+e.id+t,overlayPositioning:"fixed"},w("calcite-action",{icon:"trash",label:i.remove,onclick:()=>{this.viewModel.removeFlag(e)},scale:"s",slot:"header-menu-actions",text:i.remove,textEnabled:!0}),e.mapGraphic&&e.mapPoint?w("calcite-action",{icon:"zoom-to-object",label:s.globalStrings.zoomToFeature,onclick:()=>{this.viewModel.zoomToAsset(e.details.geometry)},scale:"s",slot:"header-menu-actions",text:s.globalStrings.zoomToFeature,textEnabled:!0}):null,"barrier"===e.type?w("calcite-label",{layout:"inline",scale:"s"},w("calcite-checkbox",{checked:e.isFilterBarrier,onclick:()=>{this.viewModel.manageFilterBarrier(!e.isFilterBarrier,e)},scale:"s"}),s.inputsStrings.barrierFilter):null,o?w("calcite-combobox",{label:s.globalStrings.selectTerminalPlaceholder,maxItems:0,overlayPositioning:"fixed",placeholder:s.globalStrings.selectTerminalPlaceholder,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:t=>{t.currentTarget.selectedItems.length>0?(e.selectedTerminals=[],t.currentTarget.selectedItems.forEach((t=>{this.viewModel.addTerminal(t.value,e)}))):e.selectedTerminals=[]},onCalciteComboboxChipClose:t=>{t.preventDefault(),this.viewModel.removeTerminal(t.currentTarget.value,e)}},r):null)}_renderHighlightColorPicker(e,t,s){const{messages:i}=this,{graphicHandler:r}=this.viewModel,o=[],l=new RegExp(`^${e.hex}$`,"i"),a=r.highlightColor.length>f.length?5:4;for(const n of r.highlightColor)o.push(w("calcite-action",{active:l.test(n.hex),key:n.hex,label:i.resultsStrings.graphicColor,onclick:()=>{"aggregate"===s?this.viewModel.changeResultGraphicColor(n,t):this.viewModel.changeResultAreaColor(t,n)},scale:"s",text:i.resultsStrings.graphicColor},w("calcite-color-picker-swatch",{active:l.test(n.hex),color:n.hex,scale:"s"})));return w("calcite-action-pad",{expandDisabled:!0,layout:"grid",position:"start"},w("calcite-action-group",{columns:a},o))}_renderRemoveTraceContainer(e){const{messages:t}=this;return w("calcite-action",{icon:"trash",label:t.globalStrings.clearResults,onclick:()=>{this._alertRemoveModal=!0,this._activeTrace=e.trace},scale:"s",slot:"header-menu-actions",text:t.globalStrings.clearResults,textEnabled:!0})}_renderResultsTab(){let e="results";return this._showFeatureInfoActive&&(e="show-feature-info"),this.viewModel._activeProgress&&(e="executing"),this._confirmReset&&(e="clear-trace-results"),w("calcite-tab",{key:`${this.id}__results-tab-item`,selected:!0},"executing"===e?this._renderExecutingTraceBlock():null,"results"===e?this.viewModel.traceResults.length?this._renderResultsPanel():this._renderWarningMessage("noTraceExecuted",!1):null,"show-feature-info"===e?this._renderShowFeatureInfoBlock():null,"clear-trace-results"===e?this._renderClearTraceResultsBlock():null)}_renderResultsPanel(){const{messages:e}=this;return w("calcite-block",{class:T.blockContainer,key:`${this.id}__results-block`,label:e.resultsStrings.headerTabResults,open:!0},w("calcite-flow",{class:T.flow},this._renderTraceResults(),this._renderTraceResultFunctions(),this._renderTraceResultByAssetGroup(),this._renderTraceResultByAssetType(),this._renderTraceResultIndividual()))}_renderResultRowFunctions(e){return w("calcite-block",{collapsible:!1,heading:e.networkAttributeName+" "+e.functionType+" = "+e.result,overlayPositioning:"fixed"})}_renderResultRowAssetGroup(e){const t=this._getAssetGroupName(e[0]);return w("calcite-list-item",{key:`${t}-${e.assetGroupCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetType(this._groupResultsByAssetType(e),t+" ("+e.length+")","assetType")}},w("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowAssetType(e){const t=this._getAssetTypeName(e[0]);return w("calcite-list-item",{key:`${t}-${e.assetTypeCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this._updatingHandles.addPromise(this.viewModel.queryFeaturesById(e).then((s=>{if(s?.length){this._resultObjectIdField=s[0].layer.objectIdField,"objectid"===this._resultDisplayField&&(this._resultDisplayField=s[0].layer.objectIdField),"objectid"===this._resultSortField&&(this._resultSortField=s[0].layer.objectIdField);const i=this._appendAttributes(e,s,"objectId");this.switchToFromIndividualRecords(i,t+" ("+e.length+")","records")}else this.switchToFromIndividualRecords(e,t+" ("+e.length+")","records")})))}},w("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowIndividual(e){const{messages:t}=this;let s,i=null;if(i=e?.details?.fields.find((({name:e})=>e===this._resultDisplayField)),"date"===i?.type){s=new Date(e.details.attributes[this._resultDisplayField]).toDateString()}else if("assetgroup"===this._resultDisplayField.toLowerCase())s=this._getAssetGroupName(e);else if("assettype"===this._resultDisplayField.toLowerCase())s=this._getAssetTypeName(e);else if(i?.domain&&M(i.domain)){const t=i.domain.codedValues.find((({code:t})=>t===e.details.attributes[this._resultDisplayField]));s=t?.name}else s=e.details?.attributes[this._resultDisplayField]??e.objectId;return s&&""!==s&&null!==s?"string"==typeof s&&(s.trim()||(s=t.resultsStrings.noValue)):s=t.resultsStrings.noValue,w("calcite-list-item",{key:e.details.uid,label:s,onCalciteListItemSelect:async()=>{this._disablePopup(),this._showFeatureInfoActive=!0;const t=d(e.details?.layer)?e.details?.layer:null;if(t){const s=Object.keys(e.details.attributes).find((e=>e.toLowerCase()===t.subtypeField.toLowerCase()))??"assetgroup",i=t.sublayers.find((t=>t.subtypeCode===e.details.attributes[s])),r=Object.keys(e.details.attributes).find((e=>e.toLowerCase()===t.objectIdField.toLowerCase()))??"objectid",o=new u;o.outFields=["*"],o.returnGeometry=!0,o.where=r+" = "+e.details.attributes[r];const l=await(i?.queryFeatures(o));l&&this._resultFeatureWidget.open(l.features[0])}else this._resultFeatureWidget.open(e.details)}},w("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderShowFeatureInfoBlock(){const{messages:e}=this;return w("calcite-block",{class:T.blockContainer,key:`${this.id}__show-feature-info-block`,label:e.resultsStrings.headerFeatureInfo,open:!0},this._resultFeatureWidget.render())}_renderStartFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter((e=>"starting-point"===e.type)),s.forEach((e=>{e.displayValue&&t.push(this._renderFlagRow(e,"start"))}));let i=null;return this._symbolStartFlag&&(i=this._getSymbolIcon(this._symbolStartFlag)),w("calcite-block",{class:T.blockContent,collapsible:!0,heading:e.inputsStrings.headerStartingPoint+" ("+s.length+")",open:!0,overlayPositioning:"fixed"},w("div",{slot:"icon"},i||w("calcite-icon",{icon:"pin",scale:"s"})),w("div",null,e.inputsStrings.startingPointHint),w("div",{class:T.listContainer},t),this._warningNoStartAssetFound?this._renderWarningMessage("noStartAsset",!0):null,w("div",{class:T.addButtonContainer},w("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("starting-point")}},w("calcite-dropdown-group",{selectionMode:"none"},w("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("starting-point")}},e.inputsStrings.addNonspatialOption)))))}_renderStartOverContainer(){const{messages:e}=this;return w("calcite-fab",{appearance:"solid",icon:"trash",kind:"brand",onclick:()=>{this.confirmReset()},slot:"fab",text:e.resultsStrings.startOverButton,textEnabled:!0,title:e.resultsStrings.startOverButton,type:"button"})}_renderTraceResultByAssetGroup(){const e=this._traceResultsAssetGroup,t=[];for(const s in e){const i=e[s];for(const e in i)t.push(this._renderResultRowAssetGroup(i[e]))}return w("calcite-flow-item",{heading:this._traceHeaderForFlow,key:"assetGroupResultMultiple",selected:"assetGroup"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetGroup([],"","result")}},w("calcite-list",{label:""},t),this._renderStartOverContainer())}_renderTraceResultByAssetType(){const e=this._traceResultsAssetType,t=[];for(const s in e)e[s].length>0&&t.push(this._renderResultRowAssetType(e[s]));return w("calcite-flow-item",{heading:this._assetGroupHeader,key:"assetTypeResult",loading:this._updatingHandles.updating,selected:"assetType"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetType([],"","assetGroup")}},w("calcite-list",{label:"",selectionMode:"none"},t),this._renderStartOverContainer())}_renderTraceResultFunctions(){if("functions"!==this._traceResultsState)return null;const{messages:e}=this,t=this._traceResultsFunctions,s=[];return t.forEach((e=>{s.push(this._renderResultRowFunctions(e))})),w("calcite-flow-item",{heading:e.resultsStrings.functionHeader,key:"functionResultMultiple",selected:"functions"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromFunctions([],"result")}},s,this._renderStartOverContainer())}_renderTraceResultIndividual(){const{messages:e}=this,t=this._traceResultsIndividual;t.sort(this._compare(this._resultSortField,this._resultSortOrder));const s=[];if(t.length>0){(t[0].details?.fields.some((({name:e})=>e.toLowerCase()===this._resultDisplayField.toLocaleLowerCase()))??!1)||(this._resultDisplayField=this._resultObjectIdField,this._resultSortField=this._resultObjectIdField),t.forEach((e=>{e?.details&&s.push(this._renderResultRowIndividual(e))})),0===s.length&&s.push(w("calcite-list-item",{label:e.resultsStrings.noFeaturesInMap}))}return w("calcite-flow-item",{heading:this._assetTypeHeader,key:"individualResult",selected:"records"===this._traceResultsState,onCalciteFlowItemBack:()=>{this._showResultOptions=!1,this.switchToFromIndividualRecords([],"","assetType")}},w("calcite-action",{afterCreate:m,bind:this,"data-node-ref":"_individualResultNode",icon:"gear",id:"field_options"+this.id,label:e.resultsStrings.displayAttribute,onclick:()=>{this._showResultOptions=!0},slot:"header-actions-end",text:e.resultsStrings.displayAttribute}),this._renderTraceResultIndividualPopover(),w("calcite-list",{label:"",selectionMode:"none"},s),this._renderStartOverContainer())}_renderTraceResultIndividualPopover(){const{messages:e}=this,t=this._traceResultsIndividual,s=[],i=[];return t.length>0&&(t[0].details?t[0].details.fields.forEach((({name:e,alias:t})=>{s.push(w("calcite-option",{key:`display-${e}`,label:t??e,selected:e===this._resultDisplayField,value:e})),i.push(w("calcite-option",{key:`sort-${e}`,label:t??e,selected:e===this._resultSortField,value:e}))})):(s.push(w("calcite-option",{key:`display-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})),i.push(w("calcite-option",{key:`sort-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})))),w("calcite-popover",{autoClose:!0,label:e.resultsStrings.displayAttribute,offsetDistance:0,offsetSkidding:0,open:this._showResultOptions,overlayPositioning:"fixed",placement:"left-start",referenceElement:this._individualResultNode,styles:null!==this.domNode?F(.75*this.domNode.clientWidth):C()},w("calcite-block",{label:e.resultsStrings.displayAttribute,open:!0,overlayPositioning:"fixed"},w("calcite-label",{scale:"s"},e.resultsStrings.displayAttribute,w("calcite-select",{label:e.resultsStrings.displayAttribute,scale:"s",onCalciteSelectChange:e=>{const t=e.currentTarget;this._resultDisplayField=t.selectedOption.value,this._showResultOptions=!1}},s)),w("calcite-label",{scale:"s"},e.resultsStrings.sortBy,w("calcite-select",{label:e.resultsStrings.sortBy,scale:"s",onCalciteSelectChange:e=>{const s=e.currentTarget;this._resultSortField=s.selectedOption.value,t.sort(this._compare(this._resultSortField,this._resultSortOrder)),this._traceResultsIndividual=t,this._showResultOptions=!1}},i))))}_renderTraceResults(){const{messages:e,messagesCommon:t}=this,{selectFeatures:s}=e.resultsStrings,i=this.viewModel.traceResults,r=[];return i.forEach(((t,i)=>{let o=[],l=[],a=!1,n=!1,c=!1,d="";null!==t.results&&t.results.hasOwnProperty("elements")?(null!==t.results.aggregatedGeometry&&(n=!0),null!==t.results.globalFunctionResults&&t.results.globalFunctionResults.length>0&&(l=t.results.globalFunctionResults,l.length>0&&(c=!0)),t.results.elements&&t.results.elements.length>0&&(o=t.results.elements,o.length>0&&(a=!0)),(n||a)&&(d=this.messagesUnits.units[t.resultArea?.unit]?.abbr),r.push(w("calcite-block",{class:T.blockContent,collapsible:!0,description:t.trace.description??"",heading:t.trace.title,key:`${t.trace.title}${i}`,open:!0,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),w("calcite-list",{label:""},c?w("calcite-list-item",{label:e.resultsStrings.functionHeader+" ("+l.length+")",onCalciteListItemSelect:()=>{this.switchToFromFunctions(l,"functions")}},w("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):null,a&&this.viewModel.showSelectionAttributes?w("calcite-list-item",{key:this.id,label:e.resultsStrings.viewFeatures+" ("+o.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetGroup(this._groupResultsByAssetGroup(t),t.trace.title+" ("+o.length+")","assetGroup")}},w("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):this.viewModel.showSelectionAttributes?w("calcite-label",{layout:"inline",scale:"s"},e.resultsStrings.noSelectionResults):null),a?w("div",{class:T.doublePaddingTop},w("calcite-label",{layout:"inline",onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)},scale:"s"},w("calcite-checkbox",{checked:t.selectionEnabled,onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)}}),this.viewModel.showSelectionAttributes?s:`${s} (${o.length})`)):null,n?w("calcite-block-section",{key:`aggregate-${t.trace.title}-${i}`,open:t.graphicEnabled,text:e.resultsStrings.highlightTrace,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.open?this.viewModel.changeResultGraphicColor(t.graphicColor,t):this.viewModel.removeResultGraphicFromView(t)}},w("calcite-list",{label:e.resultsStrings.graphicColor,selectionMode:"none"},w("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{this._swatchNode=e.currentTarget,this._activeSwatch="aggGeom_"+i}},w("calcite-color-picker-swatch",{color:t.graphicColor.hex,scale:"s",slot:"actions-end"})))):null,this.enableResultArea&&(n||a)?w("calcite-block-section",{key:`area-${t.trace.title}-${i}`,open:t.resultArea?.show,text:e.resultsStrings.resultAreaHeader,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.open?t.resultAreaGraphic?this.viewModel.addResultAreaToMap(t,t.resultAreaGraphic):this.viewModel.addResultAreaToMap(t):this.viewModel.removeResultAreaFromMap(t)}},w("calcite-list",{label:"",selectionMode:"none"},w("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{const t=e.currentTarget;this._swatchNode=t,this._activeSwatch="resultArea_"+i}},w("calcite-color-picker-swatch",{color:t.resultArea?.color.hex,scale:"s",slot:"actions-end"}))),w("calcite-list",{label:"",selectionMode:"none"},w("calcite-list-item",{label:e.resultsStrings.resultAreaBuffer},w("calcite-input-number",{afterCreate:this._afterComponentCreate,class:T.numberInput,max:999999,min:0,scale:"s",slot:"actions-end",suffixText:d,value:t.resultArea?.distance.toString(),onCalciteInputNumberChange:e=>{if(!this.view?.popup)return;this.view.popup.visible&&this.view.closePopup();const s=e.currentTarget;t.resultArea.distance>=0?(t.resultArea.distance=parseInt(s.value,10),this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t)):(t.resultArea.distance=0,this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t))}})))):null,w("calcite-popover",{autoClose:!0,closable:!0,label:e.resultsStrings.graphicColor,offsetDistance:0,offsetSkidding:0,open:this._activeSwatch==="aggGeom_"+i||this._activeSwatch==="resultArea_"+i,overlayPositioning:"fixed",placement:"auto-start",referenceElement:this._swatchNode,scale:"s",onCalcitePopoverClose:()=>{this._swatchNode=null,this._activeSwatch=null}},this._renderHighlightColorPicker(this._activeSwatch==="resultArea_"+i?t.resultArea?.color:t.graphicColor,t,this._activeSwatch==="resultArea_"+i?"resultArea":"aggregate"))))):r.push(w("calcite-block",{collapsible:!1,heading:t.trace.title,key:"error-"+i,open:!0,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),this._renderWarningMessage("noController",!1,t.status)))})),w("calcite-flow-item",{key:"traceResults",selected:"result"===this._traceResultsState},r,this._renderStartOverContainer(),this._alertRemoveModal?w("calcite-scrim",{key:"prompt"},w("div",{class:T.clearPrompt},w("h3",{slot:"header"},e.globalStrings.clearResults),w("div",{slot:"content"},e.alertsStrings.clearResultsAlert),w("div",{class:T.promptDivider}),w("div",{styles:A("row")},w("calcite-button",{appearance:"outline",onclick:()=>{this._alertRemoveModal=!1},slot:"secondary",width:"full"},t.cancel),w("calcite-button",{onclick:()=>{this._activeTrace&&this.viewModel.clearResult(this._activeTrace),this._alertRemoveModal=!1,0===this.viewModel.traceResults.length?this.switchTab("input"):(this._activeTrace=this.viewModel.traceResults[0].trace,this._traceResultsState="result")},slot:"primary",width:"full"},t.form.ok)))):null)}_renderTraceSelectorContainer(){const{messages:e}=this,t=this.viewModel.traces.map((e=>this._renderComboboxItem({value:e.globalId,text:e.title,selected:e.selected??!1}))),s=this.viewModel.traces.filter((e=>e.selected)),i=e.tracingStrings.traceOperation+` (${s.length})`;return w("calcite-block",{class:T.blockContent,collapsible:!0,heading:i,open:!0,overlayPositioning:"fixed"},w("calcite-icon",{icon:"utility-network-trace",scale:"s",slot:"icon"}),w("calcite-combobox",{label:e.inputsStrings.selectTraces,maxItems:0,overlayPositioning:"fixed",placeholder:e.inputsStrings.selectTraces,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:e=>{this.viewModel.traces.forEach((t=>{t.selected=e.currentTarget.selectedItems.some((e=>e.value===t.globalId))})),e.currentTarget.selectedItems.length&&(this._warningNoTraceSelected=!1)}},t))}_renderUtilityNetworkTrace(){const{viewModel:e,viewModel:{utilityNetwork:t}}=this,s=e.view?.map,{messages:i}=this;let r=w("calcite-tabs",{layout:"center",position:"top",styles:R(this.container)},w("calcite-tab-nav",{slot:"title-group"},w("calcite-tab-title",{onclick:()=>{this.switchTab("input")},selected:"input"===this._activeTab},i.inputsStrings.headerTabInputs),w("calcite-tab-title",{onclick:()=>{this.switchTab("results")},selected:"results"===this._activeTab},i.resultsStrings.headerTabResults)),this._renderInputsTab(),this._renderResultsTab());return(!s.utilityNetworks?.length&&!t||t&&!t.sharedNamedTraceConfigurations.length)&&(r=w("calcite-panel",null,this._renderWarningMessage("noTraceConfig",!1))),this._loadUnError||(r=w("calcite-panel",null,this._renderWarningMessage("loadUNError",!1,this._errorMessage))),r}_renderWarningMessage(e,t,s){const{messages:i}=this;let r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;switch(e){case"flag":r=i.alertsStrings.startingPointAlertHeader,o=i.alertsStrings.startingPointAlert;break;case"noTerminal":r=i.alertsStrings.noTerminalDefinedHeader,o=i.alertsStrings.noTerminalDefined;break;case"trace":r=i.alertsStrings.selectTraceAlertHeader,o=i.alertsStrings.selectTraceAlert;break;case"noTraceExecuted":r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;break;case"noBarrierAsset":case"noStartAsset":r=i.alertsStrings.noAssetsFoundHeader,o=i.alertsStrings.noAssetFound;break;case"noTraceConfig":r="",o=i.alertsStrings.noTraceSupported;break;default:r=i.alertsStrings.genericErrorHeader,o=s||""}return w("div",{class:T.noticeContainer,key:e},w("calcite-notice",{closable:t,icon:!0,key:e,kind:"danger",open:!0,scale:"s",width:"auto",onCalciteNoticeClose:()=>{switch(e){case"flag":this._warningNoFlag=!1;break;case"noTerminal":this._warningNoTerminal=!1;break;case"trace":this._warningNoTraceSelected=!1;break;case"noStartAsset":this._warningNoStartAssetFound=!1;break;case"noBarrierAsset":this._warningNoBarrierAssetFound=!1}}},w("div",{slot:"title"},r),w("div",{slot:"message"},o)))}_afterComponentCreate(e){"value"in e&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"})}_appendAttributes(e,t,s){const i=[];return e.forEach((e=>{t.forEach((t=>{t.featureSet.features.forEach((r=>{e[s]===r.attributes[this._resultObjectIdField]&&(e.details=r,e.details.fields=t.featureSet.fields,i.push(e))}))}))})),i}_changeCursor(e="default"){const t=this.view?.container?.style;t&&(t.cursor=e)}_disablePopup(){const{view:e}=this;e.popupEnabled=!1,e.closePopup()}_compare(e,t){return(s,i)=>{let r=0,o=s.details?.attributes[e]??s.objectId,l=i.details?.attributes[e]??i.objectId;return isNaN(o)&&(o=o.toLowerCase()),isNaN(l)&&(l=l.toLowerCase()),"desc"===t?o>l?r=1:o<l&&(r=-1):o<l?r=1:o>l&&(r=-1),r}}_getAssetGroupName(e){let t=e.assetGroupCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find((t=>t.sourceId===e.networkSourceId));if(i){const e=i.assetGroups.find((e=>e.assetGroupCode===s));e&&(t=e.assetGroupName)}return t}_getAssetTypeName(e){let t=e.assetTypeCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find((t=>t.sourceId===e.networkSourceId));if(i){const r=i.assetGroups.find((e=>e.assetGroupCode===s));if(r){const s=r.assetTypes.find((t=>t.assetTypeCode===e.assetTypeCode));s&&(t=s.assetTypeName)}}return t}_getSymbolIcon(e){return"picture-marker"===e.type?w("img",{height:e.height,src:e.url??void 0,width:e.width}):null}_groupBy(e,t){return e.reduce(((e,s)=>((e[s[t]]=e[s[t]]||[]).push(s),e)),{})}_groupResultsByAssetGroup(e){const t=[],s=e.results?.elements,i=this._groupBy(s??[],"networkSourceId");for(const r in i)t.push(this._groupBy(i[r],"assetGroupCode"));return t}_groupResultsByAssetType(e){return this._groupBy(e,"assetTypeCode")}_mixCustomStrings(){const{messages:e}=this;this.inputSettings.length>0&&this.inputSettings.forEach((t=>{"starting-point"===t.type&&(e.inputsStrings.headerStartingPoint=t.label,e.inputsStrings.startingPointHint=t.description),"barrier"===t.type&&(e.inputsStrings.headerBarrier=t.label,e.inputsStrings.barrierPointHint=t.description)}))}_overrideFlagSymbol(){this.inputSettings.length>0&&this.inputSettings.forEach((e=>{"starting-point"===e.type?this._symbolStartFlag=e.symbol:this._symbolBarrier=e.symbol,this.viewModel.changeFlagSymbol(e.type,e.symbol)}))}_processFlagOnLoad(){return this.view?.when().then((()=>{this._watchHandler=o((()=>!this.view?.updating),(async()=>{this._warningNoFlag=!1,this._warningNoBarrierAssetFound=!1,this._warningNoStartAssetFound=!1;const e=await this.viewModel.addFlagsOnLoad();this.viewModel.removeFlagsOnLoadWatcher(),e.includes("barrier")&&(this._warningNoBarrierAssetFound=!0),e.includes("starting-point")&&(this._warningNoStartAssetFound=!0),this.disabled=!1,null!==this._watchHandler&&this._watchHandler.remove()}))}))}_registerWatchers(){this.addHandles([i((()=>this.selectedTraces),(()=>{this.viewModel.selectTracesOnLoad(),this.scheduleRender()})),i((()=>this.defaultGraphicColor),(()=>{this.viewModel.traceResults.length>0&&this.viewModel.traceResults.forEach((e=>{this.viewModel.changeResultGraphicColor(this.viewModel.defaultGraphicColor,e)})),this.scheduleRender()}))])}_renderComboboxItem({text:e,value:t,selected:s}){return w("calcite-combobox-item",{key:t,selected:s,textLabel:e,value:t})}_resetResultFeatureWidget(){this._showFeatureInfoActive=!1,this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled}_setupAddNonspatialObject(e){this._disablePopup(),this._traceLocationType=e,this._addNonspatialObjectActive=!0}_setupAddTraceLocation(e){this._traceLocationType=e,this._changeCursor("crosshair"),this._selectToolActive=!0,this._addNonspatialObjectActive=!1,this._warningNoStartAssetFound=!1,this._warningNoBarrierAssetFound=!1,this.viewModel.addFlagByHit(this._traceLocationType,this._symbolStartFlag).then((e=>{this._changeCursor("default"),e?this._warningNoFlag=!1:(this._warningNoStartAssetFound="starting-point"===this._traceLocationType,this._warningNoBarrierAssetFound="barrier"===this._traceLocationType),this._selectToolActive=!1}))}_utilityNetworkTraceInitialized(){this.viewModel.loadUtilityNetwork().then((e=>{e&&(this.viewModel.selectTracesOnLoad(),this._registerWatchers(),this.viewModel.flags.length>0&&this._processFlagOnLoad()),this.disabled=!1})).catch((e=>{const{messages:t}=this;this._loadUnError=!1,"utility-network:no-user-type-extension"===e.name||e.details.raw.extendedCode===N.noExtension?this._errorMessage=t.alertsStrings.noUserExtension:this._errorMessage=e.message,this.disabled=!1}))}};e([l()],x.prototype,"_activeTab",void 0),e([l()],x.prototype,"_activeTrace",void 0),e([l()],x.prototype,"_activeSwatch",void 0),e([l()],x.prototype,"_addNonspatialObjectActive",void 0),e([l()],x.prototype,"_alertRemoveModal",void 0),e([l()],x.prototype,"_assetGroupHeader",void 0),e([l()],x.prototype,"_assetTypeHeader",void 0),e([l()],x.prototype,"_confirmReset",void 0),e([l()],x.prototype,"_errorMessage",void 0),e([l()],x.prototype,"_swatchNode",void 0),e([l()],x.prototype,"_selectToolActive",void 0),e([l()],x.prototype,"_showFeatureInfoActive",void 0),e([l()],x.prototype,"_traceHeaderForFlow",void 0),e([l()],x.prototype,"_traceResultsFunctions",void 0),e([l()],x.prototype,"_traceResultsAssetGroup",void 0),e([l()],x.prototype,"_traceResultsAssetType",void 0),e([l()],x.prototype,"_traceResultsIndividual",void 0),e([l()],x.prototype,"_traceResultsState",void 0),e([l()],x.prototype,"_warningNoFlag",void 0),e([l()],x.prototype,"_warningNoTraceSelected",void 0),e([l()],x.prototype,"_updatingHandles",void 0),e([l()],x.prototype,"defaultGraphicColor",null),e([l()],x.prototype,"disabled",void 0),e([l()],x.prototype,"enableResultArea",null),e([l()],x.prototype,"flags",null),e([l()],x.prototype,"gdbVersion",null),e([l()],x.prototype,"icon",null),e([l()],x.prototype,"inputSettings",void 0),e([l()],x.prototype,"label",null),e([l(),_("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")],x.prototype,"messages",void 0),e([l(),_("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([l(),_("esri/core/t9n/Units")],x.prototype,"messagesUnits",void 0),e([l()],x.prototype,"resultAreaProperties",null),e([l()],x.prototype,"selectedTraces",null),e([l()],x.prototype,"selectOnComplete",null),e([l()],x.prototype,"showGraphicsOnComplete",null),e([l()],x.prototype,"showSelectionAttributes",null),e([l()],x.prototype,"utilityNetwork",null),e([l()],x.prototype,"view",null),e([b(["add-flag","add-flag-complete","add-flag-error","select-features","clear-selection","add-result-area","remove-result-area","create-result-area","reset"]),l({type:y})],x.prototype,"viewModel",void 0),x=e([a("esri.widgets.UtilityNetworkTrace")],x);const I=x;export{I as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{deprecatedFunction as t}from"../core/deprecate.js";import s from"../core/Logger.js";import{watch as i,on as r,when as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as n}from"../core/support/UpdatingHandles.js";import c from"../layers/support/CodedValueDomain.js";import{isSubtypeGroupLayer as d}from"../layers/support/layerUtils.js";import u from"../rest/support/Query.js";import h from"./Widget.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{storeNode as m}from"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{vmEvent as b}from"./support/decorators/vmEvent.js";import{tsx as w}from"./support/jsxFactory.js";import v from"./UtilityNetworkTrace/UtilityNetworkTraceFeature.js";import y from"./UtilityNetworkTrace/UtilityNetworkTraceViewModel.js";import{defaultSwatchColors as f}from"./UtilityNetworkTrace/support/GraphicHandler.js";const S="esri-utility-network-trace",T={base:S,addButtonContainer:`${S}__add-button-container`,blockContainer:`${S}__block-container`,blockContent:`${S}__block-content`,clearPrompt:`${S}__reset-prompt`,doublePaddingTop:`${S}__double-pad-top`,flow:`${S}__flow`,listContainer:`${S}__list-container`,noticeContainer:`${S}__notice-container`,numberInput:`${S}__number-input`,promptDivider:`${S}__divider`};function k(e){return{height:e+"px"}}function F(e){return{width:e+"px"}}function C(){return{width:"75%"}}function A(e){return{width:"100%",height:window.getComputedStyle(e).getPropertyValue("max-height")}}function R(e){return{display:"flex",flexDirection:e}}function N(e){return e instanceof c}const M={noExtension:-2147208474};let x=class extends h{constructor(e,t){super(e,t),this._activeTab="input",this._activeTrace=null,this._activeSwatch="",this._addNonspatialObjectActive=!1,this._alertRemoveModal=!1,this._assetGroupHeader="",this._assetTypeHeader="",this._confirmReset=!1,this._errorMessage="",this._swatchNode=null,this._selectToolActive=!1,this._showFeatureInfoActive=!1,this._traceHeaderForFlow="",this._traceResultsFunctions=[],this._traceResultsAssetGroup=[],this._traceResultsAssetType=[],this._traceResultsIndividual=[],this._traceResultsState="result",this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._findNonspatialFeatureWidget=new v({mode:"add-nso"}),this._individualResultNode=null,this._loadUnError=!0,this._resultDisplayField="objectid",this._resultFeatureWidget=new v({mode:"show-feature-info"}),this._resultObjectIdField="objectid",this._resultSortField="objectid",this._resultSortOrder="desc",this._showResultOptions=!1,this._symbolStartFlag=null,this._symbolBarrier=null,this._traceLocationType="starting-point",this._updatingHandles=new n,this._warningNoBarrierAssetFound=!1,this._warningNoBarrierAssetNsoFound=!1,this._warningNoStartAssetFound=!1,this._warningNoStartAssetNsoFound=!1,this._warningNoTerminal=!1,this._wasPopupEnabled=!1,this._watchHandler=null,this.disabled=!0,this.inputSettings=[],this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.viewModel=new y,this._afterComponentCreate=this._afterComponentCreate.bind(this)}initialize(){this._wasPopupEnabled=!!this.view&&this.view.popupEnabled,this._findNonspatialFeatureWidget.view=this.view,this._resultFeatureWidget.view=this.view,this._utilityNetworkTraceInitialized(),this.addHandles([i((()=>this.viewModel?.resultAreaProperties),(()=>this.scheduleRender())),i((()=>this._addNonspatialObjectActive),(e=>{this._findNonspatialFeatureWidget.feature=null,e?this._changeCursor("crosshair"):this.view.popupEnabled=this._wasPopupEnabled})),i((()=>this._showFeatureInfoActive),(e=>{e||(this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled)})),r((()=>this._findNonspatialFeatureWidget),"add-nso-trace-location",(({featureWidget:e})=>{this.viewModel.addNonspatialTraceLocation(e.graphic,this._traceLocationType),this._warningNoFlag=!1,this._addNonspatialObjectActive=!1})),r((()=>this._findNonspatialFeatureWidget),"close-un-trace-feature-block",(()=>{this._addNonspatialObjectActive=!1})),r((()=>this._resultFeatureWidget),"close-un-trace-feature-block",(()=>{this._showFeatureInfoActive=!1})),r((()=>this._resultFeatureWidget),"close",(()=>{this._resetResultFeatureWidget()}))])}destroy(){this._findNonspatialFeatureWidget?.destroy(),this._resultFeatureWidget?.destroy()}get defaultGraphicColor(){return this.viewModel.defaultGraphicColor}set defaultGraphicColor(e){this.viewModel.defaultGraphicColor=e}get enableResultArea(){return this.viewModel.enableResultArea}set enableResultArea(e){this.viewModel.enableResultArea=e}get flags(){return this.viewModel.flags}set flags(e){this.viewModel.flags=e}get gdbVersion(){return t(s.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this.viewModel.gdbVersion}set gdbVersion(e){t(s.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this.viewModel.gdbVersion=e}get icon(){return"utility-network-trace"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get resultAreaProperties(){return this.viewModel.resultAreaProperties}set resultAreaProperties(e){this.viewModel.resultAreaProperties=e}get selectedTraces(){return this.viewModel.selectedTraces}set selectedTraces(e){this.viewModel.selectedTraces=e}get selectOnComplete(){return this.viewModel.selectOnComplete}set selectOnComplete(e){this.viewModel.selectOnComplete=e}get showGraphicsOnComplete(){return this.viewModel.showGraphicsOnComplete}set showGraphicsOnComplete(e){this.viewModel.showGraphicsOnComplete=e}get showSelectionAttributes(){return this.viewModel.showSelectionAttributes}set showSelectionAttributes(e){this.viewModel.showSelectionAttributes=e}get utilityNetwork(){return this.viewModel.utilityNetwork}set utilityNetwork(e){this.viewModel.utilityNetwork=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}async checkCanTrace(){this._confirmReset=!1,this._resetResultFeatureWidget();const e=this.viewModel.checkCanTrace();e.status?(this._warningNoFlag=!1,this._warningNoTraceSelected=!1,this._warningNoTerminal=!1,this._traceResultsState="result",this.switchTab("results"),this.viewModel._activeProgress=!0,this.viewModel.removeAllResultAreaGraphics(),await this.viewModel.callTrace(),this.viewModel._activeProgress=!1):e.issues.forEach((e=>{switch(e){case"noStartingPoints":this._warningNoFlag=!0;break;case"noTerminalSelected":this._warningNoTerminal=!0;break;default:this._warningNoTraceSelected=!0}}))}confirmReset(){this._confirmReset=!0}render(){return this._mixCustomStrings(),this._overrideFlagSymbol(),w("div",{class:this.classes(T.base,g.widget,g.panel,{[g.widgetDisabled]:this.disabled})},this._renderUtilityNetworkTrace())}loadDependencies(){return p({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-pad":()=>import("@esri/calcite-components/dist/components/calcite-action-pad"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),"color-picker-swatch":()=>import("@esri/calcite-components/dist/components/calcite-color-picker-swatch"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),fab:()=>import("@esri/calcite-components/dist/components/calcite-flow"),flow:()=>import("@esri/calcite-components/dist/components/calcite-fab"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),"split-button":()=>import("@esri/calcite-components/dist/components/calcite-split-button"),tab:()=>import("@esri/calcite-components/dist/components/calcite-tab"),"tab-nav":()=>import("@esri/calcite-components/dist/components/calcite-tab-nav"),"tab-title":()=>import("@esri/calcite-components/dist/components/calcite-tab-title"),tabs:()=>import("@esri/calcite-components/dist/components/calcite-tabs")})}switchTab(e){this._activeTab=e}switchToFromAssetGroup(e,t,s){this._traceHeaderForFlow=t,this._traceResultsAssetGroup=e,this._traceResultsState=s}switchToFromAssetType(e,t,s){this._assetGroupHeader=t,this._traceResultsAssetType=e,this._traceResultsState=s}switchToFromFunctions(e,t){this._traceResultsFunctions=e,this._traceResultsState=t}switchToFromIndividualRecords(e,t,s){this._assetTypeHeader=t,this._traceResultsIndividual=e,this._traceResultsState=s}_renderAddNonspatialLocationBlock(){const{messages:e}=this;return w("calcite-block",{key:`${this.id}__add-spatial-location-block`,label:e.inputsStrings.addNonspatialOption,open:!0},this._findNonspatialFeatureWidget.render())}_renderAddSpatialLocationBlock(){const{messages:e,messagesCommon:t}=this;return w("calcite-block",{class:T.blockContent,heading:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier,key:`${this.id}__add-nonspatial-location-block`,label:"starting-point"===this._traceLocationType?e.inputsStrings.headerStartingPoint:e.inputsStrings.headerBarrier,open:!0},w("calcite-action",{icon:"x",onclick:()=>{this.viewModel.removeClickHandler(),this.view?.popup&&(this.view.popupEnabled=this._wasPopupEnabled),this._changeCursor("default"),this._selectToolActive=!1},slot:"control",text:t.close}),w("calcite-notice",{icon:"starting-point"===this._traceLocationType?"pin-plus":"x-circle-f",kind:"info",open:!0},w("div",{slot:"message"},e.inputsStrings.addPointHint)))}_renderClearTraceResultsBlock(){const{messages:e,messagesCommon:t}=this;return w("calcite-scrim",{key:"prompt"},w("div",{class:T.clearPrompt},w("h3",{slot:"header"},e.resultsStrings.startOverButton),w("div",{slot:"content"},e.resultsStrings.startOverValidation),w("div",{class:T.promptDivider}),w("div",{styles:R("row")},w("calcite-button",{appearance:"outline",onclick:()=>{this._confirmReset=!1},slot:"secondary",width:"full"},t.cancel),w("calcite-button",{onclick:()=>{this._confirmReset=!1,this.viewModel.reset(),this.switchTab("input")},slot:"primary",width:"full"},t.form.ok))))}_renderExecutingTraceBlock(){const{messages:e}=this;return w("calcite-loader",{label:e.alertsStrings.traceExecuting,text:e.alertsStrings.traceExecuting,type:"indeterminate"})}_renderInputBlock(){const{messages:e}=this;return w("calcite-block",{class:T.blockContainer,key:`${this.id}__inputs-block`,label:e.inputsStrings.headerTabInputs,open:!0},w("calcite-flow",{class:T.flow},w("calcite-flow-item",{key:`${this.id}__inputs-flow-item`,selected:!this._selectToolActive&&!this._addNonspatialObjectActive},this._warningNoFlag?this._renderWarningMessage("flag",!0):null,this._warningNoTerminal?this._renderWarningMessage("noTerminal",!0):null,this._warningNoTraceSelected?this._renderWarningMessage("trace",!0):null,this._renderTraceSelectorContainer(),this._renderStartFlagsContainer(),this._renderBarriersFlagsContainer(),this._warningNoFlag&&this._warningNoTraceSelected?w("div",{styles:k(10)}):null,w("calcite-fab",{appearance:"solid",icon:"utility-network-trace",kind:"brand",onclick:()=>{this.checkCanTrace()},slot:"fab",text:e.tracingStrings.runTrace,textEnabled:!0,title:e.tracingStrings.runTrace,type:"button"}))))}_renderInputsTab(){const{messagesCommon:e}=this;let t="input";return this._selectToolActive&&!this._addNonspatialObjectActive&&(t="add-spatial-location"),!this._selectToolActive&&this._addNonspatialObjectActive&&(t="add-nso-location"),this.disabled&&(t="loading"),w("calcite-tab",{key:`${this.id}__inputs-tab-item`,selected:"input"===this._activeTab},"loading"===t?w("calcite-loader",{label:e.loading,type:"indeterminate"}):null,"input"===t?this._renderInputBlock():null,"add-spatial-location"===t?this._renderAddSpatialLocationBlock():null,"add-nso-location"===t?this._renderAddNonspatialLocationBlock():null)}_renderBarriersFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter((e=>"barrier"===e.type)),s.forEach((e=>{e.displayValue&&t.push(this._renderFlagRow(e,"barrier"))}));let i=null;return this._symbolBarrier&&(i=this._getSymbolIcon(this._symbolBarrier)),w("calcite-block",{class:T.blockContent,collapsible:!0,heading:e.inputsStrings.headerBarrier+" ("+s.length+")",open:!0,overlayPositioning:"fixed"},w("div",{slot:"icon"},i||w("calcite-icon",{icon:"x-circle-f",scale:"s"})),w("div",null,e.inputsStrings.barrierPointHint),w("div",{class:T.listContainer},t),this._warningNoBarrierAssetFound?this._renderWarningMessage("noBarrierAsset",!0):null,this._warningNoBarrierAssetNsoFound?this._renderWarningMessage("noBarrierAssetNso",!0):null,w("div",{class:T.addButtonContainer},w("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("barrier")}},w("calcite-dropdown-group",{selectionMode:"none"},w("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("barrier")}},e.inputsStrings.addNonspatialOption)))))}_renderFlagRow(e,t){const{messages:s,messagesCommon:i}=this,r=[];let o=!1;return null!=e.allTerminals&&e.allTerminals.terminals.length>0&&(o=!0,e.allTerminals.terminals.forEach((t=>{let s=!1;e?.selectedTerminals?.includes(t.id)&&(s=!0),r.push(w("calcite-combobox-item",{key:t.name,selected:s,textLabel:t.name,value:t.id}))}))),w("calcite-block",{collapsible:null!==e.allTerminals||"barrier"===e.type,heading:e.displayValue?.value??"",key:"pop"+e.globalId+e.type+e.id+t,overlayPositioning:"fixed"},w("calcite-action",{icon:"trash",label:i.remove,onclick:()=>{this.viewModel.removeFlag(e)},scale:"s",slot:"header-menu-actions",text:i.remove,textEnabled:!0}),e.mapGraphic&&e.mapPoint?w("calcite-action",{icon:"zoom-to-object",label:s.globalStrings.zoomToFeature,onclick:()=>{this.viewModel.zoomToAsset(e.details.geometry)},scale:"s",slot:"header-menu-actions",text:s.globalStrings.zoomToFeature,textEnabled:!0}):null,"barrier"===e.type?w("calcite-label",{layout:"inline",scale:"s"},w("calcite-checkbox",{checked:e.isFilterBarrier,onclick:()=>{this.viewModel.manageFilterBarrier(!e.isFilterBarrier,e)},scale:"s"}),s.inputsStrings.barrierFilter):null,o?w("calcite-combobox",{label:s.globalStrings.selectTerminalPlaceholder,maxItems:0,overlayPositioning:"fixed",placeholder:s.globalStrings.selectTerminalPlaceholder,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:t=>{t.currentTarget.selectedItems.length>0?(e.selectedTerminals=[],t.currentTarget.selectedItems.forEach((t=>{this.viewModel.addTerminal(t.value,e)}))):e.selectedTerminals=[]},onCalciteComboboxChipClose:t=>{t.preventDefault(),this.viewModel.removeTerminal(t.currentTarget.value,e)}},r):null)}_renderHighlightColorPicker(e,t,s){const{messages:i}=this,{graphicHandler:r}=this.viewModel,o=[],a=new RegExp(`^${e.hex}$`,"i"),l=r.highlightColor.length>f.length?5:4;for(const n of r.highlightColor)o.push(w("calcite-action",{active:a.test(n.hex),key:n.hex,label:i.resultsStrings.graphicColor,onclick:()=>{"aggregate"===s?this.viewModel.changeResultGraphicColor(n,t):this.viewModel.changeResultAreaColor(t,n)},scale:"s",text:i.resultsStrings.graphicColor},w("calcite-color-picker-swatch",{active:a.test(n.hex),color:n.hex,scale:"s"})));return w("calcite-action-pad",{expandDisabled:!0,layout:"grid",position:"start"},w("calcite-action-group",{columns:l},o))}_renderRemoveTraceContainer(e){const{messages:t}=this;return w("calcite-action",{icon:"trash",label:t.globalStrings.clearResults,onclick:()=>{this._alertRemoveModal=!0,this._activeTrace=e.trace},scale:"s",slot:"header-menu-actions",text:t.globalStrings.clearResults,textEnabled:!0})}_renderResultsTab(){let e="results";return this._showFeatureInfoActive&&(e="show-feature-info"),this.viewModel._activeProgress&&(e="executing"),this._confirmReset&&(e="clear-trace-results"),w("calcite-tab",{key:`${this.id}__results-tab-item`},"executing"===e?this._renderExecutingTraceBlock():null,"results"===e?this.viewModel.traceResults.length?this._renderResultsPanel():this._renderWarningMessage("noTraceExecuted",!1):null,"show-feature-info"===e?this._renderShowFeatureInfoBlock():null,"clear-trace-results"===e?this._renderClearTraceResultsBlock():null)}_renderResultsPanel(){const{messages:e}=this;return w("calcite-block",{class:T.blockContainer,key:`${this.id}__results-block`,label:e.resultsStrings.headerTabResults,open:!0},w("calcite-flow",{class:T.flow},this._renderTraceResults(),this._renderTraceResultFunctions(),this._renderTraceResultByAssetGroup(),this._renderTraceResultByAssetType(),this._renderTraceResultIndividual()))}_renderResultRowFunctions(e){return w("calcite-block",{collapsible:!1,heading:e.networkAttributeName+" "+e.functionType+" = "+e.result,overlayPositioning:"fixed"})}_renderResultRowAssetGroup(e){const t=this._getAssetGroupName(e[0]);return w("calcite-list-item",{key:`${t}-${e.assetGroupCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetType(this._groupResultsByAssetType(e),t+" ("+e.length+")","assetType")}},w("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowAssetType(e){const t=this._getAssetTypeName(e[0]);return w("calcite-list-item",{key:`${t}-${e.assetTypeCode}`,label:t+" ("+e.length+")",onCalciteListItemSelect:()=>{this._updatingHandles.addPromise(this.viewModel.queryFeaturesById(e).then((s=>{if(s?.length){this._resultObjectIdField=s[0].layer.objectIdField,"objectid"===this._resultDisplayField&&(this._resultDisplayField=s[0].layer.objectIdField),"objectid"===this._resultSortField&&(this._resultSortField=s[0].layer.objectIdField);const i=this._appendAttributes(e,s,"objectId");this.switchToFromIndividualRecords(i,t+" ("+e.length+")","records")}else this.switchToFromIndividualRecords(e,t+" ("+e.length+")","records")})))}},w("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderResultRowIndividual(e){const{messages:t}=this;let s,i=null;if(i=e?.details?.fields.find((({name:e})=>e===this._resultDisplayField)),"date"===i?.type){s=new Date(e.details.attributes[this._resultDisplayField]).toDateString()}else if("assetgroup"===this._resultDisplayField.toLowerCase())s=this._getAssetGroupName(e);else if("assettype"===this._resultDisplayField.toLowerCase())s=this._getAssetTypeName(e);else if(i?.domain&&N(i.domain)){const t=i.domain.codedValues.find((({code:t})=>t===e.details.attributes[this._resultDisplayField]));s=t?.name}else s=e.details?.attributes[this._resultDisplayField]??e.objectId;return s&&""!==s&&null!==s?"string"==typeof s&&(s.trim()||(s=t.resultsStrings.noValue)):s=t.resultsStrings.noValue,w("calcite-list-item",{key:e.details.uid,label:s,onCalciteListItemSelect:async()=>{this._disablePopup(),this._showFeatureInfoActive=!0;const t=d(e.details?.layer)?e.details?.layer:null;if(t){const s=Object.keys(e.details.attributes).find((e=>e.toLowerCase()===t.subtypeField.toLowerCase()))??"assetgroup",i=t.sublayers.find((t=>t.subtypeCode===e.details.attributes[s])),r=Object.keys(e.details.attributes).find((e=>e.toLowerCase()===t.objectIdField.toLowerCase()))??"objectid",o=new u;o.outFields=["*"],o.returnGeometry=!0,o.where=r+" = "+e.details.attributes[r];const a=await(i?.queryFeatures(o));a&&this._resultFeatureWidget.open(a.features[0])}else this._resultFeatureWidget.open(e.details)}},w("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderShowFeatureInfoBlock(){const{messages:e}=this;return w("calcite-block",{class:T.blockContainer,key:`${this.id}__show-feature-info-block`,label:e.resultsStrings.headerFeatureInfo,open:!0},this._resultFeatureWidget.render())}_renderStartFlagsContainer(){const{messages:e}=this,t=[];let s=[];s=this.viewModel._flags.filter((e=>"starting-point"===e.type)),s.forEach((e=>{e.displayValue&&t.push(this._renderFlagRow(e,"start"))}));let i=null;return this._symbolStartFlag&&(i=this._getSymbolIcon(this._symbolStartFlag)),w("calcite-block",{class:T.blockContent,collapsible:!0,heading:e.inputsStrings.headerStartingPoint+" ("+s.length+")",open:!0,overlayPositioning:"fixed"},w("div",{slot:"icon"},i||w("calcite-icon",{icon:"pin",scale:"s"})),w("div",null,e.inputsStrings.startingPointHint),w("div",{class:T.listContainer},t),this._warningNoStartAssetFound?this._renderWarningMessage("noStartAsset",!0):null,this._warningNoStartAssetNsoFound?this._renderWarningMessage("noStartAssetNso",!0):null,w("div",{class:T.addButtonContainer},w("calcite-split-button",{appearance:"outline-fill",primaryIconStart:"select",primaryText:e.inputsStrings.addPointOption,onCalciteSplitButtonPrimaryClick:()=>{this._setupAddTraceLocation("starting-point")}},w("calcite-dropdown-group",{selectionMode:"none"},w("calcite-dropdown-item",{onCalciteDropdownItemSelect:()=>{this._setupAddNonspatialObject("starting-point")}},e.inputsStrings.addNonspatialOption)))))}_renderStartOverContainer(){const{messages:e}=this;return w("calcite-fab",{appearance:"solid",icon:"trash",kind:"brand",onclick:()=>{this.confirmReset()},slot:"fab",text:e.resultsStrings.startOverButton,textEnabled:!0,title:e.resultsStrings.startOverButton,type:"button"})}_renderTraceResultByAssetGroup(){const e=this._traceResultsAssetGroup,t=[];for(const s in e){const i=e[s];for(const e in i)t.push(this._renderResultRowAssetGroup(i[e]))}return w("calcite-flow-item",{heading:this._traceHeaderForFlow,key:"assetGroupResultMultiple",selected:"assetGroup"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetGroup([],"","result")}},w("calcite-list",{label:""},t),this._renderStartOverContainer())}_renderTraceResultByAssetType(){const e=this._traceResultsAssetType,t=[];for(const s in e)e[s].length>0&&t.push(this._renderResultRowAssetType(e[s]));return w("calcite-flow-item",{heading:this._assetGroupHeader,key:"assetTypeResult",loading:this._updatingHandles.updating,selected:"assetType"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromAssetType([],"","assetGroup")}},w("calcite-list",{label:"",selectionMode:"none"},t),this._renderStartOverContainer())}_renderTraceResultFunctions(){if("functions"!==this._traceResultsState)return null;const{messages:e}=this,t=this._traceResultsFunctions,s=[];return t.forEach((e=>{s.push(this._renderResultRowFunctions(e))})),w("calcite-flow-item",{heading:e.resultsStrings.functionHeader,key:"functionResultMultiple",selected:"functions"===this._traceResultsState,onCalciteFlowItemBack:()=>{this.switchToFromFunctions([],"result")}},s,this._renderStartOverContainer())}_renderTraceResultIndividual(){const{messages:e}=this,t=this._traceResultsIndividual;t.sort(this._compare(this._resultSortField,this._resultSortOrder));const s=[];if(t.length>0){(t[0].details?.fields.some((({name:e})=>e.toLowerCase()===this._resultDisplayField.toLocaleLowerCase()))??!1)||(this._resultDisplayField=this._resultObjectIdField,this._resultSortField=this._resultObjectIdField),t.forEach((e=>{e?.details&&s.push(this._renderResultRowIndividual(e))})),0===s.length&&s.push(w("calcite-list-item",{label:e.resultsStrings.noFeaturesInMap}))}return w("calcite-flow-item",{heading:this._assetTypeHeader,key:"individualResult",selected:"records"===this._traceResultsState,onCalciteFlowItemBack:()=>{this._showResultOptions=!1,this.switchToFromIndividualRecords([],"","assetType")}},w("calcite-action",{afterCreate:m,bind:this,"data-node-ref":"_individualResultNode",icon:"gear",id:"field_options"+this.id,label:e.resultsStrings.displayAttribute,onclick:()=>{this._showResultOptions=!0},slot:"header-actions-end",text:e.resultsStrings.displayAttribute}),this._renderTraceResultIndividualPopover(),w("calcite-list",{label:"",selectionMode:"none"},s),this._renderStartOverContainer())}_renderTraceResultIndividualPopover(){const{messages:e}=this,t=this._traceResultsIndividual,s=[],i=[];return t.length>0&&(t[0].details?t[0].details.fields.forEach((({name:e,alias:t})=>{s.push(w("calcite-option",{key:`display-${e}`,label:t??e,selected:e===this._resultDisplayField,value:e})),i.push(w("calcite-option",{key:`sort-${e}`,label:t??e,selected:e===this._resultSortField,value:e}))})):(s.push(w("calcite-option",{key:`display-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})),i.push(w("calcite-option",{key:`sort-${this._resultDisplayField}`,label:this._resultDisplayField,value:this._resultDisplayField})))),w("calcite-popover",{autoClose:!0,label:e.resultsStrings.displayAttribute,offsetDistance:0,offsetSkidding:0,open:this._showResultOptions,overlayPositioning:"fixed",placement:"left-start",referenceElement:this._individualResultNode,styles:null!==this.domNode?F(.75*this.domNode.clientWidth):C()},w("calcite-block",{label:e.resultsStrings.displayAttribute,open:!0,overlayPositioning:"fixed"},w("calcite-label",{scale:"s"},e.resultsStrings.displayAttribute,w("calcite-select",{label:e.resultsStrings.displayAttribute,scale:"s",onCalciteSelectChange:e=>{const t=e.currentTarget;this._resultDisplayField=t.selectedOption.value,this._showResultOptions=!1}},s)),w("calcite-label",{scale:"s"},e.resultsStrings.sortBy,w("calcite-select",{label:e.resultsStrings.sortBy,scale:"s",onCalciteSelectChange:e=>{const s=e.currentTarget;this._resultSortField=s.selectedOption.value,t.sort(this._compare(this._resultSortField,this._resultSortOrder)),this._traceResultsIndividual=t,this._showResultOptions=!1}},i))))}_renderTraceResults(){const{messages:e,messagesCommon:t}=this,{selectFeatures:s}=e.resultsStrings,i=this.viewModel.traceResults,r=[];return i.forEach(((t,i)=>{let o=[],a=[],l=!1,n=!1,c=!1,d="";null!==t.results&&t.results.hasOwnProperty("elements")?(null!==t.results.aggregatedGeometry&&(n=!0),null!==t.results.globalFunctionResults&&t.results.globalFunctionResults.length>0&&(a=t.results.globalFunctionResults,a.length>0&&(c=!0)),t.results.elements&&t.results.elements.length>0&&(o=t.results.elements,o.length>0&&(l=!0)),(n||l)&&(d=this.messagesUnits.units[t.resultArea?.unit]?.abbr),r.push(w("calcite-block",{class:T.blockContent,collapsible:!0,description:t.trace.description??"",heading:t.trace.title,key:`${t.trace.title}${i}`,open:!0,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),w("calcite-list",{label:""},c?w("calcite-list-item",{label:e.resultsStrings.functionHeader+" ("+a.length+")",onCalciteListItemSelect:()=>{this.switchToFromFunctions(a,"functions")}},w("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):null,l&&this.viewModel.showSelectionAttributes?w("calcite-list-item",{key:this.id,label:e.resultsStrings.viewFeatures+" ("+o.length+")",onCalciteListItemSelect:()=>{this.switchToFromAssetGroup(this._groupResultsByAssetGroup(t),t.trace.title+" ("+o.length+")","assetGroup")}},w("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"})):this.viewModel.showSelectionAttributes?w("calcite-label",{layout:"inline",scale:"s"},e.resultsStrings.noSelectionResults):null),l?w("div",{class:T.doublePaddingTop},w("calcite-label",{layout:"inline",onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)},scale:"s"},w("calcite-checkbox",{checked:t.selectionEnabled,onclick:e=>{e.preventDefault(),e.stopPropagation(),this.viewModel.mergeSelection(!t.selectionEnabled,t.trace)}}),this.viewModel.showSelectionAttributes?s:`${s} (${o.length})`)):null,n?w("calcite-block-section",{key:`aggregate-${t.trace.title}-${i}`,open:t.graphicEnabled,text:e.resultsStrings.highlightTrace,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.open?this.viewModel.changeResultGraphicColor(t.graphicColor,t):this.viewModel.removeResultGraphicFromView(t)}},w("calcite-list",{label:e.resultsStrings.graphicColor,selectionMode:"none"},w("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{this._swatchNode=e.currentTarget,this._activeSwatch="aggGeom_"+i}},w("calcite-color-picker-swatch",{color:t.graphicColor.hex,scale:"s",slot:"actions-end"})))):null,this.enableResultArea&&(n||l)?w("calcite-block-section",{key:`area-${t.trace.title}-${i}`,open:t.resultArea?.show,text:e.resultsStrings.resultAreaHeader,toggleDisplay:"switch",onCalciteBlockSectionToggle:e=>{e.currentTarget.open?t.resultAreaGraphic?this.viewModel.addResultAreaToMap(t,t.resultAreaGraphic):this.viewModel.addResultAreaToMap(t):this.viewModel.removeResultAreaFromMap(t)}},w("calcite-list",{label:"",selectionMode:"none"},w("calcite-list-item",{label:e.resultsStrings.graphicColor,onclick:e=>{const t=e.currentTarget;this._swatchNode=t,this._activeSwatch="resultArea_"+i}},w("calcite-color-picker-swatch",{color:t.resultArea?.color.hex,scale:"s",slot:"actions-end"}))),w("calcite-list",{label:"",selectionMode:"none"},w("calcite-list-item",{label:e.resultsStrings.resultAreaBuffer},w("calcite-input-number",{afterCreate:this._afterComponentCreate,class:T.numberInput,max:999999,min:0,scale:"s",slot:"actions-end",suffixText:d,value:t.resultArea?.distance.toString(),onCalciteInputNumberChange:e=>{if(!this.view?.popup)return;this.view.popup.visible&&this.view.closePopup();const s=e.currentTarget;t.resultArea.distance>=0?(t.resultArea.distance=parseInt(s.value,10),this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t)):(t.resultArea.distance=0,this.viewModel.removeResultAreaFromMap(t),this.viewModel.addResultAreaToMap(t))}})))):null,w("calcite-popover",{autoClose:!0,closable:!0,label:e.resultsStrings.graphicColor,offsetDistance:0,offsetSkidding:0,open:this._activeSwatch==="aggGeom_"+i||this._activeSwatch==="resultArea_"+i,overlayPositioning:"fixed",placement:"auto-start",referenceElement:this._swatchNode,scale:"s",onCalcitePopoverClose:()=>{this._swatchNode=null,this._activeSwatch=null}},this._renderHighlightColorPicker(this._activeSwatch==="resultArea_"+i?t.resultArea?.color:t.graphicColor,t,this._activeSwatch==="resultArea_"+i?"resultArea":"aggregate"))))):r.push(w("calcite-block",{collapsible:!1,heading:t.trace.title,key:"error-"+i,open:!0,overlayPositioning:"fixed"},this._renderRemoveTraceContainer(t),this._renderWarningMessage("noController",!1,t.status)))})),w("calcite-flow-item",{key:"traceResults",selected:"result"===this._traceResultsState},r,this._renderStartOverContainer(),this._alertRemoveModal?w("calcite-scrim",{key:"prompt"},w("div",{class:T.clearPrompt},w("h3",{slot:"header"},e.globalStrings.clearResults),w("div",{slot:"content"},e.alertsStrings.clearResultsAlert),w("div",{class:T.promptDivider}),w("div",{styles:R("row")},w("calcite-button",{appearance:"outline",onclick:()=>{this._alertRemoveModal=!1},slot:"secondary",width:"full"},t.cancel),w("calcite-button",{onclick:()=>{this._activeTrace&&this.viewModel.clearResult(this._activeTrace),this._alertRemoveModal=!1,0===this.viewModel.traceResults.length?this.switchTab("input"):(this._activeTrace=this.viewModel.traceResults[0].trace,this._traceResultsState="result")},slot:"primary",width:"full"},t.form.ok)))):null)}_renderTraceSelectorContainer(){const{messages:e}=this,t=this.viewModel.traces.map((e=>this._renderComboboxItem({value:e.globalId,text:e.title,selected:e.selected??!1}))),s=this.viewModel.traces.filter((e=>e.selected)),i=e.tracingStrings.traceOperation+` (${s.length})`;return w("calcite-block",{class:T.blockContent,collapsible:!0,heading:i,open:!0,overlayPositioning:"fixed"},w("calcite-icon",{icon:"utility-network-trace",scale:"s",slot:"icon"}),w("calcite-combobox",{label:e.inputsStrings.selectTraces,maxItems:0,overlayPositioning:"fixed",placeholder:e.inputsStrings.selectTraces,scale:"s",selectionMode:"multiple",onCalciteComboboxChange:e=>{this.viewModel.traces.forEach((t=>{t.selected=e.currentTarget.selectedItems.some((e=>e.value===t.globalId))})),e.currentTarget.selectedItems.length&&(this._warningNoTraceSelected=!1)}},t))}_renderUtilityNetworkTrace(){const{viewModel:e,viewModel:{utilityNetwork:t}}=this,s=e.view?.map,{messages:i}=this;let r=w("calcite-tabs",{layout:"center",position:"top",styles:A(this.container)},w("calcite-tab-nav",{slot:"title-group"},w("calcite-tab-title",{onclick:()=>{this.switchTab("input")},selected:"input"===this._activeTab},i.inputsStrings.headerTabInputs),w("calcite-tab-title",{onclick:()=>{this.switchTab("results")},selected:"results"===this._activeTab},i.resultsStrings.headerTabResults)),this._renderInputsTab(),this._renderResultsTab());return(!s.utilityNetworks?.length&&!t||t&&!t.sharedNamedTraceConfigurations.length)&&(r=w("calcite-panel",null,this._renderWarningMessage("noTraceConfig",!1))),this._loadUnError||(r=w("calcite-panel",null,this._renderWarningMessage("loadUNError",!1,this._errorMessage))),r}_renderWarningMessage(e,t,s){const{messages:i}=this;let r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;switch(e){case"flag":r=i.alertsStrings.startingPointAlertHeader,o=i.alertsStrings.startingPointAlert;break;case"noTerminal":r=i.alertsStrings.noTerminalDefinedHeader,o=i.alertsStrings.noTerminalDefined;break;case"trace":r=i.alertsStrings.selectTraceAlertHeader,o=i.alertsStrings.selectTraceAlert;break;case"noTraceExecuted":r=i.alertsStrings.NoRunAlertHeader,o=i.alertsStrings.noResultsInfo;break;case"noBarrierAsset":case"noStartAsset":r=i.alertsStrings.noAssetsFoundHeader,o=i.alertsStrings.noAssetFound;break;case"noBarrierAssetNso":case"noStartAssetNso":r="",o=i.alertsStrings.noAssetFound;break;case"noTraceConfig":r="",o=i.alertsStrings.noTraceSupported;break;default:r=i.alertsStrings.genericErrorHeader,o=s||""}return w("div",{class:T.noticeContainer,key:e},w("calcite-notice",{closable:t,icon:!0,key:e,kind:"danger",open:!0,scale:"s",width:"auto",onCalciteNoticeClose:()=>this._handleWarningNoticeClose(e)},w("div",{slot:"title"},r),w("div",{slot:"message"},o)))}_afterComponentCreate(e){"value"in e&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"})}_appendAttributes(e,t,s){const i=[];return e.forEach((e=>{t.forEach((t=>{t.featureSet.features.forEach((r=>{e[s]===r.attributes[this._resultObjectIdField]&&(e.details=r,e.details.fields=t.featureSet.fields,i.push(e))}))}))})),i}_changeCursor(e="default"){const t=this.view?.container?.style;t&&(t.cursor=e)}_disablePopup(){const{view:e}=this;e.popupEnabled=!1,e.closePopup()}_compare(e,t){return(s,i)=>{let r=0,o=s.details?.attributes[e]??s.objectId,a=i.details?.attributes[e]??i.objectId;return isNaN(o)&&(o=o.toLowerCase()),isNaN(a)&&(a=a.toLowerCase()),"desc"===t?o>a?r=1:o<a&&(r=-1):o<a?r=1:o>a&&(r=-1),r}}_getAssetGroupName(e){let t=e.assetGroupCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find((t=>t.sourceId===e.networkSourceId));if(i){const e=i.assetGroups.find((e=>e.assetGroupCode===s));e&&(t=e.assetGroupName)}return t}_getAssetTypeName(e){let t=e.assetTypeCode.toString();const s=e.assetGroupCode,i=this.viewModel.getValidSources().find((t=>t.sourceId===e.networkSourceId));if(i){const r=i.assetGroups.find((e=>e.assetGroupCode===s));if(r){const s=r.assetTypes.find((t=>t.assetTypeCode===e.assetTypeCode));s&&(t=s.assetTypeName)}}return t}_getSymbolIcon(e){return"picture-marker"===e.type?w("img",{height:e.height,src:e.url??void 0,width:e.width}):null}_groupBy(e,t){return e.reduce(((e,s)=>((e[s[t]]=e[s[t]]||[]).push(s),e)),{})}_groupResultsByAssetGroup(e){const t=[],s=e.results?.elements,i=this._groupBy(s??[],"networkSourceId");for(const r in i)t.push(this._groupBy(i[r],"assetGroupCode"));return t}_groupResultsByAssetType(e){return this._groupBy(e,"assetTypeCode")}_handleWarningNoticeClose(e){switch(e){case"flag":this._warningNoFlag=!1;break;case"noTerminal":this._warningNoTerminal=!1;break;case"trace":this._warningNoTraceSelected=!1;break;case"noStartAsset":this._warningNoStartAssetFound=!1;break;case"noStartAssetNso":this._warningNoStartAssetNsoFound=!1;break;case"noBarrierAsset":this._warningNoBarrierAssetFound=!1;break;case"noBarrierAssetNso":this._warningNoBarrierAssetNsoFound=!1}}_mixCustomStrings(){const{messages:e}=this;this.inputSettings.length>0&&this.inputSettings.forEach((t=>{"starting-point"===t.type&&(e.inputsStrings.headerStartingPoint=t.label,e.inputsStrings.startingPointHint=t.description),"barrier"===t.type&&(e.inputsStrings.headerBarrier=t.label,e.inputsStrings.barrierPointHint=t.description)}))}_overrideFlagSymbol(){this.inputSettings.length>0&&this.inputSettings.forEach((e=>{"starting-point"===e.type?this._symbolStartFlag=e.symbol:this._symbolBarrier=e.symbol,this.viewModel.changeFlagSymbol(e.type,e.symbol)}))}_processFlagOnLoad(){return this.view?.when().then((()=>{this._watchHandler=o((()=>!this.view?.updating),(async()=>{this._warningNoFlag=!1,this._warningNoBarrierAssetFound=!1,this._warningNoStartAssetFound=!1;const e=await this.viewModel.addFlagsOnLoad();this.viewModel.removeFlagsOnLoadWatcher(),e.includes("barrier")&&(this._warningNoBarrierAssetFound=!0),e.includes("starting-point")&&(this._warningNoStartAssetFound=!0),this.disabled=!1,null!==this._watchHandler&&this._watchHandler.remove()}))}))}_registerWatchers(){this.addHandles([i((()=>this.selectedTraces),(()=>{this.viewModel.selectTracesOnLoad(),this.scheduleRender()})),i((()=>this.defaultGraphicColor),(()=>{this.viewModel.traceResults.length>0&&this.viewModel.traceResults.forEach((e=>{this.viewModel.changeResultGraphicColor(this.viewModel.defaultGraphicColor,e)})),this.scheduleRender()}))])}_renderComboboxItem({text:e,value:t,selected:s}){return w("calcite-combobox-item",{key:t,selected:s,textLabel:e,value:t})}_resetResultFeatureWidget(){this._showFeatureInfoActive=!1,this._resultFeatureWidget.feature=null,this.view.popupEnabled=this._wasPopupEnabled}_resetTraceLocationWarnings(){this._warningNoBarrierAssetFound=!1,this._warningNoBarrierAssetNsoFound=!1,this._warningNoStartAssetFound=!1,this._warningNoStartAssetNsoFound=!1}_setupAddNonspatialObject(e){this._disablePopup(),this._traceLocationType=e,this._addNonspatialObjectActive=!0,this._resetTraceLocationWarnings(),this.viewModel.getNonspatialTraceLocationInitialFeature().then((e=>{this._findNonspatialFeatureWidget.feature=null;const t=e.graphic;this._findNonspatialFeatureWidget.open(t)})).catch((()=>{this._warningNoStartAssetNsoFound="starting-point"===e,this._warningNoBarrierAssetNsoFound="barrier"===e,this._addNonspatialObjectActive=!1})).finally((()=>this._changeCursor("default")))}_setupAddTraceLocation(e){this._traceLocationType=e,this._changeCursor("crosshair"),this._selectToolActive=!0,this._addNonspatialObjectActive=!1,this._resetTraceLocationWarnings(),this.viewModel.addFlagByHit(this._traceLocationType,this._symbolStartFlag).then((e=>{this._changeCursor("default"),e?this._warningNoFlag=!1:(this._warningNoStartAssetFound="starting-point"===this._traceLocationType,this._warningNoBarrierAssetFound="barrier"===this._traceLocationType),this._selectToolActive=!1}))}_utilityNetworkTraceInitialized(){this.viewModel.loadUtilityNetwork().then((e=>{e&&(this.viewModel.selectTracesOnLoad(),this._registerWatchers(),this.viewModel.flags.length>0&&this._processFlagOnLoad()),this.disabled=!1})).catch((e=>{const{messages:t}=this;this._loadUnError=!1,"utility-network:no-user-type-extension"===e.name||e.details.raw.extendedCode===M.noExtension?this._errorMessage=t.alertsStrings.noUserExtension:this._errorMessage=e.message,this.disabled=!1}))}};e([a()],x.prototype,"_activeTab",void 0),e([a()],x.prototype,"_activeTrace",void 0),e([a()],x.prototype,"_activeSwatch",void 0),e([a()],x.prototype,"_addNonspatialObjectActive",void 0),e([a()],x.prototype,"_alertRemoveModal",void 0),e([a()],x.prototype,"_assetGroupHeader",void 0),e([a()],x.prototype,"_assetTypeHeader",void 0),e([a()],x.prototype,"_confirmReset",void 0),e([a()],x.prototype,"_errorMessage",void 0),e([a()],x.prototype,"_swatchNode",void 0),e([a()],x.prototype,"_selectToolActive",void 0),e([a()],x.prototype,"_showFeatureInfoActive",void 0),e([a()],x.prototype,"_traceHeaderForFlow",void 0),e([a()],x.prototype,"_traceResultsFunctions",void 0),e([a()],x.prototype,"_traceResultsAssetGroup",void 0),e([a()],x.prototype,"_traceResultsAssetType",void 0),e([a()],x.prototype,"_traceResultsIndividual",void 0),e([a()],x.prototype,"_traceResultsState",void 0),e([a()],x.prototype,"_warningNoFlag",void 0),e([a()],x.prototype,"_warningNoTraceSelected",void 0),e([a()],x.prototype,"_updatingHandles",void 0),e([a()],x.prototype,"defaultGraphicColor",null),e([a()],x.prototype,"disabled",void 0),e([a()],x.prototype,"enableResultArea",null),e([a()],x.prototype,"flags",null),e([a()],x.prototype,"gdbVersion",null),e([a()],x.prototype,"icon",null),e([a()],x.prototype,"inputSettings",void 0),e([a()],x.prototype,"label",null),e([a(),_("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace")],x.prototype,"messages",void 0),e([a(),_("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([a(),_("esri/core/t9n/Units")],x.prototype,"messagesUnits",void 0),e([a()],x.prototype,"resultAreaProperties",null),e([a()],x.prototype,"selectedTraces",null),e([a()],x.prototype,"selectOnComplete",null),e([a()],x.prototype,"showGraphicsOnComplete",null),e([a()],x.prototype,"showSelectionAttributes",null),e([a()],x.prototype,"utilityNetwork",null),e([a()],x.prototype,"view",null),e([b(["add-flag","add-flag-complete","add-flag-error","select-features","clear-selection","add-result-area","remove-result-area","create-result-area","reset"]),a({type:y})],x.prototype,"viewModel",void 0),x=e([l("esri.widgets.UtilityNetworkTrace")],x);const I=x;export{I as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../FilterCondition.js";import{defaultOperatorNamesByFieldType as l}from"../FilterCondition/conditionUtils.js";let p=class extends t{constructor(o){super(o),this.conditionOperator="AND",this.conditionWidgets=new r,this.layer=null,this.operators=l}initialize(){this.addHandles([i((()=>this.layer),(async o=>{o&&!o.loaded&&"loading"!==o.loadStatus&&await o.load()}),s)])}get count(){return this.conditionWidgets.length}get state(){const{layer:o}=this;return o?o.loaded?"ready":"loading":"disabled"}get whereClause(){const{conditionOperator:o,whereClauses:t}=this;let e="";return t.forEach(((t,r)=>{e+=r>0?` ${o} (${t})`:`(${t})`})),e}get whereClauses(){return this.conditionWidgets.toArray().map((o=>o.whereClause)).filter(e)}addCondition(o,t){const{layer:e,operators:r}=this;e&&this.conditionWidgets.add(new d({...o,layer:e,operators:r}),t)}duplicateCondition(o){const t=this.conditionWidgets.at(o);if(!t)return;const{fieldName:e,operator:r,value:i}=t;this.addCondition({fieldName:e,operator:r,value:i})}reset(){this.conditionWidgets.removeAll()}removeCondition(o){null==o?this.conditionWidgets.pop():this.conditionWidgets.splice(o,1)}};o([n()],p.prototype,"conditionOperator",void 0),o([n()],p.prototype,"conditionWidgets",void 0),o([n()],p.prototype,"count",null),o([n()],p.prototype,"layer",void 0),o([n()],p.prototype,"operators",void 0),o([n()],p.prototype,"state",null),o([n()],p.prototype,"whereClause",null),o([n()],p.prototype,"whereClauses",null),p=o([a("esri.widgets.support.FilterBuilder.FilterBuilderViewModel")],p);const c=p;export{c as default};
5
+ import{_ as o}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../FilterCondition.js";import{defaultOperatorNamesByFieldType as l}from"../FilterCondition/conditionUtils.js";let p=class extends t{constructor(o){super(o),this.conditionOperator="AND",this.conditionWidgets=new r,this.layer=null,this.operators=l}initialize(){this.addHandles([i((()=>this.layer),(async o=>{o&&!o.loaded&&await o.load()}),s)])}get count(){return this.conditionWidgets.length}get state(){const{layer:o}=this;return o?o.loaded?"ready":"loading":"disabled"}get whereClause(){const{conditionOperator:o,whereClauses:t}=this;let e="";return t.forEach(((t,r)=>{e+=r>0?` ${o} (${t})`:`(${t})`})),e}get whereClauses(){return this.conditionWidgets.toArray().map((o=>o.whereClause)).filter(e)}addCondition(o,t){const{layer:e,operators:r}=this;e&&this.conditionWidgets.add(new a({...o,layer:e,operators:r}),t)}duplicateCondition(o){const t=this.conditionWidgets.at(o);if(!t)return;const{fieldName:e,operator:r,value:i}=t;this.addCondition({fieldName:e,operator:r,value:i})}reset(){this.conditionWidgets.removeAll()}removeCondition(o){null==o?this.conditionWidgets.pop():this.conditionWidgets.splice(o,1)}};o([n()],p.prototype,"conditionOperator",void 0),o([n()],p.prototype,"conditionWidgets",void 0),o([n()],p.prototype,"count",null),o([n()],p.prototype,"layer",void 0),o([n()],p.prototype,"operators",void 0),o([n()],p.prototype,"state",null),o([n()],p.prototype,"whereClause",null),o([n()],p.prototype,"whereClauses",null),p=o([d("esri.widgets.support.FilterBuilder.FilterBuilderViewModel")],p);const c=p;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{cast as o}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import{loadCalciteComponents as n}from"./componentsUtils.js";import"./widgetUtils.js";import{messageBundle as s}from"./decorators/messageBundle.js";import{tsx as l}from"./jsxFactory.js";import c from"./FilterBuilder/FilterBuilderViewModel.js";const a={fab:!0,menu:!0},d="esri-filter-builder",p={base:d,container:`${d}__container`,conditionContainer:`${d}__condition-container`,operatorSelect:`${d}__operator-select`};let u=class extends r{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new c,this.visibleElements={...a}}loadDependencies(){return n({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get conditionOperator(){return this.viewModel.conditionOperator}set conditionOperator(e){this.viewModel.conditionOperator=e}get count(){return this.viewModel.count}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get operators(){return this.viewModel.operators}set operators(e){this.viewModel.operators=e}get state(){return this.viewModel.state}castVisibleElements(e){return{...a,...e}}get whereClause(){return this.viewModel.whereClause}get whereClauses(){return this.viewModel.whereClauses}render(){return l("div",{class:p.base},this._renderOperatorSelect(),this._renderConditions(),this._renderFAB())}_renderOperatorSelect(){if(this.count<2)return;const{conditionOperator:e,messages:t}=this,o="AND"===e;return l("div",{class:p.operatorSelect},l("calcite-select",{label:t.condition,width:"full",onCalciteSelectChange:({currentTarget:e})=>{this.conditionOperator=e.value}},l("calcite-option",{label:t.allAreTrue,selected:o,value:"AND"}),l("calcite-option",{label:t.anyAreTrue,selected:!o,value:"OR"})))}_renderConditions(){return this.viewModel.conditionWidgets.toArray().map(((e,t)=>this._renderConditionContainer(e,t)))}_renderConditionContainer(e,t){return l("calcite-block",{class:p.conditionContainer,heading:this.messages.condition,open:!0},e.render(),this._renderConditionrMenu(t))}_renderFAB(){if(!this.visibleElements.fab)return;const e="loading"===this.state;return l("calcite-fab",{appearance:"outline-fill",disabled:e,icon:"plus",kind:"neutral",loading:e,onclick:()=>this.viewModel.addCondition(),text:this.messages.addNew,textEnabled:!0})}_renderConditionrMenu(e){if(!this.visibleElements.menu)return;const{messages:t}=this;return l("calcite-action-menu",{label:t.moreOptions,overlayPositioning:"fixed",placement:"bottom-end",slot:"control"},l("calcite-action",{onclick:()=>this.viewModel.removeCondition(e),text:t.delete,textEnabled:!0}),l("calcite-action",{onclick:()=>this.viewModel.duplicateCondition(e),text:t.duplicate,textEnabled:!0}))}};e([t()],u.prototype,"conditionOperator",null),e([t()],u.prototype,"count",null),e([t()],u.prototype,"layer",null),e([t(),s("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],u.prototype,"messages",void 0),e([t(),s("esri/t9n/common")],u.prototype,"messagesCommon",void 0),e([t()],u.prototype,"operators",null),e([t()],u.prototype,"state",null),e([t()],u.prototype,"viewModel",void 0),e([t()],u.prototype,"visibleElements",void 0),e([o("visibleElements")],u.prototype,"castVisibleElements",null),e([t()],u.prototype,"whereClause",null),e([t()],u.prototype,"whereClauses",null),u=e([i("esri.widgets.support.FilterBuilder")],u);const m=u;export{m as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{cast as o}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import{loadCalciteComponents as s}from"./componentsUtils.js";import"./widgetUtils.js";import{messageBundle as n}from"./decorators/messageBundle.js";import{tsx as l}from"./jsxFactory.js";import c from"./FilterBuilder/FilterBuilderViewModel.js";const a={fab:!0,menu:!0},d="esri-filter-builder",p={base:d,container:`${d}__container`,conditionContainer:`${d}__condition-container`,operatorSelect:`${d}__operator-select`};let u=class extends r{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new c,this.visibleElements={...a}}loadDependencies(){return s({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get conditionOperator(){return this.viewModel.conditionOperator}set conditionOperator(e){this.viewModel.conditionOperator=e}get count(){return this.viewModel.count}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get operators(){return this.viewModel.operators}set operators(e){this.viewModel.operators=e}get state(){return this.viewModel.state}castVisibleElements(e){return{...a,...e}}get whereClause(){return this.viewModel.whereClause}get whereClauses(){return this.viewModel.whereClauses}render(){return l("div",{class:p.base},this._renderOperatorSelect(),this._renderConditions(),this._renderFAB())}reset(){this.viewModel.reset()}_renderOperatorSelect(){if(this.count<2)return;const{conditionOperator:e,messages:t}=this,o="AND"===e;return l("div",{class:p.operatorSelect},l("calcite-select",{label:t.condition,width:"full",onCalciteSelectChange:({currentTarget:e})=>{this.conditionOperator=e.value}},l("calcite-option",{label:t.allAreTrue,selected:o,value:"AND"}),l("calcite-option",{label:t.anyAreTrue,selected:!o,value:"OR"})))}_renderConditions(){return this.viewModel.conditionWidgets.toArray().map(((e,t)=>this._renderConditionContainer(e,t)))}_renderConditionContainer(e,t){return l("calcite-block",{class:p.conditionContainer,heading:this.messages.condition,open:!0},e.render(),this._renderConditionrMenu(t))}_renderFAB(){if(!this.visibleElements.fab)return;const e="loading"===this.state;return l("calcite-fab",{appearance:"outline-fill",disabled:e,icon:"plus",kind:"neutral",loading:e,onclick:()=>this.viewModel.addCondition(),text:this.messages.addNew,textEnabled:!0})}_renderConditionrMenu(e){if(!this.visibleElements.menu)return;const{messages:t}=this;return l("calcite-action-menu",{label:t.moreOptions,overlayPositioning:"fixed",placement:"bottom-end",slot:"control"},l("calcite-action",{onclick:()=>this.viewModel.removeCondition(e),text:t.delete,textEnabled:!0}),l("calcite-action",{onclick:()=>this.viewModel.duplicateCondition(e),text:t.duplicate,textEnabled:!0}))}};e([t()],u.prototype,"conditionOperator",null),e([t()],u.prototype,"count",null),e([t()],u.prototype,"layer",null),e([t(),n("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],u.prototype,"messages",void 0),e([t(),n("esri/t9n/common")],u.prototype,"messagesCommon",void 0),e([t()],u.prototype,"operators",null),e([t()],u.prototype,"state",null),e([t()],u.prototype,"viewModel",void 0),e([t()],u.prototype,"visibleElements",void 0),e([o("visibleElements")],u.prototype,"castVisibleElements",null),e([t()],u.prototype,"whereClause",null),e([t()],u.prototype,"whereClauses",null),u=e([i("esri.widgets.support.FilterBuilder")],u);const m=u;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/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{watch as i,initial as o}from"../../../core/reactiveUtils.js";import{property as r}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{isStringField as s,isNumericField as n,isObjectIDField as a,isGlobalIDField as d,isIntegerField as p,isTimeOnlyField as u,normalizeFieldName as m}from"../../../layers/support/fieldUtils.js";import{defaultOperatorNamesByFieldType as c}from"./conditionUtils.js";let y=class extends t{constructor(e){super(e),this.fieldName=null,this.layer=null,this.operator="is",this.operators=c,this.value=null}initialize(){this.addHandles(i((()=>this.layer),(async e=>{e&&!e.loaded&&"loading"!==e.loadStatus&&await e.load()}),o))}get domain(){const{fieldName:e,layer:t}=this;if(e&&t)return t.getFieldDomain(e)}get field(){const{fieldName:e,layer:t}=this;if(e&&t)return t.fieldsIndex.get(e)}get fields(){return(this.layer?.fields??[]).filter((e=>!!(s(e)||n(e)||a(e)||d(e))))}get fieldLabel(){const{field:e}=this;return e&&(e.alias||e.name)||""}get isIdField(){const{field:e}=this;return!!e&&(a(e)||d(e))}get isIntegerField(){return p(this.field)}get isNumericField(){return n(this.field)}get isStringField(){return s(this.field)}get isTimeOnlyField(){return u(this.field)}get normalizedFieldName(){return m(this.field?.name)}get state(){const{layer:e}=this;return e?e.loaded?"ready":"loading":"disabled"}get valueAsString(){const{value:e}=this;return null==e||""===e?"":`${e}`}get whereClause(){const{normalizedFieldName:e,operator:t,valueAsString:i}=this;return e&&t?"isBlank"===t?`${e} IS NULL`:"isNotBlank"===t?`${e} IS NOT NULL`:"isEmpty"===t?`${e} = ''`:"isNotEmpty"===t?`${e} <> ''`:""===i?null:"is"===t?`${e} = '${i}'`:"isNot"===t?`${e} <> '%${i}%'`:"startsWith"===t?`${e} LIKE '${i}%'`:"endsWith"===t?`${e} LIKE '%${i}'`:"contains"===t?`${e} LIKE '%${i}%'`:"doesNotContain"===t?`${e} NOT LIKE '%${i}%'`:null:null}};e([r()],y.prototype,"domain",null),e([r()],y.prototype,"field",null),e([r()],y.prototype,"fields",null),e([r()],y.prototype,"fieldLabel",null),e([r()],y.prototype,"fieldName",void 0),e([r()],y.prototype,"isIdField",null),e([r()],y.prototype,"isIntegerField",null),e([r()],y.prototype,"isNumericField",null),e([r()],y.prototype,"isStringField",null),e([r()],y.prototype,"isTimeOnlyField",null),e([r()],y.prototype,"layer",void 0),e([r()],y.prototype,"normalizedFieldName",null),e([r()],y.prototype,"operator",void 0),e([r()],y.prototype,"operators",void 0),e([r()],y.prototype,"state",null),e([r()],y.prototype,"value",void 0),e([r()],y.prototype,"valueAsString",null),e([r()],y.prototype,"whereClause",null),y=e([l("esri.widgets.support.FilterCondition.FilterConditionViewModel")],y);const f=y;export{f as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{watch as i,initial as l}from"../../../core/reactiveUtils.js";import{property as r}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{isStringField as s,isNumericField as n,isObjectIDField as a,isGlobalIDField as d,isIntegerField as p,isTimeOnlyField as u,normalizeFieldName as m}from"../../../layers/support/fieldUtils.js";import{defaultOperatorNamesByFieldType as c}from"./conditionUtils.js";let y=class extends t{constructor(e){super(e),this.fieldName=null,this.layer=null,this.operator="is",this.operators=c,this.value=null}initialize(){this.addHandles(i((()=>this.layer),(async e=>{e&&!e.loaded&&await e.load()}),l))}get domain(){const{fieldName:e,layer:t}=this;if(e&&t)return t.getFieldDomain(e)}get field(){const{fieldName:e,layer:t}=this;if(e&&t)return t.fieldsIndex.get(e)}get fields(){return(this.layer?.fields??[]).filter((e=>!!(s(e)||n(e)||a(e)||d(e))))}get fieldLabel(){const{field:e}=this;return e&&(e.alias||e.name)||""}get isObjectIDField(){const{field:e}=this;return!!e&&a(e)}get isGlobalIDField(){const{field:e}=this;return!!e&&d(e)}get isIntegerField(){return p(this.field)}get isNumericField(){return n(this.field)}get isStringField(){return s(this.field)}get isTimeOnlyField(){return u(this.field)}get normalizedFieldName(){return m(this.field?.name)}get state(){const{layer:e}=this;return e?e.loaded?"ready":"loading":"disabled"}get valueAsString(){const{value:e}=this;return null==e||""===e?"":`${e}`}get normalizedValue(){const{value:e,isNumericField:t,isObjectIDField:i}=this;return null==e||""===e?"":t||i?`${e}`:`'${e}'`}get whereClause(){const{normalizedFieldName:e,operator:t,normalizedValue:i}=this;return e&&t?"isBlank"===t?`${e} IS NULL`:"isNotBlank"===t?`${e} IS NOT NULL`:"isEmpty"===t?`${e} = ''`:"isNotEmpty"===t?`${e} <> ''`:""===i?null:"is"===t?`${e} = ${i}`:"isNot"===t?`${e} <> ${i}`:"startsWith"===t?`${e} LIKE ${i}%`:"endsWith"===t?`${e} LIKE %${i}`:"contains"===t?`${e} LIKE %${i}%`:"doesNotContain"===t?`${e} NOT LIKE %${i}%`:null:null}};e([r()],y.prototype,"domain",null),e([r()],y.prototype,"field",null),e([r()],y.prototype,"fields",null),e([r()],y.prototype,"fieldLabel",null),e([r()],y.prototype,"fieldName",void 0),e([r()],y.prototype,"isObjectIDField",null),e([r()],y.prototype,"isIntegerField",null),e([r()],y.prototype,"isNumericField",null),e([r()],y.prototype,"isStringField",null),e([r()],y.prototype,"isTimeOnlyField",null),e([r()],y.prototype,"layer",void 0),e([r()],y.prototype,"normalizedFieldName",null),e([r()],y.prototype,"operator",void 0),e([r()],y.prototype,"operators",void 0),e([r()],y.prototype,"state",null),e([r()],y.prototype,"value",void 0),e([r()],y.prototype,"valueAsString",null),e([r()],y.prototype,"normalizedValue",null),e([r()],y.prototype,"whereClause",null),y=e([o("esri.widgets.support.FilterCondition.FilterConditionViewModel")],y);const f=y;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/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{cast as i}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Widget.js";import{loadCalciteComponents as l}from"./componentsUtils.js";import"./widgetUtils.js";import{messageBundle as s}from"./decorators/messageBundle.js";import{tsx as n}from"./jsxFactory.js";import a from"./FilterCondition/FilterConditionViewModel.js";const d={},p="esri-filter-condition",u={base:p,container:`${p}__container`,valueInputContainer:`${p}__value-input-container`};let c=class extends o{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new a,this.visibleElements={...d}}loadDependencies(){return l({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get _defaultFieldName(){const{fields:e,fieldName:t}=this;return t||(e?.length?e[0].name:void 0)}get _valueInputType(){const{viewModel:e}=this;return e.isNumericField||e.isIdField?"number":"text"}get _visibleOperators(){const{field:e,operators:t,viewModel:i}=this;return e?i.isStringField?t.string:i.isNumericField?t.number:i.isIdField?t.id:[]:[]}get _isValueInputHidden(){const{operator:e}=this;return!!e&&["isBlank","isNotBlank","isEmpty","isNotEmpty"].includes(e)}get domain(){return this.viewModel.domain}get field(){return this.viewModel.field}get fields(){return this.viewModel.fields}get fieldLabel(){return this.viewModel.fieldLabel}get fieldName(){return this.viewModel.fieldName}set fieldName(e){this.viewModel.fieldName=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get normalizedFieldName(){return this.viewModel.normalizedFieldName}get operator(){return this.viewModel.operator}set operator(e){this.viewModel.operator=e}get operators(){return this.viewModel.operators}set operators(e){this.viewModel.operators=e}get state(){return this.viewModel.state}get value(){return this.viewModel.value}set value(e){this.viewModel.value=e}get valueAsString(){return this.viewModel.valueAsString}castVisibleElements(e){return{...d,...e}}get whereClause(){return this.viewModel.whereClause}render(){return n("div",{class:u.base},this._renderFieldSelection(),this._renderOperatorSelection(),this._renderValueInput())}_renderFieldSelection(){const e=this.normalizedFieldName;return n("div",null,n("calcite-select",{afterCreate:()=>{this.fieldName||(this.fieldName=this._defaultFieldName)},bind:this,label:this.messages.chooseField,width:"full",onCalciteSelectChange:({currentTarget:e})=>{this.fieldName=e.value}},this.fields.map((t=>this._renderOption(t.name,t.alias,e)))))}_renderOperatorSelection(){const{_visibleOperators:e,messages:t,operator:i}=this;if(e.length)return n("div",null,n("calcite-select",{afterUpdate:e=>{const t=e.value;this._visibleOperators.includes(t)||(this.operator=this._visibleOperators[0])},bind:this,label:t.operator,required:!0,width:"full",onCalciteSelectChange:e=>{this.operator=e.currentTarget.value}},e.map((e=>this._renderOption(e,t.operators[e],i)))))}_renderOption(e,t,i){return n("calcite-option",{key:e,label:t??e,selected:e===i,value:e})}_renderValueInput(){const{valueAsString:e,domain:t,messages:i,operator:r}=this;if(!this._isValueInputHidden)return"coded-value"===t?.type&&t.codedValues.length&&"is"===r?n("div",{key:"value-select"},n("calcite-select",{afterCreate:()=>{this.value||(this.value=`${t.codedValues[0].code}`)},bind:this,label:i.value,required:!0,width:"full",onCalciteSelectChange:({currentTarget:e})=>{this._onValueChange(e.value)}},t.codedValues.map((({code:t,name:i})=>this._renderOption(`${t}`,i,e))))):n("div",{class:u.valueInputContainer,key:"value-input"},n("calcite-input",{label:i.value,type:this._valueInputType,value:e,onCalciteInputInput:({currentTarget:e})=>{this._onValueChange(e.value)}}))}_onValueChange(e){const{viewModel:t}=this;e&&""!==e?t.isStringField?this.value=e.toString():(t.isNumericField||t.isIdField)&&(this.value=parseFloat(e)):this.value=null}};e([t()],c.prototype,"_defaultFieldName",null),e([t()],c.prototype,"_valueInputType",null),e([t()],c.prototype,"_visibleOperators",null),e([t()],c.prototype,"_isValueInputHidden",null),e([t()],c.prototype,"domain",null),e([t()],c.prototype,"field",null),e([t()],c.prototype,"fields",null),e([t()],c.prototype,"fieldLabel",null),e([t()],c.prototype,"fieldName",null),e([t()],c.prototype,"layer",null),e([t(),s("esri/widgets/support/FilterCondition/t9n/FilterCondition")],c.prototype,"messages",void 0),e([t(),s("esri/t9n/common")],c.prototype,"messagesCommon",void 0),e([t()],c.prototype,"normalizedFieldName",null),e([t()],c.prototype,"operator",null),e([t()],c.prototype,"operators",null),e([t()],c.prototype,"state",null),e([t()],c.prototype,"value",null),e([t()],c.prototype,"valueAsString",null),e([t()],c.prototype,"viewModel",void 0),e([t()],c.prototype,"visibleElements",void 0),e([i("visibleElements")],c.prototype,"castVisibleElements",null),e([t()],c.prototype,"whereClause",null),c=e([r("esri.widgets.support.FilterCondition")],c);const m=c;export{m as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{cast as i}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Widget.js";import{loadCalciteComponents as r}from"./componentsUtils.js";import"./widgetUtils.js";import{messageBundle as s}from"./decorators/messageBundle.js";import{tsx as n}from"./jsxFactory.js";import a from"./FilterCondition/FilterConditionViewModel.js";const d={},p="esri-filter-condition",u={base:p,container:`${p}__container`,valueInputContainer:`${p}__value-input-container`};let c=class extends o{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new a,this.visibleElements={...d}}loadDependencies(){return r({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),select:()=>import("@esri/calcite-components/dist/components/calcite-select")})}get _defaultFieldName(){const{fields:e,fieldName:t}=this;return t||(e?.length?e[0].name:void 0)}get _valueInputType(){const{viewModel:e}=this;return e.isNumericField||e.isObjectIDField?"number":"text"}get _visibleOperators(){const{field:e,operators:t,viewModel:i}=this;return e?i.isStringField||i.isGlobalIDField?t.string:i.isNumericField?t.number:i.isObjectIDField?t.id:[]:[]}get _isValueInputHidden(){const{operator:e}=this;return!!e&&["isBlank","isNotBlank","isEmpty","isNotEmpty"].includes(e)}get domain(){return this.viewModel.domain}get field(){return this.viewModel.field}get fields(){return this.viewModel.fields}get fieldLabel(){return this.viewModel.fieldLabel}get fieldName(){return this.viewModel.fieldName}set fieldName(e){this.viewModel.fieldName=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get normalizedFieldName(){return this.viewModel.normalizedFieldName}get operator(){return this.viewModel.operator}set operator(e){this.viewModel.operator=e}get operators(){return this.viewModel.operators}set operators(e){this.viewModel.operators=e}get state(){return this.viewModel.state}get value(){return this.viewModel.value}set value(e){this.viewModel.value=e}get valueAsString(){return this.viewModel.valueAsString}castVisibleElements(e){return{...d,...e}}get whereClause(){return this.viewModel.whereClause}render(){return n("div",{class:u.base},this._renderFieldSelection(),this._renderOperatorSelection(),this._renderValueInput())}_renderFieldSelection(){const e=this.normalizedFieldName;return n("div",null,n("calcite-select",{afterCreate:()=>{this.fieldName||(this.fieldName=this._defaultFieldName)},bind:this,label:this.messages.chooseField,width:"full",onCalciteSelectChange:({currentTarget:e})=>{this.fieldName=e.value}},this.fields.map((t=>this._renderOption(t.name,t.alias,e)))))}_renderOperatorSelection(){const{_visibleOperators:e,messages:t,operator:i}=this;if(e.length)return n("div",null,n("calcite-select",{afterUpdate:e=>{const t=e.value;this._visibleOperators.includes(t)||(this.operator=this._visibleOperators[0])},bind:this,label:t.operator,required:!0,width:"full",onCalciteSelectChange:e=>{this.operator=e.currentTarget.value}},e.map((e=>this._renderOption(e,t.operators[e],i)))))}_renderOption(e,t,i){return n("calcite-option",{key:e,label:t??e,selected:e===i,value:e})}_renderValueInput(){const{valueAsString:e,domain:t,messages:i,operator:l}=this;if(!this._isValueInputHidden)return"coded-value"===t?.type&&t.codedValues.length&&"is"===l?n("div",{key:"value-select"},n("calcite-select",{afterCreate:()=>{this.value||(this.value=`${t.codedValues[0].code}`)},bind:this,label:i.value,required:!0,width:"full",onCalciteSelectChange:({currentTarget:e})=>{this._onValueChange(e.value)}},t.codedValues.map((({code:t,name:i})=>this._renderOption(`${t}`,i,e))))):n("div",{class:u.valueInputContainer,key:"value-input"},n("calcite-input",{label:i.value,type:this._valueInputType,value:e,onCalciteInputInput:({currentTarget:e})=>{this._onValueChange(e.value)}}))}_onValueChange(e){const{viewModel:t}=this;e&&""!==e?t.isStringField||t.isGlobalIDField?this.value=e.toString():(t.isNumericField||t.isObjectIDField)&&(this.value=parseFloat(e)):this.value=null}};e([t()],c.prototype,"_defaultFieldName",null),e([t()],c.prototype,"_valueInputType",null),e([t()],c.prototype,"_visibleOperators",null),e([t()],c.prototype,"_isValueInputHidden",null),e([t()],c.prototype,"domain",null),e([t()],c.prototype,"field",null),e([t()],c.prototype,"fields",null),e([t()],c.prototype,"fieldLabel",null),e([t()],c.prototype,"fieldName",null),e([t()],c.prototype,"layer",null),e([t(),s("esri/widgets/support/FilterCondition/t9n/FilterCondition")],c.prototype,"messages",void 0),e([t(),s("esri/t9n/common")],c.prototype,"messagesCommon",void 0),e([t()],c.prototype,"normalizedFieldName",null),e([t()],c.prototype,"operator",null),e([t()],c.prototype,"operators",null),e([t()],c.prototype,"state",null),e([t()],c.prototype,"value",null),e([t()],c.prototype,"valueAsString",null),e([t()],c.prototype,"viewModel",void 0),e([t()],c.prototype,"visibleElements",void 0),e([i("visibleElements")],c.prototype,"castVisibleElements",null),e([t()],c.prototype,"whereClause",null),c=e([l("esri.widgets.support.FilterCondition")],c);const m=c;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/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../chunks/tslib.es6.js";import{assertIsSome as r}from"../../core/maybe.js";import{property as e}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";const t=t=>{let i=class extends t{constructor(...o){super(...o),this.goToOverride=null,this.view=null}callGoTo(o){const{view:e}=this;return r(e),this.goToOverride?this.goToOverride(e,o):e.goTo(o.target,o.options)}};return o([e()],i.prototype,"goToOverride",void 0),o([e()],i.prototype,"view",void 0),i=o([s("esri.widgets.support.GoTo")],i),i};export{t as default};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import{assertIsSome as r}from"../../core/maybe.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 e}from"../../core/accessorSupport/decorators/subclass.js";import{goTo as t}from"./goToUtils.js";const i=i=>{let p=class extends i{constructor(...o){super(...o),this.goToOverride=null,this.view=null}callGoTo(o){const{view:s}=this;return r(s),this.goToOverride?this.goToOverride(s,o):t(s,o)}};return o([s()],p.prototype,"goToOverride",void 0),o([s()],p.prototype,"view",void 0),p=o([e("esri.widgets.support.GoTo")],p),p};export{i as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
+ */
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import s from"../../../core/Clonable.js";import r from"../../../core/Collection.js";import i from"../../../core/Identifiable.js";import{ignoreAbortErrors as a,debounce as n}from"../../../core/promiseUtils.js";import c from"../../../core/ReactiveMap.js";import{watch as l,initial as u}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{isSubtypeSublayer as h}from"../../../layers/support/layerUtils.js";import p from"../../../rest/networks/support/NetworkElement.js";import m from"../../../rest/support/Query.js";import{featureUtilityNetworkFields as g}from"../../Feature/FeatureUtilityNetworkAssociations/resources.js";import{findUtilityNetwork as A}from"../../Feature/support/featureUtils.js";const b=100;let w=class extends(s.ClonableMixin(i.IdentifiableMixin(o))){constructor(t){super(t),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.source="popup",this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._queryOpenAssociationType=async()=>{this.activeAssociationType&&await this._queryDebounced(this.activeAssociationType)},this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await a(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await a(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=n(this._queryController,b),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,b)}initialize(){this.addHandles([l((()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery]),(()=>this.refresh()),u),l((()=>this.activeAssociationType),(t=>this._queryDebounced(t)),u)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&"string"==typeof this.globalId}get canQuery(){const t=this.layer?.capabilities?.query;return!!this.associationTypes&&"string"==typeof this.globalId&&!!t?.supportsPagination}set displayCount(t){const e=0,o=3;this._set("displayCount",Math.max(t??o,e))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:t}=this;return t?.globalIdField}get activeAssociationType(){return this._get("activeAssociationType")}set activeAssociationType(t){t&&!this.associationTypes.includes(t)||this._set("activeAssociationType",t)}get state(){const{_queryAbortController:t,_queryFeatureCountAbortController:e,_queryPageAbortController:o,canQuery:s,_loaded:r,canLoad:i,source:a}=this;return e||i&&!r?"loading":t||o?"querying":!s||"popup"===a&&0===this.featureCount?"disabled":"ready"}get utilityNetwork(){const{layer:t,map:e}=this;if(!t?.loaded||!e)return null;const o=h(t)?t.parent:t;return A(e,o)}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new r}get structureAssociations(){return this._get("structureAssociations")||new r}get contentAssociations(){return this._get("contentAssociations")||new r}get containerAssociations(){return this._get("containerAssociations")||new r}get connectivityAssociations(){return this._get("connectivityAssociations")||new r}get associationFeatures(){return this._get("associationFeatures")||new c}get associationViewModels(){return this._get("associationViewModels")||new Map}async refresh(){await this._queryFeatureCountDebounced(),await this._queryOpenAssociationType()}getFeatureCountForAssociationType(t){switch(t){case"attachment":return this.attachmentsFeatureCount;case"structure":return this.structureFeatureCount;case"content":return this.contentFeatureCount;case"container":return this.containerFeatureCount;case"connectivity":return this.connectivityFeatureCount}}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach((t=>t.destroyAll()))}async _loadUtiltyNetworks(){const t=this.map;if(!t)return;await Promise.allSettled(t.utilityNetworks?.map((async t=>{await t.load()}))??[]);const e=this.utilityNetwork;if(e){const o=t=>{if("layerId"in t&&e.isUtilityLayer(t)){const o=e.getSourceIdByLayerId(t.layerId);null!==o&&this.networkSourceIdsInUse.add(o)}};this._set("networkSourceIdsInUse",new Set),t.allLayers.forEach(o),t.allTables.forEach(o)}}async _findLayersBySourceId(t){const{utilityNetwork:e,map:o}=this,s=t=>{const o=t;if(!t.url)return!1;if(o.layerId===r){return t.url.replace(/\/\d+$/,"")===e?.featureServiceUrl}return!1};await(e?.load());const r=e.getLayerIdBySourceId(t),i=o.allLayers.filter(s),a=o.allTables.filter(s),n=i.concat(a).toArray();return await Promise.allSettled(n.map((t=>t.load()))),n}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach((t=>t.removeAll())),this.associationFeatures.clear()}_getAssociationsByType(t){switch(t){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}async _queryLayer(t,e,o,s,r){const i=t.fieldsIndex.get(g.assetGroup),a=t.fieldsIndex.get(g.assetType),n=null!=o,c=null!=s,l="("+e.map((t=>`'${t}'`)).join(", ")+")",u=n?` AND ${i?.name} = ${o}`:"",d=n&&c?` AND ${a?.name} = ${s}`:"",y=`${t.globalIdField} IN ${l}`+u+d,h=new m({outFields:["*"],cacheHint:this.supportsCacheHint,where:y});return await this._queryAll(h,t,{signal:r?.signal})}async _createAssociationFeatureObjects(t,e,o,s,r,i){if(0===t.length)return[];const a=new Map;for(const[c,l]of e){const t=await this._findLayersBySourceId(c);for(const e of t){(await this._queryLayer(e,l,s,r,i)).forEach((t=>{if("popup"===this.source?t.layer&&t.getEffectivePopupTemplate():!!t.layer){const o=a.get(t.attributes[e.globalIdField])??[];o.push(t),a.set(t.attributes[e.globalIdField],o)}}))}}const n=[];return t.toArray().forEach((t=>{const{fromNetworkElement:e,toNetworkElement:s}=t,r=e.globalId===o?s:e;(a.get(r.globalId)??[]).forEach((e=>{const o=this.utilityNetwork?.getTerminalById(r?.terminalId)?.name;n.push({association:t,feature:e,terminalName:o})}))})),n}_parseFeatureObjects(t,e){t.forEach((t=>{const o=t?.feature,s=o.layer,i=e.get(s)??new r;i.add(t),e.set(s,i)}))}async _queryAll(t,e,o){const s=[];let r=0,i=!1;t.num=e.sourceJSON?.maxRecordCount??2e3;do{t.start=r;const a=await e.queryFeatures(t,o);s.push(...a.features),i=a.exceededTransferLimit,i&&(r+=a.features.length)}while(i);return s}async _queryAssociations(t){const{layer:e,globalId:o,associationTypes:s,utilityNetwork:r,canQuery:i}=this;if(await Promise.allSettled([e?.load(),r?.load()]),this._clearAssociations(),!(i&&e&&s&&r&&o))return;const a=h(e)?e.parent:e,n=new p({globalId:o,networkSourceId:r.getSourceIdByLayerId(a.layerId)}),c=new Set;s.forEach((t=>{switch(t.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity")}}));const l=await(r?.queryAssociations({elements:[n],types:Array.from(c)},{signal:t?.signal})),u=new Map,d=new Map;s.forEach((t=>{d.set(t.type,t),u.set(t.type,[])})),l.forEach((t=>{const{toNetworkElement:e,fromNetworkElement:s}=t;switch(t.associationType){case"connectivity":case"junction-junction-connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"connectivity",d))break;u.get("connectivity")?.push(e.globalId)}else{if(this._shouldDiscardNetworkElement(s,"connectivity",d))break;u.get("connectivity")?.push(s.globalId)}this.connectivityAssociations.add(t);break;case"containment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"content",d))break;u.get("content")?.push(e.globalId),this.contentAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"container",d))break;u.get("container")?.push(s.globalId),this.containerAssociations.add(t)}break;case"attachment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"attachment",d))break;u.get("attachment")?.push(e.globalId),this.attachmentsAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"structure",d))break;u.get("structure")?.push(s.globalId),this.structureAssociations.add(t)}}}));const y=s.map((async e=>{const{associatedNetworkSourceId:o,associatedAssetGroup:s,associatedAssetType:r}=e,i=u.get(e.type),a=null!=s?await this._countAssociatedFeatures(o,i,s,r,t):i.length;switch(e.type){case"attachment":this._set("attachmentsFeatureCount",a);break;case"structure":this._set("structureFeatureCount",a);break;case"content":this._set("contentFeatureCount",a);break;case"container":this._set("containerFeatureCount",a);break;case"connectivity":this._set("connectivityFeatureCount",a)}}));await Promise.allSettled(y)}async _countAssociatedFeatureCount(t,e,o,s,r){const i=t.fieldsIndex.get(g.assetGroup),a=t.fieldsIndex.get(g.assetType),n=null!=s,c="("+e.map((t=>`'${t}'`)).join(", ")+")",l=` AND ${i?.name} = ${o}`,u=n?` AND ${a?.name} = ${s}`:"",d=`${t.globalIdField} IN ${c}`+l+u;return t.queryFeatureCount({where:d,outFields:["*"],returnGeometry:!1},{signal:r?.signal})}async _countAssociatedFeatures(t,e,o,s,r){if(0===e.length)return 0;const i=(await this._findLayersBySourceId(t)).map((async t=>this._countAssociatedFeatureCount(t,e,o,s,r)));return(await Promise.all(i)).reduce(((t,e)=>t+e),0)}async _queryAssociatedFeatures(t,e){const{layer:o,globalId:s,associationTypes:r,utilityNetwork:i,canQuery:a,associationFeatures:n}=this;if(await Promise.allSettled([o?.load(),i?.load()]),!(a&&o&&r&&i))return;const c=this._getAssociationsByType(t.type),{associatedAssetGroup:l,associatedAssetType:u}=t,d=new Map;c.forEach((t=>{const{fromNetworkElement:e,toNetworkElement:o}=t,{networkSourceId:r,elementGlobalId:i}=e.globalId===s?{networkSourceId:o.networkSourceId,elementGlobalId:o.globalId}:{networkSourceId:e.networkSourceId,elementGlobalId:e.globalId},a=d.get(r)||[];a.push(i),d.set(r,a)}));const y=await this._createAssociationFeatureObjects(c,d,s,l,u,e);this._parseFeatureObjects(y,n)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:t,canQuery:e}=this;e?(await this._queryAssociations(t),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(t){if(!t)return;await this._loadUtiltyNetworks();const{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),0!==this.featureCount&&(this.destroyed||await this._queryAssociatedFeatures(t,{signal:e?.signal}))}_shouldDiscardNetworkElement(t,e,o){if(!t)return!1;const{networkSourceIdsInUse:s}=this,{networkSourceId:r}=t,i=o.get(e)?.associatedNetworkSourceId,a=s.has(r);return null!=i&&i!==r||!a}};t([d()],w.prototype,"_loaded",void 0),t([d()],w.prototype,"_queryAbortController",void 0),t([d()],w.prototype,"_queryPageAbortController",void 0),t([d()],w.prototype,"_queryFeatureCountAbortController",void 0),t([d({readOnly:!0})],w.prototype,"supportsCacheHint",null),t([d({readOnly:!0})],w.prototype,"canLoad",null),t([d({readOnly:!0})],w.prototype,"canQuery",null),t([d()],w.prototype,"networkSourceIdsInUse",void 0),t([d({constructOnly:!0})],w.prototype,"source",void 0),t([d()],w.prototype,"description",void 0),t([d({value:3})],w.prototype,"displayCount",null),t([d({type:e})],w.prototype,"graphic",void 0),t([d()],w.prototype,"layer",void 0),t([d()],w.prototype,"map",void 0),t([d({readOnly:!0})],w.prototype,"objectId",null),t([d({readOnly:!0})],w.prototype,"objectIdField",null),t([d({readOnly:!0})],w.prototype,"globalId",null),t([d({readOnly:!0})],w.prototype,"globalIdField",null),t([d()],w.prototype,"featureCount",void 0),t([d()],w.prototype,"associationTypes",void 0),t([d()],w.prototype,"activeAssociationType",null),t([d()],w.prototype,"showAllEnabled",void 0),t([d()],w.prototype,"state",null),t([d()],w.prototype,"title",void 0),t([d({readOnly:!0})],w.prototype,"utilityNetwork",null),t([d({readOnly:!0})],w.prototype,"attachmentsFeatureCount",void 0),t([d({readOnly:!0})],w.prototype,"structureFeatureCount",void 0),t([d({readOnly:!0})],w.prototype,"attachmentsAssociations",null),t([d({readOnly:!0})],w.prototype,"structureAssociations",null),t([d({readOnly:!0})],w.prototype,"contentFeatureCount",void 0),t([d({readOnly:!0})],w.prototype,"containerFeatureCount",void 0),t([d({readOnly:!0})],w.prototype,"contentAssociations",null),t([d({readOnly:!0})],w.prototype,"containerAssociations",null),t([d({readOnly:!0})],w.prototype,"connectivityFeatureCount",void 0),t([d({readOnly:!0})],w.prototype,"connectivityAssociations",null),t([d({readOnly:!0})],w.prototype,"associationFeatures",null),t([d({readOnly:!0})],w.prototype,"associationViewModels",null),w=t([y("esri.widgets.support.UtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],w);const _=w;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/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import t from"../../../core/ReactiveMap.js";import{watch as o}from"../../../core/reactiveUtils.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 s from"../../Widget.js";import{loadCalciteComponents as n}from"../componentsUtils.js";import"../widgetUtils.js";import{messageBundle as a}from"../decorators/messageBundle.js";import{tsx as c}from"../jsxFactory.js";import l from"./UtilityNetworkAssociationsViewModel.js";import{substitute as u}from"../../../intl/substitute.js";const d="esri-utility-network-association-list",p={featureObserver:`${d}__feature-observer`,filterContainer:`${d}__filter-container`,limitNoticeContainer:`${d}__limit-notice-container`,loadingContainer:`${d}__loading-container`};let m=class extends s{constructor(e,o){super(e,o),this._isFeatureCountNoticeOpen=!0,this._observer=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this._observerNode=null,this.featuresPerPage=50,this.filterText="",this.headingLevel=5,this.maxFeatureCount=1e3,this.messagesFeature=null,this.messagesCommon=null,this.selectedLayer=null,this.tooltipReferenceMap=new t,this.viewModel=new l}initialize(){this.setUpObserver()}loadDependencies(){return n({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this.tooltipReferenceMap.clear()}get associatedFeatureCount(){const e=this.viewModel.associationViewModels,t=this.selectedLayer?e.get(this.selectedLayer):null;return t?t.length:0}set currentFeaturePage(e){const{featuresPerPage:t,associatedFeatureCount:o}=this,i=Math.ceil(o/t)||1,r=Math.max(Math.min(e,i),1);this._set("currentFeaturePage",r)}get currentFeaturePage(){return this._get("currentFeaturePage")??1}get endIndex(){const{currentFeaturePage:e,featuresPerPage:t,maxFeatureCount:o}=this;return Math.min(e*t,o)}renderConnectivityIcon(e,t){const{tooltipReferenceMap:o}=this;let i;switch(e){case"junction-edge-from-connectivity":i="connection-end-left";break;case"junction-edge-to-connectivity":i="connection-end-right";break;case"junction-edge-midspan-connectivity":i="connection-middle";break;default:i="connection-to-connection"}return c("calcite-icon",{afterCreate:e=>o.set(t,e),afterRemoved:()=>o.delete(t),icon:i,scale:"s",slot:"content-start"})}renderFeatureCountWarning(){const{associatedFeatureCount:e,maxFeatureCount:t,messagesFeature:o}=this;return e>t?c("calcite-notice",{class:this._isFeatureCountNoticeOpen?p.limitNoticeContainer:void 0,closable:!0,icon:"information",kind:"info",open:!0,scale:"s",width:"full",onCalciteNoticeBeforeOpen:()=>this._isFeatureCountNoticeOpen=!0,onCalciteNoticeClose:()=>this._isFeatureCountNoticeOpen=!1},c("div",{slot:"title"},o.associationsLimitNoticeTitle),c("div",{slot:"message"},u(o.associationsLimitNoticeMessage,{number:t}))):null}renderFeatureObserver(){return c("div",{afterCreate:this._onObserverCreate,bind:this,class:p.featureObserver,key:"feature-observer"})}renderFilter(){return c("div",{class:p.filterContainer,key:"filter"},c("calcite-input",{icon:"search",placeholder:this.messagesFeature.associationFilterPlaceholder,type:"search",onCalciteInputInput:e=>{this.filterText=e.currentTarget.value.trim().toLowerCase(),this.currentFeaturePage=1}}))}renderLoading(){return c("div",{class:p.loadingContainer,key:"loading-container"},this.renderLoadingIcon())}renderLoadingIcon(){return c("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}getConnectivityTooltip(e){const{messagesFeature:t}=this;switch(e){case"connectivity":case"junction-junction-connectivity":return t.associationsJunctionJunction;case"junction-edge-from-connectivity":return t.associationsJunctionEdgeFrom;case"junction-edge-midspan-connectivity":return t.associationsJunctionEdgeMidspan;case"junction-edge-to-connectivity":return t.associationsJunctionEdgeTo;default:return""}}setUpObserver(){this.addHandles(o((()=>this._observerNode),(()=>this._onObserverChange())))}_increaseFeaturePage(){this.currentFeaturePage++}async _onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e,showAllEnabled:t}=this.viewModel;this._observerNode&&"ready"===e&&t&&this._observer.observe(this._observerNode)}_onObserverCreate(e){this._observerNode=e}};e([i()],m.prototype,"_observer",void 0),e([i()],m.prototype,"_observerNode",void 0),e([i()],m.prototype,"associatedFeatureCount",null),e([i()],m.prototype,"currentFeaturePage",null),e([i()],m.prototype,"endIndex",null),e([i()],m.prototype,"featuresPerPage",void 0),e([i()],m.prototype,"filterText",void 0),e([i()],m.prototype,"headingLevel",void 0),e([i()],m.prototype,"maxFeatureCount",void 0),e([i(),a("esri/widgets/Feature/t9n/Feature")],m.prototype,"messagesFeature",void 0),e([i(),a("esri/t9n/common")],m.prototype,"messagesCommon",void 0),e([i()],m.prototype,"selectedLayer",void 0),e([i()],m.prototype,"tooltipReferenceMap",void 0),e([i({type:l})],m.prototype,"viewModel",void 0),m=e([r("esri.widgets.support.UtilityNetworkAssociations.UtilityNetworkAssociationList")],m);const h=m;export{h as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import t from"../../../core/ReactiveMap.js";import{watch as o}from"../../../core/reactiveUtils.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 s from"../../Widget.js";import{loadCalciteComponents as n}from"../componentsUtils.js";import"../widgetUtils.js";import{messageBundle as a}from"../decorators/messageBundle.js";import{tsx as c}from"../jsxFactory.js";import l from"./FeatureUtilityNetworkAssociationsViewModel.js";import{substitute as u}from"../../../intl/substitute.js";const d="esri-utility-network-association-list",p={featureObserver:`${d}__feature-observer`,filterContainer:`${d}__filter-container`,limitNoticeContainer:`${d}__limit-notice-container`,loadingContainer:`${d}__loading-container`};let m=class extends s{constructor(e,o){super(e,o),this._isFeatureCountNoticeOpen=!0,this._observer=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this._observerNode=null,this.featuresPerPage=50,this.filterText="",this.headingLevel=5,this.maxFeatureCount=1e3,this.messagesFeature=null,this.messagesCommon=null,this.selectedLayer=null,this.tooltipReferenceMap=new t,this.viewModel=new l}initialize(){this.setUpObserver()}loadDependencies(){return n({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this.tooltipReferenceMap.clear()}get associatedFeatureCount(){const e=this.viewModel.associationViewModels,t=this.selectedLayer?e.get(this.selectedLayer):null;return t?t.length:0}set currentFeaturePage(e){const{featuresPerPage:t,associatedFeatureCount:o}=this,i=Math.ceil(o/t)||1,r=Math.max(Math.min(e,i),1);this._set("currentFeaturePage",r)}get currentFeaturePage(){return this._get("currentFeaturePage")??1}get endIndex(){const{currentFeaturePage:e,featuresPerPage:t,maxFeatureCount:o}=this;return Math.min(e*t,o)}renderConnectivityIcon(e,t){const{tooltipReferenceMap:o}=this;let i;switch(e){case"junction-edge-from-connectivity":i="connection-end-left";break;case"junction-edge-to-connectivity":i="connection-end-right";break;case"junction-edge-midspan-connectivity":i="connection-middle";break;default:i="connection-to-connection"}return c("calcite-icon",{afterCreate:e=>o.set(t,e),afterRemoved:()=>o.delete(t),icon:i,scale:"s",slot:"content-start"})}renderFeatureCountWarning(){const{associatedFeatureCount:e,maxFeatureCount:t,messagesFeature:o}=this;return e>t?c("calcite-notice",{class:this._isFeatureCountNoticeOpen?p.limitNoticeContainer:void 0,closable:!0,icon:"information",kind:"info",open:!0,scale:"s",width:"full",onCalciteNoticeBeforeOpen:()=>this._isFeatureCountNoticeOpen=!0,onCalciteNoticeClose:()=>this._isFeatureCountNoticeOpen=!1},c("div",{slot:"title"},o.associationsLimitNoticeTitle),c("div",{slot:"message"},u(o.associationsLimitNoticeMessage,{number:t}))):null}renderFeatureObserver(){return c("div",{afterCreate:this._onObserverCreate,bind:this,class:p.featureObserver,key:"feature-observer"})}renderFilter(){return c("div",{class:p.filterContainer,key:"filter"},c("calcite-input",{icon:"search",placeholder:this.messagesFeature.associationFilterPlaceholder,type:"search",onCalciteInputInput:e=>{this.filterText=e.currentTarget.value.trim().toLowerCase(),this.currentFeaturePage=1}}))}renderLoading(){return c("div",{class:p.loadingContainer,key:"loading-container"},this.renderLoadingIcon())}renderLoadingIcon(){return c("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}getConnectivityTooltip(e){const{messagesFeature:t}=this;switch(e){case"connectivity":case"junction-junction-connectivity":return t.associationsJunctionJunction;case"junction-edge-from-connectivity":return t.associationsJunctionEdgeFrom;case"junction-edge-midspan-connectivity":return t.associationsJunctionEdgeMidspan;case"junction-edge-to-connectivity":return t.associationsJunctionEdgeTo;default:return""}}setUpObserver(){this.addHandles(o((()=>this._observerNode),(()=>this._onObserverChange())))}_increaseFeaturePage(){this.currentFeaturePage++}async _onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e,showAllEnabled:t}=this.viewModel;this._observerNode&&"ready"===e&&t&&this._observer.observe(this._observerNode)}_onObserverCreate(e){this._observerNode=e}};e([i()],m.prototype,"_observer",void 0),e([i()],m.prototype,"_observerNode",void 0),e([i()],m.prototype,"associatedFeatureCount",null),e([i()],m.prototype,"currentFeaturePage",null),e([i()],m.prototype,"endIndex",null),e([i()],m.prototype,"featuresPerPage",void 0),e([i()],m.prototype,"filterText",void 0),e([i()],m.prototype,"headingLevel",void 0),e([i()],m.prototype,"maxFeatureCount",void 0),e([i(),a("esri/widgets/Feature/t9n/Feature")],m.prototype,"messagesFeature",void 0),e([i(),a("esri/t9n/common")],m.prototype,"messagesCommon",void 0),e([i()],m.prototype,"selectedLayer",void 0),e([i()],m.prototype,"tooltipReferenceMap",void 0),e([i({type:l})],m.prototype,"viewModel",void 0),m=e([r("esri.widgets.support.UtilityNetworkAssociations.UtilityNetworkAssociationList")],m);const h=m;export{h as default};