@arcgis/map-components 5.1.0-next.50 → 5.1.0-next.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/64K3ZLWU.js +2 -0
- package/dist/cdn/7OCT6QER.js +2 -0
- package/dist/cdn/BVV442IW.js +2 -0
- package/dist/cdn/CM2DTEKZ.js +2 -0
- package/dist/cdn/CMMCCDZM.js +2 -0
- package/dist/cdn/CX4BONNF.js +2 -0
- package/dist/cdn/D4VBRIIX.js +2 -0
- package/dist/cdn/FII7IMJT.js +2 -0
- package/dist/cdn/LAIMIE36.js +2 -0
- package/dist/cdn/{TRD7HG5P.js → LREZ5SKG.js} +1 -1
- package/dist/cdn/LZSSMLAK.js +2 -0
- package/dist/cdn/NKR3PQHN.js +2 -0
- package/dist/cdn/NSWFEQPG.js +2 -0
- package/dist/cdn/PDRWEM43.js +2 -0
- package/dist/cdn/PJ6ASBCK.js +2 -0
- package/dist/cdn/WRKFEF2E.js +2 -0
- package/dist/cdn/WRXZSYE7.js +2 -0
- package/dist/cdn/X4YAWY7C.js +3 -0
- package/dist/cdn/{2CHYBLOC.js → XFLYIMEH.js} +1 -1
- package/dist/cdn/ZW3F22OF.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/layer-utils.js +39 -27
- package/dist/components/arcgis-expand/customElement.js +5 -11
- package/dist/components/arcgis-feature-utility-network-associations/customElement.js +85 -88
- package/dist/components/arcgis-utility-network-aggregated-geometry/customElement.js +1 -1
- package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +49 -50
- package/dist/components/arcgis-utility-network-trace-results/customElement.js +64 -67
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +4 -4
- package/dist/cdn/3KZ42JDF.js +0 -2
- package/dist/cdn/4BF7JJHX.js +0 -2
- package/dist/cdn/53A4TVFJ.js +0 -2
- package/dist/cdn/63VDVNOO.js +0 -2
- package/dist/cdn/73W64JNK.js +0 -2
- package/dist/cdn/DEUTYZQD.js +0 -2
- package/dist/cdn/FL3CDOKT.js +0 -2
- package/dist/cdn/G2QS2EES.js +0 -2
- package/dist/cdn/GV445FXS.js +0 -2
- package/dist/cdn/HBJXWV7A.js +0 -2
- package/dist/cdn/P4KEOVAP.js +0 -2
- package/dist/cdn/RBTA7SDX.js +0 -2
- package/dist/cdn/SUCLDKGU.js +0 -3
- package/dist/cdn/TPLNBIOY.js +0 -2
- package/dist/cdn/TVLLHHUA.js +0 -2
- package/dist/cdn/UDSVK25W.js +0 -2
- package/dist/cdn/WR3AVKYZ.js +0 -2
- package/dist/cdn/WUWAJE6E.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as I}from"./MP6Z45SA.js";import a from"./NKR3PQHN.js";import{a as A}from"./J6UG5EF7.js";import{O as q,S as L,U as N,a as T,b as p}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([{createReactiveMap:C,findUtilityNetwork:V,getOrCreateMapValue:Q},{stripHTML:S},f,{ignoreAbortErrors:$},{watch:k},U,B,P,x,G,{b:E,f:F}])=>{var O=T`.list-container{min-height:var(--calcite-spacing-xxxl)}.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}.sticky-loading-container{display:flex;position:sticky;bottom:var(--calcite-spacing-sm);align-items:center;justify-content:center;z-index:2;margin:0;padding:0;height:var(--calcite-spacing-xxxl);pointer-events:none;height:500px}`,M=100,j={assetGroup:"assetgroup",assetType:"assettype"},D="{00000000-0000-0000-0000-000000000000}",v=class extends q{constructor(){super(...arguments),this._addFlowItem=t=>{t&&this.flowItems?.push(t)},this._attachmentAssociations=new f,this._attachmentFeatureCount=0,this._cancelQuery=()=>{let{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{let{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._connectivityAssociations=new f,this._connectivityFeatureCount=0,this._containerAssociations=new f,this._containerFeatureCount=0,this._contentAssociations=new f,this._contentFeatureCount=0,this._networkSourceIdsInUse=new Set,this._query=async t=>{if(!t)return;await this._loadUtiltyNetworks();let{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),this._featureCount&&await this._queryAssociatedFeatures(t,{signal:e?.signal})},this._queryController=async t=>{this._cancelQuery();let e=new AbortController;this._queryAbortController=e,await $(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();let t=new AbortController;this._queryFeatureCountAbortController=t,await $(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=I(this._queryController,M),this._queryFeatureCountDebounced=I(this._queryFeatureCountController,M),this._structureAssociations=new f,this._structureFeatureCount=0,this._queryAssociationType=async()=>{this._activeAssociationType&&this._queryDebounced(this._activeAssociationType)},this._associationFeatures=C(),this._associationViewModels=C(),this._featureCount=0,this._loaded=!1,this._queryAbortController=null,this._queryFeatureCountAbortController=null,this._queryPageAbortController=null,this.associationTypes=null,this.autoDestroyDisabled=!1,this.flowType="feature-utility-network-associations",this.headingLevel=2,this.source="popup"}static{this.properties={_activeAssociationType:16,_associationFeatures:16,_associationViewModels:16,_canLoad:16,_canQuery:16,_featureCount:16,_loaded:16,_queryAbortController:16,_queryFeatureCountAbortController:16,_queryPageAbortController:16,_state:16,associationTypes:0,autoDestroyDisabled:5,description:1,flowItems:0,flowType:1,graphic:0,heading:1,headingLevel:9,layer:0,map:0,messages:0,parentFeatureViewModel:0,referenceElement:1,source:1,spatialReference:0,timeZone:1,view:0}}static{this.styles=O}get _globalId(){return(this._globalIdField&&this.graphic?.attributes?.[this._globalIdField])??null}get _globalIdField(){return this.layer?.globalIdField}get _objectId(){return(this._objectIdField&&this.graphic?.attributes?.[this._objectIdField])??null}get _objectIdField(){return this.layer?.objectIdField}get _supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get _utilityNetwork(){let{layer:t,map:e}=this;if(!t?.loaded||!e)return null;let s=F(t)?t.parent:t;return V(e,s)}get _canLoad(){return!!this.map}get _canQuery(){return!!this.layer?.capabilities?.query?.supportsPagination}get _state(){let{_canLoad:t,_canQuery:e,_featureCount:s,_loaded:o,_queryAbortController:i,_queryFeatureCountAbortController:a,_queryPageAbortController:r,associationTypes:l}=this;return a||t&&!o?"loading":i||r?"querying":!this._globalId||!l||!e||!s?"disabled":"ready"}get heading(){return this._heading}set heading(t){this._heading=t}async destroy(){await this.manager.destroy()}loaded(){this.manager.onLifecycle(()=>[k(()=>[this.graphic,this.layer,this.map,this.associationTypes,this._canQuery,this._objectId,this._globalId],()=>{this._queryFeatureCountDebounced(),this._queryAssociationType()},{initial:!0}),k(()=>this._activeAssociationType,t=>{this._queryDebounced(t)}),k(()=>this._associationFeatures.values(),()=>{this._setUpUtilityNetworkAssociationsViewModels()})]),this.manager.onDestroy(()=>{this._cancelQuery(),this._cancelQueryFeatureCount()})}_addAssociationTypeFlowItem(t){this._addFlowItem(L(p`<arcgis-feature-utility-network-association-list .autoDestroyDisabled=${this.autoDestroyDisabled} .associationViewModels=${this._associationViewModels} .description=${this.parentFeatureViewModel?.title} .flowItems=${this.flowItems} .flowType=${this.flowType} .heading=${this._getAssociationTypeTitle(t)} .messages=${this.messages} .map=${this.map} .parentFeatureViewModel=${this.parentFeatureViewModel} .referenceElement=${this.referenceElement} .state=${this._state} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature-utility-network-association-list>`))}_clearAssociations(){this._attachmentAssociations.removeAll(),this._connectivityAssociations.removeAll(),this._containerAssociations.removeAll(),this._contentAssociations.removeAll(),this._structureAssociations.removeAll()}_clearFeatures(){this._associationFeatures.forEach(t=>t.removeAll()),this._associationFeatures.clear()}_compareByFeatureTitle(t,e){return t.title.localeCompare(e.title,void 0,{numeric:!0})}async _countAssociatedFeatureCount(t,e,s,o,i){let a=this._getFeatureQueryWhereClause(t,e,s,o);return await t.queryFeatureCount({where:a,outFields:["*"],returnGeometry:!1},{signal:i?.signal})}async _countAssociatedFeatures(t,e,s,o,i){if(!e.length)return 0;let a=await this._findLayersBySourceId(t);await this._loadLayers(a);let r=a.map(l=>this._countAssociatedFeatureCount(l,e,s,o,i));return(await Promise.all(r)).reduce((l,c)=>l+c,0)}async _createAssociationFeatureObjects(t,e,s,o,i){if(!t.length)return[];let a=new Map,r=Array.from(e.entries()).map(async([c,d])=>{let u=await this._findLayersBySourceId(c);await this._loadLayers(u);let h=u.map(m=>this._queryLayer(m,d,s,o,i));(await Promise.all(h)).forEach(m=>{m.forEach(n=>{if(this.source==="popup"?n.sourceLayer&&n.getEffectivePopupTemplate():n.sourceLayer){let _=n.layer.globalIdField??"",y=n.getAttribute(_),w=a.get(y)??[];w.push(n),a.set(y,w)}})})});await Promise.all(r);let l=[];return await Promise.all(t.toArray().map(async c=>{let{fromNetworkElement:d,toNetworkElement:u}=c,h=d.globalId===this._globalId?u:d,m=a.get(h.globalId)??[];await Promise.all(m.map(async n=>{let _=this._utilityNetwork?.getTerminalById(h?.terminalId??void 0)?.name,y=await n.sourceLayer.getFeatureTitle(n)||this._getFeatureTitle(n);l.push({title:y,feature:n,association:c,terminalName:_})}))})),l}_destroyAssociatedFeatureViewModels(){this._associationViewModels.forEach(t=>t.destroyAll())}_equals(t,e){if(t.globalId===D&&e.globalId===D){let s=function(d,u){return d.networkSourceId===u.networkSourceId&&d.globalId===u.globalId&&d.terminalId===u.terminalId&&d.firstUnit===u.firstUnit&&d.numUnits===u.numUnits},o=t.fromNetworkElement,i=t.toNetworkElement,a=e.fromNetworkElement,r=e.toNetworkElement,l=s(o,a),c=s(i,r);return l&&c&&t.associationType===e.associationType}return t.globalId!=null&&e.globalId!=null&&t.globalId===e.globalId}async _findLayersBySourceId(t){let{_utilityNetwork:e,map:s}=this;e?.loaded||await e?.load();let o=e.getLayerIdBySourceId(t),i=s.allLayers.filter(r=>!!e?.isUtilityLayer(r)&&r.layerId===o),a=s.allTables.filter(r=>!!e?.isUtilityLayer(r)&&r.layerId===o);return i.concat(a).toArray()}_getAssociationsByType(t){switch(t){case"attachment":return this._attachmentAssociations;case"structure":return this._structureAssociations;case"connectivity":return this._connectivityAssociations;case"container":return this._containerAssociations;case"content":return this._contentAssociations}}_getAssociationTypeTitle(t){let{messages:e}=this;if(t.title)return t.title;switch(t.type){case"attachment":return e?.associationsAttachments??this.messages?.noTitle??"";case"connectivity":return e?.associationsConnectivity??this.messages?.noTitle??"";case"structure":return e?.associationsStructure??this.messages?.noTitle??"";case"content":return e?.associationsContents??this.messages?.noTitle??"";case"container":return e?.associationsContainer??this.messages?.noTitle??""}}_getFeatureCountForAssociationType(t){switch(t){case"attachment":return this._attachmentFeatureCount;case"structure":return this._structureFeatureCount;case"content":return this._contentFeatureCount;case"container":return this._containerFeatureCount;case"connectivity":return this._connectivityFeatureCount}}_getFeatureQueryWhereClause(t,e,s,o){let i=t.globalIdField,a=t.fieldsIndex.get(j.assetGroup),r=t.fieldsIndex.get(j.assetType),l=s!=null,c=o!=null,d=i?U.sqlIn(i,e):null,u=l?`(${a?.name} = ${s})`:null,h=l&&c?`(${r?.name} = ${o})`:null;return[d,u,h].filter(Boolean).join(" AND ")}_getFeatureTitle(t){let e=t.attributes,s=t.sourceLayer;if(!e||!s)return"";let o="displayField"in s?s.displayField:null,i=o!=null?e[o.toString()]:null,a=i!=null?i.toString():null,r=t.getObjectId()?.toString();return a||r||""}async _loadUtiltyNetworks(){let t=this.map;if(!t)return;t.utilityNetworks&&await Promise.allSettled(t.utilityNetworks.map(s=>s.load()));let e=this._utilityNetwork;if(e){let s=o=>{if("layerId"in o&&e.isUtilityLayer(o)){let i=o.layerId!=null?e.getSourceIdByLayerId(o.layerId):null;i!=null&&this._networkSourceIdsInUse.add(i)}};this._networkSourceIdsInUse=new Set,t.allLayers.forEach(s),t.allTables.forEach(s)}}async _loadLayers(t){let e=t.filter(s=>!s.loaded).map(s=>s.load());e.length&&await Promise.allSettled(e)}_matchesGlobalFeature(t,e){return this._equals(t.association,e.association)}async _queryAssociatedFeatures(t,e){let{layer:s,_globalId:o,associationTypes:i,_utilityNetwork:a,_canQuery:r,_associationFeatures:l}=this;if(await Promise.allSettled([s?.load(),a?.load()]),!r||!s||!i||!a)return;let c=this._getAssociationsByType(t.type),{associatedAssetGroup:d,associatedAssetType:u}=t,h=new Map;c.forEach(n=>{let{fromNetworkElement:_,toNetworkElement:y}=n,{networkSourceId:w,elementGlobalId:b}=_.globalId===o?{networkSourceId:y.networkSourceId,elementGlobalId:y.globalId}:{networkSourceId:_.networkSourceId,elementGlobalId:_.globalId},g=h.get(w)||[];g.push(b),h.set(w,g)});let m=await this._createAssociationFeatureObjects(c,h,d,u,e);this._parseFeatureObjects(m,l)}async _queryAssociations(t){let{layer:e,_globalId:s,associationTypes:o,_utilityNetwork:i,_canQuery:a}=this;if(await Promise.allSettled([e?.load(),i?.load()]),this._clearAssociations(),!a||!e||!o||!i||!s)return;let r=F(e)?e.parent:e,l=new B({globalId:s,networkSourceId:i.getSourceIdByLayerId(r.layerId)}),c=new Set;o.forEach(n=>{switch(n.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity");break}});let d=await i?.queryAssociations(new P({elements:[l],types:Array.from(c)}),{signal:t?.signal}),u=new Map,h=new Map;o.forEach(n=>{h.set(n.type,n),u.set(n.type,[])}),d.forEach(n=>{let{toNetworkElement:_,fromNetworkElement:y}=n;switch(n.associationType){case"attachment":if(y?.globalId===s){if(this._shouldDiscardNetworkElement(_,"attachment",h))break;u.get("attachment")?.push(_.globalId),this._attachmentAssociations.add(n)}else{if(this._shouldDiscardNetworkElement(y,"structure",h))break;u.get("structure")?.push(y.globalId),this._structureAssociations.add(n)}break;case"connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":case"junction-junction-connectivity":if(y?.globalId===s){if(this._shouldDiscardNetworkElement(_,"connectivity",h))break;u.get("connectivity")?.push(_.globalId)}else{if(this._shouldDiscardNetworkElement(y,"connectivity",h))break;u.get("connectivity")?.push(y.globalId)}this._connectivityAssociations.add(n);break;case"containment":if(y?.globalId===s){if(this._shouldDiscardNetworkElement(_,"content",h))break;u.get("content")?.push(_.globalId),this._contentAssociations.add(n)}else{if(this._shouldDiscardNetworkElement(y,"container",h))break;u.get("container")?.push(y.globalId),this._containerAssociations.add(n)}break}});let m=o.map(async n=>{let{associatedNetworkSourceId:_,associatedAssetGroup:y,associatedAssetType:w}=n,b=u.get(n.type),g=y!=null?await this._countAssociatedFeatures(_,b,y,w,t):b.length;switch(n.type){case"attachment":this._attachmentFeatureCount=g;break;case"connectivity":this._connectivityFeatureCount=g;break;case"container":this._containerFeatureCount=g;break;case"content":this._contentFeatureCount=g;break;case"structure":this._structureFeatureCount=g;break}});await Promise.allSettled(m)}async _queryFeatureCount(){await this._loadUtiltyNetworks();let{_queryFeatureCountAbortController:t,_canQuery:e}=this;if(!e){this._featureCount=0;return}await this._queryAssociations(t),this._featureCount=this._attachmentFeatureCount+this._connectivityFeatureCount+this._containerFeatureCount+this._contentFeatureCount+this._structureFeatureCount}async _queryLayer(t,e,s,o,i){let a=this._getFeatureQueryWhereClause(t,e,s,o),r=new x({where:a,outFields:["*"],cacheHint:this._supportsCacheHint}),{features:l}=await E(t,r,i);return l}_parseFeatureObjects(t,e){let s=C();t.forEach(o=>{let i=(o?.feature).sourceLayer;Q(s,i,()=>new f).add(o)});for(let[o,i]of s)this._sortFeatureObjectsByTitle(i),e.set(o,i)}_selectAssociationType(t){let{flowItems:e}=this;e&&(this._activeAssociationType=t,this._setUpUtilityNetworkAssociationsViewModels(),this._addAssociationTypeFlowItem(t))}_setUpUtilityNetworkAssociationsViewModels(){this._associationViewModels.forEach((i,a)=>{let r=this._associationFeatures.get(a);r?i.forEach(l=>{r.find(c=>this._matchesGlobalFeature(l,c))||(i.remove(l),i.length||this._associationViewModels.delete(a))}):(i.removeAll(),this._associationViewModels.delete(a))});let{map:t,view:e,spatialReference:s,timeZone:o}=this;this._associationFeatures.forEach((i,a)=>{let r=this._associationViewModels.get(a)||new f;i?.filter(Boolean).forEach((l,c)=>{if(!r.some(d=>this._matchesGlobalFeature(d,l))){let{association:d,feature:u,terminalName:h,title:m}=l;r.add({title:m,association:d,featureViewModel:new G({abilities:{utilityNetworkAssociationsContent:!1},map:t,view:e,spatialReference:s,timeZone:o,graphic:u}),terminalName:h},c)}}),this._associationViewModels.set(a,r)})}_shouldDiscardNetworkElement(t,e,s){if(!t)return!1;let{networkSourceId:o}=t,i=s.get(e)?.associatedNetworkSourceId,a=this._networkSourceIdsInUse.has(o);return i!=null&&i!==o||!a}_sortFeatureObjectsByTitle(t){t.sort(this._compareByFeatureTitle)}render(){let{_state:t}=this;return p`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .headingLevel=${this.headingLevel} .description=${this.description}></arcgis-feature-element-info>${t==="loading"?this._renderLoading():t==="disabled"?this._renderAssociationNotFound():this._renderContent()}</div>`}_renderAssociationNotFound(){return p`<calcite-notice icon=information kind=info open scale=s width=full><div slot=message>${this.messages?.noAssociations}</div></calcite-notice>`}_renderAssociationTypeList(t){return this._getFeatureCountForAssociationType(t.type)>0?this._renderAssociationTypeListItem(t):null}_renderAssociationTypeListItem(t){let e=this._getAssociationTypeTitle(t);return A(`association-type-${t.type}`,p`<calcite-list-item .description=${S(t.description)} .label=${S(e)} .value=${t.type} @calciteListItemSelect=${()=>this._selectAssociationType(t)}><calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon></calcite-list-item>`)}_renderContent(){let{_state:t,associationTypes:e,messages:s}=this,o=s?.associationsList??s?.noTitle??"";return A("list-container",p`<div class="list-container">${t==="ready"?p`<div><calcite-list display-mode=flat .label=${o}>${e.map(i=>this._renderAssociationTypeList(i))}</calcite-list></div>`:null}${this._renderStickyLoading()}</div>`)}_renderLoading(){return p`<div class="loading-container">${this._renderLoadingIcon()}${this._renderStickyLoading()}</div>`}_renderLoadingIcon(){return p`<calcite-loader inline label></calcite-loader>`}_renderStickyLoading(){return this._state==="querying"?p`<div class="sticky-loading-container">${this._renderLoadingIcon()}</div>`:null}};N("arcgis-feature-utility-network-associations",v);return v},"applications/Components/featureUtils","applications/Components/stringUtils","core/Collection","core/promiseUtils","core/reactiveUtils","core/sql","rest/networks/support/NetworkElement","rest/networks/support/QueryAssociationsParameters","rest/support/Query","widgets/Feature/FeatureViewModel",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import j from"./F2MDJ3QQ.js";import i from"./DHDFI523.js";import h from"./NKR3PQHN.js";import{a as b}from"./J6UG5EF7.js";import g from"./2SQ2T6UO.js";import f from"./5CJ44XUV.js";import{a as se}from"./SVVJHTPA.js";import e from"./3JMJAUSY.js";import c from"./RO4TU5R3.js";import{g as re}from"./55IJQTCC.js";import"./7DOI3267.js";import a from"./O5TDDX7K.js";import"./EHZW6UXL.js";import{M as V,N as D,O as ee,P as te,Q as N,R as ie,U as ae,a as Y,b as d,c as R,x as E}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([{property:s,subclass:C},Z,B,{getApplicationClipboard:Me},Ce,j,{getFullTemplate:ce,isSharedTemplate:de,getCreationAttributes:Fe,isSharedTemplateOrMetadata:me},{createApplySetModifyItem:W,createApplySet:J,createFeatureStateProvider:Q,createApplySetAddItem:q,writeApplySetToService:_e},{whenOnce:ue,watch:X},{getRendererFields:pe,getFeatureEditFields:xe},Pe,{substitute:y},{createGraphicsMover:$e},,,,oe,,{g:U},{a:le,b:ne}])=>{var Ae=Y`.esri-widget__heading{color:var(--calcite-color-text-2);margin:0 0 .5rem;font-weight:var(--calcite-font-weight-semibold)}h1.esri-widget__heading{font-size:var(--calcite-font-size-xl)}h2.esri-widget__heading{font-size:var(--calcite-font-size-md)}h3.esri-widget__heading,h4.esri-widget__heading,h5.esri-widget__heading,h6.esri-widget__heading{font-size:var(--calcite-font-size)}.esri-widget{box-sizing:border-box;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget *,.esri-widget :before,.esri-widget :after{box-sizing:inherit}.esri-widget.esri-widget--disabled>*{opacity:.4;pointer-events:none}.esri-widget.esri-widget--compact{--esri-widget-padding-y: 0;--esri-widget-padding-x: 0}.esri-widget__anchor{color:var(--calcite-color-text-2)}.esri-widget__anchor:hover{color:var(--calcite-color-text-3)}.esri-widget__anchor:hover,.esri-widget__anchor:focus{text-decoration:underline}.esri-widget__anchor--disabled{opacity:.4;pointer-events:none}.esri-widget__header{background-color:var(--calcite-color-foreground-1);flex:1 0 100%;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 0 12px 15px;display:flex}.esri-widget__heading{word-break:break-word}.esri-widget__header .esri-widget__heading{width:calc(100% - 48px);text-align:initial;color:var(--calcite-color-text-1);align-items:center;margin:0;padding:0;display:flex}.esri-widget__header-button{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);border:none;flex:0 0 48px;justify-content:center;align-self:stretch;align-items:center;width:48px;padding:0;display:flex}.esri-widget__footer{background-color:var(--calcite-color-foreground-1);justify-content:center;align-items:center;width:100%;min-height:48px;display:flex}.esri-widget__footer-pagination{color:var(--calcite-color-text-2);justify-content:space-between;align-items:center;display:flex}.esri-widget__footer-pagination-previous-button,.esri-widget__footer-pagination-next-button{cursor:pointer;background-color:var(--calcite-color-foreground-1);border:0;margin:0 7px;padding:12px 15px;transition:background-color .125s ease-in-out}.esri-widget__footer-pagination-previous-button:hover,.esri-widget__footer-pagination-previous-button:focus,.esri-widget__footer-pagination-next-button:hover,.esri-widget__footer-pagination-next-button:focus{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.esri-menu{visibility:hidden;z-index:1;background-clip:padding;background-color:var(--calcite-color-foreground-1);background-clip:padding-box;width:100%;max-height:0;margin:2px 0 0;padding:0;font-size:var(--calcite-font-size);line-height:var(--calcite-spacing-xl);position:absolute;top:100%;left:0;overflow:hidden;box-shadow:0 1px 2px #0000004d}.esri-menu .esri-menu__header{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse);padding:6px 12px}.esri-menu__list{margin:0;padding:0;list-style:none}.esri-menu__list-item{cursor:pointer;border-top:1px solid #adadad4d;border-left:3px solid #0000;padding:.8em 1em}.esri-menu__list-item [class^=esri-icon-],.esri-menu__list-item [class*=" esri-icon-"]{padding-right:2.8px}.esri-menu__list-item:first-child{border-top:none}.esri-menu__list-item--focus,.esri-menu__list-item:hover,.esri-menu__list-item:focus{background-color:var(--calcite-color-foreground-1)}.esri-menu__list-item:active{background-color:var(--calcite-color-foreground-current)}.esri-menu__list-item--active,.esri-menu__list-item--active:hover,.esri-menu__list-item--active:focus{background-color:var(--calcite-color-foreground-1);border-left-color:var(--calcite-color-brand)}.esri-widget__table{border-collapse:collapse;color:var(--calcite-color-text-1);border:none;width:100%;line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget__table tr:nth-child(odd){background-color:var(--calcite-color-transparent)}.esri-widget__table tr:nth-child(2n){background-color:var(--calcite-color-transparent-press)}.esri-widget__table tr a{color:var(--calcite-color-text-2)}.esri-widget__table tr a:hover,.esri-widget__table tr a:focus{color:var(--calcite-color-text-1)}.esri-widget__table tr td,.esri-widget__table tr th{vertical-align:top;word-break:break-word;padding:.5em .7em;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular)}.esri-widget__table tr th{text-align:left;border-right:3px solid #0000000d;width:50%}.esri-widget__table tr td{width:50%}.esri-input{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1);border:1px solid #959595;font-size:var(--calcite-font-size)}.esri-input::-ms-clear{display:none}.esri-input::placeholder{opacity:1;color:var(--calcite-color-text-2)}.esri-input:placeholder-shown{text-overflow:ellipsis}.esri-input[type=text],.esri-input[type=password],.esri-input[type=number]{height:32px;padding:0 .5em}calcite-combobox.esri-input{border:none}.esri-widget__content--empty{text-align:center;color:var(--calcite-color-border-input);flex-flow:column wrap;align-items:center;padding:18px 22px;display:flex}.esri-widget__content--empty h1.esri-widget__heading,.esri-widget__content--empty h2.esri-widget__heading,.esri-widget__content--empty h3.esri-widget__heading,.esri-widget__content--empty h4.esri-widget__heading,.esri-widget__content--empty h5.esri-widget__heading{font-weight:var(--calcite-font-weight-regular)}.esri-widget__content-illustration--empty{width:128px;padding:1rem 0}.esri-widget__content-icon--empty{width:32px;padding:.5rem 0}.esri-select{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background:var(--calcite-color-foreground-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 32 32' width='32' height='32'%3E%3Cpath d='M8 11.207l-4-4V5.793l4 4 4-4v1.414z' fill='%23adadad' fillrule='nonzero'/%3E%3C/svg%3E") 100% no-repeat;border:1px solid #959595;border-radius:0;width:100%;height:32px;margin:0;padding:0 .5em;font-family:inherit;font-size:.85em;display:block}.esri-select[disabled]{cursor:auto}.esri-select::-ms-expand{display:none}.esri-disabled a,.esri-disabled [role=menu],.esri-disabled [role=checkbox],.esri-disabled [class^=esri-icon-],.esri-disabled [class*=" esri-icon-"]{color:var(--calcite-color-text-3)}.keynav-mode .esri-widget:focus,.keynav-mode .esri-widget :focus{z-index:1;outline-offset:2px;outline:2px solid #adadad}.esri-widget__loader-animation{border:.15em solid #adadad4d;border-top-color:var(--calcite-color-border-input);border-radius:100%;width:1em;height:1em;font-size:var(--calcite-font-size-md);animation:1.25s linear infinite esri-rotate;display:block;transform:translateZ(0)}:dir(rtl) .esri-widget__table th{text-align:right;border-left:3px solid #0000000d;border-right:none}:dir(rtl) .esri-select{background-position:0}:dir(rtl) .esri-menu__list-item{border-left:none;border-right:3px solid #0000}:dir(rtl) .esri-menu__list-item [class^=esri-icon-],:dir(rtl) .esri-menu__list-item [class*=" esri-icon-"]{padding-left:2px;padding-right:0}:dir(rtl) .esri-menu__list-item--active{border-right-color:var(--calcite-color-brand)}.esri-icon-font-fallback-text{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.esri-rotating{animation:1.25s linear infinite esri-rotate;transform:translateZ(0)}.esri-clearfix:before,.esri-clearfix:after{content:" ";display:table}.esri-clearfix:after{clear:both}.esri-interactive{cursor:pointer}.esri-hidden{display:none!important}.esri-invisible{visibility:hidden!important}.esri-offscreen{position:absolute;top:-999em;left:-999em}.esri-match-height{flex-direction:column;flex:auto;display:flex;overflow:hidden}:host{display:flex}.arcgis-paste{height:var(--arcgis-paste-height, 300px);width:var(--arcgis-paste-width, 300px);flex:1}.hidden{display:none}.flex-row{flex-direction:row}.justify-center{justify-content:center}.h-full{height:100%}.w-full{width:100%}.flex{display:flex}.text-center{text-align:center}.pad-contents{padding:var(--arcgis-paste-blocks-padding, var(--calcite-spacing-md))}.merge-feature-form{padding-left:var(--arcgis-paste-blocks-padding, var(--calcite-spacing-md));padding-right:var(--arcgis-paste-blocks-padding, var(--calcite-spacing-md));padding-bottom:var(--arcgis-paste-blocks-padding, var(--calcite-spacing-md))}.pad-start-end{padding-left:var(--arcgis-paste-blocks-padding, var(--calcite-spacing-md));padding-right:var(--arcgis-paste-blocks-padding, var(--calcite-spacing-md))}.gallery-content{padding-top:var(--arcgis-paste-blocks-padding, var(--calcite-spacing-md));padding-bottom:var(--arcgis-paste-blocks-padding, var(--calcite-spacing-md));display:flex;row-gap:var(--arcgis-paste-blocks-padding, var(--calcite-spacing-md));flex-direction:column}.chip-indent{margin-left:5px;margin-right:5px}.merge-split-view-container{display:flex;flex-direction:column;height:100%}.merge-split-view-items{flex:0 1 auto;max-height:50%;overflow-y:scroll}.merge-split-view-attributes{flex:1;overflow-y:scroll}.choose-feature{position:absolute;width:100%;max-height:100%;z-index:2;overflow-y:auto}.bau-pick{display:flex;flex-direction:row;align-items:center;gap:4px}.danger-icon-warning{--calcite-icon-color: var(--calcite-color-status-danger)}.paste-feature-templates{--arcgis-feature-templates-max-list-height: 100%}`;async function Ee(e,t={}){if(e?.type==="subtype-group"){if(!e.subtypeField)return[];let i=t[e.subtypeField];if(!be(i))return[];let a=e.findSublayerForSubtypeCode(i);return a?a.renderer&&a.fieldsIndex?await pe(a.renderer,e.fieldsIndex):[]:[]}return e?e.renderer&&e.fieldsIndex?await pe(e.renderer,e.fieldsIndex):[]:[]}function Ie(e,t,i,a,r,o){let l={...a},h=ke(o),p=Se(o),m="";(o.type==="subtype-group"||o.type==="subtype-sublayer")&&(m=o.subtypeField??"");let v=o.objectIdField??"";return e.forEach(u=>{if(u.name!==v&&!h.includes(u.name)&&!p.includes(u.name)&&!r.includes(u.name)&&u.type!=="global-id"&&(m===""||m!==u.name)){let w=He(u,t);w.match&&w.targetField&&(l[w.targetField?.name]=i[u.name])}}),l}function ke(e){return e&&"relationships"in e?(e.relationships??[]).filter(t=>t.role==="origin").map(t=>t.keyField):[]}function Se(e){return e?.type==="subtype-sublayer"&&(e=e.parent),e?xe(e):[]}function Te(e,t){if(e.type===t.type)return t.type==="string"?e.length<=t.length:!0;switch(e.type){case"small-integer":return["integer","big-integer"].includes(t.type);case"integer":return t.type==="big-integer";case"single":return t.type==="double";default:return!1}}function He(e,t){let i={match:!1,sourceField:null,targetField:null};for(let a of t)if(Te(e,a)){let r=e.name.replace(/\s/gu,"").toLowerCase();if(a.name.replace(/\s/gu,"").toLowerCase()===r)return i.match=!0,i.sourceField=e,i.targetField=a,i}return i}async function ge(e,t,i,a){let r=!0,o={hasAsyncArcadeExpressions:!1},l=e.items.filter(h=>h.type==="add");for(let h of l){let p=h.graphic.clone(),m=Oe(h.graphic,h.layer);if(!m){r=!1;continue}let v=!await Ge(t,h.graphic,m,i,o);if(o.hasAsyncArcadeExpressions&&l.length>a)return!1;let u=W({graphic:h.graphic,layer:h.layer,originalGraphic:p});if(e.push(u),!v)return!1}return r}function Oe(e,t){return t.type==="feature"||t.type==="subtype-sublayer"?t:t.findSublayerForFeature(e)||null}async function Ge(e,t,i,a,r){let o=i.formTemplate,l=i.fields.filter(w=>{let z=t.attributes[w.name],fe=z===null||z===""||z===void 0;return w.editable&&!w.nullable&&fe});if(!o)return l.length!==0;let h=new Set;we(o.elements??[],h);let p=new Set;if(ve(o.elements??[],p),h.size===0&&p.size===0)return l.length>0;let m=t.clone();m.layer=i,delete m.attributes[i.objectIdField],a.has(i)||a.set(i,new Pe({map:e.map,editType:"INSERT"}));let v=a.get(i);if(v.features=new j([m]),await ue(()=>(v.status==="loaded"||v.status==="failed")&&!v.updating),v.hasAsyncArcadeExpressions&&(r.hasAsyncArcadeExpressions=!0),v.status==="failed")return!0;let u=v.getValues(m)??{};if(i.objectIdField&&u[i.objectIdField]!==void 0){let{[i.objectIdField]:w,...z}=u;u=z}return Object.keys(u).forEach(w=>{i.fieldsIndex.has(w)&&(t.attributes[w]=ze(u[w],w,i.fieldsIndex))}),v.invalidFeatures.length>0}function ve(e,t){for(let i of e)i.type==="group"?ve(i.elements,t):i.type==="field"&&i.valueExpression&&t.add(i.fieldName)}function we(e,t){for(let i of e)i.type==="group"?we(i.elements,t):i.type==="field"&&i.requiredExpression&&t.add(i.fieldName)}function be(e){return typeof e=="number"}function Le(e){return typeof e=="number"&&window.isFinite(e)&&Math.floor(e)===e}function ze(e,t,i){if(e==null)return null;switch(i.get(t).type){case"big-integer":case"long":case"oid":case"integer":case"small-integer":return Le(e)?e:window.parseInt(e);case"single":case"double":return be(e)?e:window.parseFloat(e);case"global-id":case"guid":return e===""?null:e;case"date":break;case"date-only":case"time-only":case"timestamp-offset":return e===""?null:e;case"string":return e===""?null:e}return e}function Ve(e){return e&&"layer"in e?e.layer:void 0}function I(e){if(!e)return null;let t=Ve(e.origin)??e.layer??e?.sourceLayer??null;if(t&&t.type==="subtype-sublayer")return t.parent;switch(t?.type){case"csv":case"feature":case"geojson":case"ogc-feature":case"subtype-group":case"wfs":return t;default:return null}}var De=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,A=(e,t,i,a)=>{for(var r=a>1?void 0:a?Be(t,i):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(r=(a?l(t,i,r):l(r))||r);return a&&r&&De(t,i,r),r},ye={noChangeError:"Operation has not made any changes",noSelectedError:"Operation requires a selected feature",deletesGeometryError:"Operation would result in a null geometry",noGeometryError:"The selected feature has not geometry"},g=class extends Z{constructor(e){super(e)}get mustShowOnCommandPage(){return!0}get icon(){}get id(){return""}label(e,t){return""}description(e,t){return""}get commandEnabled(){return!1}commandDisabledReason(e,t){return""}get immediate(){return!1}async initiate(e,t){}async execute(){throw new Error("arcgis-paste: Paste command does not support execute")}async runPasteCommand(e,t,i){try{this.viewModel.applying=!0;let a=await this.prepareCopy(t);if(!a||a.items.length===0){this.viewModel.lastPasteError={errorCode:"noPasteItems",errorMessage:"No items to paste",localizedErrorMessage:"noPasteItemsError"},e.onPasteError(this.viewModel.lastPasteError);return}let r=a.items.length>this.viewModel.maximumFeatureCount||this.viewModel.alwaysShowFeatureForm||i?.showFeatureForm===!0||!await ge(a,this.viewModel.view,this.viewModel.formViewModelMap,this.viewModel.maximumFeatureCountWithComplexForms);if(this.viewModel.alwaysShowFeatureForm||r||i?.showFeatureForm===!0)this.viewModel.bauActiveFeatureIndex=0,this.viewModel.bauApplySet=a,this.viewModel.activeCommand=t,this.viewModel.bauOriginalGraphics=a.items.map(o=>o.type==="add"?{layer:o.layer,graphic:o.graphic}:null).filter(o=>o!==null),this.viewModel.bauFeatures=new j,this.viewModel.activeFlowPage="form-page",await new Promise(o=>{setTimeout(o,100)}),this.viewModel.bauFeatures=new j(this.viewModel.bauOriginalGraphics.map(o=>(o.graphic.layer=o.layer,o.graphic))),this.viewModel.updateIndividualMultiFeatureFormHighlight();else try{let o=await e.onApply({command:"paste",applySet:a});if(o.success){this.viewModel.resetHome(),this.viewModel.closeOnApply&&e.closeAfterApply();return}this.viewModel.handleApplyError(o,e.onPasteError)}catch(o){this.viewModel.lastPasteError={errorCode:"unexpectedError",errorMessage:o.message,localizedErrorMessage:"unexpectedError"},e.onPasteError(this.viewModel.lastPasteError);return}finally{a?.featureState?.clearAll()}}finally{this.viewModel.applying=!1}}async prepareCopy(e){let t=e==="paste"||e==="paste-as"&&this.viewModel.pasteWithAttributes||e==="paste-merge"&&this.viewModel.pasteWithAttributes,i=t&&e==="paste-merge"?this.viewModel.clipboard.items.getItemAt(this.viewModel.selectedClipboardItemIndex):null,a=J();if(a.featureState=Q(this.viewModel.view),e==="paste-merge"){let r=this.viewModel.pasteTemplate?.template?await ce(this.viewModel.view,this.viewModel.pasteTemplate.template):null;if(!r)return null;let o=de(this.viewModel.pasteTemplate.template)?r.layer:this.viewModel.pasteTemplate.layer,l=await this.createMergedClipboardGeom(),h=await this.constructFeatureAttributesCopy(r,o,i),p=new B({geometry:l,attributes:h});this.removeGraphicIdentifierFields(p,o),a.push(q({graphic:p,layer:o}))}else if(e==="paste")for(let r of this.viewModel.clipboardFeatures){let o=r.graphic.clone();this.removeGraphicIdentifierFields(o,r.layer),a.push(q({graphic:o,layer:r.layer}))}else if(e==="paste-as"){let r=this.viewModel.pasteTemplate?.template?await ce(this.viewModel.view,this.viewModel.pasteTemplate.template):null;if(!r)return null;let o=de(r)?r.layer:this.viewModel.pasteTemplate.layer;for(let l of this.viewModel.clipboardFeatures){let h=await this.constructFeatureAttributesCopy(r,o,t?l:null),p=new B({geometry:l.graphic?.geometry?.clone()??null,attributes:h});this.removeGraphicIdentifierFields(p,o),a.push(q({graphic:p,layer:o}))}}return a}async constructFeatureAttributesCopy(e,t,i){let a=Fe(e,{});if(i){let r=i.layer?.fields;if(r){let o=t.fields,l=i.graphic.attributes??{},h=await Ee(t,a);a=Ie(r,o,l,a,h,t)}}return a}async createMergedClipboardGeom(){let e=this.viewModel.clipboardFeatures.map(t=>t.graphic?.geometry).filter(t=>t!=null).toArray();return e.length===0?null:e.length===1?e[0].clone():(await $arcgis.t(m=>m[0],"geometry/operators/unionOperator")).executeMany(e)??null}removeGraphicIdentifierFields(e,t){t.objectIdField&&delete e.attributes[t.objectIdField],t.globalIdField&&delete e.attributes[t.globalIdField]}};A([s()],g.prototype,"viewModel",2);A([s()],g.prototype,"mustShowOnCommandPage",1);A([s()],g.prototype,"icon",1);A([s()],g.prototype,"id",1);A([s()],g.prototype,"commandEnabled",1);A([s()],g.prototype,"commandDisabledReason",1);A([s()],g.prototype,"immediate",1);g=A([C("components.paste.commands.PasteCommand")],g);var je=Object.defineProperty,We=Object.getOwnPropertyDescriptor,T=(e,t,i,a)=>{for(var r=a>1?void 0:a?We(t,i):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(r=(a?l(t,i,r):l(r))||r);return a&&r&&je(t,i,r),r},F=class extends g{get id(){return"paste-append"}get icon(){return"reshape-add-geometry"}get immediate(){return!0}get mustShowOnCommandPage(){return!0}get commandEnabled(){return this.viewModel.clipboardFeatures.length>0&&this.viewModel.selectedFeature!==void 0&&this.viewModel.layerPermissionsCheck.canUpdate(I(this.viewModel.selectedFeature))&&this.viewModel.selectedFeature?.geometry!==null&&(this.viewModel.selectedFeature?.geometry?.type==="multipoint"||this.viewModel.selectedFeature?.geometry?.type==="polyline"||this.viewModel.selectedFeature?.geometry?.type==="polygon")&&this.viewModel.clipboard.singleGeometryType===this.viewModel.selectedFeature?.geometry?.type}async initiate(e){let t=null;try{this.viewModel.applying=!0;let i=await this.prepareAppend();if(i.applySet&&(t=i.applySet),!i.success){this.viewModel.lastPasteError={errorCode:i.failReason,errorMessage:ye[i.failReason],localizedErrorMessage:i.failReason},e.onPasteError(this.viewModel.lastPasteError);return}let a=await e.onApply({command:"paste-append",applySet:i.applySet});if(a.success){this.viewModel.resetHome(),this.viewModel.closeOnApply&&e.closeAfterApply();return}this.viewModel.handleApplyError(a,e.onPasteError)}catch(i){this.viewModel.lastPasteError={errorCode:"unexpectedError",errorMessage:i.message,localizedErrorMessage:"unexpectedError"},e.onPasteError(this.viewModel.lastPasteError);return}finally{this.viewModel.applying=!1,t&&(t.featureState?.clearAll(),t.featureState=null)}}async execute(){let e=await this.prepareAppend();if(!e.success)throw new Error(`arcgis-paste: Paste append failed. ${e.failReason}`);return{success:!0,userInputRequired:!1,applySet:e.applySet}}async prepareAppend(){let e=J();if(e.featureState=Q(this.viewModel.view),!this.viewModel.selectedFeature)return{success:!1,failReason:"noSelectedError"};let[t,i]=await Promise.all([$arcgis.t(m=>m[0],"geometry/operators/unionOperator"),$arcgis.t(m=>m[0],"geometry/operators/equalsOperator")]),a=this.viewModel.selectedFeature.geometry,r=!1;for(let l of this.viewModel.clipboardFeatures){let h=l?.graphic?.geometry??null;if(!h)continue;if(a===null){a=l?.graphic?.geometry??null,a&&(a=a.clone(),r=!0);continue}let p=t.execute(a,h);i.execute(a,p)||(a=p,r=!0)}if(!r)return{success:!1,failReason:"noChangeError"};let o=this.viewModel.selectedFeature.clone();return o.geometry=a,e.push(W({graphic:o,layer:I(this.viewModel.selectedFeature),originalGraphic:this.viewModel.selectedFeature})),{success:!0,applySet:e}}description(e,t){return e.pasteAppendDesc}label(e,t){return e.pasteAppendTitle}};T([s()],F.prototype,"id",1);T([s()],F.prototype,"icon",1);T([s()],F.prototype,"immediate",1);T([s()],F.prototype,"mustShowOnCommandPage",1);T([s()],F.prototype,"commandEnabled",1);F=T([C("components.paste.commands.PasteAppendCommand")],F);var Re=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,H=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ne(t,i):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(r=(a?l(t,i,r):l(r))||r);return a&&r&&Re(t,i,r),r},_=class extends g{get id(){return"paste-subtract"}get icon(){return"reshape-subtract-geometry"}get immediate(){return!0}get mustShowOnCommandPage(){return!0}get commandEnabled(){return this.viewModel.clipboardFeatures.length>0&&this.viewModel.selectedFeature!==void 0&&this.viewModel.layerPermissionsCheck.canUpdate(I(this.viewModel.selectedFeature))&&this.viewModel.selectedFeature?.geometry!==null&&(this.viewModel.selectedFeature?.geometry?.type==="multipoint"||this.viewModel.selectedFeature?.geometry?.type==="polyline"||this.viewModel.selectedFeature?.geometry?.type==="polygon")&&(this.viewModel.clipboard.singleGeometryType===this.viewModel.selectedFeature?.geometry?.type||this.viewModel.clipboard.singleGeometryType==="polygon")}async prepareSubtract(){let e=J();if(e.featureState=Q(this.viewModel.view),!this.viewModel.selectedFeature)return{success:!1,failReason:"noSelectedError",applySet:e};let[t,i]=await Promise.all([$arcgis.t(m=>m[0],"geometry/operators/differenceOperator"),$arcgis.t(m=>m[0],"geometry/operators/equalsOperator")]),a=this.viewModel.selectedFeature.geometry;if(!a)return{success:!1,failReason:"noGeometryError",applySet:e};let r=!1;for(let l of this.viewModel.clipboardFeatures){let h=l?.graphic?.geometry;if(!h)continue;let p=t.execute(a,h);if(!p)return{success:!1,failReason:"deletesGeometryError",applySet:e};i.execute(a,p)||(a=p,r=!0)}if(!r)return{success:!1,failReason:"noChangeError",applySet:e};let o=this.viewModel.selectedFeature.clone();return o.geometry=a,e.push(W({graphic:o,layer:I(this.viewModel.selectedFeature),originalGraphic:this.viewModel.selectedFeature})),{success:!0,applySet:e}}async execute(){let e=await this.prepareSubtract();if(!e.success)throw new Error(`arcgis-paste: Paste subtract failed. ${e.failReason}`);return{success:!0,userInputRequired:!1,applySet:e.applySet}}async initiate(e){let t=null;try{this.viewModel.applying=!0;let i=await this.prepareSubtract();if(i.applySet&&(t=i.applySet),!i.success){this.viewModel.lastPasteError={errorCode:i.failReason,errorMessage:ye[i.failReason],localizedErrorMessage:i.failReason},e.onPasteError(this.viewModel.lastPasteError);return}let a=await e.onApply({command:"paste-subtract",applySet:i.applySet});if(a.success){this.viewModel.resetHome(),this.viewModel.closeOnApply&&e.closeAfterApply();return}this.viewModel.handleApplyError(a,e.onPasteError)}catch(i){this.viewModel.lastPasteError={errorCode:"unexpectedError",errorMessage:i.message,localizedErrorMessage:"unexpectedError"},e.onPasteError(this.viewModel.lastPasteError);return}finally{this.viewModel.applying=!1,t&&(t.featureState?.clearAll(),t.featureState=null)}}description(e,t){return e.pasteSubtractDesc}label(e,t){return e.pasteSubtractTitle}};H([s()],_.prototype,"id",1);H([s()],_.prototype,"icon",1);H([s()],_.prototype,"immediate",1);H([s()],_.prototype,"mustShowOnCommandPage",1);H([s()],_.prototype,"commandEnabled",1);_=H([C("components.paste.commands.PasteSubtractCommand")],_);var Ue=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,O=(e,t,i,a)=>{for(var r=a>1?void 0:a?qe(t,i):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(r=(a?l(t,i,r):l(r))||r);return a&&r&&Ue(t,i,r),r},x=class extends g{get id(){return"paste-as"}get icon(){return"templates"}get immediate(){return!1}get mustShowOnCommandPage(){return!1}get commandEnabled(){return(this.viewModel.clipboardFeatures.length===1||this.viewModel.clipboardFeatures.length>0&&this.viewModel.pasteWithMultipleFeaturesEnabled)&&this.viewModel.clipboard.singleGeometryType!==void 0}async initiate(e){this.viewModel.activeFlowPage="gallery-page",this.viewModel.activeCommand="paste-as"}description(e,t){return e.pasteAsDesc}label(e,t){return e.pasteAsTitle}};O([s()],x.prototype,"id",1);O([s()],x.prototype,"icon",1);O([s()],x.prototype,"immediate",1);O([s()],x.prototype,"mustShowOnCommandPage",1);O([s()],x.prototype,"commandEnabled",1);x=O([C("components.paste.commands.PasteAsCommand")],x);var Xe=Object.defineProperty,Ke=Object.getOwnPropertyDescriptor,G=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ke(t,i):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(r=(a?l(t,i,r):l(r))||r);return a&&r&&Xe(t,i,r),r},P=class extends g{get id(){return"paste"}get icon(){return"duplicate"}get immediate(){return!0}get mustShowOnCommandPage(){return!0}get commandEnabled(){let e=this.viewModel.clipboardFeatures.length===1,t=this.viewModel.clipboardFeatures.length>0&&this.viewModel.clipboardItemLayers.length===1&&this.viewModel.pasteWithMultipleFeaturesEnabled,i=this.viewModel.clipboardFeatures.length>0&&this.viewModel.pasteWithMultipleFeaturesEnabled&&this.viewModel.pasteWithMultipleLayersEnabled;return this.viewModel.clipboardFeatures.length>0&&this.viewModel.canCreateOnAllLayers&&(e||t||i)}async initiate(e,t){await this.runPasteCommand(e,"paste",t)}async execute(){let e=await this.prepareCopy("paste");if(!e||e.items.length===0)throw new Error("arcgis-paste: No items to paste");return e.items.length>this.viewModel.maximumFeatureCount||!await ge(e,this.viewModel.view,this.viewModel.formViewModelMap,this.viewModel.maximumFeatureCountWithComplexForms)?{success:!1,userInputRequired:!0}:{success:!0,userInputRequired:!1,applySet:e}}description(e,t){return e.pasteDesc}label(e,t){return e.pasteTitle}};G([s()],P.prototype,"id",1);G([s()],P.prototype,"icon",1);G([s()],P.prototype,"immediate",1);G([s()],P.prototype,"mustShowOnCommandPage",1);G([s()],P.prototype,"commandEnabled",1);P=G([C("components.paste.commands.PasteSetCommand")],P);var Ze=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,L=(e,t,i,a)=>{for(var r=a>1?void 0:a?Je(t,i):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(r=(a?l(t,i,r):l(r))||r);return a&&r&&Ze(t,i,r),r},$=class extends g{get id(){return"paste-merge"}get icon(){return"merge"}get immediate(){return!1}get mustShowOnCommandPage(){return!0}get commandEnabled(){return this.viewModel.clipboardFeatures.length>1&&this.viewModel.clipboard.singleGeometryType!==void 0}async initiate(e){this.viewModel.activeFlowPage="gallery-page",this.viewModel.activeCommand="paste-merge";for(let t=0;t<this.viewModel.clipboard.items.length;t++)if(this.viewModel.clipboard.items.getItemAt(t).type==="feature"){this.viewModel.selectedClipboardItemIndex=t;break}}description(e,t){return e.pasteMergeDesc}label(e,t){return e.pasteMergeTitle}};L([s()],$.prototype,"id",1);L([s()],$.prototype,"icon",1);L([s()],$.prototype,"immediate",1);L([s()],$.prototype,"mustShowOnCommandPage",1);L([s()],$.prototype,"commandEnabled",1);$=L([C("components.paste.commands.PasteMergeCommand")],$);var Qe=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,k=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ye(t,i):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(r=(a?l(t,i,r):l(r))||r);return a&&r&&Qe(t,i,r),r},f=class extends g{constructor(e){super(e)}get id(){return this.customCommand.id}get icon(){return this.customCommand.icon}get immediate(){return!0}get mustShowOnCommandPage(){return!0}get commandEnabled(){return this.customCommand.commandEnabled(this.viewModel.clipboard,this.viewModel.selectedFeature)}async initiate(e){try{this.viewModel.applying=!0;let t=await e.onApply({command:this.id});if(t.success){this.viewModel.resetHome(),this.viewModel.closeOnApply&&e.closeAfterApply();return}this.viewModel.handleApplyError(t,e.onPasteError)}catch(t){this.viewModel.lastPasteError={errorCode:"unexpectedError",errorMessage:t.message,localizedErrorMessage:"unexpectedError"},e.onPasteError(this.viewModel.lastPasteError);return}finally{this.viewModel.applying=!1}}description(e,t){return this.customCommand.description(e,t)}label(e,t){return this.customCommand.label(e,t)}};k([s()],f.prototype,"customCommand",2);k([s()],f.prototype,"id",1);k([s()],f.prototype,"icon",1);k([s()],f.prototype,"immediate",1);k([s()],f.prototype,"mustShowOnCommandPage",1);k([s()],f.prototype,"commandEnabled",1);f=k([C("components.paste.commands.PasteCustomCommand")],f);var et=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,c=(e,t,i,a)=>{for(var r=a>1?void 0:a?tt(t,i):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(r=(a?l(t,i,r):l(r))||r);return a&&r&&et(t,i,r),r};function he(e){return!me(e)||e.type==="feature"}var n=class extends Z{constructor(e){super(e),this.customPasteCommands=new j,this.bauInvalidFeatures=[],this.bauFormValid=!0,this.bauFormUpdating=!1,this.bauActiveFeatureIndex=-1,this.bauHasTooManyFeatures=!1,this.bauHasTooManyComplexFeatures=!1,this.bauOriginalGraphics=[],this.formViewModelMap=new Map,this.supportedCommands=["paste-append","paste-as","paste-subtract","paste","paste-merge"],this.pasteWithMultipleLayersEnabled=!1,this.pasteWithMultipleFeaturesEnabled=!1,this.alwaysShowFeatureForm=!1,this.selectedClipboardItemIndex=-1,this.pasteWithAttributes=!0,this.closeOnApply=!1,this.currentPasteOperation="",this._activeFlowPage="commands-page",this.showClipboardItems=!1,this.hideTooltips=!1,this.hideFooter=!1,this.hideFooterCancelButton=!1,this.hideHeaderCloseButton=!1,this.hideViewClipboard=!1,this.hideErrorNotice=!1,this.highlightGroup="temporary",this._hoverHighlightHandle=null,this.maximumFeatureCount=200,this.maximumFeatureCountWithComplexForms=50,this.layerPermissionsCheck={canCreate:t=>t?!!t.effectiveCapabilities?.operations.supportsAdd:!1,canUpdate:t=>{if(!t)return!1;let i=t.effectiveCapabilities,a=!!i?.operations.supportsUpdate,r=!!i?.editing.supportsGeometryUpdate&&a;return!t.isTable&&!r?!1:a}},this.applying=!1}get bauActiveGraphic(){return this.bauActiveFeatureIndex===-1?void 0:this.bauFeatures?.getItemAt(this.bauActiveFeatureIndex)}get hasTooManyPasteCreateFeatures(){return this.clipboardFeatures.length>this.maximumFeatureCount&&["paste","paste-as"].includes(this.activeCommand??"")}get bauActiveLayer(){if(this.bauActiveFeatureIndex!==-1&&this.bauFeatures)return I(this.bauFeatures.getItemAt(this.bauActiveFeatureIndex))??void 0}get pasteTemplateIsValid(){return this.pasteTemplate?this.pasteTemplate.layer?!!this.workingLayers.includes(this.pasteTemplate.layer.type==="subtype-sublayer"?this.pasteTemplate.layer.parent:this.pasteTemplate.layer):!1:!0}get clipboardAndTemplateSupportAttributes(){if(this.clipboardFeatures.length===0||!this.pasteTemplate?.layer)return!1;let e=this.pasteTemplate.template;if(!he(e))return!1;for(let t of this.clipboardFeatures){let i=t.layer;if(!i)return!1;let a=i.type==="subtype-sublayer"?i.parent:i;if(a.type==="subtype-group"){let r=a.fieldsIndex.get(a.subtypeField).name,o=e.prototype?.[r];if(o==null||o!==t.graphic.attributes[r])return!1}}return!0}get hasClipboardItemMatchingTemplate(){let e=this.pasteTemplate?.layer;if(!e||this.clipboardFeatures.length===0)return!1;let t=this.pasteTemplate.template;if(!he(t))return!1;for(let i of this.clipboardFeatures){let a=i.layer;if(!a)return!1;let r=a.type==="subtype-sublayer"?a.parent:a;if(e===a){if(r.type==="subtype-group"){let o=r.fieldsIndex.get(r.subtypeField).name,l=t.prototype?.[o];if(l==null||l!==i.graphic.attributes[o])continue}return!0}}return!1}get activeFlowPage(){return this._activeFlowPage}set activeFlowPage(e){e==="clipboard"&&this.beforeClipboard===void 0?this.beforeClipboard=this.activeFlowPage:e!=="clipboard"&&(this.beforeClipboard=void 0),e==="form-page"&&this.beforeForm===void 0?this.beforeForm=this.activeFlowPage:e!=="form-page"&&(this.beforeForm=void 0),this._activeFlowPage=e,this.checkAndSuspendMove()}get updating(){return this.applying}formFeatureValuesChanged(e,t){if(!t)return;let i=e.graphic.clone();for(let r of Object.keys(t))i.attributes[r]=t[r];let a=W({graphic:i,originalGraphic:e.graphic.clone(),layer:e.layer});this.bauApplySet?.push(a)}highlightSelectedGraphicOnMap(e){if(this.clearHighlightSelectedGraphic(),!e.graphic?.geometry||!this.view)return;let t=new B({geometry:e.graphic.geometry,symbol:ne(e.graphic.geometry.type)});this.view.graphics.add(t),this._hoverHighlightHandle={remove:()=>{this.view.graphics.remove(t)}}}clearHighlightSelectedGraphic(){this._hoverHighlightHandle?.remove(),this._hoverHighlightHandle=null}updateIndividualMultiFeatureFormHighlight(){if(this.activeFlowPage!=="form-page"){this.clearIndividualFeatureFormHighlight();return}if(this.view)if(this.bauActiveGraphic&&this.bauActiveLayer){if(this.bauIndividualHighlight?.graphic!==this.bauActiveGraphic&&this.clearIndividualFeatureFormHighlight(),!this.bauIndividualHighlight){let e=U(this.view,this.bauActiveLayer);if(!e)return;this.bauIndividualHighlight={graphic:this.bauActiveGraphic,handle:e.highlight(this.bauActiveGraphic,{name:this.highlightGroup})}}}else this.clearIndividualFeatureFormHighlight()}clearIndividualFeatureFormHighlight(){this.bauIndividualHighlight?.handle?.remove(),this.bauIndividualHighlight=void 0}highlightMultiFeatureFormFeature(e,t){this.bauHighlight&&this.clearMultiFeatureFormHighlights();let i=this.view?U(this.view,e.layer):void 0;i&&(this.bauHighlight=i.highlight(e,{name:this.highlightGroup}))}clearMultiFeatureFormHighlights(){this.bauHighlight?.remove(),this.bauHighlight=void 0}updateClipboardGraphicsLayer(){if(!this.showClipboardItems){if(this.clipboardMover?.cancel(),this.clipboardMover=void 0,this.clipboardGraphicsLayer&&this.view)try{this.view.map?.remove(this.clipboardGraphicsLayer),this.clipboardGraphicsLayer=void 0}catch{}return}if(this.showClipboardItems&&this.view){this.clipboardGraphicsLayer||(this.clipboardGraphicsLayer=new Ce({listMode:"hide"}),this.view.map?.layers.add(this.clipboardGraphicsLayer));let e=this.clipboard.items;this.clipboardGraphicsLayer.removeAll();let t=-1;for(let i of e){if(t++,i.type!=="feature"||!i.graphic.geometry)continue;let a=new B({geometry:i.graphic.geometry.clone(),attributes:{clipboardIdx:t},symbol:le(i.graphic.geometry.type)});this.clipboardGraphicsLayer.add(a)}}else if(!this.showClipboardItems&&this.view&&this.clipboardGraphicsLayer)try{this.view.map?.remove(this.clipboardGraphicsLayer),this.clipboardGraphicsLayer=void 0}catch{}this.checkAndSuspendMove()}checkAndSuspendMove(){let e=this.activeFlowPage==="form-page";this.clipboardGraphicsLayer&&(this.clipboardGraphicsLayer.visible=!e),this.clipboardMover&&(this.clipboardMover.suspended=e)}get clipboard(){return Me()}get clipboardFeatures(){return this.clipboard.items.filter(e=>e.type==="feature")}get hasPasteCommandsPage(){return this.availableCommands.length>1||!!this.availableCommands.at(0)?.mustShowOnCommandPage}_clearActiveCommand(){this.activeCommand=void 0,this.lastPasteError=void 0}resetHome(){let e=this.activeFlowPage;this.hasPasteCommandsPage?(e="commands-page",this._clearActiveCommand(),this.selectedClipboardItemIndex=-1):this.clipboard.items.length===0?(e="clipboard-empty-page",this._clearActiveCommand(),this.selectedClipboardItemIndex=-1):this.availableCommands.length===0?(e="no-command-page",this._clearActiveCommand()):this.availableCommands[0].commandEnabled?(e="gallery-page",this.activeCommand=this.availableCommands[0].id,this.lastPasteError=void 0):(e="no-command-page",this._clearActiveCommand(),this.selectedClipboardItemIndex=-1),this.activeFlowPage==="clipboard"&&this.hideViewClipboard?(this.activeFlowPage=e,this.beforeClipboard=void 0):this.activeFlowPage==="clipboard"&&!this.hideViewClipboard?this.beforeClipboard=e:(this.activeFlowPage=e,this.beforeClipboard=void 0),this.resetFormPage()}get workingLayers(){return(this.view?.map?.allLayers?.toArray()??[]).filter(e=>e.type==="feature"||e.type==="subtype-group").filter(e=>{let t=this.clipboard.singleGeometryType;return this.activeCommand==="paste-merge"&&this.clipboard.singleGeometryType==="point"&&(t="multipoint"),!(e.geometryType!==t||!this.layerPermissionsCheck.canCreate(e))})}get clipboardItemLayers(){let e=new Set;for(let t of this.clipboard.items)t.layer&&e.add(t.layer.type==="subtype-sublayer"?t.layer.parent:t.layer);return[...e]}get canCreateOnAllLayers(){if(this.clipboardItemLayers.length===0)return!1;for(let e of this.clipboardItemLayers)if(!e||!this.layerPermissionsCheck.canCreate(e))return!1;return!0}get availableCommands(){let e=new Set(this.supportedCommands);return this.allCommands.filter(t=>e.has(t.id))}get allCommands(){let e=[];e.push(...[P,x,$,F,_].map(t=>new t({viewModel:this})));for(let t of this.customPasteCommands)e.push(new f({viewModel:this,customCommand:t}));return e}get pasteCommandsState(){return this.allCommands.map(e=>({id:e.id,disabled:!e.commandEnabled,available:this.supportedCommands.includes(e.id)}))}nextActiveFeature(){this.bauActiveFeatureIndex++,this.updateIndividualMultiFeatureFormHighlight()}previousActiveFeature(){this.bauActiveFeatureIndex--,this.updateIndividualMultiFeatureFormHighlight()}resetFormPage(){this.bauApplySet?.featureState?.clearAll(),this.bauApplySet=void 0,this.clearIndividualFeatureFormHighlight(),this.clearMultiFeatureFormHighlights(),this.bauFeatures=void 0,this.bauOriginalGraphics=[]}getPasteCommandById(e){return this.allCommands.find(t=>t.id===e)}async runPasteFormCommand(e){try{this.applying=!0;let t=this.bauApplySet,i=await e.onApply({command:this.activeCommand,applySet:t});if(i.success){this.resetHome(),this.closeOnApply&&e.closeAfterApply();return}this.handleApplyError(i,e.onPasteError)}catch(t){this.lastPasteError={errorCode:"unexpectedError",errorMessage:t.message,localizedErrorMessage:"unexpectedError"},e.onPasteError(this.lastPasteError);return}finally{this.applying=!1}}handleApplyError(e,t){e.success||e.errorCode!=="cancelled"&&(this.lastPasteError={errorCode:e.errorCode??"unexpectedError",errorMessage:e.errorMessage??"",localizedErrorMessage:e.errorMessage?void 0:"unexpectedError"},t(this.lastPasteError))}async writeChanges(e){return await _e(e,this.view)}};c([s()],n.prototype,"customPasteCommands",2);c([s()],n.prototype,"bauInvalidFeatures",2);c([s()],n.prototype,"bauFormValid",2);c([s()],n.prototype,"bauFormUpdating",2);c([s()],n.prototype,"bauActiveFeatureIndex",2);c([s()],n.prototype,"bauHasTooManyFeatures",2);c([s()],n.prototype,"bauHasTooManyComplexFeatures",2);c([s()],n.prototype,"bauActiveGraphic",1);c([s()],n.prototype,"hasTooManyPasteCreateFeatures",1);c([s()],n.prototype,"bauActiveLayer",1);c([s()],n.prototype,"bauFeatures",2);c([s()],n.prototype,"bauApplySet",2);c([s()],n.prototype,"bauOriginalGraphics",2);c([s()],n.prototype,"formViewModelMap",2);c([s()],n.prototype,"bauHighlight",2);c([s()],n.prototype,"bauIndividualHighlight",2);c([s()],n.prototype,"view",2);c([s()],n.prototype,"supportedCommands",2);c([s()],n.prototype,"selectedFeature",2);c([s()],n.prototype,"pasteWithMultipleLayersEnabled",2);c([s()],n.prototype,"pasteWithMultipleFeaturesEnabled",2);c([s()],n.prototype,"alwaysShowFeatureForm",2);c([s()],n.prototype,"pasteTemplate",2);c([s()],n.prototype,"pasteTemplateIsValid",1);c([s()],n.prototype,"selectedClipboardItemIndex",2);c([s()],n.prototype,"clipboardAndTemplateSupportAttributes",1);c([s()],n.prototype,"hasClipboardItemMatchingTemplate",1);c([s()],n.prototype,"pasteWithAttributes",2);c([s()],n.prototype,"closeOnApply",2);c([s()],n.prototype,"currentPasteOperation",2);c([s()],n.prototype,"activeFlowPage",1);c([s()],n.prototype,"_activeFlowPage",2);c([s()],n.prototype,"beforeClipboard",2);c([s()],n.prototype,"beforeForm",2);c([s()],n.prototype,"showClipboardItems",2);c([s()],n.prototype,"updating",1);c([s()],n.prototype,"hideTooltips",2);c([s()],n.prototype,"hideFooter",2);c([s()],n.prototype,"hideFooterCancelButton",2);c([s()],n.prototype,"hideHeaderCloseButton",2);c([s()],n.prototype,"hideViewClipboard",2);c([s()],n.prototype,"hideErrorNotice",2);c([s()],n.prototype,"clipboardGraphicsLayer",2);c([s()],n.prototype,"clipboardMover",2);c([s()],n.prototype,"highlightGroup",2);c([s()],n.prototype,"clipboard",1);c([s()],n.prototype,"clipboardFeatures",1);c([s()],n.prototype,"hasPasteCommandsPage",1);c([s()],n.prototype,"activeCommand",2);c([s()],n.prototype,"maximumFeatureCount",2);c([s()],n.prototype,"maximumFeatureCountWithComplexForms",2);c([s()],n.prototype,"workingLayers",1);c([s()],n.prototype,"layerPermissionsCheck",2);c([s()],n.prototype,"clipboardItemLayers",1);c([s()],n.prototype,"canCreateOnAllLayers",1);c([s()],n.prototype,"applying",2);c([s()],n.prototype,"lastPasteError",2);c([s()],n.prototype,"availableCommands",1);c([s()],n.prototype,"allCommands",1);c([s()],n.prototype,"pasteCommandsState",1);n=c([C("components.paste.PasteViewModel")],n);var it=Object.defineProperty,at=Object.getOwnPropertyDescriptor,S=(e,t,i,a)=>{for(var r=a>1?void 0:a?at(t,i):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(r=(a?l(t,i,r):l(r))||r);return a&&r&&it(t,i,r),r},M=class extends Z{constructor(){super(...arguments),this.continuous=!1,this._mover=null,this.stateChanged=null,this._suspended=!1}clipboardContentsChanged(){this._destroyMover(),this.stateChanged?.("clipboard-contents-changed"),this.continuous&&this.start()}start(){this._destroyMover(),this._mover=$e({view:this.view,graphics:this.graphicsLayer.graphics.toArray(),indicatorsEnabled:!0,highlightsEnabled:!0,enableMoveAllGraphics:!0,callbacks:{onGraphicPointerOver:()=>{"cursor"in this.view&&(this.view.cursor="move")},onGraphicPointerOut:()=>{"cursor"in this.view&&(this.view.cursor="default")},onGraphicMoveStop:async()=>{"cursor"in this.view&&(this.view.cursor="default");for(let e of this.graphicsLayer.graphics)this.clipboard.items.getItemAt(e.attributes.clipboardIdx).graphic.geometry=e.geometry;this._destroyMover(),this.stateChanged?.("contents-moved"),this.continuous&&setTimeout(()=>{this.start()},100)}}})}cancel(){this.continuous=!1,this._destroyMover(),this.stateChanged?.("completed")}get suspended(){return this._suspended}set suspended(e){e!==this._suspended&&(e?(this._destroyMover(),this.stateChanged?.("suspended")):(this.start(),this.stateChanged?.("suspended")),this._suspended=e)}_destroyMover(){this._mover?.destroy(),this._mover=null}};S([s()],M.prototype,"view",2);S([s()],M.prototype,"continuous",2);S([s()],M.prototype,"clipboard",2);S([s()],M.prototype,"graphicsLayer",2);S([s()],M.prototype,"suspended",1);S([s()],M.prototype,"_suspended",2);M=S([C("components.paste.ClipboardMove")],M);var rt=oe(n),K=class extends ee{constructor(){super(),this._featureFormElement=V(),this._floatingChoiceContainer=V(),this._bauForm=V(),this._templateGallery=V(),this._messages=se(),this.viewModel=rt(this),this.hasPasteCommandsPage=this.viewModel.hasPasteCommandsPage,this.activeCommand=this.viewModel.activeCommand,this.availableCommands=this.viewModel.availableCommands,this._showFloatingChoice=!1,this.activeFlowPage=this.viewModel.activeFlowPage,this.autoDestroyDisabled=!1,this.view=this.viewModel.view,this.selectedFeature=this.viewModel.selectedFeature,this.closed=!1,this.highlightGroup=this.viewModel.highlightGroup,this.pasteWithMultipleLayersEnabled=this.viewModel.pasteWithMultipleLayersEnabled,this.pasteWithMultipleFeaturesEnabled=this.viewModel.pasteWithMultipleFeaturesEnabled,this.alwaysShowFeatureForm=this.viewModel.alwaysShowFeatureForm,this.closeOnApply=this.viewModel.closeOnApply,this.hideErrorNotice=this.viewModel.hideErrorNotice,this.hideFooterCancelButton=this.viewModel.hideFooterCancelButton,this.hideFooter=this.viewModel.hideFooter,this.hideHeaderCloseButton=this.viewModel.hideHeaderCloseButton,this.hideTooltips=this.viewModel.hideTooltips,this.hideViewClipboard=this.viewModel.hideViewClipboard,this.maximumFeatureCount=this.viewModel.maximumFeatureCount,this.maximumFeatureCountWithComplexForms=this.viewModel.maximumFeatureCountWithComplexForms,this.layerPermissionsCheck=this.viewModel.layerPermissionsCheck,this.pasteCommandsState=this.viewModel.pasteCommandsState,this.arcgisApplyPasteCommand=E(),this.arcgisApplyPasteError=E(),this.arcgisBeforeClipboardMove=E(),this.arcgisClipboardMoveStateChanged=E(),this.arcgisClose=E(),this.arcgisPropertyChange=re()("pasteCommandsState","activeFlowPage"),this.arcgisReady=E(),this.listenOn(window,"click",this._handleClickAway),this.listenOn(window,"keydown",this._handleKeyDown)}static{this.properties={hasPasteCommandsPage:16,activeCommand:16,availableCommands:16,_showFloatingChoice:16,activeFlowPage:32,autoDestroyDisabled:5,referenceElement:1,view:0,selectedFeature:0,closed:7,highlightGroup:1,supportedCommands:1,pasteWithMultipleLayersEnabled:5,pasteWithMultipleFeaturesEnabled:5,alwaysShowFeatureForm:5,beforeApply:0,clipboard:32,closeOnApply:5,hideErrorNotice:5,hideFooterCancelButton:5,hideFooter:5,hideHeaderCloseButton:5,hideTooltips:5,hideViewClipboard:5,maximumFeatureCount:9,maximumFeatureCountWithComplexForms:9,layerPermissionsCheck:0,pasteCommandsState:0}}static{this.styles=Ae}get supportedCommands(){return this.viewModel.supportedCommands}set supportedCommands(t){if(!Array.isArray(t)){this.viewModel.supportedCommands=t.split(",");return}this.viewModel.supportedCommands=t.slice(0)}get clipboard(){return this.viewModel.clipboard}async cancelMoveClipboard(){this.viewModel.clipboardMover?.cancel(),this.viewModel.clipboardMover=void 0}async destroy(){await this.manager.destroy()}async executePasteCommand(t,i){let a=this.viewModel.getPasteCommandById(t);if(!a)throw new Error("arcgis-paste: Paste command not found");if(!a.commandEnabled)throw new Error("arcgis-paste: Paste command is not enabled");if(!i?.silent){if(!this.availableCommands.includes(a))throw new Error("arcgis-paste: Paste command is not available");return this.viewModel.resetHome(),await this._runPasteCommand(a,i),{userInputRequired:!1,success:!0}}return await a.execute()}async registerPasteCommand(t){this.viewModel.customPasteCommands.add(t)}async reset(){this.viewModel.activeFlowPage==="clipboard"&&(this.viewModel.activeFlowPage=this.viewModel.beforeClipboard),this.viewModel.resetHome()}async showClipboardItems(t){this.viewModel.showClipboardItems=t,this.viewModel.updateClipboardGraphicsLayer()}async startMoveClipboard(t){if(!this.viewModel.showClipboardItems)throw new Error("arcgis-paste: Cannot move clipboard. Clipboard items must be visible first.");this.arcgisBeforeClipboardMove.emit().defaultPrevented||(this.viewModel.clipboardMover&&(this.viewModel.clipboardMover.stateChanged=null,this.viewModel.clipboardMover.cancel(),this.viewModel.clipboardMover=void 0),this.viewModel.clipboardMover=new M({view:this.view,continuous:t,clipboard:this.clipboard,graphicsLayer:this.viewModel.clipboardGraphicsLayer,stateChanged:i=>{i==="contents-moved"&&this.viewModel.updateClipboardGraphicsLayer(),this.arcgisClipboardMoveStateChanged.emit({change:i})}}),this.viewModel.clipboardMover.start())}async writeChanges(t){return await this.viewModel.writeChanges(t)}updated(){this._featureFormElement.value&&(this._featureFormElement.value.hideReadOnlyNotice=!0,this._featureFormElement.value.disabled=!0),this._checkAndUpdateInitialPasteTemplate()}loaded(){this.manager.onLifecycle(()=>[this.viewModel.clipboard.items.on("change",()=>{this.viewModel.updateClipboardGraphicsLayer(),this.activeFlowPage==="form-page"&&this.viewModel.resetHome()}),X(()=>this.clipboard.version,()=>{this.viewModel.resetHome(),this.viewModel.updateClipboardGraphicsLayer(),this.viewModel.clipboardMover?.clipboardContentsChanged()}),X(()=>this.closed,()=>{this.closed&&this.viewModel.formViewModelMap.clear(),this.viewModel.updateClipboardGraphicsLayer()}),X(()=>[this.viewModel?.supportedCommands.join(","),this.pasteWithMultipleFeaturesEnabled,this.viewModel?.hideViewClipboard,this.pasteWithMultipleLayersEnabled].join(","),()=>{this.viewModel.resetHome()},{initial:!0})])}_handleCloseAfterApply(){this.closed=!0,this.arcgisClose.emit()}_updateBauViewModelFields(t){this.viewModel.bauActiveFeatureIndex=t.activeFeatureIndex,this.viewModel.bauInvalidFeatures=t.invalidFeatures,this.viewModel.bauFormValid=t.valid,this.viewModel.bauFormUpdating=t.updating,this.viewModel.bauHasTooManyComplexFeatures=t.hasTooManyComplexFeatures,this.viewModel.bauHasTooManyFeatures=t.hasTooManyFeatures}_handleClickAway(t){!this._showFloatingChoice||!this._floatingChoiceContainer.value||t.composedPath().find(i=>i===this._floatingChoiceContainer.value)||(this._showFloatingChoice=!1)}_handleKeyDown(t){!this._showFloatingChoice||!this._floatingChoiceContainer.value||t.composedPath().find(i=>i===this._floatingChoiceContainer.value)||(this._showFloatingChoice=!1)}async _runPasteCommand(t,i){try{this.viewModel.lastPasteError=void 0,await t.initiate({closeAfterApply:()=>{this._handleCloseAfterApply()},onPasteError:a=>{this.arcgisApplyPasteError.emit({command:t.id,errorMessage:a.errorMessage,errorCode:a.errorCode})},onApply:async a=>{try{await this.beforeApply?.();let r={...a};return this.arcgisApplyPasteCommand.emit(r).defaultPrevented?{success:!1,errorCode:"cancelled"}:r.completionCallback?await r.completionCallback??{success:!0}:{success:!0}}catch{return{success:!1}}}},i)}catch{}}_checkAndUpdateInitialPasteTemplate(){requestAnimationFrame(()=>{if(!this._templateGallery.value||this.viewModel.activeFlowPage!=="gallery-page")return;let t=this._templateGallery.value;if(t.state!=="ready")return;if(this.viewModel.pasteTemplateIsValid||(this.viewModel.pasteTemplate=void 0),this.viewModel.pasteTemplate!==void 0){t.selectedItem||this._templateGallery.value?.select(this.viewModel.pasteTemplate);return}let i;for(let a of t.items){if("items"in a){if(a.items.length>0){i=a.items[0];break}continue}i=a;break}i&&t.select(i)})}_renderFlowCommandStart(t){return t?d`<slot name=home-header-actions-start slot=header-actions-start></slot>`:null}_renderCloseCommand(t){return d`${this.hideHeaderCloseButton?null:d`<calcite-action slot=header-actions-end icon=x text @click=${()=>{this.reset(),this.closed=!0,this.arcgisClose.emit()}}></calcite-action>`}${t?d`<slot name=header-actions-end slot=header-actions-end></slot>`:null}`}_renderClipboardCommand(t){return d`<calcite-action slot=header-actions-end icon=clipboard .hidden=${this.viewModel.hideViewClipboard} .text=${this._messages.clipboardTooltip??""} .id=${`arcgis-clipboard-show-${t}`} .disabled=${this.viewModel.updating} @click=${()=>{this.viewModel.activeFlowPage="clipboard"}}>${this.hideTooltips?null:d`<calcite-tooltip .referenceElement=${`arcgis-clipboard-show-${t}`} placement=bottom><span>${this._messages.clipboardTooltip}</span></calcite-tooltip>`}</calcite-action>`}_renderNoClipboardData(t){return b("no-data",d`<calcite-flow-item .selected=${t} .heading=${this._messages.componentLabel} @calciteFlowItemBack=${i=>{i.preventDefault()}}>${this._renderClipboardCommand("no-data")}${this._renderCloseCommand(t)}<calcite-panel><div class="pad-contents"><div class="flex flex-row justify-center"><svg xmlns=http://www.w3.org/2000/svg height=92 width=92 style=${N({strokeWidth:"0.1px",fill:"var(--calcite-color-text-2)"})} viewBox="0 0 64 64">${R`<path d="M21 18h-1v-3h1zm24-3h-1v3h1zm0 5h-1v3h1zm-24 0h-1v3h1zm9.84 13.71l.3.954 3.02-.954-.3-.953zm-6.04 1.908l.3.953 3.02-.953-.3-.953zm-3.8 1.2V35h-1v3.182l2.08-.657-.3-.953zM21 30h-1v3h1zm0-5h-1v3h1zm27.816 5.896l-4.746.015 2.294 4.575-3.071 1.535-2.358-4.668-2.835 3.886V23.036zm-6.04-.78l3.607-.012-7.483-5.49v9.17l2.16-2.96 2.587 5.126 1.643-.821zM60.9 10.874v41.25a1.777 1.777 0 0 1-1.775 1.775H4.875A1.777 1.777 0 0 1 3.1 52.125v-41.25A1.777 1.777 0 0 1 4.875 9.1h54.25a1.777 1.777 0 0 1 1.775 1.775zm-.8 24.54l-24.2 7.641V53.1h23.225a.976.976 0 0 0 .975-.975zm0-24.54a.976.976 0 0 0-.975-.975H45V13h-1V9.9H21V13h-1V9.9H4.875a.976.976 0 0 0-.975.975V32.1H18v.8H3.9v19.225a.976.976 0 0 0 .975.975H35.1V35.51l.8-.252v6.96l24.2-7.643z" />`}</svg></div><p class="text-center">${this._messages.noClipboardData}</p></div></calcite-panel></calcite-flow-item>`)}_renderNoCommandPage(t){let i=this._messages.noPasteCommandsAvailable,a=this.availableCommands.at(0);return a?.commandDisabledReason&&(i=a.commandDisabledReason(this._messages,this._messages._lang),i||(i=this._messages.noPasteCommandsAvailable)),b("no-command",d`<calcite-flow-item .selected=${t} .heading=${this._messages.componentLabel} @calciteFlowItemBack=${r=>{r.preventDefault()}}>${this._renderClipboardCommand("no-command")}${this._renderCloseCommand(t)}<calcite-panel><div class="pad-contents"><div class="flex flex-row justify-center"><svg xmlns=http://www.w3.org/2000/svg height=92 width=92 style=${N({strokeWidth:"0.1px",fill:"var(--calcite-color-text-2)"})} viewBox="0 0 64 64">${R`<path d="M21 18h-1v-3h1zm24-3h-1v3h1zm0 5h-1v3h1zm-24 0h-1v3h1zm9.84 13.71l.3.954 3.02-.954-.3-.953zm-6.04 1.908l.3.953 3.02-.953-.3-.953zm-3.8 1.2V35h-1v3.182l2.08-.657-.3-.953zM21 30h-1v3h1zm0-5h-1v3h1zm27.816 5.896l-4.746.015 2.294 4.575-3.071 1.535-2.358-4.668-2.835 3.886V23.036zm-6.04-.78l3.607-.012-7.483-5.49v9.17l2.16-2.96 2.587 5.126 1.643-.821zM60.9 10.874v41.25a1.777 1.777 0 0 1-1.775 1.775H4.875A1.777 1.777 0 0 1 3.1 52.125v-41.25A1.777 1.777 0 0 1 4.875 9.1h54.25a1.777 1.777 0 0 1 1.775 1.775zm-.8 24.54l-24.2 7.641V53.1h23.225a.976.976 0 0 0 .975-.975zm0-24.54a.976.976 0 0 0-.975-.975H45V13h-1V9.9H21V13h-1V9.9H4.875a.976.976 0 0 0-.975.975V32.1H18v.8H3.9v19.225a.976.976 0 0 0 .975.975H35.1V35.51l.8-.252v6.96l24.2-7.643z" />`}</svg></div><p class="text-center">${i}</p></div></calcite-panel></calcite-flow-item>`)}_renderAttributeCheckbox(t){return d`<calcite-label class="bold">${this._messages.attributesSubtitle}</calcite-label><calcite-label layout=inline><calcite-checkbox .disabled=${t} .checked=${this.viewModel.pasteWithAttributes} @calciteCheckboxChange=${i=>{this.viewModel.pasteWithAttributes=i.target.checked}}></calcite-checkbox>${this._messages.pasteWithAttributesLabel}</calcite-label>`}_renderFlowPasteAs(t){return t?b("paste-gallery",d`<calcite-flow-item .selected=${t} .heading=${this._messages.componentLabel} @calciteFlowItemBack=${i=>{i.preventDefault(),this.viewModel.hasPasteCommandsPage&&(this.viewModel.activeFlowPage="commands-page")}}>${this._renderFlowCommandStart(!this.viewModel.hasPasteCommandsPage)}${this._renderClipboardCommand("paste-as")}${this._renderCloseCommand(t)}<calcite-panel>${this.hideFooter?null:d`<div class="w-full" slot=footer><div class="w-full flex"><calcite-button .disabled=${this.viewModel.updating} width=half .hidden=${this.viewModel.hideFooterCancelButton} kind=brand appearance=outline @click=${()=>{this.viewModel.resetHome(),this.closed=!0,this.arcgisClose.emit()}}>${this._messages.cancel}</calcite-button><calcite-button .disabled=${this.viewModel.updating||!this.viewModel.pasteTemplate||this.viewModel.hasTooManyPasteCreateFeatures} kind=brand appearance=solid .width=${this.viewModel.hideFooterCancelButton?"full":"half"} @click=${()=>{try{this.viewModel.lastPasteError=void 0,this.viewModel.getPasteCommandById(this.viewModel.activeCommand).runPasteCommand({closeAfterApply:()=>{this._handleCloseAfterApply()},onPasteError:i=>{this.arcgisApplyPasteError.emit({command:this.activeCommand??"paste-as",errorMessage:i.errorMessage,errorCode:i.errorCode})},onApply:async i=>{try{await this.beforeApply?.();let a={...i};return this.arcgisApplyPasteCommand.emit(a).defaultPrevented?{success:!1,errorCode:"cancelled"}:a.completionCallback?await a.completionCallback??{success:!0}:{success:!0}}catch{return{success:!1}}}},this.viewModel.activeCommand??"paste-as")}catch{}}}>${this.viewModel.alwaysShowFeatureForm?this._messages.next:(this.viewModel.clipboardFeatures.length??0)>1&&this.activeCommand!=="paste-merge"?y(this._messages.pasteMany??"",{num:this.viewModel.clipboardFeatures.length}):this._messages.paste}</calcite-button></div></div>`}${this.viewModel.hasTooManyPasteCreateFeatures?d`<div class="pad-start-end gallery-content"><calcite-notice open icon=exclamation-point kind=warning><div slot=message>${y(this._messages.tooManyCreateFeatures??"",{num:this.maximumFeatureCount})}</div></calcite-notice></div>`:null}<slot name=gallery-page-message></slot><div class="pad-start-end gallery-content"><div>${!this.viewModel.clipboardAndTemplateSupportAttributes&&this.viewModel.pasteTemplate?d`<div class="pad-contents"><calcite-notice open icon=exclamation-point kind=info><div slot=message>${this._messages.attributesNotCopied}</div>${this.activeCommand==="paste-merge"&&this.viewModel.hasClipboardItemMatchingTemplate?d`<calcite-link slot=link @click=${()=>{this.viewModel.activeFlowPage="merge-page"}} title=${this._messages.seeMergeOptions??ie}>${this._messages.seeMergeOptions}</calcite-link>`:null}</calcite-notice></div>`:null}${this.viewModel.clipboardAndTemplateSupportAttributes&&this.viewModel.pasteTemplate?this._renderAttributeCheckbox(!this.viewModel.clipboardAndTemplateSupportAttributes):null}${this.viewModel.clipboardAndTemplateSupportAttributes?null:this._renderAttributeCheckbox(!1)}</div><calcite-list .hidden=${this.viewModel.activeCommand!=="paste-merge"} .label=${this._messages.pasteCommandChoices??""} selection-mode=none selection-appearance=border><calcite-list-item .label=${this._messages.mergeOptionsTitle} .description=${this._messages.mergeOptionsDesc} .disabled=${this.viewModel.updating} @click=${()=>{this.viewModel.activeFlowPage="merge-page"}}><calcite-icon slot=content-start icon=configure></calcite-icon><calcite-icon slot=content-end icon=chevron-right></calcite-icon></calcite-list-item></calcite-list><div>${this.viewModel.workingLayers.length>0?d`<arcgis-feature-templates-legacy .disabledItemFunction=${i=>!!(i.template&&me(i.template)&&i.template.type!=="feature")} class="paste-feature-templates" .layers=${this.viewModel.workingLayers} selection-mode=single @arcgisPropertyChange=${i=>{this._checkAndUpdateInitialPasteTemplate()}} @arcgisSelect=${i=>{this.viewModel.pasteTemplate=i.detail.item}} .view=${this.viewModel.view} .referenceElement=${this.referenceElement} ${D(this._templateGallery)}></arcgis-feature-templates-legacy>`:d`<calcite-notice open icon=exclamation-point kind=warning><div slot=message>${y(this._messages.noMatchingEditableLayers??"",{num:this.maximumFeatureCount})}</div></calcite-notice>`}</div></div></calcite-panel>${this._renderApplying()}</calcite-flow-item>`):b("paste-gallery",d`<calcite-flow-item .selected=${t} .heading=${this._messages.componentLabel} @calciteFlowItemBack=${i=>{i.preventDefault(),this.viewModel.hasPasteCommandsPage&&(this.viewModel.activeFlowPage="commands-page")}}>${this._renderFlowCommandStart(!this.viewModel.hasPasteCommandsPage)}</calcite-flow-item>`)}_renderFlowPasteMerge(t){if(!t)return b("paste-merge",d`<calcite-flow-item .selected=${t} .heading=${this._messages.componentLabel} @calciteFlowItemBack=${a=>{a.preventDefault(),this.viewModel.activeFlowPage="gallery-page"}}></calcite-flow-item>`);let i=this.viewModel.selectedClipboardItemIndex===-1?null:this.viewModel.clipboard.items.getItemAt(this.viewModel.selectedClipboardItemIndex);return b("paste-merge",d`<calcite-flow-item .selected=${t} .heading=${this._messages.componentLabel} @calciteFlowItemBack=${a=>{a.preventDefault(),this.viewModel.activeFlowPage="gallery-page"}}>${this._renderClipboardCommand("merge")}${this._renderCloseCommand(t)}<calcite-panel><div class="merge-split-view-container"><div class="pad-contents merge-split-view-items"><calcite-label>${this._messages.selectionLabel}<calcite-list .label=${this._messages.features??""} selection-mode=single selection-appearance=border>${this.clipboard.items.toArray().map((a,r)=>({id:r,item:a})).filter(a=>a.item.type==="feature"&&a.item.layer&&a.item.graphic).map(a=>d`<calcite-list-item .disabled=${this.viewModel.updating} .selected=${a.id===this.viewModel.selectedClipboardItemIndex} @calciteListItemSelect=${()=>{this.viewModel.selectedClipboardItemIndex=a.id}} @pointerenter=${r=>{this.viewModel.highlightSelectedGraphicOnMap(a.item),r.target.classList.add("hovering")}} @pointerleave=${r=>{r.target.classList.remove("hovering"),this.viewModel.clearHighlightSelectedGraphic()}} .value=${a.id}><arcgis-feature-title slot=content .graphic=${a.item.graphic} .layer=${a.item.layer}></arcgis-feature-title><arcgis-feature-image width-in-pixels=16 height-in-pixels=16 use-true-shape slot=content-start .graphic=${a.item.graphic} .layer=${a.item.layer}></arcgis-feature-image>${this.viewModel.selectedClipboardItemIndex!==a.id?d`<calcite-chip slot=content-end .label=${this._messages.preservethis??""} class="chip-indent only-on-hover item-candidate" scale=s .value=${a.id}>${this._messages.preservethis??""}</calcite-chip>`:""}${this.viewModel.selectedClipboardItemIndex===a.id?d`<calcite-chip icon=check .label=${this._messages.preserved??""} class="item-preserved chip-indent" scale=s slot=content-end .value=${a.id}>${this._messages.preserved}</calcite-chip>`:""}</calcite-list-item>`)}</calcite-list></calcite-label></div><div class="merge-split-view-attributes">${this.viewModel.selectedClipboardItemIndex===-1?d`<div></div>`:d`<div class="merge-feature-form"><arcgis-feature-form heading-level=5 .feature=${i.graphic} .formTemplate=${i.layer.formTemplate?i.layer.formTemplate:null} .layer=${i.layer} ${D(this._featureFormElement)}></arcgis-feature-form></div>`}</div></div></calcite-panel>${this._renderApplying()}</calcite-flow-item>`)}_renderFlowPasteForm(t){if(!t)return b("paste-form",d`<calcite-flow-item .selected=${t} .heading=${this._messages.componentLabel} @calciteFlowItemBack=${p=>{p.preventDefault(),this.viewModel.activeFlowPage=this.viewModel.beforeForm,this.viewModel.resetFormPage()}}></calcite-flow-item>`);let i=(this.viewModel.bauFeatures?.length??0)>1&&!this.viewModel.bauHasTooManyFeatures&&!this.viewModel.bauHasTooManyComplexFeatures,a=this.viewModel.updating,r=this.viewModel.bauActiveFeatureIndex>0,o=this.viewModel.bauActiveFeatureIndex!==-1&&this.viewModel.bauActiveFeatureIndex<(this.viewModel.bauFeatures?.length??0)-1,l=this.viewModel.bauActiveFeatureIndex===-1?y(this._messages.multipleFeaturesX??"",{total:this.viewModel.bauFeatures?.length??0}):y(this._messages.range??"",{current:this.viewModel.bauActiveFeatureIndex+1,total:this.viewModel.bauFeatures?.length??0}),h=(this.viewModel.bauInvalidFeatures?.length??0)>0;return b("paste-form",d`<calcite-flow-item .selected=${t} .heading=${this._messages.componentLabel} @calciteFlowItemBack=${p=>{p.preventDefault(),this.viewModel.activeFlowPage=this.viewModel.beforeForm,this.viewModel.resetFormPage()}}>${this._renderCloseCommand(t)}<calcite-panel>${this.hideFooter?null:d`<div class="w-full" slot=footer><div class="w-full flex"><calcite-button .disabled=${this.viewModel.updating} width=half .hidden=${this.viewModel.hideFooterCancelButton} kind=brand appearance=outline @click=${()=>{this.viewModel.resetHome(),this.closed=!0,this.arcgisClose.emit()}}>${this._messages.cancel}</calcite-button><calcite-button .disabled=${this.viewModel.updating||this.viewModel.bauFormUpdating||this.viewModel.bauHasTooManyFeatures||this.viewModel.bauHasTooManyComplexFeatures} kind=brand appearance=solid .width=${this.viewModel.hideFooterCancelButton?"full":"half"} @click=${async()=>{try{if(await ue(()=>!this.viewModel.bauFormUpdating),!this.viewModel.bauFormValid){this._bauForm.value?.goToFirstError();return}this.viewModel.lastPasteError=void 0,this.viewModel.runPasteFormCommand({closeAfterApply:()=>{this._handleCloseAfterApply()},onPasteError:p=>{this.arcgisApplyPasteError.emit({command:this.activeCommand??"paste-as",errorMessage:p.errorMessage,errorCode:p.errorCode})},onApply:async p=>{try{await this.beforeApply?.();let m={...p};return this.arcgisApplyPasteCommand.emit(m).defaultPrevented?{success:!1,errorCode:"cancelled"}:m.completionCallback?await m.completionCallback??{success:!0}:{success:!0}}catch{return{success:!1}}}})}catch{}}}>${(this.viewModel.bauFeatures?.length??0)>1?y(this._messages.pasteMany??"",{num:this.viewModel.bauFeatures.length}):this._messages.paste}</calcite-button></div></div>`}${i?d`<calcite-action-bar overflow-actions-disabled slot=action-bar layout=horizontal scale=s expand-disabled class="carousel-bar"><calcite-button .disabled=${this.viewModel.updating} @click=${p=>{this._showFloatingChoice=!this._showFloatingChoice,p.stopPropagation()}} scale=s appearance=transparent icon-start=legend icon-end=chevron-down kind=neutral><span class="bau-pick">${l}${h?d`<calcite-icon scale=s icon=exclamation-mark-triangle class="danger-icon-warning"></calcite-icon>`:""}</span></calcite-button><calcite-action slot=actions-end icon=chevron-left icon-flip-rtl scale=s .text=${this._messages.back??""} .disabled=${!r||a||!i} @click=${()=>{this.viewModel.previousActiveFeature()}}></calcite-action><calcite-action slot=actions-end icon=chevron-right icon-flip-rtl scale=s .text=${this._messages.next??""} .disabled=${!o||a||!i} @click=${()=>{this.viewModel.nextActiveFeature()}}></calcite-action></calcite-action-bar>${this._renderFloatingUIChoice(i)}`:""}<div class=${te(this.viewModel.bauHasTooManyComplexFeatures||this.viewModel.bauHasTooManyFeatures?"hidden":void 0)}>${this._renderPasteFormBreadcrumb()}<arcgis-multi-feature-form edit-type=INSERT submit-has-been-attempted .view=${this.view} .referenceElement=${this.referenceElement} .hidden=${this.viewModel.bauHasTooManyComplexFeatures||this.viewModel.bauHasTooManyFeatures} .disabled=${this.viewModel.updating} .maximumFeatureCount=${this.maximumFeatureCount} .maximumFeatureCountWithComplexForms=${this.maximumFeatureCountWithComplexForms} .features=${this.viewModel.bauFeatures} .activeFeatureIndex=${this.viewModel.bauActiveFeatureIndex} @arcgisPropertyChange=${p=>{this._updateBauViewModelFields(p.target)}} @arcgisValueChange=${p=>{let m=0;for(let v of this.viewModel.bauFeatures?.toArray()??[]){let u=this.viewModel.bauOriginalGraphics[m];this.viewModel.formFeatureValuesChanged(u,p.target.getValues(v)),m++}}} ${D(this._bauForm)}></arcgis-multi-feature-form></div>${this.viewModel.bauHasTooManyComplexFeatures||this.viewModel.bauHasTooManyFeatures?d`<div class="pad-start-end gallery-content"><calcite-notice open icon=exclamation-point kind=warning><div slot=message>${this.viewModel.bauHasTooManyFeatures?y(this._messages.tooManyCreateFeatures??"",{num:this.maximumFeatureCount}):y(this._messages.tooManyCreateComplexFeatures??"",{num:this.maximumFeatureCountWithComplexForms})}</div></calcite-notice></div>`:null}</calcite-panel>${this.renderPasteErrorFooter()}${this._renderApplying()}</calcite-flow-item>`)}_renderPasteFormBreadcrumb(){return d`<calcite-list .label=${this._messages.breadcrumb??""} selection-appearance=border scale=s selection-mode=none><calcite-list-item>${this.viewModel.bauActiveFeatureIndex===-1?d`<calcite-icon scale=s slot=content-start icon=group-form></calcite-icon>`:I(this.viewModel.bauActiveGraphic)?.isTable?d`<calcite-icon scale=s slot=content-start icon=table></calcite-icon>`:d`<arcgis-feature-image width-in-pixels=16 height-in-pixels=16 use-true-shape slot=content-start .graphic=${this.viewModel.bauActiveGraphic} .layer=${this.viewModel.bauActiveLayer}></arcgis-feature-image>`}${this.viewModel.bauActiveFeatureIndex===-1?d`<span slot=content>${y(this._messages.multipleFeaturesX??"",{total:this.viewModel.bauFeatures?.length??0})}</span>`:d`<arcgis-feature-title is-new-feature slot=content .graphic=${this.viewModel.bauActiveGraphic} .layer=${this.viewModel.bauActiveLayer}></arcgis-feature-title>`}</calcite-list-item></calcite-list>`}_renderFloatingUIChoice(t){if(!this._showFloatingChoice||!t)return d`<div></div>`;let i=!1;this.viewModel.bauInvalidFeatures.length>0&&(i=!0);let a=new Set(this.viewModel.bauInvalidFeatures);return d`<div class="choose-feature" slot=action-bar ${D(this._floatingChoiceContainer)}><calcite-list .label=${this._messages.choosefeature??""} selection-mode=single selection-appearance=border><calcite-list-item .disabled=${this.viewModel.updating} @calciteListItemSelect=${r=>{this.viewModel.bauActiveFeatureIndex!==-1&&(this.viewModel.bauActiveFeatureIndex=-1,this.viewModel.updateIndividualMultiFeatureFormHighlight()),this.viewModel.clearMultiFeatureFormHighlights(),this._showFloatingChoice=!1}} .label=${y(this._messages.multipleFeaturesX??"",{total:this.viewModel.bauFeatures.length})} .selected=${this.viewModel.bauActiveFeatureIndex===-1} value=shared><calcite-icon scale=s icon=group-form class="feature-choose-listitem" slot=content-start></calcite-icon></calcite-list-item>${this.viewModel.bauFeatures.map((r,o)=>d`<calcite-list-item .disabled=${this.viewModel.updating} @pointerenter=${l=>{this.viewModel.highlightMultiFeatureFormFeature(r,o)}} @pointerleave=${l=>{this.viewModel.clearMultiFeatureFormHighlights()}} .selected=${this.viewModel.bauActiveFeatureIndex===o} @calciteListItemSelect=${l=>{let h=window.parseInt(l.currentTarget.value);this.viewModel.bauActiveFeatureIndex=h,this.viewModel.updateIndividualMultiFeatureFormHighlight(),this.viewModel.clearMultiFeatureFormHighlights(),this._showFloatingChoice=!1}} .value=${o}><arcgis-feature-title is-new-feature slot=content .graphic=${r} .layer=${r.layer}></arcgis-feature-title>${I(r)?.isTable?d`<calcite-icon scale=s icon=table slot=content-start class="feature-choose-listitem"></calcite-icon>`:d`<arcgis-feature-image slot=content-start class="feature-choose-listitem" .graphic=${r} width-in-pixels=16 height-in-pixels=16 use-true-shape .layer=${r.layer}></arcgis-feature-image>`}${a.has(r)&&i?d`<calcite-icon slot=content-end icon=exclamation-mark-triangle scale=s class="danger-icon-warning"></calcite-icon>`:""}</calcite-list-item>`)}</calcite-list></div>`}_renderClipboard(t){return t?b("paste-form",d`<calcite-flow-item .selected=${t} .heading=${this._messages.clipboardContents} @calciteFlowItemBack=${i=>{i.preventDefault(),this.viewModel.activeFlowPage=this.viewModel.beforeClipboard}}>${this._renderCloseCommand(t)}<calcite-panel><arcgis-clipboard .view=${this.view} .referenceElement=${this.referenceElement} .hideTooltips=${this.hideTooltips}></arcgis-clipboard></calcite-panel></calcite-flow-item>`):b("paste-form",d`<calcite-flow-item .selected=${t} .heading=${this._messages.clipboardContents} @calciteFlowItemBack=${i=>{i.preventDefault(),this.viewModel.activeFlowPage=this.viewModel.beforeClipboard}}></calcite-flow-item>`)}_renderPasteCommands(t){if(!t)return b("paste-commands",d`<calcite-flow-item .selected=${t} .heading=${this._messages.componentLabel} @calciteFlowItemBack=${a=>{a.preventDefault(),this.viewModel.activeFlowPage="commands-page"}}>${this._renderFlowCommandStart(this.viewModel.hasPasteCommandsPage)}</calcite-flow-item>`);let i=this.viewModel.clipboard.items.length===0?this._messages.clipboardEmpty??"":this.viewModel.clipboard.items.length>1?y(this._messages.clipboardContentsMany??"",{num:this.viewModel.clipboard.items.length}):this._messages.clipboardContentsSingle??"";return b("paste-commands",d`<calcite-flow-item .selected=${t} .heading=${this._messages.componentLabel} @calciteFlowItemBack=${a=>{a.preventDefault(),this.viewModel.activeFlowPage="commands-page"}}>${this._renderFlowCommandStart(this.viewModel.hasPasteCommandsPage)}${this._renderClipboardCommand("commands")}${this._renderCloseCommand(t)}<calcite-panel><calcite-list .label=${this._messages.clipboardContents??""} selection-mode=none selection-appearance=border><calcite-list-item .description=${i}></calcite-list-item></calcite-list><slot name=commands-page-message></slot><div class="pad-contents"><calcite-list .label=${this._messages.pasteCommandChoices??""} selection-mode=none selection-appearance=border>${this.availableCommands.map(a=>d`<calcite-list-item .label=${a.label(this._messages,this._messages._lang)} .description=${a.description(this._messages,this._messages._lang)} .value=${a.id} .disabled=${!a.commandEnabled||this.viewModel.updating} @click=${async()=>{await this._runPasteCommand(a)}}><calcite-icon slot=content-start .icon=${a.icon}></calcite-icon>${a.immediate?"":d`<calcite-icon slot=content-end icon=chevron-right flip-rtl></calcite-icon>`}</calcite-list-item>`)}</calcite-list></div></calcite-panel>${this.renderPasteErrorFooter()}${this._renderApplying()}</calcite-flow-item>`)}renderPasteErrorFooter(){return!this.viewModel.lastPasteError||this.viewModel.hideErrorNotice?null:d`<calcite-notice slot=footer open kind=danger icon=exclamation-mark-triangle closable @calciteNoticeClose=${()=>{this.viewModel.lastPasteError=void 0}}><div slot=title>${this._messages.errorNoticeTitle??""}</div><div slot=message>${this.viewModel.lastPasteError.localizedErrorMessage?this._messages[this.viewModel.lastPasteError.localizedErrorMessage]:this._messages.errorNoticeMessage??""}</div></calcite-notice>`}_renderApplying(){return this.viewModel.applying?d`<calcite-scrim><calcite-loader scale=s .label=${this._messages.updating??""}></calcite-loader></calcite-scrim>`:""}render(){return this.activeFlowPage==="clipboard-empty-page"?d`<calcite-flow class="arcgis-paste" .hidden=${this.closed}>${this._renderNoClipboardData(this.activeFlowPage==="clipboard-empty-page")}</calcite-flow>`:this.activeFlowPage==="no-command-page"?d`<calcite-flow class="arcgis-paste" .hidden=${this.closed}>${this._renderNoCommandPage(this.activeFlowPage==="no-command-page")}</calcite-flow>`:d`<calcite-flow class="arcgis-paste" .hidden=${this.closed}>${this.hasPasteCommandsPage&&this._renderPasteCommands(this.activeFlowPage==="commands-page")||""}${this._renderFlowPasteAs(this.activeFlowPage==="gallery-page")}${this._renderFlowPasteMerge(this.activeFlowPage==="merge-page")}${this._renderFlowPasteForm(this.activeFlowPage==="form-page")}${this._renderClipboard(this.activeFlowPage==="clipboard")}</calcite-flow>`}};ae("arcgis-paste",K);return K},"core/accessorSupport/decorators","core/Accessor","Graphic","applications/Components/clipboard","layers/GraphicsLayer","core/Collection","applications/Components/templateUtils","applications/Components/applySetUtils","core/reactiveUtils","layers/support/fieldUtils","widgets/BatchAttributeForm/BatchAttributeFormViewModel","intl","applications/Components/editUtils",a,c,e,f,g,h,i,j)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import a from"./NKR3PQHN.js";import{p as u}from"./MDRC374Z.js";export default $arcgis.t(([{replace:f},{fieldFormatFromFieldInfo:h},{h:s}])=>{var c=/^\s*expression\//iu,y=/href=(""|'')/giu,I=/(\{([^{\r\n]+)\})/gu,N=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/giu,F=/'/gu,C="relationships/",w=/^(?:mailto:|tel:)/u;function P(n,e){let r=new Map;if(!n)return r;for(let t of n){if(!t.fieldName)continue;let i=d(t.fieldName,e);t.fieldName=i,r.set(i.toLowerCase(),t)}return r}function R(n){let e=[];if(!n)return e;let{fieldInfos:r,content:t}=n;return r&&e.push(...r),!t||!Array.isArray(t)||t.forEach(i=>{if(i.type==="fields"){let o=i?.fieldInfos;o&&e.push(...o)}}),e}function W(n,e){return n?.getEffectivePopupTemplate(e)??void 0}function B(n){if(n!=null)return"sourceLayer"in n&&n.sourceLayer?n.sourceLayer:n.layer??void 0}function L(n=""){return n?n.includes(C):!1}function D(n=""){if(n)return!w.test(n.trim().toLowerCase())}function d(n,e){let r=g(e,n);return r?r.name:n}function G(n,e){return n?.map(r=>d(r,e))}function p(n){return n?c.test(n):!1}function b(n,e){if(!e||!p(e)||!n)return;let r=e.replace(c,"").toLowerCase();return n.find(({name:t})=>t.toLowerCase()===r)}function J(n,e){if(!(!n?.length||!e))return n.find(r=>r.fieldName?.toLowerCase()===e.toLowerCase())}function A(n){let{fieldInfo:e,graphic:r,layer:t}=n;return v({fieldInfo:e,graphic:r})?s(t,{graphic:r}):null}function v({fieldInfo:n,graphic:e}){return!!n?.fieldName&&!p(n.fieldName)&&!L(n.fieldName)&&!e?.popupTemplate}function K({expressionInfos:n,fieldInfo:e,graphic:r,isContentFieldInfos:t,layer:i}){if(!e?.fieldName)return null;let o=b(n,e?.fieldName);if(o)return o.title||null;let a=A({fieldInfo:e,graphic:r,layer:i});if(a){let l=a.getFieldAlias(e.fieldName);return t?e.label||l||e.fieldName:l||e.fieldName}return e.label||e.fieldName}function Q(n){let{configurableFieldsContainer:e,fieldInfo:r,isContentFieldInfos:t}=n;if(!r?.fieldName)return null;let i=!e.popupTemplate&&!e.fieldConfigurations?h(r,e.getField(r.fieldName)):e.getFieldConfiguration(r.fieldName)?.fieldFormat;return t&&r.fieldFormat||i}function m(n){return n.trim()}function x(n){return n.replaceAll(y,"")}function j(n,e){return`{${e.get(n.toLowerCase())?.fieldName||n}}`}function k({formattedValues:n,template:e,fieldInfoMap:r}){return m(x(f(f(e,t=>j(t,r)),n)))}function g(n,e){return!(n&&"getField"in n&&typeof n.getField=="function")||!e?null:n.getField(e)??null}function E(n,e){return n.replaceAll(I,(r,t,i)=>{let o=g(e,i);return o?`{${o.name}}`:t})}function M(n,e,r=!1){let t=e[n];if(typeof t=="string"){let i=(r?encodeURIComponent(t):t).replaceAll(F,"%27");e[n]=i}}function T(n,e=!1){let r={...n};return Object.keys(r).forEach(t=>M(t,r,e)),r}function V(n,e,r){e=m(e);let t=e&&!e.startsWith("{");return f(n,T(r,t||!1))}function $(n,e,r){let t=E(n,r);return t&&t.replaceAll(N,(i,o,a)=>V(i,o||a,e))}function _({values:n,globalValues:e,layer:r,text:t,fieldInfoMap:i}){return t?k({formattedValues:e,template:$(t,{...e,...n},r),fieldInfoMap:i}):""}async function z({type:n,value:e,event:r}){try{return typeof e=="function"?e(r):await e}catch(t){u("error","arcgis-feature",`An error occurred when calling the "${n}" function`,{detail:{error:t,graphic:r.graphic,value:e}});return}}function H(n){let e=n.attributes,r=n.layer;if(!e||!r)return"";let t="displayField"in r?r.displayField:null,i=t!=null?e[t]:null,o=n.getObjectId()?.toString();return i?.toString()||o||"Unknown"}return{a:P,b:R,c:W,d:B,e:L,f:D,g:d,h:G,i:p,j:J,k:A,l:K,m:Q,n:k,o:E,p:_,q:z,r:H}},"applications/Components/stringUtils","applications/Components/fieldFormatUtils",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import a from"./NKR3PQHN.js";import{a as d}from"./SVVJHTPA.js";import"./55IJQTCC.js";import"./7DOI3267.js";import"./EHZW6UXL.js";import{O as l,R as y,U as n,a as p,b as m,p as t,r as s,x as g}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([G,u,v,L,f,b,{a:h,d:w}])=>{var k=p`.loader-container{display:flex;justify-content:center;padding-bottom:var(--calcite-spacing-md)}`,o=12,c=class extends l{constructor(){super(...arguments),this._graphicsLayerName="arcgis-utility-network-aggregated-geometry-graphics",this._messages=d({blocking:!0}),this._graphics=[],this._addAggregatedGeometryToView=()=>{let e=this.geometry,{line:i,multipoint:r,polygon:_}=e;this._graphics=[i,r,_].filter(a=>a!=null).map(a=>this._makeGraphicFromGeometry(a)),this._graphicsLayer.addMany(this._graphics)},this._createGraphicsLayer=()=>{let e=this.view.map,i=this._graphicsLayerName,r=e.findLayerById(i);if(r&&w(r)){this._graphicsLayer=r;return}this._graphicsLayer=new v({id:i,listMode:"hide",title:i}),h(this.view,this._graphicsLayer)},this.hideGraphics=!1,this.graphicsColor=new G([255,255,0,.6]),this.autoDestroyDisabled=!1,this.arcgisHideGraphicsChange=g()}static{this.properties={geometry:0,hideGraphics:5,graphicsColor:0,view:0,autoDestroyDisabled:5}}static{this.styles=k}async destroy(){this.view?.map&&this._graphicsLayer&&this.view.map.remove(this._graphicsLayer),await this.manager.destroy()}connectedCallback(){super.connectedCallback(),this.view&&this._graphicsLayer&&h(this.view,this._graphicsLayer)}load(){!this.geometry||!this.view?.map||this._createGraphicsLayer()}willUpdate(e){if(e.has("graphicsColor")&&this._updateGraphicSymbols(),e.has("geometry")&&(this._graphicsLayer?.removeAll(),this._addAggregatedGeometryToView()),e.has("view")){let i=e.get("view");i?.map&&this._graphicsLayer&&(i.map.remove(this._graphicsLayer),this._createGraphicsLayer(),this._addAggregatedGeometryToView())}}loaded(){this.geometry||t("error",this,s("geometry")),this.view?this.view.map||t("error",this,s("The property `view` was provided, but `view.map` is null. Cannot draw aggregated geometry.")):t("error",this,s("view"))}_handleShowGraphicsChange(){this.hideGraphics=!this.hideGraphics,this.hideGraphics?this._graphicsLayer?.removeAll():this._graphicsLayer?.addMany(this._graphics),this.arcgisHideGraphicsChange.emit(this.hideGraphics)}_makeGraphicFromGeometry(e){return new u({geometry:e,symbol:this._makeSymbolForGeometry(e)})}_makeSymbolForGeometry(e){let i=this.graphicsColor;switch(e.type){case"multipoint":return new b({color:i,size:o,outline:{color:i,width:0}});case"polygon":return new L({color:i,outline:{color:i,width:o}});case"polyline":return new f({color:i,width:o})}}_updateGraphicSymbols(){this._graphicsLayer?.graphics.forEach(e=>{let i=e.geometry;e.symbol=this._makeSymbolForGeometry(i)})}render(){return m`<calcite-switch .checked=${!this.hideGraphics} .label=${this._messages.labels.showGraphicsToggle} label-text-end=${this._messages.showGraphics??y} @calciteSwitchChange=${this._handleShowGraphicsChange}></calcite-switch>`}};n("arcgis-utility-network-aggregated-geometry",c);return c},"Color","Graphic","layers/GraphicsLayer","symbols/SimpleFillSymbol","symbols/SimpleLineSymbol","symbols/SimpleMarkerSymbol",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import c from"./BVV442IW.js";import a from"./NKR3PQHN.js";import{a as $}from"./MPXHOG6M.js";import{a as C}from"./SVVJHTPA.js";import{g as T}from"./55IJQTCC.js";import"./7DOI3267.js";import"./EHZW6UXL.js";import{N as d,O as k,U as S,a as b,b as s,p as l,r as y,s as _,x as n}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([h,{watch:P},{substitute:I},U,F,A,E,D,{a:N,b:u,d:p,e:L,f:v},{r:g}])=>{var M=b`:host{height:100%;flex-grow:1}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-block-group{flex-grow:1;padding-bottom:var(--calcite-spacing-md);background-color:var(--calcite-color-foreground-1)}calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}calcite-block calcite-select,calcite-block calcite-input{margin:0 var(--calcite-spacing-md)}calcite-block calcite-input-message{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md) 0 var(--calcite-spacing-md)}calcite-block calcite-label:last-child{--calcite-label-margin-bottom: 0}calcite-notice{margin:var(--calcite-spacing-md)}#subnetwork-info-block{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0 var(--calcite-spacing-md)}#results-limited-message{padding:var(--calcite-spacing-sm)}.inline-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.add-spatial-mode{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);margin:var(--calcite-spacing-md)}.heading{color:var(--calcite-color-text-1);margin:0 0 var(--calcite-spacing-md) 0;font-size:var(--calcite-font-size);font-style:normal;font-weight:var(--calcite-font-weight-medium)}`,m=`utility-network-trace-inputs-sketch-${Date.now()}`,B=20,f=class extends k{constructor(){super(...arguments),this._defaultPopupTemplateEnabled=!0,this._messages=C({blocking:!0}),this._layerIdToLayer=new Map,this._startingPoints=new h,this._barriers=new h,this._stoppingPoints=new h,this._subnetworkTraceTypes=new Set(["subnetwork","subnetwork-controller","upstream","downstream","isolation"]),this._removeDuplicateSubnetworkNames=(e,t,i)=>t===0||e.getAttribute("SUBNETWORKNAME")!==i[t-1].getAttribute("SUBNETWORKNAME"),this._hitTestPromise=null,this._featuresFromHitTest=[],this._displayLimit=20,this._traceLocationStartingRefChange=e=>{e&&(this._traceLocationStartingElement=e)},this._traceLocationBarrierRefChange=e=>{e&&(this._traceLocationBarrierElement=e)},this._traceLocationStoppingRefChange=e=>{e&&(this._traceLocationStoppingElement=e)},this._featuresComponentRefChange=e=>{e&&(this._featuresComponentElement=e)},this.compatibleSubnetworkNames=[],this.traceConfigurations=[],this._state="ready",this._exceedDisplayLimit=!1,this.autoDestroyDisabled=!1,this.hideActionBar=!1,this.mode="default",this.arcgisPropertyChange=T()("mode"),this.arcgisSelectedNamedTraceConfigurationChange=n(),this.arcgisTraceInputsChange=n(),this.arcgisTraceLocationSelectEnd=n(),this.arcgisTraceLocationSelectStart=n(),this.arcgisUtilityNetworkChange=n(),this.renderFeatureListItem=e=>{let{feature:t,label:i}=e;return s`<calcite-list-item .label=${i} @calciteListItemSelect=${()=>this._handleFeatureSelectChange(t)}><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`}}static{this.properties={compatibleSubnetworkNames:16,subnetworksTable:16,traceConfigurations:16,utilityNetworks:16,_unTraceConfiguration:16,_state:16,_activeTraceLocationType:16,_selectedFeature:16,_exceedDisplayLimit:16,beforeTraceLocationSelectStart:0,view:0,selectedUtilityNetwork:0,selectedNamedTraceConfiguration:0,autoDestroyDisabled:5,hideActionBar:5,unTraceConfiguration:32,referenceElement:1,mode:3,traceLocations:32}}static{this.styles=M}get isSubnetworkNameTraceSelected(){let e=this.selectedNamedTraceConfiguration?.traceType;return!!this.selectedNamedTraceConfiguration?.traceConfiguration?.subnetworkName&&e==="subnetwork"}get selectedSubnetworkName(){return this._unTraceConfiguration?.subnetworkName??void 0}set selectedSubnetworkName(e){this._unTraceConfiguration&&(this._unTraceConfiguration.subnetworkName=e)}get _allLayers(){let{view:e}=this;return e?.map?e.map.allLayers.toArray().concat(e.map.allTables.toArray()):[]}get showStartingPoints(){return!this.isSubnetworkNameTraceSelected}get showStoppingPoints(){let e=this.selectedNamedTraceConfiguration?.traceType;return e==="path"||e==="circuit"}get _subnetworkLayerIds(){let e=this.selectedUtilityNetwork?.dataElement?.domainNetworks;return e?e.map(t=>t.subnetworkLayerId).filter(t=>t!=null&&t>-1):[]}get unTraceConfiguration(){return this._unTraceConfiguration}get traceLocations(){let e=[],t=i=>{i.flagProperties.terminalConfiguration&&i.flagProperties.selectedTerminals?i.flagProperties.selectedTerminals.forEach(a=>{e.push(new A({type:i.traceLocation.type,isFilterBarrier:i.traceLocation.isFilterBarrier,globalId:i.traceLocation.globalId,percentAlong:i.traceLocation.percentAlong,terminalId:a}))}):e.push(i.traceLocation)};return this.showStartingPoints&&this._startingPoints.forEach(i=>t(i)),this._barriers.forEach(i=>t(i)),this.showStoppingPoints&&this._stoppingPoints.forEach(i=>t(i)),e}async destroy(){this._removeGraphicLayer(m),this._clearTraceLocations(),this._sketchViewModel?.cancel(),this._featuresComponentElement?.destroy(),this._traceLocationStartingElement?.destroy(),this._traceLocationBarrierElement?.destroy(),this._traceLocationStoppingElement?.destroy(),await this.manager.destroy()}load(){this.manager.onLifecycle(()=>[P(()=>this.view?.map,()=>{this._setupUtilityNetwork(),this._setupSketchViewModel()},{initial:!0})])}willUpdate(e){let{utilityNetworks:t,selectedUtilityNetwork:i}=this;(e.has("utilityNetworks")||!t||t.length===0||!i||!t?.includes(i))&&this._handleUtilityNetworksChange(),e.has("selectedUtilityNetwork")&&(this.arcgisUtilityNetworkChange.emit(),this._handleSelectedUtilityNetworkChange()),e.has("selectedNamedTraceConfiguration")&&(this.arcgisTraceInputsChange.emit(),this.arcgisSelectedNamedTraceConfigurationChange.emit(),this._handleTraceConfigChange()),e.has("selectedSubnetworkName")&&this.arcgisTraceInputsChange.emit()}disconnectedCallback(){super.disconnectedCallback(),this._layerIdToLayer.clear()}_clearTraceLocations(){this._startingPoints.forEach(e=>{e.spatialProperties.flagGraphic&&this.view?.graphics.remove(e.spatialProperties.flagGraphic)}),this._startingPoints.removeAll(),this._barriers.forEach(e=>{e.spatialProperties.flagGraphic&&this.view?.graphics.remove(e.spatialProperties.flagGraphic)}),this._barriers.removeAll(),this._stoppingPoints.forEach(e=>{e.spatialProperties.flagGraphic&&this.view?.graphics.remove(e.spatialProperties.flagGraphic)}),this._stoppingPoints.removeAll()}_createGraphicLayer(e){let{map:t}=this.view;if(!t?.findLayerById(e)){let i=new U({id:e,listMode:"hide",title:e});N(this.view,i)}}_getGraphicLayer(e){let{map:t}=this.view;if(t){let i=t.findLayerById(e);if(p(i))return t.reorder(i,t.layers.length-1),i}return null}_removeGraphicLayer(e){let{map:t}=this.view,i=t?.findLayerById(e);i&&p(i)&&t?.remove(i)}_setSnappingOption(){let{_sketchViewModel:e,_unLayers:t}=this;if(e&&t&&t.length>0){let i=new h;t.forEach(a=>{L(a)?a.sublayers.forEach(r=>{i.add(new E({layer:r,enabled:!0}))}):i.add(new E({layer:a,enabled:!0}))}),e.snappingOptions={enabled:!0,featureEnabled:!0,featureSources:i}}}_initializeSketchViewModel(){let{view:e}=this,t=this._getGraphicLayer(m);return new D({layer:t,view:e})}_setupSketchViewModel(){this._createGraphicLayer(m),this._sketchViewModel=this._initializeSketchViewModel(),this._setSnappingOption()}_clearSubnetworks(){this.selectedSubnetworkName=void 0,this.subnetworksTable=void 0,this.compatibleSubnetworkNames=[]}async _loadSubnetworksTable(){this.subnetworksTable||(this.subnetworksTable=await this.selectedUtilityNetwork?.loadSubnetworksTable())}async _querySubnetworks(){let{subnetworksTable:e}=this;if(!e)return;let t=e.createQuery();t.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,t.where=this._getSubnetworkQueryWhereClause(),t.outFields=["SUBNETWORKNAME"],t.orderByFields=["SUBNETWORKNAME"];let{features:i}=await u(e,t,void 0,!1);this.compatibleSubnetworkNames=i.filter(this._removeDuplicateSubnetworkNames).map(a=>a.getAttribute("SUBNETWORKNAME"))}_getSubnetworkQueryWhereClause(){let e=this._unTraceConfiguration,t=`DOMAINNETWORKNAME = '${e.domainNetworkName}'`,i=`TIERNAME = '${e.tierName}'`;return[t,i].join(" AND ")}async _handleSubnetworkTraceConfigChange(e){await this._loadSubnetworksTable(),await this._querySubnetworks();let{compatibleSubnetworkNames:t}=this;e.subnetworkName&&!t.some(i=>i===e.subnetworkName)&&(this.selectedSubnetworkName=t.at(0))}_selectTraceConfigurationByGuid(e){let t=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.find(i=>i.globalId===e);if(!t){l("error",this,"`traceConfig` not found in `selectedUtilityNetwork.sharedNamedTraceConfigurations`");return}this.selectedNamedTraceConfiguration=t}_handleTraceConfigChange(){let{selectedNamedTraceConfiguration:e}=this;if(!(e?.traceConfiguration instanceof F)){l("error",this,y("selectedNamedTraceConfiguration.traceConfiguration")),this._unTraceConfiguration=void 0;return}switch(this._unTraceConfiguration=e.traceConfiguration.clone(),e.traceType){case"subnetwork":this._state="loading",this._handleSubnetworkTraceConfigChange(this._unTraceConfiguration).finally(()=>this._state="ready");break}}async _handleSelectedUtilityNetworkChange(){await this.selectedUtilityNetwork?.load(),this._clearSubnetworks(),this._setupTraceConfigurations(),this._filterUnLayers(),this._clearTraceLocations()}_setupTraceConfigurations(){this._unTraceConfiguration=void 0,this.selectedNamedTraceConfiguration=void 0,this.traceConfigurations=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.filter(Boolean).filter(e=>e.traceType!=="path"&&e.traceType!=="circuit").sort((e,t)=>e.title.localeCompare(t.title))||[],this.selectedNamedTraceConfiguration=this.traceConfigurations.at(0)}_filterUnLayers(){let{selectedUtilityNetwork:e}=this;this._unLayers=new h(this._allLayers.filter(t=>e?.isUtilityLayer(t)&&!this._subnetworkLayerIds.includes(t.layerId))),this._setSnappingOption()}_handleUtilityNetworksChange(){let{utilityNetworks:e}=this;if(!e||e.length===0){this.selectedUtilityNetwork=void 0,this._state="error",l("error",this,_("utilityNetworks"));return}(!this.selectedUtilityNetwork||!e.includes(this.selectedUtilityNetwork))&&(this.selectedUtilityNetwork=e.at(0))}async _setupUtilityNetwork(){if(this.view?.map){let e=this.view.map;await e.load(),this.utilityNetworks=e.utilityNetworks||void 0}else this._state="disabled",l("error",this,"The property `view.map` is required to load utility networks but is missing.")}_handleTraceLocationSelectStart(e){if(e.stopPropagation(),this.arcgisTraceLocationSelectStart.emit(e.detail).defaultPrevented){e.preventDefault();return}this._activeTraceLocationType=e?.target?.traceLocationType,this.mode="add-spatial-instructions"}_getLayerByLayerId(e){if(e==null)return;let{_layerIdToLayer:t,_unLayers:i}=this;if(t.get(e))return t.get(e);if(!i)return;let a=i.find(r=>"layerId"in r&&r.layerId===e);return a&&t.set(e,a),a}async _queryFeatures(e,t){let i=e.createQuery();i.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,i.objectIds=t.map(r=>r.getObjectId()),i.outFields=["*"];let{features:a}=await u(e,i);return a.forEach(r=>{if(!r.getEffectivePopupTemplate(this._defaultPopupTemplateEnabled)){let o=r.layer;r.popupTemplate=o.createPopupTemplate()}}),a}async _populateFeaturesWithLabel(e){let t=new Map;e.forEach(a=>{let r=v(a.layer)?a.layer.parent:a.layer;if(r){let o=r.layerId,c=this._getLayerByLayerId(o);if(c){let w=t.get(c)||[];w.push(a),t.set(c,w)}}});let i=[];return await Promise.all(Array.from(t.keys()).map(async a=>{let r=t.get(a)??[],o=await this._queryFeatures(a,r);i.push(...o)})),await Promise.all(i.map(async a=>{let r=a.layer;if(r&&"getFeatureTitle"in r){let o=await r.getFeatureTitle(a)||g(a);return{feature:a,label:o}}return{feature:a,label:g(a)}}))}async _handleHitTestComplete(e){if(this._exceedDisplayLimit=e.length>this._displayLimit,this._featuresFromHitTest=await this._populateFeaturesWithLabel(e.slice(0,this._displayLimit)),this._featuresFromHitTest.length===0)return this._handleAddSpatialCancelClick(),await Promise.reject(Error("No features found"));if(this._featuresFromHitTest.length===1){let[{feature:t}]=this._featuresFromHitTest;this._selectedFeature=t,this.mode="add-spatial-feature"}else this.mode="add-spatial-feature-list";return this._hitTestPromise?.reject(),this._hitTestPromise=Promise.withResolvers(),await this._hitTestPromise.promise}_handleTraceLocationSelectEnd(e){e.stopPropagation(),this.arcgisTraceLocationSelectEnd.emit(),this._activeTraceLocationType=void 0,this.mode="default",this._handleAddSpatialCancelClick()}_handleAddSpatialCancelClick(e){e?.stopPropagation();let t=this._featuresComponentElement;t&&t.clear(),this._selectedFeature=void 0,this.mode="default",this._sketchViewModel?.cancel(),this._hitTestPromise?.reject(),this._hitTestPromise=null}_handleFeaturesClose(){this.mode="add-spatial-feature-list",this._selectedFeature=void 0}_handleAddSpatialAddClick(){let{_hitTestPromise:e,_featuresComponentElement:t}=this;if(e&&t){let i=t,a=i.selectedDrillInFeature??i.selectedFeature;if(!a)return;e.resolve(a),this._hitTestPromise=null}}_handleFeatureSelectChange(e){this._selectedFeature=e,this.mode="add-spatial-feature"}renderError(e,t=!1,i){return s`<calcite-notice .closable=${t} kind=danger open scale=s width=auto .icon=${i}><div slot=message>${e}</div></calcite-notice>`}renderLoader(){return s`<calcite-loader label=loading></calcite-loader>`}renderTraceSelection(){let{_messages:e,traceConfigurations:t}=this,i=e.labels.traceConfiguration;if(t.length===0)return this.renderError(e.errors.noTraceConfigurationError);let a=$(t,r=>r.globalId,r=>s`<calcite-option .value=${r.globalId}>${r.title}</calcite-option>`);return s`<calcite-block .heading=${i} .label=${i} expanded><calcite-select .label=${i} .value=${this.selectedNamedTraceConfiguration?.globalId||void 0} @calciteSelectChange=${r=>{this._selectTraceConfigurationByGuid(r.target.value)}}>${a}</calcite-select></calcite-block>`}renderUtilityNetworkSelection(){let{_messages:e}=this,t=e.labels.utilityNetwork,i=this.utilityNetworks?.map(a=>s`<calcite-option .value=${a.id}>${a.title}</calcite-option>`);return s`<calcite-block .heading=${t} .label=${t} expanded><calcite-select .label=${t} .value=${this.selectedUtilityNetwork?.id} @calciteSelectChange=${a=>{this.selectedUtilityNetwork?.id!==a.target.value&&(this.selectedUtilityNetwork=this.utilityNetworks?.find(r=>r.id===a.target.value))}}>${i}</calcite-select></calcite-block>`}renderDefaultMode(){let{_messages:e,_state:t,mode:i}=this;return s`<calcite-flow-item .selected=${i==="default"}>${t==="disabled"?this.renderError(e.errors.noMapError):this.renderContent()}</calcite-flow-item>`}renderSpatialSelectInstructions(){let{_messages:e,_activeTraceLocationType:t,mode:i}=this,a=t==="starting-point"?e.labels.addSpatial.startingPoint:t==="barrier"?e.labels.addSpatial.barrier:e.labels.addSpatial.stoppingPoint;return s`<calcite-flow-item .selected=${i==="add-spatial-instructions"} .heading=${a} @calciteFlowItemBack=${r=>this._handleAddSpatialCancelClick(r)}><div class="add-spatial-mode"><div><h5 class="heading">${e.instructions.addSpatial.selectFeature.heading}</h5>${e.instructions.addSpatial.selectFeature.subheading}</div><div><h5 class="heading">${e.instructions.addSpatial.selectAssociatedFeature.heading}</h5>${e.instructions.addSpatial.selectAssociatedFeature.subheading}</div></div></calcite-flow-item>`}renderFeaturesList(e){return s`<calcite-list label="Feature list">${e.map(this.renderFeatureListItem)}</calcite-list>`}renderHitTestResults(){let{_messages:e,_activeTraceLocationType:t,_featuresFromHitTest:i,mode:a}=this,r=t==="starting-point"?e.labels.addSpatial.startingPoint:t==="barrier"?e.labels.addSpatial.barrier:e.labels.addSpatial.stoppingPoint;return s`<calcite-flow-item .selected=${a==="add-spatial-feature-list"} .heading=${r} @calciteFlowItemBack=${o=>this._handleAddSpatialCancelClick(o)}>${this.renderFeaturesList(i)}</calcite-flow-item>`}renderSelectedFeature(){let{_selectedFeature:e}=this;return e?s`<arcgis-features .referenceElement=${this.referenceElement} .features=${[e]} .view=${this.view} .defaultPopupTemplateEnabled=${this._defaultPopupTemplateEnabled} .hideActionBar=${this.hideActionBar} open @arcgisClose=${()=>this._handleFeaturesClose()} .autoDestroyDisabled=${this.autoDestroyDisabled} ${d(this._featuresComponentRefChange)}></arcgis-features>`:(this.mode="default",null)}renderAddSpatialFooter(){let{mode:e,_messages:t,selectedUtilityNetwork:i,_selectedFeature:a}=this,r=I(t.warnings.exceededDisplayLimit,{limit:this._displayLimit.toString()}),o=e==="add-spatial-feature-list"&&this._exceedDisplayLimit,c=a?!(i?.isUtilityLayer(a.layer)??!0):!0;return s`${o&&s`<calcite-input-message id=results-limited-message icon=exclamation-mark-circle status=idle>${r}</calcite-input-message>`||""}<calcite-button appearance=outline width=full @click=${()=>{this._handleAddSpatialCancelClick()}} slot=footer>${t.buttons.cancel}</calcite-button>${e==="add-spatial-feature"&&s`<calcite-button width=full slot=footer appearance=solid @click=${()=>{this._handleAddSpatialAddClick()}} .disabled=${c}>${t.buttons.add}</calcite-button>`||""}`}renderStartingPointSelection(){return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=starting-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .traceLocations=${this._startingPoints} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${d(this._traceLocationStartingRefChange)}></arcgis-utility-network-trace-location>`}renderStoppingPointSelection(){return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=stopping-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .traceLocations=${this._stoppingPoints} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${d(this._traceLocationStoppingRefChange)}></arcgis-utility-network-trace-location>`}renderBarrierSelection(){return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=barrier .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .traceLocations=${this._barriers} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${d(this._traceLocationBarrierRefChange)}></arcgis-utility-network-trace-location>`}renderSubnetworkNameInput(){return s`<calcite-input clearable type=text .placeholder=${this._messages.instructions.enterSubnetworkName} max-length=64 .value=${this.selectedSubnetworkName} @calciteInputInput=${e=>this.selectedSubnetworkName=e.target.value}></calcite-input><calcite-input-message icon=exclamation-mark-triangle status=idle>${this._messages.labels.tooManySubnetworks}</calcite-input-message>`}renderSubnetworkSelectList(){return s`<calcite-select .label=${this._messages.labels.subnetworkName} .value=${this.selectedSubnetworkName} @calciteSelectChange=${e=>this.selectedSubnetworkName=e.target.value}>${this.compatibleSubnetworkNames.map(e=>s`<calcite-option .value=${e}>${e}</calcite-option>`)}</calcite-select>`}renderSubnetworkSelection(){let{compatibleSubnetworkNames:e}=this,t=this._messages.labels.subnetworkName;return this.isSubnetworkNameTraceSelected?this._state==="loading"?s`<calcite-loader class="inline-loader" label=loading scale=s></calcite-loader>`:e.length?s`<calcite-block .heading=${t} .label=${t} expanded>${e.length>B?this.renderSubnetworkNameInput():this.renderSubnetworkSelectList()}</calcite-block>`:this.renderError(this._messages.errors.noCompatibleSubnetworks,!1,"exclamation-mark-triangle"):null}renderSubnetworkInfo(){let{_messages:e,selectedNamedTraceConfiguration:t,_unTraceConfiguration:i}=this;return i&&t?.traceType&&this._subnetworkTraceTypes.has(t.traceType)?s`<calcite-block id=subnetwork-info-block expanded .label=${e.labels.subnetworkInfo}><arcgis-utility-network-subnetwork-info .namedTraceConfig=${t}></arcgis-utility-network-subnetwork-info></calcite-block>`:null}renderContent(){let{utilityNetworks:e}=this,t=this.selectedNamedTraceConfiguration?.traceConfiguration;if(!e||e.length===0)return this.renderError(this._messages.errors.noUtilityNetworkError);let i=s`${this.renderTraceSelection()}${this.renderSubnetworkInfo()}${this.renderSubnetworkSelection()}`,a=s`${this.showStartingPoints?this.renderStartingPointSelection():null}${this.showStoppingPoints?this.renderStoppingPointSelection():null}${this.renderBarrierSelection()}`;return s`<calcite-block-group .label=${this._messages.labels.traceInputs}>${e.length>1?this.renderUtilityNetworkSelection():null}${this.selectedUtilityNetwork?.loaded?i:this.renderLoader()}${t?a:null}</calcite-block-group>`}render(){let{mode:e}=this;return s`<calcite-panel>${e==="add-spatial-feature"?this.renderSelectedFeature():s`<calcite-flow>${this.renderDefaultMode()}${this.renderSpatialSelectInstructions()}${this.renderHitTestResults()}</calcite-flow>`}${e!=="default"?this.renderAddSpatialFooter():null}</calcite-panel>`}};S("arcgis-utility-network-trace-inputs",f);return f},"core/Collection","core/reactiveUtils","intl","layers/GraphicsLayer","networks/support/UNTraceConfiguration","rest/networks/support/TraceLocation","views/interactive/snapping/FeatureSnappingLayerSource","widgets/Sketch/SketchViewModel",a,c)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import a from"./NKR3PQHN.js";import{a as I}from"./SVVJHTPA.js";import"./55IJQTCC.js";import"./7DOI3267.js";import"./EHZW6UXL.js";import{O as S,U as v,a as L,b as m,p as n,r as g,x as f}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([C,b,d,A,$,G,k,T,{c:w,f:x}])=>{var F=L`calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}.add-location-button{--calcite-button-border-color: var(--calcite-color-border-1);--calcite-button-icon-color: var(--calcite-color-text-1);--calcite-button-text-color: var(--calcite-color-text-1)}.button-container{justify-content:center;display:grid}.clear-button{--calcite-button-border-color: transparent}`,_=class extends S{constructor(){super(...arguments),this.messages=I({blocking:!0}),this.isSelectWaiting=!1,this.traceLocationType="starting-point",this.spatialTolerance=.05,this.autoDestroyDisabled=!1,this.arcgisTraceLocationChange=f(),this.arcgisTraceLocationSelectEnd=f(),this.arcgisTraceLocationSelectStart=f()}static{this.properties={isSelectWaiting:16,beforeTraceLocationSelectStart:0,afterHitTest:0,view:0,traceLocationType:1,traceLocations:0,filterLayers:0,sketchViewModel:0,spatialTolerance:9,autoDestroyDisabled:5,utilityNetwork:0}}static{this.styles=F}async destroy(){this._resetCursor(),await this.manager.destroy()}async load(){d.isLoaded()||await d.load()}_createPolyline(e,t){return new A({hasZ:!1,hasM:!0,paths:e,spatialReference:new $({wkid:t})})}_calculatePercentAlong(e,t){let r=e.spatialReference,c=this._createPolyline(e.paths,r.wkid),o=t.x-.5,i=t.x+.5,s=t.y-.5,a=t.y+.5,l=[[[o,s],[i,a]]],h=this._createPolyline(l,t.spatialReference.wkid),p=d.execute(h,r);if(!p)return n("error",this,"Unable to project flag geometry to source geometry spatial reference."),.5;let u=C.execute(c,p);if(u.length>0){let P=b.execute(c,{unit:"feet"}),y;return u[0].paths[0][0][0]===c.paths[0][0][0]?y=b.execute(u[0],{unit:"feet"}):u.length>1?y=b.execute(u[1],{unit:"feet"}):y=0,y/P}return n("warn",this,"Unable to cut the source geometry with the flag geometry."),.5}get _edgeSourceLayerIds(){let e=this.utilityNetwork?.dataElement?.domainNetworks;return e?e.flatMap(t=>t.edgeSources).map(t=>t.layerId).filter(Boolean):[]}async _handleAddButtonClick(){let{view:e,sketchViewModel:t}=this;if(!(e&&t)){n("error",this,"Cannot add trace location."),t||n("error",this,g("sketchViewModel")),e||n("error",this,g("view"));return}if(this.beforeTraceLocationSelectStart){this.isSelectWaiting=!0;try{await this.beforeTraceLocationSelectStart()}finally{this.isSelectWaiting=!1}}this.arcgisTraceLocationSelectStart.emit({cancelSelect:()=>t.cancel()}).defaultPrevented||await this._startSketch(e,t)}async _startSketch(e,t){this._clickHandler?.remove(),this._clickHandler=t.on("create",r=>this._handleSketchComplete(r,e,t)),"acquireCursor"in e&&e.acquireCursor("crosshair"),this.sketchViewModel?.create("point")}_handleSketchComplete(e,t,r){if(e.state==="complete"&&e.graphic){r.layer.remove(e.graphic),this._performHitTest(e,t,r);return}e.state==="cancel"&&(this._resetCursor(),this.arcgisTraceLocationSelectEnd.emit())}async _performHitTest(e,t,r){let{utilityNetwork:c}=this;if(!c){n("error",this,g("utilityNetwork")),this._resetCursor(),this.arcgisTraceLocationSelectEnd.emit();return}let o=e.graphic?.geometry,i=t.toScreen(o);if(!i){n("warn",this,"No screen point available for hit test."),this._startSketch(t,r);return}let s=(await t.hitTest(i,{include:this.filterLayers})).results.filter(a=>a.type==="graphic"&&a?.layer&&a.graphic);if(s.length===0){n("info",this,"No usable hit test results found."),this._startSketch(t,r);return}this._resetCursor(),await this._processHitTestResults(s,o,t),this.arcgisTraceLocationSelectEnd.emit()}_resetCursor(){let{view:e}=this;if(!e){n("error",this,g("view"));return}this._clickHandler?.remove(),this._clickHandler=void 0,"acquireCursor"in e&&e.acquireCursor("default")}async _processHitTestResults(e,t,r){if(e.length===0){n("error",this,"There are no hit test results to process.");return}let c=e[0],o=e.map(a=>{let l=a,h=l.graphic;return h.origin=l.layer,h.sourceLayer=l.layer,h}),i=this.afterHitTest?await this.afterHitTest(o).catch(()=>null):c.graphic;if(!i){n("error",this,"No graphic available from hit test results."),this.arcgisTraceLocationSelectEnd.emit();return}let s=await this._ensureNecessaryAttributes(i);if(!s){n("error",this,"Unable to ensure necessary attributes on the selected graphic."),this.arcgisTraceLocationSelectEnd.emit();return}await this._generateTraceLocation(s,t,r)}async _ensureNecessaryAttributes(e){let t=(w(e.layer),e.layer),r=t.fieldsIndex?.get("assetgroup")??!1,c=t.fieldsIndex?.get("assetgroup")?.name??"assetgroup",o=t.fieldsIndex?.get("assettype")??!1,i=t.fieldsIndex?.get("assettype")?.name??"assettype",s=e.getGlobalId(),a=e.getObjectId(),l=r?!!e.getAttribute(c):!0,h=o?!!e.getAttribute(i):!0;if(s&&a&&l&&h)return e;let p=t.createQuery();return p.objectIds=[a],(await t.queryFeatures(p))?.features[0]||null}async _generateTraceLocation(e,t,r){let{traceLocations:c}=this,o=e.getGlobalId()??"",i=e.geometry?.type,s=await this._generateFlagInfo(e,t);if(!s){n("error",this,"Unable to generate flag info for trace location.");return}let a=c?.filter(h=>h.spatialProperties.mapGraphic?.getGlobalId()===o)??[];if(a.length>0){if(i!=="polyline"){n("warn",this,"A flag with the same globalId already exists.");return}else if(a.some(h=>Math.abs(h.traceLocation.percentAlong-s.traceLocation.percentAlong)<=this.spatialTolerance)){n("warn",this,"A flag with the same globalId already exists within tolerance.");return}}let l=this._addFlagGraphic(e,t,r);if(!l){n("warn",this,"Unable to add flag graphic.");return}s.spatialProperties.flagGraphic=l,c?.add(s)}async _generateFlagInfo(e,t){let{traceLocationType:r,utilityNetwork:c}=this,o=e.getGlobalId()??"",i=e.geometry?.type,s=await this._generateItemTitle(e);if(i==="point"||i==="polygon"){let a=c?.getTerminalConfiguration(e),l=a?a.terminals[0].id:1;return{traceLocation:new k({type:r,isFilterBarrier:!1,globalId:o,terminalId:l}),flagProperties:{title:s,expanded:!1,terminalConfiguration:a??void 0,selectedTerminals:a?new Set([l]):void 0},spatialProperties:{mapPoint:t,mapGraphic:e}}}else if(i==="polyline"){let a=this._calculatePercentAlong(e.geometry,t);return{traceLocation:new k({type:r,isFilterBarrier:!1,globalId:o,percentAlong:a}),flagProperties:{title:s,expanded:!1},spatialProperties:{mapPoint:t,mapGraphic:e}}}else if(!i){let a=x(e.layer)?e.layer.parent:e.layer,l=a&&this._edgeSourceLayerIds.includes(a.layerId),h=c?.getTerminalConfiguration(e),p=h?h.terminals[0].id:l?-1:1,u=l?.5:-1;return{traceLocation:new k({type:r,isFilterBarrier:!1,globalId:o,terminalId:p,percentAlong:u}),flagProperties:{title:s,expanded:!1,terminalConfiguration:h??void 0,selectedTerminals:h?new Set([p]):void 0},spatialProperties:{mapPoint:t,mapGraphic:e}}}return null}async _generateItemTitle(e){let{messages:t}=this,r=(w(e.layer),e.layer);return("getFeatureTitle"in r?await r.getFeatureTitle(e):null)||e?.getObjectId()?.toString()||t.labels.unknown}_addFlagGraphic(e,t,r){let c=e.geometry?.type==="point"?e.geometry:t,o=this._createFlagSymbol(),i=new G({geometry:c,symbol:o,attributes:e.attributes});return r.graphics.add(i),i}_createFlagSymbol(){let{traceLocationType:e}=this,t=[244,21,21,.6],r=[21,244,21,.6];return e==="stopping-point"?new T({color:t,style:"x",size:12,outline:{color:t,width:2}}):e==="barrier"?new T({color:t,style:"square",size:12,outline:{color:t,width:0}}):new T({color:r,style:"circle",size:12,outline:{color:r,width:0}})}_handleClearButtonClick(){let{view:e,traceLocations:t}=this;t?.forEach(r=>{r.spatialProperties.flagGraphic&&e&&e.graphics.remove(r.spatialProperties.flagGraphic)}),t?.removeAll()}renderAddLocationBlock(){let{traceLocationType:e,messages:t,traceLocations:r,view:c}=this,o=e==="starting-point"?t.types.startingPoint:e==="barrier"?t.types.barrier:t.types.stoppingPoint,i=o.heading,s=o.description,a=o.buttonText;return m`<calcite-block .heading=${i} .label=${i} expanded .description=${s}>${r?.length?m`<calcite-button class="clear-button" slot=actions-end appearance=transparent .label=${t.buttons.clear} @click=${()=>this._handleClearButtonClick()}>${t.buttons.clear}</calcite-button>`:null}<arcgis-utility-network-trace-location-list .traceLocations=${r} .traceLocationType=${e} .view=${c}></arcgis-utility-network-trace-location-list><div class="button-container"><calcite-button .loading=${this.isSelectWaiting} class="add-location-button" icon-start=select appearance=outline .label=${a} @click=${()=>this._handleAddButtonClick()}>${a}</calcite-button></div></calcite-block>`}render(){return m`<div class="root">${this.renderAddLocationBlock()}</div>`}};v("arcgis-utility-network-trace-location",_);return _},"geometry/operators/cutOperator","geometry/operators/lengthOperator","geometry/operators/projectOperator","geometry/Polyline","geometry/SpatialReference","Graphic","rest/networks/support/TraceLocation","symbols/SimpleMarkerSymbol",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as b}from"./MP6Z45SA.js";import c from"./BVV442IW.js";import a from"./NKR3PQHN.js";import{a as R}from"./J6UG5EF7.js";import{b as P}from"./EHZW6UXL.js";import{M as O,N as S,O as j,P as q,S as L,U as Q,a as x,b as o}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([{templateHasKey:V,stripHTML:k},{isRelatableFeatureSupportedLayer:G,findRelatedLayer:J},{substitute:U,formatNumber:H},{watch:_,on:X},K,T,{ignoreAbortErrors:D},Y,,{g:B}])=>{var ee=x`:host{position:relative;flex:1 1 auto}.list{min-height:var(--calcite-spacing-xxxl)}.list-item-hidden{display:none}.feature-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.sticky-loading-container{display:flex;position:sticky;bottom:var(--calcite-spacing-sm);align-items:center;justify-content:center;z-index:2;margin:0;padding:0;height:var(--calcite-spacing-xxxl);pointer-events:none}`,te=y=>{let e=[];if(y.formTemplate){let{description:t,title:r}=y.formTemplate;y.fields?.forEach(i=>{let s=r&&V(r,i.name),a=t&&V(t,i.name);(s||a)&&e.push(i.name)})}return e},E=100,M=class extends j{constructor(){super(...arguments),this._increaseFeaturePage=()=>{let{state:e,showAllEnabled:t,relatedFeatures:r,featuresPerPage:i,featurePage:s}=this;e==="ready"&&t&&r.length>=i*s&&this.featurePage++},this._relatedFeatureIntersectionObserver=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._featurePage=1,this._cancelQuery=()=>{let{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{let{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{let{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();let e=new AbortController;this._queryAbortController=e,await D(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();let e=new AbortController;this._queryFeatureCountAbortController=e,await D(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{let e=new AbortController;this._queryPageAbortController=e,await D(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=b(this._queryController,E),this._queryFeatureCountDebounced=b(this._queryFeatureCountController,E),this._queryPageDebounced=b(this._queryPageController,E),this._query=async()=>{let{_queryAbortController:e,relatedFeatures:t}=this;!this.featureCount||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||(this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,t.destroyAll(),t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal}))))},this._addFlowItem=e=>{e&&this.flowItems?.push(e)},this._relatedFeatureIntersectionObserverNode=O(),this.relatedFeatures=new K,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featureCount=0,this._loaded=!1,this.relatedFeatureViewModels=new K,this.autoDestroyDisabled=!1,this.featuresPerPage=10,this.flowType="feature-relationship",this.headingLevel=2,this.hideHeading=!1,this.hideDescription=!1,this.showAllEnabled=!1}static{this.properties={allCategories:16,_queryAbortController:16,_queryPageAbortController:16,_queryFeatureCountAbortController:16,featureCount:16,_loaded:16,canLoad:16,canQuery:16,displayShowAllButton:16,displayListItems:16,categories:16,itemDescriptionFieldName:16,relatedFeatureViewModels:16,state:16,autoDestroyDisabled:5,allItemsDescription:32,featurePage:9,featuresPerPage:9,flowItems:0,flowType:1,headingLevel:9,messages:0,heading:1,description:1,values:0,activeCategory:0,hideHeading:5,hideDescription:5,displayCount:9,graphic:0,layer:0,map:0,view:0,spatialReference:0,timeZone:1,orderByFields:0,relationshipId:9,showAllEnabled:5,label:3}}static{this.styles=ee}get orderByFieldsFixedCasing(){let{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(r=>{let i=r.clone();return i.field=B(r.field,t),i}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get allCategoriesCount(){return this.allCategories?.length??0}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedLayer(){let{layer:e,map:t,relationship:r}=this;if(!e?.loaded||!t||!r)return null;let i=e.type==="subtype-sublayer"&&e.parent&&G(e.parent)?e.parent:e;return J(t,i,r)??null}get relatedLayerKeyField(){let{relatedLayer:e,relationshipId:t}=this;return e?.loaded&&t!=null?e.relationships?.find(r=>r.id===t)?.keyField:null}get relatedLayerKeyFields(){let{relatedLayer:e}=this;return e?.loaded?e.relationships?.map(t=>t.keyField).filter(t=>t!=null)??[]:[]}get relationship(){let{relationshipId:e,layer:t}=this;return e!=null&&t?.loaded?t.relationships?.find(({id:r})=>r===e)??null:null}get relationshipKey(){let{relationshipKeyField:e}=this;return(e&&this.graphic?.attributes?.[e])??null}get relationshipKeyField(){return this.relationship?.keyField||null}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){let e=this.layer?.capabilities?.queryRelated;return!!this.relatedLayer&&!!this.relationship&&this.relationshipId!=null&&this.objectId!=null&&!!e?.supportsCount&&e?.supportsPagination}get displayShowAllButton(){let{showAllEnabled:e,featureCount:t,displayCount:r,state:i,allCategoriesCount:s}=this,a=!!s&&(s>r||r===0),n=!!t&&(t>r||r===0);return!e&&i==="ready"&&(a||n)}get displayListItems(){let{relatedFeatures:e,allCategoriesCount:t}=this;return this.displayShowAllButton||!!e.length||!!t}get categories(){let{allCategories:e}=this;return this.showAllEnabled?e:e?.slice(0,this.displayCount)??null}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}get state(){let{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:i,_loaded:s,canLoad:a}=this;return t||a&&!s?"loading":e||r?"querying":i?"ready":"disabled"}get allItemsDescription(){let{messages:e,featureCount:t,allCategories:r,allCategoriesCount:i}=this;return U(e?.numberRecords??"",{number:H(r?i:t)})}get featurePage(){return this._featurePage}set featurePage(e){let{featuresPerPage:t,featureCount:r}=this,i=1,s=Math.ceil(r/t)||1;this._featurePage=Math.min(Math.max(e,i),s)}get heading(){let{activeCategory:e}=this;return this._heading??e?.name}set heading(e){this._heading=e}get displayCount(){return this._displayCount??3}set displayCount(e){this._displayCount=Math.min(Math.max(e??3,0),10)}async destroy(){await this.manager.destroy()}loaded(){this.manager.onLifecycle(()=>[_(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount,this.activeCategory],()=>this._queryDebounced(),{initial:!0}),_(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),_(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery,this.activeCategory],()=>this._queryFeatureCountDebounced(),{initial:!0}),_(()=>[this.state,this.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),X(()=>this.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels())]),this.manager.onDestroy(()=>{this.relatedFeatureViewModels.destroyAll(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage(),this._unobserveRelatedFeatureObserver()})}async _queryFeatureCount(){let{layer:e,relatedLayer:t}=this;await e?.load(),await t?.load();let{_queryFeatureCountAbortController:r,activeCategory:i,canQuery:s,objectId:a,relatedLayerKeyField:n,relationshipId:l,relationshipKey:g,supportsCacheHint:C}=this;if(!s||!e||!t||a==null){this.featureCount=0,this.allCategories=void 0;return}if(t?.type==="subtype-group"&&!i){if(this.featureCount=0,this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,this.relatedFeatures.destroyAll(),n&&g!=null){let{default:w}=await $arcgis.t(m=>m[0],"smartMapping/statistics/uniqueValues"),{uniqueValueInfos:v}=await w({layer:t,sqlWhere:`${n} = '${g}'`,field:t.subtypeField??void 0,signal:r?.signal}),I=v.map(({count:u,value:c})=>{let m=t.subtypes?.find(A=>A.code===c)?.name;return c!=null&&m?{count:u,value:c,name:m}:void 0}).filter(u=>u!=null);this.allCategories=I}return}let{historicMoment:p,gdbVersion:f}=e,F=new T({cacheHint:C,gdbVersion:f,historicMoment:p,relationshipId:l,returnGeometry:!1,objectIds:[a],where:this._getRelationshipWhereClause(t)}),h=await e.queryRelatedFeaturesCount(F,{signal:r?.signal});this.allCategories=void 0,this.featureCount=h[a]||0}_getRelationshipWhereClause(e){let{activeCategory:t}=this,r=e.createQuery(),i="subtypeField"in e?e.subtypeField:void 0,s=t&&i?`${i} = ${t.value}`:void 0,a=r.where;return a&&s?`(${a}) AND (${s})`:a??s}_sliceFeatures(e){let{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){let{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:i,featureCount:s}=this;!r||t<2||!s||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||e.addMany(await this._queryRelatedFeatures({signal:i?.signal}))}async _queryRelatedFeatures(e){let{displayCount:t,featureCount:r,featurePage:i,featuresPerPage:s,layer:a,orderByFieldsFixedCasing:n,relatedLayer:l,relatedLayerKeyFields:g,relationshipId:C,showAllEnabled:p,supportsCacheHint:f}=this,{canQuery:F,objectId:h}=this;if(!F||!a||!l||h==null)return[];let w=p?((i-1)*s+r)%r:0,v=p?s:t,I=l.objectIdField,u="subtypeField"in l?l.subtypeField:void 0,c=[...n.map(d=>d.field),...te(l),...g,I,u].filter(d=>d!=null),m=n.map(d=>`${d.field} ${d.order}`),{historicMoment:A,gdbVersion:Z}=a,W=new T({orderByFields:m,start:w,num:v,outFields:c,cacheHint:f,historicMoment:A,gdbVersion:Z,relationshipId:C,returnGeometry:!1,objectIds:[h],where:this._getRelationshipWhereClause(l)}),$=(await a.queryRelatedFeatures(W,{signal:e?.signal}))[h]?.features||[];return l.type==="subtype-group"&&u?$.forEach(d=>{let z=d.attributes[u],N=l.findSublayerForSubtypeCode?.(z);d.sourceLayer=N,d.layer=N}):$.forEach(d=>{d.sourceLayer=l,d.layer=l}),$}_selectCategory(e){let{flowItems:t}=this;t&&this._addRelationshipFlowItem({showAllEnabled:!0,activeCategory:e})}_selectRecord(e){let{flowItems:t}=this;t&&this._addFlowItem(L(R(e,o`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .flowType=${this.flowType} .graphic=${e.graphic} .map=${this.map} show-relationship-content .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature>`)))}_addRelationshipFlowItem({showAllEnabled:e=!1,activeCategory:t}){this._addFlowItem(L(R(t,o`<arcgis-feature-relationship .autoDestroyDisabled=${this.autoDestroyDisabled} .messages=${this.messages} .activeCategory=${t} .displayCount=${this.displayCount} .flowItems=${this.flowItems} .flowType=${this.flowType} .graphic=${this.graphic} .heading=${this.heading} hide-description .showAllEnabled=${e} hide-heading .layer=${this.layer} .map=${this.map} .orderByFields=${this.orderByFields} .relationshipId=${this.relationshipId} .spatialReference=${this.spatialReference} .values=${this.values} .view=${this.view}></arcgis-feature-relationship>`)))}_showAllRecords(){let{flowItems:e}=this;e&&this._addRelationshipFlowItem({showAllEnabled:!0})}_handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();let{state:e,showAllEnabled:t}=this;this._relatedFeatureIntersectionObserverNode.value&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode.value)}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode.value&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode.value)}_matchesFeature(e,t){let r=e?.graphic?.getObjectId(),i=t?.getObjectId();return r!=null&&i!=null&&r===i}_setRelatedFeaturesViewModels(){let{relatedFeatures:e,relatedFeatureViewModels:t,map:r,view:i,spatialReference:s,timeZone:a}=this;e?.filter(Boolean).forEach(n=>{t.some(l=>this._matchesFeature(l,n))||t.add(new Y({abilities:{relationshipContent:!1},map:r,view:i,spatialReference:s,timeZone:a,graphic:n}))}),t.forEach(n=>{e?.find(l=>this._matchesFeature(n,l))||t.remove(n)})}render(){let{state:e}=this;return o`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .headingLevel=${this.headingLevel} .description=${this.description}></arcgis-feature-element-info>${e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures()}</div>`}_renderStickyLoading(){return this.state==="querying"?o`<div class="sticky-loading-container">${this._renderLoadingIcon()}</div>`:null}_renderLoadingIcon(){return o`<calcite-loader inline label></calcite-loader>`}_renderLoading(){return o`<div class="loading-container">${this._renderLoadingIcon()}</div>`}_renderShowAllIconNode(){return o`<calcite-icon icon=list scale=s slot=content-end></calcite-icon>`}_renderChevronIconNode(){return o`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`}_renderCategory(e){let{count:t,name:r}=e,i=H(t);return o`<calcite-list-item class="list-item" .disabled=${!t} .label=${r} @calciteListItemSelect=${()=>this._selectCategory(e)}><calcite-chip .label=${i} scale=s slot=content-end>${i}</calcite-chip>${this._renderChevronIconNode()}</calcite-list-item>`}_renderRelatedFeature(e){let{itemDescriptionFieldName:t,values:r}=this,{formattedAttributes:i,state:s,title:a}=e,n={...r,...i?.global},l=(t&&n?.[t])??"";return o`<calcite-list-item class=${q(P("list-item",{"list-item-hidden":s==="loading"}))} .description=${k(l.toString())} .label=${k(a)} @calciteListItemSelect=${()=>this._selectRecord(e)}>${this._renderChevronIconNode()}</calcite-list-item>`}_renderShowAllListItem(){return this.displayShowAllButton?o`<calcite-list-item .description=${this.allItemsDescription} .label=${this.messages?.showAll} @calciteListItemSelect=${()=>this._showAllRecords()}>${this._renderShowAllIconNode()}</calcite-list-item>`:null}_renderNoRelatedFeaturesMessage(){return o`<calcite-notice icon=information kind=brand open scale=s width=full><div slot=message>${this.messages?.noRelatedFeatures}</div></calcite-notice>`}_renderFeatureObserver(){return o`<div class="feature-observer" ${S(this._relatedFeatureIntersectionObserverNode)}></div>`}_renderList(){let{relatedFeatureViewModels:e,categories:t}=this;return o`<calcite-list display-mode=flat .label=${this.messages?.relatedFeaturesList??""}>${t?.map(r=>this._renderCategory(r))??e.toArray().map(r=>this._renderRelatedFeature(r))}${this._renderShowAllListItem()}</calcite-list>`}_renderRelatedFeatures(){let{displayListItems:e}=this,{state:t}=this;return o`<div class=${q(P("list",{"list-querying":t==="querying"}))}>${e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null}${this._renderStickyLoading()}${this._renderFeatureObserver()}</div>`}_renderRelationshipNotFound(){return o`<calcite-notice icon=exclamation-mark-triangle kind=danger open scale=s width=full><div slot=message>${this.messages?.relationshipNotFound}</div></calcite-notice>`}};Q("arcgis-feature-relationship",M);return M},"applications/Components/stringUtils","applications/Components/featureUtils","intl","core/reactiveUtils","core/Collection","rest/support/RelationshipQuery","core/promiseUtils","widgets/Feature/FeatureViewModel",a,c)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import c from"./BVV442IW.js";import a from"./NKR3PQHN.js";import{a as w}from"./SVVJHTPA.js";import"./55IJQTCC.js";import"./7DOI3267.js";import"./EHZW6UXL.js";import{M as b,N as h,O as v,U as $,a as _,b as i,p as o,r as g,s as f,x as n}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([E,,,{b:L,e:F,f:R},{r:m}])=>{var G=_`:host{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}arcgis-features{height:100%}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}calcite-table{--calcite-table-border-color: none}calcite-table-row{--calcite-table-row-border-color: var(--calcite-color-border-3)}.white-panel-background{--calcite-panel-background-color: var(--calcite-color-foreground-1)}.aggregated-geometry-container{display:flex;justify-content:space-between;padding:0 var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-md)}#elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);margin:0 var(--calcite-spacing-sm)}.no-selectable-results{padding:0 var(--calcite-spacing-md);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size)}.results-heading{display:flex;flex-direction:column;margin:var(--calcite-spacing-md);gap:var(--calcite-spacing-xs)}.results-heading .results-heading-title{font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.results-heading .results-heading-subtitle{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3)}.functions-heading{padding:var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-xxs) var(--calcite-spacing-md);font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.no-results-landing{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;margin:var(--calcite-spacing-sm) var(--calcite-spacing-xl) var(--calcite-spacing-xl) var(--calcite-spacing-xl);gap:var(--calcite-spacing-md)}.no-results-landing calcite-icon{margin-bottom:var(--calcite-spacing-sm);--calcite-icon-color: var(--calcite-color-text-3)}.no-results-landing .no-results-heading{font-size:var(--calcite-font-size-2)}.no-results-landing .no-results-description{color:var(--calcite-color-text-3)}`,C={dirtyAreasDiscovered:-2147208511,noValidControllers:-2147208935},p=class extends v{constructor(){super(...arguments),this._defaultPopupTemplateEnabled=!0,this._messages=w({blocking:!0}),this._elementsWithoutLayer=[],this._popoverRef=b(),this._featuresFromSelectedLayer=[],this._layerIdToFeatures=new Map,this._layerIdToLayer=new Map,this._subtypeCodeToFeatures=new Map,this._sourceIdToElements=new Map,this._unLayers=[],this._compareByFeatureTitle=(e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0}),this._compareByLayerTitle=([,e],[,t])=>{let s=e[0].feature.layer,a=t[0].feature.layer,r=s?.title??"",c=a?.title??"";return r.localeCompare(c,void 0,{numeric:!0})},this._queryFeaturesOnLayer=async([e,t])=>{let s=this.utilityNetwork?.getLayerIdBySourceId(e),a=this._getLayerByLayerId(s),r=this._getElementsUniqueByGlobalId(t);if(s==null||!a){this._elementsWithoutLayer.push(...r);return}let c=a.createQuery();c.gdbVersion=this.utilityNetwork?.gdbVersion,c.objectIds=r.map(l=>l.objectId),c.outFields=["*"];let{features:u}=await L(a,c),y=await Promise.all(u.map(async l=>{let d=l.layer;if(l.getEffectivePopupTemplate(this._defaultPopupTemplateEnabled)||(l.popupTemplate=d.createPopupTemplate()),d&&"getFeatureTitle"in d){let T=await d.getFeatureTitle(l)||m(l);return{feature:l,label:T}}return{feature:l,label:m(l)}}));F(a)?y.forEach(l=>this._addOrCreateMapValue(this._subtypeCodeToFeatures,l.feature.layer.subtypeCode,l)):this._layerIdToFeatures.set(s,y)},this._aggregateGeometryRefChange=e=>{e&&(this._aggregatedGeometryComponentElement=e)},this._featuresRefChange=e=>{e&&(this._featuresComponentElement=e)},this._aggregatedGeometryDisabled=!1,this.aggregatedGeometryGraphicsColor=new E([255,255,0,.6]),this.hideActionBar=!1,this.hideFeatureResults=!1,this.isElementsSelected=!1,this.layers=[],this.state="ready",this.traceResultFeatures=[],this.autoDestroyDisabled=!1,this.arcgisAggregatedGeometryGraphicsColorChange=n(),this.arcgisHideGraphicsChange=n(),this.arcgisSelectedLayerChange=n(),this.arcgisSelectedResultTypeChange=n(),this.arcgisTraceResultFeaturesReady=n(),this._renderLayerListItem=([,e])=>{if(!e.length)return null;let t=e[0].feature.layer,s=t?.title||this._messages.unknown;return i`<calcite-list-item .label=${s} @calciteListItemSelect=${()=>this._setSelectedLayerAndFeatures(t)}><calcite-chip .label=${this._messages.labels.numElements} slot=content-end scale=s>${e.length}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`},this._renderFeatureListItem=e=>{let{feature:t,label:s}=e;return i`<calcite-list-item .label=${s} @calciteListItemSelect=${()=>this.selectedFeature=t}><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`}}static{this.properties={_aggregatedGeometryDisabled:16,aggregatedGeometryGraphicsColor:0,hideActionBar:5,hideFeatureResults:5,featuresFromSelectedLayer:32,isElementsSelected:5,layers:0,messageOverrides:0,numResults:32,referenceElement:1,selectedFeature:0,selectedLayer:0,state:1,traceConfigTitle:1,traceError:0,traceResult:0,traceResultFeatures:0,utilityNetwork:0,view:0,autoDestroyDisabled:5}}static{this.styles=G}get featuresFromSelectedLayer(){return this._featuresFromSelectedLayer.map(({feature:e})=>e)}get numResults(){return this.traceResultFeatures.length+this._elementsWithoutLayer.length}clearAggregatedGeometryGraphics(){this._aggregatedGeometryComponentElement?.destroy()}async destroy(){this._layerIdToFeatures.clear(),this._subtypeCodeToFeatures.clear(),this._sourceIdToElements.clear(),this._aggregatedGeometryComponentElement?.destroy(),this._featuresComponentElement?.destroy(),await this.manager.destroy()}load(){this.traceResult&&(this._setSourceIdToElements(),this._loadDependencies().then(()=>this._queryTraceResultsFeatures()).finally(()=>{this.arcgisTraceResultFeaturesReady.emit(),this.state="ready"}))}willUpdate(e){e.has("isElementsSelected")&&this.arcgisSelectedResultTypeChange.emit(),e.has("selectedLayer")&&this.arcgisSelectedLayerChange.emit(),e.has("traceResult")&&(this.isElementsSelected=!1,this.traceResult||(this.traceResultFeatures=[],this._elementsWithoutLayer=[])),(e.has("layers")||e.has("utilityNetwork"))&&this._loadDependencies()}loaded(){this.utilityNetwork||o("warn",this,g("utilityNetwork")),this.layers.length===0&&o("warn",this,f("layers")),this.view||o("warn",this,g("view"))}disconnectedCallback(){super.disconnectedCallback(),this._layerIdToLayer.clear()}_addOrCreateMapValue(e,t,s){let a=e.get(t);a==null?e.set(t,[s]):a.push(s)}_getLayerByLayerId(e){if(e==null)return;let{_layerIdToLayer:t,_unLayers:s}=this;if(t.get(e))return t.get(e);let a=s.find(r=>"layerId"in r&&r.layerId===e);return a&&t.set(e,a),a}_getElementsUniqueByGlobalId(e){return Array.from(new Map(e.map(t=>[t.globalId,t])).values())}_handleHideGraphicsChange(e){e.stopPropagation();let t=e.detail;this.arcgisHideGraphicsChange.emit(t),this._aggregatedGeometryDisabled=t,t&&this._popoverRef.value?.open&&(this._popoverRef.value.open=!1)}async _loadDependencies(){let{layers:e,utilityNetwork:t}=this;if(!t)return;t.loaded||(this.state="loading",await t.load()),this._unLayers=e.filter(a=>t.isUtilityLayer(a));let s=this._unLayers.filter(a=>!a.loaded).map(a=>a.load());s.length>0&&(this.state="loading",await Promise.allSettled(s))}async _queryTraceResultsFeatures(){let e=Array.from(this._sourceIdToElements.entries());if(!e.length)return;this.state="loading";let t=e.map(this._queryFeaturesOnLayer);(await Promise.allSettled(t)).forEach((r,c)=>{if(r.status==="rejected"){let[u]=e[c];o("error",this,`Failed to query features for source ${u}. Reason: ${r.reason}`)}});let s=Array.from(this._layerIdToFeatures.values()),a=Array.from(this._subtypeCodeToFeatures.values());this.traceResultFeatures=s.concat(a).flat().map(({feature:r})=>r)}_setSelectedLayerAndFeatures(e){let t;if(!e)t=[];else if(R(e)){let{subtypeCode:s}=e;t=this._subtypeCodeToFeatures.get(s)??[]}else{let{layerId:s}=e;t=this._layerIdToFeatures.get(s)??[]}this._featuresFromSelectedLayer=t.sort(this._compareByFeatureTitle),this.selectedLayer=e}_setSourceIdToElements(){this.traceResult.elements?.forEach(e=>this._addOrCreateMapValue(this._sourceIdToElements,e.networkSourceId,e))}render(){let{traceError:e,traceResult:t}=this;if(e)return this._renderErrorLanding(e);if(!t)return this._renderNoTraceLanding();let{elements:s,globalFunctionResults:a,aggregatedGeometry:r}=t;if(!s.length&&!a.length&&!r)return this._renderNoResultsLanding();if(this.state==="loading")return this._renderGettingResults();if(this.selectedFeature)return i`<arcgis-features .referenceElement=${this.referenceElement} .features=${[this.selectedFeature]} .view=${this.view} open .defaultPopupTemplateEnabled=${this._defaultPopupTemplateEnabled} .hideActionBar=${this.hideActionBar} @arcgisClose=${()=>this.selectedFeature=void 0} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._featuresRefChange)}></arcgis-features>`;let c=s.length>0&&!a.length&&!r;return this.hideFeatureResults&&c?this._renderFeaturesAreHiddenLanding():i`<calcite-flow>${c?null:i`<calcite-flow-item .selected=${!this.isElementsSelected}>${this._renderLanding(t)}</calcite-flow-item>`}<calcite-flow-item .heading=${this._messages.headings.features} .description=${this._messages.headings.totalFeatures.replace("{number}",this.numResults.toString())} .selected=${(c||this.isElementsSelected)&&!this.selectedLayer} @calciteFlowItemBack=${()=>this.isElementsSelected=!1}>${this._renderLayerList()}</calcite-flow-item><calcite-flow-item .heading=${this.selectedLayer?.title??void 0} .description=${this._messages.headings.totalFeatures.replace("{number}",this._featuresFromSelectedLayer.length.toString())} .selected=${!!this.selectedLayer} @calciteFlowItemBack=${()=>this.selectedLayer=void 0}>${this._renderFeaturesList()}</calcite-flow-item></calcite-flow>`}_renderGettingResults(){return i`<calcite-panel class="white-panel-background"><calcite-loader .label=${this._messages.gettingResults} .text=${this._messages.gettingResults}></calcite-loader></calcite-panel>`}_renderLanding(e){let{elements:t,globalFunctionResults:s,aggregatedGeometry:a}=e;return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}${a!=null?this._renderAggregatedGeometry(a):null}${a!=null&&!t.length?this._renderNoSelectableResults():null}${t.length>0?this.hideFeatureResults?this._renderFeaturesAreHidden():this._renderElementsResults():null}${s.length>0?this._renderFunctionsResults(s):null}</calcite-panel>`}_renderAggregatedGeometry(e){return i`<div class="aggregated-geometry-container"><arcgis-utility-network-aggregated-geometry .graphicsColor=${this.aggregatedGeometryGraphicsColor} .geometry=${e} .view=${this.view} @arcgisHideGraphicsChange=${this._handleHideGraphicsChange} auto-destroy-disabled ${h(this._aggregateGeometryRefChange)}></arcgis-utility-network-aggregated-geometry><calcite-swatch id=geometry-color-swatch .label=${this._messages.labels.aggregatedGeometryGraphicsColor} .color=${this.aggregatedGeometryGraphicsColor.toCss()} .disabled=${this._aggregatedGeometryDisabled}></calcite-swatch><calcite-popover .heading=${this._messages.headings.setColor} .label=${this._messages.headings.setColor} reference-element=geometry-color-swatch closable ${h(this._popoverRef)}><calcite-color-picker alpha-channel channels-disabled clearable hex-disabled saved-disabled .value=${this.aggregatedGeometryGraphicsColor} @calciteColorPickerChange=${t=>{let s=t.target.value;this.arcgisAggregatedGeometryGraphicsColorChange.emit(s)}} .disabled=${this._aggregatedGeometryDisabled}></calcite-color-picker></calcite-popover></div>`}_renderFeaturesAreHiddenLanding(){return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}${this._renderFeaturesAreHidden()}</calcite-panel>`}_renderFeaturesAreHidden(){return i`<div class="no-selectable-results">${this._messages.resultFeaturesAreHidden}</div>`}_renderNoSelectableResults(){return i`<div class="no-selectable-results">${this._messages.noSelectableFeatures}</div>`}_renderElementsResults(){return i`<calcite-list .label=${this._messages.headings.traceResultsGeneric}><calcite-list-item id=elements-list-item .label=${this._messages.headings.features} @calciteListItemSelect=${()=>this.isElementsSelected=!0}><calcite-chip .label=${this._messages.labels.numFeatures} scale=s slot=content-end>${this.numResults}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item></calcite-list>`}_renderFunctionsResults(e){return i`<div class="functions-heading">${this._messages.headings.functions}</div><calcite-table .caption=${this._messages.labels.functionResults}>${e.filter(t=>t.networkAttributeName!=null&&t.result!=null&&t.functionType!=null).map(t=>i`<calcite-table-row><calcite-table-cell>${`${t.networkAttributeName} ${t.functionType}`}</calcite-table-cell><calcite-table-cell>${t.result}</calcite-table-cell></calcite-table-row>`)}</calcite-table>`}_renderLayerList(){let e=Array.from(this._layerIdToFeatures.entries()),t=Array.from(this._subtypeCodeToFeatures.entries()),s=e.concat(t).sort(this._compareByLayerTitle).map(this._renderLayerListItem);return this._elementsWithoutLayer.length>0&&s.push(this._renderUnknownListItem()),i`<calcite-list .label=${this._messages.labels.traceResultElementsByLayer} .loading=${this.state==="loading"}>${s}</calcite-list>`}_renderUnknownListItem(){return i`<calcite-list-item .label=${this._messages.unknown} disabled><calcite-chip .label=${this._messages.labels.numElements} slot=content-end scale=s>${this._elementsWithoutLayer.length}</calcite-chip></calcite-list-item>`}_renderFeaturesList(){return i`<calcite-list .label=${this._messages.headings.traceResultsGeneric}>${this._featuresFromSelectedLayer.map(this._renderFeatureListItem)}</calcite-list>`}_renderTraceResultsHeading(){return i`<div class="results-heading"><div class="results-heading-title">${this._messages.headings.traceResultsGeneric}</div>${this.traceConfigTitle?i`<div class="results-heading-subtitle">${this.traceConfigTitle}</div>`:null}</div>`}_renderErrorLanding(e){let t=e.message;switch(e.details?.raw?.extendedCode){case C.dirtyAreasDiscovered:t=this._messages.traceErrors.dirtyAreasDiscovered;break;case C.noValidControllers:t=this._messages.traceErrors.noValidControllers;break}return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.traceFailedHeading}</div><div class="no-results-description">${this._messages.traceFailedDescription}</div><div class="no-results-description">${t}</div></div></calcite-panel>`}_renderNoResultsLanding(){return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.noResultsHeading}</div><div class="no-results-description">${this._messages.noResultsDescription}</div></div></calcite-panel>`}_renderNoTraceLanding(){return i`<calcite-panel class="white-panel-background">${this._renderTraceResultsHeading()}<div class="no-results-landing"><calcite-icon icon=utility-network-trace scale=l></calcite-icon><div class="no-results-heading">${this._messages.noTraceConfigHeading}</div><div class="no-results-description">${this._messages.noTraceConfigDescription}</div></div></calcite-panel>`}};$("arcgis-utility-network-trace-results",p);return p},"Color","core/Error","Graphic",a,c)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import c from"./I5CLFGA4.js";import b from"./NKR3PQHN.js";import{a as d}from"./J6UG5EF7.js";import{P as f,S as h,U as y,a as g,b as a}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([{stripHTML:$},{formatNumber:_,substitute:A},{f:u},w])=>{var b=g`:host{position:relative;flex:1 1 auto}.list-item--hidden{display:none}.feature-observer{bottom:var(--calcite-spacing-xxl);position:relative;text-align:center;z-index:2}.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}.notice-container{margin-bottom:var(--calcite-spacing-xs)}`,v="nested",p=class extends w{constructor(){super(...arguments),this.autoDestroyDisabled=!1,this.displayCount=3,this.flowType="feature-utility-network-association-type"}static{this.properties={autoDestroyDisabled:5,description:1,displayCount:9,endIndex:32,flowItems:0,flowType:1,heading:1,map:0,referenceElement:1,spatialReference:0,timeZone:1,view:0}}static{this.styles=b}get endIndex(){let{currentFeaturePage:e,featuresPerPage:t,maxFeatureCount:s}=this;return Math.min(e*t,s)}async destroy(){await this.manager.destroy()}_featureViewModelMatch(e,t){let s=e.graphic,i=s?.layer,o=null;u(i)&&i.parent?o=i.parent.globalIdField??null:i&&"globalIdField"in i&&(o=i.globalIdField);let r=o?s?.getAttribute(o):null,l=t.graphic,n=l?.layer,c=null;u(n)&&n.parent?c=n.parent.globalIdField??null:n&&"globalIdField"in n&&(c=n.globalIdField);let m=c?l?.getAttribute(c):null;return!!(r&&m&&r===m)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if(t.flowType!=="feature-association")return!1;let s=t.viewModel;return this._featureViewModelMatch(s,e)})??-1}_formatPercentAlong(e){let{percentAlong:t}=e;return t==null?"":_(t,{style:"percent",maximumFractionDigits:2})}async _handleFeatureClick(e,t,s){let{flowItems:i}=this;if(e){i?.destroyAll();return}if(t<0||!i){await this._selectAssociation(s);return}for(;i.length>t+1;)i.pop()}_isConnectivityAssociation(e){let{associationType:t}=e;return t==="connectivity"||t==="junction-junction-connectivity"||t==="junction-edge-from-connectivity"||t==="junction-edge-midspan-connectivity"||t==="junction-edge-to-connectivity"}_isConnectivityMidspanAssociation(e){return e.associationType==="junction-edge-midspan-connectivity"}_isParentFeature(e){let t=this.flowItems?.getItemAt(0);if(!t)return!1;let s=t.parentFeatureViewModel;return this._featureViewModelMatch(s,e)}async _selectAssociation(e){let{flowItems:t}=this;t&&t.push(h(d(this.parentFeatureViewModel,a`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .flowType=${"feature-association"} .graphic=${e.graphic} .map=${this.map} .referenceElement=${this.referenceElement} show-utility-network-content .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature>`)))}_showAllAssociations(e){let{flowItems:t,description:s}=this;if(!t||!e)return;this.showAllEnabled=!0;let i=e?.title??"";t.push(h(a`<arcgis-feature-utility-network-association-list .autoDestroyDisabled=${this.autoDestroyDisabled} .associationViewModels=${this.associationViewModels} .description=${s} .flowItems=${t} .flowType=${this.flowType} .heading=${i} .messages=${this.messages} .parentFeatureViewModel=${this.parentFeatureViewModel} .referenceElement=${this.referenceElement} .selectedLayer=${e} .showAllEnabled=${this.showAllEnabled}></arcgis-feature-utility-network-association-list>`))}render(){let{associationViewModels:e,state:t}=this,s=this.selectedLayer?.title??this.messages?.noTitle??"";return a`<div class="root">${t==="loading"||t==="querying"?this._renderLoading():a`<calcite-list .displayMode=${v} .filterEnabled=${this.showAllEnabled&&!!this.selectedLayer} .filterLabel=${this.messages?.associationFilterPlaceholder} .filterPlaceholder=${this.messages?.associationFilterPlaceholder} .label=${s}>${this.showAllEnabled&&this.selectedLayer?a`${this._renderFeatureCountWarning()}${this._renderAssociatedFeatureListPage()}${this._renderFeatureObserver()}`:Array.from(e.keys(),i=>this._renderTypeList(i))}</calcite-list>`}</div>`}_renderAssociatedFeature(e){let{featureViewModel:t,title:s}=e,i=this.state==="loading",o=this._findFlowItem(t),r=o<0&&this._isParentFeature(t),l=r||o>=0,n=`associated-feature-${e.association.globalId}`;return a`<calcite-list-item class=${f(i?"list-item--hidden":"")} .description=${$(e.terminalName??"")} .label=${$(s)} @calciteListItemSelect=${async()=>await this._handleFeatureClick(r,o,t)}>${this._isConnectivityAssociation(e.association)?this._renderConnectivityIcon(e.association.associationType,n):null}${this._isConnectivityMidspanAssociation(e.association)?a`<calcite-chip .label=${this._formatPercentAlong(e.association)} scale=s slot=content-end>${this._formatPercentAlong(e.association)}</calcite-chip>`:null}${this._renderChevronIconNode(l)}</calcite-list-item>`}_renderAssociatedFeatureList(e){return e.toArray().map(t=>this._renderAssociatedFeature(t))}_renderAssociatedFeatureListPage(){let e=this.associationViewModels.get(this.selectedLayer).slice(0,this.endIndex);return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderChevronIconNode(e){return a`<calcite-icon flip-rtl .icon=${e?"move-up":"chevron-right"} scale=s slot=content-end></calcite-icon>`}_renderItemTooltip(e){let{tooltipReferenceMap:t}=this,s=`associated-feature-${e.association.globalId}`;return this._isConnectivityAssociation(e.association)?a`<calcite-tooltip overlay-positioning=fixed .referenceElement=${t.get(s)}>${this.getConnectivityTooltip(e.association.associationType)}</calcite-tooltip>`:null}_renderTypeList(e){let{messages:t}=this,{displayCount:s}=this,i=this.associationViewModels.get(e),o=i.slice(0,s),r=o.length<i.length,l=A(t?.numberRecords??"",{number:i.length.toString()}),n=t?.showAll??"";return d("show-all",a`<calcite-list-item expanded .label=${e.title} .value=${e.id}><calcite-chip .label=${String(i.length)} scale=s slot=content-end>${i.length}</calcite-chip><calcite-list .group=${e.id} .label=${e.title??""}>${[this._renderTooltips(o),this._renderAssociatedFeatureList(o)]}${r?d("show-all-item",a`<calcite-list-item .description=${l} .label=${n} @calciteListItemSelect=${()=>this._showAllAssociations(e)}><calcite-icon icon=list scale=s slot=content-end></calcite-icon></calcite-list-item>`):null}</calcite-list></calcite-list-item>`)}_renderTooltips(e){return e.toArray().map(t=>this._renderItemTooltip(t))}};y("arcgis-feature-utility-network-association-list",p);return p},"applications/Components/stringUtils","intl",b,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import i from"./5CJ44XUV.js";import{a as _}from"./SVVJHTPA.js";import{a as D}from"./YMPJFJHK.js";import e from"./3JMJAUSY.js";import c from"./RO4TU5R3.js";import{g as y}from"./55IJQTCC.js";import"./7DOI3267.js";import a from"./O5TDDX7K.js";import{b as u}from"./EHZW6UXL.js";import{M as d,N as g,O as w,P as h,R as f,U as b,a as v,b as o,x}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([{on:I,when:C,watch:H},M,{property:p,subclass:P},,,,$])=>{var O=Object.defineProperty,L=Object.getOwnPropertyDescriptor,l=(i,e,t,a)=>{for(var n=a>1?void 0:a?L(e,t):e,s=i.length-1,c;s>=0;s--)(c=i[s])&&(n=(a?c(e,t,n):c(n))||n);return a&&n&&O(e,t,n),n},E=new EventTarget;function S(i,e,t){let a=!1,n=H(i,(s,c)=>{a||e(s,c)},t);return{remove(){n.remove()},pause(){a=!0},resume(){a=!1}}}var r=class extends M{constructor(i){super(i),this._viewpointHandle=null,this.addHandles(I(()=>E,"expand",e=>{let{target:t}=e.detail;t!==this&&t.expanded&&t.group&&t.group===this.group&&this.expanded&&this._collapse()}))}destroy(){this._viewpointHandle=null,this.view=null}set autoCollapse(i){this._set("autoCollapse",i),this._watchViewpoint()}set expanded(i){this._set("expanded",i),this.group&&i&&E.dispatchEvent(new CustomEvent("expand",{detail:{target:this}})),this._viewpointHandleChange(i)}get state(){return this.view?.ready?"ready":"disabled"}set view(i){this._get("view")!==i&&(this._set("view",i),i&&C(()=>i.ready,()=>{this.view===i&&this._watchViewpoint()},{once:!0,initial:!0}))}_viewpointHandleChange(i){this._viewpointHandle&&(i?C(()=>this.view?.stationary,()=>this._viewpointHandle?.resume(),{once:!0,initial:!0}):this._viewpointHandle.pause())}_watchViewpoint(){let i="viewpoint";this.removeHandles(i),this._viewpointHandle=null;let{autoCollapse:e,view:t}=this;if(!t||!e)return;let a=S(()=>t.type==="3d"?t.camera:t.viewpoint,()=>this._collapse());this.addHandles(a,i),this._viewpointHandle=a}_collapse(){this.expanded=!1}};l([p({value:!1})],r.prototype,"autoCollapse",1);l([p({value:!1})],r.prototype,"expanded",1);l([p()],r.prototype,"group",2);l([p({readOnly:!0})],r.prototype,"state",1);l([p({value:null})],r.prototype,"view",1);r=l([P("map-components.expand.ExpandViewModel")],r);var j=v`:host{display:flex;pointer-events:auto;--arcgis-internal-expand-icon-number-spacing-left: none;--arcgis-internal-expand-icon-number-spacing-right: none}arcgis-expand>.content-expanded{background-color:var(--calcite-color-background)}.root{--esri-widget-panel-max-height: 95svh;--calcite-sheet-max-height: var(--esri-widget-panel-max-height);--calcite-sheet-height: auto;background-color:var(--calcite-color-foreground-1)}.action{cursor:pointer;text-align:center;color:var(--calcite-color-text-2);justify-content:center;align-items:center;margin:0;padding:0;font-size:var(--calcite-font-size);transition:background-color .125s ease-in-out;display:flex;flex-direction:column;overflow:hidden}.toggle{position:relative}.popover-content{flex-direction:column;display:flex;max-height:var(--arcgis-internal-expand-max-height, 95svh);::slotted(*){max-height:var(--arcgis-internal-expand-max-height, 95svh);overflow-y:auto}::slotted(arcgis-sketch){--arcgis-internal-sketch-gap: var(--calcite-spacing-none)}::slotted(:is(arcgis-area-measurement-2d,arcgis-area-measurement-3d,arcgis-basemap-gallery,arcgis-basemap-layer-list,arcgis-bookmarks,arcgis-building-explorer,arcgis-catalog-layer-list,arcgis-directions,arcgis-direct-line-measurement-3d,arcgis-distance-measurement-2d,arcgis-editor,arcgis-feature-form,arcgis-features,arcgis-layer-list,arcgis-legend,arcgis-line-of-sight,arcgis-print,arcgis-shadow-cast,arcgis-slice,arcgis-table-list,arcgis-utility-network-trace,arcgis-grid-controls)){width:var(--arcgis-internal-panel-width);min-width:var(--calcite-spacing-xxxl);min-height:var(--calcite-spacing-xxxl);transition:max-height .25s ease-in-out}}.popover-content .esri-widget--panel{width:300px}.panel{max-height:var(--esri-widget-panel-max-height)}.panel-content{::slotted(*){width:100%}::slotted(:is(arcgis-area-measurement-2d,arcgis-area-measurement-3d,arcgis-basemap-gallery,arcgis-basemap-layer-list,arcgis-bookmarks,arcgis-building-explorer,arcgis-catalog-layer-list,arcgis-directions,arcgis-direct-line-measurement-3d,arcgis-distance-measurement-2d,arcgis-editor,arcgis-feature-form,arcgis-features,arcgis-layer-list,arcgis-legend,arcgis-line-of-sight,arcgis-print,arcgis-shadow-cast,arcgis-slice,arcgis-table-list,arcgis-utility-network-trace,arcgis-grid-controls)){overflow-y:auto}}.panel-content .esri-widget{width:auto}.panel-content .esri-widget--panel{flex:auto}.arcgis-map-container-ui__element .popover-content .esri-widget,.arcgis-map-container-ui__element .popover-content .esri-widget.esri-component,.arcgis-map-container-ui__element .panel-content .esri-widget,.arcgis-map-container-ui__element .panel-content .esri-widget.esri-component,.popover-content .esri-widget,.popover-content .esri-widget.esri-component,.panel-content .esri-widget,.panel-content .esri-widget.esri-component{box-sizing:border-box;box-shadow:none;margin-bottom:0}.panel-content,.content-container{background-color:var(--calcite-color-foreground-1);flex-direction:column;flex:auto;justify-content:stretch;display:flex}.sheet .panel-content,.sheet .content-container{overflow:hidden}.panel-icon-number{align-self:center}.icon{display:flex}calcite-button:not(:hover) .icon:not(calcite-icon){color:var(--calcite-color-text-3)}.icon-flip{transform:var(--arcgis-internal-collapse-icon-flip)}.icon-number{transform-origin:50%;color:var(--calcite-color-text-inverse);pointer-events:none;background-color:var(--calcite-color-text-3);border-radius:var(--calcite-spacing-xl);justify-content:center;align-items:center;height:var(--calcite-spacing-lg);padding:.125em .333em;font-size:var(--calcite-font-size-sm);line-height:1em;display:flex;position:absolute;top:-6px;left:var(--arcgis-internal-expand-icon-number-spacing-left);right:var(--arcgis-internal-expand-icon-number-spacing-right)}`,k="chevrons-left",T="chevrons-right",z=$(r),m=class extends w{constructor(){super(...arguments),this.popoverEl=d(),this.messages=_({}),this.viewModel=z(this),this.toggleActionEl=d(),this.view=this.viewModel.view,this.state=this.viewModel.state,this.autoDestroyDisabled=!1,this.autoCollapse=this.viewModel.autoCollapse,this.closeOnEscDisabled=!1,this.content="",this.expandTooltip="",this.collapseTooltip="",this.focusTrapDisabled=!1,this.group=this.viewModel.group,this.iconNumber=0,this.mode="auto",this.topLayerDisabled=!1,this.visualScale="m",this.arcgisPropertyChange=y()("expanded"),this.arcgisReady=x()}static{this.properties={expandTitle:16,_displaySheet:16,view:0,state:32,icon:1,label:1,autoDestroyDisabled:5,referenceElement:1,autoCollapse:5,closeOnEscDisabled:5,content:1,expanded:7,expandIcon:3,expandTooltip:1,collapseIcon:3,collapseTooltip:1,focusTrapDisabled:5,group:1,iconNumber:9,mode:1,placement:1,messageOverrides:0,topLayerDisabled:5,visualScale:1}}static{this.styles=j}get expandTitle(){let{expanded:e,messages:t,collapseTooltip:a,expandTooltip:n}=this;return(e?a||t.collapse:n||t.expand)??""}get _displaySheet(){switch(this.mode){case"drawer":return!0;case"auto":return this.viewModel.view?.widthBreakpoint==="xsmall";default:return!1}}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){if(this._expandIcon)return this._expandIcon;let e=null;return this.content instanceof HTMLElement&&("widget"in this.content&&this.content.widget?.icon?e=this.content.widget.icon:"icon"in this.content?e=this.content.icon:e=this.content.getAttribute("icon")),e??k}set expandIcon(e){this._expandIcon=e}get collapseIcon(){return this._collapseIcon??T}set collapseIcon(e){this._collapseIcon=e}async collapse(){this.expanded=!1}async destroy(){await this.manager.destroy()}async expand(){this.expanded=!0}loaded(){this.manager.onLifecycle(()=>[H(()=>this.viewModel?.view?.size,()=>void this.popoverEl?.value?.reposition(),{initial:!0})])}toggle(){this.expanded=!this.expanded}getPopoverPlacement(){if(this.placement)return this.placement;switch(this.el.slot){case"bottom-start":case"bottom-left":return"right-end";case"bottom-right":case"bottom-end":return"left-end";case"top-start":case"top-left":return"right-start";case"top-right":case"top-end":return"left-start";case"manual":default:return"auto"}}_isCloseOnEscapeDisabled(e){let{closeOnEscDisabled:t}=this;return typeof t=="function"?t(e):t}_handlePopoverClose(e){e.target===this.popoverEl.value&&this.collapse()}_handleKeyDown(e){this.expanded&&e.key==="Escape"&&this._isCloseOnEscapeDisabled(e)&&e.preventDefault()}render(){let{_displaySheet:e,toggleActionEl:t,viewModel:{expanded:a},label:n,topLayerDisabled:s}=this;return o`<div class=${h(u("root",D.widget))}>${this._renderToggle()}${e?o`<calcite-sheet class="sheet" height=l .label=${n??""} .topLayerDisabled=${s} @keydown=${this._handleKeyDown} .open=${a} position=block-end @calciteSheetClose=${this.collapse}><calcite-panel class="panel" closable .closed=${!a} .heading=${n} @keydown=${this._handleKeyDown} @calcitePanelClose=${this.collapse}><div class="panel-content">${this._renderContent()}</div></calcite-panel></calcite-sheet>`:t.value?o`<calcite-popover .focusTrapDisabled=${this.focusTrapDisabled} .label=${n??""} @keydown=${this._handleKeyDown} trigger-disabled .open=${this.expanded} overlay-positioning=fixed .placement=${this.getPopoverPlacement()} .referenceElement=${t.value} .topLayerDisabled=${s} @calcitePopoverClose=${this._handlePopoverClose} ${g(this.popoverEl)}><div class="popover-content">${this._renderContent()}</div></calcite-popover>`:null}</div>`}_renderBadgeNumber(){let{expanded:e,iconNumber:t}=this;return t&&!e?o`<span class="icon-number">${t}</span>`:null}_renderToggleButton(){let{expanded:e,expandTitle:t,expandIcon:a,collapseIcon:n}=this,s=e?n:a;return o`<calcite-action class=${h(u("action","icon",{"icon-flip":s===k||s===T}))} @click=${this.toggle} .text=${t} title=${t??f} .icon=${s} .scale=${this.visualScale} ${g(this.toggleActionEl)}></calcite-action>`}_renderToggle(){return o`<div class="toggle">${this._renderToggleButton()}${this._renderBadgeNumber()}</div>`}_renderContent(){return o`<div class="content-container"><slot></slot></div>`}};b("arcgis-expand",m);return m},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators",a,c,e,i)
|
|
2
|
+
import i from"./5CJ44XUV.js";import{a as _}from"./SVVJHTPA.js";import{a as D}from"./YMPJFJHK.js";import e from"./3JMJAUSY.js";import c from"./RO4TU5R3.js";import{g as y}from"./55IJQTCC.js";import"./7DOI3267.js";import a from"./O5TDDX7K.js";import{b as u}from"./EHZW6UXL.js";import{M as d,N as g,O as w,P as h,R as f,U as b,a as v,b as o,x}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([{on:I,when:C,watch:H},P,{property:p,subclass:M},,,,$])=>{var O=Object.defineProperty,L=Object.getOwnPropertyDescriptor,l=(i,e,t,a)=>{for(var s=a>1?void 0:a?L(e,t):e,n=i.length-1,c;n>=0;n--)(c=i[n])&&(s=(a?c(e,t,s):c(s))||s);return a&&s&&O(e,t,s),s},E=new EventTarget;function S(i,e,t){let a=!1,s=H(i,(n,c)=>{a||e(n,c)},t);return{remove(){s.remove()},pause(){a=!0},resume(){a=!1}}}var r=class extends P{constructor(i){super(i),this._viewpointHandle=null,this.addHandles(I(()=>E,"expand",e=>{let{target:t}=e.detail;t!==this&&t.expanded&&t.group&&t.group===this.group&&this.expanded&&this._collapse()}))}destroy(){this._viewpointHandle=null,this.view=null}set autoCollapse(i){this._set("autoCollapse",i),this._watchViewpoint()}set expanded(i){this._set("expanded",i),this.group&&i&&E.dispatchEvent(new CustomEvent("expand",{detail:{target:this}})),this._viewpointHandleChange(i)}get state(){return this.view?.ready?"ready":"disabled"}set view(i){this._get("view")!==i&&(this._set("view",i),i&&C(()=>i.ready,()=>{this.view===i&&this._watchViewpoint()},{once:!0,initial:!0}))}_viewpointHandleChange(i){this._viewpointHandle&&(i?C(()=>this.view?.stationary,()=>this._viewpointHandle?.resume(),{once:!0,initial:!0}):this._viewpointHandle.pause())}_watchViewpoint(){let i="viewpoint";this.removeHandles(i),this._viewpointHandle=null;let{autoCollapse:e,view:t}=this;if(!t||!e)return;let a=S(()=>t.type==="3d"?t.camera:t.viewpoint,()=>this._collapse());this.addHandles(a,i),this._viewpointHandle=a}_collapse(){this.expanded=!1}};l([p({value:!1})],r.prototype,"autoCollapse",1);l([p({value:!1})],r.prototype,"expanded",1);l([p()],r.prototype,"group",2);l([p({readOnly:!0})],r.prototype,"state",1);l([p({value:null})],r.prototype,"view",1);r=l([M("map-components.expand.ExpandViewModel")],r);var j=v`:host{display:flex;pointer-events:auto;--arcgis-internal-expand-icon-number-spacing-left: none;--arcgis-internal-expand-icon-number-spacing-right: none}arcgis-expand>.content-expanded{background-color:var(--calcite-color-background)}.root{--esri-widget-panel-max-height: 95svh;--calcite-sheet-max-height: var(--esri-widget-panel-max-height);--calcite-sheet-height: auto;background-color:var(--calcite-color-foreground-1)}.action{cursor:pointer;text-align:center;color:var(--calcite-color-text-2);justify-content:center;align-items:center;margin:0;padding:0;font-size:var(--calcite-font-size);transition:background-color .125s ease-in-out;display:flex;flex-direction:column;overflow:hidden}.toggle{position:relative}.popover-content{flex-direction:column;display:flex;max-height:var(--arcgis-internal-expand-max-height, 95svh);::slotted(*){max-height:var(--arcgis-internal-expand-max-height, 95svh);overflow-y:auto}::slotted(arcgis-sketch){--arcgis-internal-sketch-gap: var(--calcite-spacing-none)}::slotted(:is(arcgis-area-measurement-2d,arcgis-area-measurement-3d,arcgis-basemap-gallery,arcgis-basemap-layer-list,arcgis-bookmarks,arcgis-building-explorer,arcgis-catalog-layer-list,arcgis-directions,arcgis-direct-line-measurement-3d,arcgis-distance-measurement-2d,arcgis-editor,arcgis-feature-form,arcgis-features,arcgis-layer-list,arcgis-legend,arcgis-line-of-sight,arcgis-print,arcgis-shadow-cast,arcgis-slice,arcgis-table-list,arcgis-utility-network-trace,arcgis-grid-controls)){width:var(--arcgis-internal-panel-width);min-width:var(--calcite-spacing-xxxl);min-height:var(--calcite-spacing-xxxl);transition:max-height .25s ease-in-out}}.popover-content .esri-widget--panel{width:300px}.panel{max-height:var(--esri-widget-panel-max-height)}.panel-content{::slotted(*){width:100%}::slotted(:is(arcgis-area-measurement-2d,arcgis-area-measurement-3d,arcgis-basemap-gallery,arcgis-basemap-layer-list,arcgis-bookmarks,arcgis-building-explorer,arcgis-catalog-layer-list,arcgis-directions,arcgis-direct-line-measurement-3d,arcgis-distance-measurement-2d,arcgis-editor,arcgis-feature-form,arcgis-features,arcgis-layer-list,arcgis-legend,arcgis-line-of-sight,arcgis-print,arcgis-shadow-cast,arcgis-slice,arcgis-table-list,arcgis-utility-network-trace,arcgis-grid-controls)){overflow-y:auto}}.panel-content .esri-widget{width:auto}.panel-content .esri-widget--panel{flex:auto}.arcgis-map-container-ui__element .popover-content .esri-widget,.arcgis-map-container-ui__element .popover-content .esri-widget.esri-component,.arcgis-map-container-ui__element .panel-content .esri-widget,.arcgis-map-container-ui__element .panel-content .esri-widget.esri-component,.popover-content .esri-widget,.popover-content .esri-widget.esri-component,.panel-content .esri-widget,.panel-content .esri-widget.esri-component{box-sizing:border-box;box-shadow:none;margin-bottom:0}.panel-content,.content-container{background-color:var(--calcite-color-foreground-1);flex-direction:column;flex:auto;justify-content:stretch;display:flex}.sheet .panel-content,.sheet .content-container{overflow:hidden}.panel-icon-number{align-self:center}.icon{display:flex}calcite-button:not(:hover) .icon:not(calcite-icon){color:var(--calcite-color-text-3)}.icon-flip{transform:var(--arcgis-internal-collapse-icon-flip)}.icon-number{transform-origin:50%;color:var(--calcite-color-text-inverse);pointer-events:none;background-color:var(--calcite-color-text-3);border-radius:var(--calcite-spacing-xl);justify-content:center;align-items:center;height:var(--calcite-spacing-lg);padding:.125em .333em;font-size:var(--calcite-font-size-sm);line-height:1em;display:flex;position:absolute;top:-6px;left:var(--arcgis-internal-expand-icon-number-spacing-left);right:var(--arcgis-internal-expand-icon-number-spacing-right)}`,k="chevrons-left",T="chevrons-right",z=$(r),m=class extends w{constructor(){super(...arguments),this.popoverEl=d(),this.messages=_({}),this.viewModel=z(this),this.toggleActionEl=d(),this.view=this.viewModel.view,this.state=this.viewModel.state,this.autoDestroyDisabled=!1,this.autoCollapse=this.viewModel.autoCollapse,this.closeOnEscDisabled=!1,this.content="",this.expanded=this.viewModel.expanded,this.expandTooltip="",this.collapseTooltip="",this.focusTrapDisabled=!1,this.group=this.viewModel.group,this.iconNumber=0,this.mode="auto",this.topLayerDisabled=!1,this.visualScale="m",this.arcgisPropertyChange=y()("expanded"),this.arcgisReady=x()}static{this.properties={expandTitle:16,_displaySheet:16,view:0,state:32,icon:1,label:1,autoDestroyDisabled:5,referenceElement:1,autoCollapse:5,closeOnEscDisabled:5,content:1,expanded:7,expandIcon:3,expandTooltip:1,collapseIcon:3,collapseTooltip:1,focusTrapDisabled:5,group:1,iconNumber:9,mode:1,placement:1,messageOverrides:0,topLayerDisabled:5,visualScale:1}}static{this.styles=j}get expandTitle(){let{expanded:e,messages:t,collapseTooltip:a,expandTooltip:s}=this;return(e?a||t.collapse:s||t.expand)??""}get _displaySheet(){switch(this.mode){case"drawer":return!0;case"auto":return this.viewModel.view?.widthBreakpoint==="xsmall";default:return!1}}get expandIcon(){if(this._expandIcon)return this._expandIcon;let e=null;return this.content instanceof HTMLElement&&("widget"in this.content&&this.content.widget?.icon?e=this.content.widget.icon:"icon"in this.content?e=this.content.icon:e=this.content.getAttribute("icon")),e??k}set expandIcon(e){this._expandIcon=e}get collapseIcon(){return this._collapseIcon??T}set collapseIcon(e){this._collapseIcon=e}async collapse(){this.expanded=!1}async destroy(){await this.manager.destroy()}async expand(){this.expanded=!0}loaded(){this.manager.onLifecycle(()=>[H(()=>this.viewModel?.view?.size,()=>void this.popoverEl?.value?.reposition(),{initial:!0})])}toggle(){this.expanded=!this.expanded}getPopoverPlacement(){if(this.placement)return this.placement;switch(this.el.slot){case"bottom-start":case"bottom-left":return"right-end";case"bottom-right":case"bottom-end":return"left-end";case"top-start":case"top-left":return"right-start";case"top-right":case"top-end":return"left-start";case"manual":default:return"auto"}}_isCloseOnEscapeDisabled(e){let{closeOnEscDisabled:t}=this;return typeof t=="function"?t(e):t}_handlePopoverClose(e){e.target===this.popoverEl.value&&this.collapse()}_handleKeyDown(e){this.expanded&&e.key==="Escape"&&this._isCloseOnEscapeDisabled(e)&&e.preventDefault()}render(){let{_displaySheet:e,toggleActionEl:t,expanded:a,label:s,topLayerDisabled:n}=this;return o`<div class=${h(u("root",D.widget))}>${this._renderToggle()}${e?o`<calcite-sheet class="sheet" height=l .label=${s??""} .topLayerDisabled=${n} @keydown=${this._handleKeyDown} .open=${a} position=block-end @calciteSheetClose=${this.collapse}><calcite-panel class="panel" closable .closed=${!a} .heading=${s} @keydown=${this._handleKeyDown} @calcitePanelClose=${this.collapse}><div class="panel-content">${this._renderContent()}</div></calcite-panel></calcite-sheet>`:t.value?o`<calcite-popover .focusTrapDisabled=${this.focusTrapDisabled} .label=${s??""} @keydown=${this._handleKeyDown} trigger-disabled .open=${a} overlay-positioning=fixed .placement=${this.getPopoverPlacement()} .referenceElement=${t.value} .topLayerDisabled=${n} @calcitePopoverClose=${this._handlePopoverClose} ${g(this.popoverEl)}><div class="popover-content">${this._renderContent()}</div></calcite-popover>`:null}</div>`}_renderBadgeNumber(){let{expanded:e,iconNumber:t}=this;return t&&!e?o`<span class="icon-number">${t}</span>`:null}_renderToggleButton(){let{expanded:e,expandTitle:t,expandIcon:a,collapseIcon:s}=this,n=e?s:a;return o`<calcite-action class=${h(u("action","icon",{"icon-flip":n===k||n===T}))} @click=${this.toggle} .text=${t} title=${t??f} .icon=${n} .scale=${this.visualScale} ${g(this.toggleActionEl)}></calcite-action>`}_renderToggle(){return o`<div class="toggle">${this._renderToggleButton()}${this._renderBadgeNumber()}</div>`}_renderContent(){return o`<div class="content-container"><slot></slot></div>`}};b("arcgis-expand",m);return m},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators",a,c,e,i)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import b from"./BVV442IW.js";import a from"./NKR3PQHN.js";import{N as c,O as s,U as l,a as n,b as o}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([{watch:g},{renderingSanitizer:m},,{f:h,q:r}])=>{var f=n`.loader-container{display:flex;align-items:center;justify-content:center;padding:0;height:150px}.root{font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-normal)}.root h1,.root h2,.root h3,.root h4,.root h5,.root h6{margin:var(--calcite-spacing-sm) 0;line-height:var(--calcite-font-line-height-relative-tight);letter-spacing:0;color:var(--calcite-color-text-1);font-weight:var(--calcite-font-weight-semibold)}.root h1{font-size:var(--calcite-font-size-xxl)}.root h2{font-size:var(--calcite-font-size-xl)}.root h3{font-size:var(--calcite-font-size-lg)}.root h4,.root h5,.root h6{font-size:var(--calcite-font-size)}.description{margin-bottom:var(--calcite-spacing-xs)}.root p{margin:0 0 var(--calcite-spacing-xs);font-size:var(--calcite-font-size)}.root p:last-child{margin-block-end:0}.root img{max-width:100%;max-height:100%;image-orientation:from-image}.root video{max-width:100%;max-height:100%}.root figure{margin:0;padding:0}.root figcaption{display:block;margin:var(--calcite-spacing-xs) 0 0;padding:0;font-size:var(--calcite-font-size-sm);font-style:italic}.root ul,.root ol{margin-block:var(--calcite-spacing-sm)}.root ul:first-child,.root ol:first-child{margin-block-start:0}.root a,.root a:hover,.root a:focus{color:var(--calcite-color-text-link)}`,a=class extends s{static{this.properties={_loadingPromise:16,_created:16,creator:1,destroyer:0,graphic:0}}static{this.styles=f}loaded(){this.manager.onLifecycle(()=>g(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},{initial:!0}))}async _createContent(t){let{graphic:e}=this;if(!e||!t)return;let i=r({type:"content",value:t,event:{graphic:e}});this._loadingPromise=i;let d=await i;i===this._loadingPromise&&(this._loadingPromise=void 0,this._created=d)}_destroyContent(){let{_created:t,graphic:e,destroyer:i}=this;t&&e&&(r({type:"content",value:i,event:{graphic:e}}),this._created=null)}_addTargetToAnchors(t){t&&Array.from(t.querySelectorAll("a")).forEach(e=>{h(e.href)&&!e.hasAttribute("target")&&e.setAttribute("target","_blank")})}render(){return o`<div class="root">${this._loadingPromise?this._renderLoading():this._renderCreated()}</div>`}_renderLoading(){return o`<div class="loader-container"><calcite-loader inline label></calcite-loader></div>`}_renderCreated(){let{_created:t}=this;return t instanceof HTMLElement?t:typeof t=="string"?o`<div .innerHTML=${m.sanitize(t)??""} ${c(this._addTargetToAnchors)}></div>`:null}};l("arcgis-feature-content",a);return a},"core/reactiveUtils","applications/Components/sanitizerUtils",a,b)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
export default $arcgis.t(([{queryAllJSON:i},y])=>{function l(r){return r!=null&&typeof r=="object"&&"sourceLayer"in r}function m(r,n){if(!r.map)return;let{map:t}=r;t.layers.includes(n)||(t.add(n),t.reorder(n,t.layers.length-1))}async function h(r,n,t,e=!0){let u=await i(r,n,t),o=y.fromJSON(u);return e&&o.features.forEach(a=>{a.layer=p(r)?r.findSublayerForFeature(a):r,a.origin=a.layer,l(a)&&(a.sourceLayer=a.layer)}),o}function c(r){return r!=null&&typeof r=="object"&&"type"in r&&r.type==="feature"}function f(r){return c(r)&&r?.type==="feature"&&r.source?.type==="feature-layer"}function j(r){return r!=null&&typeof r=="object"&&"type"in r&&r.type==="graphics"}function p(r){return r!=null&&typeof r=="object"&&"type"in r&&r.type==="subtype-group"&&"sublayers"in r}function F(r){return r?.type==="subtype-sublayer"}function b(r){return c(r)&&f(r)}function L(r,n){let t=n?.type==="subtype-sublayer"?n.parent:n;return r.allLayerViews.find(e=>{let u=e.layer;return u===t||"sublayers"in u&&u.sublayers!=null&&u.sublayers.includes(t)})}function s(r){let n=r?.type;return n==="binning"||n==="cluster"}function R(r,n){if(!b(r))return;let t=n?.graphic,e=r.featureReduction;if(t){if(t.isAggregate){let u=t.origin;return u&&"featureReductionProvider"in u&&e?s(e)?e:null:void 0}return r}return n?.checkFeatureReduction&&e?s(e)?e:null:r}return{a:m,b:h,c:c,d:j,e:p,f:F,g:L,h:R}},"applications/Components/featureUtils","rest/support/FeatureSet")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as E}from"./VQLAZAPA.js";import e from"./XFLYIMEH.js";import d from"./BVV442IW.js";import c from"./NKR3PQHN.js";import b from"./5MHPKAFK.js";import"./PC4PAQXQ.js";import"./TFUFDVQ6.js";import{a as S}from"./SVVJHTPA.js";import"./55IJQTCC.js";import"./7DOI3267.js";import a from"./O5TDDX7K.js";import{b as y}from"./EHZW6UXL.js";import{M as v,N as f,O as T,P as h,Q as A,R as o,U as M,b as r}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([{isLayerFromCatalog:O},{h:w},,,,{b:I,c:L}])=>{var D={hideChildren:"hide-children"};function R({exclusive:a,visible:e,visibilityAppearance:t}){let i=t==="checkbox";return e?a?"circle-f":i?"check-square-f":"view-visible":a?"circle":i?"square":"view-hide"}function P({connectionStatus:a,publishing:e}){return a?a==="connected"?"beacon":"offline":e?"square":"bullet-point"}function k(a){return a?.listMode===D.hideChildren}function U(a){let e=(a?.layer&&F(a.layer)?a.layer.layer:void 0)??a?.layer;return e?e.type==="catalog"?!1:B(e)??!0:!1}function F(a){return a!=null&&"layer"in a&&a.layer!=null}function B(a){let e=V(a);return e!=null&&"supportsDynamicLayers"in e?e.supportsDynamicLayers:void 0}function V(a){return a&&"capabilities"in a&&a.capabilities!=null&&"exportMap"in a.capabilities?a.capabilities.exportMap:void 0}function G(a){return a?.getAttribute("data-item")}function N(a){let{children:e,error:t}=a,i="incompatible"in a?a.incompatible:!1;return!!e?.filter(n=>!n.hidden).length&&!t&&!i}function q(a){for(let e of a)for(let t of e)if(t.type==="button"||t.type==="toggle")return t}function x(a,e){let t=a.parent,i=a.layer;if(i?.type!=="map-image"||!i.sourceJSON||!t)return!1;let n=i.sourceJSON.layers;if(!n)return!1;let s=n.find(l=>a.id===l.id),c=e==="footprints"?"Feature Layer":"Catalog Dynamic Group Layer";return s?.type!==c?!1:n.find(l=>l.id===t.id)?.type==="Catalog Layer"}var C=class extends T{constructor(){super(...arguments),this._itemRef=v(),this._noticeRef=v(),this.messages=S(),this.hideCatalogLayerList=!1,this.showCloseButton=!1,this.showCollapseButton=!1,this.showErrors=!1,this.showFilter=!1,this.showHeading=!1,this.hideStatusIndicators=!1,this.showTemporaryLayerIndicators=!1,this.showTemporaryTableIndicators=!1,this.dragEnabled=!1,this.listModeDisabled=!1,this.autoDestroyDisabled=!1}static{this.properties={_title:16,_renderedItemStatus:16,_renderedItemTemporaryIcon:16,_renderedItemToggle:16,_renderedPanel:16,_renderedPanelAction:16,_renderedActions:16,_renderedActionMenu:16,_renderedActionMenuContent:16,_renderedCatalogFootprintIcon:16,_renderedCatalogDynamicIcon:16,_renderedCatalogSelectNode:16,_renderedChildList:16,_hasTables:16,_renderedTablesItem:16,_renderedItemMessage:16,_singleAction:16,_filteredSections:16,_actionsCount:16,activeItem:0,canMove:0,css:0,displayMode:1,hideCatalogLayerList:5,showCloseButton:5,showCollapseButton:5,showErrors:5,showFilter:5,showHeading:5,hideStatusIndicators:5,showTemporaryLayerIndicators:5,showTemporaryTableIndicators:5,dragEnabled:5,item:0,layerTablesEnabled:0,listModeDisabled:5,handleAction:0,handlePanelOpen:0,handleCatalogOpen:0,handleTablesOpen:0,handleSelectedDragItemLayerUidChange:0,handleTooltipReferenceChange:0,parent:0,parentTitles:0,rootGroupUid:1,selectionMode:1,selectedItems:0,selectedDragItemLayerUid:1,visibilityAppearance:1,autoDestroyDisabled:5}}static{this.styles=E}get _title(){let{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){let{item:e,parent:t,hideStatusIndicators:i,css:n}=this;if(!i)return null;let{publishing:s}=e,c="updating"in e&&e.updating&&!t,l="connectionStatus"in e?e.connectionStatus:void 0,u=!!l;return r`<calcite-icon class=${h(y(n.statusIndicator,{[n.publishing]:s},"updating"in n&&{[n.updating]:c},"connectionStatus"in n&&{[n.connectionStatus]:u},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:u&&l==="connected"}))} .icon=${P({connectionStatus:l,publishing:s})} scale=s slot=content-end></calcite-icon>`}get _renderedItemTemporaryIcon(){let{item:e,showTemporaryLayerIndicators:t,showTemporaryTableIndicators:i,css:n}=this,{layer:s}=e,c=s&&"persistenceEnabled"in s&&(O(s)||!s.persistenceEnabled);return(t||i)&&c?r`<calcite-icon class=${h(n.itemTemporaryIcon)} icon=temporary scale=s slot=content-start title=${this.messages.temporary??o}></calcite-icon>`:null}get _renderedItemToggle(){let{item:e,parent:t,messages:i,visibilityAppearance:n,css:s}=this;if(!("visible"in e)||!("layerVisibility"in i)||!("visibleToggle"in s)||!n)return null;let{visible:c}=e,l=this._getParentVisibilityMode(t);if(l==="inherited")return null;let u=R({visible:c,exclusive:l==="exclusive",visibilityAppearance:n}),d=n==="checkbox",g=i.layerVisibility;return r`<calcite-action class=${h(s.visibleToggle)} .icon=${d?u:void 0} @click=${()=>this._toggleVisibility(e,t)} scale=s .slot=${d?"actions-start":"actions-end"} .text=${g??""} title=${g??o}>${d?null:r`<calcite-icon class=${h(y({[s.visibleIcon]:l!=="exclusive"&&c}))} .icon=${u} scale=s></calcite-icon>`}</calcite-action>`}get _renderedPanel(){let{panel:e}=this.item;return e?.open&&!e.disabled&&!e.flowEnabled?r`<div class=${h(this.css.itemContentBottom)} slot=content-bottom>${e.render()}</div>`:null}get _renderedPanelAction(){let{panel:e}=this.item;if(!e?.visible)return null;let{open:t,title:i,disabled:n}=e,s={icon:e.icon,image:e.image,indicator:!1};return r`<calcite-action .active=${t} .disabled=${n} .icon=${I(s)} @click=${()=>this._togglePanel(e)} scale=s slot=actions-end .text=${i??""} title=${i??void 0??o}>${this._renderFallbackIcon(e)}</calcite-action>`}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){let{item:e,messages:t}=this,i=t.options;return r`<calcite-action-menu appearance=transparent .label=${t.menu??""} .open=${e.actionsOpen} overlay-positioning=fixed placement=bottom-end scale=s slot=actions-end @calciteActionMenuOpen=${this._onActionMenuOpen}><calcite-action icon=ellipsis scale=s slot=trigger .text=${i??""} title=${i??o}></calcite-action>${this._renderedActionMenuContent}</calcite-action-menu>`}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>r`<calcite-action-group>${e.toArray().map(t=>this._renderAction({action:t,textEnabled:!0}))}</calcite-action-group>`)}get _renderedCatalogFootprintIcon(){let{css:e}=this,t=this.item.layer,i=t?.type==="catalog-footprint",n=t?.type==="sublayer"&&x(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?r`<calcite-icon class=${h(e.itemCatalogIcon)} icon=footprint scale=s slot=content-start></calcite-icon>`:null}get _renderedCatalogDynamicIcon(){let{css:e}=this,t=this.item.layer,i=t?.type==="catalog-dynamic-group",n=t?.type==="sublayer"&&x(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?r`<calcite-icon class=${h(e.itemCatalogIcon)} icon=catalog-dataset scale=s slot=content-start></calcite-icon>`:null}get _renderedCatalogSelectNode(){let{_title:e,item:t,hideCatalogLayerList:i}=this;if(!("visible"in t))return;let{layer:n}=t,s=n?.type==="catalog-dynamic-group";return i&&s?r`<calcite-action .disabled=${!n.visible} icon=chevron-right icon-flip-rtl @click=${()=>this._triggerOnCatalogOpen(t)} scale=s slot=actions-end .text=${e}></calcite-action>`:null}get _renderedChildList(){let{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:s,displayMode:c}=this;if(!("children"in t))return;let l=[...this.parentTitles??[],t.title],{children:u,layer:d}=t,g=d?.type!=="catalog-dynamic-group"&&N(t),$=n?!1:k(d),m=d?.type==="group",_=!$&&!g&&e&&m,b=e?"childrenSortable"in t&&t.childrenSortable&&U(t):!1;return g||_?r`<calcite-list .canPull=${p=>this.canMove?this.canMove(p,"pull"):!1} .canPut=${p=>this.canMove?this.canMove(p,"put"):!1} data-item=${t??o} data-layer-type=${i??o} .displayMode=${c} .dragEnabled=${b} .group=${m?i:`${i}-${d?.uid}`} .label=${t.title} selection-appearance=border .selectionMode=${s}>${u?.filter(p=>!p.hidden&&(this.showErrors||!p.error)).toArray().map(p=>this._renderItem(p,t,l))}${this._renderedTablesItem}</calcite-list>`:null}get _hasTables(){let{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){let{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?r`<calcite-list-item class=${h(i.item)} data-layer-id=${n?.id??o} drag-disabled .label=${t.tables} title=${t.tables??o} @calciteListItemSelect=${()=>this._triggerOnTablesOpen(e)}><calcite-icon class=${h(i.itemTableIcon)} icon=table scale=s slot=content-start></calcite-icon><calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon></calcite-list-item>`:null}get _renderedItemMessage(){let{item:e,messages:t,css:i}=this;return e.error?r`<div class=${h(i.itemMessage)} slot=content-bottom><calcite-notice icon=exclamation-mark-triangle kind=warning open scale=s width=full><div slot=message>${"tableError"in t?t.tableError:t.layerError}</div></calcite-notice></div>`:"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?r`<div class=${h(i.itemMessage)} slot=content-bottom><calcite-notice icon=exclamation-mark-triangle kind=warning open scale=s tabindex=0 width=full ${f(this._noticeRef)}><div slot=message>${t.layerIncompatible}</div></calcite-notice></div>`:null}get _singleAction(){return this._renderAction({action:q(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(t=>t.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}async destroy(){await this.manager.destroy()}willUpdate(){this._itemRef.value&&this._focusSelectedDragEl(this._itemRef.value,this.item),this._noticeRef.value&&this._setTooltipReference(this._noticeRef.value)}updated(){this._itemRef.value&&this._focusSelectedDragEl(this._itemRef.value,this.item),this._noticeRef.value&&this._removeTooltipReference()}_onActionMenuOpen(e){this.item.actionsOpen=e.currentTarget.open}_setTooltipReference(e){this.handleTooltipReferenceChange?.(this.item.layer?.uid,e)}_removeTooltipReference(){this.handleTooltipReferenceChange?.(this.item.layer?.uid,null)}_triggerAction(e,t){!t||!e||(t.type==="toggle"&&(t.value=!t.value),this.handleAction(t,e))}_triggerOnTablesOpen(e){!e||!this.handleTablesOpen||this.handleTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.handleCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(w(e),this.handleSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(G(e.target)!==t)return;let n=this._getParentVisibilityMode(i);this.selectionMode!=="none"||n==="inherited"||this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.handlePanelOpen()}_toggleVisibility(e,t){!e||!("visible"in e)||this._getParentVisibilityMode(t)==="exclusive"&&e.visible||(e.visible=!e.visible)}render(){let e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:s,selectedItems:c,messages:l,parent:u,css:d}=this,g="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in l&&!i.visibleAtCurrentTimeExtent?`${t} (${l.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in l&&!i.visibleAtCurrentScale?`${t} (${l.layerInvisibleAtScale})`:t,$="parent"in i&&i.parent?.layer?.type==="catalog",{layer:m}=i,_="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return r`<calcite-list-item class=${h(y(d.item,"itemActive"in d&&{[d.itemActive]:n===i}))} data-item=${i??o} data-layer-id=${m?.id??o} .dragDisabled=${!("sortable"in i&&i.sortable)||$} id=${m?.uid??o} .label=${t} .metadata=${{parentTitles:e,_title:t}} .expanded=${"open"in i&&i.open} .selected=${s!=="none"?c.includes(i):!1} title=${g??o} .unavailable=${_} .value=${m?.uid} @calciteListItemSelect=${b=>"visible"in i&&this._handleCalciteListItemSelect(b,i,u)} @calciteListItemToggle=${b=>"open"in i&&this._handleCalciteListItemToggle(b,i)} ${f(this._itemRef)}>${this._renderedCatalogFootprintIcon}${this._renderedCatalogDynamicIcon}${this._renderedItemStatus}${this._renderedItemToggle}${this._renderedCatalogSelectNode}${this._renderedItemTemporaryIcon}${this._renderedChildList}${this._renderedItemMessage}${this._renderedPanel}${this._renderedPanelAction}${this._renderedActions}</calcite-list-item>`}_renderAction(e){let{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;let{active:s,disabled:c,title:l,type:u,indicator:d}=i;return r`<calcite-action .active=${u==="toggle"?i.value:!1} data-action-id=${i.id??o} .disabled=${c} .icon=${I(i)} .indicator=${d} .loading=${s} @click=${()=>this._triggerAction(t,i)} scale=s slot=${(n?void 0:"actions-end")??o} .text=${l??""} .textEnabled=${n} title=${l??void 0??o}>${this._renderFallbackIcon(i)}</calcite-action>`}_renderFallbackIcon(e){let{css:t}=this,{icon:i}=e;if(i)return null;let n="image"in e?e.image:void 0,s={[t.itemActionImage]:!!n};return n?r`<span aria-hidden=true class=${h(y(t.itemActionIcon,s))} style=${A(L(n))}></span>`:null}_renderItem(e,t,i=[]){return r`<arcgis-layer-list-item .activeItem=${this.activeItem} .canMove=${this.canMove} .css=${this.css} .displayMode=${this.displayMode} .dragEnabled=${this.dragEnabled} .item=${e} .layerTablesEnabled=${this.layerTablesEnabled} .listModeDisabled=${this.listModeDisabled} .parent=${t} .parentTitles=${i} .rootGroupUid=${this.rootGroupUid} .selectedDragItemLayerUid=${this.selectedDragItemLayerUid} .selectedItems=${this.selectedItems} .selectionMode=${this.selectionMode} .visibilityAppearance=${this.visibilityAppearance} .handleAction=${this.handleAction} .handleCatalogOpen=${this.handleCatalogOpen} .handlePanelOpen=${this.handlePanelOpen} .handleSelectedDragItemLayerUidChange=${this.handleSelectedDragItemLayerUidChange} .handleTablesOpen=${this.handleTablesOpen} .handleTooltipReferenceChange=${this.handleTooltipReferenceChange} .hideCatalogLayerList=${this.hideCatalogLayerList} .showCloseButton=${this.showCloseButton} .showCollapseButton=${this.showCollapseButton} .showErrors=${this.showErrors} .showFilter=${this.showFilter} .showHeading=${this.showHeading} .hideStatusIndicators=${this.hideStatusIndicators} .showTemporaryLayerIndicators=${this.showTemporaryLayerIndicators} .showTemporaryTableIndicators=${this.showTemporaryTableIndicators}></arcgis-layer-list-item>`}};M("arcgis-layer-list-item",C);return C},"layers/catalog/catalogUtils",a,b,c,d,e)
|