@arcgis/map-components 5.2.0-next.51 → 5.2.0-next.52

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 (39) hide show
  1. package/README.md +2 -2
  2. package/dist/cdn/4JAQPYHG.js +2 -0
  3. package/dist/cdn/7RN4FELN.js +2 -0
  4. package/dist/cdn/{TXPI3GGA.js → AIVVE6PW.js} +1 -1
  5. package/dist/cdn/{KBQRHXQ4.js → BCDL4T34.js} +1 -1
  6. package/dist/cdn/H5DDBPGU.js +2 -0
  7. package/dist/cdn/HFJDGHMV.js +2 -0
  8. package/dist/cdn/HGL6PAIG.js +2 -0
  9. package/dist/cdn/NWUV3BTR.js +2 -0
  10. package/dist/cdn/{6RSIIYYJ.js → QA56535U.js} +1 -1
  11. package/dist/cdn/U26MQUQF.js +2 -0
  12. package/dist/cdn/UOXJUYC7.js +2 -0
  13. package/dist/cdn/index.js +1 -1
  14. package/dist/chunks/useArcgisViewReadyError.js +14 -7
  15. package/dist/components/arcgis-utility-network-aggregated-geometry/customElement.js +59 -53
  16. package/dist/components/arcgis-utility-network-subnetwork-info/customElement.d.ts +1 -1
  17. package/dist/components/arcgis-utility-network-subnetwork-info/customElement.js +12 -12
  18. package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +116 -105
  19. package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +199 -182
  20. package/dist/components/arcgis-utility-network-trace-location/customElement.js +68 -67
  21. package/dist/components/arcgis-utility-network-trace-location-list/customElement.js +26 -26
  22. package/dist/components/arcgis-utility-network-trace-results/customElement.js +128 -108
  23. package/dist/docs/api.json +1 -1
  24. package/dist/docs/docs.json +1 -1
  25. package/dist/docs/web-types.json +1 -1
  26. package/dist/loader.js +1 -1
  27. package/dist/types/lumina.d.ts +1 -1
  28. package/dist/types/preact.d.ts +1 -1
  29. package/dist/types/react.d.ts +1 -1
  30. package/dist/types/stencil.d.ts +1 -1
  31. package/package.json +4 -4
  32. package/dist/cdn/3BU2B6F7.js +0 -2
  33. package/dist/cdn/3HHUVV6D.js +0 -2
  34. package/dist/cdn/4GZ7DNJF.js +0 -2
  35. package/dist/cdn/CWFOZVE7.js +0 -2
  36. package/dist/cdn/J6ZHNOE2.js +0 -2
  37. package/dist/cdn/MUAJSX4F.js +0 -2
  38. package/dist/cdn/MUFXNQE3.js +0 -2
  39. package/dist/cdn/NKWXCVN3.js +0 -2
