@esri/solutions-components 5.0.0 → 5.0.1
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.
- package/dist/cdn/{J6Z7OGPT.js → 224I72SO.js} +1 -1
- package/dist/cdn/{JV3YKSCY.js → 2333JKXT.js} +1 -1
- package/dist/cdn/{3QLYSIKK.js → 243LX5NA.js} +1 -1
- package/dist/cdn/{G3RPEESM.js → 2SD4IYX3.js} +1 -1
- package/dist/cdn/{Z5H7S4UV.js → 2XLDIKUR.js} +1 -1
- package/dist/cdn/{PTPT75U6.js → 3RZAPX3S.js} +1 -1
- package/dist/cdn/{6OSOUHQD.js → 4JMP7ZE6.js} +1 -1
- package/dist/cdn/{S6XTVW2E.js → 4YJT24E5.js} +1 -1
- package/dist/cdn/{IW3HH57K.js → 5MTMSAKC.js} +1 -1
- package/dist/cdn/{LYMOZHWK.js → 5SHA3PGC.js} +1 -1
- package/dist/cdn/{SXOJTCOY.js → 6NMWB5NC.js} +1 -1
- package/dist/cdn/{C4M2JGW3.js → 6UJALA2L.js} +1 -1
- package/dist/cdn/{JRDWWNST.js → 6VKEW33C.js} +1 -1
- package/dist/cdn/{ONIWIJZN.js → 76M3UWJF.js} +1 -1
- package/dist/cdn/{R6DDGHRE.js → 7GQ24AKO.js} +1 -1
- package/dist/cdn/7PY2VM2S.js +2 -0
- package/dist/cdn/{ULPRAGHR.js → 7PZQ2MP7.js} +1 -1
- package/dist/cdn/{ASS5QC73.js → ARXWEJFK.js} +1 -1
- package/dist/cdn/{7JX6B3W3.js → AV3KXTWF.js} +1 -1
- package/dist/cdn/{QNT2CGG3.js → BXXYI7NG.js} +1 -1
- package/dist/cdn/{DJRQRVE7.js → BZVRRVNB.js} +1 -1
- package/dist/cdn/{KUYFIQG5.js → C5LZGCHH.js} +1 -1
- package/dist/cdn/CI66IACC.js +2 -0
- package/dist/cdn/DD3JC2L3.js +4 -0
- package/dist/cdn/{RGCDDZZ7.js → E7UFN5JY.js} +1 -1
- package/dist/cdn/{AS3OMVJG.js → EMSOP52X.js} +1 -1
- package/dist/cdn/{L4UMQNXD.js → ESOI3UW5.js} +1 -1
- package/dist/cdn/FMFUEICN.js +2 -0
- package/dist/cdn/{V3SPTOG3.js → FNGWQOMU.js} +1 -1
- package/dist/cdn/{QNSZUCGN.js → G2T6OYTB.js} +1 -1
- package/dist/cdn/{E4LHQX7P.js → GU77W2GF.js} +1 -1
- package/dist/cdn/HHKKBJCY.js +2 -0
- package/dist/cdn/{K3TXWVO2.js → HK7YZNM4.js} +1 -1
- package/dist/cdn/{QNTMCZAS.js → HTLJCLHR.js} +1 -1
- package/dist/cdn/{MGOL3BOX.js → HVE26GKL.js} +1 -1
- package/dist/cdn/{PRSBDD25.js → IQQXCY6C.js} +1 -1
- package/dist/cdn/{EVYF4Q4A.js → IZU7KP25.js} +1 -1
- package/dist/cdn/{PKLCCM5C.js → JAOKRCFG.js} +1 -1
- package/dist/cdn/{AELONRA2.js → JBJJMSR3.js} +1 -1
- package/dist/cdn/{7XSKL7BM.js → JUINWMBC.js} +1 -1
- package/dist/cdn/{4GUAHP55.js → K5Z5A2RY.js} +1 -1
- package/dist/cdn/{Q36LSOV4.js → M5MCA232.js} +1 -1
- package/dist/cdn/{HUTJQTEN.js → MBVWXJW7.js} +1 -1
- package/dist/cdn/{EUQ4JO3K.js → NCTVUAXT.js} +1 -1
- package/dist/cdn/{GPHDOTEY.js → NHKAOTFM.js} +1 -1
- package/dist/cdn/{DBPLH4RV.js → NNOOCMHD.js} +1 -1
- package/dist/cdn/{74XBLQLQ.js → NU2NW3YW.js} +1 -1
- package/dist/cdn/{56MHO3UY.js → O7AZMIQX.js} +1 -1
- package/dist/cdn/{Z5GWY442.js → OIFBNDN7.js} +1 -1
- package/dist/cdn/{V7JWKNPI.js → OLLLVTHU.js} +1 -1
- package/dist/cdn/{GRJZORJP.js → P6NSLBDS.js} +1 -1
- package/dist/cdn/{RLTX5S5V.js → P77GI3QL.js} +1 -1
- package/dist/cdn/{NVYKJK26.js → PAKIDHHK.js} +1 -1
- package/dist/cdn/{ENW2DF2D.js → PCG2HRKC.js} +1 -1
- package/dist/cdn/{M2KUCUL3.js → PQ7PCKL4.js} +1 -1
- package/dist/cdn/PSXEKRGH.js +2 -0
- package/dist/cdn/{EJJFSS5C.js → QRUCDIZO.js} +1 -1
- package/dist/cdn/QXSUDN7A.js +21 -0
- package/dist/cdn/{C7UAPXZR.js → RA35CIMF.js} +1 -1
- package/dist/cdn/{NPPIBUUP.js → RUU2LTYJ.js} +1 -1
- package/dist/cdn/{ZJZBIHZ5.js → S4WGAHIV.js} +1 -1
- package/dist/cdn/{2CMRI2B3.js → S7XOHDIW.js} +1 -1
- package/dist/cdn/{V7FXM6DJ.js → SLXAZV5B.js} +1 -1
- package/dist/cdn/{EYFR4JQP.js → SNN6XXHG.js} +1 -1
- package/dist/cdn/SPBICIV2.js +2 -0
- package/dist/cdn/SS7F2SZ4.js +2 -0
- package/dist/cdn/{5S7OJL7F.js → SSL3U5CO.js} +1 -1
- package/dist/cdn/{GVGTMXTG.js → SU77ODY2.js} +1 -1
- package/dist/cdn/TAHIBODN.js +2 -0
- package/dist/cdn/TE7VJ4KH.js +2 -0
- package/dist/cdn/{YHW6JKYZ.js → TOLNZKKL.js} +1 -1
- package/dist/cdn/{5KV6KCRT.js → UAUP4JQ4.js} +1 -1
- package/dist/cdn/{PDNBP4EL.js → VCZPVG3A.js} +1 -1
- package/dist/cdn/{QEZPZGBW.js → VGC3RHQQ.js} +1 -1
- package/dist/cdn/VLIHU4DD.js +2 -0
- package/dist/cdn/{6A5SBI3R.js → VWDJZ7HA.js} +1 -1
- package/dist/cdn/{RSLHX62X.js → WCGF6MFJ.js} +1 -1
- package/dist/cdn/WGKOKVQY.js +2 -0
- package/dist/cdn/WNOPX4X3.js +2 -0
- package/dist/cdn/WPV4X3NK.js +2 -0
- package/dist/cdn/{QMRCHKSO.js → XY5MX7TV.js} +1 -1
- package/dist/cdn/{HA5W44KL.js → Y3XY5BXI.js} +1 -1
- package/dist/cdn/{C5YQOXHX.js → YCLEJLXQ.js} +1 -1
- package/dist/cdn/{T6AL47LF.js → ZIPMI556.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/components/public-notification/customElement.js +3 -3
- package/dist/components/solutions-all-panel/customElement.js +8 -8
- package/dist/components/solutions-all-shell/customElement.js +9 -9
- package/dist/components/solutions-deployed-shell/customElement.js +2 -2
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/solutions-components_commit.txt +4 -4
- package/package.json +3 -3
- package/dist/cdn/4SZGXI37.js +0 -2
- package/dist/cdn/52QNBNIL.js +0 -2
- package/dist/cdn/AHXBPG3X.js +0 -2
- package/dist/cdn/BF6WA5U4.js +0 -2
- package/dist/cdn/CBVAXYAC.js +0 -2
- package/dist/cdn/D6VGQMIK.js +0 -2
- package/dist/cdn/ETEJ4PIB.js +0 -2
- package/dist/cdn/GSRMKEUC.js +0 -2
- package/dist/cdn/H74UJR3L.js +0 -2
- package/dist/cdn/HATDZAP6.js +0 -2
- package/dist/cdn/JJUJVV7A.js +0 -2
- package/dist/cdn/LHCWS2RN.js +0 -4
- package/dist/cdn/PLHWBWIG.js +0 -2
- package/dist/cdn/U4QFXUX2.js +0 -33
- package/dist/cdn/WNQD3BKN.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{I as s}from"./46DQNAMV.js";var t=s({defaultAssetPath:"https://js.arcgis.com/5.0.
|
|
2
|
+
import{I as s}from"./46DQNAMV.js";var t=s({defaultAssetPath:"https://js.arcgis.com/5.0.1/solutions-components/",hydratedAttribute:"hydrated"}),{customElement:i,getAssetPath:n,setAssetPath:u}=t;t.t=void 0;t.o=void 0;t.c=void 0;t.r=void 0;export{t as a,i as b,n as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as E}from"./LLYTIOG4.js";import{b as k}from"./PZ4L77M5.js";import c from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as V}from"./HA5W44KL.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as C}from"./2CMRI2B3.js";import{F as d,G as u,H as S,J as p,K as v,h as b,i as o,r as w,u as L}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([x,N,D,W,R,{a:$,d:G,f:T},{c:_,g:I,j:O}])=>{var P=b`@layer{:host{display:block}.div-visible{display:inherit}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100%!important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:.5rem}.padding-end-1-2{padding-inline-end:.5rem}.icon{--calcite-color-icon-color: var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}}`,m=class extends S{constructor(){super(),this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=!1,this.enabledLayerIds=[],this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.geometries=[],this.headerLabelClass="font-bold",this.isUpdate=!1,this.layerViews=[],this.noResultText="",this.selectionLayerIds=[],this.searchDistanceEnabled=!1,this.useLayerFeaturesEnabled=!1,this._numSelected=0,this._searchTerm="",this._selectionLoading=!1,this._translations=V({name:"map-select-tools",blocking:!0}),this._bufferTools=d(),this._drawTools=d(),this._labelName=d(),this._pnContextConsumer=k({context:E,subscribe:!0}),this._searchElement=d(),this._selectedIds=[],this._selectionLabel="",this._graphics=[],this._featuresCollection={},this.selectionSetChange=w(),this.listenOn(window,"searchConfigurationChange",this.searchConfigurationChangeChanged),this.listenOn(window,"distanceChanged",this.distanceChanged),this.listenOn(window,"unitChanged",this.unitChanged)}static{this.properties={bufferColor:1,bufferOutlineColor:1,customLabelEnabled:5,enabledLayerIds:0,enableLayerFeatures:5,enableLayerFeaturesOnLoad:5,enableSearchDistance:5,enableSearchDistanceOnLoad:5,enableSketchTools:5,defaultBufferDistance:9,defaultBufferUnit:1,geometries:0,headerLabelClass:1,isUpdate:5,layerViews:0,mapView:0,noResultText:1,searchConfiguration:0,selectionSet:0,selectionLayerIds:0,selectLayerView:0,sketchLineSymbol:0,sketchPointSymbol:0,sketchPolygonSymbol:0,searchDistanceEnabled:5,useLayerFeaturesEnabled:5,_numSelected:16,_searchTerm:16,_selectionLoading:16,_translations:16}}static{this.styles=P}static{this.shadowRootOptions=L}willUpdate(e){e.has("geometries")&&(this.hasUpdated||this.geometries?.length>0)&&this.watchGeometriesHandler(this.geometries,e.get("geometries")),e.has("mapView")&&this.mapView&&this.mapViewWatchHandler(this.mapView,e.get("mapView")),e.has("searchConfiguration")&&this.searchConfiguration&&this.watchSearchConfigurationHandler(this.searchConfiguration,e.get("searchConfiguration")),e.has("defaultBufferUnit")&&this.hasUpdated&&(this.selectionSet&&(this.selectionSet.unit=this.defaultBufferUnit),this._bufferTools.value&&this.defaultBufferUnit!==void 0&&(this._bufferTools.value.unit=this.defaultBufferUnit),this._updateLabel()),e.has("defaultBufferDistance")&&this.hasUpdated&&(this.selectionSet&&(this.selectionSet.distance=this.defaultBufferDistance),this._updateLabel())}async watchGeometriesHandler(e,t){if(e!==t&&e.length>0)return this._highlightWithOIDsOrGeoms()}async mapViewWatchHandler(e,t){e&&e!==t&&await this._init()}async watchSearchConfigurationHandler(e,t){JSON.stringify(e)!==JSON.stringify(t)&&await this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||await this._updateLabel(),{id:this.isUpdate&&this.selectionSet?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.value?.distance,download:!0,unit:this._bufferTools.value?.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this.searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this.useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}searchConfigurationChangeChanged(e){this.searchConfiguration=e.detail}async distanceChanged(e){await this._distanceChanged(e.detail)}async unitChanged(e){e.detail.newValue!==e.detail.oldValue&&(this._unit=e.detail.newValue,await this._updateLabel())}async loaded(){await this._init()}render(){let e=this.enableSketchTools?"":"display-none",t=this.enableSketchTools?"padding-top-1":"";return o`${this._getMapLayerPicker()}<div class="border-bottom"></div><div class="padding-top-sides-1"><div class="search-widget" ${u(this._searchElement)}></div><div class=${p(t)}><map-draw-tools active class=${p(e)} .editGraphicsEnabled=${!this.useLayerFeaturesEnabled} .graphics=${this._graphics} .mapView=${this.mapView} @sketchGraphicsChange=${s=>{this._sketchGraphicsChanged(s)}} .pointSymbol=${this.sketchPointSymbol} .polygonSymbol=${this.sketchPolygonSymbol} .polylineSymbol=${this.sketchLineSymbol} ${u(this._drawTools)}></map-draw-tools></div>${this.enableSearchDistance?this._getBufferOptions():void 0}${this.enableLayerFeatures?this._getUseLayerFeaturesOptions():void 0}${this._getNumSelected()}</div><div class="border-bottom"></div>${this._getNameInput()}`}_getBufferOptions(){this.enableSearchDistanceOnLoad&&(this.searchDistanceEnabled=!0,this.enableSearchDistanceOnLoad=!1);let e=this.searchDistanceEnabled?"search-distance":"div-not-visible",t=typeof this.selectionSet?.distance=="number"?this.selectionSet.distance:this.defaultBufferDistance;return o`<div><div class="padding-top-1 display-flex"><calcite-label class="label-margin-0 w-100" layout=inline-space-between><div class="tooltip-container">${this._translations.searchDistance}<calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=search-distance-icon scale=s></calcite-icon></div></calcite-label><calcite-popover closable label overlay-positioning=fixed reference-element=search-distance-icon><span class="tooltip-message">${this._translations.useSearchDistanceTootip}</span></calcite-popover><calcite-switch .checked=${this.searchDistanceEnabled} @calciteSwitchChange=${()=>this.searchDistanceEnabled=!this.searchDistanceEnabled}></calcite-switch></div><div class=${p(e)}><buffer-tools .disabled=${!this.searchDistanceEnabled} .distance=${t} .geometries=${this.geometries} @bufferComplete=${s=>{this._bufferComplete(s)}} .unit=${this.selectionSet?.unit||this.defaultBufferUnit} ${u(this._bufferTools)}></buffer-tools></div></div>`}_getUseLayerFeaturesOptions(){this.enableLayerFeaturesOnLoad&&(this.useLayerFeaturesEnabled=!0,this.enableLayerFeaturesOnLoad=!1);let e=this.useLayerFeaturesEnabled?"div-visible":"div-not-visible";return o`<div><div class="padding-top-1 display-flex"><calcite-label class="label-margin-0 w-100" layout=inline-space-between><div class="tooltip-container">${this._translations.useLayerFeatures}<calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=use-layer-features-icon scale=s></calcite-icon></div></calcite-label><calcite-popover closable label overlay-positioning=fixed reference-element=use-layer-features-icon><span class="tooltip-message">${this._translations.useLayerFeaturesTooltip}</span></calcite-popover><calcite-switch .checked=${this.useLayerFeaturesEnabled} @calciteSwitchChange=${()=>{this._useLayerFeaturesEnabledChanged()}}></calcite-switch></div><div class=${`${e} padding-top-1`}><map-layer-picker .enabledLayerIds=${this.selectionLayerIds} .mapView=${this.mapView} @layerSelectionChange=${t=>{this._layerSelectionChange(t)}} .selectedIds=${this.layerViews.map(t=>t.layer.id)}></map-layer-picker></div></div>`}_getNumSelected(){let e=this._translations._lang==="en"?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return o`<div class="padding-top-1 padding-bottom-1" style=${v({"align-items":"end",display:"flex"})}>${this._selectionLoading?o`<div><calcite-loader class="info-blue padding-end-1-2" inline .label=${e||""} scale=m type=indeterminate></calcite-loader></div>`:o`<calcite-icon class="info-blue padding-end-1-2" icon=feature-layer scale=s></calcite-icon>`}<calcite-input-message class="info-blue" scale=m>${this._selectionLoading?e:this.noResultText&&this._numSelected===0?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())}</calcite-input-message></div>`}_getNameInput(){let e=this.customLabelEnabled?"":"display-none";return o`<div class=${`padding-sides-1 padding-top-1 ${e}`}><calcite-label class=${p(this.headerLabelClass)}>${this._translations.listName}<calcite-input @input=${()=>{this._selectionLabel=this._labelName.value?this._labelName.value.value:""}} .placeholder=${this._translations.listNamePlaceholder} .value=${this._selectionLabel||""} ${u(this._labelName)}></calcite-input></calcite-label></div>`}_getMapLayerPicker(){let e=this.selectionSet?.layerView?.layer.id;return o`<div class="display-flex padding-sides-1 padding-bottom-1"><calcite-label class=${`${this.headerLabelClass} width-full label-margin-0`}>${this._translations.inputLayer}<map-layer-picker .enabledLayerIds=${this.enabledLayerIds} .mapView=${this.mapView} @layerSelectionChange=${t=>{this._inputLayerSelectionChange(t)}} .selectedIds=${this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet&&e!==void 0?[e]:[]}></map-layer-picker></calcite-label></div>`}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),await this._initSearchWidget()}async _initSelectionSet(){this.selectionSet&&(this._searchTerm=this.selectionSet.searchResult?.name,this._searchResult=this.selectionSet.searchResult,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs||[],this.searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this.useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...this.selectionSet?.geometries||[]],this._graphics=this.geometries.reduce((e,t)=>{let s=t.type==="point"?this.sketchPointSymbol:t.type==="polyline"?this.sketchLineSymbol:this.sketchPolygonSymbol;return e.push(new D({geometry:t,symbol:s})),e},[]),this._selectionLabel=this.selectionSet?.label,this.useLayerFeaturesEnabled||await this._drawTools.value?.updateGraphics(),this.selectionSet.layerView&&this.mapView&&await O(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}async _initSearchWidget(){if(this.mapView&&this._searchElement.value){let e=this.searchConfiguration&&this._getSearchConfig(this.searchConfiguration,this.mapView),t={view:this.mapView,container:this._searchElement.value,searchTerm:this._searchTerm,...e};this._searchWidget?(this._searchWidget.view=this.mapView,this._searchWidget.searchTerm=this._searchTerm):this._searchWidget=new R(t),this._searchWidget&&(this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.viewModel.addHandles(this._searchWidget.on("search-clear",()=>{let s=this._searchClearLabel();this._searchResult?.name&&this._clearResults(!1,s)})),this._searchWidget.viewModel.addHandles(this._searchWidget.on("select-result",s=>{this._selectResult(s.result)})),await this._searchWidget.when(()=>{this._searchWidget&&(this._searchWidget.allPlaceholder=this.searchConfiguration?.allPlaceholder&&this.searchConfiguration.allPlaceholder.toLowerCase()!=="find address or place"?this.searchConfiguration.allPlaceholder:this._translations.placeholder)}))}}async _selectResult(e){if(e){this._searchResult=e;let t=e.feature,s=t?.layer,i=this.selectLayerView?.layer,a=Number(t?.getObjectId()),l;s?.sourceJSON?.isView&&s.url&&(l=await this._getViewSourceUrl(s.url));let r;i?.sourceJSON?.isView&&i.url&&(r=await this._getViewSourceUrl(i.url));let c=s?.url?.toLowerCase(),n=l?.toLowerCase(),h=i?.url?.toLowerCase(),y=r?.toLowerCase(),g=c&&h&&(c===h||c===y||n===h||n===y)&&!Number.isNaN(a),F=g?[a]:void 0;this._workflowType="SEARCH",this._updateLabel();let f=[e.feature];this._updateSelection(f,g,F),this._drawTools.value&&(this._drawTools.value.graphics=f),this._searchWidget?.resultGraphic&&(this._searchWidget.resultGraphic.visible=!1)}else{let t=this._searchClearLabel();this._clearResults(!1,t)}}async _getViewSourceUrl(e){let t="",s=`${e}/sources?f=json`;try{let i=await x(s,{query:{f:"json"}});i?.data?.services?.length===1&&(t=i.data.services[0].url)}catch(i){console.log(i)}return t}_searchClearLabel(){return this._searchResult?.name&&this._labelName.value&&this._labelName.value.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(e,t){let s=e?.sources;return s&&s?.length>0?(e={...e,includeDefaultSources:!1},s.forEach(i=>{if(i.hasOwnProperty("layer")){let a=i,l=a.layer?.id,r=l?t.map?.findLayerById(l):null,c=a?.layer?.url;r&&a?a.layer=r:c&&(a.layer=new N(c))}}),s?.forEach(i=>{if(i.hasOwnProperty("locator")){let a=i;if(a?.name==="ArcGIS World Geocoding Service"){let l=a.outFields||["Addr_type","Match_addr","StAddr","City"];a.outFields=l,a.singleLineFieldName="SingleLine"}a.url=a.url,delete a.url}})):e={...e,includeDefaultSources:!0},e}_initGraphicsLayer(){let e=this._pnContextConsumer.value,t=this._translations.bufferLayer;if(this.mapView){let s=this.mapView.map.layers.findIndex(i=>i.title===t);if(s>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(s);else if(this._bufferGraphicsLayer=new W({title:t,listMode:"hide"}),this._bufferGraphicsLayer){e.managedLayers[t]="buffer";let i=this.mapView.map.layers.findIndex(a=>a.title===this._translations.sketchLayer);i>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,i):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}}async _sketchGraphicsChanged(e,t=!1){let s=e.detail.graphics;if(s.length>0&&s[0])if(t||(this._sketchGraphic=s[0]),this._workflowType=this.useLayerFeaturesEnabled?"SELECT":"SKETCH",this._workflowType==="SKETCH"&&this._drawTools.value&&await this._drawTools.value.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this.useLayerFeaturesEnabled&&!t){let i=Array.isArray(s)?s.map(a=>a.geometry):this.geometries;await this._selectLayerFeatures(i[0])}else{let i=s.reduce((l,r)=>(r?.layer?.objectIdField?l.push(Number(r.attributes[r.layer.objectIdField])):r.getObjectId&&l.push(Number(r.getObjectId())),l),[]),a=e.detail.useOIDs&&i.length>0;this._updateSelection(s,a,i),a&&await this._highlightFeatures(i)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){return this._skipGeomOIDs&&this._skipGeomOIDs?.length>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(e){let t=this._pnContextConsumer.value;if(t.removeHandles(),e.length>0&&this.selectLayerView&&this.mapView){let s=await I(e,this.selectLayerView,this.mapView);t.highlightHandles.push(s)}this._numSelected=e.length,this.selectionSetChange.emit(e.length)}async _selectFeatures(e){this._selectionLoading=!0,this._selectedIds=this.selectLayerView&&await $(e,this.selectLayerView.layer)||[],this._selectionLoading=!1,this._drawTools.value&&(this._drawTools.value.graphics=this._graphics),await this._highlightFeatures(this._selectedIds)}async _bufferComplete(e){this._bufferGeometry=Array.isArray(e.detail)?e.detail[0]:e.detail;let t=this._bufferTools.value&&Number(this._bufferTools.value.distance),s=0;if(this._bufferGeometry){let i={type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}},a=new D({geometry:this._bufferGeometry,symbol:i});this._bufferGraphicsLayer&&a&&this.mapView&&(this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(a),await this._selectFeatures([this._bufferGeometry]),a.geometry?.extent&&await this.mapView.goTo(a.geometry.extent)),s=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:s})}_geomQuery(e){let t=T(e);return t?this._selectFeatures(t):Promise.resolve()}async _clearResults(e=!0,t=!1){this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName.value&&(this._labelName.value.value="")),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),e&&this._searchWidget&&this._clearSearchWidget(),this._pnContextConsumer.value.removeHandles(),this._drawTools.value?.clear&&(this._graphics=[],await this._drawTools.value.clear()),this._numSelected=this._selectedIds.length,this.selectionSetChange.emit(this._numSelected)}_clearSearchWidget(){this._searchWidget?.clear(),this._searchResult=void 0}_updateSelection(e,t,s){this._selectedIds=t&&s?s:this._selectedIds,this._skipGeomOIDs=t?s:void 0,this.geometries=Array.isArray(e)?e.reduce((i,a)=>(a.geometry&&i.push(a.geometry),i),[]):this.geometries,this._graphics=e}async _updateLabel(){if(this.enableSearchDistance){let e=this._translations.sketch&&this._selectionLabel.indexOf(this._translations.sketch)>-1,t=this._translations.select&&this._selectionLabel.indexOf(this._translations.select)>-1,s=this._selectionLabel.indexOf(this._searchResult?.name)>-1,i=this._workflowType==="SEARCH"?this._searchResult?.name:this._workflowType==="SELECT"?this._translations.select:this._translations.sketch,a=this._bufferTools.value?this._bufferTools.value.unit:this._unit,l=this._bufferTools.value&&a&&await this._bufferTools.value.getTranslatedUnit(a),r=Number.isNaN(Number(this._distance))&&this._bufferTools.value?this._bufferTools.value.distance:this._distance;this._selectionLabel=e||t||s||!this._selectionLabel?`${i} ${r} ${l}`:this._selectionLabel,this._labelName.value&&(this._labelName.value.value=this._selectionLabel)}}async _layerSelectionChange(e){if(Array.isArray(e.detail)&&e.detail.length>0){let t=e.detail.reduce((s,i)=>(this.mapView&&s.push(_(this.mapView,i)),s),[]);return Promise.all(t).then(s=>{this.layerViews=s.reduce((i,a)=>(a&&i.push(a),i),[]),this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})})}}async _inputLayerSelectionChange(e){let t=e?.detail?.length>0?e.detail[0]:"";(!this.selectLayerView||t!==this.selectLayerView.layer.id)&&(this.selectLayerView=this.mapView&&await _(this.mapView,t),await this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}async _distanceChanged(e){e.newValue!==e.oldValue&&(this._distance=e.newValue,await this._updateLabel())}async _selectLayerFeatures(e){this._selectionLoading=!0;let t=this.layerViews.map(s=>(this._featuresCollection[s.layer.id]=[],G(0,s.layer,e,this._featuresCollection)));return Promise.all(t).then(async s=>{this._selectionLoading=!1;let i=[];s.forEach(n=>{Object.keys(n).forEach(h=>{i=i.concat(n[h])})});let a=!1;i.forEach(n=>{let h=n.geometry;n.symbol=h&&h.type==="point"?this.sketchPointSymbol:h&&h.type==="polyline"?this.sketchLineSymbol:h&&h.type==="polygon"?this.sketchPolygonSymbol:void 0,a=n?.layer?.hasOwnProperty("objectIdField")||n.hasOwnProperty("getObjectId")});let l=this.layerViews[0].layer,r=this.selectLayerView?.layer,c=a&&l.url===r?.url&&r?.layerId===l.layerId;await this._sketchGraphicsChanged({detail:{graphics:i,useOIDs:c}},!0)})}_useLayerFeaturesEnabledChanged(){this.useLayerFeaturesEnabled=!this.useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}};C("map-select-tools",m);return m},"request","layers/FeatureLayer","Graphic","layers/GraphicsLayer","widgets/Search",a,c)
|
|
2
|
+
import{a as E}from"./LLYTIOG4.js";import{b as k}from"./PZ4L77M5.js";import c from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as V}from"./Y3XY5BXI.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as C}from"./S7XOHDIW.js";import{F as d,G as u,H as S,J as p,K as v,h as b,i as o,r as w,u as L}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([x,N,D,W,R,{a:$,d:G,f:T},{c:_,g:I,j:O}])=>{var P=b`@layer{:host{display:block}.div-visible{display:inherit}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100%!important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:.5rem}.padding-end-1-2{padding-inline-end:.5rem}.icon{--calcite-color-icon-color: var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}}`,m=class extends S{constructor(){super(),this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=!1,this.enabledLayerIds=[],this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.geometries=[],this.headerLabelClass="font-bold",this.isUpdate=!1,this.layerViews=[],this.noResultText="",this.selectionLayerIds=[],this.searchDistanceEnabled=!1,this.useLayerFeaturesEnabled=!1,this._numSelected=0,this._searchTerm="",this._selectionLoading=!1,this._translations=V({name:"map-select-tools",blocking:!0}),this._bufferTools=d(),this._drawTools=d(),this._labelName=d(),this._pnContextConsumer=k({context:E,subscribe:!0}),this._searchElement=d(),this._selectedIds=[],this._selectionLabel="",this._graphics=[],this._featuresCollection={},this.selectionSetChange=w(),this.listenOn(window,"searchConfigurationChange",this.searchConfigurationChangeChanged),this.listenOn(window,"distanceChanged",this.distanceChanged),this.listenOn(window,"unitChanged",this.unitChanged)}static{this.properties={bufferColor:1,bufferOutlineColor:1,customLabelEnabled:5,enabledLayerIds:0,enableLayerFeatures:5,enableLayerFeaturesOnLoad:5,enableSearchDistance:5,enableSearchDistanceOnLoad:5,enableSketchTools:5,defaultBufferDistance:9,defaultBufferUnit:1,geometries:0,headerLabelClass:1,isUpdate:5,layerViews:0,mapView:0,noResultText:1,searchConfiguration:0,selectionSet:0,selectionLayerIds:0,selectLayerView:0,sketchLineSymbol:0,sketchPointSymbol:0,sketchPolygonSymbol:0,searchDistanceEnabled:5,useLayerFeaturesEnabled:5,_numSelected:16,_searchTerm:16,_selectionLoading:16,_translations:16}}static{this.styles=P}static{this.shadowRootOptions=L}willUpdate(e){e.has("geometries")&&(this.hasUpdated||this.geometries?.length>0)&&this.watchGeometriesHandler(this.geometries,e.get("geometries")),e.has("mapView")&&this.mapView&&this.mapViewWatchHandler(this.mapView,e.get("mapView")),e.has("searchConfiguration")&&this.searchConfiguration&&this.watchSearchConfigurationHandler(this.searchConfiguration,e.get("searchConfiguration")),e.has("defaultBufferUnit")&&this.hasUpdated&&(this.selectionSet&&(this.selectionSet.unit=this.defaultBufferUnit),this._bufferTools.value&&this.defaultBufferUnit!==void 0&&(this._bufferTools.value.unit=this.defaultBufferUnit),this._updateLabel()),e.has("defaultBufferDistance")&&this.hasUpdated&&(this.selectionSet&&(this.selectionSet.distance=this.defaultBufferDistance),this._updateLabel())}async watchGeometriesHandler(e,t){if(e!==t&&e.length>0)return this._highlightWithOIDsOrGeoms()}async mapViewWatchHandler(e,t){e&&e!==t&&await this._init()}async watchSearchConfigurationHandler(e,t){JSON.stringify(e)!==JSON.stringify(t)&&await this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||await this._updateLabel(),{id:this.isUpdate&&this.selectionSet?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.value?.distance,download:!0,unit:this._bufferTools.value?.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this.searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this.useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}searchConfigurationChangeChanged(e){this.searchConfiguration=e.detail}async distanceChanged(e){await this._distanceChanged(e.detail)}async unitChanged(e){e.detail.newValue!==e.detail.oldValue&&(this._unit=e.detail.newValue,await this._updateLabel())}async loaded(){await this._init()}render(){let e=this.enableSketchTools?"":"display-none",t=this.enableSketchTools?"padding-top-1":"";return o`${this._getMapLayerPicker()}<div class="border-bottom"></div><div class="padding-top-sides-1"><div class="search-widget" ${u(this._searchElement)}></div><div class=${p(t)}><map-draw-tools active class=${p(e)} .editGraphicsEnabled=${!this.useLayerFeaturesEnabled} .graphics=${this._graphics} .mapView=${this.mapView} @sketchGraphicsChange=${s=>{this._sketchGraphicsChanged(s)}} .pointSymbol=${this.sketchPointSymbol} .polygonSymbol=${this.sketchPolygonSymbol} .polylineSymbol=${this.sketchLineSymbol} ${u(this._drawTools)}></map-draw-tools></div>${this.enableSearchDistance?this._getBufferOptions():void 0}${this.enableLayerFeatures?this._getUseLayerFeaturesOptions():void 0}${this._getNumSelected()}</div><div class="border-bottom"></div>${this._getNameInput()}`}_getBufferOptions(){this.enableSearchDistanceOnLoad&&(this.searchDistanceEnabled=!0,this.enableSearchDistanceOnLoad=!1);let e=this.searchDistanceEnabled?"search-distance":"div-not-visible",t=typeof this.selectionSet?.distance=="number"?this.selectionSet.distance:this.defaultBufferDistance;return o`<div><div class="padding-top-1 display-flex"><calcite-label class="label-margin-0 w-100" layout=inline-space-between><div class="tooltip-container">${this._translations.searchDistance}<calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=search-distance-icon scale=s></calcite-icon></div></calcite-label><calcite-popover closable label overlay-positioning=fixed reference-element=search-distance-icon><span class="tooltip-message">${this._translations.useSearchDistanceTootip}</span></calcite-popover><calcite-switch .checked=${this.searchDistanceEnabled} @calciteSwitchChange=${()=>this.searchDistanceEnabled=!this.searchDistanceEnabled}></calcite-switch></div><div class=${p(e)}><buffer-tools .disabled=${!this.searchDistanceEnabled} .distance=${t} .geometries=${this.geometries} @bufferComplete=${s=>{this._bufferComplete(s)}} .unit=${this.selectionSet?.unit||this.defaultBufferUnit} ${u(this._bufferTools)}></buffer-tools></div></div>`}_getUseLayerFeaturesOptions(){this.enableLayerFeaturesOnLoad&&(this.useLayerFeaturesEnabled=!0,this.enableLayerFeaturesOnLoad=!1);let e=this.useLayerFeaturesEnabled?"div-visible":"div-not-visible";return o`<div><div class="padding-top-1 display-flex"><calcite-label class="label-margin-0 w-100" layout=inline-space-between><div class="tooltip-container">${this._translations.useLayerFeatures}<calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=use-layer-features-icon scale=s></calcite-icon></div></calcite-label><calcite-popover closable label overlay-positioning=fixed reference-element=use-layer-features-icon><span class="tooltip-message">${this._translations.useLayerFeaturesTooltip}</span></calcite-popover><calcite-switch .checked=${this.useLayerFeaturesEnabled} @calciteSwitchChange=${()=>{this._useLayerFeaturesEnabledChanged()}}></calcite-switch></div><div class=${`${e} padding-top-1`}><map-layer-picker .enabledLayerIds=${this.selectionLayerIds} .mapView=${this.mapView} @layerSelectionChange=${t=>{this._layerSelectionChange(t)}} .selectedIds=${this.layerViews.map(t=>t.layer.id)}></map-layer-picker></div></div>`}_getNumSelected(){let e=this._translations._lang==="en"?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return o`<div class="padding-top-1 padding-bottom-1" style=${v({"align-items":"end",display:"flex"})}>${this._selectionLoading?o`<div><calcite-loader class="info-blue padding-end-1-2" inline .label=${e||""} scale=m type=indeterminate></calcite-loader></div>`:o`<calcite-icon class="info-blue padding-end-1-2" icon=feature-layer scale=s></calcite-icon>`}<calcite-input-message class="info-blue" scale=m>${this._selectionLoading?e:this.noResultText&&this._numSelected===0?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())}</calcite-input-message></div>`}_getNameInput(){let e=this.customLabelEnabled?"":"display-none";return o`<div class=${`padding-sides-1 padding-top-1 ${e}`}><calcite-label class=${p(this.headerLabelClass)}>${this._translations.listName}<calcite-input @input=${()=>{this._selectionLabel=this._labelName.value?this._labelName.value.value:""}} .placeholder=${this._translations.listNamePlaceholder} .value=${this._selectionLabel||""} ${u(this._labelName)}></calcite-input></calcite-label></div>`}_getMapLayerPicker(){let e=this.selectionSet?.layerView?.layer.id;return o`<div class="display-flex padding-sides-1 padding-bottom-1"><calcite-label class=${`${this.headerLabelClass} width-full label-margin-0`}>${this._translations.inputLayer}<map-layer-picker .enabledLayerIds=${this.enabledLayerIds} .mapView=${this.mapView} @layerSelectionChange=${t=>{this._inputLayerSelectionChange(t)}} .selectedIds=${this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet&&e!==void 0?[e]:[]}></map-layer-picker></calcite-label></div>`}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),await this._initSearchWidget()}async _initSelectionSet(){this.selectionSet&&(this._searchTerm=this.selectionSet.searchResult?.name,this._searchResult=this.selectionSet.searchResult,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs||[],this.searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this.useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...this.selectionSet?.geometries||[]],this._graphics=this.geometries.reduce((e,t)=>{let s=t.type==="point"?this.sketchPointSymbol:t.type==="polyline"?this.sketchLineSymbol:this.sketchPolygonSymbol;return e.push(new D({geometry:t,symbol:s})),e},[]),this._selectionLabel=this.selectionSet?.label,this.useLayerFeaturesEnabled||await this._drawTools.value?.updateGraphics(),this.selectionSet.layerView&&this.mapView&&await O(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}async _initSearchWidget(){if(this.mapView&&this._searchElement.value){let e=this.searchConfiguration&&this._getSearchConfig(this.searchConfiguration,this.mapView),t={view:this.mapView,container:this._searchElement.value,searchTerm:this._searchTerm,...e};this._searchWidget?(this._searchWidget.view=this.mapView,this._searchWidget.searchTerm=this._searchTerm):this._searchWidget=new R(t),this._searchWidget&&(this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.viewModel.addHandles(this._searchWidget.on("search-clear",()=>{let s=this._searchClearLabel();this._searchResult?.name&&this._clearResults(!1,s)})),this._searchWidget.viewModel.addHandles(this._searchWidget.on("select-result",s=>{this._selectResult(s.result)})),await this._searchWidget.when(()=>{this._searchWidget&&(this._searchWidget.allPlaceholder=this.searchConfiguration?.allPlaceholder&&this.searchConfiguration.allPlaceholder.toLowerCase()!=="find address or place"?this.searchConfiguration.allPlaceholder:this._translations.placeholder)}))}}async _selectResult(e){if(e){this._searchResult=e;let t=e.feature,s=t?.layer,i=this.selectLayerView?.layer,a=Number(t?.getObjectId()),l;s?.sourceJSON?.isView&&s.url&&(l=await this._getViewSourceUrl(s.url));let r;i?.sourceJSON?.isView&&i.url&&(r=await this._getViewSourceUrl(i.url));let c=s?.url?.toLowerCase(),n=l?.toLowerCase(),h=i?.url?.toLowerCase(),y=r?.toLowerCase(),g=c&&h&&(c===h||c===y||n===h||n===y)&&!Number.isNaN(a),F=g?[a]:void 0;this._workflowType="SEARCH",this._updateLabel();let f=[e.feature];this._updateSelection(f,g,F),this._drawTools.value&&(this._drawTools.value.graphics=f),this._searchWidget?.resultGraphic&&(this._searchWidget.resultGraphic.visible=!1)}else{let t=this._searchClearLabel();this._clearResults(!1,t)}}async _getViewSourceUrl(e){let t="",s=`${e}/sources?f=json`;try{let i=await x(s,{query:{f:"json"}});i?.data?.services?.length===1&&(t=i.data.services[0].url)}catch(i){console.log(i)}return t}_searchClearLabel(){return this._searchResult?.name&&this._labelName.value&&this._labelName.value.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(e,t){let s=e?.sources;return s&&s?.length>0?(e={...e,includeDefaultSources:!1},s.forEach(i=>{if(i.hasOwnProperty("layer")){let a=i,l=a.layer?.id,r=l?t.map?.findLayerById(l):null,c=a?.layer?.url;r&&a?a.layer=r:c&&(a.layer=new N(c))}}),s?.forEach(i=>{if(i.hasOwnProperty("locator")){let a=i;if(a?.name==="ArcGIS World Geocoding Service"){let l=a.outFields||["Addr_type","Match_addr","StAddr","City"];a.outFields=l,a.singleLineFieldName="SingleLine"}a.url=a.url,delete a.url}})):e={...e,includeDefaultSources:!0},e}_initGraphicsLayer(){let e=this._pnContextConsumer.value,t=this._translations.bufferLayer;if(this.mapView){let s=this.mapView.map.layers.findIndex(i=>i.title===t);if(s>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(s);else if(this._bufferGraphicsLayer=new W({title:t,listMode:"hide"}),this._bufferGraphicsLayer){e.managedLayers[t]="buffer";let i=this.mapView.map.layers.findIndex(a=>a.title===this._translations.sketchLayer);i>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,i):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}}async _sketchGraphicsChanged(e,t=!1){let s=e.detail.graphics;if(s.length>0&&s[0])if(t||(this._sketchGraphic=s[0]),this._workflowType=this.useLayerFeaturesEnabled?"SELECT":"SKETCH",this._workflowType==="SKETCH"&&this._drawTools.value&&await this._drawTools.value.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this.useLayerFeaturesEnabled&&!t){let i=Array.isArray(s)?s.map(a=>a.geometry):this.geometries;await this._selectLayerFeatures(i[0])}else{let i=s.reduce((l,r)=>(r?.layer?.objectIdField?l.push(Number(r.attributes[r.layer.objectIdField])):r.getObjectId&&l.push(Number(r.getObjectId())),l),[]),a=e.detail.useOIDs&&i.length>0;this._updateSelection(s,a,i),a&&await this._highlightFeatures(i)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){return this._skipGeomOIDs&&this._skipGeomOIDs?.length>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(e){let t=this._pnContextConsumer.value;if(t.removeHandles(),e.length>0&&this.selectLayerView&&this.mapView){let s=await I(e,this.selectLayerView,this.mapView);t.highlightHandles.push(s)}this._numSelected=e.length,this.selectionSetChange.emit(e.length)}async _selectFeatures(e){this._selectionLoading=!0,this._selectedIds=this.selectLayerView&&await $(e,this.selectLayerView.layer)||[],this._selectionLoading=!1,this._drawTools.value&&(this._drawTools.value.graphics=this._graphics),await this._highlightFeatures(this._selectedIds)}async _bufferComplete(e){this._bufferGeometry=Array.isArray(e.detail)?e.detail[0]:e.detail;let t=this._bufferTools.value&&Number(this._bufferTools.value.distance),s=0;if(this._bufferGeometry){let i={type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}},a=new D({geometry:this._bufferGeometry,symbol:i});this._bufferGraphicsLayer&&a&&this.mapView&&(this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(a),await this._selectFeatures([this._bufferGeometry]),a.geometry?.extent&&await this.mapView.goTo(a.geometry.extent)),s=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:s})}_geomQuery(e){let t=T(e);return t?this._selectFeatures(t):Promise.resolve()}async _clearResults(e=!0,t=!1){this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName.value&&(this._labelName.value.value="")),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),e&&this._searchWidget&&this._clearSearchWidget(),this._pnContextConsumer.value.removeHandles(),this._drawTools.value?.clear&&(this._graphics=[],await this._drawTools.value.clear()),this._numSelected=this._selectedIds.length,this.selectionSetChange.emit(this._numSelected)}_clearSearchWidget(){this._searchWidget?.clear(),this._searchResult=void 0}_updateSelection(e,t,s){this._selectedIds=t&&s?s:this._selectedIds,this._skipGeomOIDs=t?s:void 0,this.geometries=Array.isArray(e)?e.reduce((i,a)=>(a.geometry&&i.push(a.geometry),i),[]):this.geometries,this._graphics=e}async _updateLabel(){if(this.enableSearchDistance){let e=this._translations.sketch&&this._selectionLabel.indexOf(this._translations.sketch)>-1,t=this._translations.select&&this._selectionLabel.indexOf(this._translations.select)>-1,s=this._selectionLabel.indexOf(this._searchResult?.name)>-1,i=this._workflowType==="SEARCH"?this._searchResult?.name:this._workflowType==="SELECT"?this._translations.select:this._translations.sketch,a=this._bufferTools.value?this._bufferTools.value.unit:this._unit,l=this._bufferTools.value&&a&&await this._bufferTools.value.getTranslatedUnit(a),r=Number.isNaN(Number(this._distance))&&this._bufferTools.value?this._bufferTools.value.distance:this._distance;this._selectionLabel=e||t||s||!this._selectionLabel?`${i} ${r} ${l}`:this._selectionLabel,this._labelName.value&&(this._labelName.value.value=this._selectionLabel)}}async _layerSelectionChange(e){if(Array.isArray(e.detail)&&e.detail.length>0){let t=e.detail.reduce((s,i)=>(this.mapView&&s.push(_(this.mapView,i)),s),[]);return Promise.all(t).then(s=>{this.layerViews=s.reduce((i,a)=>(a&&i.push(a),i),[]),this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})})}}async _inputLayerSelectionChange(e){let t=e?.detail?.length>0?e.detail[0]:"";(!this.selectLayerView||t!==this.selectLayerView.layer.id)&&(this.selectLayerView=this.mapView&&await _(this.mapView,t),await this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}async _distanceChanged(e){e.newValue!==e.oldValue&&(this._distance=e.newValue,await this._updateLabel())}async _selectLayerFeatures(e){this._selectionLoading=!0;let t=this.layerViews.map(s=>(this._featuresCollection[s.layer.id]=[],G(0,s.layer,e,this._featuresCollection)));return Promise.all(t).then(async s=>{this._selectionLoading=!1;let i=[];s.forEach(n=>{Object.keys(n).forEach(h=>{i=i.concat(n[h])})});let a=!1;i.forEach(n=>{let h=n.geometry;n.symbol=h&&h.type==="point"?this.sketchPointSymbol:h&&h.type==="polyline"?this.sketchLineSymbol:h&&h.type==="polygon"?this.sketchPolygonSymbol:void 0,a=n?.layer?.hasOwnProperty("objectIdField")||n.hasOwnProperty("getObjectId")});let l=this.layerViews[0].layer,r=this.selectLayerView?.layer,c=a&&l.url===r?.url&&r?.layerId===l.layerId;await this._sketchGraphicsChanged({detail:{graphics:i,useOIDs:c}},!0)})}_useLayerFeaturesEnabledChanged(){this.useLayerFeaturesEnabled=!this.useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}};C("map-select-tools",m);return m},"request","layers/FeatureLayer","Graphic","layers/GraphicsLayer","widgets/Search",a,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as I}from"./LLYTIOG4.js";import{b as w}from"./PZ4L77M5.js";import e from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as L}from"./HA5W44KL.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as u}from"./2CMRI2B3.js";import{F as d,G as o,H as g,J as p,K as c,h as b,i,l,r as h,u as _}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,{a:f,b:v,d:y}])=>{var $=b`@layer{:host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default!important;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom: 0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}.popover-list{overflow:auto;width:250px}}`,m=class extends g{constructor(){super(),this.appearance="transparent",this.configLayerOrderDefined=!1,this.defaultLayerId="",this.disabled=!1,this.display="inline-block",this.enabledLayerIds=[],this.isMobile=!1,this.showOnlyUpdatableLayers=!1,this.selectedIds=[],this.scale="m",this.showTables=!1,this.showTablesDisabled=!1,this.showSingleLayerAsLabel=!1,this.type="select",this.showLayersListInPopover=!1,this.referenceElement="",this.force=!1,this._hasMultipleLayers=!0,this._hasValidLayers=!0,this._isDropdownOpen=!1,this.ids=[],this.selectedName="",this._translations=L({name:"map-layer-picker",blocking:!0}),this.defaultLayerHonored=!1,this._layerSelectElement=d(),this._layerComboboxElement=d(),this._pnContextConsumer=w({context:I,subscribe:!0}),this._skipEditCheck=!1,this._popover=d(),this.beforeLayerSelectionChange=h(),this.idsFound=h(),this.noLayersFound=h(),this.layerSelectionChange=h(),this.listenOn(window,"mapChanged",this.mapChanged)}static{this.properties={appearance:1,configLayerOrderDefined:5,defaultLayerId:1,disabled:5,display:1,enabledLayerIds:0,height:9,isMobile:5,mapView:0,showOnlyUpdatableLayers:5,placeholderIcon:1,selectedIds:0,scale:1,showTables:5,showTablesDisabled:5,showSingleLayerAsLabel:5,type:1,showLayersListInPopover:5,referenceElement:1,force:16,_hasMultipleLayers:16,_hasValidLayers:16,_isDropdownOpen:16,ids:16,selectedName:16,_translations:16}}static{this.styles=$}static{this.shadowRootOptions=_}willUpdate(e){e.has("mapView")&&this.hasUpdated&&this.mapViewWatchHandler(),e.has("type")&&(this._layerElement=this.type==="select"?this._layerSelectElement:this._layerComboboxElement),e.has("selectedIds")&&this.hasUpdated&&this.mapView&&(async()=>{let t=await y(this.mapView,this.selectedIds[0]);this.selectedName=t?.title??""})(),e.has("enabledLayerIds")&&this.hasUpdated&&this.enabledLayerIdsWatchHandler()}async enabledLayerIdsWatchHandler(){let e=this.selectedIds.length>0&&!this.enabledLayerIds.includes(this.selectedIds[0]),t=this.enabledLayerIds.some(a=>!this.ids.includes(a)),s=this.ids.toString()!==this.enabledLayerIds.toString();e?this.mapViewWatchHandler():(t||s)&&this._setLayers(),this._hasMultipleLayers=this.enabledLayerIds.length>1}async mapViewWatchHandler(){if(await this._setLayers(),this.ids?.length>0){this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1;let e=this.ids[0];this.defaultLayerId&&!this.defaultLayerHonored&&(e=this.defaultLayerId),await this._setSelectedLayer(e)}else this.mapView&&(this._hasValidLayers=!1,this.noLayersFound.emit())}async setLayerById(e,t=!1){this._skipEditCheck=t,!t||t&&e!==this.selectedIds[0]?this._setSelectedLayer(e):t&&e===this.selectedIds[0]&&(this.force=!0,setTimeout(()=>{this.force=!1},10)),this._skipEditCheck=!1}async setLayerByIds(e,t=!1){this._skipEditCheck=t,this._layerSelectionChange(e),this._skipEditCheck=!1}async updateLayer(){await this._setSelectedLayer(this.ids[0])}async mapChanged(e){e.detail.isValid||(this._hasValidLayers=!1,this.noLayersFound.emit())}async load(){await this._setLayers(),this.ids?.length>0?(this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1,this.defaultLayerId||await this._setSelectedLayer(this.ids[0])):this.mapView&&(this._hasValidLayers=!1,this.noLayersFound.emit())}render(){let e="map-layer-picker",t=this.height&&this.height>0&&!this.showLayersListInPopover?{height:`${this.height.toString()}px`}:{};return t={...t,display:this.display},i`<div class="map-layer-picker-container" style=${c(t)}><div class="map-layer-picker" style=${c(t)}>${this._hasValidLayers?!this._hasMultipleLayers&&this.showSingleLayerAsLabel?this._getSingleLayerPlaceholder():this.type==="combobox"?this._getCombobox(e):this.type==="select"?this._getSelect(e):this.showLayersListInPopover?this._getMapLayerPopOver():this._getDropdown(e):this._getInvalidPlaceholder()}</div></div>`}loaded(){if(this.ids?.length>0||this.selectedIds?.length===1){let e=this.selectedIds.length===1?this.selectedIds[0]:this.ids[0];this.type==="select"?this._layerElement.value&&(this._layerElement.value.value=e):this.type==="dropdown"&&(this.selectedName=this._layerNameHash&&Object.keys(this._layerNameHash).indexOf(e)>-1?this._layerNameHash[e].name:this._tableNameHash&&Object.keys(this._tableNameHash).indexOf(e)>-1?this._tableNameHash[e].name:"")}this._popover.value?.addEventListener("calcitePopoverOpen",()=>{this.el.querySelector("calcite-dropdown-item[selected]")?.setFocus()})}_getMapLayerPopOver(){let e=this.height&&this.height>0?{"max-height":`${this.height.toString()}px`}:{};return i`<calcite-popover auto-close focus-trap-disabled .label=${this.referenceElement} placement=left .referenceElement=${this.referenceElement} scale=s ${o(this._popover)}><div class=popover-list style=${c(e)}>${this._getMapLayerOptions()}</div></calcite-popover>`}_getInvalidPlaceholder(){return i`<div><calcite-notice class="height-100" icon=exclamation-mark-triangle id=no-valid-layers kind=danger open><div slot=message>${this._translations.noLayersFound}</div></calcite-notice><calcite-tooltip .label=${this._translations.enableEditUpdate} placement=bottom reference-element=no-valid-layers><span>${this._translations.enableEditUpdate}</span></calcite-tooltip></div>`}_getSingleLayerPlaceholder(){let e=this._getItemTypeIcon();return i`<div class="layer-picker-label-container cursor-default"><calcite-icon .icon=${e} scale=s></calcite-icon><calcite-label class="no-bottom-margin padding-start-1">${this.selectedName}</calcite-label></div>`}_getSelect(e){return i`<calcite-select .disabled=${this.disabled} id=${e??l} label @calciteSelectChange=${()=>this._layerSelectionChange()} .scale=${this.scale} ${o(this._layerElement)}>${this._getMapLayerOptions()}</calcite-select>`}_getCombobox(e){return i`<calcite-combobox clear-disabled id=${e??l} label @calciteComboboxChange=${()=>this._layerSelectionChange()} .placeholderIcon=${this.placeholderIcon} .scale=${this.scale} selection-mode=single ${o(this._layerElement)}>${this._getMapLayerOptions()}</calcite-combobox>`}_getDropdown(e){return i`<calcite-dropdown class="layer-picker-dropdown" @calciteDropdownBeforeClose=${()=>this._isDropdownOpen=!1} @calciteDropdownBeforeOpen=${()=>this._isDropdownOpen=!0}>${this.isMobile?this._getDropdownButton():this._getActionDropdownButton(e)}<calcite-dropdown-group selection-mode=single>${this._getMapLayerOptions()}</calcite-dropdown-group></calcite-dropdown>`}_getActionDropdownButton(e){return i`<calcite-action appearance=solid id=${e??l} slot=trigger text>${this._getDropdownButton()}</calcite-action>`}_getDropdownButton(){let e=this._getItemTypeIcon(),t=this.isMobile?"":"max-width-350",s=this.isMobile?"trigger":"",a=this._isDropdownOpen?"chevron-up":"chevron-down";return i`<calcite-button alignment=icon-end-space-between .appearance=${this.appearance} class=${p(t)} .iconEnd=${a} .iconStart=${e} kind=neutral slot=${s??l} width=full><div>${this.selectedName}</div></calcite-button>`}_getItemTypeIcon(){let e=this.selectedIds.length>0&&this._layerNameHash,t=e?this.selectedIds[0]:void 0;return e?Object.keys(this._layerNameHash).indexOf(t)>-1?"layers":"table":"layers"}_getMapLayerOptions(){return this.ids.reduce((e,t)=>(this._validLayer(t)?e.push(this._getItem(t,"layer")):this._validTable(t)&&e.push(this._getItem(t,"table")),e),[])}_getItem(e,t){let s=t==="layer"&&this._layerNameHash?this._layerNameHash[e]:this._tableNameHash?this._tableNameHash[e]:void 0,a=this.showOnlyUpdatableLayers?s&&!s.supportsUpdate:!1,r=s?.name||"",n=this.selectedIds.indexOf(e)>-1;return this.type==="combobox"?i`<calcite-combobox-item .disabled=${a} .heading=${r} .selected=${n} .value=${e}></calcite-combobox-item>`:this.type==="select"?i`<calcite-option .disabled=${a} .label=${r} .selected=${n} .value=${e}></calcite-option>`:this.force&&n||!this.force?i`<calcite-dropdown-group class=${p(a?"disabled":"")} id=${r??l} .selectionMode=${a?"none":"single"}><calcite-dropdown-item .disabled=${!!(t==="table"&&this.showTablesDisabled)} .iconStart=${t} @click=${a?void 0:()=>{this._setSelectedLayer(e)}} .selected=${n}>${r}</calcite-dropdown-item></calcite-dropdown-group>`:null}async _setSelectedLayer(e){if(e!==this.selectedIds[0]){let t;if(this.defaultLayerId&&!this.defaultLayerHonored&&(t=this._getLayerFromHash(this.defaultLayerId),this.defaultLayerHonored=t!==void 0,e=this.defaultLayerHonored?this.defaultLayerId:e),t=t||this._getLayerFromHash(e),!this._skipEditCheck&&this.beforeLayerSelectionChange.emit({currentId:this.selectedIds[0],newId:e,ref:this.el}).defaultPrevented)return;this.selectedName=t?.name,this.selectedIds=[e],this._popover.value&&(this._popover.value.open=!1),this.layerSelectionChange.emit(this.selectedIds)}else{let t=this.mapView&&await y(this.mapView,this.selectedIds[0]);this.selectedName=t?.title||""}}_getLayerFromHash(e){return this._layerNameHash&&Object.keys(this._layerNameHash).indexOf(e)>-1?this._layerNameHash[e]:this._tableNameHash&&Object.keys(this._tableNameHash).indexOf(e)>-1?this._tableNameHash[e]:void 0}async _setLayers(){if(this.mapView){await this._initLayerTableHash();let e=[];this._layerNameHash&&(e=this.showOnlyUpdatableLayers?this._getEditableIds(this._layerNameHash):Object.keys(this._layerNameHash));let t=[];if(this._tableNameHash&&(t=this.showTables?this.showOnlyUpdatableLayers?this._getEditableIds(this._tableNameHash):Object.keys(this._tableNameHash):[]),this.configLayerOrderDefined){let s=[...e.reverse(),...t.reverse()];this.ids=this.enabledLayerIds.length>0?this.enabledLayerIds.filter(a=>s.includes(a)):s}else this.ids=[...e.reverse().filter(s=>this.enabledLayerIds?.length>0?this.enabledLayerIds.indexOf(s)>-1:!0),...t.reverse().filter(s=>this.enabledLayerIds?.length>0?this.enabledLayerIds.indexOf(s)>-1:!0)];this.idsFound.emit(this.ids)}}_getEditableIds(e){return Object.keys(e).filter(t=>e[t].supportsUpdate)}async _initLayerTableHash(){this._layerNameHash=this.mapView&&await f(this.mapView,this.showOnlyUpdatableLayers),this._tableNameHash=this.showTables&&this.mapView?await v(this.mapView,this.showOnlyUpdatableLayers):{}}_validLayer(e){let t=this._pnContextConsumer.value,s=this._layerNameHash&&this._layerNameHash[e]?.name;return s!==void 0&&Object.keys(t?.managedLayers||[]).indexOf(s)<0&&(this.enabledLayerIds?.length>0?this.enabledLayerIds.indexOf(e)>-1:!0)}_validTable(e){let t=this._pnContextConsumer.value,s=this._tableNameHash&&this._tableNameHash[e]?.name,a=s&&this.showTables;return a?(t?.managedTables||[]).indexOf(s)<0&&(this.enabledLayerIds?.length>0?this.enabledLayerIds.indexOf(e)>-1:!0):a!==void 0}_layerSelectionChange(e){if(this._layerElement.value){let t=e||(Array.isArray(this._layerElement.value.value)?this._layerElement.value.value:[this._layerElement.value.value]);if(JSON.stringify(t)!==JSON.stringify([""])){if(!this._skipEditCheck&&this.beforeLayerSelectionChange.emit({currentIds:this.selectedIds,newIds:t,ref:this.el}).defaultPrevented)return;this.selectedIds=t,this.layerSelectionChange.emit(this.selectedIds)}}}};u("map-layer-picker",m);return m},a,e)
|
|
2
|
+
import{a as I}from"./LLYTIOG4.js";import{b as w}from"./PZ4L77M5.js";import e from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as L}from"./Y3XY5BXI.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as u}from"./S7XOHDIW.js";import{F as d,G as o,H as g,J as p,K as c,h as b,i,l,r as h,u as _}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,{a:f,b:v,d:y}])=>{var $=b`@layer{:host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default!important;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom: 0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}.popover-list{overflow:auto;width:250px}}`,m=class extends g{constructor(){super(),this.appearance="transparent",this.configLayerOrderDefined=!1,this.defaultLayerId="",this.disabled=!1,this.display="inline-block",this.enabledLayerIds=[],this.isMobile=!1,this.showOnlyUpdatableLayers=!1,this.selectedIds=[],this.scale="m",this.showTables=!1,this.showTablesDisabled=!1,this.showSingleLayerAsLabel=!1,this.type="select",this.showLayersListInPopover=!1,this.referenceElement="",this.force=!1,this._hasMultipleLayers=!0,this._hasValidLayers=!0,this._isDropdownOpen=!1,this.ids=[],this.selectedName="",this._translations=L({name:"map-layer-picker",blocking:!0}),this.defaultLayerHonored=!1,this._layerSelectElement=d(),this._layerComboboxElement=d(),this._pnContextConsumer=w({context:I,subscribe:!0}),this._skipEditCheck=!1,this._popover=d(),this.beforeLayerSelectionChange=h(),this.idsFound=h(),this.noLayersFound=h(),this.layerSelectionChange=h(),this.listenOn(window,"mapChanged",this.mapChanged)}static{this.properties={appearance:1,configLayerOrderDefined:5,defaultLayerId:1,disabled:5,display:1,enabledLayerIds:0,height:9,isMobile:5,mapView:0,showOnlyUpdatableLayers:5,placeholderIcon:1,selectedIds:0,scale:1,showTables:5,showTablesDisabled:5,showSingleLayerAsLabel:5,type:1,showLayersListInPopover:5,referenceElement:1,force:16,_hasMultipleLayers:16,_hasValidLayers:16,_isDropdownOpen:16,ids:16,selectedName:16,_translations:16}}static{this.styles=$}static{this.shadowRootOptions=_}willUpdate(e){e.has("mapView")&&this.hasUpdated&&this.mapViewWatchHandler(),e.has("type")&&(this._layerElement=this.type==="select"?this._layerSelectElement:this._layerComboboxElement),e.has("selectedIds")&&this.hasUpdated&&this.mapView&&(async()=>{let t=await y(this.mapView,this.selectedIds[0]);this.selectedName=t?.title??""})(),e.has("enabledLayerIds")&&this.hasUpdated&&this.enabledLayerIdsWatchHandler()}async enabledLayerIdsWatchHandler(){let e=this.selectedIds.length>0&&!this.enabledLayerIds.includes(this.selectedIds[0]),t=this.enabledLayerIds.some(a=>!this.ids.includes(a)),s=this.ids.toString()!==this.enabledLayerIds.toString();e?this.mapViewWatchHandler():(t||s)&&this._setLayers(),this._hasMultipleLayers=this.enabledLayerIds.length>1}async mapViewWatchHandler(){if(await this._setLayers(),this.ids?.length>0){this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1;let e=this.ids[0];this.defaultLayerId&&!this.defaultLayerHonored&&(e=this.defaultLayerId),await this._setSelectedLayer(e)}else this.mapView&&(this._hasValidLayers=!1,this.noLayersFound.emit())}async setLayerById(e,t=!1){this._skipEditCheck=t,!t||t&&e!==this.selectedIds[0]?this._setSelectedLayer(e):t&&e===this.selectedIds[0]&&(this.force=!0,setTimeout(()=>{this.force=!1},10)),this._skipEditCheck=!1}async setLayerByIds(e,t=!1){this._skipEditCheck=t,this._layerSelectionChange(e),this._skipEditCheck=!1}async updateLayer(){await this._setSelectedLayer(this.ids[0])}async mapChanged(e){e.detail.isValid||(this._hasValidLayers=!1,this.noLayersFound.emit())}async load(){await this._setLayers(),this.ids?.length>0?(this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1,this.defaultLayerId||await this._setSelectedLayer(this.ids[0])):this.mapView&&(this._hasValidLayers=!1,this.noLayersFound.emit())}render(){let e="map-layer-picker",t=this.height&&this.height>0&&!this.showLayersListInPopover?{height:`${this.height.toString()}px`}:{};return t={...t,display:this.display},i`<div class="map-layer-picker-container" style=${c(t)}><div class="map-layer-picker" style=${c(t)}>${this._hasValidLayers?!this._hasMultipleLayers&&this.showSingleLayerAsLabel?this._getSingleLayerPlaceholder():this.type==="combobox"?this._getCombobox(e):this.type==="select"?this._getSelect(e):this.showLayersListInPopover?this._getMapLayerPopOver():this._getDropdown(e):this._getInvalidPlaceholder()}</div></div>`}loaded(){if(this.ids?.length>0||this.selectedIds?.length===1){let e=this.selectedIds.length===1?this.selectedIds[0]:this.ids[0];this.type==="select"?this._layerElement.value&&(this._layerElement.value.value=e):this.type==="dropdown"&&(this.selectedName=this._layerNameHash&&Object.keys(this._layerNameHash).indexOf(e)>-1?this._layerNameHash[e].name:this._tableNameHash&&Object.keys(this._tableNameHash).indexOf(e)>-1?this._tableNameHash[e].name:"")}this._popover.value?.addEventListener("calcitePopoverOpen",()=>{this.el.querySelector("calcite-dropdown-item[selected]")?.setFocus()})}_getMapLayerPopOver(){let e=this.height&&this.height>0?{"max-height":`${this.height.toString()}px`}:{};return i`<calcite-popover auto-close focus-trap-disabled .label=${this.referenceElement} placement=left .referenceElement=${this.referenceElement} scale=s ${o(this._popover)}><div class=popover-list style=${c(e)}>${this._getMapLayerOptions()}</div></calcite-popover>`}_getInvalidPlaceholder(){return i`<div><calcite-notice class="height-100" icon=exclamation-mark-triangle id=no-valid-layers kind=danger open><div slot=message>${this._translations.noLayersFound}</div></calcite-notice><calcite-tooltip .label=${this._translations.enableEditUpdate} placement=bottom reference-element=no-valid-layers><span>${this._translations.enableEditUpdate}</span></calcite-tooltip></div>`}_getSingleLayerPlaceholder(){let e=this._getItemTypeIcon();return i`<div class="layer-picker-label-container cursor-default"><calcite-icon .icon=${e} scale=s></calcite-icon><calcite-label class="no-bottom-margin padding-start-1">${this.selectedName}</calcite-label></div>`}_getSelect(e){return i`<calcite-select .disabled=${this.disabled} id=${e??l} label @calciteSelectChange=${()=>this._layerSelectionChange()} .scale=${this.scale} ${o(this._layerElement)}>${this._getMapLayerOptions()}</calcite-select>`}_getCombobox(e){return i`<calcite-combobox clear-disabled id=${e??l} label @calciteComboboxChange=${()=>this._layerSelectionChange()} .placeholderIcon=${this.placeholderIcon} .scale=${this.scale} selection-mode=single ${o(this._layerElement)}>${this._getMapLayerOptions()}</calcite-combobox>`}_getDropdown(e){return i`<calcite-dropdown class="layer-picker-dropdown" @calciteDropdownBeforeClose=${()=>this._isDropdownOpen=!1} @calciteDropdownBeforeOpen=${()=>this._isDropdownOpen=!0}>${this.isMobile?this._getDropdownButton():this._getActionDropdownButton(e)}<calcite-dropdown-group selection-mode=single>${this._getMapLayerOptions()}</calcite-dropdown-group></calcite-dropdown>`}_getActionDropdownButton(e){return i`<calcite-action appearance=solid id=${e??l} slot=trigger text>${this._getDropdownButton()}</calcite-action>`}_getDropdownButton(){let e=this._getItemTypeIcon(),t=this.isMobile?"":"max-width-350",s=this.isMobile?"trigger":"",a=this._isDropdownOpen?"chevron-up":"chevron-down";return i`<calcite-button alignment=icon-end-space-between .appearance=${this.appearance} class=${p(t)} .iconEnd=${a} .iconStart=${e} kind=neutral slot=${s??l} width=full><div>${this.selectedName}</div></calcite-button>`}_getItemTypeIcon(){let e=this.selectedIds.length>0&&this._layerNameHash,t=e?this.selectedIds[0]:void 0;return e?Object.keys(this._layerNameHash).indexOf(t)>-1?"layers":"table":"layers"}_getMapLayerOptions(){return this.ids.reduce((e,t)=>(this._validLayer(t)?e.push(this._getItem(t,"layer")):this._validTable(t)&&e.push(this._getItem(t,"table")),e),[])}_getItem(e,t){let s=t==="layer"&&this._layerNameHash?this._layerNameHash[e]:this._tableNameHash?this._tableNameHash[e]:void 0,a=this.showOnlyUpdatableLayers?s&&!s.supportsUpdate:!1,r=s?.name||"",n=this.selectedIds.indexOf(e)>-1;return this.type==="combobox"?i`<calcite-combobox-item .disabled=${a} .heading=${r} .selected=${n} .value=${e}></calcite-combobox-item>`:this.type==="select"?i`<calcite-option .disabled=${a} .label=${r} .selected=${n} .value=${e}></calcite-option>`:this.force&&n||!this.force?i`<calcite-dropdown-group class=${p(a?"disabled":"")} id=${r??l} .selectionMode=${a?"none":"single"}><calcite-dropdown-item .disabled=${!!(t==="table"&&this.showTablesDisabled)} .iconStart=${t} @click=${a?void 0:()=>{this._setSelectedLayer(e)}} .selected=${n}>${r}</calcite-dropdown-item></calcite-dropdown-group>`:null}async _setSelectedLayer(e){if(e!==this.selectedIds[0]){let t;if(this.defaultLayerId&&!this.defaultLayerHonored&&(t=this._getLayerFromHash(this.defaultLayerId),this.defaultLayerHonored=t!==void 0,e=this.defaultLayerHonored?this.defaultLayerId:e),t=t||this._getLayerFromHash(e),!this._skipEditCheck&&this.beforeLayerSelectionChange.emit({currentId:this.selectedIds[0],newId:e,ref:this.el}).defaultPrevented)return;this.selectedName=t?.name,this.selectedIds=[e],this._popover.value&&(this._popover.value.open=!1),this.layerSelectionChange.emit(this.selectedIds)}else{let t=this.mapView&&await y(this.mapView,this.selectedIds[0]);this.selectedName=t?.title||""}}_getLayerFromHash(e){return this._layerNameHash&&Object.keys(this._layerNameHash).indexOf(e)>-1?this._layerNameHash[e]:this._tableNameHash&&Object.keys(this._tableNameHash).indexOf(e)>-1?this._tableNameHash[e]:void 0}async _setLayers(){if(this.mapView){await this._initLayerTableHash();let e=[];this._layerNameHash&&(e=this.showOnlyUpdatableLayers?this._getEditableIds(this._layerNameHash):Object.keys(this._layerNameHash));let t=[];if(this._tableNameHash&&(t=this.showTables?this.showOnlyUpdatableLayers?this._getEditableIds(this._tableNameHash):Object.keys(this._tableNameHash):[]),this.configLayerOrderDefined){let s=[...e.reverse(),...t.reverse()];this.ids=this.enabledLayerIds.length>0?this.enabledLayerIds.filter(a=>s.includes(a)):s}else this.ids=[...e.reverse().filter(s=>this.enabledLayerIds?.length>0?this.enabledLayerIds.indexOf(s)>-1:!0),...t.reverse().filter(s=>this.enabledLayerIds?.length>0?this.enabledLayerIds.indexOf(s)>-1:!0)];this.idsFound.emit(this.ids)}}_getEditableIds(e){return Object.keys(e).filter(t=>e[t].supportsUpdate)}async _initLayerTableHash(){this._layerNameHash=this.mapView&&await f(this.mapView,this.showOnlyUpdatableLayers),this._tableNameHash=this.showTables&&this.mapView?await v(this.mapView,this.showOnlyUpdatableLayers):{}}_validLayer(e){let t=this._pnContextConsumer.value,s=this._layerNameHash&&this._layerNameHash[e]?.name;return s!==void 0&&Object.keys(t?.managedLayers||[]).indexOf(s)<0&&(this.enabledLayerIds?.length>0?this.enabledLayerIds.indexOf(e)>-1:!0)}_validTable(e){let t=this._pnContextConsumer.value,s=this._tableNameHash&&this._tableNameHash[e]?.name,a=s&&this.showTables;return a?(t?.managedTables||[]).indexOf(s)<0&&(this.enabledLayerIds?.length>0?this.enabledLayerIds.indexOf(e)>-1:!0):a!==void 0}_layerSelectionChange(e){if(this._layerElement.value){let t=e||(Array.isArray(this._layerElement.value.value)?this._layerElement.value.value:[this._layerElement.value.value]);if(JSON.stringify(t)!==JSON.stringify([""])){if(!this._skipEditCheck&&this.beforeLayerSelectionChange.emit({currentIds:this.selectedIds,newIds:t,ref:this.el}).defaultPrevented)return;this.selectedIds=t,this.layerSelectionChange.emit(this.selectedIds)}}}};u("map-layer-picker",m);return m},a,e)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
+
import e from"./GU77W2GF.js";import{a as V}from"./LLYTIOG4.js";import c from"./2SD4IYX3.js";import"./MQF26HKA.js";import"./G4VIPBRX.js";import{a as L}from"./PZ4L77M5.js";import"./DD3JC2L3.js";import b from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as E}from"./Y3XY5BXI.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as T,c as k}from"./S7XOHDIW.js";import{F as h,G as d,H as x,J as p,h as S,i as l,l as m,r as w,s as v,u as $}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([A,G,M,N,u,f,,{g:C,j:I},{a:P,d:O,e:D,f:R}])=>{var U=S`@layer{:host{display:block;--calcite-input-message-spacing-value: 0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-bottom-0{padding-bottom:0!important}.padding-inline-start-0{padding-inline-start:0!important}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-block-start-1{padding-block-start:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-top-1-2{padding-block-start:.5rem!important}.padding-top-1{padding-top:1rem}.indent-group{border-inline-start:1px solid var(--calcite-color-border-2);margin-bottom:.5rem;padding-inline-start:1rem;margin-inline-start:.5rem}.margin-bottom-0-5{margin-bottom:.5rem}.margin-top-0-5{margin-top:.5rem!important}.instructional-text{line-height:1;padding:0!important;margin:0;color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--2)}.info-blue{color:var(--calcite-color-status-info)}.info-message{justify-content:center;display:grid}.font-bold{font-weight:700}.header-label{font-weight:700;font-size:var(--calcite-font-size-0)}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:.5rem}.margin-top-0{margin-block-start:0!important}.margin-top-1{margin-top:1rem!important}.label-margin-0{--calcite-label-margin-bottom: 0}.list-label{color:var(--calcite-color-text-1);font-weight:var(--calcite-font-weight-bold)!important}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3: var(--calcite-color-brand);--calcite-color-foreground-2: var(--calcite-color-brand-hover);--calcite-color-text-1: var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}.list-container{padding:0 1rem 1rem}.list-items{align-items:center;background-color:#fff;box-shadow:0 1px 3px #0000001a;font-family:sans-serif;padding:12px 16px}.list-item{display:flex;align-items:center;justify-content:space-between}.item-label{color:#4a4a4a;font-size:16px}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}calcite-segmented-control{--calcite-segmented-control-border-color: var(--calcite-color-border-2)}calcite-segmented-control-item{--calcite-segmented-control-color: var(--calcite-color-text-3)}calcite-segmented-control-item[checked]{--calcite-segmented-control-border-color: var(--calcite-color-surface-highlight);--calcite-segmented-control-background-color: var(--calcite-color-surface-highlight);--calcite-segmented-control-color: var(--calcite-color-text-highlight)}calcite-action-bar{--calcite-internal-action-bar-gap: 0px;--calcite-internal-action-bar-padding: 0px}}`,b=class extends v{constructor(){super(),this.managedLayers={},this.managedTables=[],this.highlightHandles=[]}removeHandles(){this.highlightHandles.forEach(e=>{e?.remove()}),this.highlightHandles=[]}},y=class extends x{constructor(){super(),this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=!1,this.customExport=!1,this.customExportURL="",this.defaultBufferDistance=0,this.defaultBufferUnit="feet",this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.featureHighlightEnabled=!1,this.noResultText="",this.initialNotice="",this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType="PDF",this._fetchingData=!1,this._isMobile=!1,this._numDuplicates=0,this._pageType="LIST",this._saveEnabled=!1,this._selectionSets=[],this._segmentType="STANDARD",this._selectedReportingLayerId="",this._isInitialLoading=!0,this._translations=E({name:"public-notification",blocking:!0}),this._downloadTools=h(),this.layoutTemplateSelectRef=h(),this.reportTemplateSelectRef=h(),this._onboardingImageUrl="",this._popupsEnabled=!1,this._removeDuplicates=h(),this._selectTools=h(),this._refineSelection=h(),this._titleElement=h(),this._titleValue=void 0,this._numSelected=0,this._pnStateContextProvider=L({context:V}),this._refineGraphics=[],this._layoutTemplates=[],this._reportTemplates=[],this._reportTemplatesInfo=[],this.searchConfigurationChange=w(),this.listenOn(window,"selectionSetsChanged",this.selectionSetsChanged),this._pnState=new b,this._pnStateContextProvider.setValue(this._pnState)}static{this.properties={addresseeLayerIds:0,bufferColor:1,bufferOutlineColor:1,customLabelEnabled:5,customExport:5,customExportURL:1,defaultBufferDistance:9,defaultBufferUnit:1,defaultExportTitle:1,defaultNumLabelsPerPage:9,enableLayerFeatures:5,enableLayerFeaturesOnLoad:5,enableSearchDistance:5,enableSearchDistanceOnLoad:5,enableSketchTools:5,featureEffect:0,featureHighlightEnabled:5,mapView:0,noResultText:1,initialNotice:1,searchConfiguration:0,selectionLayerIds:0,showRefineSelection:5,showSearchSettings:5,sketchLineSymbol:0,sketchPointSymbol:0,sketchPolygonSymbol:0,_exportGraphics:16,_addMap:16,_addResults:16,_addTitle:16,_downloadActive:16,_exportType:16,_fetchingData:16,_isMobile:16,_numDuplicates:16,_pageType:16,_saveEnabled:16,_selectionSets:16,_segmentType:16,_selectedReportingLayerId:16,_isInitialLoading:16,_translations:16}}static{this.styles=U}static{this.shadowRootOptions=$}willUpdate(e){e.has("mapView")&&this.mapView&&this.mapViewWatchHandler(this.mapView),e.has("searchConfiguration")&&this.searchConfiguration&&this.watchSearchConfigurationHandler(this.searchConfiguration,e.get("searchConfiguration")),e.has("sketchLineSymbol")&&this.sketchLineSymbolWatchHandler(this.sketchLineSymbol,e.get("sketchLineSymbol")),e.has("sketchPointSymbol")&&this.sketchPointSymbolWatchHandler(this.sketchPointSymbol,e.get("sketchPointSymbol")),e.has("sketchPolygonSymbol")&&this.sketchPolygonSymbolWatchHandler(this.sketchPolygonSymbol,e.get("sketchPolygonSymbol")),e.has("_pageType")&&(this.hasUpdated||this._pageType!=="LIST")&&this.pageTypeWatchHandler(this._pageType,e.get("_pageType"))}async mapViewWatchHandler(e){e?.popup&&(this._popupsEnabled=e?.popupEnabled),this.searchConfiguration&&this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(e,t){let i=JSON.stringify(e);this.mapView&&(i!==JSON.stringify(t)||i&&!this._searchConfiguration)&&(this._searchConfiguration=JSON.parse(i),this._searchConfiguration&&this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setLineSymbol(e)}async sketchPointSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setPointSymbol(e)}async sketchPolygonSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setPolygonSymbol(e)}async pageTypeWatchHandler(e,t){if(this._checkPopups(),this.mapView?.popup&&(this.mapView.popupEnabled=e!=="LIST"?!1:this._popupsEnabled),e==="EXPORT"&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),(t==="SELECT"||t==="REFINE")&&await this._clearSelection(),t==="EXPORT"&&this._removeExportGraphics(),e!=="SELECT")return this._highlightFeatures()}selectionSetsChanged(e){this._selectionSets=[...e.detail]}connectedCallback(){super.connectedCallback(),this._mediaQuery=window.matchMedia("(max-width: 600px)"),this.listenOn(this._mediaQuery,"change",e=>this._setIsMobile(e))}async load(){this._initSymbols(),this._onboardingImageUrl=k("assets/public-notification/images/onboarding.png")}render(){let e=this._isMobile?"footer":"header";return l`<calcite-shell>${this._isInitialLoading?l`<calcite-loader label></calcite-loader>`:l`<calcite-action-bar class="border-bottom-1 action-bar-size" expand-disabled layout=horizontal slot=${e??m}>${this._getActionGroup("list-check","LIST",this._translations.myLists)}${this.showRefineSelection?this._getActionGroup("test-data","REFINE",this._translations.refineSelection):null}${this._getActionGroup("export","EXPORT",this._translations.export)}</calcite-action-bar>${this._getPage(this._pageType)}`}</calcite-shell>`}async loaded(){this.searchConfiguration&&this._initSearchConfiguration(this.searchConfiguration),this.customExport&&this.customExportURL&&await this._setTemplates(),this._isInitialLoading=!1}_initSearchConfiguration(e){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=e,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(e){let t=e?.type==="simple-line";this.sketchLineSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(e){let t=e?.type==="simple-marker";this.sketchPointSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(e){let t=e?.type==="simple-fill";this.sketchPolygonSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(e){this._isMobile=e.matches}_getActionGroup(e,t,i){let s=this.showRefineSelection?"w-1-3":"w-1-2";return l`<calcite-action-group class=${p(s)} layout=horizontal><div class="background-override"><calcite-action .active=${this._pageType===t} alignment=center appearance=solid class="width-full height-full" .icon=${e} id=${e??m} @click=${()=>{this._setPageType(t)}} text></calcite-action></div><calcite-tooltip label placement=bottom .referenceElement=${e}><span>${i}</span></calcite-tooltip></calcite-action-group>`}_setPageType(e){this._pageType=e}_getPage(e){let t;switch(e){case"LIST":t=this._getListPage();break;case"SELECT":t=this._getSelectPage();break;case"EXPORT":t=this._getExportPage();break;case"REFINE":t=this._getRefinePage();break}return t}_getListPage(){let e=this._hasSelections(),t=e?this._translations.listHasSetsTip:this.initialNotice!==""?this.initialNotice:this._translations.selectLayerAndAdd;return l`<calcite-panel>${this._getLabel(this._translations.myLists,!1,"header-label")}${this._getNotice(t||"","padding-sides-1 padding-bottom-1","word-wrap-anywhere")}${e?this._getSelectionSetList():this._getOnboardingImage()}<div class="display-flex padding-1"><calcite-button @click=${()=>{this._setPageType("SELECT")}} width=full><span class="font-weight-500">${this._translations.add}</span></calcite-button></div></calcite-panel>`}_getOnboardingImage(){return l`<div class="display-flex padding-sides-1"><img class="img-container" role=presentation src=${this._onboardingImageUrl??m}></div>`}_getSelectionSetList(){return l`<div class="padding-top-1-2 padding-bottom-1-2"><calcite-list class="list-border margin-sides-1" label>${this._selectionSets.reduce((e,t,i)=>{let s=this._getSelectionSetIds(t),a=!0;return t.workflowType==="REFINE"&&(a=Object.keys(t.refineInfos).reduce((o,c)=>{let n=t.refineInfos[c];return o+=n.addIds.length+n.removeIds.length,o},0)>0),a&&e.push(l`<calcite-list-item .label=${t.label} @click=${()=>this.mapView&&this._gotoSelection(t,this.mapView)}><div slot=content><div class="list-label">${t.label}</div><div class="list-description">${t?.layerView?.layer.title}</div><div class="list-description">${this._translations.selectedFeatures.replace("{{n}}",s.length.toString())}</div></div>${this._getAction(!0,"pencil","",o=>this._openSelection(t,o),!1,"actions-end")}${this._getAction(!0,"x","",o=>this._deleteSelection(i,o),!1,"actions-end")}</calcite-list-item>`),e},[])}</calcite-list></div>`}_getSelectionSetIds(e){return e.workflowType!=="REFINE"?e.selectedIds:Object.keys(e.refineInfos).reduce((t,i)=>[...t,...e.refineInfos[i].addIds],[])}_hasSelections(e=!1){let t=[],i=this._selectionSets.some(s=>s.workflowType==="REFINE"?(t=this._getSelectionSetIds(s),!0):!1);return e&&i?t.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){let e=this._getExportInfos(),t=this.mapView?.map&&await P(this.mapView.map,e),i=t&&O(t);return t&&i?t.length-i.length:0}_getExportInfos(){return this._selectionSets.reduce((e,t)=>{if(t.download)if(t.workflowType!=="REFINE"&&t?.layerView){let i=t.layerView.layer.id;i!==void 0&&this._updateIds(i,t.layerView,t.selectedIds,e)}else Object.keys(t.refineInfos).forEach(i=>{let s=t.refineInfos[i];s.addIds.length>0&&this._updateIds(i,s.layerView,s.addIds,e)});return e},{})}_updateIds(e,t,i,s){return s[e]?s[e].ids=s[e].ids.concat(i):s[e]={layerView:t,ids:i},s}_getSelectPage(){let e=this._translations.selectSearchTip;return l`<calcite-panel>${this._getLabel(this._translations?.stepTwoFull,!0,"header-label")}${this._getNotice(e,"padding-1","word-wrap-anywhere")}<div><map-select-tools .bufferColor=${this.bufferColor} .bufferOutlineColor=${this.bufferOutlineColor} class="" .customLabelEnabled=${this.customLabelEnabled} .defaultBufferDistance=${this.defaultBufferDistance} .defaultBufferUnit=${this.defaultBufferUnit} .enableLayerFeatures=${this.enableLayerFeatures} .enableLayerFeaturesOnLoad=${this.enableLayerFeaturesOnLoad} .enableSearchDistance=${this.enableSearchDistance} .enableSearchDistanceOnLoad=${this.enableSearchDistanceOnLoad} .enableSketchTools=${this.enableSketchTools} .enabledLayerIds=${this.addresseeLayerIds} header-label-class .isUpdate=${!!this._activeSelection} .mapView=${this.mapView} .noResultText=${this.noResultText} @selectionSetChange=${this._updateForSelection} .searchConfiguration=${this._searchConfiguration} .searchDistanceEnabled=${this.enableSearchDistanceOnLoad} .selectionLayerIds=${this.selectionLayerIds} .selectionSet=${this._activeSelection} .sketchLineSymbol=${this.sketchLineSymbol} .sketchPointSymbol=${this.sketchPointSymbol} .sketchPolygonSymbol=${this.sketchPolygonSymbol} .useLayerFeaturesEnabled=${this.enableLayerFeaturesOnLoad} ${d(this._selectTools)}></map-select-tools></div>${this._getPageNavButtons(this._translations.done,this._numSelected===0,()=>{this._saveSelection()},this._translations.cancel,!1,()=>{this._home()})}</calcite-panel>`}_getExportPage(){let e=this._hasSelections(this.showRefineSelection),t=this._numDuplicates>0?"display-block":"display-none",i=this.customExport&&this.customExportURL&&this._layoutTemplates.length;return l`<calcite-panel><div>${this._getLabel(this._translations.export,!1,"header-label")}${e?l`<div>${this._getNotice(this._translations.exportTip,"padding-sides-1")}${this._getLabel(this._translations.exportListsLabel,!1,"")}${this._getExportSelectionLists()}<div class=${`padding-sides-1 ${t}`}><div class="display-flex"><calcite-label layout=inline><calcite-checkbox ${d(this._removeDuplicates)}></calcite-checkbox><div class="display-flex">${this._translations.removeDuplicate}<div class="info-message padding-start-1-2"><calcite-input-message class="info-blue margin-top-0" scale=m>${` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`}</calcite-input-message></div></div></calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=remove-duplicates-icon scale=s></calcite-icon></div><calcite-popover closable label overlay-positioning=fixed reference-element=remove-duplicates-icon><span class="tooltip-message">${this._translations.duplicatesTip}</span></calcite-popover></div><div class="border-bottom"></div><div class="segmented-controls padding-top-sides-1">${this._getLabel(this._translations.exportOptions,!0,"","margin-bottom-0-5")}${this._getSegmentedControls()}</div>${i?this._getCustomPrintOptions():l`<div class="padding-1 padding-bottom-0">${this._getExportOptions()}</div>`}<div class="padding-1 display-flex"><calcite-button .disabled=${!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults} .loading=${this._fetchingData} @click=${()=>this._segmentType==="CUSTOM"?this._customExport():void this._standardExport()} width=full><span class="font-weight-500">${this._translations.export}</span></calcite-button></div></div>`:this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")}</div></calcite-panel>`}_customExport(){if(!this.mapView)return;let e=this.layoutTemplateSelectRef.value?this.layoutTemplateSelectRef.value.selectedOption.value:"",t=this.reportTemplateSelectRef.value?this.reportTemplateSelectRef.value.selectedOption.value:"";this._fetchingData=!0;let i=this._reportTemplatesInfo.find(n=>n.reportTemplate===t),s=i?{...i.reportOptions}:{},a=this._selectedReportingLayerId;s?.reportSectionOverrides&&Object.keys(s.reportSectionOverrides).forEach(n=>{s.reportSectionOverrides[n].sourceId=a});let o=new G({layout:e,report:t,format:"pdf",layoutOptions:{titleText:this._titleElement.value?.value},reportOptions:s}),c=new M({view:this.mapView,template:o});N.execute(this.customExportURL,c).then(n=>{let g=this._titleValue;if(!g){let r=this._getSelectionIdsAndViews(this._selectionSets,!0),_=R(r);g=D(_)}n.url&&g&&this._downloadCustomPDF(n.url,g),this._fetchingData=!1}).catch(n=>{this._fetchingData=!1,console.error(n)})}async _downloadCustomPDF(e,t){try{let i=await fetch(e);if(!i.ok)throw new Error(`Failed to fetch PDF: ${i.statusText}`);let s=await i.blob(),a=window.URL.createObjectURL(s),o=document.createElement("a");o.href=a,o.download=t||"download.pdf";let c=document.getElementById("custom-export-div");c&&(c.appendChild(o),o.click(),window.URL.revokeObjectURL(a),c.removeChild(o))}catch(i){console.error("Download failed:",i)}}_exportTypeChange(e){this._exportType=e.target.value}_segmentTypeChange(e){this._titleValue="",this._segmentType=e.target.value}_getSegmentedControls(){return this.customExport&&this.customExportURL&&this._layoutTemplates.length?this._getStandardAndCustomSegmentedControl():this._getPDFAndCSVSementedControl()}_getPDFAndCSVSementedControl(){return l`<calcite-segmented-control class="w-100 calcite-segments" @calciteSegmentedControlChange=${this._exportTypeChange} width=full><calcite-segmented-control-item .checked=${this._exportType==="PDF"} class="w-50 end-border" value=PDF><span class="font-weight-500">${this._translations.pdf}</span></calcite-segmented-control-item><calcite-segmented-control-item .checked=${this._exportType==="CSV"} class="w-50" value=CSV><span class="font-weight-500">${this._translations.csv}</span></calcite-segmented-control-item></calcite-segmented-control>`}_getStandardAndCustomSegmentedControl(){return l`<calcite-segmented-control class="w-100 calcite-segments" @calciteSegmentedControlChange=${this._segmentTypeChange} width=full><calcite-segmented-control-item .checked=${this._segmentType==="STANDARD"} class="w-50 end-border" value=STANDARD><span class="font-weight-500">${this._translations.standard}</span></calcite-segmented-control-item><calcite-segmented-control-item .checked=${this._segmentType==="CUSTOM"} class="w-50" value=CUSTOM><span class="font-weight-500">${this._translations.custom}</span></calcite-segmented-control-item></calcite-segmented-control>`}_getCustomPrintOptions(){return this._segmentType==="STANDARD"?this._getStandardExportOptions():this._getCustomExportOptions()}_getStandardExportOptions(){return l`<div class="padding-1 padding-bottom-0"><calcite-label layout=inline alignment=start scale=m><calcite-radio-button .checked=${this._exportType==="PDF"} scale=m value=PDF @calciteRadioButtonChange=${this._exportTypeChange}></calcite-radio-button>${this._translations.pdf}</calcite-label><div class=indent-group>${this._getExportOptions()}</div><calcite-label layout=inline class="margin-top-1" alignment=start scale=m><calcite-radio-button .checked=${this._exportType==="CSV"} scale=m value=CSV @calciteRadioButtonChange=${this._exportTypeChange}></calcite-radio-button>${this._translations.csv}</calcite-label></div>`}_getCustomExportOptions(){let e=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",t=[],i=this._getSelectionIdsAndViews(this._selectionSets,!0);return Object.keys(i).forEach(s=>{i[s].ids.length&&t.push(s)}),l`<div id=custom-export-div class="padding-top-sides-1"><p class="instructional-text">${this._translations.formattingTip}</p>${t.length>1&&l`<p class="instructional-text margin-top-0-5">${this._translations.selectMatchingInputLayersLabel}</p>`||""}<div class=${"margin-top-1"}>${this._getLabel(this._translations.title,!0,"","none")}<calcite-input-text class="padding-inline-start-0 padding-top-1-2" @calciteInputTextInput=${()=>this._changeTitle()} .placeholder=${this._translations.titlePlaceholder} .value=${e} ${d(this._titleElement)}></calcite-input-text></div><div class=${"margin-top-1"}>${this._getLabel(this._translations.layoutTemplate,!0,"","none")}</div><calcite-select class="padding-inline-start-0 padding-top-1-2" label ${d(this.layoutTemplateSelectRef)}>${this._layoutTemplates.map((s,a)=>l`<calcite-option .selected=${a===0} .value=${s}>${s}</calcite-option>`)}</calcite-select>${this._reportTemplates?.length&&l`<div class=${"margin-top-1"}>${this._getLabel(this._translations.reportTemplate,!0,"","none")}</div><calcite-select class="padding-inline-start-0 padding-top-1-2" label ${d(this.reportTemplateSelectRef)}>${this._reportTemplates.map((s,a)=>l`<calcite-option .selected=${a===0} .value=${s}>${s}</calcite-option>`)}</calcite-select><div class=${"padding-top-sides-1 padding-inline-start-0 display-flex margin-bottom-0-5"}><calcite-label class="label-margin-0" layout=inline>${this._translations.reportLayer}</calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=information id=filter-message-info scale=s></calcite-icon><calcite-popover closable label overlay-positioning=fixed reference-element=filter-message-info><span class="tooltip-message">${this._translations.sourceLayerWarning}</span></calcite-popover></div><map-layer-picker .disabled=${t.length<=1} .enabledLayerIds=${t} .mapView=${this.mapView} @layerSelectionChange=${s=>{this._selectedReportingLayerId=s.detail[0]}} .selectedIds=${[this._selectedReportingLayerId]}></map-layer-picker>`||""}</div>`}async _setTemplates(){let e=this.customExportURL,t=`${e.split("/GPServer")?.[0]}/GPServer`;try{let i=await this.getTasksInfo(t),s="",a=i.tasks?.map(async r=>{await this.getTaskType(r,t)==="GetReportTemplatesInfo"&&(s=`${t}/${r}`)});a&&await Promise.all(a),s&&i.executionType&&await this._fetchReportTemplates(s,i.executionType);let o=(await f(e,{authMode:"auto",responseType:"json",query:{f:"json"}}))?.data,c=o.parameters.find(r=>r.name==="Layout_Template"&&Array.isArray(r.choiceList)),n=o.parameters.find(r=>r.name==="Report_Template"&&Array.isArray(r.choiceList));this._layoutTemplates=c?c.choiceList:[];let g=n?n.choiceList:[];this._reportTemplates=this._reportTemplatesInfo.length?g.filter(r=>this._reportTemplatesInfo.some(_=>_.reportTemplate===r)):[]}catch(i){console.error(i)}}async getTaskType(e,t){if(!e||!t)return Promise.resolve("");let i=`${t}/${e}`;try{let s=(await f(i,{authMode:"auto",responseType:"json",query:{f:"json"}}))?.data?.name||"";return Promise.resolve(s)}catch(s){return console.error(s),Promise.resolve("")}}async getTasksInfo(e){if(!e)return Promise.resolve({});let t=`${e}?f=json`,i={authMode:"auto",responseType:"json",query:{f:"json"}};try{let s=(await f(t,i))?.data,a=s?.tasks,o=s?.executionType==="esriExecutionTypeSynchronous"?"execute":"submitJob";return{tasks:a,supportedOperations:o,executionType:s?.executionType}}catch(s){return console.error(s),{}}}async _fetchReportTemplates(e,t){if(e)try{if(t==="esriExecutionTypeSynchronous"){let i=(await u.execute(e,{}))?.results?.find(s=>s.paramName==="Output_JSON");this._reportTemplatesInfo=i?.value??[]}else{let i=await u.submitJob(e,{});await i.waitForJobCompletion();let s=await i.fetchResultData("Output_JSON");this._reportTemplatesInfo=s?.value??[]}this._reportTemplatesInfo=this._reportTemplatesInfo.filter(i=>{let s=i.reportOptions;if(s?.reportSectionOverrides){let a=0;return Object.keys(s.reportSectionOverrides).forEach(o=>{s.reportSectionOverrides[o].hasOwnProperty("sourceId")&&a++}),a<=1}else return!0})}catch(i){console.error("Failed to fetch report templates:",i)}}_getExportOptions(){let e=this._exportType==="PDF"?"display-block":"display-none",t=this._addTitle?"display-block":"display-none",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",a=this._addResults?"":"display-none";return l`<div class=${p(e)}><p class="instructional-text">${this._translations.selectContentTip}</p><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addResults} @calciteCheckboxChange=${()=>this._addResults=!this._addResults}></calcite-checkbox>${this._translations.addResults}</calcite-label></div><div class=${`indent-group margin-top-1 ${a}`}><div class="margin-bottom-0-5"><calcite-label class="label-margin-0">${this._translations.selectPDFLabelOption}</calcite-label></div><div><pdf-download .defaultNumLabelsPerPage=${Number.parseInt(this.defaultNumLabelsPerPage.toString(),10)} .disabled=${!this._downloadActive} ${d(this._downloadTools)}></pdf-download></div></div><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addTitle} @calciteCheckboxChange=${()=>this._addTitle=!this._addTitle}></calcite-checkbox>${this._translations.title}</calcite-label></div><div class=${`${t} indent-group margin-top-0-5`}><calcite-input-text class="padding-inline-start-0 padding-top-1-2" @calciteInputTextInput=${()=>this._changeTitle()} .placeholder=${this._translations.titlePlaceholder} .value=${s} ${d(this._titleElement)}></calcite-input-text></div><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addMap} @calciteCheckboxChange=${()=>this._handleAddMapChange()}></calcite-checkbox>${this._translations.includeMap}</calcite-label></div><div class=${`padding-top-sides-1 padding-inline-start-0 ${i}`}><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._exportGraphics} @calciteCheckboxChange=${()=>this._handleExportGraphicsChange()}></calcite-checkbox>${this._translations.listGraphics}</calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=list-graphics-icon scale=s></calcite-icon><calcite-popover closable label overlay-positioning=fixed reference-element=list-graphics-icon><span class="tooltip-message">${this._translations.listGraphicsTip}</span></calcite-popover></div></div>`}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(e){let t,i=this._pnStateContextProvider.value;return Object.keys(i.managedLayers).some(s=>{let a=this.mapView?.map.layers.findIndex(o=>o.title===s);return i.managedLayers[s]===e&&a!==void 0?(t=this.mapView?.map.layers.getItemAt(a),!0):!1}),t}_updateExportGraphics(e=!1){(e||!this._exportGraphics||!this._addMap)&&this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){let e=this._getManagedLayer("sketch"),t=this._getManagedLayer("buffer");e&&e.graphics.removeAll(),t&&t.graphics.removeAll()}_addExportGraphics(){let e=this._getManagedLayer("sketch"),t=this._getManagedLayer("buffer");this._refineGraphics.forEach(i=>{e?.add(i.drawnGraphic),t?.add(i.bufferGraphic)}),this._selectionSets.forEach(i=>{if(i.download&&(e&&i.sketchGraphic&&e.graphics.add(i.sketchGraphic),t)){let s={type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}},a=new A({geometry:i.buffer,symbol:s});a&&t.graphics.add(a)}})}_getRefinePage(){let e=this._hasSelections();return l`<calcite-panel>${this._getLabel(this._translations.refineSelection,!1,"header-label")}${e?l`<div>${this._getNotice(this._translations.refineTip,"padding-sides-1")}<refine-selection .enabledLayerIds=${this.selectionLayerIds} .mapView=${this.mapView} .drawnGraphicsArr=${this._refineGraphics} .selectionSets=${this._selectionSets} .sketchLineSymbol=${this.sketchLineSymbol} .sketchPointSymbol=${this.sketchPointSymbol} .sketchPolygonSymbol=${this.sketchPolygonSymbol} .bufferColor=${this.bufferColor} .bufferOutlineColor=${this.bufferOutlineColor} .defaultBufferDistance=${this.defaultBufferDistance} .defaultBufferUnit=${this.defaultBufferUnit} .enableSearchDistance=${this.enableSearchDistance} .enableSearchDistanceOnLoad=${this.enableSearchDistanceOnLoad} .searchDistanceEnabled=${this.enableSearchDistanceOnLoad} ${d(this._refineSelection)}></refine-selection></div>`:this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1")}</calcite-panel>`}_getPageNavButtons(e,t,i,s,a,o){return l`<div class="padding-bottom-1"><div class="display-flex padding-top-sides-1"><calcite-button .disabled=${t} @click=${i} width=full><span class="font-weight-500">${e}</span></calcite-button></div><div class="display-flex padding-top-1-2 padding-sides-1"><calcite-button appearance=outline .disabled=${a} @click=${o} width=full><span class="font-weight-500">${s}</span></calcite-button></div></div>`}_changeTitle(){this._titleElement.value?.value&&(this._titleValue=this._titleElement.value.value||"")}_getNotice(e,t="padding-1",i=""){return l`<calcite-notice class=${p(t)} icon=lightbulb kind=success open><div class=${p(i)} slot=message>${e}</div></calcite-notice>`}_getLabel(e,t=!1,i="font-bold",s="padding-top-sides-1"){return i+=t?" label-margin-0":"",l`<div class=${p(s)}><calcite-label class=${p(i)}>${e}</calcite-label></div>`}_getExportSelectionLists(){return this._selectionSets.reduce((e,t)=>{let i=this._getSelectionSetIds(t),s=t.workflowType!=="REFINE"||i.length>0;return!this._downloadActive&&t.download&&s&&(this._downloadActive=!0),s&&e.push(l`<div class="display-flex padding-sides-1 padding-bottom-1"><calcite-checkbox .checked=${t.download} class="align-center" @calciteCheckboxChange=${()=>{this._toggleDownload(t.id)}}></calcite-checkbox><calcite-list class="list-border margin-start-1-2 width-full" id=download-list label><calcite-list-item .disabled=${!t.download} .label=${t.label} @click=${()=>{this._toggleDownload(t.id)}}><div slot=content><div class="list-label">${t.label}</div><div class="list-description">${t.layerView?.layer.title}</div><div class="list-description">${this._translations.selectedFeatures.replace("{{n}}",i.length.toString())}</div></div></calcite-list-item></calcite-list></div>`),e},[])||l`<div></div>`}async _toggleDownload(e){let t=!1;this._selectionSets=this._selectionSets.map(i=>{let s=!1;return i.refineInfos&&Object.keys(i.refineInfos).forEach(a=>{i.refineInfos[a].addIds.length&&(s=!0)}),(i.workflowType!=="REFINE"||s)&&(i.download=i.id===e?!i.download:i.download,t=i.download?!0:t),i}),this._updateExportGraphics(!0),this._downloadActive=t,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _standardExport(){let e=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType==="PDF"){let t="";this._addMap&&this.mapView&&(t=(await this.mapView.takeScreenshot({width:1500,height:2e3}))?.dataUrl),this._fetchingData=!0,this._downloadTools.value&&this._removeDuplicates.value&&this.mapView?.map&&await this._downloadTools.value.downloadPDF(this.mapView.map,e,this._removeDuplicates.value.checked,this._addTitle&&this._titleElement.value?this._titleElement.value.value:"",t),this._fetchingData=!1}this._exportType==="CSV"&&(this._fetchingData=!0,this._downloadTools.value&&this.mapView?.map&&await this._downloadTools.value.downloadCSV(this.mapView.map,e,this._removeDuplicates.value?.checked||!1),this._fetchingData=!1)}_getSelectionIdsAndViews(e,t=!1){return(t?e.filter(i=>i.download):e).reduce((i,s)=>{if(s.workflowType==="REFINE")Object.keys(s.refineInfos).forEach(a=>{let o=s.refineInfos[a];if(o.addIds){let c=o.layerView.layer.id;i=this._updateExportInfos(i,c,s.label,o.addIds,o.layerView)}});else{let a=s?.layerView?.layer.id;a!==void 0&&s.layerView&&(i=this._updateExportInfos(i,a,s.label,s.selectedIds,s.layerView))}return i},{})}_updateExportInfos(e,t,i,s,a){return t&&Object.keys(e).indexOf(t)>-1?(e[t].ids=[...new Set([...e[t].ids,...s])],e[t].selectionSetNames.push(i)):t&&(e[t]={ids:s,layerView:a,selectionSetNames:[i]}),e}_getAction(e,t,i,s,a=!1,o=""){return l`<calcite-action appearance=solid .disabled=${!e} .icon=${t} icon-flip-rtl .indicator=${a} @click=${s} slot=${o??m} .text=${i}></calcite-action>`}_updateForSelection(e){this._numSelected=e.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType("LIST")}async _saveSelection(){let e=await this._selectTools.value?.getSelection();if(e){let t=this._selectTools.value?.isUpdate;this._selectionSets=t?this._selectionSets.map(i=>i.id===e.id?e:i):[...this._selectionSets,e]}return this._home()}async _clearSelection(){await this._selectTools.value?.clearSelection(),this._numSelected=0,this._activeSelection=void 0}async _deleteSelection(e,t){return t.stopPropagation(),this._selectionSets=this._selectionSets.filter((i,s)=>(i.workflowType==="REFINE"&&(this._refineGraphics=[]),s!==e?i:!1)),this._highlightFeatures()}_gotoSelection(e,t){e.selectedIds&&e.layerView&&I(e.selectedIds,e.layerView,t,this.featureHighlightEnabled,this.featureEffect)}_openSelection(e,t){t.stopPropagation(),this._activeSelection=e,this._pageType=e.workflowType==="REFINE"?"REFINE":"SELECT"}async _highlightFeatures(){let e=this._pnStateContextProvider.value;this._clearHighlight();let t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType==="EXPORT"),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){let a=t[i[s]];if(a.layerView&&this.mapView){let o=await C(a.ids,a.layerView,this.mapView);e.highlightHandles.push(o)}}}_checkPopups(){typeof this._popupsEnabled!="boolean"&&(this._popupsEnabled=!!this.mapView?.popupEnabled)}_clearHighlight(){let e=this._pnStateContextProvider.value;e&&e.highlightHandles&&e.removeHandles()}};T("public-notification",y);return y},"Graphic","rest/support/PrintTemplate","rest/support/PrintParameters","rest/print","rest/geoprocessor","request",a,b,c,e)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
+
import b from"./TAHIBODN.js";import"./WCGF6MFJ.js";import a from"./HHKKBJCY.js";import{b as D}from"./PZ4L77M5.js";import{Zb as I}from"./DD3JC2L3.js";import{a as f}from"./Y3XY5BXI.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as _}from"./S7XOHDIW.js";import{F as u,G as d,H as g,J as r,h as m,i as l,l as p,r as c}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([{K:w,b:b,y:y},{a:$,b:v}])=>{var C=m`*[tabindex]:focus-visible{outline-style:solid!important;outline-width:2px!important;outline-color:var(--calcite-color-brand)!important;outline-offset:2px!important}.deletion-note-text{display:inline-block}.deletion-note-container{display:flex;align-items:center;gap:var(--calcite-spacing-sm);font-size:var(--calcite-font-size-0);margin-bottom:var(--calcite-spacing-md)}.panel-bg-color{--calcite-panel-header-background-color: var(--calcite-color-foreground-1);--calcite-panel-background-color: var(--calcite-color-foreground-1)}.display-none{display:none}calcite-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.loader-text{margin-top:var(--calcite-spacing-md);margin-bottom:var(--calcite-spacing-xl);text-align:center;font-size:var(--calcite-font-size-relative-base);color:var(--calcite-color-text-1)}.padding-around{padding:12px 2rem 2rem}`,h=class extends g{constructor(){super(),this.open=!1,this.source="Card Dropdown",this._deletePercentage=0,this._fetchingTemplates=!1,this._isDeleteInProgress=!1,this._nonSolutionDependencyItems=[],this._showDeleteError=!1,this._showUndeletableItems=!1,this._templateInfos=[],this._translations=f({name:"solution-delete-dialog",blocking:!0}),this._accordion=u(),this._configContextConsumer=D({context:b,subscribe:!0}),this.solutionDeleteDialogOpen=c(),this.solutionDeleted=c(),this.solutionDeleteDialogBeforeClose=c(),this.listenOn(window,"beforeunload",t=>{this._isDeleteInProgress&&(t.preventDefault(),t.returnValue=!0)})}static{this.properties={card:0,open:5,source:1,_deletePercentage:16,_fetchingTemplates:16,_isDeleteInProgress:16,_nonSolutionDependencyItems:16,_showDeleteError:16,_showUndeletableItems:16,_templateInfos:16,_translations:16}}static{this.styles=C}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}close(){this._showUndeletableItems&&this.solutionDeleted.emit({showAlert:!1,refreshSolutionsTimeout:!0,solutionTitle:this.card?.title}),this._showDeleteError=!1,this._showUndeletableItems=!1,this._isDeleteInProgress=!1,this.open=!1,this.solutionDeleteDialogOpen.emit(!1)}delete(){if(this._telemetry?.logEvent({category:w.DEPLOYMENTS,action:"Delete Solution",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"",this.source]}),this._isDeleteInProgress=!0,this.card){let t=[{itemName:this.card.title,itemType:"Solution",owner:this.card.owner,modified:this.card.modified}],i={progressCallback:s=>{this._deletePercentage=Math.round(s)},solutionOwner:this.card.owner};I(this.card.id,this._configContextConsumer.value.userSession,i).then(s=>{let a=s[1],o;if(a?o=a.items.map(e=>({itemName:e.title,itemType:e.type,owner:e.owner,modified:e.modified})):o=t,o.length===0)this.solutionDeleted.emit({showAlert:!0,refreshSolutionsTimeout:!0,solutionTitle:this.card?.title}),this._isDeleteInProgress=!1,this.open=!1;else if(o.some(e=>e.itemType==="Solution"))this.card?v(this.card,this._configContextConsumer.value.userSession).then(e=>{this._templateInfos=e,this._showDeleteError=!0,this._showUndeletableItems=!0,this._isDeleteInProgress=!1}):(this._showDeleteError=!0,this._isDeleteInProgress=!1);else if(this.card){let e=[];e=a.items.map(n=>({id:n.id,title:n.title,type:n.type,owner:n.owner,modified:n.modified,typeKeywords:[],snippet:"",dependencies:[],url:y(n.id,this._configContextConsumer.value.authentication)})),this._templateInfos=e,this._showDeleteError=!1,this._showUndeletableItems=!0,this._isDeleteInProgress=!1}else this.solutionDeleted.emit({showAlert:!0,refreshSolutionsTimeout:!0}),this._isDeleteInProgress=!1,this.open=!1})}}willUpdate(t){if(t.has("open")){let i=t.get("open");this.open&&!i&&(this._fetchingTemplates=!0,$(this._configContextConsumer.value.userSession,this.card).then(s=>{this._templateInfos=s.templateInfos,this._nonSolutionDependencyItems=s._nonSolutionDependencyItems,this._fetchingTemplates=!1}))}}render(){let t=this._fetchingTemplates?"":"display-none",i=this._fetchingTemplates?"display-none":"",s=[...new Set(this._nonSolutionDependencyItems.map(e=>e.controlItemId))],a=this._templateInfos.length-this._getDependencyCount(),o=this._translations.deletionCount.replace("{{deleteableCount}}",a.toString()).replace("{{totalCount}}",this._templateInfos.length.toString());return l`<calcite-dialog class="panel-bg-color" .closeDisabled=${this._isDeleteInProgress} .escapeDisabled=${this._isDeleteInProgress} .heading=${this._translations.title.replace("{{solution}}",this.card?.title??"")} id=${this._translations.title.replace("{{solution}}",this.card?.title??"")??p} modal kind=danger .open=${this.open} width=l outside-close-disabled @calciteDialogBeforeClose=${()=>{this.solutionDeleteDialogBeforeClose.emit()}} @calciteDialogClose=${()=>{this.open=!1,this.solutionDeleteDialogOpen.emit(!1)}}>${this._isDeleteInProgress?l`<calcite-loader .label=${this._translations.deleteInProgress} scale=l type=determinate-value .value=${this._deletePercentage}></calcite-loader><div class="loader-text" tabindex=0>${this._translations.deleteInProgress}</div>`:this._showUndeletableItems?l`<calcite-label class=${r(i)} layout=inline><span tabindex=0>${this._translations.failedToDeleteItems}</span></calcite-label><solution-item-accordion class=${r(i)} .itemRelationshipDependencies=${[]} link-type=item list-selection-mode=multiple .reuseWarning=${this._translations.itemDependencyReusewarning} .templateInfos=${this._templateInfos} .typeKeywords=${this.card?.typeKeywords} ${d(this._accordion)}></solution-item-accordion><calcite-button appearance=outline @click=${this.close} slot=footer-end>${this._translations.buttonClose}</calcite-button>`:l`<div class="padding-around"><div class=${`deletion-note-container ${i}`}><span class="deletion-note-text" tabindex=0>${this._translations.deletionNote}</span><calcite-chip .label=${o} scale=m icon=information>${o}</calcite-chip></div><calcite-loader class=${r(t)} label></calcite-loader><solution-item-accordion class=${r(i)} .itemRelationshipDependencies=${s} link-type=item list-selection-mode=multiple .reuseWarning=${this._translations.itemDependencyReusewarning} .templateInfos=${this._templateInfos} .typeKeywords=${this.card?.typeKeywords} ${d(this._accordion)}></solution-item-accordion></div><calcite-button appearance=outline @click=${this.close} slot=footer-end>${this._translations.buttonCancel}</calcite-button><calcite-button @click=${()=>{this.delete()}} slot=footer-end kind=danger>${this._translations.buttonDelete}</calcite-button>${this._showDeleteError&&l`<calcite-alert icon=exclamation-mark-triangle kind=danger .label=${this._translations.failedToDelete} @calciteAlertClose=${()=>{this._showDeleteError=!1}} open><div slot=message>${this._translations.failedToDelete}</div></calcite-alert>`||""}`}</calcite-dialog>`}_getDependencyCount(){let t=this._nonSolutionDependencyItems.map(i=>i.controlItemId);return[...new Set(t)].length}};_("solution-delete-dialog",h);return h},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./TE7VJ4KH.js";import a from"./HHKKBJCY.js";import"./PZ4L77M5.js";import"./DD3JC2L3.js";import"./Y3XY5BXI.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import"./S7XOHDIW.js";import"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,a])=>{return a},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import b from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{b as l}from"./
|
|
2
|
+
import b from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{b as l}from"./S7XOHDIW.js";import{H as c,h as o,r as s,u as r}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([p,m,,{c:h}])=>{var d=o`@layer{:host{display:block;pointer-events:all!important}}`,a=class extends c{constructor(){super(...arguments),this.selectedLayerId="",this.tool="rectangle",this.drawingComplete=s(),this.featuresSelected=s()}static{this.properties={mapView:0,selectedLayerId:1,tool:1}}static{this.styles=d}static{this.shadowRootOptions=r}willUpdate(e){e.has("mapView")&&this.mapViewWatchHandler()}async mapViewWatchHandler(){await this.mapView?.when(()=>{this._initSketchViewModel()})}async toggleSelectionTool(e,t){if(this._graphicsLayer?.removeAll(),this._selectionTool?.state==="active"&&this._selectionTool.cancel(),t){let i=e??this.tool;this._selectionTool?.create(i)}}async loaded(){await this.init()}render(){return""}async init(){this.mapView&&this._initSketchViewModel()}_initSketchViewModel(){this._graphicsLayer=new p({listMode:"hide"}),this._selectionTool=new m({layer:this._graphicsLayer,view:this.mapView}),this._selectionTool&&this._selectionTool.on("create",e=>{if(e.state==="complete"){this.drawingComplete.emit();let t=e.graphic?.geometry;t&&this._selectFeatures(t),this._graphicsLayer&&this._graphicsLayer.removeAll()}}),this.mapView?.map&&this._graphicsLayer&&this.mapView.map.layers.add(this._graphicsLayer)}async _selectFeatures(e){let t=this.mapView&&await h(this.mapView,this.selectedLayerId);try{let i={geometry:e},n=t&&await t.queryObjectIds(i);this.featuresSelected.emit(n)}catch(i){console.error("Error selecting features:",i)}}};l("selection-tool",a);return a},"layers/GraphicsLayer","widgets/Sketch/SketchViewModel",a,b)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
+
import a from"./HHKKBJCY.js";import{ta as i}from"./DD3JC2L3.js";export default $arcgis.t(([{u:p}])=>{async function D(o,a){let r=await v(a,o),I=[],m=[],d=[],f=r.map(async e=>{let c=await h(e.id,"reverse","Solution2Item",o);return{template:e,relatedItems:c}}),u=await Promise.all(f);for(let{template:e,relatedItems:c}of u)for(let w of c){let s=[];for(let t of w.relatedItemIds)s.push({controlItemId:e.id,dependencyItemId:t});let S=s.reduce((t,n)=>(t[n.controlItemId]||(t[n.controlItemId]=new Set),t[n.controlItemId].add(n.dependencyItemId),t),{}),l=Object.entries(S).filter(([t,n])=>n.size>1).flatMap(([t,n])=>Array.from(n).map(g=>({controlItemId:t,dependencyItemId:g})));l.length>0&&(d=d.concat(l))}m=Array.from(new Map([...d].map(e=>[`${e.controlItemId}:${e.dependencyItemId}`,e])).values());let y=m.map(e=>e.controlItemId);return I=[...new Set(y)],{uniqueIitemIds:I,_nonSolutionDependencyItems:m,templateInfos:r}}async function h(o,a,r,I){let m=await i(o,r,a,I);return[{relationshipType:r,relatedItemIds:m.relatedItems.map(d=>d.id)}]}async function v(o,a){return await p(o.id,a)}return{a:D,b:v}},a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
+
import a from"./HHKKBJCY.js";import{b as r}from"./PZ4L77M5.js";import{a as b}from"./Y3XY5BXI.js";import{b as g}from"./S7XOHDIW.js";import{F as o,G as s,H as p,K as u,h as d,i,j as h,r as l}from"./46DQNAMV.js";export default $arcgis.t(([{a:v,b:f,t:m}])=>{var x=d`calcite-shell-panel{z-index:var(--calcite-z-index-1)}.display-flex{display:flex}.flex-1,.flex-grow{flex:1}.flex-shrink-0{flex:0 0 auto}.leader-1{margin-top:var(--calcite-spacing-xxl)}.trailer-1{margin-bottom:var(--calcite-spacing-xxl)}.warning-text{max-width:35em;margin-left:auto;margin-right:auto;font-size:var(--calcite-font-size-md)}.text-center{text-align:center}.border-override{border-top-width:var(--calcite-border-width-none);border-bottom-width:var(--calcite-border-width-none)}.header-override{--calcite-panel-header-content-space: var(--calcite-spacing-none);--calcite-panel-header-background-color: var(--calcite-color-foreground-2)}.panel-override{--calcite-panel-background-color: var(--calcite-color-foreground-2);--calcite-panel-border-color: none}.label-override{--calcite-label-margin-bottom: var(--calcite-spacing-none);font-weight:var(--calcite-font-weight-medium)}.header-content-wrapper{padding-inline-start:var(--calcite-spacing-xxs)}.header-button-padding{padding-top:var(--calcite-spacing-sm);padding-bottom:var(--calcite-spacing-sm);padding-inline-start:var(--calcite-spacing-lg);padding-inline-end:var(--calcite-spacing-lg)}.padding-start{padding-inline-start:var(--calcite-spacing-lg)}.align-items-center{align-items:center}.justify-content-end{justify-content:end}.justify-content-start{justify-content:start}.filter-width-350{--calcite-shell-panel-width: 350px}.z-index-2{z-index:2}.mock-fab{--calcite-fab-shadow-internal: 0 6px 20px -4px rgba(0, 0, 0, .1), 0 4px 12px -2px rgba(0, 0, 0, .08);box-shadow:var(--calcite-fab-shadow, var(--calcite-fab-shadow-internal));--calcite-button-background-color: var(--calcite-fab-background-color);--calcite-button-border-color: var(--calcite-fab-border-color);--calcite-button-text-color: var(--calcite-fab-text-color);--calcite-button-loader-color: var(--calcite-fab-loader-color)}.position-relative{position:relative}.height-100{height:100%}.height-50{height:50px}.sign-in-prompt{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%}.sign-in-icon{transform:translate(-20px)}.height-150{height:150px}.width-150{width:150px}.padding-top-8{padding-top:8px}`,c=class extends p{constructor(){super(),this.solutionsCount=0,this.filterOpen=!0,this.isMobile=!1,this._showAlertFailed=!1,this._translations=b({name:"solutions-deployed-shell",blocking:!0}),this._configContextConsumer=r({context:f,subscribe:!0}),this._deployedCardFetchFailedMessage="",this._deployedCardFetchFailedTitle="",this._isMobileContextConsumer=r({context:v,subscribe:!0,callback:e=>this.isMobile=e}),this._solutionsDeployedPanelRef=o(),this._mainPanelRef=o(),this._panelFixed=!1,this.filterRemoved=l(),this.tokenRefreshed=l(),this._handleSignIn=()=>{let e=window.location.pathname.endsWith("deployments")?"":"deployments";this._configContextConsumer.value?.authentication?.signIn(e)},this.listenOn(window,"deployedCardFetchFailed",e=>{let t=e.detail;this._deployedCardFetchFailedTitle=t.title,this._deployedCardFetchFailedMessage=t.message,this._showAlertFailed=!0})}static{this.properties={solutionsCount:9,filterOpen:16,isMobile:16,_showAlertFailed:16,_translations:16}}static{this.styles=x}willUpdate(e){e.has("isMobile")&&(this.filterOpen=!this.isMobile)}async searchSolutions(e){this._solutionsDeployedPanelRef.value?.setSearchOptions(e),("sortType"in e||"searchTerm"in e)&&this._solutionsDeployedPanelRef.value?.searchSolutions(e)}async load(){this._isMobileContextConsumer.value&&(this.isMobile=this._isMobileContextConsumer.value)}updated(){this._fixPanelContentWrapperFocus()}_fixPanelContentWrapperFocus(){if(!this._panelFixed&&this._mainPanelRef.value){let e=this._mainPanelRef.value;e.componentOnReady?.().then(()=>{if(e.shadowRoot){let t=e.shadowRoot.querySelector(".content-wrapper");t&&(t.tabIndex=-1,this._panelFixed=!0,this._setupPanelObserver())}}).catch(()=>{this._panelFixed=!0})}}_setupPanelObserver(){if(this._panelObserver)return;this._panelObserver=new MutationObserver(t=>{t.forEach(a=>{if(a.type==="attributes"&&a.attributeName==="tabindex"){let n=a.target;n.classList.contains("content-wrapper")&&n.tabIndex===0&&(n.tabIndex=-1)}})});let e=this._mainPanelRef.value;if(e?.shadowRoot){let t=e.shadowRoot.querySelector(".content-wrapper");t&&this._panelObserver.observe(t,{attributes:!0,attributeFilter:["tabindex"]})}}disconnectedCallback(){super.disconnectedCallback(),this._panelObserver?.disconnect()}render(){if(!this._configContextConsumer.value?.authentication?.IsSignedIn)return this._getSignInPrompt();let e=this.isMobile?"justify-content-start":"";return i`<calcite-shell class="position-relative"><calcite-panel class="border-override header-override panel-override z-index-1" ${s(this._mainPanelRef)}><div class=${`display-flex align-items-center height-50 header-content-wrapper ${e}`} slot=header-content><calcite-label class="label-override flex-shrink-0 padding-top-8" layout=inline>${this._translations.numberOfDeployments?.replace("{{count}}",this.solutionsCount.toString())}</calcite-label></div>${this._getSolutionsDeployedPanel()}</calcite-panel></calcite-shell>`}_getSignInPrompt(){return i`<div class="sign-in-prompt">${this._getSignInIcon()}<div class="text-center leader-1 warning-text trailer-1">${this._translations.signInMessage}</div><calcite-button appearance=outline @click=${this._handleSignIn} @keydown=${e=>m(e,()=>this._handleSignIn())} scale=l>${this._translations.signIn}</calcite-button></div>`}_getSolutionsDeployedPanel(){let e=this.isMobile&&this.filterOpen?{display:"none"}:"";return i`<div><solutions-deployed-panel @deployedCardsFetched=${this._updateSolutionCount} style=${u(e)} ${s(this._solutionsDeployedPanelRef)}></solutions-deployed-panel><calcite-alert icon=exclamation-mark-triangle kind=danger .label=${this._deployedCardFetchFailedTitle} @calciteAlertClose=${()=>{this._showAlertFailed=!1}} .open=${this._showAlertFailed}><div slot=title>${this._deployedCardFetchFailedTitle}</div><div slot=message>${this._deployedCardFetchFailedMessage}</div></calcite-alert></div>`}_updateSolutionCount(e){this.solutionsCount=e.detail}_getSignInIcon(){return i`<div class="sign-in-icon"><svg viewBox="0 0 64 64" width=200 height=200 xmlns=http://www.w3.org/2000/svg>${h`<path d="M56.9 4.1V60h-.8V4.9H23.3l25.6 7.47v39.26l-28.8 8.4V35h.8v23.97l27.2-7.94V12.97L20.9 5.03V30h-.8V4.1h36.8zM30.735 41.7l.565.566 9.766-9.766-9.766-9.766-.565.567 8.799 8.799H5v.8h34.534l-8.8 8.8z" fill=var(--calcite-color-text-3) />`}</svg></div>`}};g("solutions-deployed-shell",c);return c},a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./PAKIDHHK.js";import a from"./HHKKBJCY.js";import{b as f}from"./PZ4L77M5.js";import"./DD3JC2L3.js";import{a as u}from"./Y3XY5BXI.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as m}from"./S7XOHDIW.js";import{H as h,J as p,L as o,h as n,i as t,r as d}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([{K:x,b:g,t:b},{f:v}])=>{var S=n`calcite-card{height:100%;padding-bottom:2px;border:2px solid transparent;transition:border-color .1s ease;box-sizing:border-box}@media(max-width:400px){calcite-card{width:100%}}calcite-card:hover img{-webkit-filter:brightness(30%);filter:brightness(30%);-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;-ms-transition:all .1s ease;transition:all .1s ease}calcite-card:hover .hover-text{opacity:1;color:#fff}calcite-card:hover{border-color:var(--calcite-color-brand);cursor:pointer}.chip-status{--calcite-chip-icon-color: var(--calcite-color-brand);cursor:pointer}.chip-deployed{--calcite-chip-icon-color: var(--calcite-color-status-success)}.hover-text{transition:.1s ease;opacity:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;display:flex;flex-direction:row;align-items:center;height:100%;font-size:1.2rem}.font-color-text-2{--calcite-label-text-color: var(--calcite-color-text-2)}.font-line-height{line-height:1.4}.font-size-size--1{font-size:var(--calcite-font-size--1)}.header-line-height{--calcite-label-margin-bottom: 0;margin-top:.5rem;margin-bottom:.7rem}.info-icon{--calcite-icon-color: var(--calcite-color-text-inverse);padding-inline-end:.3rem}.card-image-wrap{flex:0 0 auto}.card-image-wrap{width:100%;position:relative;margin-bottom:0;-webkit-box-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.card-image{width:100%;display:block}video,img{max-width:100%;height:auto}img{overflow-clip-margin:content-box;overflow:clip}a{text-decoration:none;color:inherit;outline:0;padding:0;margin:0;display:inherit;height:100%}`,l=class extends h{constructor(){super(...arguments),this.referrerSolutionId="",this.referrerSolutionTitle="",this.referrerSolutionVersion="",this.source="all-solutions",this._translations=u({name:"solution-details-card",blocking:!0}),this._configContextConsumer=f({context:g,subscribe:!0}),this.detailsCardSelected=d()}static{this.properties={card:0,referrerSolutionId:1,referrerSolutionTitle:1,referrerSolutionVersion:1,source:1,_translations:16}}static{this.styles=S}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}render(){let e=v(this.card.title);return t`<a href=${e??o} @click=${this._anchorClick} tabindex=-1 .title=${`${this._translations.arcgisSolutions} | ${this.card.title}`}>${this._renderCard()}</a>`}_anchorClick(e){e.preventDefault()}_cardSelected(){if(this.source==="you-may-also-like"){let e=[this.referrerSolutionTitle,this.referrerSolutionId,this.referrerSolutionVersion,this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""];this._telemetry?.logEvent({category:x.SOLUTION_DETAILS,action:"Related Solution",dimensions:e})}this.detailsCardSelected.emit(this.card)}_renderChips(e){let r=e.includes("deployed"),y=e.filter(i=>i!=="deployed"),a=[];return y.forEach(i=>{let $="chip-status",c=`solution-details-card-chip-${i}`,_=i==="new"?"star":"mega-phone",s=i==="new"?this._translations.newSolution:this._translations.updated;a.push(t`<calcite-chip class=${p($)} .icon=${_} id=${c??o} .label=${s} .value=${s} scale=s></calcite-chip><calcite-tooltip .referenceElement=${c}><span>${s}</span></calcite-tooltip>`)}),r&&a.push(t`<calcite-chip class="chip-deployed" icon=check-circle id=solution-details-card-chip-deployed .label=${this._translations.deployed} .value=${this._translations.deployed} scale=s></calcite-chip><calcite-tooltip reference-element=solution-details-card-chip-deployed><span>${this._translations.deployed}</span></calcite-tooltip>`),a}_renderCard(){let e=this.card;return t`<calcite-card .label=${e.snippet} @click=${this._cardSelected} @keydown=${r=>b(r,()=>this._cardSelected())}><div class="card-image-wrap" slot=thumbnail><img alt=${e.title??o} class="thumbnail card-image" src=${e.thumbnailUrl??o}><div class="hover-text">${this._translations.viewDetails}</div></div><calcite-label slot=heading class="header-line-height" scale=l>${e.title}</calcite-label><p slot=description class="font-color-text-2 font-line-height font-size-size--1">${e.snippet}</p>${e.chips&&e.chips.length>0?t`<div slot=footer-end style="display: flex; gap: 0.5rem; justify-content: flex-end;">${this._renderChips(e.chips)}</div>`:void 0}<div slot=footer-start></div></calcite-card>`}};m("solution-details-card",l);return l},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./HHKKBJCY.js";import"./PZ4L77M5.js";import"./DD3JC2L3.js";import"./Y3XY5BXI.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import"./S7XOHDIW.js";import"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([{B:o}])=>{return o},a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import c from"./HATDZAP6.js";import b from"./NVYKJK26.js";import a from"./JJUJVV7A.js";import{b as C}from"./PZ4L77M5.js";import"./LHCWS2RN.js";import{a as w}from"./HA5W44KL.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as f}from"./2CMRI2B3.js";import{F as u,G as d,H as g,L as y,h as m,i as r,j as _,r as l}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([{H:c,K:n,L:T,b:v,q:x},,{a:h,b:b}])=>{var D=m`calcite-panel{width:100%;height:100%;--calcite-panel-background-color: var(--calcite-color-foreground-2)}.card-group{overflow:hidden;padding:.25rem var(--calcite-spacing-xxs) var(--calcite-spacing-md)}.text-center{text-align:center}.leader-1{margin-top:var(--calcite-spacing-xxl)}.trailer-1{margin-bottom:var(--calcite-spacing-xxl)}.warning-text{max-width:35em;margin-left:auto;margin-right:auto;font-size:var(--calcite-font-size-md)}.no-solutions{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;min-height:calc(100vh - 190px)}.display-flex{display:flex}.display-none{display:none}.flex-direction-column{flex-direction:column}h1{font-weight:unset;margin:0;padding:0}solution-deployed-card{width:calc(20% - .75rem)}@media(max-width:1280px){solution-deployed-card{width:calc(25% - .75rem)}}@media(max-width:1010px){solution-deployed-card{width:calc(33.333% - .75rem)}}@media(max-width:740px){solution-deployed-card{width:calc(50% - .75rem)}}@media(max-width:440px){solution-deployed-card{width:calc(100% - .75rem)}}.margin-top-half{margin-top:.5rem}`,S=5,p=class extends g{constructor(){super(),this.sortType="created",this._cards=[],this._cardsFetching=!1,this._modifiedCheckTry=0,this._newId="",this._refs={},this._showDeleteCompleteAlert=!1,this._deletedSolutionName="",this._translations=w({name:"solutions-deployed-panel",blocking:!0}),this._agoTerms=c,this._allCards=[],this._baseAgoTerms=c,this._categories=[],this._mainPanelRef=u(),this._panelFixed=!1,this._configContextConsumer=C({context:v,subscribe:!0,callback:async e=>{e&&(this._initCardsFetchers(),await this._getDeployedSolutions())}}),this._delay=!1,this._owner="My solutions",this._sortField="created",this._sortOrder="desc",this.deployedCardsFetched=l(),this.searchTermSet=l(),this.sortTypeSet=l(),this.listenOn(window,"solutionDeleted",e=>{this._modifiedCheckTry=S,this.reload(e.detail.showAlert,e.detail.refreshSolutionsTimeout,e.detail.solutionTitle)}),this.listenOn(window,"solutionConfigureDialogClose",e=>{e.detail&&this.reload(!1,!1)}),this.listenOn(window,"deployProgressEnd",e=>{this._modifiedCheckTry=S,this._refreshAfterDeploy(e.detail)}),this.listenOn(window,"sortTypeChanged",e=>{e.detail&&e.detail.scope==="deployments"&&(this.sortType=e.detail.sortType,this._telemetry?.logEvent({category:n.DEPLOYMENTS,action:"Sort",dimensions:[x(e.detail.sortType)]}),this.searchSolutions(e.detail))}),this.listenOn(window,"searchChanged",e=>{e.detail&&e.detail.scope==="deployments"&&(e.detail.logSearchTelemetry&&e.detail.option?.searchTerm?this._telemetry?.logEvent({category:n.DEPLOYMENTS,action:"Search",dimensions:[e.detail.option.searchTerm]}):this.searchSolutions(e.detail.option))})}static{this.properties={sortType:1,_cards:16,_cardsFetching:16,_modifiedCheckTry:16,_newId:16,_refs:16,_showDeleteCompleteAlert:16,_deletedSolutionName:16,_translations:16}}static{this.styles=D}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async reload(e=!0,t=!0,s){this._initCardsFetchers(),e&&(this._showDeleteCompleteAlert=!0,this._deletedSolutionName=s||this._translations.solution),t?setTimeout(()=>{(async()=>{try{await this._getDeployedSolutions()}catch(i){console.error("Error getting deployed solutions:",i)}})()},500):await this._getDeployedSolutions()}async searchSolutions(e){if(e){if("searchTerm"in e&&this._setSearchTerm(e.searchTerm||""),"sortType"in e&&this._setSortOptions(e),Object.keys(e).indexOf("type")>-1){let t=e;this._owner=t.value,this._telemetry?.logEvent({category:n.DEPLOYMENTS,action:"Filter",dimensions:[t.value==="My solutions"?"My content":"Organization"]})}if(Object.keys(e).indexOf("filter")>-1){let t=e;this._owner=t.filter===T.ORG?"My organization's solutions":"My solutions"}}else this._agoTerms=this._baseAgoTerms,this._clearFilterCategories();await this._getDeployedSolutions()}async setSearchOptions(e){e&&("searchTerm"in e&&(this._setSearchTerm(e.searchTerm),this.searchTermSet.emit({searchTerm:e.searchTerm,scope:"deployments"})),"sortType"in e&&(this._setSortOptions(e),this.sortTypeSet.emit({sortType:e.sortType,scope:"deployments"})))}updated(){this._fixPanelContentWrapperFocus()}_fixPanelContentWrapperFocus(){if(!this._panelFixed&&this._mainPanelRef.value){let e=this._mainPanelRef.value;e.componentOnReady?.().then(()=>{if(e.shadowRoot){let t=e.shadowRoot.querySelector(".content-wrapper");t&&(t.tabIndex=-1,this._panelFixed=!0,this._setupPanelObserver())}}).catch(()=>{this._panelFixed=!0})}}_setupPanelObserver(){if(this._panelObserver)return;this._panelObserver=new MutationObserver(t=>{t.forEach(s=>{if(s.type==="attributes"&&s.attributeName==="tabindex"){let i=s.target;i.classList.contains("content-wrapper")&&i.tabIndex===0&&(i.tabIndex=-1)}})});let e=this._mainPanelRef.value;if(e?.shadowRoot){let t=e.shadowRoot.querySelector(".content-wrapper");t&&this._panelObserver.observe(t,{attributes:!0,attributeFilter:["tabindex"]})}}disconnectedCallback(){super.disconnectedCallback(),this._panelObserver?.disconnect()}render(){return this._cardsFetching?r`<calcite-loader .label=${this._translations.fetchingDeployedSolutions}></calcite-loader>`:this._cards.length?r`<calcite-panel ${d(this._mainPanelRef)}><calcite-card-group class="card-group" .label=${this._translations.allDeployed}>${this._renderCards()}</calcite-card-group><calcite-alert auto-close auto-close-duration=fast icon=check-circle kind=success .label=${this._translations.deleteComplete.replace("{{solutionName}}",this._deletedSolutionName)} .open=${this._showDeleteCompleteAlert} @calciteAlertClose=${()=>{this._showDeleteCompleteAlert=!1}}><div slot=title>${this._translations.deleteComplete.replace("{{solutionName}}",this._deletedSolutionName)}</div></calcite-alert></calcite-panel>`:r`<div class="no-solutions">${this._getSolutionsBriefcase()}<div class="text-center leader-1 warning-text trailer-1 display-flex flex-direction-column"><div>${this._translations.noSolutionsFound}</div><div class="margin-top-half">${this._translations.noSolutionsInstruction}</div></div></div>`}_initCardsFetchers(){if(this._configContextConsumer.value){let e=this._configContextConsumer.value;this._cardsFetcher=new h(e.locale,e.orgUrl,e.portalURL),this._cardsFetcherDeployed=new h(e.locale,e.orgUrl,e.portalURL)}}_renderCards(){return this._refs={},this._cards.map(e=>r`<solution-deployed-card .card=${e} .deployedDate=${e.created} .description=${e.snippet} .diagramKey=${this._configContextConsumer.value?.diagramKey} .heading=${e.title} id=${e.id??y} .itemId=${e.id} .owner=${this._owner==="My solutions"?"":e.owner} .thumbnail=${e.thumbnailUrl} ${d(this._handleRefs)}></solution-deployed-card>`)}_handleRefs(e){e&&(this._refs[e.id]=e)}async _getDeployedSolutions(){let e=this._configContextConsumer.value.authentication;if(e.IsSignedIn){this._abortController?(this._abortController.abort("redundant request"),this._abortController=new AbortController):this._abortController=new AbortController,this._cardsFetching=!0;try{let t=await b(e,this._configContextConsumer.value.userSession,this._cardsFetcher,this._cardsFetcherDeployed,this._agoTerms,this._sortField,this._sortOrder,this._delay,this._categories,this._allCards,this._abortController.signal,this._owner);this._abortController=void 0,this._modifiedCheckTry>0&&(this._cards?.length===t?.cards?.length?(this._modifiedCheckTry--,this._getDeployedSolutions()):this._modifiedCheckTry=0),this._cards=t?.cards??[],this.deployedCardsFetched.emit(this._cards.length),this._cardsFetching=!1}catch(t){t.message!=="redundant request"&&console.warn(t)}}}_getSolutionsBriefcase(){return r`<div><svg viewBox="0 0 64 64" width=200 height=200 xmlns=http://www.w3.org/2000/svg fill=var(--calcite-color-text-3)>${_`<path d="M10.723 54.9h6.409a7.896 7.896 0 0 0 13.736 0h23.896a4.137 4.137 0 0 0 4.136-4.136l-.004-32.446a3.222 3.222 0 0 0-3.217-3.219l-10.779.064V9.836A3.741 3.741 0 0 0 41.163 6.1H23.837A3.741 3.741 0 0 0 20.1 9.836l.067 5.264-10.8.004A3.275 3.275 0 0 0 6.1 18.37L6.096 26a.893.893 0 0 0 .263.636.907.907 0 0 0 .638.263l5.902-.014.013-5.985 38.781.01a.407.407 0 0 1 .407.407l.008 22.925a2.858 2.858 0 0 1-2.857 2.858H30.868a7.896 7.896 0 0 0-13.736 0H12.9v-5.2a.801.801 0 0 0-.8-.8H6.9a.801.801 0 0 0-.8.8l-.001 8.375a4.59 4.59 0 0 0 1.353 3.27 4.658 4.658 0 0 0 3.27 1.355zM6.9 41.9h5.2v6h5.51l.112-.213a7.098 7.098 0 0 1 12.556 0l.113.213h18.86a3.683 3.683 0 0 0 2.587-1.071 3.635 3.635 0 0 0 1.071-2.587L52.9 21.317a1.208 1.208 0 0 0-1.207-1.207l-38.867-.01a.714.714 0 0 0-.714.712l-.011 5.275-5.106.012.001.4-.1-.499.003-7.628a2.471 2.471 0 0 1 2.468-2.469l10.8-.003a.734.734 0 0 0 .733-.733v-5.33A2.94 2.94 0 0 1 23.837 6.9h17.326A2.94 2.94 0 0 1 44.1 9.836v5.327a.734.734 0 0 0 .733.733l10.846.003a2.421 2.421 0 0 1 2.417 2.419l.004 32.446a3.337 3.337 0 0 1-3.336 3.336H30.39l-.113.213a7.098 7.098 0 0 1-12.556 0l-.113-.213h-6.886a3.85 3.85 0 0 1-2.704-1.12 3.796 3.796 0 0 1-1.12-2.705zm17.1 13a3.9 3.9 0 1 0-3.9-3.9 3.905 3.905 0 0 0 3.9 3.9zm0-7a3.1 3.1 0 1 1-3.1 3.1 3.103 3.103 0 0 1 3.1-3.1zm10-6a7.918 7.918 0 0 0 7.349-5h4.818a.734.734 0 0 0 .733-.733v-4.334a.734.734 0 0 0-.733-.733h-4.818a7.9 7.9 0 0 0-14.698 0H5.833a.734.734 0 0 0-.733.733v4.334a.734.734 0 0 0 .733.733h20.818a7.918 7.918 0 0 0 7.349 5zm-28.167-10h21.378l.095-.266a7.1 7.1 0 0 1 13.388 0l.095.266 5.31-.066.068 4.266h-5.378l-.095.266a7.1 7.1 0 0 1-13.388 0l-.095-.266-21.31.066zM34 37.9a3.9 3.9 0 1 0-3.9-3.9 3.905 3.905 0 0 0 3.9 3.9zm0-7a3.1 3.1 0 1 1-3.1 3.1 3.103 3.103 0 0 1 3.1-3.1zm5.658-20.8H25.342a1.244 1.244 0 0 0-1.242 1.242V15.9h16.8v-4.558a1.244 1.244 0 0 0-1.242-1.242zm.442 5H24.9v-3.758a.443.443 0 0 1 .442-.442h14.316a.443.443 0 0 1 .442.442z" />`}</svg></div>`}_setSearchTerm(e){this._agoTerms=this._baseAgoTerms+` ${e}`}_setSortOptions(e){let t=e.sortType;t==="relevance"||t==="title"?(t==="title"&&(this._sortOrder="asc"),this._sortField=t):(t==="updated"||t==="created")&&(this._sortOrder="desc",this._sortField=t),this.sortType=t}_clearFilterCategories(){this._categories=[]}async _refreshAfterDeploy(e){if(e){this._newId=e;let t=10,s=500;for(let a=0;a<t&&(await this._getDeployedSolutions(),!this._cards.some(o=>o.id===e));a++)a<t-1&&await new Promise(o=>setTimeout(o,s));await this.updateComplete;let i=10,F=100;for(let a=0;a<i;a++){if(this._refs[e]){let o=this._cards.find(O=>O.id===e);window.dispatchEvent(new CustomEvent("deployedCardReady",{detail:{card:o,cardRef:this._refs[e]}})),this._newId="";return}await new Promise(o=>setTimeout(o,F)),await this.updateComplete}console.warn(`Failed to find ref for newly deployed solution after all retries: ${e}`),window.dispatchEvent(new CustomEvent("deploymentCompletedWithoutNav",{detail:{solutionId:e}})),this._newId=""}}};f("solutions-deployed-panel",p);return p},a,b,c)
|
|
2
|
+
import c from"./WGKOKVQY.js";import b from"./PAKIDHHK.js";import a from"./HHKKBJCY.js";import{b as C}from"./PZ4L77M5.js";import"./DD3JC2L3.js";import{a as w}from"./Y3XY5BXI.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as f}from"./S7XOHDIW.js";import{F as u,G as d,H as g,L as y,h as m,i as r,j as _,r as l}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([{H:c,K:n,L:T,b:v,q:x},,{a:h,b:b}])=>{var D=m`calcite-panel{width:100%;height:100%;--calcite-panel-background-color: var(--calcite-color-foreground-2)}.card-group{overflow:hidden;padding:.25rem var(--calcite-spacing-xxs) var(--calcite-spacing-md)}.text-center{text-align:center}.leader-1{margin-top:var(--calcite-spacing-xxl)}.trailer-1{margin-bottom:var(--calcite-spacing-xxl)}.warning-text{max-width:35em;margin-left:auto;margin-right:auto;font-size:var(--calcite-font-size-md)}.no-solutions{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;min-height:calc(100vh - 190px)}.display-flex{display:flex}.display-none{display:none}.flex-direction-column{flex-direction:column}h1{font-weight:unset;margin:0;padding:0}solution-deployed-card{width:calc(20% - .75rem)}@media(max-width:1280px){solution-deployed-card{width:calc(25% - .75rem)}}@media(max-width:1010px){solution-deployed-card{width:calc(33.333% - .75rem)}}@media(max-width:740px){solution-deployed-card{width:calc(50% - .75rem)}}@media(max-width:440px){solution-deployed-card{width:calc(100% - .75rem)}}.margin-top-half{margin-top:.5rem}`,S=5,p=class extends g{constructor(){super(),this.sortType="created",this._cards=[],this._cardsFetching=!1,this._modifiedCheckTry=0,this._newId="",this._refs={},this._showDeleteCompleteAlert=!1,this._deletedSolutionName="",this._translations=w({name:"solutions-deployed-panel",blocking:!0}),this._agoTerms=c,this._allCards=[],this._baseAgoTerms=c,this._categories=[],this._mainPanelRef=u(),this._panelFixed=!1,this._configContextConsumer=C({context:v,subscribe:!0,callback:async e=>{e&&(this._initCardsFetchers(),await this._getDeployedSolutions())}}),this._delay=!1,this._owner="My solutions",this._sortField="created",this._sortOrder="desc",this.deployedCardsFetched=l(),this.searchTermSet=l(),this.sortTypeSet=l(),this.listenOn(window,"solutionDeleted",e=>{this._modifiedCheckTry=S,this.reload(e.detail.showAlert,e.detail.refreshSolutionsTimeout,e.detail.solutionTitle)}),this.listenOn(window,"solutionConfigureDialogClose",e=>{e.detail&&this.reload(!1,!1)}),this.listenOn(window,"deployProgressEnd",e=>{this._modifiedCheckTry=S,this._refreshAfterDeploy(e.detail)}),this.listenOn(window,"sortTypeChanged",e=>{e.detail&&e.detail.scope==="deployments"&&(this.sortType=e.detail.sortType,this._telemetry?.logEvent({category:n.DEPLOYMENTS,action:"Sort",dimensions:[x(e.detail.sortType)]}),this.searchSolutions(e.detail))}),this.listenOn(window,"searchChanged",e=>{e.detail&&e.detail.scope==="deployments"&&(e.detail.logSearchTelemetry&&e.detail.option?.searchTerm?this._telemetry?.logEvent({category:n.DEPLOYMENTS,action:"Search",dimensions:[e.detail.option.searchTerm]}):this.searchSolutions(e.detail.option))})}static{this.properties={sortType:1,_cards:16,_cardsFetching:16,_modifiedCheckTry:16,_newId:16,_refs:16,_showDeleteCompleteAlert:16,_deletedSolutionName:16,_translations:16}}static{this.styles=D}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async reload(e=!0,t=!0,s){this._initCardsFetchers(),e&&(this._showDeleteCompleteAlert=!0,this._deletedSolutionName=s||this._translations.solution),t?setTimeout(()=>{(async()=>{try{await this._getDeployedSolutions()}catch(i){console.error("Error getting deployed solutions:",i)}})()},500):await this._getDeployedSolutions()}async searchSolutions(e){if(e){if("searchTerm"in e&&this._setSearchTerm(e.searchTerm||""),"sortType"in e&&this._setSortOptions(e),Object.keys(e).indexOf("type")>-1){let t=e;this._owner=t.value,this._telemetry?.logEvent({category:n.DEPLOYMENTS,action:"Filter",dimensions:[t.value==="My solutions"?"My content":"Organization"]})}if(Object.keys(e).indexOf("filter")>-1){let t=e;this._owner=t.filter===T.ORG?"My organization's solutions":"My solutions"}}else this._agoTerms=this._baseAgoTerms,this._clearFilterCategories();await this._getDeployedSolutions()}async setSearchOptions(e){e&&("searchTerm"in e&&(this._setSearchTerm(e.searchTerm),this.searchTermSet.emit({searchTerm:e.searchTerm,scope:"deployments"})),"sortType"in e&&(this._setSortOptions(e),this.sortTypeSet.emit({sortType:e.sortType,scope:"deployments"})))}updated(){this._fixPanelContentWrapperFocus()}_fixPanelContentWrapperFocus(){if(!this._panelFixed&&this._mainPanelRef.value){let e=this._mainPanelRef.value;e.componentOnReady?.().then(()=>{if(e.shadowRoot){let t=e.shadowRoot.querySelector(".content-wrapper");t&&(t.tabIndex=-1,this._panelFixed=!0,this._setupPanelObserver())}}).catch(()=>{this._panelFixed=!0})}}_setupPanelObserver(){if(this._panelObserver)return;this._panelObserver=new MutationObserver(t=>{t.forEach(s=>{if(s.type==="attributes"&&s.attributeName==="tabindex"){let i=s.target;i.classList.contains("content-wrapper")&&i.tabIndex===0&&(i.tabIndex=-1)}})});let e=this._mainPanelRef.value;if(e?.shadowRoot){let t=e.shadowRoot.querySelector(".content-wrapper");t&&this._panelObserver.observe(t,{attributes:!0,attributeFilter:["tabindex"]})}}disconnectedCallback(){super.disconnectedCallback(),this._panelObserver?.disconnect()}render(){return this._cardsFetching?r`<calcite-loader .label=${this._translations.fetchingDeployedSolutions}></calcite-loader>`:this._cards.length?r`<calcite-panel ${d(this._mainPanelRef)}><calcite-card-group class="card-group" .label=${this._translations.allDeployed}>${this._renderCards()}</calcite-card-group><calcite-alert auto-close auto-close-duration=fast icon=check-circle kind=success .label=${this._translations.deleteComplete.replace("{{solutionName}}",this._deletedSolutionName)} .open=${this._showDeleteCompleteAlert} @calciteAlertClose=${()=>{this._showDeleteCompleteAlert=!1}}><div slot=title>${this._translations.deleteComplete.replace("{{solutionName}}",this._deletedSolutionName)}</div></calcite-alert></calcite-panel>`:r`<div class="no-solutions">${this._getSolutionsBriefcase()}<div class="text-center leader-1 warning-text trailer-1 display-flex flex-direction-column"><div>${this._translations.noSolutionsFound}</div><div class="margin-top-half">${this._translations.noSolutionsInstruction}</div></div></div>`}_initCardsFetchers(){if(this._configContextConsumer.value){let e=this._configContextConsumer.value;this._cardsFetcher=new h(e.locale,e.orgUrl,e.portalURL),this._cardsFetcherDeployed=new h(e.locale,e.orgUrl,e.portalURL)}}_renderCards(){return this._refs={},this._cards.map(e=>r`<solution-deployed-card .card=${e} .deployedDate=${e.created} .description=${e.snippet} .diagramKey=${this._configContextConsumer.value?.diagramKey} .heading=${e.title} id=${e.id??y} .itemId=${e.id} .owner=${this._owner==="My solutions"?"":e.owner} .thumbnail=${e.thumbnailUrl} ${d(this._handleRefs)}></solution-deployed-card>`)}_handleRefs(e){e&&(this._refs[e.id]=e)}async _getDeployedSolutions(){let e=this._configContextConsumer.value.authentication;if(e.IsSignedIn){this._abortController?(this._abortController.abort("redundant request"),this._abortController=new AbortController):this._abortController=new AbortController,this._cardsFetching=!0;try{let t=await b(e,this._configContextConsumer.value.userSession,this._cardsFetcher,this._cardsFetcherDeployed,this._agoTerms,this._sortField,this._sortOrder,this._delay,this._categories,this._allCards,this._abortController.signal,this._owner);this._abortController=void 0,this._modifiedCheckTry>0&&(this._cards?.length===t?.cards?.length?(this._modifiedCheckTry--,this._getDeployedSolutions()):this._modifiedCheckTry=0),this._cards=t?.cards??[],this.deployedCardsFetched.emit(this._cards.length),this._cardsFetching=!1}catch(t){t.message!=="redundant request"&&console.warn(t)}}}_getSolutionsBriefcase(){return r`<div><svg viewBox="0 0 64 64" width=200 height=200 xmlns=http://www.w3.org/2000/svg fill=var(--calcite-color-text-3)>${_`<path d="M10.723 54.9h6.409a7.896 7.896 0 0 0 13.736 0h23.896a4.137 4.137 0 0 0 4.136-4.136l-.004-32.446a3.222 3.222 0 0 0-3.217-3.219l-10.779.064V9.836A3.741 3.741 0 0 0 41.163 6.1H23.837A3.741 3.741 0 0 0 20.1 9.836l.067 5.264-10.8.004A3.275 3.275 0 0 0 6.1 18.37L6.096 26a.893.893 0 0 0 .263.636.907.907 0 0 0 .638.263l5.902-.014.013-5.985 38.781.01a.407.407 0 0 1 .407.407l.008 22.925a2.858 2.858 0 0 1-2.857 2.858H30.868a7.896 7.896 0 0 0-13.736 0H12.9v-5.2a.801.801 0 0 0-.8-.8H6.9a.801.801 0 0 0-.8.8l-.001 8.375a4.59 4.59 0 0 0 1.353 3.27 4.658 4.658 0 0 0 3.27 1.355zM6.9 41.9h5.2v6h5.51l.112-.213a7.098 7.098 0 0 1 12.556 0l.113.213h18.86a3.683 3.683 0 0 0 2.587-1.071 3.635 3.635 0 0 0 1.071-2.587L52.9 21.317a1.208 1.208 0 0 0-1.207-1.207l-38.867-.01a.714.714 0 0 0-.714.712l-.011 5.275-5.106.012.001.4-.1-.499.003-7.628a2.471 2.471 0 0 1 2.468-2.469l10.8-.003a.734.734 0 0 0 .733-.733v-5.33A2.94 2.94 0 0 1 23.837 6.9h17.326A2.94 2.94 0 0 1 44.1 9.836v5.327a.734.734 0 0 0 .733.733l10.846.003a2.421 2.421 0 0 1 2.417 2.419l.004 32.446a3.337 3.337 0 0 1-3.336 3.336H30.39l-.113.213a7.098 7.098 0 0 1-12.556 0l-.113-.213h-6.886a3.85 3.85 0 0 1-2.704-1.12 3.796 3.796 0 0 1-1.12-2.705zm17.1 13a3.9 3.9 0 1 0-3.9-3.9 3.905 3.905 0 0 0 3.9 3.9zm0-7a3.1 3.1 0 1 1-3.1 3.1 3.103 3.103 0 0 1 3.1-3.1zm10-6a7.918 7.918 0 0 0 7.349-5h4.818a.734.734 0 0 0 .733-.733v-4.334a.734.734 0 0 0-.733-.733h-4.818a7.9 7.9 0 0 0-14.698 0H5.833a.734.734 0 0 0-.733.733v4.334a.734.734 0 0 0 .733.733h20.818a7.918 7.918 0 0 0 7.349 5zm-28.167-10h21.378l.095-.266a7.1 7.1 0 0 1 13.388 0l.095.266 5.31-.066.068 4.266h-5.378l-.095.266a7.1 7.1 0 0 1-13.388 0l-.095-.266-21.31.066zM34 37.9a3.9 3.9 0 1 0-3.9-3.9 3.905 3.905 0 0 0 3.9 3.9zm0-7a3.1 3.1 0 1 1-3.1 3.1 3.103 3.103 0 0 1 3.1-3.1zm5.658-20.8H25.342a1.244 1.244 0 0 0-1.242 1.242V15.9h16.8v-4.558a1.244 1.244 0 0 0-1.242-1.242zm.442 5H24.9v-3.758a.443.443 0 0 1 .442-.442h14.316a.443.443 0 0 1 .442.442z" />`}</svg></div>`}_setSearchTerm(e){this._agoTerms=this._baseAgoTerms+` ${e}`}_setSortOptions(e){let t=e.sortType;t==="relevance"||t==="title"?(t==="title"&&(this._sortOrder="asc"),this._sortField=t):(t==="updated"||t==="created")&&(this._sortOrder="desc",this._sortField=t),this.sortType=t}_clearFilterCategories(){this._categories=[]}async _refreshAfterDeploy(e){if(e){this._newId=e;let t=10,s=500;for(let a=0;a<t&&(await this._getDeployedSolutions(),!this._cards.some(o=>o.id===e));a++)a<t-1&&await new Promise(o=>setTimeout(o,s));await this.updateComplete;let i=10,F=100;for(let a=0;a<i;a++){if(this._refs[e]){let o=this._cards.find(O=>O.id===e);window.dispatchEvent(new CustomEvent("deployedCardReady",{detail:{card:o,cardRef:this._refs[e]}})),this._newId="";return}await new Promise(o=>setTimeout(o,F)),await this.updateComplete}console.warn(`Failed to find ref for newly deployed solution after all retries: ${e}`),window.dispatchEvent(new CustomEvent("deploymentCompletedWithoutNav",{detail:{solutionId:e}})),this._newId=""}}};f("solutions-deployed-panel",p);return p},a,b,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./QXSUDN7A.js";import a from"./HHKKBJCY.js";import"./PZ4L77M5.js";import"./DD3JC2L3.js";import"./Y3XY5BXI.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import"./S7XOHDIW.js";import"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,{c:o}])=>{return o},a,b)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
+
import e from"./WGKOKVQY.js";import d from"./PAKIDHHK.js";import b from"./HHKKBJCY.js";import{b as f}from"./PZ4L77M5.js";import"./DD3JC2L3.js";import{a as v}from"./Y3XY5BXI.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as S}from"./S7XOHDIW.js";import{H as C,h as m,i as a,j as y,r as c}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([{D:b,E:A,H:D,I:h,K:u,b:w,q:x,t:T},{c:I},{a:g,b:L}])=>{var O=m`calcite-panel{width:100%;height:100%;--calcite-panel-background-color: var(--calcite-color-foreground-2)}.card-group{overflow:hidden;padding:.25rem var(--calcite-spacing-md) var(--calcite-spacing-md)}solution-details-card{width:calc(25% - .6rem)}@media(max-width:1234px){solution-details-card{width:calc(33.333% - .6rem)}}@media(max-width:1010px){solution-details-card{width:calc(50% - .6rem)}}@media(max-width:800px){.card-group{padding-left:0;padding-right:0}solution-details-card{width:calc(33.33% - .6rem)}}@media(max-width:680px){solution-details-card{width:calc(50% - .6rem)}}@media(max-width:440px){solution-details-card{width:calc(100% - .75rem)}}.text-center{text-align:center}.leader-1{margin-top:var(--calcite-spacing-xxl)}.trailer-1{margin-bottom:var(--calcite-spacing-xxl)}.warning-text{max-width:35em;margin-left:auto;margin-right:auto;font-size:var(--calcite-font-size-md)}.no-solutions{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;min-height:calc(100vh - 190px)}.margin-top-half{margin-top:.5rem}.margin-top-1{margin-top:1rem}.no-solutions-prompt{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}`,E=5,_=class extends C{constructor(){super(),this.sortType="relevance",this._cards=[],this._isLoading=!0,this._modifiedCheckTry=0,this._translations=v({name:"solutions-all-panel",blocking:!0}),this._agoTerms=`${h}`,this._allCards=[],this._baseAgoTerms=h,this._categories=[],this._configContextConsumer=f({context:w,subscribe:!0,callback:async t=>{t&&(this._isDisconnectedEnvironment?this._isLoading=!1:await this._loadUpdateProcedures())}}),this._delay=!1,this._getSuggested=!1,this._relatedSolutions=new Set,this._sortField="relevance",this._sortOrder="desc",this.cardsFetched=c(),this.allCardsFetched=c(),this.searchTermSet=c(),this.sortTypeSet=c(),this.detailsCardSelected=c(),this._handleOpenAssistant=()=>{this._telemetry?.logEvent({category:u.ASSISTANT,action:"Open"}),window.dispatchEvent(new CustomEvent("openAssistant"))},this.listenOn(window,"deployProgressEnd",()=>{this._modifiedCheckTry=E,this._loadUpdateProcedures()}),this.listenOn(window,"solutionDeleted",()=>{this._modifiedCheckTry=E,this._loadUpdateProcedures()}),this.listenOn(window,"sortTypeChanged",t=>{t.detail&&t.detail.scope==="all-solutions"&&(this.sortType=t.detail.sortType,this._telemetry?.logEvent({category:u.ALL_SOLUTIONS,action:"Sort",dimensions:[x(t.detail.sortType)]}),this.sortType==="suggested"&&this._deployedSolutions?.cards.length===0?this._getDeployedSolutions().then(()=>{this.searchSolutions(t.detail)}):this.searchSolutions(t.detail))}),this.listenOn(window,"solutionIDFromAssistant",t=>{this._lookupSolutionById(t.detail)})}static{this.properties={sortType:1,_cards:16,_isLoading:16,_modifiedCheckTry:16,_translations:16}}static{this.styles=O}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextConsumer.value?.isEnterprise===!0&&this._configContextConsumer.value?.authentication?.CanSearchArcGISOnline===!1}async searchSolutions(t){this._isDisconnectedEnvironment||(t?"searchTerm"in t?this._textSearch(t.searchTerm):"sortType"in t?this._sortCards(t):Array.isArray(t)&&this._filterCards(t):(this._agoTerms=this._baseAgoTerms,this._clearFilterCategories()),this._cards=await this._getSolutions())}async setSearchOptions(t){t&&("searchTerm"in t&&(this._textSearch(t.searchTerm),this.searchTermSet.emit({searchTerm:t.searchTerm,scope:"all-solutions"})),"sortType"in t&&(this._sortCards(t),this.sortTypeSet.emit({sortType:t.sortType,scope:"all-solutions"})))}render(){let t=this._configContextConsumer.value?.authentication?.IsSignedIn&&this._configContextConsumer.value?.authentication?.CanUseAI;return this._isDisconnectedEnvironment?a`<div class="no-solutions">${this._getMeridianSearch()}<div class="no-solutions-prompt"><div class="text-center leader-1 warning-text trailer-1"><div>${this._translations.disconnectedEnvironment}</div></div></div></div>`:this._isLoading||this._cards.length?a`<calcite-panel>${this._isLoading?a`<calcite-loader id=solutions-all-panel-loader .label=${this._translations.fetchingSolutions}></calcite-loader>`:a`<calcite-card-group class="card-group" .label=${this._translations.allSolutionCards}>${this._renderCards()}</calcite-card-group>`}</calcite-panel>`:a`<div class="no-solutions">${this._getMeridianSearch()}<div class="no-solutions-prompt"><div class="text-center leader-1 warning-text trailer-1"><div>${this._translations.noSolutionsFound}</div><div class="margin-top-half">${t?this._translations.assistantHelp:this._translations.changeSearchTerm}</div></div>${t&&a`<calcite-button appearance=outline icon-start=speech-bubbles @click=${this._handleOpenAssistant} @keydown=${e=>T(e,()=>this._handleOpenAssistant())} scale=l>${this._translations.askAssistant}</calcite-button>`||""}</div></div>`}_renderCards(){return this._cards.map(t=>a`<solution-details-card .card=${t}></solution-details-card>`)}async _getSolutions(){if(this._isDisconnectedEnvironment)return this._isLoading=!1,[];if(this._configContextConsumer.value){this._isLoading=!0,this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let t=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},this._configContextConsumer.value?.primarySolutionsGroupId,this._configContextConsumer.value?.agoBasedEnterpriseSolutionsGroupId,this._configContextConsumer.value?.userSession,this._configContextConsumer.value?.isEnterprise,this._abortController.signal,{num:1e3});this._abortController=void 0;let e=t?.cards.length?t.cards:[];if(this.sortType==="new"||this.sortType==="updated"){let s="/Categories/New Release";this.sortType==="updated"&&(s="/Categories/Updated"),e.sort((l,d)=>l.categories.includes(s)&&!d.categories.includes(s)?-1:!l.categories.includes(s)&&d.categories.includes(s)?1:l.categories.includes(s)&&d.categories.includes(s)?l.categories.length-d.categories.length:0)}else if(this.sortType==="suggested"&&this._relatedSolutions.size>0&&this._deployedSolutions?.cards?.length){let s=new Map;for(let i of e){let r=s.get(i.deployCommonId),n=Number(i.deployVersion);(!r||n>r)&&s.set(i.deployCommonId,n)}let l=this._deployedSolutions.cards.filter(i=>{let r=s.get(i.deployCommonId);return r!==void 0&&Number(i.deployVersion)>=r}),d=new Set(l.map(i=>i.deployCommonId));this._relatedSolutions=new Set([...this._relatedSolutions].filter(i=>!d.has(i))),e.sort((i,r)=>{let n=this._relatedSolutions.has(i.deployCommonId),p=this._relatedSolutions.has(r.deployCommonId);return n&&!p?-1:!n&&p?1:0})}let o=e.map(s=>{let l=s.categories.indexOf("/Categories/New Release")>-1,d=s.categories.indexOf("/Categories/Updated")>-1,i=!1,r=!0;this._deployedSolutions&&(i=this._isSolutionDeployed(s.deployCommonId),r=this._isLatestVersion(s));let n=[];return l?n.push("new"):d&&n.push("updated"),i&&r&&n.push("deployed"),s.chips=n.length>0?n:void 0,s.supportReuse=i?!!(i&&!r):!0,s});return this._allCards.length===0&&t?.cards&&(this._allCards=t?.cards,this._deployedSolutions&&(this._relatedSolutions=I(this._deployedSolutions.cards,this._allCards))),this.cardsFetched.emit(o.length),this._isLoading=!1,o}else return this._isLoading=!1,[]}async _loadUpdateProcedures(){if(this._isDisconnectedEnvironment){this._isLoading=!1;return}this._isLoading=!0;let t=this._configContextConsumer.value;this._cardsFetcher=new g(t.locale,t.orgUrl,t.portalURL),this._cardsFetcherDeployed=new g(t.locale,t.orgUrl,t.portalURL),await this._getDeployedSolutions(),this._cards=await this._getSolutions(),this.allCardsFetched.emit(this._cards),this._isLoading=!1}async _getDeployedSolutions(){let t=this._configContextConsumer.value.authentication,e=this._configContextConsumer.value.userSession;if(t&&e&&t.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let o=await L(t,e,this._cardsFetcher,this._cardsFetcherDeployed,D,"created",this._sortOrder,void 0,this._categories,void 0,this._abortControllerDeployed.signal);if(this._abortControllerDeployed=void 0,o){if(this._modifiedCheckTry>0){if(this._deployedSolutions?.cards.length===o?.cards.length)return this._modifiedCheckTry--,await this._getDeployedSolutions();this._modifiedCheckTry=0}this._deployedSolutions=o}}}_getMeridianSearch(){return a`<div><svg viewBox="0 0 64 64" width=140 height=140 xmlns=http://www.w3.org/2000/svg fill=var(--calcite-color-text-3)>${y`<path d="M60.217 54.937l-15.77-15.77-1.414 1.415-3.801-3.8a19.94 19.94 0 1 0-2.451 2.45l3.802 3.802-1.413 1.415 15.767 15.767a1.739 1.739 0 0 0 2.459 0l2.82-2.821a1.742 1.742 0 0 0 0-2.458zM4.9 24A19.1 19.1 0 1 1 24 43.1 19.121 19.121 0 0 1 4.9 24zm32.474 14.693q.69-.63 1.32-1.32l3.774 3.775-1.32 1.32zM59.65 56.83l-2.82 2.82a.97.97 0 0 1-1.327 0L40.3 44.45l4.145-4.15L59.65 55.501a.939.939 0 0 1 0 1.328zM22.343 9.62l.097.795q-.31.038-.619.086a13.635 13.635 0 0 0-11.353 11.775l-.026.217-.795-.084.026-.228a14.44 14.44 0 0 1 12.022-12.47c.215-.034.431-.064.648-.09z" />`}</svg></div>`}_textSearch(t){this._agoTerms=this._baseAgoTerms+` ${t}`}_sortCards(t){let e=t.sortType;this._getSuggested=!1,this._sortOrder="desc",e==="suggested"?this._getSuggested=!0:e==="new"?this._sortField="relevance":e==="relevance"||e==="title"?(e==="title"&&(this._sortOrder="asc"),this._sortField=e):e==="updated"&&(this._sortField="relevance"),this.sortType=e}_filterCards(t){this._categories=[],t.forEach(e=>{if(e.industry){let o=this._getIndustryValue(e.industry);if(e.domain){let s=this._getDomainValue(e.domain);this._categories.push(`/Categories/${o}/${s}`)}else this._categories.push(`/Categories/${o}`)}})}_getDomainValue(t){return A[t]}_getIndustryValue(t){return t==="AEC"?"AEC":b[t]}_clearFilterCategories(){this._categories=[]}_isSolutionDeployed(t){return!!this._deployedSolutions?.cards?.some(e=>e?.typeKeywords?.some(o=>o.includes("solutionid")&&o.includes(t)))}_isLatestVersion(t){let e=this._deployedSolutions?.cards?.filter(o=>o?.typeKeywords?.some(s=>s.includes("solutionid")&&s.includes(t.deployCommonId)));return!(e&&e.length>0&&e[0].deployVersion!==t.deployVersion)}_lookupSolutionById(t){let e=this._allCards.filter(o=>o.deployCommonId===t);e.length>0&&this.detailsCardSelected.emit(e[0])}};S("solutions-all-panel",_);return _},b,d,e)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./2SD4IYX3.js";export default $arcgis.t(([a,u,{g:i}])=>{var c=class{async getPopupTitle(o,f){let s={};for(let[e,r]of Object.entries(o.attributes))s={...s,[`{${e.toUpperCase()}}`]:r};let p=o.layer,l=this._removeTags(p?.popupTemplate?.title);if(l.includes("{expression/expr")&&p?.popupTemplate?.expressionInfos!=null)for(let e=0;e<p.popupTemplate?.expressionInfos.length;e++){let r=p.popupTemplate.expressionInfos[e],n=a.createArcadeProfile("popup");try{let t=await(await a.createArcadeExecutor(r.expression,n)).executeAsync({$feature:o,$layer:p,$map:f});(t!==null||t!=="")&&(s[`{expression/${r.name}}`.toUpperCase()]=t)}catch(t){console.error(t);continue}}return p.popupTemplate?.fieldInfos&&p.fields.forEach(e=>{let r=o.attributes[e.name],n=(p?.popupTemplate?.fieldInfos||[]).find(m=>m.fieldName.toLowerCase()===e.name.toLowerCase()),t=i(r,e.type,e?.domain,n?.format,u);s[`{${e.name.toUpperCase()}}`]=t??r}),l?.replace(/{.*?}/g,e=>s[e.toUpperCase()]!=null?s[e.toUpperCase()]:"")}_removeTags(o){return o==null||o===""?"":o.toString().replace(/(<([^>]+)>)/gi,"")}};return c},"arcade","intl",a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as h}from"./
|
|
2
|
+
import{a as h}from"./Y3XY5BXI.js";import{b as p}from"./S7XOHDIW.js";import{H as d,h as r,i as l,l as c,r as n}from"./46DQNAMV.js";var y=r`:host{display:block}.padding-start-1{padding-inline-start:1rem}.border-override{--calcite-accordion-border-color: var(--calcite-color-border-1) !important}.display-flex{display:flex}.align-center{align-items:center}.solution-list-item-label{color:var(--calcite-color-text-1);font-size:var(--calcite-font-size--1)}.solution-list-item-label,.solution-list-item-description{font-family:var(--calcite-font-family);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.solution-list-item-description{font-size:var(--calcite-font-size--2);margin-block-start:.125rem;color:var(--calcite-color-text-3)}.solution-list-item-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;line-height:1.375}.underline{text-decoration:underline}calcite-chip{--calcite-chip-icon-color: var(--calcite-color-brand)}`,a=class extends d{constructor(){super(...arguments),this.itemRelationshipDependencies=[],this.linkType="item",this.listSelectionMode="none",this.reuseWarning="",this.templateInfos=[],this.typeKeywords=[],this._sortedTemplateInfos=[],this._translations=h({name:"solution-item-accordion",blocking:!0}),this._sortOrder=["Hub Site Application","Hub Page","Web Experience","Instant App","Web Mapping Application","Dashboard","StoryMap","Form","QuickCapture Project","Workflow","Big Data Analytic (hosted)","Real Time Analytic (hosted)","Feed (hosted)","Tool","Notebook","Data Pipeline","Project Package","Desktop Application Template","TypeNotFound","Web Map","Web Scene","Feature Layer (hosted, view)","Feature Layer (hosted)","Table (hosted, view)","Table (hosted)","Tile Layer","CSV","Microsoft Excel","Microsoft Word","Report Template","Rule Package","Group"],this.solutionItemHover=n(),this.solutionItemSelect=n(),this.solutionTypeHover=n()}static{this.properties={itemRelationshipDependencies:0,linkType:1,listSelectionMode:1,reuseWarning:1,templateInfos:0,typeKeywords:0,_sortedTemplateInfos:16,_translations:16}}static{this.styles=y}willUpdate(e){e.has("templateInfos")&&(this.hasUpdated||this.templateInfos?.length>0)&&this.templateInfosWatchHandler()}async templateInfosWatchHandler(){this._sortedTemplateInfos=this._sortTemplates()}async collapseAll(){this.el?.shadowRoot?.querySelectorAll("calcite-accordion-item")?.forEach(e=>{e.expanded=!1})}async deselectAll(){(this.listSelectionMode==="single"||this.listSelectionMode==="single-persist")&&this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(e=>{e.selected&&(e.selected=!1),(e.parentElement?.parentElement).expanded&&((e.parentElement?.parentElement).expanded=!1)})}async expandItemById(e){this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{t.id===e&&((t.parentElement?.parentElement).expanded=!0)})}async expandFirstItem(){let e=this.el?.shadowRoot?.querySelectorAll("calcite-list-item");e?.length&&((e[0].parentElement?.parentElement).expanded=!0)}async expandItems(e){this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{e.indexOf(t.id)>-1&&((t.parentElement?.parentElement).expanded=!0)})}async selectItem(e){(this.listSelectionMode==="single"||this.listSelectionMode==="single-persist")&&this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{t.id===e&&(t.selected=!0,(t.parentElement?.parentElement).expanded=!0)})}async selectFirstItem(){let e=this.el?.shadowRoot?.querySelectorAll("calcite-list-item");e?.length&&(e[0].selected=!0,(e[0].parentElement?.parentElement).expanded=!0)}async selectItems(e){this.listSelectionMode==="multiple"&&this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{e.indexOf(t.id)>-1&&(t.selected=!0,(t.parentElement?.parentElement).expanded=!0)})}async load(){this._sortedTemplateInfos=this._sortTemplates()}render(){return this._getAccordion()}_deselectOthers(e){(this.listSelectionMode==="single"||this.listSelectionMode==="single-persist")&&this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{t.id!==e&&(t.selected=!1)})}_getAccordion(){let e=[],t=this._sortedTemplateInfos.reduce((i,o)=>{let s=this._getTypeForDisplay(o.type,o.typeKeywords);return e.indexOf(s)<0&&(e.push(s),i.push(this._getAccordionItem(o))),i},[]);return l`<calcite-accordion class="border-override" selection-mode=single>${t}</calcite-accordion>`}_getAccordionItem(e){let t=this._getTypeForDisplay(e.type,e.typeKeywords),i=this._sortedTemplateInfos.filter(o=>this._getTypeForDisplay(o.type,o.typeKeywords)===t);return l`<calcite-accordion-item .heading=${`${t} (${i.length})`} @mouseenter=${()=>this.solutionTypeHover.emit({itemType:t,entering:!0})} @mouseleave=${()=>this.solutionTypeHover.emit({itemType:t,entering:!1})}><solution-item-icon class="padding-start-1 display-flex align-center" slot=actions-start .type=${e.type} .typeKeywords=${e.typeKeywords}></solution-item-icon>${this._getList(i)}</calcite-accordion-item>`}_getList(e){let t=this._sortTemplatesByTitle(e);return l`<calcite-list .label=${this._translations.solutionsTemplates} selection-appearance=border .selectionMode=${this.listSelectionMode}>${t.map(i=>this._getListItem(i))}</calcite-list>`}_getListItem(e){let t=this.typeKeywords.includes("Deployed")&&e.url,i=this.linkType==="action";return l`<calcite-list-item id=${e.id??c} @mouseenter=${()=>this.solutionItemHover.emit({itemId:e.id,entering:!0})} @mouseleave=${()=>this.solutionItemHover.emit({itemId:e.id,entering:!1})} @calciteListItemSelect=${()=>{this._deselectOthers(e.id),this.solutionItemSelect.emit({itemId:e.id,selected:!0}),t&&!i&&window.open(e.url,"_blank")}} .value=${e.id}><div class="solution-list-item-content" slot=content><div class=${`solution-list-item-label ${t&&!i?"underline":""}`}>${e.title}</div><div class="solution-list-item-description">${e.snippet}</div></div>${this.itemRelationshipDependencies.length>0&&this.itemRelationshipDependencies.some(o=>o===e.id)&&this.reuseWarning&&this._getReuseWarningChip()||""}${t&&i?l`<div slot=actions-end><calcite-action icon=launch .id=${`${e.id}-launch`} @click=${()=>window.open(e.url,"_blank")} text></calcite-action><calcite-tooltip overlay-positioning=fixed .referenceElement=${`${e.id}-launch`}><span>${this._translations?.openDetails}</span></calcite-tooltip></div>`:null}</calcite-list-item>`}_sortTemplatesByTitle(e){return e.sort((t,i)=>t.title<i.title?-1:t.title>i.title?1:0)}_sortTemplates(){return this.templateInfos.sort((e,t)=>{let i=this._getTypeForSort(e),o=this._getTypeForSort(t),s=this._sortOrder.indexOf(i),m=this._sortOrder.indexOf(o);return s-m})}_getTypeForSort(e){let t=this._getTypeForDisplay(e.type,e.typeKeywords);return this._sortOrder.indexOf(t)<0&&(t="TypeNotFound"),t}_getTypeForDisplay(e,t){let i=e;if(e==="Feature Service"){let o=t.indexOf("View Service")>-1,s=t.indexOf("Table")>-1;i=o&&s?"Table (hosted, view)":s?"Table (hosted)":o?"Feature Layer (hosted, view)":"Feature Layer (hosted)"}return e==="Web Mapping Application"&&(i=t.indexOf("configurableApp")>-1?"Instant App":i),i=e==="Geoprocessing Service"?"Tool":i,i=e==="Feed"?"Feed (hosted)":i,i=e==="Real Time Analytic"?"Real Time Analytic (hosted)":i,i=e==="Big Data Analytic"?"Big Data Analytic (hosted)":i,i=e==="Vector Tile Service"?"Tile Layer":i,i}_getReuseWarningChip(){return l`<calcite-chip icon=information kind=neutral .label=${this.reuseWarning} scale=s slot=actions-end>${this.reuseWarning}</calcite-chip>`}};p("solution-item-accordion",a);export{a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
+
import b from"./PAKIDHHK.js";import a from"./HHKKBJCY.js";import{K as J,nb as B,ob as S,qa as M,r as N}from"./DD3JC2L3.js";import{g as O}from"./CGLFPVBM.js";export default $arcgis.t(([{H:T,g:D,h:k,i:z,j:K,m:U,n:w},{a:v,b:h,c:j,e:p}])=>{var V=class{constructor(e,r,s){this.cMissingImageDataURI="https://static.arcgis.com/images/solution.png",this.cardCache=[],this.cardCacheParams={q:"",categoriesAsStr:"[]",sortField:"title",sortOrder:"asc"},this.locale=e,this.orgUrl=r,this.portalUrl=s,this.anonAgolSession=new O({}),this.agolPortalUrl=K(s)}addToCache(e){this.cardCache.push(e)}getCache(){return this.cardCache}removeFromCache(e){this.cardCache=this.cardCache.filter(r=>r.id!==e)}requestAvailableSolutionCards(e,r,s,t,o,n,a,i){let m=a?.start?a.start:1,g=a?.num?a.num:24,P=this.portalUrl+"/sharing/rest",f=this.agolPortalUrl+"/sharing/rest",C=this.anonAgolSession,q=JSON.stringify(e.categories);if(this.cardCacheParams.q!==e.q||this.cardCacheParams.categoriesAsStr!==q||e.sortField==="relevance"?(this.cardCache=[],this.cardCacheParams={q:e.q,categoriesAsStr:q,sortField:e.sortField,sortOrder:e.sortOrder}):(this.cardCacheParams.sortField!==e.sortField||this.cardCacheParams.sortOrder!==e.sortOrder)&&(this.cardCacheParams.sortField=e.sortField,this.cardCacheParams.sortOrder=e.sortOrder,this.cardCache=p(this.cardCache,this.cardCacheParams.sortField,this.cardCacheParams.sortOrder)),this.cardCache.length>0){let c;if(i&&i.size>0){let d=v(this.cardCache,i);c=h(d,m,g)}else c=h(this.cardCache,m,g);return Promise.resolve(c)}let A={filter:e.filter,sortField:e.sortField,sortOrder:e.sortOrder,categories:e?.categories?this.convertSearchCategories(e.categories):"",signal:n},y=[];if(r&&!o){let c=t||new O({});y.push(S(r,e.q,c,A,P))}return s&&o&&y.push(S(s,e.q,C,A,f)),Promise.allSettled(y).then(c=>{let d=[];c.forEach(u=>{if(u.status==="fulfilled"){let I=u.value,b="",R=!1;b=this.agolPortalUrl,R=!0,I.results.forEach(E=>{E.sourcePortalUrl=b,E.knownToBePublicSource=R}),d.push(I)}else if(u.status==="rejected")throw new Error(u.reason.message?u.reason.message:"cannotAccessAGO")}),d.length===0?this.cardCache=[]:d.length===1?this.cardCache=this.getCardsFromResponse(d[0]):this.cardCache=p(this.getCardsFromResponse(this.mergeResponses(d)),this.cardCacheParams.sortField,this.cardCacheParams.sortOrder);let F;if(i&&i.size>0){let u=v(this.cardCache,i);F=h(u,m,g)}else F=h(this.cardCache,m,g);return Promise.resolve(F)}).catch(c=>Promise.reject(new Error(c.message)))}requestDeployedSolutionCards(e,r,s="",t){let o=this.portalUrl+"/sharing/rest";if(t.aborted)return Promise.resolve([]);if(this.cardCacheParams.q!==e.q||this.cardCacheParams.categoriesAsStr!==JSON.stringify(e.q)||e.sortField==="relevance"?(this.cardCache=[],this.cardCacheParams={q:e.q,categoriesAsStr:"[]",sortField:e.sortField,sortOrder:e.sortOrder}):(this.cardCacheParams.sortField!==e.sortField||this.cardCacheParams.sortOrder!==e.sortOrder)&&(this.cardCacheParams.sortField=e.sortField,this.cardCacheParams.sortOrder=e.sortOrder,this.cardCache=p(this.cardCache,this.cardCacheParams.sortField,this.cardCacheParams.sortOrder)),t.aborted)return Promise.resolve([]);if(this.cardCache.length>0){let a=h(this.cardCache,1,this.cardCache.length);return Promise.resolve(a)}let n={q:e.q,filter:e.filter,sortField:e.sortField,sortOrder:e.sortOrder,authentication:r,portal:o,categories:e?.categories?JSON.stringify(e.categories):"",num:e.num,signal:t};return s?M(s,r).then(a=>{if(t.aborted)return Promise.resolve([]);this.cardCache=this.getCardsFromResponse({results:[a]});let i=h(this.cardCache,1,this.cardCache.length);return Promise.resolve(i)}).catch(a=>Promise.reject(new Error(a))):B(n).then(a=>{this.cardCache=this.getCardsFromResponse(a);let i=h(this.cardCache,1,this.cardCache.length);return Promise.resolve(i)}).catch(a=>Promise.reject(new Error(a)))}convertSearchCategories(e){return e&&(Array.isArray(e)?e=e.map(r=>JSON.stringify(Array.isArray(r)?r:[r])):e=JSON.stringify([e])),e}getCardsFromResponse(e){return e.results.length>0?N(e.results).map(r=>{let s=r.sourcePortalUrl?r.sourcePortalUrl:this.portalUrl,t=r.sourcePortalUrl?r.sourcePortalUrl:this.orgUrl,o={id:r.id,title:r.title,snippet:r.snippet||"",description:r.description||"",url:r.url||"",itemUrl:`${t}/home/item.html`+k([{k:"id",v:r.id}])||"",thumbnailFilename:r.thumbnail,thumbnailUrl:z(r.id,r.thumbnail,this.cMissingImageDataURI,s),tryitUrl:r.url||"",typeKeywords:r.typeKeywords,learnMoreUrl:r.properties?.learnMoreUrl||"",createdMs:r.created,created:U(r.created,this.locale),modified:U(r.modified,this.locale),numViews:r.numViews,tags:r.tags,categories:r.groupCategories&&r.groupCategories.length>0?r.groupCategories:r.categories||[],licenseInfo:D(r.licenseInfo),deployCommonId:w(r.typeKeywords||[],"solutionid-"),deployVersion:w(r.typeKeywords||[],"solutionversion-"),canDelete:r.created>16183314e5,preview:this.preparePreviewImageUrls(r.id,r.properties?.preview,s),sourcePortalUrl:r.sourcePortalUrl||"",knownToBePublicSource:r.knownToBePublicSource||!1,waitId:"",relatedSolutions:J(r,"properties.relatedSolutions")||[],owner:r.owner};return o.deployCommonId!==""&&o.deployVersion!==""?o:null}).filter(r=>r!=null):[]}mergeResponses(e){let r=0;e.forEach(t=>r+=t.total);let s=[];return e.forEach(t=>s=s.concat(t.results)),{query:e[0].query,start:1,num:r,nextStart:-1,total:r,results:s}}preparePreviewImageUrls(e,r,s){return r?r.map(t=>(t.format==="image"&&(t.name=s+"/sharing/rest/content/items/"+e+"/resources/"+t.name),t)):[]}};async function L(l,e,r,s,t=T,o="created",n="desc",a=!1,i=[],m=[],g,P,f){if(!l?.IsSignedIn)return;let C={q:t,filter:"type:Solution",sortField:o,sortOrder:n,delay:a,categories:i,num:100};return C.q+=G(l,P),await x(e,C,s,m,f,g)}function G(l,e){let r="",s=l.PortalUserOrg,t=l.PortalUserName;return s&&(r+=" orgid:"+s),e!=="My organization's solutions"&&t&&(r+=" owner:"+t),r}async function x(l,e,r,s,t="",o){let n=await r.requestDeployedSolutionCards(e,l,t,o),a=j(n.cards,s);return{cards:n.cards,relatedSolutions:a}}return{a:V,b:L}},a,b)
|