package/dist/loader.js CHANGED
@@ -154,7 +154,7 @@ const s = t(e, {
154
154
  "arcgis-utility-network-trace": [() => import("./components/arcgis-utility-network-trace/customElement.js"), "autoDestroyDisabled,defaultGraphicColor:,disabled,enableResultArea,flags:,icon,inputSettings:,label,referenceElement,resultAreaProperties:,selectedTraces:,selectOnCompleteDisabled,showGraphicsOnCompleteDisabled,showSelectionAttributesDisabled,state:,traceResults:,view:;checkCanTrace,confirmReset,destroy"],
155
155
  "arcgis-utility-network-trace-analysis": [() => import("./components/arcgis-utility-network-trace-analysis/customElement.js"), "_messages:,aggregatedGeometryGraphicsColor:,autoDestroyDisabled,beforeTraceLocationSelectStart:,disableHighlightFeatureResults,hideActionBar,hideFeatureResults,label,messageOverrides:,referenceElement,state:,traceResultFeatures:,view:;destroy"],
156
156
  "arcgis-utility-network-aggregated-geometry": [() => import("./components/arcgis-utility-network-aggregated-geometry/customElement.js"), "_messages:,autoDestroyDisabled,geometry:,graphicsColor:,hideGraphics,view:;destroy"],
157
- "arcgis-utility-network-subnetwork-info": [() => import("./components/arcgis-utility-network-subnetwork-info/customElement.js"), "_messages:,namedTraceConfig:"],
157
+ "arcgis-utility-network-subnetwork-info": [() => import("./components/arcgis-utility-network-subnetwork-info/customElement.js"), "_messages:,namedTraceConfiguration:"],
158
158
  "arcgis-utility-network-trace-inputs": [() => import("./components/arcgis-utility-network-trace-inputs/customElement.js"), "_messages:,autoDestroyDisabled,beforeTraceLocationSelectStart:,hideActionBar,isSubnetworkNameTraceSelected:,mode,referenceElement,selectedNamedTraceConfiguration:,selectedUtilityNetwork:,traceConfiguration:,traceLocationFlagInfos:,traceLocations:,view:;destroy"],
159
159
  "arcgis-utility-network-trace-location": [() => import("./components/arcgis-utility-network-trace-location/customElement.js"), "_messages:,afterHitTest:,autoDestroyDisabled,beforeTraceLocationSelectStart:,filterLayers:,sketchViewModel:,spatialTolerance,traceLocations:,traceLocationType,utilityNetwork:,view:;destroy"],
160
160
  "arcgis-utility-network-trace-location-list": [() => import("./components/arcgis-utility-network-trace-location-list/customElement.js"), "_messages:,traceLocations:,traceLocationType,view:"],
@@ -759,7 +759,7 @@ interface LuminaArcgisUtilityNetworkAggregatedGeometry extends Required<Pick<Arc
759
759
  onarcgisHideGraphicsChange?: EventHandler<ArcgisUtilityNetworkAggregatedGeometry["arcgisHideGraphicsChange"]>;
760
760
  }
761
761
 
762
- interface LuminaArcgisUtilityNetworkSubnetworkInfo extends Required<Pick<ArcgisUtilityNetworkSubnetworkInfo, "namedTraceConfig">>, h.JSX.HTMLAttributes<ArcgisUtilityNetworkSubnetworkInfo> {
762
+ interface LuminaArcgisUtilityNetworkSubnetworkInfo extends Required<Pick<ArcgisUtilityNetworkSubnetworkInfo, "namedTraceConfiguration">>, h.JSX.HTMLAttributes<ArcgisUtilityNetworkSubnetworkInfo> {
763
763
  }
764
764
 
765
765
  interface LuminaArcgisUtilityNetworkTraceInputs extends Partial<Pick<ArcgisUtilityNetworkTraceInputs, "autoDestroyDisabled" | "beforeTraceLocationSelectStart" | "hideActionBar" | "mode" | "referenceElement" | "selectedNamedTraceConfiguration" | "selectedUtilityNetwork" | "view">>, h.JSX.HTMLAttributes<ArcgisUtilityNetworkTraceInputs> {
@@ -760,7 +760,7 @@ interface PreactArcgisUtilityNetworkAggregatedGeometry extends Required<Pick<Arc
760
760
  onarcgisHideGraphicsChange?: EventHandler<ArcgisUtilityNetworkAggregatedGeometry["arcgisHideGraphicsChange"]>;
761
761
  }
762
762
 
763
- interface PreactArcgisUtilityNetworkSubnetworkInfo extends Required<Pick<ArcgisUtilityNetworkSubnetworkInfo, "namedTraceConfig">>, HTMLAttributes<ArcgisUtilityNetworkSubnetworkInfo> {
763
+ interface PreactArcgisUtilityNetworkSubnetworkInfo extends Required<Pick<ArcgisUtilityNetworkSubnetworkInfo, "namedTraceConfiguration">>, HTMLAttributes<ArcgisUtilityNetworkSubnetworkInfo> {
764
764
  }
765
765
 
766
766
  interface PreactArcgisUtilityNetworkTraceInputs extends Partial<Pick<ArcgisUtilityNetworkTraceInputs, "autoDestroyDisabled" | "beforeTraceLocationSelectStart" | "hideActionBar" | "mode" | "referenceElement" | "selectedNamedTraceConfiguration" | "selectedUtilityNetwork" | "view">>, HTMLAttributes<ArcgisUtilityNetworkTraceInputs> {
@@ -760,7 +760,7 @@ interface ReactArcgisUtilityNetworkAggregatedGeometry extends Required<Pick<Arcg
760
760
  onarcgisHideGraphicsChange?: EventHandler<ArcgisUtilityNetworkAggregatedGeometry["arcgisHideGraphicsChange"]>;
761
761
  }
762
762
 
763
- interface ReactArcgisUtilityNetworkSubnetworkInfo extends Required<Pick<ArcgisUtilityNetworkSubnetworkInfo, "namedTraceConfig">>, HTMLProps<ArcgisUtilityNetworkSubnetworkInfo> {
763
+ interface ReactArcgisUtilityNetworkSubnetworkInfo extends Required<Pick<ArcgisUtilityNetworkSubnetworkInfo, "namedTraceConfiguration">>, HTMLProps<ArcgisUtilityNetworkSubnetworkInfo> {
764
764
  }
765
765
 
766
766
  interface ReactArcgisUtilityNetworkTraceInputs extends Partial<Pick<ArcgisUtilityNetworkTraceInputs, "autoDestroyDisabled" | "beforeTraceLocationSelectStart" | "hideActionBar" | "mode" | "referenceElement" | "selectedNamedTraceConfiguration" | "selectedUtilityNetwork" | "view">>, HTMLProps<ArcgisUtilityNetworkTraceInputs> {
@@ -760,7 +760,7 @@ interface StencilArcgisUtilityNetworkAggregatedGeometry extends Required<Pick<Ar
760
760
  onArcgisHideGraphicsChange?: EventHandler<ArcgisUtilityNetworkAggregatedGeometry["arcgisHideGraphicsChange"]>;
761
761
  }
762
762
 
763
- interface StencilArcgisUtilityNetworkSubnetworkInfo extends Required<Pick<ArcgisUtilityNetworkSubnetworkInfo, "namedTraceConfig">>, StencilJsx.HTMLAttributes<ArcgisUtilityNetworkSubnetworkInfo> {
763
+ interface StencilArcgisUtilityNetworkSubnetworkInfo extends Required<Pick<ArcgisUtilityNetworkSubnetworkInfo, "namedTraceConfiguration">>, StencilJsx.HTMLAttributes<ArcgisUtilityNetworkSubnetworkInfo> {
764
764
  }
765
765
 
766
766
  interface StencilArcgisUtilityNetworkTraceInputs extends Partial<Pick<ArcgisUtilityNetworkTraceInputs, "autoDestroyDisabled" | "beforeTraceLocationSelectStart" | "hideActionBar" | "mode" | "referenceElement" | "selectedNamedTraceConfiguration" | "selectedUtilityNetwork" | "view">>, StencilJsx.HTMLAttributes<ArcgisUtilityNetworkTraceInputs> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/map-components",
3
- "version": "5.2.0-next.51",
3
+ "version": "5.2.0-next.52",
4
4
  "description": "ArcGIS Map Components",
5
5
  "keywords": [
6
6
  "2D",
@@ -46,9 +46,9 @@
46
46
  "lit": "^3.3.0",
47
47
  "lodash-es": "^4.18.1",
48
48
  "tslib": "^2.8.1",
49
- "@arcgis/common-components": "5.2.0-next.51",
50
- "@arcgis/lumina": "5.2.0-next.51",
51
- "@arcgis/toolkit": "5.2.0-next.51"
49
+ "@arcgis/toolkit": "5.2.0-next.52",
50
+ "@arcgis/common-components": "5.2.0-next.52",
51
+ "@arcgis/lumina": "5.2.0-next.52"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@arcgis/core": "^5.2.0-next",
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import c from"./MZWO5JYA.js";import a from"./P6CDJ2IV.js";import"./VJVKFKSG.js";import{a as $}from"./JP24H6WY.js";import{g as S}from"./Z7J6NDSB.js";import"./VWED2WAO.js";import"./QUZTFUWM.js";import"./RZ6SODVT.js";import{N as h,O as f,U as k,a as w,b as r,p as d,r as b,s as y,x as l}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([c,{watch:P},{substitute:I},E,F,x,L,U,{a:m},{a:T,b:u,d:g,e:C,f:N}])=>{var A=w`:host{height:100%;flex-grow:1}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-block-group{flex-grow:1;padding-bottom:var(--calcite-spacing-md);background-color:var(--calcite-color-foreground-1)}calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}calcite-block calcite-combobox,calcite-block calcite-input{margin:0 var(--calcite-spacing-md)}calcite-block calcite-input-message{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md) 0}calcite-notice{margin:var(--calcite-spacing-md)}#subnetwork-info-block{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0}#results-limited-message{padding:var(--calcite-spacing-sm)}.inline-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.add-spatial-mode{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);margin:var(--calcite-spacing-md)}.heading{color:var(--calcite-color-text-1);margin:0 0 var(--calcite-spacing-md);font-size:var(--calcite-font-size);font-weight:var(--calcite-font-weight-medium)}`,p=`utility-network-trace-inputs-sketch-${Date.now()}`,D=20,_=class extends f{constructor(){super(...arguments),this._defaultPopupTemplateEnabled=!0,this._messages=$({blocking:!0}),this._layerIdToLayer=new Map,this._startingPoints=new c,this._barriers=new c,this._stoppingPoints=new c,this._subnetworkTraceTypes=new Set(["subnetwork","subnetwork-controller","upstream","downstream","isolation"]),this._setUpMap=()=>{if(this._error=void 0,!this.view?.map){this._error=this._messages.errors.noView,this._utilityNetworks=void 0;return}let e=this.view.map;this._setupUtilityNetworks(e),this._setupSketchViewModel(e)},this._hitTestPromise=null,this._maxNumCandidateFeatures=20,this._traceLocationStartingRefChange=e=>{e&&(this._traceLocationStartingElement=e)},this._traceLocationBarrierRefChange=e=>{e&&(this._traceLocationBarrierElement=e)},this._traceLocationStoppingRefChange=e=>{e&&(this._traceLocationStoppingElement=e)},this._featuresComponentRefChange=e=>{e&&(this._featuresComponentElement=e)},this._handleFeaturesPropertyChange=({detail:e,target:t})=>{(e.name==="selectedDrillInFeature"||e.name==="selectedFeature")&&(this._selectedFeature=t.selectedDrillInFeature??t.selectedFeature??void 0)},this._candidateFeatures=[],this._compatibleSubnetworkNames=[],this._namedTraceConfigurations=[],this._subnetworkNamesState="ready",this._exceedDisplayLimit=!1,this.autoDestroyDisabled=!1,this.hideActionBar=!1,this.mode="default",this.arcgisPropertyChange=S()("mode"),this.arcgisSelectedNamedTraceConfigurationChange=l(),this.arcgisTraceInputsChange=l(),this.arcgisTraceLocationSelectEnd=l(),this.arcgisTraceLocationSelectStart=l(),this.arcgisUtilityNetworkChange=l()}static{this.properties={_selectedFeature:16,_candidateFeatures:16,_compatibleSubnetworkNames:16,_subnetworksTable:16,_namedTraceConfigurations:16,_utilityNetworks:16,_traceConfiguration:16,_error:16,_subnetworkNamesState:16,_activeTraceLocationType:16,_exceedDisplayLimit:16,beforeTraceLocationSelectStart:0,view:0,selectedUtilityNetwork:0,selectedNamedTraceConfiguration:0,autoDestroyDisabled:5,hideActionBar:5,traceConfiguration:32,isSubnetworkNameTraceSelected:32,referenceElement:1,mode:3,traceLocationFlagInfos:32,traceLocations:32}}static{this.styles=A}get _selectedSubnetworkName(){return this._traceConfiguration?.subnetworkName??void 0}set _selectedSubnetworkName(e){this._traceConfiguration&&(this._traceConfiguration.subnetworkName=e)}get _allLayersAndTables(){let{view:e}=this;return e?.map?e.map.allLayers.toArray().concat(e.map.allTables.toArray()):[]}get _showStartingPoints(){return!this.isSubnetworkNameTraceSelected}get _showStoppingPoints(){let e=this.selectedNamedTraceConfiguration?.traceType;return e==="path"||e==="circuit"}get _subnetworkLayerIds(){let e=this.selectedUtilityNetwork?.dataElement?.domainNetworks;return e?e.map(t=>t.subnetworkLayerId).filter(t=>t!=null&&t>-1):[]}get traceConfiguration(){return this._traceConfiguration}get isSubnetworkNameTraceSelected(){let{selectedNamedTraceConfiguration:e}=this;return!!e?.traceConfiguration?.subnetworkName&&e?.traceType==="subnetwork"}get traceLocationFlagInfos(){return new c([...this._startingPoints,...this._barriers,...this._stoppingPoints])}get traceLocations(){let e=[];return this._showStartingPoints&&this._startingPoints.forEach(t=>e.push(...this._createTraceLocations(t))),this._showStoppingPoints&&this._stoppingPoints.forEach(t=>e.push(...this._createTraceLocations(t))),this._barriers.forEach(t=>e.push(...this._createTraceLocations(t))),e}async destroy(){this._removeGraphicsLayerById(p),this._clearTraceLocations(),this._sketchViewModel?.cancel(),this._featuresComponentElement?.destroy(),this._traceLocationStartingElement?.destroy(),this._traceLocationBarrierElement?.destroy(),this._traceLocationStoppingElement?.destroy(),await this.manager.destroy()}load(){this._setUpMap(),this.manager.onLifecycle(()=>[P(()=>this.view?.map,()=>this._setUpMap())])}willUpdate(e){e.has("_utilityNetworks")&&this._handleUtilityNetworksChange(),e.has("selectedUtilityNetwork")&&(this.arcgisUtilityNetworkChange.emit(),this._handleSelectedUtilityNetworkChange()),e.has("selectedNamedTraceConfiguration")&&(this.arcgisTraceInputsChange.emit(),this.arcgisSelectedNamedTraceConfigurationChange.emit(),this._handleTraceConfigChange())}disconnectedCallback(){super.disconnectedCallback(),this._layerIdToLayer.clear()}_createTraceLocations(e){let t=e.flagProperties.selectedTerminals;return e.flagProperties.terminalConfiguration&&t?.size?Array.from(t,i=>new x({type:e.traceLocation.type,isFilterBarrier:e.traceLocation.isFilterBarrier,globalId:e.traceLocation.globalId,percentAlong:e.traceLocation.percentAlong,terminalId:i})):[e.traceLocation]}_clearTraceLocations(){this._startingPoints.forEach(e=>{e.spatialProperties.flagGraphic&&this.view?.graphics.remove(e.spatialProperties.flagGraphic)}),this._startingPoints.removeAll(),this._barriers.forEach(e=>{e.spatialProperties.flagGraphic&&this.view?.graphics.remove(e.spatialProperties.flagGraphic)}),this._barriers.removeAll(),this._stoppingPoints.forEach(e=>{e.spatialProperties.flagGraphic&&this.view?.graphics.remove(e.spatialProperties.flagGraphic)}),this._stoppingPoints.removeAll()}_createGraphicsLayerById(e,t){if(!e.findLayerById(t)){let i=new E({id:t,listMode:"hide",title:t});T(this.view,i)}}_getGraphicsLayerById(e,t){let i=e.findLayerById(t);return g(i)?(e.reorder(i,e.layers.length-1),i):null}_removeGraphicsLayerById(e){if(!this.view?.map)return;let{map:t}=this.view,i=t?.findLayerById(e);i&&g(i)&&t?.remove(i)}_setSnappingOptions(){if(!this._sketchViewModel)return;let e=new c;this._utilityNetworkLayers?.forEach(t=>{C(t)?t.sublayers.forEach(i=>{e.add(new L({layer:i,enabled:!0}))}):e.add(new L({layer:t,enabled:!0}))}),this._sketchViewModel.snappingOptions={enabled:!1,featureSources:e}}_initializeSketchViewModel(e){let{view:t}=this,i=this._getGraphicsLayerById(e,p);return new U({layer:i,view:t})}_setupSketchViewModel(e){this._createGraphicsLayerById(e,p),this._sketchViewModel=this._initializeSketchViewModel(e),this._setSnappingOptions()}_clearSubnetworks(){this._selectedSubnetworkName=void 0,this._subnetworksTable=void 0,this._compatibleSubnetworkNames=[]}async _loadSubnetworksTable(){this._subnetworksTable||(this._subnetworksTable=await this.selectedUtilityNetwork?.loadSubnetworksTable())}async _querySubnetworks(){let{_subnetworksTable:e}=this;if(!e)return;let t=e.fieldsIndex.get("SUBNETWORKNAME"),i=(o,n,v)=>n===0||o.getAttribute(t.name)!==v[n-1].getAttribute(t.name),a=e.createQuery();a.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,a.where=this._getSubnetworkQueryWhereClause(),a.outFields=[t.name],a.orderByFields=[t.name];let{features:s}=await u(e,a,void 0,!1);this._compatibleSubnetworkNames=s.filter(i).map(o=>o.getAttribute(t.name))}_getSubnetworkQueryWhereClause(){let e=this._traceConfiguration,t=`DOMAINNETWORKNAME = '${e.domainNetworkName}'`,i=`TIERNAME = '${e.tierName}'`;return[t,i].join(" AND ")}async _handleSubnetworkTraceConfigurationChange(e){await this._loadSubnetworksTable(),await this._querySubnetworks(),e.subnetworkName&&!this._compatibleSubnetworkNames.some(t=>t===e.subnetworkName)&&(this._selectedSubnetworkName=this._compatibleSubnetworkNames.at(0))}_selectTraceConfigurationByGlobalId(e){let t=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.find(i=>i.globalId===e);if(!t){d("error",this,"`traceConfig` not found in `selectedUtilityNetwork.sharedNamedTraceConfigurations`");return}this.selectedNamedTraceConfiguration=t}async _handleTraceConfigChange(){let{selectedNamedTraceConfiguration:e}=this;if(!(e?.traceConfiguration instanceof F)){d("error",this,b("selectedNamedTraceConfiguration.traceConfiguration")),this._traceConfiguration=void 0;return}this._traceConfiguration=e.traceConfiguration.clone(),this.isSubnetworkNameTraceSelected&&(this._subnetworkNamesState="loading",await this._handleSubnetworkTraceConfigurationChange(this._traceConfiguration),this._subnetworkNamesState="ready")}async _handleSelectedUtilityNetworkChange(){let{selectedUtilityNetwork:e}=this;try{e&&!e.loaded&&await e.load()}catch(t){m(t,this,"Error while loading the selected utility network")}this._clearSubnetworks(),this._setupTraceConfigurations(),this._setUtilityNetworkLayers(),this._clearTraceLocations()}_setupTraceConfigurations(){this._traceConfiguration=void 0,this.selectedNamedTraceConfiguration=void 0,this._namedTraceConfigurations=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.filter(Boolean).filter(e=>e.traceType!=="circuit").sort((e,t)=>e.title.localeCompare(t.title))||[],this._namedTraceConfigurations.length?this.selectedNamedTraceConfiguration=this._namedTraceConfigurations.at(0):d("error",this,"The selected utility network has no compatible named trace configurations.")}_setUtilityNetworkLayers(){let{selectedUtilityNetwork:e}=this;this._utilityNetworkLayers=new c(this._allLayersAndTables.filter(t=>e?.isUtilityLayer(t)&&!this._subnetworkLayerIds.includes(t.layerId))),this._setSnappingOptions()}_handleUtilityNetworksChange(){let{_utilityNetworks:e,selectedUtilityNetwork:t}=this;e?.length?(!t||!e.includes(t))&&(this.selectedUtilityNetwork=e.at(0)):(d("error",this,y("_utilityNetworks")),this.selectedUtilityNetwork=void 0,this._error=this._messages.errors.noUtilityNetwork)}async _setupUtilityNetworks(e){try{e.loaded||await e.load()}catch(t){m(t,this,"Error while loading `view.map`")}finally{this._utilityNetworks=e.utilityNetworks||new c}}_handleTraceLocationSelectStart(e){if(e.stopPropagation(),this.arcgisTraceLocationSelectStart.emit(e.detail).defaultPrevented){e.preventDefault();return}this._activeTraceLocationType=e?.target?.traceLocationType,this.mode="add-spatial-instructions"}_getLayerByLayerId(e){if(e==null)return;let{_layerIdToLayer:t,_utilityNetworkLayers:i}=this;if(t.get(e))return t.get(e);if(!i)return;let a=i.find(s=>"layerId"in s&&s.layerId===e);return a&&t.set(e,a),a}async _queryFeaturesOnLayer(e,t){let i=e.createQuery();i.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,i.objectIds=t.map(s=>s.getObjectId()),i.outFields=["*"];let{features:a}=await u(e,i);return a.forEach(s=>{if(!s.getEffectivePopupTemplate(this._defaultPopupTemplateEnabled)){let o=s.layer;s.popupTemplate=o.createPopupTemplate()}}),a}async _queryFeatures(e){let t=new Map,i=[];return e.forEach(a=>{let s=N(a.layer)?a.layer.parent:a.layer;if(s){let o=this._getLayerByLayerId(s.layerId);if(o){let n=t.get(o)||[];n.push(a),t.set(o,n)}}}),await Promise.all(Array.from(t.keys()).map(async a=>{let s=t.get(a)??[],o=await this._queryFeaturesOnLayer(a,s);i.push(...o)})),i}async _handleHitTestComplete(e){return this._exceedDisplayLimit=e.length>this._maxNumCandidateFeatures,this._candidateFeatures=await this._queryFeatures(e.slice(0,this._maxNumCandidateFeatures)),this._candidateFeatures.length===0?(this._handleAddSpatialCancelClick(),await Promise.reject(Error("No features found"))):(this._candidateFeatures.length===1&&(this._selectedFeature=this._candidateFeatures.at(0)),this.mode="add-spatial-feature",this._hitTestPromise?.reject(),this._hitTestPromise=Promise.withResolvers(),await this._hitTestPromise.promise)}_handleTraceLocationSelectEnd(e){e.stopPropagation(),this.arcgisTraceLocationSelectEnd.emit(),this._activeTraceLocationType=void 0,this.mode="default",this._handleAddSpatialCancelClick()}_handleAddSpatialCancelClick(e){e?.stopPropagation(),this._featuresComponentElement?.clear(),this._handleFeaturesClose(),this._sketchViewModel?.cancel()}_handleFeaturesClose(){this.mode="default",this._candidateFeatures=[],this._selectedFeature=void 0,this._hitTestPromise?.reject(),this._hitTestPromise=null}_handleAddSpatialAddClick(){let{_hitTestPromise:e,_featuresComponentElement:t,_selectedFeature:i}=this;if(e&&t){if(!i)return;e.resolve(i),this._hitTestPromise=null}}_renderError(e,t=!1,i){return r`<calcite-notice .closable=${t} kind=danger open scale=s width=auto .icon=${i}><div slot=message>${e}</div></calcite-notice>`}_renderLoader(){return r`<calcite-loader label=loading></calcite-loader>`}_renderTraceSelection(){let e=this._namedTraceConfigurations.map(i=>r`<calcite-combobox-item .value=${i.globalId} .heading=${i.title} .selected=${i.globalId===this.selectedNamedTraceConfiguration?.globalId}></calcite-combobox-item>`),t=this._messages.labels.traceConfiguration;return r`<calcite-block .heading=${t} .label=${t} expanded><calcite-combobox .label=${t} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:i})=>{let a=i.selectedItems[0]?.value;this._selectTraceConfigurationByGlobalId(a)}}>${e}</calcite-combobox></calcite-block>`}_renderUtilityNetworkSelection(){let e=this._messages.labels.utilityNetwork,t=this._utilityNetworks?.map(i=>r`<calcite-combobox-item .value=${i.id} .heading=${i.title||i.id} .selected=${i.id===this.selectedUtilityNetwork?.id}></calcite-combobox-item>`);return r`<calcite-block .heading=${e} .label=${e} expanded><calcite-combobox .label=${e} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:i})=>{let a=i.selectedItems[0]?.value;this.selectedUtilityNetwork?.id!==a&&(this.selectedUtilityNetwork=this._utilityNetworks?.find(s=>s.id===a))}}>${t}</calcite-combobox></calcite-block>`}_renderDefaultMode(){let{selectedUtilityNetwork:e}=this,{noView:t,noUtilityNetwork:i}=this._messages.errors,a;return this._error===t||this._error===i?a=this._renderError(this._error,!1,"exclamation-mark-triangle"):!e?.loaded&&!e?.loadError?a=this._renderLoader():a=this._renderContent(),r`<calcite-flow-item .selected=${this.mode==="default"}>${a}</calcite-flow-item>`}_renderSpatialSelectInstructions(){let{_messages:e,mode:t}=this,i=this._activeTraceLocationType==="starting-point"?e.labels.addSpatial.startingPoint:this._activeTraceLocationType==="barrier"?e.labels.addSpatial.barrier:e.labels.addSpatial.stoppingPoint;return r`<calcite-flow-item .selected=${t==="add-spatial-instructions"} .heading=${i} @calciteFlowItemBack=${a=>this._handleAddSpatialCancelClick(a)}><div class="add-spatial-mode"><div><h5 class="heading">${e.instructions.addSpatial.selectFeature.heading}</h5>${e.instructions.addSpatial.selectFeature.subheading}</div><div><h5 class="heading">${e.instructions.addSpatial.selectAssociatedFeature.heading}</h5>${e.instructions.addSpatial.selectAssociatedFeature.subheading}</div></div></calcite-flow-item>`}_renderCandidateFeatures(){if(!this._candidateFeatures.length)return this.mode="default",null;let e=this._activeTraceLocationType==="starting-point"?this._messages.labels.addSpatial.startingPoint:this._activeTraceLocationType==="barrier"?this._messages.labels.addSpatial.barrier:this._messages.labels.addSpatial.stoppingPoint,t=this._candidateFeatures.length===1?"feature":"list";return r`<arcgis-features-next .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this._defaultPopupTemplateEnabled} .features=${this._candidateFeatures} .featureMenuTitle=${e} .hideActionBar=${this.hideActionBar} hide-select-feature .initialDisplayMode=${t} @arcgisClose=${()=>this._handleFeaturesClose()} @arcgisPropertyChange=${this._handleFeaturesPropertyChange} open .referenceElement=${this.referenceElement} .view=${this.view} ${h(this._featuresComponentRefChange)}></arcgis-features-next>`}_renderAddSpatialFooter(){let{mode:e,_messages:t,_selectedFeature:i,selectedUtilityNetwork:a}=this,s=e==="add-spatial-feature"&&this._exceedDisplayLimit&&!i,o=I(t.warnings.exceededDisplayLimit,{limit:this._maxNumCandidateFeatures.toString()}),n=i?!(a?.isUtilityLayer(i.layer)??!0):!0;return r`${s&&r`<calcite-input-message id=results-limited-message icon=exclamation-mark-circle status=idle>${o}</calcite-input-message>`||""}<calcite-button appearance=outline width=full @click=${()=>this._handleAddSpatialCancelClick()} slot=footer>${t.buttons.cancel}</calcite-button>${e==="add-spatial-feature"&&r`<calcite-button width=full slot=footer appearance=solid @click=${()=>this._handleAddSpatialAddClick()} .disabled=${n}>${t.buttons.add}</calcite-button>`||""}`}_renderStartingPointSelection(){return r`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=starting-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._utilityNetworkLayers} .traceLocations=${this._startingPoints} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationStartingRefChange)}></arcgis-utility-network-trace-location>`}_renderStoppingPointSelection(){return r`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=stopping-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._utilityNetworkLayers} .traceLocations=${this._stoppingPoints} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationStoppingRefChange)}></arcgis-utility-network-trace-location>`}_renderBarrierSelection(){return r`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=barrier .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._utilityNetworkLayers} .traceLocations=${this._barriers} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationBarrierRefChange)}></arcgis-utility-network-trace-location>`}_renderSubnetworkNameInput(){return r`<calcite-input clearable type=text .placeholder=${this._messages.instructions.enterSubnetworkName} max-length=64 .status=${this._selectedSubnetworkName?"valid":"invalid"} .value=${this._selectedSubnetworkName} @calciteInputInput=${e=>this._selectedSubnetworkName=e.target.value}></calcite-input><calcite-input-message icon=exclamation-mark-triangle status=idle>${this._messages.labels.tooManySubnetworks}</calcite-input-message>`}_renderSubnetworkSelectList(){return r`<calcite-combobox .label=${this._messages.labels.subnetworkName} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:e})=>{let t=e.selectedItems[0]?.value;this._selectedSubnetworkName=t}}>${this._compatibleSubnetworkNames.map(e=>r`<calcite-combobox-item .value=${e} .heading=${e} .selected=${e===this._selectedSubnetworkName}></calcite-combobox-item>`)}</calcite-combobox>`}_renderSubnetworkSelection(){let e=this._messages.labels.subnetworkName;return this.isSubnetworkNameTraceSelected?this._subnetworkNamesState==="loading"?r`<calcite-loader class="inline-loader" label=loading scale=s></calcite-loader>`:this._compatibleSubnetworkNames.length?r`<calcite-block .heading=${e} .label=${e} expanded>${this._compatibleSubnetworkNames.length>D?this._renderSubnetworkNameInput():this._renderSubnetworkSelectList()}</calcite-block>`:this._renderError(this._messages.errors.noCompatibleSubnetworks,!1,"exclamation-mark-triangle"):null}_renderSubnetworkInfo(){let{selectedNamedTraceConfiguration:e}=this;return this._traceConfiguration&&e?.traceType&&this._subnetworkTraceTypes.has(e.traceType)?r`<calcite-block id=subnetwork-info-block expanded .label=${this._messages.labels.subnetworkInfo}><arcgis-utility-network-subnetwork-info .namedTraceConfig=${e}></arcgis-utility-network-subnetwork-info></calcite-block>`:null}_renderContent(){let{noTraceConfiguration:e,noNamedTraceConfigurations:t,utilityNetworkLoadFailed:i}=this._messages.errors,a=this._utilityNetworks&&this._utilityNetworks.length>1?this._renderUtilityNetworkSelection():null,s;this.selectedUtilityNetwork?.loadError?s=this._renderError(i,!1,"exclamation-mark-triangle"):this._namedTraceConfigurations.length||(s=this._renderError(t,!1,"exclamation-mark-triangle"));let o=r`${this._renderTraceSelection()}${this._renderSubnetworkInfo()}${this._renderSubnetworkSelection()}`,n=this.traceConfiguration?r`${this._showStartingPoints?this._renderStartingPointSelection():null}${this._showStoppingPoints?this._renderStoppingPointSelection():null}${this._renderBarrierSelection()}`:this._renderError(e,!1,"exclamation-mark-triangle");return r`<calcite-block-group .label=${this._messages.labels.traceInputs}>${a}${s??r`${o}${n}`}</calcite-block-group>`}render(){let{mode:e}=this;return r`<calcite-panel>${e==="add-spatial-feature"?this._renderCandidateFeatures():null}<calcite-flow .hidden=${e==="add-spatial-feature"}>${this._renderDefaultMode()}${this._renderSpatialSelectInstructions()}</calcite-flow>${e!=="default"?this._renderAddSpatialFooter():null}</calcite-panel>`}};k("arcgis-utility-network-trace-inputs",_);return _},"core/Collection","core/reactiveUtils","intl","layers/GraphicsLayer","networks/support/UNTraceConfiguration","rest/networks/support/TraceLocation","views/interactive/snapping/FeatureSnappingLayerSource","widgets/Sketch/SketchViewModel",a,c)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as u}from"./JP24H6WY.js";import"./Z7J6NDSB.js";import"./VWED2WAO.js";import"./QUZTFUWM.js";import"./RZ6SODVT.js";import{O as h,U as g,a as m,b as a,p as n,s as p}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([v,{substitute:b}])=>{var $=m`:host{padding:0 var(--calcite-spacing-sm) var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}calcite-list{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);overflow:hidden}calcite-list-item[selected] [slot=content-bottom]{display:block}.warning{color:var(--calcite-color-status-danger)}.terminals{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md);display:flex;flex-direction:column}.filter-barrier{display:flex;justify-content:space-between;align-items:center;width:100%}`,d=class extends h{constructor(){super(...arguments),this._messages=u({blocking:!0}),this.traceLocations=new v,this.traceLocationType="starting-point"}static{this.properties={traceLocations:0,traceLocationType:1,view:0}}static{this.styles=$}loaded(){this.traceLocations.length||n("warn",this,p("traceLocations"))}_handleTraceLocationItemRemoved(e){let{traceLocations:i,view:t}=this;e.spatialProperties.flagGraphic&&t&&t.graphics.remove(e.spatialProperties.flagGraphic),i?.remove(e)}_renderTerminal(e,i){let{flagProperties:t}=e,{selectedTerminals:r}=t,{name:s,id:c}=i,o=r?.has(c)??!1;return a`<calcite-label layout=inline><calcite-checkbox .value=${c} .checked=${o} @calciteCheckboxChange=${l=>{l.target.checked?r?.add(c):r?.delete(c),this.requestUpdate()}}></calcite-checkbox>${s}</calcite-label>`}_renderTerminalError(){return a`<calcite-notice kind=danger open scale=s width=auto><div slot=message>${this._messages.errors.noTerminalSelected}</div></calcite-notice>`}_renderFilterBarrier(e){let{traceLocation:i}=e;return a`<calcite-label layout=inline><div class="filter-barrier">${this._messages.labels.filterBarrier}<calcite-switch .checked=${i.isFilterBarrier} @calciteSwitchChange=${t=>{i.isFilterBarrier=t.target.checked}}></calcite-switch></div></calcite-label>`}_renderContents(e){let{flagProperties:i}=e,{terminalConfiguration:t,selectedTerminals:r}=i,s=e.traceLocation.type==="barrier",c=t&&t.terminals.length>0&&r?.size===0;return a`<calcite-action .icon=${i.expanded?"chevron-up":"chevron-down"} slot=actions-end scale=s text @click=${()=>{i.expanded=!i.expanded,this.requestUpdate()}}></calcite-action>${c&&a`<calcite-icon class="warning" icon=exclamation-mark-triangle scale=s slot=content-start></calcite-icon>`||""}${i.expanded&&a`<div class="terminals" slot=content-bottom>${s&&this._renderFilterBarrier(e)||""}${t&&this._renderTerminals(e)||""}${c&&this._renderTerminalError()||""}</div>`||""}`}_renderTerminals(e){let{flagProperties:i}=e,{terminalConfiguration:t}=i;if(!t)return n("warn",this,"One or more locations are missing the required flag property `terminalConfiguration`."),[];let r=t.terminals;return r.length?r.length===1?[]:r.map(s=>this._renderTerminal(e,s)):(n("warn",this,"`terminalConfiguration.terminals` is required but either missing or empty.`"),[])}_renderListItem(e){let{flagProperties:i}=e,{terminalConfiguration:t,expanded:r,title:s}=i,c=t&&t.id!==0,o=e.traceLocation.type==="barrier",l=c||o,f=t?.name??void 0;return a`<calcite-list-item .label=${s} .description=${f} .value=${s} .expanded=${r}>${l?this._renderContents(e):a`<div slot=content-bottom></div>`}<calcite-action icon=x slot=actions-end scale=s text @click=${()=>this._handleTraceLocationItemRemoved(e)}></calcite-action></calcite-list-item>`}render(){let e=this.traceLocations.map(t=>this._renderListItem(t)).toArray();if(!e.length)return null;let i=b(this._messages.labels.list,{traceLocationType:this.traceLocationType});return a`<div><calcite-list interaction-mode=static selection-mode=none .label=${i}>${e}</calcite-list></div>`}};g("arcgis-utility-network-trace-location-list",d);return d},"core/Collection","intl")
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as m}from"./JP24H6WY.js";import"./Z7J6NDSB.js";import"./VWED2WAO.js";import"./QUZTFUWM.js";import"./RZ6SODVT.js";import{O as d,U as u,a as c,b as s,p as a,r as n}from"./CDSRIIHC.js";import"./H6RQVSYM.js";var g=c`.subnetwork-details{border-radius:var(--calcite-border-radius);border:solid 1px var(--calcite-color-border-3)}.key-value-pair{padding:var(--calcite-spacing-sm)}.key-value-pair__key{font-size:var(--calcite-font-size--2);color:var(--calcite-color-text-3)}.key-value-pair__value{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1)}`,l=class extends d{constructor(){super(...arguments),this._messages=m({blocking:!0})}static{this.properties={namedTraceConfig:0}}static{this.styles=g}loaded(){this.namedTraceConfig||a("warn",this,n("namedTraceConfig"))}render(){let{_messages:e,namedTraceConfig:r}=this;if(!r?.traceConfiguration)return a("error",this,n("namedTraceConfig.traceConfiguration")),null;let{domainNetworkName:i,tierName:t,targetTierName:o}=r.traceConfiguration;return!i&&!t&&!o?(a("warn",this,"`namedTraceConfig.traceConfiguration` has no `domainNetworkName`, `tierName`, or `targetTierName`."),null):s`<div class="subnetwork-details">${i?this._renderKeyValuePair(e.headings.domainNetwork,i):null}${t?this._renderKeyValuePair(e.headings.tier,t):null}${o?this._renderKeyValuePair(e.headings.targetTier,o):null}</div>`}_renderKeyValuePair(e,r){return s`<div class="key-value-pair"><div class="key-value-pair__key">${e}</div><div class="key-value-pair__value">${r}</div></div>`}};u("arcgis-utility-network-subnetwork-info",l);export{l as ArcgisUtilityNetworkSubnetworkInfo};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as g}from"./O5T75PGZ.js";import j from"./P6CDJ2IV.js";import"./VJVKFKSG.js";import i from"./SYRZLONH.js";import{a as b}from"./JP24H6WY.js";import f from"./V6VLUKHQ.js";import e from"./7MO7E734.js";import"./Z7J6NDSB.js";import"./VWED2WAO.js";import c from"./3MWUCGFA.js";import"./QUZTFUWM.js";import"./RZ6SODVT.js";import{N as h,O as m,U as _,a as d,b as a,p,x as n}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([w,,{when:T},R,,,,v,{a:y}])=>{var $=d`:host{--arcgis-internal-color-black-30: color-mix(in srgb, #000000 30.2%, transparent);--arcgis-internal-box-shadow: var(--calcite-spacing-none) var(--calcite-spacing-px) var(--calcite-spacing-base) var(--arcgis-internal-color-black-30);--arcgis-internal-top-max-width: calc(min(100cqw, 100vw) - var(--calcite-spacing-xxxl));--arcgis-internal-panel-width: 300px;--arcgis-internal-panel-height: 100%;--arcgis-internal-panel-height-sm: 240px;--arcgis-internal-panel-height-md: 420px;--arcgis-internal-panel-height-lg: 540px;--arcgis-internal-panel-height-xl: 680px;--arcgis-internal-panel-gap: var(--calcite-spacing-lg);--arcgis-internal-panel-actions-gap: var(--calcite-spacing-sm);--arcgis-internal-basemap-gallery-width-lg: 450px;--arcgis-internal-collapse-icon-flip: scaleX(1);--arcgis-internal-row-direction: row;--arcgis-internal-legend-width: 300px;--arcgis-internal-layout-overlay-space-top: var(--arcgis-layout-overlay-space-top, 0px);--arcgis-internal-layout-overlay-space-bottom: var(--arcgis-layout-overlay-space-bottom, 0px);--arcgis-internal-layout-overlay-space-left: var(--arcgis-layout-overlay-space-left, 0px);--arcgis-internal-layout-overlay-space-right: var(--arcgis-layout-overlay-space-right, 0px);--arcgis-internal-view-color-focus: var(--arcgis-view-color-focus, var(--calcite-color-brand));--arcgis-internal-attribution-space-bottom: var(--arcgis-internal-layout-overlay-space-bottom);--arcgis-internal-attribution-space-left: var(--arcgis-internal-layout-overlay-space-left);--arcgis-internal-attribution-space-right: var(--arcgis-internal-layout-overlay-space-right);--arcgis-internal-attribution-font-size: var(--calcite-font-size-sm);--arcgis-internal-attribution-font-size-sm: var(--calcite-font-size-xs);--arcgis-internal-sketch-justify-content: flex-start}:host{display:flex;flex-direction:column;height:var(--arcgis-internal-panel-height, 100%)}arcgis-utility-network-trace-inputs[mode=default]{height:auto}calcite-tabs{display:flex;flex-direction:column;height:100%}calcite-tab{--calcite-tab-content-space-y: 0;min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-tab:not([selected]){flex:0}calcite-panel{--calcite-panel-background-color: var(--calcite-color-foreground-1)}calcite-notice{margin:var(--calcite-spacing-md)}.inputs-tab-container{display:flex;flex-direction:column;height:100%}.trace-inputs-warning{flex:none;height:fit-content;calcite-notice{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0}}`,C=v(R),u=class extends m{constructor(){super(...arguments),this._messages=b({blocking:!0}),this._viewModel=C(this),this._highlightHandles=[],this._handleRunTraceButtonClick=()=>{this._setTraceWarnings(),!(this._showNoStartingPointsWarning||this._showMissingTerminalWarning)&&(this._showNoStartingPointsWarning=!1,this._showMissingTerminalWarning=!1,this._clearTraceResult(),this._switchTab("results"),this._runTrace())},this._handleTraceInputsRefChange=e=>{e&&(this._traceInputsElement=e)},this._handleTraceResultsRefChange=e=>{e&&(this._traceResultsElement=e)},this._activeTab="input",this._showMissingTerminalWarning=!1,this._showNoStartingPointsWarning=!1,this._mode="default",this.autoDestroyDisabled=!1,this.aggregatedGeometryGraphicsColor=new w([255,255,0,.6]),this.disableHighlightFeatureResults=!1,this.hideActionBar=!1,this.hideFeatureResults=!1,this.state=this._viewModel.state,this.view=this._viewModel.view,this.arcgisHideGraphicsChange=n(),this.arcgisReady=n(),this.arcgisTraceLocationSelectEnd=n(),this.arcgisTraceLocationSelectStart=n(),this.arcgisTraceResultClear=n(),this.arcgisTraceResultFeaturesReady=n()}static{this.properties={_activeTab:16,_traceError:16,_traceResult:16,_showMissingTerminalWarning:16,_showNoStartingPointsWarning:16,_mode:16,autoDestroyDisabled:5,beforeTraceLocationSelectStart:0,aggregatedGeometryGraphicsColor:0,disableHighlightFeatureResults:5,hideActionBar:5,hideFeatureResults:5,label:3,messageOverrides:0,traceResultFeatures:32,referenceElement:1,state:32,view:0}}static{this.styles=$}get _allLayersAndTables(){let{view:e}=this;return e?.map?e.map.allLayers.toArray().concat(e.map.allTables.toArray()):[]}get traceResultFeatures(){return this._traceResultsElement?.traceResultFeatures??[]}async destroy(){this._clearHighlights(),this._traceResultsElement?.destroy(),this._traceInputsElement?.destroy(),await this.manager.destroy()}load(){this.manager.onLifecycle(()=>[T(()=>!this._viewModel.utilityNetwork,()=>this._switchTab("input"))])}_clearTraceResult(){this._traceResult=void 0,this._clearHighlights(),this._clearAggregatedGeometryGraphics()}_setTraceWarnings(){if(!this._traceInputsElement)return;let{traceLocations:e,traceLocationFlagInfos:t,traceConfiguration:i,isSubnetworkNameTraceSelected:s}=this._traceInputsElement,l=!!i?.subnetworkName,c=e?.some(r=>r.type==="starting-point"),o=t?.some(r=>!!r.flagProperties.terminalConfiguration&&!r.flagProperties.selectedTerminals?.size)??!1;this._traceError=void 0,this._showNoStartingPointsWarning=!s&&!c||s&&!l,this._showMissingTerminalWarning=o}_switchTab(e){this._activeTab=e}_getLoadError(e){switch(e){case"no-user-type-extension":return this._messages.errors.loadErrors.noUserTypeExtension;case"no-utility-network":return this._messages.errors.loadErrors.noUtilityNetwork;case"no-view":return this._messages.errors.loadErrors.noView;case"sceneView-not-supported":return this._messages.errors.loadErrors.sceneViewNotSupported;default:return e}}_clearHighlights(){this._highlightHandles.forEach(e=>e.remove()),this._highlightHandles=[]}_clearAggregatedGeometryGraphics(){this._traceResultsElement?.clearAggregatedGeometryGraphics()}_highlightResults(){let{_traceResult:e,view:t}=this,i=this._viewModel.utilityNetwork;!i||!e?.elements||!t||i.getObjectIdsFromElements(e.elements).forEach(s=>{let l=t.allLayerViews.find(o=>{let r=o.layer;if(i.isUtilityLayer(r)){let f=Number(s.layerUrl.split("/").pop());return r.layerId===f}return!1});if(!l)return;let c=l.highlight(s.objectIds);this._highlightHandles.push(c)})}async _runTrace(){let e=this._traceInputsElement?.selectedNamedTraceConfiguration,t=this._traceInputsElement?.traceConfiguration;if(!(e?.traceType&&t)){p("error",this,"Trace configuration not found");return}let i=this._traceInputsElement?.traceLocations;try{this._traceResult=await this._viewModel.executeTraceConfiguration({traceType:e.traceType,traceConfiguration:t,traceLocations:i??[],resultTypes:e.resultTypes,outSpatialReference:this.view?.spatialReference}),this.disableHighlightFeatureResults||this._highlightResults()}catch(s){y(s,this,"Error while running trace"),this._traceError=s,this._traceResult=void 0}}_handleHideGraphicsChange(e){e.stopPropagation(),this.arcgisHideGraphicsChange.emit(e.detail)}_handleTraceLocationSelectStart(e){e.stopPropagation(),this.arcgisTraceLocationSelectStart.emit(e.detail).defaultPrevented&&e.preventDefault()}_handleTraceLocationSelectEnd(e){e.stopPropagation(),this.arcgisTraceLocationSelectEnd.emit()}_handleTraceResultFeaturesReady(e){e.stopPropagation(),this.arcgisTraceResultFeaturesReady.emit()}_handleAggregatedGeometryGraphicsColorChange(e){let t=e.detail;this.aggregatedGeometryGraphicsColor=new w(t)}_handleSelectedNamedTraceConfigurationChange(){this._showNoStartingPointsWarning=!1,this._showMissingTerminalWarning=!1}_handleUtilityNetworkChange(){this._viewModel.utilityNetwork=this._traceInputsElement?.selectedUtilityNetwork}_renderMissingTerminalWarning(){return a`<calcite-panel class="trace-inputs-warning"><calcite-notice open icon=exclamation-mark-triangle closable kind=danger scale=s @calciteNoticeClose=${()=>this._showMissingTerminalWarning=!1}><div slot=title>${this._messages.errors.missingTerminalTitle}</div><div slot=message>${this._messages.errors.missingTerminalBody}</div></calcite-notice></calcite-panel>`}_renderNoStartingPointsWarning(){return a`<calcite-panel class="trace-inputs-warning"><calcite-notice open icon=exclamation-mark-triangle closable kind=danger scale=s @calciteNoticeClose=${()=>this._showNoStartingPointsWarning=!1}><div slot=title>${this._messages.errors.noStartingPointsTitle}</div><div slot=message>${this._messages.errors.noStartingPointsBody}</div></calcite-notice></calcite-panel>`}_renderResultsTab(){return g(`${this.el.id}__results-tab-item`,a`<calcite-tab .selected=${this._activeTab==="results"}>${this.state==="executing"?a`<calcite-panel><calcite-loader .label=${this._messages.runningTrace} .text=${this._messages.runningTrace}></calcite-loader></calcite-panel>`:a`<arcgis-utility-network-trace-results .autoDestroyDisabled=${this.autoDestroyDisabled} .aggregatedGeometryGraphicsColor=${this.aggregatedGeometryGraphicsColor} .hideActionBar=${this.hideActionBar} .hideFeatureResults=${this.hideFeatureResults} .layers=${this._allLayersAndTables} .messageOverrides=${this.messageOverrides} .referenceElement=${this.referenceElement} .traceConfigTitle=${this._selectedNamedTraceConfiguration?.title} .traceError=${this._traceError} .traceResult=${this._traceResult} .utilityNetwork=${this._viewModel.utilityNetwork??void 0} .view=${this.view??void 0} @arcgisAggregatedGeometryGraphicsColorChange=${this._handleAggregatedGeometryGraphicsColorChange} @arcgisHideGraphicsChange=${this._handleHideGraphicsChange} @arcgisTraceResultFeaturesReady=${this._handleTraceResultFeaturesReady} ${h(this._handleTraceResultsRefChange)}></arcgis-utility-network-trace-results>`}</calcite-tab>`)}_renderResultsFooter(){let{_traceResult:e}=this,t=!!(e?.elements.length||e?.globalFunctionResults.length||e?.aggregatedGeometry)&&this._traceResultsElement?.state==="ready",i=this._traceResultsElement?.numResults??0;return a`<calcite-button appearance=outline width=full @click=${()=>{this._switchTab("input"),this._clearTraceResult(),this.arcgisTraceResultClear.emit()}} .disabled=${!t} slot=footer>${i>0&&!this.hideFeatureResults&&this.state!=="executing"?this._messages.buttons.clearResultsCustom.replace("{number}",i.toString()):this._messages.buttons.clearResultsGeneric}</calcite-button>`}_renderInputTab(){let{loadError:e}=this._viewModel,t=(e==="no-user-type-extension"||e==="sceneView-not-supported"?a`<calcite-notice kind=danger open scale=s slot=content-top width=auto><div slot=message>${this._getLoadError(e)}</div></calcite-notice>`:void 0)??a`${this._showNoStartingPointsWarning&&this._mode==="default"&&this._renderNoStartingPointsWarning()||""}${this._showMissingTerminalWarning&&this._mode==="default"&&this._renderMissingTerminalWarning()||""}<arcgis-utility-network-trace-inputs .autoDestroyDisabled=${this.autoDestroyDisabled} .hideActionBar=${this.hideActionBar} .referenceElement=${this.referenceElement} .view=${this.view??void 0} .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisPropertyChange=${i=>{i.stopPropagation(),i.detail.name==="mode"&&(this._mode=i.target.mode)}} @arcgisSelectedNamedTraceConfigurationChange=${this._handleSelectedNamedTraceConfigurationChange} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisUtilityNetworkChange=${this._handleUtilityNetworkChange} ${h(this._handleTraceInputsRefChange)}></arcgis-utility-network-trace-inputs>`;return g(`${this.el.id}__inputs-tab-item`,a`<calcite-tab .selected=${this._activeTab==="input"}><div class="inputs-tab-container">${t}</div></calcite-tab>`)}_renderInputFooter(){let{state:e}=this;if(this._mode!=="default")return null;let t=e==="disabled"||e==="loading"||!this._traceInputsElement?.traceConfiguration;return a`<calcite-button appearance=solid width=full @click=${this._handleRunTraceButtonClick} slot=footer .disabled=${t}>${this._messages.buttons.getResults}</calcite-button>`}render(){let{_activeTab:e,state:t}=this;return a`<calcite-panel><calcite-tabs layout=center position=top><calcite-tab-nav slot=title-group><calcite-tab-title @click=${()=>this._switchTab("input")} .selected=${e==="input"}>${this._messages.tabs.inputTab}</calcite-tab-title><calcite-tab-title @click=${()=>this._switchTab("results")} .selected=${e==="results"} .disabled=${t==="disabled"||t==="loading"}>${this._messages.tabs.resultsTab}</calcite-tab-title></calcite-tab-nav>${this._renderInputTab()}${this._renderResultsTab()}</calcite-tabs>${e==="input"?this._renderInputFooter():null}${e==="results"?this._renderResultsFooter():null}</calcite-panel>`}};_("arcgis-utility-network-trace-analysis",u);return u},"Color","core/Error","core/reactiveUtils","networks/UtilityNetworkTraceAnalysis",c,e,f,i,j)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./MZWO5JYA.js";import{a as d}from"./JP24H6WY.js";import"./Z7J6NDSB.js";import"./VWED2WAO.js";import"./QUZTFUWM.js";import"./RZ6SODVT.js";import{O as g,R as l,U as y,b as p,p as t,r as s,x as m}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([_,G,u,L,v,f,{a:h,d:n}])=>{var o=12,c=class extends g{constructor(){super(...arguments),this._graphicsLayerName="arcgis-utility-network-aggregated-geometry-graphics",this._messages=d({blocking:!0}),this._graphics=[],this._addAggregatedGeometryToView=()=>{let e=this.geometry,{line:i,multipoint:r,polygon:w}=e;this._graphics=[i,r,w].filter(a=>a!=null).map(a=>this._makeGraphicFromGeometry(a)),this._graphicsLayer.addMany(this._graphics)},this._createGraphicsLayer=()=>{let e=this.view.map,i=this._graphicsLayerName,r=e.findLayerById(i);if(r&&n(r)){this._graphicsLayer=r;return}this._graphicsLayer=new u({id:i,listMode:"hide",title:i}),h(this.view,this._graphicsLayer)},this.hideGraphics=!1,this.graphicsColor=new _([255,255,0,.6]),this.autoDestroyDisabled=!1,this.arcgisHideGraphicsChange=m()}static{this.properties={geometry:0,hideGraphics:5,graphicsColor:0,view:0,autoDestroyDisabled:5}}async destroy(){this.view?.map&&this._graphicsLayer&&this.view.map.remove(this._graphicsLayer),await this.manager.destroy()}connectedCallback(){super.connectedCallback(),this.view&&this._graphicsLayer&&h(this.view,this._graphicsLayer)}load(){!this.geometry||!this.view?.map||this._createGraphicsLayer()}willUpdate(e){if(e.has("graphicsColor")&&this._updateGraphicSymbols(),e.has("geometry")&&(this._graphicsLayer?.removeAll(),this._addAggregatedGeometryToView()),e.has("view")){let i=e.get("view");i?.map&&this._graphicsLayer&&(i.map.remove(this._graphicsLayer),this._createGraphicsLayer(),this._addAggregatedGeometryToView())}}loaded(){this.geometry||t("error",this,s("geometry")),this.view?this.view.map||t("error",this,s("The property `view` was provided, but `view.map` is null. Cannot draw aggregated geometry.")):t("error",this,s("view"))}_handleShowGraphicsChange(){this.hideGraphics=!this.hideGraphics,this.hideGraphics?this._graphicsLayer?.removeAll():this._graphicsLayer?.addMany(this._graphics),this.arcgisHideGraphicsChange.emit(this.hideGraphics)}_makeGraphicFromGeometry(e){return new G({geometry:e,symbol:this._makeSymbolForGeometry(e)})}_makeSymbolForGeometry(e){let i=this.graphicsColor;switch(e.type){case"multipoint":return new f({color:i,size:o,outline:{color:i,width:0}});case"polygon":return new L({color:i,outline:{color:i,width:o}});case"polyline":return new v({color:i,width:o})}}_updateGraphicSymbols(){this._graphicsLayer?.graphics.forEach(e=>{let i=e.geometry;e.symbol=this._makeSymbolForGeometry(i)})}render(){return p`<calcite-switch .checked=${!this.hideGraphics} .label=${this._messages.labels.showGraphicsToggle} label-text-end=${this._messages.showGraphics??l} @calciteSwitchChange=${this._handleShowGraphicsChange}></calcite-switch>`}};y("arcgis-utility-network-aggregated-geometry",c);return c},"Color","Graphic","layers/GraphicsLayer","symbols/SimpleFillSymbol","symbols/SimpleLineSymbol","symbols/SimpleMarkerSymbol",a)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./MZWO5JYA.js";import a from"./P6CDJ2IV.js";import"./VJVKFKSG.js";import{a as R}from"./JP24H6WY.js";import"./Z7J6NDSB.js";import"./VWED2WAO.js";import"./QUZTFUWM.js";import"./RZ6SODVT.js";import{M as _,N as g,O as f,U as v,a as p,b as r,p as o,r as h,s as y,x as d}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([E,,,{a:$},{b:b,e:w}])=>{var T=p`:host{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}arcgis-features-next{height:100%}calcite-table{--calcite-table-border-color: none}calcite-table-row{--calcite-table-row-border-color: var(--calcite-color-border-3)}.white-panel-background{--calcite-panel-background-color: var(--calcite-color-foreground-1)}.aggregated-geometry-container{display:flex;justify-content:space-between;margin:0 var(--calcite-spacing-md) var(--calcite-spacing-md)}#elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);margin:0 var(--calcite-spacing-sm)}.no-selectable-results{margin:0 var(--calcite-spacing-md);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size)}.results-heading{display:flex;flex-direction:column;margin:var(--calcite-spacing-md);gap:var(--calcite-spacing-xs)}.results-heading-title{font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.results-heading-subtitle{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3)}.functions-heading{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-xxs);font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.no-results-landing{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;margin:var(--calcite-spacing-sm) var(--calcite-spacing-xl) var(--calcite-spacing-xl);gap:var(--calcite-spacing-md)}.no-results-landing calcite-icon{margin-bottom:var(--calcite-spacing-sm);--calcite-icon-color: var(--calcite-color-text-3)}.no-results-landing .no-results-heading{font-size:var(--calcite-font-size-2)}.no-results-landing .no-results-description{color:var(--calcite-color-text-3)}`,u={dirtyAreasDiscovered:-2147208511,noValidControllers:-2147208935,pathNotFound:-2147208444},m=class extends f{constructor(){super(...arguments),this._defaultPopupTemplateEnabled=!0,this._messages=R({blocking:!0}),this._elementsWithoutLayer=[],this._popoverElement=_(),this._layerIdToFeatures=new Map,this._layerIdToLayer=new Map,this._subtypeCodeToFeatures=new Map,this._sourceIdToElements=new Map,this._utilityNetworkLayers=[],this._queryFeaturesOnLayer=async([e,t])=>{let a=this.utilityNetwork?.getLayerIdBySourceId(e),s=this._getLayerByLayerId(a),i=this._getElementsUniqueByGlobalId(t);if(a==null||!s){this._elementsWithoutLayer.push(...i);return}let n=s.createQuery();n.gdbVersion=this.utilityNetwork?.gdbVersion,n.objectIds=i.map(c=>c.objectId),n.outFields=["*"];let{features:l}=await b(s,n);l.forEach(c=>{let C=c.layer;c.getEffectivePopupTemplate(this._defaultPopupTemplateEnabled)||(c.popupTemplate=C.createPopupTemplate())}),w(s)?l.forEach(c=>this._addOrCreateMapValue(this._subtypeCodeToFeatures,c.layer.subtypeCode,c)):this._layerIdToFeatures.set(a,l)},this._aggregateGeometryRefChange=e=>{e&&(this._aggregatedGeometryComponentElement=e)},this._featuresRefChange=e=>{e&&(this._featuresComponentElement=e)},this._aggregatedGeometryDisabled=!1,this.aggregatedGeometryGraphicsColor=new E([255,255,0,.6]),this.hideActionBar=!1,this.hideFeatureResults=!1,this.isElementsSelected=!1,this.layers=[],this.state="ready",this.traceResultFeatures=[],this.autoDestroyDisabled=!1,this.arcgisAggregatedGeometryGraphicsColorChange=d(),this.arcgisHideGraphicsChange=d(),this.arcgisSelectedResultTypeChange=d(),this.arcgisTraceResultFeaturesReady=d()}static{this.properties={_aggregatedGeometryDisabled:16,_featuresComponentElement:16,aggregatedGeometryGraphicsColor:0,hideActionBar:5,hideFeatureResults:5,isElementsSelected:5,layers:0,messageOverrides:0,numResults:32,referenceElement:1,state:1,traceConfigTitle:1,traceError:0,traceResult:0,traceResultFeatures:0,utilityNetwork:0,view:0,autoDestroyDisabled:5}}static{this.styles=T}get numResults(){return this.traceResultFeatures.length+this._elementsWithoutLayer.length}clearAggregatedGeometryGraphics(){this._aggregatedGeometryComponentElement?.destroy()}async destroy(){this._layerIdToFeatures.clear(),this._subtypeCodeToFeatures.clear(),this._sourceIdToElements.clear(),this._aggregatedGeometryComponentElement?.destroy(),this._featuresComponentElement?.destroy(),await this.manager.destroy()}load(){this.traceResult&&(this._setSourceIdToElements(),this._loadDependencies().then(()=>this._queryTraceResultsFeatures()).finally(()=>{this.arcgisTraceResultFeaturesReady.emit(),this.state="ready"}))}willUpdate(e){e.has("isElementsSelected")&&this.arcgisSelectedResultTypeChange.emit(),e.has("traceResult")&&(this.isElementsSelected=!1,this.traceResult||(this.traceResultFeatures=[],this._elementsWithoutLayer=[]))}loaded(){this.traceResult&&(this.utilityNetwork||o("warn",this,h("utilityNetwork")),this.layers.length||o("warn",this,y("layers")),this.view||o("warn",this,h("view")))}disconnectedCallback(){super.disconnectedCallback(),this._layerIdToLayer.clear()}_addOrCreateMapValue(e,t,a){let s=e.get(t);s==null?e.set(t,[a]):s.push(a)}_getLayerByLayerId(e){if(e==null)return;let{_layerIdToLayer:t,_utilityNetworkLayers:a}=this;if(t.get(e))return t.get(e);let s=a.find(i=>"layerId"in i&&i.layerId===e);return s&&t.set(e,s),s}_getElementsUniqueByGlobalId(e){return Array.from(new Map(e.map(t=>[t.globalId,t])).values())}_handleHideGraphicsChange(e){e.stopPropagation();let t=e.detail;this.arcgisHideGraphicsChange.emit(t),this._aggregatedGeometryDisabled=t,t&&this._popoverElement.value?.open&&(this._popoverElement.value.open=!1)}async _loadDependencies(){let{layers:e,utilityNetwork:t}=this;if(!t)return;try{t.loaded||(this.state="loading",await t.load())}catch(s){$(s,this,"Error while loading the selected utility network")}this._utilityNetworkLayers=e.filter(s=>t.isUtilityLayer(s));let a=this._utilityNetworkLayers.filter(s=>!s.loaded).map(s=>s.load());a.length>0&&(this.state="loading",(await Promise.allSettled(a)).forEach(s=>{s.status==="rejected"&&o("error",this,`Failed to load layer. Reason: ${s.reason}`)}))}async _queryTraceResultsFeatures(){let e=Array.from(this._sourceIdToElements.entries());if(!e.length)return;this.state="loading";let t=e.map(this._queryFeaturesOnLayer);(await Promise.allSettled(t)).forEach((i,n)=>{if(i.status==="rejected"){let[l]=e[n];o("error",this,`Failed to query features for source ${l}. Reason: ${i.reason}`)}});let a=Array.from(this._layerIdToFeatures.values()),s=Array.from(this._subtypeCodeToFeatures.values());this.traceResultFeatures=a.concat(s).flat()}_setSourceIdToElements(){this.traceResult.elements?.forEach(e=>this._addOrCreateMapValue(this._sourceIdToElements,e.networkSourceId,e))}render(){let{traceError:e,traceResult:t}=this;if(e)return this._renderErrorLanding(e);if(!t)return this._renderNoTraceLanding();let{elements:a,globalFunctionResults:s,aggregatedGeometry:i}=t,n=!a.length&&!s.length&&!i,l=a.length>0&&!s.length&&!i;return n?this._renderNoResultsLanding():this.state==="loading"?this._renderGettingResults():this.hideFeatureResults&&l?this._renderFeaturesAreHiddenLanding():this.isElementsSelected||l?r`<arcgis-features-next .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this._defaultPopupTemplateEnabled} .features=${this.traceResultFeatures} .hideActionBar=${this.hideActionBar} .hideCloseButton=${l} hide-select-feature initial-display-mode=list .messageOverrides=${this.messageOverrides} @arcgisClose=${()=>this.isElementsSelected=!1} open .referenceElement=${this.referenceElement} .view=${this.view} ${g(this._featuresRefChange)}></arcgis-features-next>`:this._renderLanding(t)}_renderGettingResults(){return r`<calcite-panel class="white-panel-background"><calcite-loader .label=${this._messages.gettingResults} .text=${this._messages.gettingResults}></calcite-loader></calcite-panel>`}_renderLanding(e){let{elements:t,globalFunctionResults:a,aggregatedGeometry:s}=e;return r`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}${s!=null?this._renderAggregatedGeometry(s):null}${s!=null&&!t.length?this._renderNoSelectableResults():null}${t.length>0?this.hideFeatureResults?this._renderFeaturesAreHidden():this._renderElementsResults():null}${a.length>0?this._renderFunctionsResults(a):null}</calcite-panel>`}_renderAggregatedGeometry(e){return r`<div class="aggregated-geometry-container"><arcgis-utility-network-aggregated-geometry .graphicsColor=${this.aggregatedGeometryGraphicsColor} .geometry=${e} .view=${this.view} @arcgisHideGraphicsChange=${this._handleHideGraphicsChange} auto-destroy-disabled ${g(this._aggregateGeometryRefChange)}></arcgis-utility-network-aggregated-geometry><calcite-swatch id=geometry-color-swatch .label=${this._messages.labels.aggregatedGeometryGraphicsColor} .color=${this.aggregatedGeometryGraphicsColor.toCss()} .disabled=${this._aggregatedGeometryDisabled}></calcite-swatch><calcite-popover .heading=${this._messages.headings.setColor} .label=${this._messages.headings.setColor} reference-element=geometry-color-swatch closable ${g(this._popoverElement)}><calcite-color-picker alpha-channel channels-disabled clearable hex-disabled saved-disabled .value=${this.aggregatedGeometryGraphicsColor} @calciteColorPickerChange=${t=>{let a=t.target.value;this.arcgisAggregatedGeometryGraphicsColorChange.emit(a)}} .disabled=${this._aggregatedGeometryDisabled}></calcite-color-picker></calcite-popover></div>`}_renderFeaturesAreHiddenLanding(){return r`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}${this._renderFeaturesAreHidden()}</calcite-panel>`}_renderFeaturesAreHidden(){return r`<div class="no-selectable-results">${this._messages.resultFeaturesAreHidden}</div>`}_renderNoSelectableResults(){return r`<div class="no-selectable-results">${this._messages.noSelectableFeatures}</div>`}_renderElementsResults(){return r`<calcite-list .label=${this._messages.headings.traceResultsGeneric}><calcite-list-item id=elements-list-item .label=${this._messages.headings.features} @calciteListItemSelect=${()=>this.isElementsSelected=!0}><calcite-chip .label=${this._messages.labels.numFeatures} scale=s slot=content-end>${this.numResults}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item></calcite-list>`}_renderFunctionsResults(e){return r`<div class="functions-heading">${this._messages.headings.functions}</div><calcite-table .caption=${this._messages.labels.functionResults}>${e.filter(t=>t.networkAttributeName!=null&&t.result!=null&&t.functionType!=null).map(t=>{let{functionName:a,networkAttributeName:s,functionType:i,result:n}=t,l=a||`${s} ${i}`;return r`<calcite-table-row><calcite-table-cell>${l}</calcite-table-cell><calcite-table-cell>${n}</calcite-table-cell></calcite-table-row>`})}</calcite-table>`}_renderTraceResultsHeading(){return r`<div class="results-heading"><div class="results-heading-title">${this._messages.headings.traceResultsGeneric}</div>${this.traceConfigTitle?r`<div class="results-heading-subtitle">${this.traceConfigTitle}</div>`:null}</div>`}_renderErrorLanding(e){let t=e.message;switch(e.details?.raw?.extendedCode){case u.dirtyAreasDiscovered:t=this._messages.traceErrors.dirtyAreasDiscovered;break;case u.noValidControllers:t=this._messages.traceErrors.noValidControllers;break;case u.pathNotFound:t=this._messages.traceErrors.pathNotFound;break}return r`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.traceFailedHeading}</div><div class="no-results-description">${this._messages.traceFailedDescription}</div><div class="no-results-description">${t}</div></div></calcite-panel>`}_renderNoResultsLanding(){return r`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.noResultsHeading}</div><div class="no-results-description">${this._messages.noResultsDescription}</div></div></calcite-panel>`}_renderNoTraceLanding(){return r`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=utility-network-trace scale=l></calcite-icon><div class="no-results-heading">${this._messages.noTraceConfigHeading}</div><div class="no-results-description">${this._messages.noTraceConfigDescription}</div></div></calcite-panel>`}};v("arcgis-utility-network-trace-results",m);return m},"Color","core/Error","Graphic",a,b)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./MZWO5JYA.js";import{a as A}from"./JP24H6WY.js";import"./Z7J6NDSB.js";import"./VWED2WAO.js";import"./QUZTFUWM.js";import"./RZ6SODVT.js";import{O as x,U as C,a as I,b as w,p as c,r as m,x as T}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([G,_,u,$,F,N,k,S,{c:L,f:P}])=>{var H=I`calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}.add-location-button{--calcite-button-border-color: var(--calcite-color-border-1);--calcite-button-icon-color: var(--calcite-color-text-1);--calcite-button-text-color: var(--calcite-color-text-1)}.button-container{display:flex;justify-content:center}`,v=class extends x{constructor(){super(...arguments),this._messages=A({blocking:!0}),this.isSelectWaiting=!1,this.traceLocationType="starting-point",this.spatialTolerance=.05,this.autoDestroyDisabled=!1,this.arcgisTraceLocationChange=T(),this.arcgisTraceLocationSelectEnd=T(),this.arcgisTraceLocationSelectStart=T()}static{this.properties={isSelectWaiting:16,beforeTraceLocationSelectStart:0,afterHitTest:0,view:0,traceLocationType:1,traceLocations:0,filterLayers:0,sketchViewModel:0,spatialTolerance:9,autoDestroyDisabled:5,utilityNetwork:0}}static{this.styles=H}async destroy(){this._resetCursor(),await this.manager.destroy()}async load(){u.isLoaded()||await u.load()}_calculatePercentAlong(e,t){let r=e.clone(),i=r.spatialReference,o=t.spatialReference;if(!i||!o)return c("warn",this,"Unable to calculate percent along because geometry is missing a spatial reference."),-1;let s=t;if(!i.equals(o)){let f=u.execute(t,i);if(!f)return c("warn",this,"Unable to project flag point to source geometry spatial reference."),-1;s=f}let l=$.getNearestCoordinate(r,s);if(l.isEmpty)return c("warn",this,"Unable to compute nearest coordinate for polyline flag."),-1;let a=l.coordinate,n=a.x-.5,h=a.y-.5,p=a.x+.5,g=a.y+.5,y=new F({hasZ:!1,hasM:!0,paths:[[[n,h],[p,g]]],spatialReference:r.spatialReference}),d=G.execute(r,y);if(d.length>0){let f=_.execute(r,{unit:"feet"}),b;return d[0].paths[0][0][0]===r.paths[0][0][0]?b=_.execute(d[0],{unit:"feet"}):d.length>1?b=_.execute(d[1],{unit:"feet"}):b=0,b/f}return c("warn",this,"Unable to cut the source geometry with the flag geometry."),-1}get _edgeSourceLayerIds(){let e=this.utilityNetwork?.dataElement?.domainNetworks;return e?e.flatMap(t=>t.edgeSources).map(t=>t.layerId).filter(Boolean):[]}async _handleAddButtonClick(){let{view:e,sketchViewModel:t}=this;if(!(e&&t)){c("error",this,"Cannot add trace location."),t||c("error",this,m("sketchViewModel")),e||c("error",this,m("view"));return}if(this.beforeTraceLocationSelectStart){this.isSelectWaiting=!0;try{await this.beforeTraceLocationSelectStart()}finally{this.isSelectWaiting=!1}}await this._startSketch(e,t)}async _startSketch(e,t){this.arcgisTraceLocationSelectStart.emit({cancelSelect:()=>t.cancel()}).defaultPrevented||(this._clickHandler?.remove(),this._clickHandler=t.on("create",r=>this._handleSketchComplete(r,e,t)),"acquireCursor"in e&&e.acquireCursor("crosshair"),t.snappingOptions.enabled=!0,t.create("point"))}_handleSketchComplete(e,t,r){if(e.state==="complete"&&e.graphic){r.layer.remove(e.graphic),this._performHitTest(e,t,r);return}e.state==="cancel"&&(this._resetCursor(),this.arcgisTraceLocationSelectEnd.emit())}async _performHitTest(e,t,r){let{utilityNetwork:i}=this,{graphic:o}=e;if(!i){c("error",this,m("utilityNetwork")),this._resetCursor(),this.arcgisTraceLocationSelectEnd.emit();return}if(o?.geometry?.type!=="point"){c("warn",this,"No screen point available for hit test."),this._startSketch(t,r);return}let s=o.geometry,l=t.toScreen(s);if(!l){c("warn",this,"No screen point available for hit test."),this._startSketch(t,r);return}let a=(await t.hitTest(l,{include:this.filterLayers})).results.filter(n=>n.type==="graphic"&&n?.layer&&n.graphic);if(!a.length){c("info",this,"No usable hit test results found."),this._startSketch(t,r);return}this._resetCursor(),await this._processHitTestResults(a,s,t)?this.arcgisTraceLocationSelectEnd.emit():this._startSketch(t,r)}_resetCursor(){let{view:e,sketchViewModel:t}=this;if(!e){c("error",this,m("view"));return}t&&(t.snappingOptions.enabled=!1),this._clickHandler?.remove(),this._clickHandler=void 0,"acquireCursor"in e&&e.acquireCursor("default")}async _processHitTestResults(e,t,r){if(!e.length)return c("error",this,"There are no hit test results to process."),!1;let i=e[0].graphic;if(this.afterHitTest){let s=e.map(l=>{let a=l,n=a.graphic;return n.origin=a.layer,n.sourceLayer=a.layer,n});try{i=await this.afterHitTest(s)}catch{i=null}}if(!i)return c("error",this,"No graphic available from hit test results."),this.arcgisTraceLocationSelectEnd.emit(),!0;let o=await this._getGraphicWithAttributes(i);return o?await this._addTraceLocation(o,t,r):(c("error",this,"Unable to ensure necessary attributes on the selected graphic."),this.arcgisTraceLocationSelectEnd.emit(),!0)}async _getGraphicWithAttributes(e){let t=(L(e.layer),e.layer),r=t.geometryType===null,i=t.fieldsIndex?.get("assetgroup")??!1,o=t.fieldsIndex?.get("assetgroup")?.name??"assetgroup",s=t.fieldsIndex?.get("assettype")??!1,l=t.fieldsIndex?.get("assettype")?.name??"assettype",a=e.getGlobalId(),n=e.getObjectId(),h=i?!!e.getAttribute(o):!0,p=s?!!e.getAttribute(l):!0,g=!!e.geometry;if(a&&n&&h&&p&&(g||r))return e;let y=t.createQuery();return y.objectIds=[n],(await t.queryFeatures(y)).features[0]||null}async _addTraceLocation(e,t,r){let{traceLocations:i}=this,o=e.getGlobalId()??"",s=e.geometry?.type,l=await this._generateFlagInfo(e,t);if(!l)return c("error",this,"Unable to generate flag info for trace location."),!1;let a=i?.filter(h=>h.spatialProperties.mapGraphic?.getGlobalId()===o)??[];if(a.length>0){if(s!=="polyline")return c("warn",this,"A flag with the same globalId already exists."),!1;if(a.some(h=>Math.abs(h.traceLocation.percentAlong-l.traceLocation.percentAlong)<=this.spatialTolerance))return c("warn",this,"A flag with the same globalId already exists within tolerance."),!1}let n=this._addFlagGraphicToMap(e,t,r);return n?(l.spatialProperties.flagGraphic=n,i?.add(l),!0):(c("warn",this,"Unable to add flag graphic."),!1)}async _generateFlagInfo(e,t){let{traceLocationType:r,utilityNetwork:i}=this,o=e.getGlobalId()??"",s=e.geometry?.type,l=await this._generateItemTitle(e);if(s==="point"||s==="polygon"){let a=i?.getTerminalConfiguration(e),n=a?a.terminals[0].id:1;return{traceLocation:new k({type:r,isFilterBarrier:!1,globalId:o,terminalId:n}),flagProperties:{title:l,expanded:!1,terminalConfiguration:a??void 0,selectedTerminals:a?new Set([n]):void 0},spatialProperties:{mapPoint:t,mapGraphic:e}}}else if(s==="polyline"){let a=this._calculatePercentAlong(e.geometry,t);return a<0?(c("warn",this,"Unable to calculate percent along for polyline flag."),null):{traceLocation:new k({type:r,isFilterBarrier:!1,globalId:o,percentAlong:a}),flagProperties:{title:l,expanded:!1,terminalConfiguration:void 0,selectedTerminals:void 0},spatialProperties:{mapPoint:t,mapGraphic:e}}}else if(!s){let a=P(e.layer)?e.layer.parent:e.layer,n=a&&this._edgeSourceLayerIds.includes(a.layerId),h=i?.getTerminalConfiguration(e),p=h?h.terminals[0].id:n?-1:1,g=n?.5:-1;return{traceLocation:new k({type:r,isFilterBarrier:!1,globalId:o,terminalId:p,percentAlong:g}),flagProperties:{title:l,expanded:!1,terminalConfiguration:h??void 0,selectedTerminals:h?new Set([p]):void 0},spatialProperties:{mapPoint:t,mapGraphic:e}}}return null}async _generateItemTitle(e){let t=(L(e.layer),e.layer);return("getFeatureTitle"in t?await t.getFeatureTitle(e):null)||e.getObjectId()?.toString()||this._messages.unknown}_addFlagGraphicToMap(e,t,r){let i=e.geometry?e.geometry.type==="point"?e.geometry:t:null,o=this._getFlagSymbol(),s=new N({geometry:i,symbol:o,attributes:e.attributes});return r.graphics.add(s),s}_getFlagSymbol(){let{traceLocationType:e}=this,t=[244,21,21,.6],r=[21,244,21,.6];return e==="stopping-point"?new S({color:t,style:"x",size:12,outline:{color:t,width:2}}):e==="barrier"?new S({color:t,style:"square",size:12,outline:{color:t,width:0}}):new S({color:r,style:"circle",size:12,outline:{color:r,width:0}})}_handleClearButtonClick(){let{view:e,traceLocations:t}=this;t?.forEach(r=>{r.spatialProperties.flagGraphic&&e&&e.graphics.remove(r.spatialProperties.flagGraphic)}),t?.removeAll()}renderAddLocationBlock(){let{traceLocationType:e,_messages:t,traceLocations:r,view:i}=this,o=e==="starting-point"?t.types.startingPoint:e==="barrier"?t.types.barrier:t.types.stoppingPoint,s=o.heading,l=o.description,a=o.buttonText;return w`<calcite-block .heading=${s} .label=${s} expanded .description=${l}>${r?.length?w`<calcite-button slot=actions-end appearance=transparent .label=${t.buttons.clear} @click=${()=>this._handleClearButtonClick()}>${t.buttons.clear}</calcite-button><arcgis-utility-network-trace-location-list .traceLocations=${r} .traceLocationType=${e} .view=${i}></arcgis-utility-network-trace-location-list>`:null}<div class="button-container"><calcite-button .loading=${this.isSelectWaiting} class="add-location-button" icon-start=select appearance=outline .label=${a} @click=${()=>this._handleAddButtonClick()}>${a}</calcite-button></div></calcite-block>`}render(){return w`<div class="root">${this.renderAddLocationBlock()}</div>`}};C("arcgis-utility-network-trace-location",v);return v},"geometry/operators/cutOperator","geometry/operators/lengthOperator","geometry/operators/projectOperator","geometry/operators/proximityOperator","geometry/Polyline","Graphic","rest/networks/support/TraceLocation","symbols/SimpleMarkerSymbol",a)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{b as c,c as d}from"./R2Z6LGSX.js";import{c as r,e as m}from"./Z7J6NDSB.js";import{b as h}from"./RZ6SODVT.js";import{M as u,b as a,x as s,z as l}from"./CDSRIIHC.js";export default $arcgis.t(([{when:E,watch:w}])=>{var b=class extends l{constructor(o){super(o),this.direction=m(),this.popupRef=u(),this.slotGroupRefs=c(),this.attributionHeight=0,this._uiContainer=null,this.component.listen("arcgisViewClick",t=>{let e=t.detail.native;t.detail.button!==0||e?.ctrlKey||e?.metaKey||this._handleOpenPopup(t.detail)}),this.component.listenOn(globalThis,"unhandledrejection",t=>{let e=t.reason;if(e?.name==="webgl:required"){let{name:p}=e;this.webGLError={name:p}}})}hostLifecycle(){return[E(()=>this.component.view.ready,()=>{this._assignDefaultPopup()}),E(()=>this.component.view.popup?.visible,()=>{this.popupElement?.open&&(this.popupElement.open=!1)})]}async openPopup(o){if(this._assignDefaultPopup(),this.closePopup(),this.popupElement){await this.popupElement.componentOnReady(),this.popupElement.open=!0;let{fetchFeatures:t,shouldFocus:e,title:p,...n}=o;delete o.fetchFeatures,Object.assign(this.popupElement,n),p!==void 0&&(this.popupElement.heading=p),e&&await this.popupElement.setFocus(),t&&this.popupElement.fetchFeatures()}else await this.component.view.openPopup(o)}closePopup(){this.popupElement&&(this.popupElement.open=!1),this.component.view.closePopup()}_assignDefaultPopup(){this.popupRef.value&&!this.popupElement&&(this.popupElement=this.popupRef.value,this.popupElement.referenceElement=this.component.el,this.popupElement.view=this.component.view)}handleAttributionHeightChange(o){if(!(this.attributionHeight===o||!this.component.el.shadowRoot)){if(this.attributionHeight=o,!this._uiContainer){let t=this.component.el.shadowRoot.querySelector(".arcgis-map-container-ui");this._uiContainer=t}this._uiContainer?.style.setProperty("--arcgis-internal-attribution-space-top",`${this.attributionHeight}px`)}}_maybeDisableViewPopup(){this.component.view&&(this.component.popupComponentEnabled||this.popupElement)&&(this.previousViewPopupEnabled=this.component.view.popupEnabled,this.component.view.popupEnabled=!1)}_maybeResetViewPopup(){this.component.view&&this.previousViewPopupEnabled!==void 0&&(this.component.view.popupEnabled=this.previousViewPopupEnabled,this.previousViewPopupEnabled=void 0)}async _handleOpenPopup(o){if(this._assignDefaultPopup(),!this.component.popupDisabled){if(this._maybeDisableViewPopup(),this.popupElement){let{location:t,promises:e}=await this.popupElement?.handleViewClick(o)??{};e?.length?this.openPopup({location:t,promises:e}):this.popupElement?.open&&this.closePopup()}this._maybeResetViewPopup()}}_handlePopupSlotChange(o){let t=h(o.target,"arcgis-popup");!this.popupElement&&t.length?this.popupElement=t[0]:t.length||(this.popupElement=void 0)}_webGLErrorAlert(){return this.webGLError?a`<arcgis-webgl-error .errorName=${this.webGLError.name}></arcgis-webgl-error>`:null}render(){return d({direction:this.direction,popupComponentEnabled:this.component.popupComponentEnabled,slotGroupRefs:this.slotGroupRefs,handlePopupSlotChange:o=>this._handlePopupSlotChange(o),webGLErrorElement:this._webGLErrorAlert(),popupElement:this.popupRef})}},R=r((i,o)=>{let t=s();return o.onLifecycle(()=>w(()=>{let{map:e}=i;if(!e||e.destroyed)return[];let p=[];return e.loadError&&p.push(e),e.basemap?.loadError&&p.push(e.basemap),e.ground.loadError&&p.push(e.ground),[...e.allLayers,...e.allTables].forEach(n=>{n.loadError&&p.push(n)}),p},e=>{e.length&&(i.loadErrorSources=e,t.emit())})),t}),G=r((i,o)=>{let t=s();return o.onLifecycle(()=>w(()=>i.view?.readyState,e=>{(e==="map-content-error"||e==="rendering-error")&&t.emit()})),t});return{a:b,b:R,c:G}},"core/reactiveUtils")