@arcgis/core 5.2.0-next.16 → 5.2.0-next.18
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/arcgisGlobal.d.ts +3 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00bcb04934972179b9ca.js +1 -0
- package/assets/esri/core/workers/chunks/073ee52705ea326fecfb.js +1 -0
- package/assets/esri/core/workers/chunks/{282930645ce525d5bc92.js → 0e81b6aa64d5491870b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{4162a2bb774e6ba2c0db.js → 0fb685f385e91d0f0601.js} +1 -1
- package/assets/esri/core/workers/chunks/11d1af758e2140095b10.js +1 -0
- package/assets/esri/core/workers/chunks/{a8ef7acb6d3d1f45e14c.js → 29e6f4b19c3da9129439.js} +1 -1
- package/assets/esri/core/workers/chunks/31c4128b23968575feca.js +1 -0
- package/assets/esri/core/workers/chunks/35a508a9311689d8df52.js +1 -0
- package/assets/esri/core/workers/chunks/3a35779cae6a11cde51b.js +1 -0
- package/assets/esri/core/workers/chunks/3a526e1d18490b99332f.js +1 -0
- package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +1 -0
- package/assets/esri/core/workers/chunks/{cf9a132c4c37e62de3d7.js → 50c88e2545380800381f.js} +1 -1
- package/assets/esri/core/workers/chunks/{a892b3be70f482bef0ba.js → 57a6572d440d2c62432b.js} +1 -1
- package/assets/esri/core/workers/chunks/6849282c4a5cd733779d.js +1 -0
- package/assets/esri/core/workers/chunks/{2b781de7b467c61849b2.js → 6a21a22b08f968fa8d60.js} +1 -1
- package/assets/esri/core/workers/chunks/8104ac2eee69d79ada86.js +1 -0
- package/assets/esri/core/workers/chunks/{1c689bb502657b1f173b.js → 9d59cc5c0a63a4e41d99.js} +1 -1
- package/assets/esri/core/workers/chunks/{91c0de3950991d81b7f2.js → 9de673a04c70bd47047e.js} +1 -1
- package/assets/esri/core/workers/chunks/a195f569eada3a8736be.js +1 -0
- package/assets/esri/core/workers/chunks/{9da1a514e042eb642d35.js → a32651777e4f07df5b6a.js} +1 -1
- package/assets/esri/core/workers/chunks/a3c5b754a6fa0f4250bf.js +1 -0
- package/assets/esri/core/workers/chunks/a59a1fdcd37a875f179b.js +1 -0
- package/assets/esri/core/workers/chunks/{ac7ecd90330090c90005.js → aeeee92b86554962711e.js} +1 -1
- package/assets/esri/core/workers/chunks/b0e4af49fc968b0a910f.js +1 -0
- package/assets/esri/core/workers/chunks/b466af9019f10420115e.js +1 -0
- package/assets/esri/core/workers/chunks/bb9232d9f63ec0c32447.js +1 -0
- package/assets/esri/core/workers/chunks/bf9eca7dd107bdb06614.js +1 -0
- package/assets/esri/core/workers/chunks/cbe8adc100582e746a8c.js +1 -0
- package/assets/esri/core/workers/chunks/{a1509e2e7809b6754b4f.js → d523af1db620b5381c99.js} +1 -1
- package/assets/esri/core/workers/chunks/d5a0e3a73df827dc7b06.js +1 -0
- package/assets/esri/core/workers/chunks/d670e134348954ce465d.js +1 -0
- package/assets/esri/core/workers/chunks/e3ea4b7217df16592def.js +1 -0
- package/assets/esri/core/workers/chunks/{c538435216d253f7702e.js → f23351a04643c464be84.js} +1 -1
- package/assets/esri/core/workers/chunks/f3d331da3c61af5c5a2f.js +1 -0
- package/assets/esri/core/workers/chunks/{68b77b36daae2b4b4237.js → f3fe865506fd7428eb6d.js} +1 -1
- package/assets/esri/core/workers/chunks/{a4d918b47cd4ee0e1666.js → f8cfd0045d06aa24beec.js} +1 -1
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/networks/CircuitManager.d.ts +247 -1
- package/networks/UnitIdentifierManager.d.ts +40 -3
- package/networks/UtilityNetwork.d.ts +0 -11
- package/networks/support/Circuit.d.ts +0 -1
- package/networks/support/CircuitLocation.d.ts +0 -1
- package/networks/support/CircuitPath.d.ts +0 -1
- package/networks/support/CircuitPathConnectivityElement.d.ts +0 -1
- package/networks/support/CircuitSection.d.ts +0 -1
- package/networks/support/NamedTraceConfiguration.d.ts +1 -7
- package/networks/support/Subcircuit.d.ts +0 -1
- package/networks/support/UNTraceConfiguration.d.ts +0 -4
- package/networks/support/jsonTypes.d.ts +1 -1
- package/networks/support/typeUtils.d.ts +10 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +1 -1
- package/rest/networks/circuits/support/CircuitTraceResult.d.ts +0 -1
- package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +0 -1
- package/rest/networks/support/TelecomNetworkElement.d.ts +0 -1
- package/rest/networks/support/TraceLocation.d.ts +1 -11
- package/rest/networks/support/TraceParameters.d.ts +1 -7
- package/rest/networks/support/TraceResult.d.ts +0 -2
- package/rest/networks/support/TraverseAssociationsParameters.d.ts +69 -0
- package/rest/networks/support/TraverseAssociationsParameters.js +2 -0
- package/rest/networks/support/TraverseAssociationsResult.d.ts +39 -0
- package/rest/networks/support/TraverseAssociationsResult.js +2 -0
- package/rest/networks/traverseAssociations.d.ts +21 -0
- package/rest/networks/traverseAssociations.js +2 -0
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +0 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.d.ts +3 -2
- package/assets/esri/core/workers/chunks/01ba5319cac3e0f14205.js +0 -1
- package/assets/esri/core/workers/chunks/05e1f1628a3726eca03d.js +0 -1
- package/assets/esri/core/workers/chunks/1d38b2fcd85ac9ebd7c6.js +0 -1
- package/assets/esri/core/workers/chunks/1effde6a39ef0d4af525.js +0 -1
- package/assets/esri/core/workers/chunks/1ff57bf19f021f5fd246.js +0 -1
- package/assets/esri/core/workers/chunks/3dc6e9494af16f7b8009.js +0 -1
- package/assets/esri/core/workers/chunks/3ecb906322a6a5c8c93b.js +0 -1
- package/assets/esri/core/workers/chunks/3f67162456a1f02190fa.js +0 -1
- package/assets/esri/core/workers/chunks/4e4419282c4bf7ee4678.js +0 -1
- package/assets/esri/core/workers/chunks/609edb4da427ec37bcf7.js +0 -1
- package/assets/esri/core/workers/chunks/6f5a82388a5eb5fcf1b7.js +0 -1
- package/assets/esri/core/workers/chunks/7c61b18e43c789aaecc6.js +0 -1
- package/assets/esri/core/workers/chunks/8dcb3e77f76d8396706b.js +0 -1
- package/assets/esri/core/workers/chunks/a3195521a83565c7c2d3.js +0 -1
- package/assets/esri/core/workers/chunks/b0212df1fe8d9448f3d6.js +0 -1
- package/assets/esri/core/workers/chunks/b590402170ae289290d7.js +0 -1
- package/assets/esri/core/workers/chunks/bfa6f4c08e7571bb1f37.js +0 -1
- package/assets/esri/core/workers/chunks/c5e172d3baf5414868f0.js +0 -1
- package/assets/esri/core/workers/chunks/cf41a66fb97c1076fb34.js +0 -1
- package/assets/esri/core/workers/chunks/f23e995320674b32e142.js +0 -1
- package/assets/esri/core/workers/chunks/f3fd40df92e59f7c687c.js +0 -1
- package/assets/esri/core/workers/chunks/fa1336b60278017d2525.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3202,4659],{96685(e,t,r){r.r(t),r.d(t,{constructAssociationMetaDataFeatureSetFromUrl:()=>B,constructFeatureSet:()=>E,constructFeatureSetFromPortalItem:()=>K,constructFeatureSetFromRelationship:()=>Q,constructFeatureSetFromUrl:()=>D,convertToFeatureSet:()=>z,createFeatureSetCollectionFromMap:()=>V,createFeatureSetCollectionFromService:()=>Y,initialiseMetaDataCache:()=>N});var i=r(11254);class a{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection"}castToText(e=!1){return"object, FeatureSetCollection"}}var s=r(78878),n=r(35704),l=r(70333),o=r(48938),u=r(61454),c=r(66395),d=r(87449),h=r(11221),p=r(33325),y=r(80609),f=r(50145),m=r(4576),g=r(80200),_=r(39516),w=r(89696),F=r(53781),b=r(17126),I=r(54546),S=r(97552),v=r(7562);function T(e,t){null==e.clause&&(e.clause=function(e){if(0===e.length)throw new d.dr("NeverReach");const t=[];for(let r=0;r<e.length;r++){const i=e[r],a=[`"${i.name.replaceAll('"','""')}" ${i.asc?">":"<"} @last_${r}`];for(let t=0;t<r;t++){const r=e[t];a.push(`"${r.name.replaceAll('"','""')}" = @last_${t}`)}t.push(a.join(" AND "))}const r=t.join(" OR ");return w.A.create(r)}(e.keyFields));for(let r=0;r<e.keyFields.length;r++){const i=e.keyFields[r].name;e.clause.parameters[`last_${r}`]=t.attributes[i]}}class A extends h.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this._requestStandardised=!1,this._useDefinitionExpression=!0,this._recentlyUsedQueries=null,this._featureSetQueryInterceptor=null,this._featureSetInfo=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry),e.lrucache&&(this._recentlyUsedQueries=e.lrucache),e.interceptor&&(this._featureSetQueryInterceptor=e.interceptor)}_maxQueryRate(){return p.gO}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+(0,p.JB)(e.toJSON());return(0,g.d)(t,g.T.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=1,null!=e&&e>=10.61&&(this._databaseType=0)):null!=e&&(e>=10.5&&(this._databaseType=1,this._requestStandardised=!0),e>=10.61&&(this._databaseType=0))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new S.A;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}async _queryAll(){return(await this.query({abortSignal:o._})).features}async query(e){return await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter?h.An:this._canUsePagination()?this._queryUsingPaging(e):this._queryUsingIdSetTraversal(e)}async _queryUsingPaging(e){const t=this._layer.capabilities.query;let r=!0,i=null,a=!1;null!=e.orderBy&&(t.supportsOrderBy?(i=e.orderBy.toOrderByFields(),a=!0):r=!1);const s=await this.databaseType(),n=null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,s),l=!0!==this._removeGeometry,o=this._overrideFields??this._fieldsIncludingObjectId(["*"]),u=o.includes("*")?this._layer.fields.length:o.length,c=(this.isTable()||!l?t.standardMaxRecordCountNoGeometry:void 0)??t.standardMaxRecordCount??t.maxRecordCount??this._maxQueryRate(),d=u<=50?1:u<=100?.5:u<=200?.25:.125,p=Math.max(Math.ceil(c*d),t.maxRecordCount??this._maxQueryRate()),f=this._createQuery();if(f.where=(0,_.mA)(f.where,n),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);f.spatialRelationship=t.spatialRelationship,f.relationParameter=t.relationParameter,f.geometry=e.spatialFilter.geometry}return f.orderByFields=i,f.outFields=o,f.returnGeometry=l,f.outSpatialReference=this.spatialReference,f.resultType="standard",{ordered:a,filterApplied:!0,spatialFilterApplied:!0,features:this._queryPaginated(f,p,r?e.limit:null,e.abortSignal)}}async*_queryPaginated(e,t,r,i){let a;e.num=null!=r?Math.min(r,t):t,e.start=0;do{(0,d.dZ)(i),a=await this.executeQuery(e,"execute"),yield*(0,m.Ho)(a.features,this._maxQueryRate()),e.start+=a.features.length,e.num=null!=r?Math.min(r-e.start,t):t}while(e.num>0&&!0===a.exceededTransferLimit)}async _queryUsingIdSetTraversal(e){let t=!0,r=null,i=!1;null!=e.orderBy&&(this._layer.capabilities?.query?.supportsOrderBy?(r=e.orderBy.toOrderByFields(),i=!0):t=!1);const a=await this.databaseType(),s=null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,a),n=this._createQuery();if(n.where=(0,_.mA)(n.where,s),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);n.spatialRelationship=t.spatialRelationship,n.relationParameter=t.relationParameter,n.geometry=e.spatialFilter.geometry}n.orderByFields=r,n.outSpatialReference=this.spatialReference,n.num=t?e.limit:null;const l=await this.executeQuery(n,"executeForIds");if((0,d.dZ)(e.abortSignal),null==l||l.length<=0)return h.An;let o=this._maxQueryRate();const u=this._layer.capabilities?.query.maxRecordCount;null!=u&&u<o&&(o=u);const c=this._createQuery();return n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0!==this._removeGeometry,n.outSpatialReference=this.spatialReference,{ordered:i,filterApplied:!0,spatialFilterApplied:!0,features:this._traverseIdSet(c,l,o,e.abortSignal)}}async*_traverseIdSet(e,t,r,i){for(let a=0;a<t.length;a+=r){e.objectIds=t.slice(a,a+r),(0,d.dZ)(i);const s=await this.executeQuery(e,"execute");yield s.features}}async queryStat(e){await this._ensureLoaded();const t=this._layer.capabilities?.query,r=!!t?.supportsSqlExpression,i=!!t?.supportsStatistics,a=!!t?.supportsDistinct,s=(0,f.Dp)(e.stat);if("count"===s)return a?this._queryCount(e):{calculated:!1};const n=e.field;if(null==n)return{calculated:!1};if(!1===i||!1===(0,y.DA)(n)&&!1===r||!1===n.isStandardized)return null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(e.stat,n,e.limit??p.gO,e.abortSignal);if("distinct"===s)return!1===a?null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(s,n,e.limit??p.gO,e.abortSignal):{calculated:!1};const l=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:null};const o=this._createQuery();if(o.where=(0,_.mA)(o.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,l)),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);o.spatialRelationship=t.spatialRelationship,o.relationParameter=t.relationParameter,o.geometry=e.spatialFilter.geometry}const u=new v.A;u.statisticType=s,u.onStatisticField=(0,y.YY)(n,l),u.outStatisticFieldName="ARCADE_STAT_RESULT",o.returnGeometry=!1;let c="ARCADE_STAT_RESULT";o.outStatistics=[u];const m=await this.executeQuery(o,"execute");if(!m.hasOwnProperty("features")||0===m.features.length)throw new d.dr("InvalidStatResponse");let g=!1;const w=m.fields??[];for(const e of w)if("ARCADE_STAT_RESULT"===e.name.toUpperCase()){c=e.name,"esriFieldTypeDate"===e.type&&(g=!0);break}const F=m.features[0].attributes[c];return{calculated:!0,result:g&&null!=F?new Date(F):F}}async _queryCount(e){const t=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:0};const r=this._createQuery();if(r.where=(0,_.mA)(r.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,t)),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);r.spatialRelationship=t.spatialRelationship,r.relationParameter=t.relationParameter,r.geometry=e.spatialFilter.geometry}return r.returnGeometry=!1,{calculated:!0,result:await this.executeQuery(r,"executeForCount")}}async canQueryAggregate(e){await this._ensureLoaded();let t=!1;const r=this._layer.capabilities?.query,i=!0===r?.supportsSqlExpression;if(null!=r&&!0===r.supportsStatistics&&!0===r.supportsOrderBy&&(t=!0),t)for(const r of e.statistics)(!1===r.workingexpr?.isStandardized||!1===(0,y.DA)(r.workingexpr)&&!1===i)&&(t=!1);return t}async queryAggregate(e){if(await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter)return h.An;const t=await this.databaseType(),r=e.groupBy,i=e.orderBy;let a=null;if(!this._layer.capabilities.query.supportsPaginationOnAggregatedQueries){const e=this.getFieldsIndex();a={keyFields:r.map((t,r)=>({name:e.normalizeFieldName(t)??t,asc:null==i||1===i._directions[r]}))}}let s=null,n=!1;null!=i&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(null==a||(0,m.MJ)(r,0,r.length,i._fields,0,Math.min(i._fields.length,r.length),(e,t)=>e.toLowerCase()===t.toLowerCase()))&&(s=i.toOrderByFields(),n=!0),null==s&&(s=r.slice());const l=e.statistics.map(e=>new v.A({onStatisticField:null!==e.workingexpr?(0,y.YY)(e.workingexpr,t):"",outStatisticFieldName:e.field,statisticType:e.toStatisticsName()}));let o=this._maxQueryRate();const u=this._layer.capabilities?.query.maxRecordCount;null!=u&&u<o&&(o=u);const c=null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,t),d=this._createQuery();if(d.where=(0,_.mA)(d.where,c),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);d.spatialRelationship=t.spatialRelationship,d.relationParameter=t.relationParameter,d.geometry=e.spatialFilter.geometry}return d.orderByFields=s,d.outFields=["*"],d.outStatistics=l,d.groupByFieldsForStatistics=r,d.returnGeometry=!1,null==a?{filterApplied:!0,spatialFilterApplied:!0,ordered:n,features:this._queryPaginated(d,o,null,e.abortSignal)}:{filterApplied:!0,spatialFilterApplied:!0,ordered:n,features:this._queryKeysetPaginated(d,a,e.abortSignal)}}async*_queryKeysetPaginated(e,t,r){const i=e.where;for(;;){if(null!=t.clause){if(!this._layer.capabilities.query.supportsOrderBy)throw new d.dr("NotImplemented");e.where=(0,_.mA)(i,(0,y.YY)(t.clause,await this.databaseType()))}const a=await this.executeQuery(e,"execute");if((0,d.dZ)(r),!a.hasOwnProperty("features"))throw new d.dr("InvalidStatResponse");if(yield a.features,0===a.features.length||!0!==a.exceededTransferLimit)break;T(t,a.features.at(-1))}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?"subtype-group"===this._layer.type&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const r="execute"===t?async e=>{const t=await this._layer.source.queryFeaturesJSON(e);return(0,h.Rn)(t.features,t.spatialReference??this.spatialReference.toJSON()),t}:"executeForCount"===t?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let i=null;if(this._recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);i=this._recentlyUsedQueries.getFromCache(t),null===i&&(i=r(e),this._recentlyUsedQueries.addToCache(t,i),i=i.catch(e=>{throw this._recentlyUsedQueries?.removeFromCache(t),e}))}return this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===i&&(i=r(e)),i}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType||"esriGeometryNull"===this._layer.geometryType}static create(e,t,r,i,a){const s=new F.default({url:e,outFields:null===t?["*"]:t});return new A({layer:s,spatialReference:r,lrucache:i,interceptor:a})}relationshipMetadata(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON?.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return(0,p.Qi)(this._layer.parsedUrl.path)}async queryAttachments(e,t,r,i,a){const s=this._layer;if(!function(e){const t=e.capabilities;return t?.data.supportsAttachment&&t?.operations.supportsQueryAttachments}(s))return[];const n=new I.A({objectIds:[e],returnMetadata:a});(t&&t>0||r&&r>0)&&(n.size=[t&&t>0?t:0,r&&r>0?r:t+1]),i&&i.length>0&&(n.attachmentTypes=i),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:s,query:n,method:"attachments"});const l=await s.queryAttachments(n);return l?.[e]?l[e].map(t=>{const r=`${this._layer.parsedUrl.path}/${e}/attachments/${t.id}`;let i=null;return a&&t.exifInfo&&(i=c.A.convertJsonToArcade(t.exifInfo,"system",!0)),new u.A(t.id,t.name,t.contentType,t.size,r,i,t.keywords??null)}):[]}async queryRelatedFeatures(e){const t=(0,b.dw)(e);t.f="json",this._requestStandardised&&(t.sqlFormat="standard"),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const r=await(0,i.A)(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(r.data){const e={},t=r.data;if(t?.relatedRecordGroups){const r=t.spatialReference,i=!0===t.exceededTransferLimit;for(const a of t.relatedRecordGroups)(0,h.Rn)(a.relatedRecords,r),e[a.objectId]={features:a.relatedRecords,exceededTransferLimit:i}}return e}throw new d.dr("InvalidRequest")}async getFeatureByObjectId(e,t){const r=this._createQuery();r.outFields=t,r.returnGeometry=!1,r.outSpatialReference=this.spatialReference,r.where=(0,_.mA)(r.where,this.objectIdField+"="+e.toString()),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:r,method:"execute"});const i=await this._layer.source.queryFeaturesJSON(r);return 1===i.features.length?((0,h.Rn)(i.features,i.spatialReference??this.spatialReference.toJSON()),i.features[0]):null}async getIdentityUser(){await this.load();const e=l.id?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=l.id?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl??"";let t=this._layer.url;const r=t.toLowerCase().indexOf("/rest/services");if(t=r>-1?t.slice(0,r):t,t){t+="/rest/info";try{const e=await(0,i.A)(t,{query:{f:"json"}});let r="";return e.data?.owningSystemUrl&&(r=e.data.owningSystemUrl),r}catch{return""}}return""}getDataSourceFeatureSet(){const e=new A({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this._recentlyUsedQueries??void 0,interceptor:this._featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this._featureSetInfo)return this._featureSetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const r=this._layer.parsedUrl?.path??null;if(r){const a=await(0,i.A)(r,{responseType:"json",query:{f:"json"}});e=a?.data?.name??null,t=a?.data?.serviceItemId??null}const a=this._layer.title&&null!==(this._layer.parent??null);return this._featureSetInfo={layerId:this._layer.layerId,layerName:""===e?null:e,itemId:""===t?null:t,serviceLayerUrl:""===r?null:r,webMapLayerId:a?this._layer.id??null:null,webMapLayerTitle:a?this._layer.title??null:null,className:null,objectClassId:null},this._featureSetInfo}}var R=r(30235);const C=new FinalizationRegistry(e=>{e.abort()});class M extends h.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerParquet",this._outFields=null,this._returnGeometry=!0,this._ignoreDefinitionExpression=!1,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),null!=e.outFields&&(this._outFields=e.outFields),null!=e.includeGeometry&&(this._returnGeometry=e.includeGeometry)}_maxQueryRate(){return p.gO}async loadImpl(){return this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,this.objectIdField=this._layer.objectIdField,null!==this._outFields)if(1===this._outFields.length&&"*"===this._outFields[0])this._outFields=null;else{const e=new Set(this._outFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._outFields=this.fields.map(({name:e})=>e)}this._databaseType=0}getDataSourceFeatureSet(){const e=new M({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._outFields??void 0,includeGeometry:this._returnGeometry});return e._ignoreDefinitionExpression=!0,e}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this._ignoreDefinitionExpression&&(e.where=null),e}isTable(){return this._layer.isTable}async _queryAll(){return(await this.query({abortSignal:o._})).features}async query(e){if(await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter)return h.An;const t={type:"arcade",returnGeometry:this._returnGeometry,outSpatialReference:(this.spatialReference??this._layer.spatialReference).toJSON(),outFields:Array.from(new Set(this._outFields??this._layer.fields.map(e=>e.name))),where:(0,_.mA)(this._ignoreDefinitionExpression?null:this._layer.definitionExpression,e.where?(0,y.YY)(e.where,0):null),extent:null};if(null!=e.spatialFilter)switch(e.spatialFilter.relation){case"esriSpatialRelIntersects":case"esriSpatialRelContains":case"esriSpatialRelOverlaps":case"esriSpatialRelWithin":case"esriSpatialRelTouches":case"esriSpatialRelCrosses":{const r=e.spatialFilter.geometry.extent;null!=r&&(t.extent=r.toJSON());break}}return{filterApplied:!0,spatialFilterApplied:!1,ordered:!1,features:await this._queryParquetStream(t,e.abortSignal)}}async _queryParquetStream(e,t){const r=new AbortController,i=await this._layer.source._queryStream(e,{signal:r.signal}),a=this._iterateParquetStream(i,r,t);return C.register(a,r,r),a}async*_iterateParquetStream(e,t,r){try{for(;;){const i=await this._layer.source._getStreamNextFeatures(e,{signal:t.signal});if(r.aborted&&(t.abort(),(0,d.dZ)(r)),null==i)break;(0,h.Rn)(i.features,i.spatialReference??this.spatialReference.toJSON()),yield i.features}}finally{C.unregister(t)}}async isEmpty(){return this._totalCount>=0?0===this._totalCount:(this._totalCount=await this._layer.queryFeatureCount(this._createQuery()),this._totalCount<=0)}async queryStat(e){await this._ensureLoaded();const t=(0,f.Dp)(e.stat);if("count"===t)return this._queryCount(e);const r=e.field;if(null==r)throw new d.dr("NeverReach");if(!0!==this._layer.capabilities?.query.supportsStatistics)return null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(e.stat,r,e.limit??p.gO,e.abortSignal);if("distinct"===t)return{calculated:!1};if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:null};const i=this._createQuery();if(i.returnGeometry=!1,i.where=(0,_.mA)(i.where,e.where?(0,y.YY)(e.where,0):null),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);i.spatialRelationship=t.spatialRelationship,i.relationParameter=t.relationParameter,i.geometry=e.spatialFilter.geometry}const a=new v.A;a.statisticType=t,a.onStatisticField=(0,y.YY)(r,0);const s="ARCADE_STAT_RESULT";a.outStatisticFieldName=s,i.outStatistics=[a];const n=await this._layer.source.queryFeaturesJSON(i);if(n.features.length<=0)throw new d.dr("InvalidStatResponse");const l=n.features[0].attributes[s];return{calculated:!0,result:"esriFieldTypeDate"===n.fields?.find(e=>e.name===s)?.type&&null!=l?new Date(l):l}}async _queryCount(e){if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:0};const t=this._createQuery();if(t.where=(0,_.mA)(t.where,e.where?(0,y.YY)(e.where,0):null),null!=e.spatialFilter){const r=(0,h.rj)(e.spatialFilter.relation);t.spatialRelationship=r.spatialRelationship,t.relationParameter=r.relationParameter,t.geometry=e.spatialFilter.geometry}return t.returnGeometry=!1,{calculated:!0,result:await this._layer.queryFeatureCount(t)}}async canQueryAggregate(e){await this._ensureLoaded();const t=this._layer.capabilities?.query;return!0===t?.supportsStatistics&&null==e.spatialFilter}async queryAggregate(e){await this._ensureLoaded();const t=this._createQuery();return t.where=(0,_.mA)(t.where,e.where?(0,y.YY)(e.where,0):null),t.orderByFields=e.orderBy?.toOrderByFields(),t.outFields=["*"],t.outStatistics=e.statistics.map(e=>new v.A({onStatisticField:null!==e.workingexpr?(0,y.YY)(e.workingexpr,0):"",outStatisticFieldName:e.field,statisticType:e.toStatisticsName()})),t.groupByFieldsForStatistics=e.groupBy,t.returnGeometry=!1,{filterApplied:!0,spatialFilterApplied:!0,ordered:null!=e.orderBy,features:async function*(){const r=await this._layer.source.queryFeaturesJSON(t);(0,d.dZ)(e.abortSignal);for(const e of(0,m.Ho)(r.features,this._maxQueryRate()))(0,h.Rn)(e,r.spatialReference??this.spatialReference.toJSON()),yield e}.apply(this)}}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}async queryAttachments(){return[]}serviceUrl(){return""}relationshipMetadata(){return[]}get gdbVersion(){return""}getFeatureByObjectId(){throw new d.dr("NeverReach")}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return null}get dateFieldsTimeZone(){return null}get datesInUnknownTimezone(){return!1}get editFieldsInfo(){return null}get timeInfo(){return null}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}var L=r(26591);class x extends h.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._removeGeometry=!1,this._overrideFields=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),this._findObjectId=e.objectId,this.relationship=e.relationship,this._relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return p.gO}async loadImpl(){return await Promise.all([this._layer.load(),this._relatedLayer.load()]),this._initialiseFeatureSet(),this}nativeCapabilities(){return this._relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._relatedLayer.geometryType,this.fields=this._relatedLayer.fields.slice(),this.hasZ=this._relatedLayer.hasZ,this.hasM=this._relatedLayer.hasM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType),this.objectIdField=this._relatedLayer.objectIdField,this.globalIdField=this._relatedLayer.globalIdField,this.hasM=this._relatedLayer.supportsM,this.hasZ=this._relatedLayer.supportsZ,this.typeIdField=this._relatedLayer.typeIdField,this.types=this._relatedLayer.types,this.subtypeField=this._relatedLayer.subtypeField,this.subtypes=this._relatedLayer.subtypes}async databaseType(){return this._databaseType=await this._relatedLayer.databaseType(),this._databaseType}isTable(){return this._relatedLayer.isTable()}async _queryAll(){return(await this.query({abortSignal:o._})).features}async query(e){if(await this._ensureLoaded(),await this.databaseType(),this.isTable()&&null!=e.spatialFilter)return h.An;const t=this._layer.nativeCapabilities();if(!1===t.canQueryRelated)return h.An;if(t.capabilities?.queryRelated.supportsPagination)return this._queryUsingPaging(t.source,e);let r=null,i=!1;null!=e.orderBy&&t.capabilities?.queryRelated.supportsOrderBy&&(r=e.orderBy.toOrderByFields(),i=!0);const a=new L.default;return a.objectIds=[this._findObjectId],a.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]),a.relationshipId=this.relationship.id,a.where="1=1",a.returnGeometry=!0!==this._removeGeometry,a.outSpatialReference=this.spatialReference,a.orderByFields=r,{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:i,features:async function*(){const r=await t.source.queryRelatedFeatures(a);(0,d.dZ)(e.abortSignal),yield r[this._findObjectId]?r[this._findObjectId].features:[]}.apply(this)}}async _queryUsingPaging(e,t){let r=null==t.where&&null==t.spatialFilter,i=null,a=!1;const s=this._layer.nativeCapabilities();null!=t.orderBy&&(s.capabilities?.queryRelated.supportsOrderBy?(i=t.orderBy.toOrderByFields(),a=!0):r=!1),await this.databaseType();let n=this._maxQueryRate();const l=s.capabilities?.query.maxRecordCount;null!=l&&l<n&&(n=l);const o=new L.default;return o.relationshipId=this.relationship.id,o.objectIds=[this._findObjectId],o.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]),o.where="1=1",o.orderByFields=i,o.returnGeometry=!0!==this._removeGeometry,o.outSpatialReference=this.spatialReference,{filterApplied:null==t.where,spatialFilterApplied:null==t.spatialFilter,ordered:a,features:this._queryPaginated(e,o,n,r?t.limit:null,t.abortSignal)}}async*_queryPaginated(e,t,r,i,a){let s;t.num=null!=i?Math.min(i,r):r,t.start=0;do{(0,d.dZ)(a),s=(await e.queryRelatedFeatures(t))[this._findObjectId]??{exceededTransferLimit:!1,features:[]},yield s.features,t.start+=s.features.length,t.num=null!=i?Math.min(i-t.start,r):r}while(!0===s.exceededTransferLimit)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new d.dr("NeverReach")}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}get gdbVersion(){return this._relatedLayer.gdbVersion}relationshipMetadata(){return this._relatedLayer.relationshipMetadata()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,r,i,a){return this._relatedLayer.queryAttachments(e,t,r,i,a)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer.editFieldsInfo??null}get timeInfo(){return this._relatedLayer.timeInfo??null}getFeatureSetInfo(){return this._relatedLayer.getFeatureSetInfo()}}var j=r(23732),O=r(92474),k=r(4146),q=r(99680),Z=r(89160),U=r(80812);function N(){null===j.A.applicationCache&&(j.A.applicationCache=new j.A)}async function P(e,t,r){if(j.A.applicationCache){const r=j.A.applicationCache.getLayerInfo(e);if(r){const i=await r;return new F.default({url:e,outFields:t,sourceJSON:i})}const i=new F.default({url:e,outFields:t}),a=(async()=>(await i.load(),i.sourceJSON))();if(j.A.applicationCache){j.A.applicationCache.setLayerInfo(e,a);try{return await a,i}catch(t){throw j.A.applicationCache.clearLayerInfo(e),t}}return await a,i}if(null!=r){const i=r.getCachedLayerMetadata(e);if(i){const r=await i;return new F.default({url:e,outFields:t,sourceJSON:r})}const a=new F.default({url:e,outFields:t}),s=(async()=>(await a.load(),a.sourceJSON))();r.setCachedLayerMetadata(e,s);try{return await s,a}catch(t){throw r.removeCachedLayerMetadata(e,s),t}}return new F.default({url:e,outFields:t})}async function D(e,t,r,i,a,s=null){return E(await P(e,["*"],a),t,r,i,a,s)}function E(e,t=null,r=null,i=!0,a=null,s=null){switch(e.type){case"catalog-footprint":return E(e.parent,t,r,i,a,s);case"subtype-sublayer":{const l=E(e.parent,t,r,i,a,s);return new n.A({parentfeatureset:l,whereclause:w.A.create(e.parent.subtypeField+"="+e.subtypeCode.toString(),{fieldsIndex:e.parent.fieldsIndex,timeZone:l.dateFieldsTimeZoneDefaultUTC})})}case"csv":case"geojson":case"knowledge-graph-sublayer":case"wfs":return new R.A({layer:e,spatialReference:t,outFields:r,includeGeometry:i,lrucache:a,interceptor:s});case"parquet":return new M({layer:e,spatialReference:t,outFields:r,includeGeometry:i});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const n={layer:e,spatialReference:t,outFields:r,includeGeometry:i,lrucache:a,interceptor:s};return!e.url&&e.source?new R.A(n):new A(n)}default:throw new Error(`Unsupported layer type: ${e.type}`)}}async function G(e,t){if(null!==j.A.applicationCache){const t=j.A.applicationCache.getLayerInfo(e);if(null!==t)return t}if(null!=t){const r=t.getCachedServiceMetadata(e);if(null!=r)return r}const r=(async()=>{const t=await(0,i.A)(e,{responseType:"json",query:{f:"json"},authMode:"no-prompt"});if(t.data){const e=t.data;return e.layers||(e.layers=[]),e.tables||(e.tables=[]),e}return{layers:[],tables:[]}})();if(null!==j.A.applicationCache){j.A.applicationCache.setLayerInfo(e,r);try{return await r}catch(t){throw j.A.applicationCache.clearLayerInfo(e),t}}if(null!=t){t.setCachedServiceMetadata(e,r);try{return await r}catch(i){throw t.removeCachedServiceMetadata(e,r),i}}return r}async function B(e,t,r){const a={metadata:null,networkId:-1,unVersion:3,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map,queryelem:null,layerNameLkp:{},lkp:null},s=await G(e,null);if(a.metadata=s,void 0!==s.controllerDatasetLayers?.utilityNetworkLayerId&&null!==s.controllerDatasetLayers.utilityNetworkLayerId){if(s.layers)for(const e of s.layers)a.layerNameLkp[e.id]=e.name;if(s.tables)for(const e of s.tables)a.layerNameLkp[e.id]=e.name;const l=s.controllerDatasetLayers.utilityNetworkLayerId;a.networkId=l;const o=await async function(e,t){const r="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==j.A.applicationCache){const e=j.A.applicationCache.getLayerInfo(r);if(null!==e)return e}const a=(async()=>{const r=await(0,i.A)(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}});if(r.data){const e=r.data;if(e.layerDataElements?.[0])return e.layerDataElements[0]}throw new d.dr("DataElementsNotFound")})();if(null!==j.A.applicationCache){j.A.applicationCache.setLayerInfo(r,a);try{return await a}catch(e){throw j.A.applicationCache.clearLayerInfo(r),e}}return a}(e,l);if(o){a.queryelem=o,a.queryelem?.dataElement&&void 0!==a.queryelem.dataElement.schemaGeneration&&(a.unVersion=a.queryelem.dataElement.schemaGeneration),a.lkp={},a.queryelem.dataElement.domainNetworks||(a.queryelem.dataElement.domainNetworks=[]);for(const e of a.queryelem.dataElement.domainNetworks){for(const t of e.edgeSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:a.layerNameLkp[t.layerId]??null};a.layerIdLookup.set(e.layerId,e),a.sourceIdLookup.set(e.sourceId,e),e.className&&(a.lkp[e.className]=e)}for(const t of e.junctionSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:a.layerNameLkp[t.layerId]??null};a.layerIdLookup.set(e.layerId,e),a.sourceIdLookup.set(e.sourceId,e),e.className&&(a.lkp[e.className]=e)}}if(a.queryelem.dataElement.terminalConfigurations)for(const e of a.queryelem.dataElement.terminalConfigurations)for(const t of e.terminals)a.terminals.push({terminalId:t.terminalId,terminalName:t.terminalName});const s=await async function(e){if(null!==j.A.applicationCache){const t=j.A.applicationCache.getLayerInfo(e);if(null!==t)return t}const t=(async()=>{const t=await(0,i.A)(e,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(null!==j.A.applicationCache){j.A.applicationCache.setLayerInfo(e,t);try{return await t}catch(t){throw j.A.applicationCache.clearLayerInfo(e),t}}return t}(e+"/"+l);if(void 0!==s.systemLayers?.associationsTableId&&null!==s.systemLayers.associationsTableId){let i=null;if(r&&a.unVersion<8){const r=[];a.unVersion>=4&&(r.push("STATUS"),r.push("PERCENTALONG")),i=await D(e+"/"+s.systemLayers.associationsTableId,t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...r],!1,null,null),await i.load(),a.unVersion>=4&&(i=new n.A({parentfeatureset:i,whereclause:w.A.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC})}),await i.load())}return{lkp:a.lkp,associations:i,unVersion:a.unVersion,terminals:a.terminals,layerIdLookup:a.layerIdLookup,sourceIdLookup:a.sourceIdLookup}}return{associations:null,unVersion:a.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:a.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:a.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}async function Q(e,t,r,i=null,a=null,s=!0,n=null,l=null){let o=e.serviceUrl();if(!o)return null;o=o.endsWith("/")?o+t.relatedTableId.toString():o+"/"+t.relatedTableId.toString();const u=await D(o,i,a,s,n,l);return new x({layer:e,relatedLayer:u,relationship:t,objectId:r,spatialReference:i,outFields:a,includeGeometry:s,lrucache:n,interceptor:l})}class J extends a{constructor(e,t=null,r=null,i=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=r,this._interceptor=i,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,r=null){const i=E(e,this._overrideSpatialReference,null===r?["*"]:r,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),i}async listAll(){(0,O.Zm)(this._map)&&!this._map.loaded&&await this._map.load();const e=this._map.allLayers.toArray().filter(e=>(0,p.eB)(e)).map(e=>({id:e.id,name:e.title})),t=this._map.allTables.toArray().filter(e=>(0,p.eB)(e)).map(e=>({id:e.id,name:e.title}));return e.concat(t)}async featureSetByName(e,t=!0,r=null){if((0,O.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,r);null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const a=this._instantLayers[r];if(a.opitem.title===e&&a.includeGeometry===t&&a.outFields===i)return this._instantLayers[r].featureset}const a=this._map.allLayers.find(t=>(0,p.eB)(t)&&t.title===e);if(null!=a)return this._makeAndAddFeatureSet(a,t,r);if(this._map.allTables){const i=this._map.allTables.find(t=>(0,p.eB)(t)&&t.title===e);if(null!=i)return this._makeAndAddFeatureSet(i,t,r)}return null}async featureSetById(e,t=!0,r=["*"]){if((0,O.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,r);null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const a=this._instantLayers[r];if(a.opitem.id===e&&a.includeGeometry===t&&a.outFields===i)return this._instantLayers[r].featureset}const a=this._map.allLayers.find(t=>(0,p.eB)(t)&&t.id===e);if(a)return this._makeAndAddFeatureSet(a,t,r);if(this._map.allTables){const i=this._map.allTables.find(t=>(0,p.eB)(t)&&t.id===e);if(null!=i)return this._makeAndAddFeatureSet(i,t,r)}return null}}class $ extends a{constructor(e,t=null,r=null,i=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=r,this._interceptor=i,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,r=null){const i=E(e,this._overrideSpatialReference,null===r?["*"]:r,t,this._lrucache);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),i}async _loadMetaData(){const e=await G(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new $(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async listAll(){const e=await this._loadMetaData();return e.layers.concat(e.tables)}async featureSetByName(e,t=!0,r=null){null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const a=this._instantLayers[r];if(a.opitem.title===e&&a.includeGeometry===t&&a.outFields===i)return this._instantLayers[r].featureset}const a=await this._loadMetaData();let s=null;for(const t of a.layers??[])t.name===e&&(s=t);if(!s)for(const t of a.tables??[])t.name===e&&(s=t);if(s){const e=await P(this._url+"/"+s.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,r)}return null}async featureSetById(e,t=!0,r=["*"]){null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);e=null!=e?e.toString():"";for(let r=0;r<this._instantLayers.length;r++){const a=this._instantLayers[r];if(a.opitem.id===e&&a.includeGeometry===t&&a.outFields===i)return this._instantLayers[r].featureset}const a=await this._loadMetaData();let s=null;for(const t of a.layers??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(s=t);if(!s)for(const t of a.tables??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(s=t);if(s){const e=await P(this._url+"/"+s.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,r)}return null}}function V(e,t,r=null,i=null){return new J(e,t,r,i)}function Y(e,t,r=null,i=null){return new $(e,t,r,i)}function z(e,t,r,i,a){if(null===e)return null;if((0,s.m)(e)){switch(t){case"datasource":return e.getDataSourceFeatureSet();case"parent":return e;case"root":return e.getRootFeatureSet()}return null}if(e instanceof k.A&&(0,p.eB)(e)){switch(t){case"datasource":return E(e,a,"outFields"in e?e.outFields:null,!0,r,i).getDataSourceFeatureSet();case"parent":case"root":return E(e,a,"outFields"in e?e.outFields:null,!0,r,i)}return null}if((0,s.a4)(e)){switch(t){case"datasource":return E(e.parent,a,e.parent.outFields,!0,r,i).getDataSourceFeatureSet();case"parent":case"root":return E(e,a,e.parent.outFields,!0,r,i)}return null}return null}async function K(e,t,r,i,a,s,n,l=null){if(j.A.applicationCache){const o=j.A.applicationCache.getLayerInfo(e+":"+s.url);if(o)return W(await o,t,r,i,a,n,l)}if(null!=n){const o=n.getCachedPortalItem(s.url,e);if(null!=o)return await W(await o,t,r,i,a,n,l)}const o=new U.default({id:e,portal:s}).load();j.A.applicationCache?j.A.applicationCache.setLayerInfo(e+":"+s.url,o):null!=n&&n.setCachedPortalItem(s.url,e,o);try{return await W(await o,t,r,i,a,n,l)}catch(t){throw j.A.applicationCache&&j.A.applicationCache.clearLayerInfo(e+":"+s.url),null!=n&&n.removeCachedPortalItem(s.url,e,o),t}}const H=new Set(["Apache Parquet","Parquet layer","Parquet Layer","Parquet feature layer","Parquet Feature Layer"]);async function W(e,t,r,i,a,s,n){let l;if("Feature Service"===e.type||"Map Service"===e.type)l=await P((0,p.Qi)(e.url??"")+"/"+t,["*"],s);else{if(t)throw new Error(`layerId=${t} provided for ${e.type} item`);if(null!=s){const t=s.getCachedPortalItemLayer(e.portal.url,e.id);if(null!=t)l=await t;else{const t=H.has(e.type)?Promise.resolve(new q.default({data:new Z.A({portalItem:e})})):k.A.fromPortalItem(e);s.setCachedPortalItemLayer(e.portal.url,e.id,t);try{l=await t}catch(r){throw s.removeCachedPortalItemLayer(e.portal.url,e.id,t),r}}}else l=H.has(e.type)?new q.default({data:new Z.A({portalItem:e})}):await k.A.fromPortalItem(e)}return E(l,r,i,a,s,n)}},35704(e,t,r){r.d(t,{A:()=>u});var i=r(48938),a=r(87449),s=r(11221),n=r(33325),l=r(80609),o=r(89696);class u extends s.t1{constructor(e){super(),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof o.A?(this._whereClause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereClause=null)}_initialiseFeatureSet(){this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes}async _queryAll(){return(await this.query({abortSignal:i._})).features}async query(e){let t=e.where,r=!0;null!==this._whereClauseFunction?r=!1:null!=t?null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,t)):t=this._whereClause,await this._ensureLoaded();const i=await this._parent.query({...e,where:t,limit:r?e.limit:null});return(0,a.dZ)(e.abortSignal),i.filterApplied&&null==this._whereClauseFunction?i:{...i,features:this._applyFilter(i.features,e.abortSignal)}}async*_applyFilter(e,t){for await(const r of e)if((0,a.dZ)(t),null!=this._whereClause){const e=r.filter(e=>this._whereClause.testFeature(e));e.length>0&&(yield e)}else if(null!=this._whereClauseFunction){const e=[];for(const t of r)await this._whereClauseFunction(t)&&e.push(t);e.length>0&&(yield e)}else yield r}async queryStat(e){if(null!==this._whereClauseFunction)return null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??n.gO,e.abortSignal):{calculated:!1};let t=this._whereClause;null!=e.where&&null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,e.where));const r=await this._parent.queryStat({...e,where:t});return r.calculated?r:null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??n.gO,e.abortSignal):{calculated:!1}}async canQueryAggregate(e){if(null!==this._whereClauseFunction)return!1;let t=e.where;return null!=t?null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,t)):t=this._whereClause,this._parent.canQueryAggregate({...e,where:t})}async queryAggregate(e){let t=e.where;return null!=t?null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,t)):t=this._whereClause,this._parent.queryAggregate({...e,where:t})}getFieldsIndex(){return this._parent.getFieldsIndex()}}},30235(e,t,r){r.d(t,{A:()=>y});var i=r(48938),a=r(87449),s=r(11221),n=r(33325),l=r(80609),o=r(4576),u=r(39516),c=r(91075),d=r(53781),h=r(33143),p=r(20437);class y extends s.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return n.gO}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||this._layer.objectIdField===r||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this._databaseType=0,this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType}async _queryAll(){return(await this.query({abortSignal:i._})).features}_queryLayerFeaturesJSON(e){return"queryFeaturesJSON"in this._layer?this._layer.queryFeaturesJSON(e):this._layer.source.queryFeaturesJSON(e)}async query(e){await this._ensureLoaded();let t=null,r=!1;if(null!=e.orderBy&&(t=e.orderBy.toOrderByFields(),r=!0),this.isTable()&&null!=e.spatialFilter)return s.An;const i=this._createQuery();return i.where=(0,u.mA)(i.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,l.YY)(e.where,0)),null!=e.spatialFilter&&(i.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),i.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),i.geometry=e.spatialFilter.geometry),i.outSpatialReference=this.spatialReference,i.orderByFields=t,i.num=e.limit,{filterApplied:!0,spatialFilterApplied:!0,ordered:r,features:async function*(){const t=await this._queryLayerFeaturesJSON(i);(0,a.dZ)(e.abortSignal);for(const e of(0,o.Ho)(t.features,this._maxQueryRate()))(0,s.Rn)(e,t.spatialReference??this.spatialReference.toJSON()),yield e}.apply(this)}}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new a.dr("NeverReach")}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,e.outFields=this._overrideFields??["*"],e.returnGeometry=!this._removeGeometry,e}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}relationshipMetadata(){return[]}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let r=e.layerDefinition.objectIdField;const i=e.layerDefinition.typeIdField??"",a=[];if(e.layerDefinition.types)for(const t of e.layerDefinition.types)a.push(h.A.fromJSON(t));let s=e.layerDefinition.geometryType;void 0===s&&(s=e.featureSet.geometryType||"");let n=e.featureSet.features;if(!r){let t=!1;for(const i of e.layerDefinition.fields)if("oid"===i.type||"esriFieldTypeOID"===i.type){r=i.name,t=!0;break}if(!1===t){let t="FID",i=!0,a=0;for(;i;){let r=!0;for(const i of e.layerDefinition.fields)if(i.name===t){r=!1;break}!0===r?i=!1:(a++,t="FID"+a.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});const s=[];for(let r=0;r<n.length;r++)s.push({geometry:e.featureSet.features[r].geometry,attributes:{...e.featureSet.features[r].attributes,[t]:r}});n=s,r=t}}const l=[];for(const t of e.layerDefinition.fields)t instanceof p.A?l.push(t):l.push(p.A.fromJSON(t));let o=s;switch(o||(o=""),o){case"esriGeometryPoint":o="point";break;case"esriGeometryPolyline":o="polyline";break;case"esriGeometryPolygon":o="polygon";break;case"esriGeometryEnvelope":o="extent";break;case"esriGeometryMultipoint":o="multipoint";break;case"":case"esriGeometryNull":o="esriGeometryNull"}if("esriGeometryNull"!==o){const e=t.toJSON();for(const t of n)t.geometry&&t.geometry instanceof c.A==0&&(t.geometry.type=o,void 0===t.geometry.spatialReference&&(t.geometry.spatialReference=e))}else for(const e of n)e.geometry&&(e.geometry=null);const u={outFields:["*"],source:n,fields:l,hasZ:!0===e.layerDefinition.hasZ||!0===e.featureSet.hasZ,hasM:!0===e.layerDefinition.hasM||!0===e.featureSet.hasM,types:a,typeIdField:i,objectIdField:r,spatialReference:t},f="esriGeometryNull"===o||null===o;f||(u.geometryType=o);const m=new d.default(u);return e.layerDefinition.subtypeField&&e.layerDefinition.subtypes&&m.read({subtypes:e.layerDefinition.subtypes,subtypeField:e.layerDefinition.subtypeField}),new y({layer:m,spatialReference:t,isTable:f})}async queryAttachments(){return[]}async getFeatureByObjectId(e){const t=this._createQuery();t.where=this.objectIdField+"="+e.toString();const r=await this._queryLayerFeaturesJSON(t);return 1===r.features.length?((0,s.Rn)(r.features,r.spatialReference??this.spatialReference.toJSON()),r.features[0]):null}serviceUrl(){return""}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return"preferredTimeZone"in this._layer?this._layer.preferredTimeZone:null}get dateFieldsTimeZone(){return"dateFieldsTimeZone"in this._layer?this._layer.dateFieldsTimeZone:null}get datesInUnknownTimezone(){return"datesInUnknownTimezone"in this._layer&&this._layer.datesInUnknownTimezone}get editFieldsInfo(){return"editFieldsInfo"in this._layer?this._layer.editFieldsInfo:null}get timeInfo(){return"timeInfo"in this._layer?this._layer.timeInfo:null}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}},16494(e,t,r){r.d(t,{Nd:()=>l,W5:()=>n});var i=r(17632);const a=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce((e,t)=>(e[t]=[],e),{}),s=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],n=new i.I({whiteList:a,onTagAttr:(e,t,r)=>{const i=`${t}="${r}"`;if(s.includes(t))return i},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),l=new i.I({whiteList:{br:[]},stripIgnoreTag:!0,escapeHtml:e=>e},!1)},159(e,t,r){r.d(t,{A:()=>u});var i,a=r(5482),s=r(69540),n=r(25482),l=r(91429),o=r(99157);let u=i=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.steps=[]}getInverse(){const e=new i;for(let t=this.steps.length-1;t>=0;t--){const r=this.steps[t];e.steps.push(r.getInverse())}return e}};(0,a.Cg)([(0,l.MZ)({type:[o.A],nonNullable:!0,json:{name:"geoTransforms"}})],u.prototype,"steps",void 0),u=i=(0,a.Cg)([(0,l.$K)("esri.geometry.operators.support.GeographicTransformation")],u)},99157(e,t,r){r.d(t,{A:()=>o});var i,a=r(5482),s=r(69540),n=r(25482),l=r(91429);let o=i=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new i({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,a.Cg)([(0,l.MZ)({json:{name:"transformForward",read:e=>!e,write:(e,t,r)=>{t[r]=!e}}})],o.prototype,"isInverse",void 0),(0,a.Cg)([(0,l.MZ)({json:{write:!0}})],o.prototype,"wkt",void 0),(0,a.Cg)([(0,l.MZ)({json:{write:!0}})],o.prototype,"wkid",void 0),o=i=(0,a.Cg)([(0,l.$K)("esri.geometry.operators.support.GeographicTransformationStep")],o)},9762(e,t,r){r.r(t),r.d(t,{projectBuffer:()=>a});var i=r(49208);function a(e,t,r,a,s,n,l=Math.floor(e.length/3)){const o=(0,i.jd)(t,s);if(null==o)return!1;if(o===i.pO){if(e===a&&r===n)return!0;const t=r+3*l;for(let i=r,s=n;i<t;i++,s++)a[s]=e[i]??0;return!0}const u=r+3*l;for(let t=r,i=n;t<u;t+=3,i+=3)o(e,t,a,i);return!0}},49208(e,t,r){r.d(t,{Tp:()=>d,jd:()=>c,pO:()=>p,w5:()=>u});var i=r(34727),a=r(86211),s=r(73941),n=r(79258),l=r(34403),o=r(21325);const u={2:{5:p,7:null,9:null,10:p,1:b,6:null,8:null,0:null,3:f,11:m,2:p,4:A},5:{5:p,7:null,9:null,10:p,1:b,6:null,8:null,0:null,3:f,11:m,2:p,4:A},7:{5:null,7:p,9:null,10:p,1:null,6:F,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:p,10:p,1:null,6:null,8:w,0:null,3:null,11:null,2:null,4:null},3:{5:y,7:null,9:null,10:y,1:function(e,t,r,i){const a=e[t]/j,s=x-2*Math.atan(Math.exp(-e[t+1]/j)),n=j+(e[t+2]??0),l=Math.cos(s)*n;r[i]=Math.cos(a)*l,r[i+1]=Math.sin(a)*l,r[i+2]=Math.sin(s)*n},6:null,8:null,0:null,3:p,11:function(e,t,r,i){y(e,t,r,i),m(r,i,r,i)},2:y,4:function(e,t,r,i){y(e,t,r,i),A(r,i,r,i)}},4:{5:R,7:null,9:null,10:R,1:function(e,t,r,i){R(e,t,r,i),b(r,i,r,i)},6:null,8:null,0:null,3:function(e,t,r,i){R(e,t,r,i),f(r,i,r,i)},11:function(e,t,r,i){R(e,t,r,i),m(r,i,r,i)},2:R,4:p},1:{5:T,7:null,9:null,10:T,1:p,6:null,8:null,0:null,3:function(e,t,r,i){T(e,t,r,i),f(r,i,r,i)},11:function(e,t,r,i){T(e,t,r,i),m(r,i,r,i)},2:T,4:function(e,t,r,i){T(e,t,r,i),A(r,i,r,i)}},6:{5:null,7:v,9:null,10:v,1:null,6:p,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:S,10:S,1:null,6:null,8:p,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:p,3:null,11:null,2:null,4:null},10:{5:p,7:p,9:p,10:p,1:b,6:F,8:w,0:null,3:f,11:m,2:p,4:A},11:{5:g,7:null,9:null,10:g,1:function(e,t,r,i){g(e,t,r,i),b(r,i,r,i)},6:null,8:null,0:null,3:function(e,t,r,i){g(e,t,r,i),f(r,i,r,i)},11:p,2:g,4:function(e,t,r,i){g(e,t,r,i),A(r,i,r,i)}}};function c(e,t){return d(e,t)?.projector}function d(e,t){if(null==e||null==t)return null;if(C.source.spatialReference===e&&C.dest.spatialReference===t)return C;const r=h(e,C.source),i=h(t,C.dest);return 0===r&&0===i?(0,o.aI)(e,t)?C.projector=p:C.projector=null:C.projector=u[r][i],C}function h(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,a.GA)(e,1)),(0,s.jA)(e)?t.spatialReferenceId=1:(0,o.oT)(e)?t.spatialReferenceId=2:(0,o.K8)(e)?t.spatialReferenceId=3:(0,o.r1)(e)?t.spatialReferenceId=11:e.wkt===s.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===s.FY.wkt?t.spatialReferenceId=6:e.wkt===s.LJ.wkt?t.spatialReferenceId=8:(0,s.q8)(e)?t.spatialReferenceId=7:(0,s.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function p(e,t,r,i){e!==r&&(r[i++]=e[t++],r[i++]=e[t++],r[i]=e[t]??0)}function y(e,t,r,i){r[i]=L*(e[t]/j),r[i+1]=L*(x-2*Math.atan(Math.exp(-e[t+1]/j))),r[i+2]=e[t+2]??0}function f(e,t,r,a){!function(e,t,r,a,s){const n=.4999999*Math.PI,l=(0,i.qE)(M*e[t+1],-n,n),o=Math.sin(l);r[a++]=M*e[t]*s.radius,r[a++]=s.halfSemiMajorAxis*Math.log((1+o)/(1-o)),r[a]=e[t+2]??0}(e,t,r,a,n.$O)}function m(e,t,r,i){r[i]=e[t]*O,r[i+1]=e[t+1]*O,r[i+2]=e[t+2]??0}function g(e,t,r,i){r[i]=e[t]*k,r[i+1]=e[t+1]*k,r[i+2]=e[t+2]??0}function _(e,t,r,i,a){const s=a+(e[t+2]??0),n=M*e[t],l=M*e[t+1],o=Math.cos(l)*s;r[i]=Math.cos(n)*o,r[i+1]=Math.sin(n)*o,r[i+2]=Math.sin(l)*s}function w(e,t,r,i){_(e,t,r,i,n.Sw.radius)}function F(e,t,r,i){_(e,t,r,i,n.sH.radius)}function b(e,t,r,i){_(e,t,r,i,n.$O.radius)}function I(e,t,r,a,s){const n=e[t],l=e[t+1],o=e[t+2]??0,u=Math.sqrt(n*n+l*l+o*o),c=(0,i.YN)(o/(0===u?1:u)),d=Math.atan2(l,n);r[a++]=L*d,r[a++]=L*c,r[a]=u-s}function S(e,t,r,i){I(e,t,r,i,n.Sw.radius)}function v(e,t,r,i){I(e,t,r,i,n.sH.radius)}function T(e,t,r,i){I(e,t,r,i,n.$O.radius)}function A(e,t,r,i){!function(e,t,r,i,a){const s=M*e[t],n=M*e[t+1],l=e[t+2]??0,o=Math.sin(n),u=Math.cos(n),c=a.radius/Math.sqrt(1-a.eccentricitySquared*o*o);r[i++]=(c+l)*u*Math.cos(s),r[i++]=(c+l)*u*Math.sin(s),r[i++]=(c*(1-a.eccentricitySquared)+l)*o}(e,t,r,i,n.$O)}function R(e,t,r,i){const a=l.TP,s=e[t],o=e[t+1],u=e[t+2]??0;let c,d,h,p,y,f,m,g,_,w,F,b,I,S,v,T,A,R,C,M,x;c=Math.abs(u),d=s*s+o*o,h=Math.sqrt(d),p=d+u*u,y=Math.sqrt(p),M=Math.atan2(o,s),f=u*u/p,m=d/p,S=a.a2/y,v=a.a3-a.a4/y,m>.3?(g=c/y*(1+m*(a.a1+S+f*v)/y),C=Math.asin(g),w=g*g,_=Math.sqrt(1-w)):(_=h/y*(1-f*(a.a5-S-m*v)/y),C=Math.acos(_),w=1-_*_,g=Math.sqrt(w)),F=1-n.$O.eccentricitySquared*w,b=n.$O.radius/Math.sqrt(F),I=a.a6*b,S=h-b*_,v=c-I*g,A=_*S+g*v,T=_*v-g*S,R=T/(I/F+A),C+=R,x=A+T*R/2,u<0&&(C=-C),r[i++]=L*M,r[i++]=L*C,r[i]=x}const C={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:p},M=(0,i.kU)(1),L=(0,i.KJ)(1),x=.5*Math.PI,j=n.$O.radius,O=j*Math.PI/180,k=180/(j*Math.PI)},91218(e,t,r){r.r(t),r.d(t,{canProjectWithoutEngine:()=>$,initializeProjection:()=>Y,isEqualBaseGCS:()=>V,isLoaded:()=>j,isLoadedOrLoad:()=>O,isLoadedOrLoadFor:()=>k,load:()=>Z,project:()=>U,projectAsync:()=>J,projectExtent:()=>ae,projectMany:()=>N,projectMultipoint:()=>W,projectOrLoad:()=>D,projectOrLoadMany:()=>E,projectPoint:()=>K,projectPolygon:()=>re,projectPolyline:()=>ee,projectWithoutEngine:()=>z,requiresLoad:()=>q,test:()=>Q,tryProject:()=>P,unload:()=>B});var i=r(49186),a=r(17676),s=r(62788),n=r(95488),l=r(51850),o=r(21276),u=r(73941),c=r(5443),d=r(91075),h=r(48526),p=r(86738),y=r(39829),f=r(82799),m=r(16930),g=r(98764),_=r(159),w=r(9762),F=r(49208);function b(e,t,r,i,a,s){return I[0]=e,I[1]=t,I[2]=r,(0,w.projectBuffer)(I,i,0,a,s,0)}const I=(0,l.vt)();var S=r(60408),v=r(21325),T=r(52006);let A=null,R=null,C=null,M=null,L={};const x=new n.I;function j(){return!!(R?.isLoaded()&&C?.isLoaded()&&M?.isLoaded())}function O(){return!!j()||((0,s.gc)(x),Z(),!1)}function k(e,t){return!e||!t||$(e,t)||O()}function q(e,t){return!$(e,t)&&!j()}async function Z(e){null==A&&(A=Promise.all([r.e(3276).then(r.bind(r,83276)).then(e=>(R=e,R.load())),r.e(8377).then(r.bind(r,8377)).then(e=>(C=e,C.load())),r.e(2158).then(r.bind(r,12158)).then(e=>(M=e,M.load()))])),await A,(0,a.Te)(e),x.notify()}function U(e,t,r){return Array.isArray(e)?0===e.length?[]:((0,o.H)(e),N(e,e[0].spatialReference,t,r)):((0,o.f)(e),N([e],e.spatialReference,t,r)[0])}function N(e,t,r,i){if(null==t||null==r)return e;if($(t,r,i))return e.map(e=>z(e,t,r));if(null==i?.geographicTransformation&&(0,u.jA)(t))return N(e.map(e=>z(e,t,m.A.WGS84)),m.A.WGS84,r,{zConversionDisabled:i?.zConversionDisabled});if(null==i?.geographicTransformation&&(0,u.jA)(r))return N(e,t,m.A.WGS84).map(e=>z(e,m.A.WGS84,r));if(!j())throw new G;if(!i?.geographicTransformation)if(i?.extendedParams)i={...i,geographicTransformation:M.getTransformation(t,r,i.areaOfInterestExtent)||new _.A};else if(!i?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,r);let a=L[e];a||(a=M.getTransformation(t,r)||new _.A,L[e]=a),i={geographicTransformation:a,zConversionDisabled:i?.zConversionDisabled}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof d.A?R.executeMany(e,r,i):C.executeMany(e,r,i)}function P(e,t,r){try{return U(e,t,r)}catch(e){return null}}function D(e,t){const r=E([e],t);return null!=r.pending?{pending:r.pending,geometry:null}:null!=r.geometries?{pending:null,geometry:r.geometries[0]}:{pending:null,geometry:null}}function E(e,t,r){if(!j())for(const r of e)if(null!=r&&!(0,v.aI)(r.spatialReference,t)&&(0,v.fn)(r.spatialReference)&&(0,v.fn)(t)&&!$(r.spatialReference,t))return(0,s.gc)(x),{pending:Z(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,v.aI)(e.spatialReference,t)?e:(0,v.fn)(e.spatialReference)&&(0,v.fn)(t)?U(e,t,r):null)}}class G extends i.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function B(){A=null,R=null,C=null,M=null,L={}}const Q={get loadPromise(){return A}};async function J(e,t,r){if((0,a.Te)(r),!e)return e;const i=E(Array.isArray(e)?e:[e],t,r);if(i.pending)return await i.pending,(0,a.Te)(r),J(e,t,r);const s=i.geometries??[];return Array.isArray(e)?s:s[0]}function $(e,t,r){return!(r?.areaOfInterestExtent||r?.extendedParams||r?.geographicTransformation)&&(!!(0,v.aI)(e,t)||(0,v.fn)(e)&&(0,v.fn)(t)&&!!(0,F.jd)(e,t))}function V(e,t){if((0,v.aI)(e,t))return!0;if(!(0,v.fn)(e)||!(0,v.fn)(t))return!1;const r=(0,v.oT)(e)||(0,v.K8)(e)||(0,v.x1)(e),i=(0,v.oT)(t)||(0,v.K8)(t)||(0,v.x1)(t);return r&&i}async function Y(e,t,r,i){if(j())return(0,a.NO)(i);if(Array.isArray(e)){for(const{source:t,dest:r,options:a}of e)if(t&&r&&!$(t,r,a))return Z(i)}else if(e&&t&&!$(e,t,r))return Z(i);return(0,a.NO)(i)}function z(e,t,r){return e?(0,S.fT)(e)?H(e,t,new p.A,r,0):(0,S.ZC)(e)?se(e,t,new c.A,r,0):(0,S.Bi)(e)?ie(e,t,new y.A,r,0):(0,S.Rg)(e)?te(e,t,new f.A,r,0):(0,S.U9)(e)?X(e,t,new h.A,r,0):null:null}function K(e,t,r=t.spatialReference,i=0){return null!=r&&null!=e.spatialReference&&null!=H(e,e.spatialReference,t,r,i)}function H(e,t,r,i,a){ue[0]=e.x,ue[1]=e.y;const s=e.z;return ue[2]=void 0!==s?s:a,(0,w.projectBuffer)(ue,t,0,ue,i,0)?(r.x=ue[0],r.y=ue[1],r.spatialReference=i,void 0!==s||(0,u.xP)(i)?(r.z=ue[2],r.hasZ=!0):(r.z=void 0,r.hasZ=!1),void 0===e.m?(r.m=void 0,r.hasM=!1):(r.m=e.m,r.hasM=!0),r):null}function W(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=X(e,e.spatialReference,t,r,i)}function X(e,t,r,i,a){const{points:s,hasZ:n,hasM:l}=e,o=[],u=s.length,c=[];for(const e of s)c.push(e[0],e[1],n?e[2]:a);if(!(0,w.projectBuffer)(c,t,0,c,i,0,u))return null;const d=oe(n,i);for(let e=0;e<u;++e){const t=3*e,r=c[t],i=c[t+1];d&&l?o.push([r,i,c[t+2],s[e][3]]):d?o.push([r,i,c[t+2]]):l?o.push([r,i,s[e][2]]):o.push([r,i])}return r.points=o,r.spatialReference=i,r.hasZ=n,r.hasM=l,r}function ee(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=te(e,e.spatialReference,t,r,i)}function te(e,t,r,i,a){const{curvePaths:s,paths:n,hasZ:l,hasM:o}=e;if(!(s?le(s,l??!1,o??!1,t,r.curvePaths=[],i,a):ne(n,l??!1,o??!1,t,r.paths,i,a)))return null;const u=oe(l,i);return r.spatialReference=i,r.hasZ=u,r.hasM=o,r}function re(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=ie(e,e.spatialReference,t,r,i)}function ie(e,t,r,i,a){const{curveRings:s,rings:n,hasZ:l,hasM:o}=e;return(s?le(s,l??!1,o??!1,t,r.curveRings=[],i,a):ne(n,l??!1,o??!1,t,r.rings,i,a))?(r.spatialReference=i,r.hasZ=oe(l,i),r.hasM=o,r):null}function ae(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=se(e,e.spatialReference,t,r,i)}function se(e,t,r,i,a){const{xmin:s,ymin:n,xmax:l,ymax:o,hasZ:u,hasM:c}=e;if(!b(s,n,u?e.zmin:a,t,ue,i))return null;const d=oe(u,i);return r.xmin=ue[0],r.ymin=ue[1],d&&(r.zmin=ue[2]),b(l,o,u?e.zmax:a,t,ue,i)?(r.xmax=ue[0],r.ymax=ue[1],d&&(r.zmax=ue[2]),c&&(r.mmin=e.mmin,r.mmax=e.mmax),r.spatialReference=i,r):null}function ne(e,t,r,i,a,s,n=0){const l=new Array;for(const r of e)for(const e of r)l.push(e[0],e[1],t?e[2]:n);if(!(0,w.projectBuffer)(l,i,0,l,s,0))return!1;let o=0;a.length=0;const u=t?3:2,c=oe(t,s);for(const t of e){const e=new Array;for(const i of t){const t=l.slice(o,o+=3);c||t.pop(),r&&t.push(i[u]),e.push(t)}a.push(e)}return!0}function le(e,t,r,i,a,s,n=0){const l=new Array;for(const r of e)for(const e of r){if((0,T.FG)(e))return!1;if((0,T.aO)(e)){const[r,i]=e.c;l.push(r[0],r[1],t?r[2]:n,i[0],i[1],n);continue}if((0,T.n1)(e)){const[r,i,a]=e.b;l.push(r[0],r[1],t?r[2]:n,i[0],i[1],n,a[0],a[1],n);continue}const r=e;l.push(r[0],r[1],t?r[2]:n)}if(!(0,w.projectBuffer)(l,i,0,l,s,0))return!1;let o=0;a.length=0;const u=t?3:2,c=oe(t,s);for(const t of e){const e=new Array;for(const i of t){const t=l.slice(o,o+=3);if(c||t.pop(),r&&t.push((0,T.yP)(i)[u]),(0,T.FG)(i))return!1;if((0,T.aO)(i)){const r=l[o++],i=l[o++];++o,e.push({c:[t,[r,i]]});continue}if((0,T.n1)(i)){const r=l[o++],i=l[o++];++o;const a=l[o++],s=l[o++];++o,e.push({b:[t,[r,i],[a,s]]});continue}e.push(t)}a.push(e)}return!0}function oe(e,t){return e||(0,u.xP)(t)||(0,v.aI)(t,g.Y0)}const ue=(0,l.vt)()},98764(e,t,r){r.d(t,{GD:()=>n,Y0:()=>u,lO:()=>c});var i=r(73941),a=r(16930),s=r(21325);const n=new a.A(i.fv),l=new a.A(i.FY),o=new a.A(i.LJ),u=new a.A(i.Ro);function c(e){const t=d.get(e);if(t)return t;let r=n;if(e)if(e===l)r=l;else if(e===o)r=o;else{const t=e.wkid,i=e.latestWkid;if(null!=t||null!=i)(0,s.tl)(t)||(0,s.tl)(i)?r=l:((0,s.ZL)(t)||(0,s.ZL)(i))&&(r=o);else{const t=e.wkt2??e.wkt;if(t){const e=t.toUpperCase();e===h?r=l:e===p&&(r=o)}}}return d.set(e,r),r}const d=new Map,h=l.wkt.toUpperCase(),p=o.wkt.toUpperCase()},34403(e,t,r){r.d(t,{TP:()=>n});var i=r(79258);Math.PI;const a=i.$O.radius,s=i.$O.eccentricitySquared,n={a1:a*s,a2:a*s*a*s,a3:a*s*s/2,a4:a*s*a*s*2.5,a5:a*s+a*s*s/2,a6:1-s};i.$O.radius,i.$O.flattening,i.Sw.radius,i.Sw.flattening,i.sH.radius,i.sH.flattening,i.sH.radius},62815(e,t,r){r.d(t,{N:()=>l,d:()=>o});var i=r(86211),a=r(73941),s=r(21325),n=r(52006);function l(e,t,r){const i=o(t,r);if(1!==i)switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,i);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e){if(e.curvePaths)for(const r of e.curvePaths)for(const e of r){const r=(0,n.yP)(e);r.length>2&&(r[2]*=t)}if(e.paths)for(const r of e.paths)for(const e of r)e.length>2&&(e[2]*=t)}}(e,i);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e){if(e.curveRings)for(const r of e.curveRings)for(const e of r){const r=(0,n.yP)(e);r.length>2&&(r[2]*=t)}if(e.rings)for(const r of e.rings)for(const e of r)e.length>2&&(e[2]*=t)}}(e,i);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const r of e.points)r.length>2&&(r[2]*=t)}(e,i);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,i);default:return}}function o(e,t){return null==e||null==t||(0,s.aI)(e,t)||(0,a.xP)(e)||(0,a.xP)(t)?1:(0,i.G9)(e)/(0,i.G9)(t)}},4146(e,t,r){r.d(t,{A:()=>_});var i=r(5482),a=r(11254),s=r(49186),n=r(65529),l=r(4902),o=r(92474),u=r(53966),c=r(17676),d=r(84952),h=r(91429),p=r(5443),y=r(16930),f=r(92602),m=r(79677);let g=0,_=class extends((0,n.Zt)((0,l.s)(o.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new p.A(-180,-90,180,90,y.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=y.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([r.e(812),r.e(7982)]).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await Promise.all([r.e(812),r.e(5613),r.e(909)]).then(r.bind(r,45613));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",a=r?.portal?.url||f.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+a+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,c.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,d.An)(this.url)}createLayerView(e,t){return Promise.reject(new s.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,a.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,h.MZ)({type:String})],_.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],_.prototype,"effectiveVisible",null),(0,i.Cg)([(0,h.MZ)({type:p.A})],_.prototype,"fullExtent",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],_.prototype,"hasAttributionData",null),(0,i.Cg)([(0,h.MZ)({type:String,clonable:!1})],_.prototype,"id",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:["show","hide","hide-children"]})],_.prototype,"listMode",void 0),(0,i.Cg)([(0,h.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],_.prototype,"opacity",void 0),(0,i.Cg)([(0,h.MZ)({clonable:!1})],_.prototype,"parent",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean})],_.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean})],_.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,h.MZ)({type:y.A})],_.prototype,"spatialReference",void 0),(0,i.Cg)([(0,h.MZ)({type:String})],_.prototype,"title",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],_.prototype,"type",void 0),(0,i.Cg)([(0,h.MZ)()],_.prototype,"url",void 0),(0,i.Cg)([(0,h.MZ)({type:m.A})],_.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"visible",void 0),_=(0,i.Cg)([(0,h.$K)("esri.layers.Layer")],_)},52136(e,t,r){r.d(t,{p:()=>s});var i=r(5482),a=r(91429);const s=e=>{const t=e;let r=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i.Cg)([(0,a.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,i.Cg)([(0,a.$K)("esri.layers.mixins.APIKeyMixin")],r),r}},47685(e,t,r){r.d(t,{Mk:()=>p,Zk:()=>d,w6:()=>m});var i=r(5482),a=r(65529),s=r(4718),n=r(91429),l=r(20816);const o=new a.bk;function u(e){return o.on("apply-edits",new WeakRef(e))}function c(e){return o.on("update-moment",new WeakRef(e))}function d(e,t,r=null,i=!1){const a=Promise.withResolvers();return i=null==t||i,o.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:r,mayReceiveServiceEdits:i,result:a.promise}),a}const h=Symbol();function p(e){return null!=e&&"object"==typeof e&&h in e}function y(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function f(e,t,r){const i=new URL(e).host,a=l.Z3.get(i),s=e=>!e||e===a;return s(t)&&s(r)||t===r}const m=e=>{var t;const r=e;let a=class extends r{static{t=h}constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:r,gdbVersion:i,mayReceiveServiceEdits:a,result:n}=e,l=t===this.url,o=null!=r&&null!=this.layerId&&r===this.layerId,u=y(this),c=y(this)&&f(t,i,this.gdbVersion);if(!l||u&&!c||!o&&!a)return;const d=n.then(e=>{if(this.lastEditsEventDate=new Date,o&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,s.o8)(e)),e;const r=e.editedFeatures?.find(({layerId:e})=>e===this.layerId);if(r){const{adds:t,updates:i,deletes:a}=r.editedFeatures,n={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:t?t.map(({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],deletedFeatures:a?a.map(({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],updatedFeatures:i?i.map(({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],editedFeatures:(0,s.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,s.o8)(e.historicMoment)};return this.emit("edits",n),n}const a={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,s.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,s.o8)(e.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,a.historicMoment)&&this.emit("edits",a),a}).then(e=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,e.historicMoment)&&(this.historicMoment=e.historicMoment),e));this.emit("apply-edits",{result:d})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:r,moment:i}=e,a=t===this.url,s=y(this),n=y(this)&&f(t,r,this.gdbVersion),l=y(this)&&!f(t,this.gdbVersion,null);a&&s&&n&&l&&"historicMoment"in this&&this.historicMoment!==i&&(this.historicMoment=i)},this.when().then(()=>{this.addHandles(u(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(c(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(e,t,r){return"historicMoment"in this&&this.historicMoment!==r&&(0,l.w5)(e,t)}};return(0,i.Cg)([(0,n.MZ)()],a.prototype,"lastEditsEventDate",void 0),a=(0,i.Cg)([(0,n.$K)("esri.layers.mixins.EditBusLayer")],a),a}},28032(e,t,r){r.d(t,{A:()=>o});var i=r(5482),a=r(69540),s=r(25482),n=r(91429),l=r(56400);let o=class extends((0,a.OU)(s.o)){constructor(e){super(e),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};(0,i.Cg)([(0,n.MZ)()],o.prototype,"creatorField",void 0),(0,i.Cg)([(0,n.MZ)()],o.prototype,"creationDateField",void 0),(0,i.Cg)([(0,n.MZ)()],o.prototype,"editorField",void 0),(0,i.Cg)([(0,n.MZ)()],o.prototype,"editDateField",void 0),(0,i.Cg)([(0,n.MZ)()],o.prototype,"realm",void 0),(0,i.Cg)([(0,n.MZ)((0,l.P6)("dateFieldsTimeReference",!0))],o.prototype,"timeZone",void 0),o=(0,i.Cg)([(0,n.$K)("esri.layers.support.EditFieldsInfo")],o)},33143(e,t,r){r.d(t,{A:()=>d});var i=r(5482),a=r(69540),s=r(25482),n=r(91429),l=r(8631),o=r(29005),u=r(36005),c=r(43937);let d=class extends((0,a.OU)(s.o)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,l.r)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i.Cg)([(0,n.MZ)({json:{write:!0}})],d.prototype,"id",void 0),(0,i.Cg)([(0,n.MZ)({json:{write:!0}})],d.prototype,"name",void 0),(0,i.Cg)([(0,n.MZ)({json:{write:!0}})],d.prototype,"domains",void 0),(0,i.Cg)([(0,u.w)("domains")],d.prototype,"readDomains",null),(0,i.Cg)([(0,c.K)("domains")],d.prototype,"writeDomains",null),(0,i.Cg)([(0,n.MZ)({type:[o.A],json:{write:!0}})],d.prototype,"templates",void 0),d=(0,i.Cg)([(0,n.$K)("esri.layers.support.FeatureType")],d)},37352(e,t,r){r.d(t,{A:()=>o});var i,a=r(5482),s=r(7762),n=r(25482),l=r(91429);let o=i=class extends n.o{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new s.A}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,a.Cg)([(0,l.MZ)({type:String,json:{write:{isRequired:!0}}})],o.prototype,"floorField",void 0),(0,a.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],o.prototype,"viewAllMode",void 0),(0,a.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],o.prototype,"viewAllLevelIds",void 0),o=i=(0,a.Cg)([(0,l.$K)("esri.layers.support.LayerFloorInfo")],o)},45067(e,t,r){r.d(t,{A:()=>c});var i=r(5482),a=r(69540),s=r(66552),n=r(25482),l=r(91429);const o=new s.J({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),u=new s.J({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let c=class extends((0,a.OU)(n.o)){constructor(e){super(e),this.cardinality=null,this.catalogId=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};(0,i.Cg)([(0,l.MZ)({json:{read:o.read,write:o.write}})],c.prototype,"cardinality",void 0),(0,i.Cg)([(0,l.MZ)({json:{name:"catalogID"}})],c.prototype,"catalogId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"composite",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"id",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"keyField",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"keyFieldInRelationshipTable",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"name",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"relatedTableId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"relationshipTableId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:u.read,write:u.write}})],c.prototype,"role",void 0),c=(0,i.Cg)([(0,l.$K)("esri.layers.support.Relationship")],c)},17311(e,t,r){r.d(t,{A:()=>p});var i=r(5482),a=r(69622),s=r(4576),n=r(60999),l=r(7762),o=r(16494),u=r(91429),c=r(30524),d=r(43668);const h=/<br\s*\/*>/gi;let p=class extends a.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,n.UT)(()=>(0,d.l)()):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??Promise.all([r.e(4560),r.e(9301)]).then(r.bind(r,99301)).then(e=>this._featureUtils=e)}get calculatedExpressions(){const e=new l.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter(t=>e.includes(`{expression/${t.name.toLowerCase()}}`))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some(e=>!0===e.invalid)}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),i=this.fieldsIndex.get(r.at(-1)??"");i&&e.add(i.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return null!=this.objectIdField&&e.add(this.objectIdField),e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){const i=t.getObjectId()??t.attributes[e.objectIdField];return(await this.getTitles(e,[t],r)).get(i)??""}async getTitles(e,t,r){const i=new Map,a=r?.timeZone??"system";try{const[{substituteFieldsInLinksAndAttributes:s}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);r?.fetchMissingFields&&(t=await this._checkAndReQueryGraphics(e,t));const{fieldInfoMap:n,workingTitle:l}=this,u=l&&n;t.forEach(t=>{const c=t.getObjectId()??t.attributes[e.objectIdField];let d=u?s({attributes:t.attributes,expressionAttributes:null,fieldInfoMap:n,globalAttributes:this._createFormattedAttributes(e,t,a).global,layer:e,text:l}):"";r?.removeHTML&&(d=o.Nd.sanitize(d).replaceAll(h," ")),i.set(c,d)})}catch{}return i}async _checkAndReQueryGraphics(e,t){const r=t.map(t=>t.getObjectId()??t.attributes[e.objectIdField]).filter(s.Ru);if(r.length!==t.length)return t;if(t.some(e=>!(0,c.Kl)(e,this.requiredFields))){const i=e.createQuery();i.where="1=1",i.outFields=[...this.requiredFields],i.objectIds=r;const a=await e.queryFeatures(i);if(a?.features.length===t.length)return a.features}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),i=e?.name??r.fieldName;r.fieldName=i,t.set(i.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const i=this.effectivePopupTemplate?.fieldInfos??[],a={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{a[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const s={...t.attributes,...a};return{global:this._featureUtils.formatAttributes({fieldInfos:i,attributes:s,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,c.nw)(e).filter(e=>!(e.startsWith("relationships/")||e.startsWith("expression/")))}};(0,i.Cg)([(0,u.MZ)({readOnly:!0})],p.prototype,"_arcadeTask",null),(0,i.Cg)([(0,u.MZ)()],p.prototype,"_featureUtils",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],p.prototype,"featureUtilsPromise",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],p.prototype,"calculatedExpressions",null),(0,i.Cg)([(0,u.MZ)()],p.prototype,"displayField",void 0),(0,i.Cg)([(0,u.MZ)()],p.prototype,"effectivePopupTemplate",void 0),(0,i.Cg)([(0,u.MZ)()],p.prototype,"expressionsUsedInTitle",null),(0,i.Cg)([(0,u.MZ)()],p.prototype,"fieldsIndex",void 0),(0,i.Cg)([(0,u.MZ)()],p.prototype,"fieldInfoMap",null),(0,i.Cg)([(0,u.MZ)()],p.prototype,"fields",void 0),(0,i.Cg)([(0,u.MZ)()],p.prototype,"objectIdField",void 0),(0,i.Cg)([(0,u.MZ)()],p.prototype,"requiredFields",null),p=(0,i.Cg)([(0,u.$K)("esri.layers.support.TitleCreator")],p)},41560(e,t,r){r.d(t,{Ch:()=>n,mW:()=>s});var i=r(34727),a=r(39516);function s(e,t){return{...t,filterMode:e.mode}}function n(e,t,r){const s=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:i}of e.filters)t[0]=Math.max(t[0],c(r)),t[1]=Math.min(t[1],d(i));return t}(e);if(s&&((0,i.gg)(t,s[0])||(0,i.ZH)(r,s[1])))return"";const n=Array.from(l(e,t,r)),o=function(e,t,r){if(0===e.length)return!0;const a=c(e.at(0)?.minScale),s=d(e.at(-1)?.maxScale);if((0,i.ZH)(a,t)||(0,i.gg)(s,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],a=e[t+1];if((0,i.ZH)(c(a.minScale),d(r.maxScale)))return!0}return!1}(n,t,r)?"1=1":n.map(e=>e.where||"1=1").reduce((e,t)=>(0,a.IW)(e,t),"");return o&&"1=1"!==o?o:""}function*l(e,t,r){if("manual"===u(e)){const t=e.filters.find(t=>t.id===e.activeFilterId);t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const i of e.filters)o(i.minScale,i.maxScale,t,r)&&(yield i)}}function o(e,t,r,a){return e=c(e),r=c(r),t=d(t),!(!(0,i.Sp)(r,e)&&(a??r)>e||(0,i.Hx)(t,r)||void 0!==a&&(0,i.Sp)(a,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function c(e){return e||Number.POSITIVE_INFINITY}function d(e){return e||0}},77548(e,t,r){r.d(t,{Gh:()=>j,tk:()=>R,BR:()=>A,p2:()=>v,qd:()=>C,wI:()=>T,G$:()=>L,$x:()=>M,Ov:()=>w,cM:()=>h,UC:()=>p,W_:()=>F,Qz:()=>y,OP:()=>x,TU:()=>_,F2:()=>f,XX:()=>g,Qi:()=>b,jy:()=>I});var i=r(70333),a=r(11254),s=r(7762),n=(r(84952),r(36563)),l=r(36708),o=r(4146);const u=new WeakMap;function c(e){return!e.destroyed&&(u.has(e)||e.addHandles([(0,l.wB)(()=>{const{parent:t}=e;return!!(t&&t instanceof o.A)&&("catalog-dynamic-group"===t.type||c(t))},t=>u.set(e,t),l.pc),(0,n.hA)(()=>u.delete(e))]),u.get(e))}function d(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function h(e){return d(e,"knowledge-graph")&&"layers"in e}function p(e){return d(e,"knowledge-graph-sublayer")}function y(e){return d(e,"link-chart")&&"layers"in e}function f(e){return d(e,"subtype-group")&&"sublayers"in e}function m(e){const t=e.parent;return function(e){return"group"===e?.type}(t)&&t.tables.includes(e)}r(16215);const g={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function _(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function w(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function F(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t||"annotation-feature"===t||"dimension-feature"===t)&&"feature-layer"===e?.source?.type}function b(e){return null!=e&&"object"==typeof e&&"featureReduction"in e}function I(e){return function(e){return d(e,"catalog-footprint")}(e)||function(e){return d(e,"feature")}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)||function(e){return d(e,"oriented-imagery")}(e)||function(e){return"subtype-sublayer"===e?.type}(e)}function S(e){const t=e?.type;return"binning"===t||"cluster"===t}function v(e,t){if(!I(e))return;const r=t?.graphic,i="featureReduction"in e?e.featureReduction:null;if(r){if(r.isAggregate){const e=r.origin;return e&&"featureReductionProvider"in e&&i?S(i)?i:null:void 0}return e}return t?.checkFeatureReduction&&i?S(i)?i:null:e}async function T(e,t){const r=i.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const s=e.toLowerCase().indexOf("/rest/services");if(-1===s)return null;const n=`${e.slice(0,s)}/rest/info`,l=null!=t?t.signal:null,{data:o}=await(0,a.A)(n,{query:{f:"json"},responseType:"json",signal:l});return o?.owningSystemUrl||null}function A(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"parquet":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function R(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function C(e){const t=new s.A;for(const r of e.allLayers.concat(e.allTables))c(r)||m(r)||"annotation-feature"===r.type||"dimension-feature"===r.type||("charts"in r&&t.push(r),"subtype-group"===r.type&&t.push(...r.sublayers));return t}function M(e,t){return null}function L(e){return null}function x(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function j(e,t){if(!t||!x(e))return;const r=(e.url,null);r&&(e.url=r)}},73133(e,t,r){r.d(t,{j:()=>i});const i=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"})},10536(e,t,r){function i(e){const t={};for(const r in e){if("declaredClass"===r)continue;const a=e[r];if(null!=a&&"function"!=typeof a)if(Array.isArray(a)){t[r]=[];for(let e=0;e<a.length;e++)t[r][e]=i(a[e])}else"object"==typeof a?a.toJSON&&(t[r]=JSON.stringify(a)):t[r]=a}return t}r.d(t,{z:()=>i})},17126(e,t,r){r.d(t,{dw:()=>n,qD:()=>l,qW:()=>o});var i=r(11254),a=r(21325),s=r(10536);function n(e,t){const r=e.toJSON();return r.objectIds&&(r.objectIds=r.objectIds.join(",")),r.orderByFields&&(r.orderByFields=r.orderByFields.join(",")),r.outFields&&!t?.returnCountOnly?r.outFields.includes("*")?r.outFields="*":r.outFields=r.outFields.join(","):delete r.outFields,r.outSR&&(r.outSR=(0,a.YX)(r.outSR)),r.dynamicDataSource&&(r.layer=JSON.stringify({source:r.dynamicDataSource}),delete r.dynamicDataSource),r}async function l(e,t,r){const i=await u(e,t,r),a=i.data,s=a.geometryType,n=a.spatialReference,l={};for(const e of a.relatedRecordGroups){const t={fields:void 0,geometryType:s,spatialReference:n,hasZ:!!a.hasZ,hasM:!!a.hasM,features:e.relatedRecords};if(null!=e.objectId)l[e.objectId]=t;else for(const r of Object.keys(e))"relatedRecords"!==r&&(l[e[r]]=t)}return{...i,data:l}}async function o(e,t,r){const i=await u(e,t,r,{returnCountOnly:!0}),a=i.data,s={};for(const e of a.relatedRecordGroups)null!=e.objectId&&(s[e.objectId]=e.count);return{...i,data:s}}async function u(e,t,r={},a){const l=(0,s.z)({...e.query,f:"json",...a,...n(t,a)});return(0,i.A)(e.path+"/queryRelatedRecords",{...r,query:{...r.query,...l}})}},58501(e,t,r){r.d(t,{q:()=>a});var i=r(62815);function a(e,t,r){if(!r?.features||!r.hasZ)return;const a=(0,i.N)(r.geometryType,t,e.outSpatialReference);if(a)for(const e of r.features)a(e.geometry)}},16215(e,t,r){r.d(t,{S:()=>a,Y:()=>i});const i=Symbol("BasemapInstance");function a(e){return null!=e&&"object"==typeof e&&i in e}},79677(e,t,r){r.d(t,{A:()=>h});var i,a=r(5482),s=r(25482),n=r(88930),l=r(91429),o=r(98623),u=r(10184),c=r(36005),d=r(43937);let h=class extends s.o{static{i=this}static get allTime(){return p}static get empty(){return y}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,a=e.end?.getTime()??e.end;return t===i&&r===a}expandTo(e,t=o.qU){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let r=this.start;r&&(r=(0,n.lL)(r,new u.A({value:1,unit:e}),t));let a=this.end;if(a){const r=(0,n.lL)(a,new u.A({value:1,unit:e}),t);a=a.getTime()===r.getTime()?r:(0,n.S1)(r,1,e,t)}return new i({start:r,end:a})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,a=e.start?.getTime()??-1/0,s=e.end?.getTime()??1/0;let n,l;return a>=t&&a<=r?n=a:t>=a&&t<=s&&(n=t),r>=a&&r<=s?l=r:s>=t&&s<=r&&(l=s),null==n||null==l||isNaN(n)||isNaN(l)?i.empty:new i({start:n===-1/0?null:new Date(n),end:l===1/0?null:new Date(l)})}offset(e,t,r=o.qU){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();const a=new i,{start:s,end:l}=this;return null!=s&&(a.start=(0,n.S1)(s,e,t,r)),null!=l&&(a.end=(0,n.S1)(l,e,t,r)),a}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,a.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,a.Cg)([(0,c.w)("end")],h.prototype,"readEnd",null),(0,a.Cg)([(0,d.K)("end")],h.prototype,"writeEnd",null),(0,a.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,a.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,a.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,a.Cg)([(0,c.w)("start")],h.prototype,"readStart",null),(0,a.Cg)([(0,d.K)("start")],h.prototype,"writeStart",null),h=i=(0,a.Cg)([(0,l.$K)("esri.time.TimeExtent")],h);const p=new h,y=new h({start:void 0,end:void 0})},10184(e,t,r){r.d(t,{A:()=>c});var i=r(5482),a=r(69540),s=r(25482),n=r(88930),l=r(91429),o=r(73133),u=r(93223);let c=class extends((0,a.OU)(s.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,n.t)(this.value,this.unit,"milliseconds")}};(0,i.Cg)([(0,u.e)(o.j,{nonNullable:!0})],c.prototype,"unit",void 0),(0,i.Cg)([(0,l.MZ)({type:Number,json:{write:!0},nonNullable:!0})],c.prototype,"value",void 0),c=(0,i.Cg)([(0,l.$K)("esri.time.TimeInterval")],c)},20816(e,t,r){r.d(t,{TA:()=>a,We:()=>l,Z3:()=>s,ZJ:()=>o,w5:()=>u});var i=r(11254);const a=(0,r(13069).vD)(),s=new Map,n=new Map;async function l(e,t,r){if(!e||!r)return!1;if(!t)return!0;const a=new URL(e).host;let n=s.get(a);if(!n){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");n=(await(0,i.A)(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return n===t}async function o(e,t,i=!1){if(!e||!t)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),l=n.get(s)?.entries();if(l)for(const[e,n]of l)if(n.name===t){const t=!n.stack?.hasForwardEdits();if(!t&&i){const[{deleteForwardEdits:t},{default:i}]=await Promise.all([r.e(2186).then(r.bind(r,32186)),r.e(2558).then(r.bind(r,32558))]),l=await t(s,e,new i({sessionId:a,moment:n.moment}));return l.success&&n.stack?.clearForwardEdits(),l.success}return t}return!0}function u(e,t){if(!e)return!1;const r=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=n.get(r)?.entries();if(i)for(const[e,r]of i)if(r.name===t)return"edit"===r.lockType;return!1}new Map}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3202,8503],{96685(e,t,r){r.r(t),r.d(t,{constructAssociationMetaDataFeatureSetFromUrl:()=>G,constructFeatureSet:()=>E,constructFeatureSetFromPortalItem:()=>z,constructFeatureSetFromRelationship:()=>Q,constructFeatureSetFromUrl:()=>D,convertToFeatureSet:()=>K,createFeatureSetCollectionFromMap:()=>V,createFeatureSetCollectionFromService:()=>Y,initialiseMetaDataCache:()=>N});var i=r(11254);class a{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection"}castToText(e=!1){return"object, FeatureSetCollection"}}var s=r(78878),n=r(35704),l=r(70333),o=r(48938),u=r(61454),c=r(66395),d=r(87449),h=r(11221),p=r(33325),y=r(80609),f=r(50145),m=r(4576),g=r(80200),_=r(39516),w=r(89696),F=r(53781),b=r(17126),I=r(54546),S=r(97552),v=r(7562);function T(e,t){null==e.clause&&(e.clause=function(e){if(0===e.length)throw new d.dr("NeverReach");const t=[];for(let r=0;r<e.length;r++){const i=e[r],a=[`"${i.name.replaceAll('"','""')}" ${i.asc?">":"<"} @last_${r}`];for(let t=0;t<r;t++){const r=e[t];a.push(`"${r.name.replaceAll('"','""')}" = @last_${t}`)}t.push(a.join(" AND "))}const r=t.join(" OR ");return w.A.create(r)}(e.keyFields));for(let r=0;r<e.keyFields.length;r++){const i=e.keyFields[r].name;e.clause.parameters[`last_${r}`]=t.attributes[i]}}class A extends h.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this._requestStandardised=!1,this._useDefinitionExpression=!0,this._recentlyUsedQueries=null,this._featureSetQueryInterceptor=null,this._featureSetInfo=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry),e.lrucache&&(this._recentlyUsedQueries=e.lrucache),e.interceptor&&(this._featureSetQueryInterceptor=e.interceptor)}_maxQueryRate(){return p.gO}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+(0,p.JB)(e.toJSON());return(0,g.d)(t,g.T.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=1,null!=e&&e>=10.61&&(this._databaseType=0)):null!=e&&(e>=10.5&&(this._databaseType=1,this._requestStandardised=!0),e>=10.61&&(this._databaseType=0))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new S.A;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}async _queryAll(){return(await this.query({abortSignal:o._})).features}async query(e){return await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter?h.An:this._canUsePagination()?this._queryUsingPaging(e):this._queryUsingIdSetTraversal(e)}async _queryUsingPaging(e){const t=this._layer.capabilities.query;let r=!0,i=null,a=!1;null!=e.orderBy&&(t.supportsOrderBy?(i=e.orderBy.toOrderByFields(),a=!0):r=!1);const s=await this.databaseType(),n=null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,s),l=!0!==this._removeGeometry,o=this._overrideFields??this._fieldsIncludingObjectId(["*"]),u=o.includes("*")?this._layer.fields.length:o.length,c=(this.isTable()||!l?t.standardMaxRecordCountNoGeometry:void 0)??t.standardMaxRecordCount??t.maxRecordCount??this._maxQueryRate(),d=u<=50?1:u<=100?.5:u<=200?.25:.125,p=Math.max(Math.ceil(c*d),t.maxRecordCount??this._maxQueryRate()),f=this._createQuery();if(f.where=(0,_.mA)(f.where,n),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);f.spatialRelationship=t.spatialRelationship,f.relationParameter=t.relationParameter,f.geometry=e.spatialFilter.geometry}return f.orderByFields=i,f.outFields=o,f.returnGeometry=l,f.outSpatialReference=this.spatialReference,f.resultType="standard",{ordered:a,filterApplied:!0,spatialFilterApplied:!0,features:this._queryPaginated(f,p,r?e.limit:null,e.abortSignal)}}async*_queryPaginated(e,t,r,i){let a;e.num=null!=r?Math.min(r,t):t,e.start=0;do{(0,d.dZ)(i),a=await this.executeQuery(e,"execute"),yield*(0,m.Ho)(a.features,this._maxQueryRate()),e.start+=a.features.length,e.num=null!=r?Math.min(r-e.start,t):t}while(e.num>0&&!0===a.exceededTransferLimit)}async _queryUsingIdSetTraversal(e){let t=!0,r=null,i=!1;null!=e.orderBy&&(this._layer.capabilities?.query?.supportsOrderBy?(r=e.orderBy.toOrderByFields(),i=!0):t=!1);const a=await this.databaseType(),s=null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,a),n=this._createQuery();if(n.where=(0,_.mA)(n.where,s),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);n.spatialRelationship=t.spatialRelationship,n.relationParameter=t.relationParameter,n.geometry=e.spatialFilter.geometry}n.orderByFields=r,n.outSpatialReference=this.spatialReference,n.num=t?e.limit:null;const l=await this.executeQuery(n,"executeForIds");if((0,d.dZ)(e.abortSignal),null==l||l.length<=0)return h.An;let o=this._maxQueryRate();const u=this._layer.capabilities?.query.maxRecordCount;null!=u&&u<o&&(o=u);const c=this._createQuery();return n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0!==this._removeGeometry,n.outSpatialReference=this.spatialReference,{ordered:i,filterApplied:!0,spatialFilterApplied:!0,features:this._traverseIdSet(c,l,o,e.abortSignal)}}async*_traverseIdSet(e,t,r,i){for(let a=0;a<t.length;a+=r){e.objectIds=t.slice(a,a+r),(0,d.dZ)(i);const s=await this.executeQuery(e,"execute");yield s.features}}async queryStat(e){await this._ensureLoaded();const t=this._layer.capabilities?.query,r=!!t?.supportsSqlExpression,i=!!t?.supportsStatistics,a=!!t?.supportsDistinct,s=(0,f.Dp)(e.stat);if("count"===s)return a?this._queryCount(e):{calculated:!1};const n=e.field;if(null==n)return{calculated:!1};if(!1===i||!1===(0,y.DA)(n)&&!1===r||!1===n.isStandardized)return null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(e.stat,n,e.limit??p.gO,e.abortSignal);if("distinct"===s)return!1===a?null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(s,n,e.limit??p.gO,e.abortSignal):{calculated:!1};const l=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:null};const o=this._createQuery();if(o.where=(0,_.mA)(o.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,l)),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);o.spatialRelationship=t.spatialRelationship,o.relationParameter=t.relationParameter,o.geometry=e.spatialFilter.geometry}const u=new v.A;u.statisticType=s,u.onStatisticField=(0,y.YY)(n,l),u.outStatisticFieldName="ARCADE_STAT_RESULT",o.returnGeometry=!1;let c="ARCADE_STAT_RESULT";o.outStatistics=[u];const m=await this.executeQuery(o,"execute");if(!m.hasOwnProperty("features")||0===m.features.length)throw new d.dr("InvalidStatResponse");let g=!1;const w=m.fields??[];for(const e of w)if("ARCADE_STAT_RESULT"===e.name.toUpperCase()){c=e.name,"esriFieldTypeDate"===e.type&&(g=!0);break}const F=m.features[0].attributes[c];return{calculated:!0,result:g&&null!=F?new Date(F):F}}async _queryCount(e){const t=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:0};const r=this._createQuery();if(r.where=(0,_.mA)(r.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,t)),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);r.spatialRelationship=t.spatialRelationship,r.relationParameter=t.relationParameter,r.geometry=e.spatialFilter.geometry}return r.returnGeometry=!1,{calculated:!0,result:await this.executeQuery(r,"executeForCount")}}async canQueryAggregate(e){await this._ensureLoaded();let t=!1;const r=this._layer.capabilities?.query,i=!0===r?.supportsSqlExpression;if(null!=r&&!0===r.supportsStatistics&&!0===r.supportsOrderBy&&(t=!0),t)for(const r of e.statistics)(!1===r.workingexpr?.isStandardized||!1===(0,y.DA)(r.workingexpr)&&!1===i)&&(t=!1);return t}async queryAggregate(e){if(await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter)return h.An;const t=await this.databaseType(),r=e.groupBy,i=e.orderBy;let a=null;if(!this._layer.capabilities.query.supportsPaginationOnAggregatedQueries){const e=this.getFieldsIndex();a={keyFields:r.map((t,r)=>({name:e.normalizeFieldName(t)??t,asc:null==i||1===i._directions[r]}))}}let s=null,n=!1;null!=i&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(null==a||(0,m.MJ)(r,0,r.length,i._fields,0,Math.min(i._fields.length,r.length),(e,t)=>e.toLowerCase()===t.toLowerCase()))&&(s=i.toOrderByFields(),n=!0),null==s&&(s=r.slice());const l=e.statistics.map(e=>new v.A({onStatisticField:null!==e.workingexpr?(0,y.YY)(e.workingexpr,t):"",outStatisticFieldName:e.field,statisticType:e.toStatisticsName()}));let o=this._maxQueryRate();const u=this._layer.capabilities?.query.maxRecordCount;null!=u&&u<o&&(o=u);const c=null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,t),d=this._createQuery();if(d.where=(0,_.mA)(d.where,c),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);d.spatialRelationship=t.spatialRelationship,d.relationParameter=t.relationParameter,d.geometry=e.spatialFilter.geometry}return d.orderByFields=s,d.outFields=["*"],d.outStatistics=l,d.groupByFieldsForStatistics=r,d.returnGeometry=!1,null==a?{filterApplied:!0,spatialFilterApplied:!0,ordered:n,features:this._queryPaginated(d,o,null,e.abortSignal)}:{filterApplied:!0,spatialFilterApplied:!0,ordered:n,features:this._queryKeysetPaginated(d,a,e.abortSignal)}}async*_queryKeysetPaginated(e,t,r){const i=e.where;for(;;){if(null!=t.clause){if(!this._layer.capabilities.query.supportsOrderBy)throw new d.dr("NotImplemented");e.where=(0,_.mA)(i,(0,y.YY)(t.clause,await this.databaseType()))}const a=await this.executeQuery(e,"execute");if((0,d.dZ)(r),!a.hasOwnProperty("features"))throw new d.dr("InvalidStatResponse");if(yield a.features,0===a.features.length||!0!==a.exceededTransferLimit)break;T(t,a.features.at(-1))}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?"subtype-group"===this._layer.type&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const r="execute"===t?async e=>{const t=await this._layer.source.queryFeaturesJSON(e);return(0,h.Rn)(t.features,t.spatialReference??this.spatialReference.toJSON()),t}:"executeForCount"===t?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let i=null;if(this._recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);i=this._recentlyUsedQueries.getFromCache(t),null===i&&(i=r(e),this._recentlyUsedQueries.addToCache(t,i),i=i.catch(e=>{throw this._recentlyUsedQueries?.removeFromCache(t),e}))}return this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===i&&(i=r(e)),i}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType||"esriGeometryNull"===this._layer.geometryType}static create(e,t,r,i,a){const s=new F.default({url:e,outFields:null===t?["*"]:t});return new A({layer:s,spatialReference:r,lrucache:i,interceptor:a})}relationshipMetadata(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON?.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return(0,p.Qi)(this._layer.parsedUrl.path)}async queryAttachments(e,t,r,i,a){const s=this._layer;if(!function(e){const t=e.capabilities;return t?.data.supportsAttachment&&t?.operations.supportsQueryAttachments}(s))return[];const n=new I.A({objectIds:[e],returnMetadata:a});(t&&t>0||r&&r>0)&&(n.size=[t&&t>0?t:0,r&&r>0?r:t+1]),i&&i.length>0&&(n.attachmentTypes=i),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:s,query:n,method:"attachments"});const l=await s.queryAttachments(n);return l?.[e]?l[e].map(t=>{const r=`${this._layer.parsedUrl.path}/${e}/attachments/${t.id}`;let i=null;return a&&t.exifInfo&&(i=c.A.convertJsonToArcade(t.exifInfo,"system",!0)),new u.A(t.id,t.name,t.contentType,t.size,r,i,t.keywords??null)}):[]}async queryRelatedFeatures(e){const t=(0,b.dw)(e);t.f="json",this._requestStandardised&&(t.sqlFormat="standard"),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const r=await(0,i.A)(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(r.data){const e={},t=r.data;if(t?.relatedRecordGroups){const r=t.spatialReference,i=!0===t.exceededTransferLimit;for(const a of t.relatedRecordGroups)(0,h.Rn)(a.relatedRecords,r),e[a.objectId]={features:a.relatedRecords,exceededTransferLimit:i}}return e}throw new d.dr("InvalidRequest")}async getFeatureByObjectId(e,t){const r=this._createQuery();r.outFields=t,r.returnGeometry=!1,r.outSpatialReference=this.spatialReference,r.where=(0,_.mA)(r.where,this.objectIdField+"="+e.toString()),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:r,method:"execute"});const i=await this._layer.source.queryFeaturesJSON(r);return 1===i.features.length?((0,h.Rn)(i.features,i.spatialReference??this.spatialReference.toJSON()),i.features[0]):null}async getIdentityUser(){await this.load();const e=l.id?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=l.id?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl??"";let t=this._layer.url;const r=t.toLowerCase().indexOf("/rest/services");if(t=r>-1?t.slice(0,r):t,t){t+="/rest/info";try{const e=await(0,i.A)(t,{query:{f:"json"}});let r="";return e.data?.owningSystemUrl&&(r=e.data.owningSystemUrl),r}catch{return""}}return""}getDataSourceFeatureSet(){const e=new A({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this._recentlyUsedQueries??void 0,interceptor:this._featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this._featureSetInfo)return this._featureSetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const r=this._layer.parsedUrl?.path??null;if(r){const a=await(0,i.A)(r,{responseType:"json",query:{f:"json"}});e=a?.data?.name??null,t=a?.data?.serviceItemId??null}const a=this._layer.title&&null!==(this._layer.parent??null);return this._featureSetInfo={layerId:this._layer.layerId,layerName:""===e?null:e,itemId:""===t?null:t,serviceLayerUrl:""===r?null:r,webMapLayerId:a?this._layer.id??null:null,webMapLayerTitle:a?this._layer.title??null:null,className:null,objectClassId:null},this._featureSetInfo}}var R=r(30235);const C=new FinalizationRegistry(e=>{e.abort()});class M extends h.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerParquet",this._outFields=null,this._returnGeometry=!0,this._ignoreDefinitionExpression=!1,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),null!=e.outFields&&(this._outFields=e.outFields),null!=e.includeGeometry&&(this._returnGeometry=e.includeGeometry)}_maxQueryRate(){return p.gO}async loadImpl(){return this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,this.objectIdField=this._layer.objectIdField,null!==this._outFields)if(1===this._outFields.length&&"*"===this._outFields[0])this._outFields=null;else{const e=new Set(this._outFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._outFields=this.fields.map(({name:e})=>e)}this._databaseType=0}getDataSourceFeatureSet(){const e=new M({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._outFields??void 0,includeGeometry:this._returnGeometry});return e._ignoreDefinitionExpression=!0,e}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this._ignoreDefinitionExpression&&(e.where=null),e}isTable(){return this._layer.isTable}async _queryAll(){return(await this.query({abortSignal:o._})).features}async query(e){if(await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter)return h.An;const t={type:"arcade",returnGeometry:this._returnGeometry,outSpatialReference:(this.spatialReference??this._layer.spatialReference).toJSON(),outFields:Array.from(new Set(this._outFields??this._layer.fields.map(e=>e.name))),where:(0,_.mA)(this._ignoreDefinitionExpression?null:this._layer.definitionExpression,e.where?(0,y.YY)(e.where,0):null),extent:null};if(null!=e.spatialFilter)switch(e.spatialFilter.relation){case"esriSpatialRelIntersects":case"esriSpatialRelContains":case"esriSpatialRelOverlaps":case"esriSpatialRelWithin":case"esriSpatialRelTouches":case"esriSpatialRelCrosses":{const r=e.spatialFilter.geometry.extent;null!=r&&(t.extent=r.toJSON());break}}return{filterApplied:!0,spatialFilterApplied:!1,ordered:!1,features:await this._queryParquetStream(t,e.abortSignal)}}async _queryParquetStream(e,t){const r=new AbortController,i=await this._layer.source._queryStream(e,{signal:r.signal}),a=this._iterateParquetStream(i,r,t);return C.register(a,r,r),a}async*_iterateParquetStream(e,t,r){try{for(;;){const i=await this._layer.source._getStreamNextFeatures(e,{signal:t.signal});if(r.aborted&&(t.abort(),(0,d.dZ)(r)),null==i)break;(0,h.Rn)(i.features,i.spatialReference??this.spatialReference.toJSON()),yield i.features}}finally{C.unregister(t)}}async isEmpty(){return this._totalCount>=0?0===this._totalCount:(this._totalCount=await this._layer.queryFeatureCount(this._createQuery()),this._totalCount<=0)}async queryStat(e){await this._ensureLoaded();const t=(0,f.Dp)(e.stat);if("count"===t)return this._queryCount(e);const r=e.field;if(null==r)throw new d.dr("NeverReach");if(!0!==this._layer.capabilities?.query.supportsStatistics)return null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(e.stat,r,e.limit??p.gO,e.abortSignal);if("distinct"===t)return{calculated:!1};if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:null};const i=this._createQuery();if(i.returnGeometry=!1,i.where=(0,_.mA)(i.where,e.where?(0,y.YY)(e.where,0):null),null!=e.spatialFilter){const t=(0,h.rj)(e.spatialFilter.relation);i.spatialRelationship=t.spatialRelationship,i.relationParameter=t.relationParameter,i.geometry=e.spatialFilter.geometry}const a=new v.A;a.statisticType=t,a.onStatisticField=(0,y.YY)(r,0);const s="ARCADE_STAT_RESULT";a.outStatisticFieldName=s,i.outStatistics=[a];const n=await this._layer.source.queryFeaturesJSON(i);if(n.features.length<=0)throw new d.dr("InvalidStatResponse");const l=n.features[0].attributes[s];return{calculated:!0,result:"esriFieldTypeDate"===n.fields?.find(e=>e.name===s)?.type&&null!=l?new Date(l):l}}async _queryCount(e){if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:0};const t=this._createQuery();if(t.where=(0,_.mA)(t.where,e.where?(0,y.YY)(e.where,0):null),null!=e.spatialFilter){const r=(0,h.rj)(e.spatialFilter.relation);t.spatialRelationship=r.spatialRelationship,t.relationParameter=r.relationParameter,t.geometry=e.spatialFilter.geometry}return t.returnGeometry=!1,{calculated:!0,result:await this._layer.queryFeatureCount(t)}}async canQueryAggregate(e){await this._ensureLoaded();const t=this._layer.capabilities?.query;return!0===t?.supportsStatistics&&null==e.spatialFilter}async queryAggregate(e){await this._ensureLoaded();const t=this._createQuery();return t.where=(0,_.mA)(t.where,e.where?(0,y.YY)(e.where,0):null),t.orderByFields=e.orderBy?.toOrderByFields(),t.outFields=["*"],t.outStatistics=e.statistics.map(e=>new v.A({onStatisticField:null!==e.workingexpr?(0,y.YY)(e.workingexpr,0):"",outStatisticFieldName:e.field,statisticType:e.toStatisticsName()})),t.groupByFieldsForStatistics=e.groupBy,t.returnGeometry=!1,{filterApplied:!0,spatialFilterApplied:!0,ordered:null!=e.orderBy,features:async function*(){const r=await this._layer.source.queryFeaturesJSON(t);(0,d.dZ)(e.abortSignal);for(const e of(0,m.Ho)(r.features,this._maxQueryRate()))(0,h.Rn)(e,r.spatialReference??this.spatialReference.toJSON()),yield e}.apply(this)}}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}async queryAttachments(){return[]}serviceUrl(){return""}relationshipMetadata(){return[]}get gdbVersion(){return""}getFeatureByObjectId(){throw new d.dr("NeverReach")}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return null}get dateFieldsTimeZone(){return null}get datesInUnknownTimezone(){return!1}get editFieldsInfo(){return null}get timeInfo(){return null}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}var L=r(26591);class j extends h.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._removeGeometry=!1,this._overrideFields=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),this._findObjectId=e.objectId,this.relationship=e.relationship,this._relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return p.gO}async loadImpl(){return await Promise.all([this._layer.load(),this._relatedLayer.load()]),this._initialiseFeatureSet(),this}nativeCapabilities(){return this._relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._relatedLayer.geometryType,this.fields=this._relatedLayer.fields.slice(),this.hasZ=this._relatedLayer.hasZ,this.hasM=this._relatedLayer.hasM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType),this.objectIdField=this._relatedLayer.objectIdField,this.globalIdField=this._relatedLayer.globalIdField,this.hasM=this._relatedLayer.supportsM,this.hasZ=this._relatedLayer.supportsZ,this.typeIdField=this._relatedLayer.typeIdField,this.types=this._relatedLayer.types,this.subtypeField=this._relatedLayer.subtypeField,this.subtypes=this._relatedLayer.subtypes}async databaseType(){return this._databaseType=await this._relatedLayer.databaseType(),this._databaseType}isTable(){return this._relatedLayer.isTable()}async _queryAll(){return(await this.query({abortSignal:o._})).features}async query(e){if(await this._ensureLoaded(),await this.databaseType(),this.isTable()&&null!=e.spatialFilter)return h.An;const t=this._layer.nativeCapabilities();if(!1===t.canQueryRelated)return h.An;if(t.capabilities?.queryRelated.supportsPagination)return this._queryUsingPaging(t.source,e);let r=null,i=!1;null!=e.orderBy&&t.capabilities?.queryRelated.supportsOrderBy&&(r=e.orderBy.toOrderByFields(),i=!0);const a=new L.default;return a.objectIds=[this._findObjectId],a.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]),a.relationshipId=this.relationship.id,a.where="1=1",a.returnGeometry=!0!==this._removeGeometry,a.outSpatialReference=this.spatialReference,a.orderByFields=r,{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:i,features:async function*(){const r=await t.source.queryRelatedFeatures(a);(0,d.dZ)(e.abortSignal),yield r[this._findObjectId]?r[this._findObjectId].features:[]}.apply(this)}}async _queryUsingPaging(e,t){let r=null==t.where&&null==t.spatialFilter,i=null,a=!1;const s=this._layer.nativeCapabilities();null!=t.orderBy&&(s.capabilities?.queryRelated.supportsOrderBy?(i=t.orderBy.toOrderByFields(),a=!0):r=!1),await this.databaseType();let n=this._maxQueryRate();const l=s.capabilities?.query.maxRecordCount;null!=l&&l<n&&(n=l);const o=new L.default;return o.relationshipId=this.relationship.id,o.objectIds=[this._findObjectId],o.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]),o.where="1=1",o.orderByFields=i,o.returnGeometry=!0!==this._removeGeometry,o.outSpatialReference=this.spatialReference,{filterApplied:null==t.where,spatialFilterApplied:null==t.spatialFilter,ordered:a,features:this._queryPaginated(e,o,n,r?t.limit:null,t.abortSignal)}}async*_queryPaginated(e,t,r,i,a){let s;t.num=null!=i?Math.min(i,r):r,t.start=0;do{(0,d.dZ)(a),s=(await e.queryRelatedFeatures(t))[this._findObjectId]??{exceededTransferLimit:!1,features:[]},yield s.features,t.start+=s.features.length,t.num=null!=i?Math.min(i-t.start,r):r}while(!0===s.exceededTransferLimit)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new d.dr("NeverReach")}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}get gdbVersion(){return this._relatedLayer.gdbVersion}relationshipMetadata(){return this._relatedLayer.relationshipMetadata()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,r,i,a){return this._relatedLayer.queryAttachments(e,t,r,i,a)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer.editFieldsInfo??null}get timeInfo(){return this._relatedLayer.timeInfo??null}getFeatureSetInfo(){return this._relatedLayer.getFeatureSetInfo()}}var x=r(23732),O=r(92474),k=r(4146),q=r(99680),Z=r(89160),U=r(80812);function N(){null===x.A.applicationCache&&(x.A.applicationCache=new x.A)}async function P(e,t,r){if(x.A.applicationCache){const r=x.A.applicationCache.getLayerInfo(e);if(r){const i=await r;return new F.default({url:e,outFields:t,sourceJSON:i})}const i=new F.default({url:e,outFields:t}),a=(async()=>(await i.load(),i.sourceJSON))();if(x.A.applicationCache){x.A.applicationCache.setLayerInfo(e,a);try{return await a,i}catch(t){throw x.A.applicationCache.clearLayerInfo(e),t}}return await a,i}if(null!=r){const i=r.getCachedLayerMetadata(e);if(i){const r=await i;return new F.default({url:e,outFields:t,sourceJSON:r})}const a=new F.default({url:e,outFields:t}),s=(async()=>(await a.load(),a.sourceJSON))();r.setCachedLayerMetadata(e,s);try{return await s,a}catch(t){throw r.removeCachedLayerMetadata(e,s),t}}return new F.default({url:e,outFields:t})}async function D(e,t,r,i,a,s=null){return E(await P(e,["*"],a),t,r,i,a,s)}function E(e,t=null,r=null,i=!0,a=null,s=null){switch(e.type){case"catalog-footprint":return E(e.parent,t,r,i,a,s);case"subtype-sublayer":{const l=E(e.parent,t,r,i,a,s);return new n.A({parentfeatureset:l,whereclause:w.A.create(e.parent.subtypeField+"="+e.subtypeCode.toString(),{fieldsIndex:e.parent.fieldsIndex,timeZone:l.dateFieldsTimeZoneDefaultUTC})})}case"csv":case"geojson":case"knowledge-graph-sublayer":case"wfs":return new R.A({layer:e,spatialReference:t,outFields:r,includeGeometry:i,lrucache:a,interceptor:s});case"parquet":return new M({layer:e,spatialReference:t,outFields:r,includeGeometry:i});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const n={layer:e,spatialReference:t,outFields:r,includeGeometry:i,lrucache:a,interceptor:s};return!e.url&&e.source?new R.A(n):new A(n)}default:throw new Error(`Unsupported layer type: ${e.type}`)}}async function B(e,t){if(null!==x.A.applicationCache){const t=x.A.applicationCache.getLayerInfo(e);if(null!==t)return t}if(null!=t){const r=t.getCachedServiceMetadata(e);if(null!=r)return r}const r=(async()=>{const t=await(0,i.A)(e,{responseType:"json",query:{f:"json"},authMode:"no-prompt"});if(t.data){const e=t.data;return e.layers||(e.layers=[]),e.tables||(e.tables=[]),e}return{layers:[],tables:[]}})();if(null!==x.A.applicationCache){x.A.applicationCache.setLayerInfo(e,r);try{return await r}catch(t){throw x.A.applicationCache.clearLayerInfo(e),t}}if(null!=t){t.setCachedServiceMetadata(e,r);try{return await r}catch(i){throw t.removeCachedServiceMetadata(e,r),i}}return r}async function G(e,t,r){const a={metadata:null,networkId:-1,unVersion:3,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map,queryelem:null,layerNameLkp:{},lkp:null},s=await B(e,null);if(a.metadata=s,void 0!==s.controllerDatasetLayers?.utilityNetworkLayerId&&null!==s.controllerDatasetLayers.utilityNetworkLayerId){if(s.layers)for(const e of s.layers)a.layerNameLkp[e.id]=e.name;if(s.tables)for(const e of s.tables)a.layerNameLkp[e.id]=e.name;const l=s.controllerDatasetLayers.utilityNetworkLayerId;a.networkId=l;const o=await async function(e,t){const r="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==x.A.applicationCache){const e=x.A.applicationCache.getLayerInfo(r);if(null!==e)return e}const a=(async()=>{const r=await(0,i.A)(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}});if(r.data){const e=r.data;if(e.layerDataElements?.[0])return e.layerDataElements[0]}throw new d.dr("DataElementsNotFound")})();if(null!==x.A.applicationCache){x.A.applicationCache.setLayerInfo(r,a);try{return await a}catch(e){throw x.A.applicationCache.clearLayerInfo(r),e}}return a}(e,l);if(o){a.queryelem=o,a.queryelem?.dataElement&&void 0!==a.queryelem.dataElement.schemaGeneration&&(a.unVersion=a.queryelem.dataElement.schemaGeneration),a.lkp={},a.queryelem.dataElement.domainNetworks||(a.queryelem.dataElement.domainNetworks=[]);for(const e of a.queryelem.dataElement.domainNetworks){for(const t of e.edgeSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:a.layerNameLkp[t.layerId]??null};a.layerIdLookup.set(e.layerId,e),a.sourceIdLookup.set(e.sourceId,e),e.className&&(a.lkp[e.className]=e)}for(const t of e.junctionSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:a.layerNameLkp[t.layerId]??null};a.layerIdLookup.set(e.layerId,e),a.sourceIdLookup.set(e.sourceId,e),e.className&&(a.lkp[e.className]=e)}}if(a.queryelem.dataElement.terminalConfigurations)for(const e of a.queryelem.dataElement.terminalConfigurations)for(const t of e.terminals)a.terminals.push({terminalId:t.terminalId,terminalName:t.terminalName});const s=await async function(e){if(null!==x.A.applicationCache){const t=x.A.applicationCache.getLayerInfo(e);if(null!==t)return t}const t=(async()=>{const t=await(0,i.A)(e,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(null!==x.A.applicationCache){x.A.applicationCache.setLayerInfo(e,t);try{return await t}catch(t){throw x.A.applicationCache.clearLayerInfo(e),t}}return t}(e+"/"+l);if(void 0!==s.systemLayers?.associationsTableId&&null!==s.systemLayers.associationsTableId){let i=null;if(r&&a.unVersion<8){const r=[];a.unVersion>=4&&(r.push("STATUS"),r.push("PERCENTALONG")),i=await D(e+"/"+s.systemLayers.associationsTableId,t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...r],!1,null,null),await i.load(),a.unVersion>=4&&(i=new n.A({parentfeatureset:i,whereclause:w.A.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC})}),await i.load())}return{lkp:a.lkp,associations:i,unVersion:a.unVersion,terminals:a.terminals,layerIdLookup:a.layerIdLookup,sourceIdLookup:a.sourceIdLookup}}return{associations:null,unVersion:a.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:a.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:a.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}async function Q(e,t,r,i=null,a=null,s=!0,n=null,l=null){let o=e.serviceUrl();if(!o)return null;o=o.endsWith("/")?o+t.relatedTableId.toString():o+"/"+t.relatedTableId.toString();const u=await D(o,i,a,s,n,l);return new j({layer:e,relatedLayer:u,relationship:t,objectId:r,spatialReference:i,outFields:a,includeGeometry:s,lrucache:n,interceptor:l})}class J extends a{constructor(e,t=null,r=null,i=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=r,this._interceptor=i,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,r=null){const i=E(e,this._overrideSpatialReference,null===r?["*"]:r,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),i}async listAll(){(0,O.Zm)(this._map)&&!this._map.loaded&&await this._map.load();const e=this._map.allLayers.toArray().filter(e=>(0,p.eB)(e)).map(e=>({id:e.id,name:e.title})),t=this._map.allTables.toArray().filter(e=>(0,p.eB)(e)).map(e=>({id:e.id,name:e.title}));return e.concat(t)}async featureSetByName(e,t=!0,r=null){if((0,O.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,r);null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const a=this._instantLayers[r];if(a.opitem.title===e&&a.includeGeometry===t&&a.outFields===i)return this._instantLayers[r].featureset}const a=this._map.allLayers.find(t=>(0,p.eB)(t)&&t.title===e);if(null!=a)return this._makeAndAddFeatureSet(a,t,r);if(this._map.allTables){const i=this._map.allTables.find(t=>(0,p.eB)(t)&&t.title===e);if(null!=i)return this._makeAndAddFeatureSet(i,t,r)}return null}async featureSetById(e,t=!0,r=["*"]){if((0,O.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,r);null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const a=this._instantLayers[r];if(a.opitem.id===e&&a.includeGeometry===t&&a.outFields===i)return this._instantLayers[r].featureset}const a=this._map.allLayers.find(t=>(0,p.eB)(t)&&t.id===e);if(a)return this._makeAndAddFeatureSet(a,t,r);if(this._map.allTables){const i=this._map.allTables.find(t=>(0,p.eB)(t)&&t.id===e);if(null!=i)return this._makeAndAddFeatureSet(i,t,r)}return null}}class $ extends a{constructor(e,t=null,r=null,i=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=r,this._interceptor=i,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,r=null){const i=E(e,this._overrideSpatialReference,null===r?["*"]:r,t,this._lrucache);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),i}async _loadMetaData(){const e=await B(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new $(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async listAll(){const e=await this._loadMetaData();return e.layers.concat(e.tables)}async featureSetByName(e,t=!0,r=null){null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const a=this._instantLayers[r];if(a.opitem.title===e&&a.includeGeometry===t&&a.outFields===i)return this._instantLayers[r].featureset}const a=await this._loadMetaData();let s=null;for(const t of a.layers??[])t.name===e&&(s=t);if(!s)for(const t of a.tables??[])t.name===e&&(s=t);if(s){const e=await P(this._url+"/"+s.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,r)}return null}async featureSetById(e,t=!0,r=["*"]){null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);e=null!=e?e.toString():"";for(let r=0;r<this._instantLayers.length;r++){const a=this._instantLayers[r];if(a.opitem.id===e&&a.includeGeometry===t&&a.outFields===i)return this._instantLayers[r].featureset}const a=await this._loadMetaData();let s=null;for(const t of a.layers??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(s=t);if(!s)for(const t of a.tables??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(s=t);if(s){const e=await P(this._url+"/"+s.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,r)}return null}}function V(e,t,r=null,i=null){return new J(e,t,r,i)}function Y(e,t,r=null,i=null){return new $(e,t,r,i)}function K(e,t,r,i,a){if(null===e)return null;if((0,s.m)(e)){switch(t){case"datasource":return e.getDataSourceFeatureSet();case"parent":return e;case"root":return e.getRootFeatureSet()}return null}if(e instanceof k.A&&(0,p.eB)(e)){switch(t){case"datasource":return E(e,a,"outFields"in e?e.outFields:null,!0,r,i).getDataSourceFeatureSet();case"parent":case"root":return E(e,a,"outFields"in e?e.outFields:null,!0,r,i)}return null}if((0,s.a4)(e)){switch(t){case"datasource":return E(e.parent,a,e.parent.outFields,!0,r,i).getDataSourceFeatureSet();case"parent":case"root":return E(e,a,e.parent.outFields,!0,r,i)}return null}return null}async function z(e,t,r,i,a,s,n,l=null){if(x.A.applicationCache){const o=x.A.applicationCache.getLayerInfo(e+":"+s.url);if(o)return W(await o,t,r,i,a,n,l)}if(null!=n){const o=n.getCachedPortalItem(s.url,e);if(null!=o)return await W(await o,t,r,i,a,n,l)}const o=new U.default({id:e,portal:s}).load();x.A.applicationCache?x.A.applicationCache.setLayerInfo(e+":"+s.url,o):null!=n&&n.setCachedPortalItem(s.url,e,o);try{return await W(await o,t,r,i,a,n,l)}catch(t){throw x.A.applicationCache&&x.A.applicationCache.clearLayerInfo(e+":"+s.url),null!=n&&n.removeCachedPortalItem(s.url,e,o),t}}const H=new Set(["Apache Parquet","Parquet layer","Parquet Layer","Parquet feature layer","Parquet Feature Layer"]);async function W(e,t,r,i,a,s,n){let l;if("Feature Service"===e.type||"Map Service"===e.type)l=await P((0,p.Qi)(e.url??"")+"/"+t,["*"],s);else{if(t)throw new Error(`layerId=${t} provided for ${e.type} item`);if(null!=s){const t=s.getCachedPortalItemLayer(e.portal.url,e.id);if(null!=t)l=await t;else{const t=H.has(e.type)?Promise.resolve(new q.default({data:new Z.A({portalItem:e})})):k.A.fromPortalItem(e);s.setCachedPortalItemLayer(e.portal.url,e.id,t);try{l=await t}catch(r){throw s.removeCachedPortalItemLayer(e.portal.url,e.id,t),r}}}else l=H.has(e.type)?new q.default({data:new Z.A({portalItem:e})}):await k.A.fromPortalItem(e)}return E(l,r,i,a,s,n)}},35704(e,t,r){r.d(t,{A:()=>u});var i=r(48938),a=r(87449),s=r(11221),n=r(33325),l=r(80609),o=r(89696);class u extends s.t1{constructor(e){super(),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof o.A?(this._whereClause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereClause=null)}_initialiseFeatureSet(){this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes}async _queryAll(){return(await this.query({abortSignal:i._})).features}async query(e){let t=e.where,r=!0;null!==this._whereClauseFunction?r=!1:null!=t?null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,t)):t=this._whereClause,await this._ensureLoaded();const i=await this._parent.query({...e,where:t,limit:r?e.limit:null});return(0,a.dZ)(e.abortSignal),i.filterApplied&&null==this._whereClauseFunction?i:{...i,features:this._applyFilter(i.features,e.abortSignal)}}async*_applyFilter(e,t){for await(const r of e)if((0,a.dZ)(t),null!=this._whereClause){const e=r.filter(e=>this._whereClause.testFeature(e));e.length>0&&(yield e)}else if(null!=this._whereClauseFunction){const e=[];for(const t of r)await this._whereClauseFunction(t)&&e.push(t);e.length>0&&(yield e)}else yield r}async queryStat(e){if(null!==this._whereClauseFunction)return null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??n.gO,e.abortSignal):{calculated:!1};let t=this._whereClause;null!=e.where&&null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,e.where));const r=await this._parent.queryStat({...e,where:t});return r.calculated?r:null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??n.gO,e.abortSignal):{calculated:!1}}async canQueryAggregate(e){if(null!==this._whereClauseFunction)return!1;let t=e.where;return null!=t?null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,t)):t=this._whereClause,this._parent.canQueryAggregate({...e,where:t})}async queryAggregate(e){let t=e.where;return null!=t?null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,t)):t=this._whereClause,this._parent.queryAggregate({...e,where:t})}getFieldsIndex(){return this._parent.getFieldsIndex()}}},30235(e,t,r){r.d(t,{A:()=>y});var i=r(48938),a=r(87449),s=r(11221),n=r(33325),l=r(80609),o=r(4576),u=r(39516),c=r(91075),d=r(53781),h=r(33143),p=r(20437);class y extends s.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return n.gO}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||this._layer.objectIdField===r||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this._databaseType=0,this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType}async _queryAll(){return(await this.query({abortSignal:i._})).features}_queryLayerFeaturesJSON(e){return"queryFeaturesJSON"in this._layer?this._layer.queryFeaturesJSON(e):this._layer.source.queryFeaturesJSON(e)}async query(e){await this._ensureLoaded();let t=null,r=!1;if(null!=e.orderBy&&(t=e.orderBy.toOrderByFields(),r=!0),this.isTable()&&null!=e.spatialFilter)return s.An;const i=this._createQuery();return i.where=(0,u.mA)(i.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,l.YY)(e.where,0)),null!=e.spatialFilter&&(i.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),i.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),i.geometry=e.spatialFilter.geometry),i.outSpatialReference=this.spatialReference,i.orderByFields=t,i.num=e.limit,{filterApplied:!0,spatialFilterApplied:!0,ordered:r,features:async function*(){const t=await this._queryLayerFeaturesJSON(i);(0,a.dZ)(e.abortSignal);for(const e of(0,o.Ho)(t.features,this._maxQueryRate()))(0,s.Rn)(e,t.spatialReference??this.spatialReference.toJSON()),yield e}.apply(this)}}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new a.dr("NeverReach")}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,e.outFields=this._overrideFields??["*"],e.returnGeometry=!this._removeGeometry,e}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}relationshipMetadata(){return[]}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let r=e.layerDefinition.objectIdField;const i=e.layerDefinition.typeIdField??"",a=[];if(e.layerDefinition.types)for(const t of e.layerDefinition.types)a.push(h.A.fromJSON(t));let s=e.layerDefinition.geometryType;void 0===s&&(s=e.featureSet.geometryType||"");let n=e.featureSet.features;if(!r){let t=!1;for(const i of e.layerDefinition.fields)if("oid"===i.type||"esriFieldTypeOID"===i.type){r=i.name,t=!0;break}if(!1===t){let t="FID",i=!0,a=0;for(;i;){let r=!0;for(const i of e.layerDefinition.fields)if(i.name===t){r=!1;break}!0===r?i=!1:(a++,t="FID"+a.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});const s=[];for(let r=0;r<n.length;r++)s.push({geometry:e.featureSet.features[r].geometry,attributes:{...e.featureSet.features[r].attributes,[t]:r}});n=s,r=t}}const l=[];for(const t of e.layerDefinition.fields)t instanceof p.A?l.push(t):l.push(p.A.fromJSON(t));let o=s;switch(o||(o=""),o){case"esriGeometryPoint":o="point";break;case"esriGeometryPolyline":o="polyline";break;case"esriGeometryPolygon":o="polygon";break;case"esriGeometryEnvelope":o="extent";break;case"esriGeometryMultipoint":o="multipoint";break;case"":case"esriGeometryNull":o="esriGeometryNull"}if("esriGeometryNull"!==o){const e=t.toJSON();for(const t of n)t.geometry&&t.geometry instanceof c.A==0&&(t.geometry.type=o,void 0===t.geometry.spatialReference&&(t.geometry.spatialReference=e))}else for(const e of n)e.geometry&&(e.geometry=null);const u={outFields:["*"],source:n,fields:l,hasZ:!0===e.layerDefinition.hasZ||!0===e.featureSet.hasZ,hasM:!0===e.layerDefinition.hasM||!0===e.featureSet.hasM,types:a,typeIdField:i,objectIdField:r,spatialReference:t},f="esriGeometryNull"===o||null===o;f||(u.geometryType=o);const m=new d.default(u);return e.layerDefinition.subtypeField&&e.layerDefinition.subtypes&&m.read({subtypes:e.layerDefinition.subtypes,subtypeField:e.layerDefinition.subtypeField}),new y({layer:m,spatialReference:t,isTable:f})}async queryAttachments(){return[]}async getFeatureByObjectId(e){const t=this._createQuery();t.where=this.objectIdField+"="+e.toString();const r=await this._queryLayerFeaturesJSON(t);return 1===r.features.length?((0,s.Rn)(r.features,r.spatialReference??this.spatialReference.toJSON()),r.features[0]):null}serviceUrl(){return""}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return"preferredTimeZone"in this._layer?this._layer.preferredTimeZone:null}get dateFieldsTimeZone(){return"dateFieldsTimeZone"in this._layer?this._layer.dateFieldsTimeZone:null}get datesInUnknownTimezone(){return"datesInUnknownTimezone"in this._layer&&this._layer.datesInUnknownTimezone}get editFieldsInfo(){return"editFieldsInfo"in this._layer?this._layer.editFieldsInfo:null}get timeInfo(){return"timeInfo"in this._layer?this._layer.timeInfo:null}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}},16494(e,t,r){r.d(t,{Nd:()=>l,W5:()=>n});var i=r(17632);const a=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce((e,t)=>(e[t]=[],e),{}),s=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],n=new i.I({whiteList:a,onTagAttr:(e,t,r)=>{const i=`${t}="${r}"`;if(s.includes(t))return i},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),l=new i.I({whiteList:{br:[]},stripIgnoreTag:!0,escapeHtml:e=>e},!1)},159(e,t,r){r.d(t,{A:()=>u});var i,a=r(5482),s=r(69540),n=r(25482),l=r(91429),o=r(99157);let u=i=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.steps=[]}getInverse(){const e=new i;for(let t=this.steps.length-1;t>=0;t--){const r=this.steps[t];e.steps.push(r.getInverse())}return e}};(0,a.Cg)([(0,l.MZ)({type:[o.A],nonNullable:!0,json:{name:"geoTransforms"}})],u.prototype,"steps",void 0),u=i=(0,a.Cg)([(0,l.$K)("esri.geometry.operators.support.GeographicTransformation")],u)},99157(e,t,r){r.d(t,{A:()=>o});var i,a=r(5482),s=r(69540),n=r(25482),l=r(91429);let o=i=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new i({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,a.Cg)([(0,l.MZ)({json:{name:"transformForward",read:e=>!e,write:(e,t,r)=>{t[r]=!e}}})],o.prototype,"isInverse",void 0),(0,a.Cg)([(0,l.MZ)({json:{write:!0}})],o.prototype,"wkt",void 0),(0,a.Cg)([(0,l.MZ)({json:{write:!0}})],o.prototype,"wkid",void 0),o=i=(0,a.Cg)([(0,l.$K)("esri.geometry.operators.support.GeographicTransformationStep")],o)},9762(e,t,r){r.r(t),r.d(t,{projectBuffer:()=>a});var i=r(49208);function a(e,t,r,a,s,n,l=Math.floor(e.length/3)){const o=(0,i.jd)(t,s);if(null==o)return!1;if(o===i.pO){if(e===a&&r===n)return!0;const t=r+3*l;for(let i=r,s=n;i<t;i++,s++)a[s]=e[i]??0;return!0}const u=r+3*l;for(let t=r,i=n;t<u;t+=3,i+=3)o(e,t,a,i);return!0}},49208(e,t,r){r.d(t,{Tp:()=>d,jd:()=>c,pO:()=>p,w5:()=>u});var i=r(34727),a=r(86211),s=r(73941),n=r(79258),l=r(34403),o=r(21325);const u={2:{5:p,7:null,9:null,10:p,1:b,6:null,8:null,0:null,3:f,11:m,2:p,4:A},5:{5:p,7:null,9:null,10:p,1:b,6:null,8:null,0:null,3:f,11:m,2:p,4:A},7:{5:null,7:p,9:null,10:p,1:null,6:F,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:p,10:p,1:null,6:null,8:w,0:null,3:null,11:null,2:null,4:null},3:{5:y,7:null,9:null,10:y,1:function(e,t,r,i){const a=e[t]/x,s=j-2*Math.atan(Math.exp(-e[t+1]/x)),n=x+(e[t+2]??0),l=Math.cos(s)*n;r[i]=Math.cos(a)*l,r[i+1]=Math.sin(a)*l,r[i+2]=Math.sin(s)*n},6:null,8:null,0:null,3:p,11:function(e,t,r,i){y(e,t,r,i),m(r,i,r,i)},2:y,4:function(e,t,r,i){y(e,t,r,i),A(r,i,r,i)}},4:{5:R,7:null,9:null,10:R,1:function(e,t,r,i){R(e,t,r,i),b(r,i,r,i)},6:null,8:null,0:null,3:function(e,t,r,i){R(e,t,r,i),f(r,i,r,i)},11:function(e,t,r,i){R(e,t,r,i),m(r,i,r,i)},2:R,4:p},1:{5:T,7:null,9:null,10:T,1:p,6:null,8:null,0:null,3:function(e,t,r,i){T(e,t,r,i),f(r,i,r,i)},11:function(e,t,r,i){T(e,t,r,i),m(r,i,r,i)},2:T,4:function(e,t,r,i){T(e,t,r,i),A(r,i,r,i)}},6:{5:null,7:v,9:null,10:v,1:null,6:p,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:S,10:S,1:null,6:null,8:p,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:p,3:null,11:null,2:null,4:null},10:{5:p,7:p,9:p,10:p,1:b,6:F,8:w,0:null,3:f,11:m,2:p,4:A},11:{5:g,7:null,9:null,10:g,1:function(e,t,r,i){g(e,t,r,i),b(r,i,r,i)},6:null,8:null,0:null,3:function(e,t,r,i){g(e,t,r,i),f(r,i,r,i)},11:p,2:g,4:function(e,t,r,i){g(e,t,r,i),A(r,i,r,i)}}};function c(e,t){return d(e,t)?.projector}function d(e,t){if(null==e||null==t)return null;if(C.source.spatialReference===e&&C.dest.spatialReference===t)return C;const r=h(e,C.source),i=h(t,C.dest);return 0===r&&0===i?(0,o.aI)(e,t)?C.projector=p:C.projector=null:C.projector=u[r][i],C}function h(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,a.GA)(e,1)),(0,s.jA)(e)?t.spatialReferenceId=1:(0,o.oT)(e)?t.spatialReferenceId=2:(0,o.K8)(e)?t.spatialReferenceId=3:(0,o.r1)(e)?t.spatialReferenceId=11:e.wkt===s.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===s.FY.wkt?t.spatialReferenceId=6:e.wkt===s.LJ.wkt?t.spatialReferenceId=8:(0,s.q8)(e)?t.spatialReferenceId=7:(0,s.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function p(e,t,r,i){e!==r&&(r[i++]=e[t++],r[i++]=e[t++],r[i]=e[t]??0)}function y(e,t,r,i){r[i]=L*(e[t]/x),r[i+1]=L*(j-2*Math.atan(Math.exp(-e[t+1]/x))),r[i+2]=e[t+2]??0}function f(e,t,r,a){!function(e,t,r,a,s){const n=.4999999*Math.PI,l=(0,i.qE)(M*e[t+1],-n,n),o=Math.sin(l);r[a++]=M*e[t]*s.radius,r[a++]=s.halfSemiMajorAxis*Math.log((1+o)/(1-o)),r[a]=e[t+2]??0}(e,t,r,a,n.$O)}function m(e,t,r,i){r[i]=e[t]*O,r[i+1]=e[t+1]*O,r[i+2]=e[t+2]??0}function g(e,t,r,i){r[i]=e[t]*k,r[i+1]=e[t+1]*k,r[i+2]=e[t+2]??0}function _(e,t,r,i,a){const s=a+(e[t+2]??0),n=M*e[t],l=M*e[t+1],o=Math.cos(l)*s;r[i]=Math.cos(n)*o,r[i+1]=Math.sin(n)*o,r[i+2]=Math.sin(l)*s}function w(e,t,r,i){_(e,t,r,i,n.Sw.radius)}function F(e,t,r,i){_(e,t,r,i,n.sH.radius)}function b(e,t,r,i){_(e,t,r,i,n.$O.radius)}function I(e,t,r,a,s){const n=e[t],l=e[t+1],o=e[t+2]??0,u=Math.sqrt(n*n+l*l+o*o),c=(0,i.YN)(o/(0===u?1:u)),d=Math.atan2(l,n);r[a++]=L*d,r[a++]=L*c,r[a]=u-s}function S(e,t,r,i){I(e,t,r,i,n.Sw.radius)}function v(e,t,r,i){I(e,t,r,i,n.sH.radius)}function T(e,t,r,i){I(e,t,r,i,n.$O.radius)}function A(e,t,r,i){!function(e,t,r,i,a){const s=M*e[t],n=M*e[t+1],l=e[t+2]??0,o=Math.sin(n),u=Math.cos(n),c=a.radius/Math.sqrt(1-a.eccentricitySquared*o*o);r[i++]=(c+l)*u*Math.cos(s),r[i++]=(c+l)*u*Math.sin(s),r[i++]=(c*(1-a.eccentricitySquared)+l)*o}(e,t,r,i,n.$O)}function R(e,t,r,i){const a=l.TP,s=e[t],o=e[t+1],u=e[t+2]??0;let c,d,h,p,y,f,m,g,_,w,F,b,I,S,v,T,A,R,C,M,j;c=Math.abs(u),d=s*s+o*o,h=Math.sqrt(d),p=d+u*u,y=Math.sqrt(p),M=Math.atan2(o,s),f=u*u/p,m=d/p,S=a.a2/y,v=a.a3-a.a4/y,m>.3?(g=c/y*(1+m*(a.a1+S+f*v)/y),C=Math.asin(g),w=g*g,_=Math.sqrt(1-w)):(_=h/y*(1-f*(a.a5-S-m*v)/y),C=Math.acos(_),w=1-_*_,g=Math.sqrt(w)),F=1-n.$O.eccentricitySquared*w,b=n.$O.radius/Math.sqrt(F),I=a.a6*b,S=h-b*_,v=c-I*g,A=_*S+g*v,T=_*v-g*S,R=T/(I/F+A),C+=R,j=A+T*R/2,u<0&&(C=-C),r[i++]=L*M,r[i++]=L*C,r[i]=j}const C={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:p},M=(0,i.kU)(1),L=(0,i.KJ)(1),j=.5*Math.PI,x=n.$O.radius,O=x*Math.PI/180,k=180/(x*Math.PI)},91218(e,t,r){r.r(t),r.d(t,{canProjectWithoutEngine:()=>$,initializeProjection:()=>Y,isEqualBaseGCS:()=>V,isLoaded:()=>x,isLoadedOrLoad:()=>O,isLoadedOrLoadFor:()=>k,load:()=>Z,project:()=>U,projectAsync:()=>J,projectExtent:()=>ae,projectMany:()=>N,projectMultipoint:()=>W,projectOrLoad:()=>D,projectOrLoadMany:()=>E,projectPoint:()=>z,projectPolygon:()=>re,projectPolyline:()=>ee,projectWithoutEngine:()=>K,requiresLoad:()=>q,test:()=>Q,tryProject:()=>P,unload:()=>G});var i=r(49186),a=r(17676),s=r(62788),n=r(95488),l=r(51850),o=r(21276),u=r(73941),c=r(5443),d=r(91075),h=r(48526),p=r(86738),y=r(39829),f=r(82799),m=r(16930),g=r(98764),_=r(159),w=r(9762),F=r(49208);function b(e,t,r,i,a,s){return I[0]=e,I[1]=t,I[2]=r,(0,w.projectBuffer)(I,i,0,a,s,0)}const I=(0,l.vt)();var S=r(60408),v=r(21325),T=r(52006);let A=null,R=null,C=null,M=null,L={};const j=new n.I;function x(){return!!(R?.isLoaded()&&C?.isLoaded()&&M?.isLoaded())}function O(){return!!x()||((0,s.gc)(j),Z(),!1)}function k(e,t){return!e||!t||$(e,t)||O()}function q(e,t){return!$(e,t)&&!x()}async function Z(e){null==A&&(A=Promise.all([r.e(3276).then(r.bind(r,83276)).then(e=>(R=e,R.load())),r.e(8377).then(r.bind(r,8377)).then(e=>(C=e,C.load())),r.e(2158).then(r.bind(r,12158)).then(e=>(M=e,M.load()))])),await A,(0,a.Te)(e),j.notify()}function U(e,t,r){return Array.isArray(e)?0===e.length?[]:((0,o.H)(e),N(e,e[0].spatialReference,t,r)):((0,o.f)(e),N([e],e.spatialReference,t,r)[0])}function N(e,t,r,i){if(null==t||null==r)return e;if($(t,r,i))return e.map(e=>K(e,t,r));if(null==i?.geographicTransformation&&(0,u.jA)(t))return N(e.map(e=>K(e,t,m.A.WGS84)),m.A.WGS84,r,{zConversionDisabled:i?.zConversionDisabled});if(null==i?.geographicTransformation&&(0,u.jA)(r))return N(e,t,m.A.WGS84).map(e=>K(e,m.A.WGS84,r));if(!x())throw new B;if(!i?.geographicTransformation)if(i?.extendedParams)i={...i,geographicTransformation:M.getTransformation(t,r,i.areaOfInterestExtent)||new _.A};else if(!i?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,r);let a=L[e];a||(a=M.getTransformation(t,r)||new _.A,L[e]=a),i={geographicTransformation:a,zConversionDisabled:i?.zConversionDisabled}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof d.A?R.executeMany(e,r,i):C.executeMany(e,r,i)}function P(e,t,r){try{return U(e,t,r)}catch(e){return null}}function D(e,t){const r=E([e],t);return null!=r.pending?{pending:r.pending,geometry:null}:null!=r.geometries?{pending:null,geometry:r.geometries[0]}:{pending:null,geometry:null}}function E(e,t,r){if(!x())for(const r of e)if(null!=r&&!(0,v.aI)(r.spatialReference,t)&&(0,v.fn)(r.spatialReference)&&(0,v.fn)(t)&&!$(r.spatialReference,t))return(0,s.gc)(j),{pending:Z(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,v.aI)(e.spatialReference,t)?e:(0,v.fn)(e.spatialReference)&&(0,v.fn)(t)?U(e,t,r):null)}}class B extends i.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function G(){A=null,R=null,C=null,M=null,L={}}const Q={get loadPromise(){return A}};async function J(e,t,r){if((0,a.Te)(r),!e)return e;const i=E(Array.isArray(e)?e:[e],t,r);if(i.pending)return await i.pending,(0,a.Te)(r),J(e,t,r);const s=i.geometries??[];return Array.isArray(e)?s:s[0]}function $(e,t,r){return!(r?.areaOfInterestExtent||r?.extendedParams||r?.geographicTransformation)&&(!!(0,v.aI)(e,t)||(0,v.fn)(e)&&(0,v.fn)(t)&&!!(0,F.jd)(e,t))}function V(e,t){if((0,v.aI)(e,t))return!0;if(!(0,v.fn)(e)||!(0,v.fn)(t))return!1;const r=(0,v.oT)(e)||(0,v.K8)(e)||(0,v.x1)(e),i=(0,v.oT)(t)||(0,v.K8)(t)||(0,v.x1)(t);return r&&i}async function Y(e,t,r,i){if(x())return(0,a.NO)(i);if(Array.isArray(e)){for(const{source:t,dest:r,options:a}of e)if(t&&r&&!$(t,r,a))return Z(i)}else if(e&&t&&!$(e,t,r))return Z(i);return(0,a.NO)(i)}function K(e,t,r){return e?(0,S.fT)(e)?H(e,t,new p.A,r,0):(0,S.ZC)(e)?se(e,t,new c.A,r,0):(0,S.Bi)(e)?ie(e,t,new y.A,r,0):(0,S.Rg)(e)?te(e,t,new f.A,r,0):(0,S.U9)(e)?X(e,t,new h.A,r,0):null:null}function z(e,t,r=t.spatialReference,i=0){return null!=r&&null!=e.spatialReference&&null!=H(e,e.spatialReference,t,r,i)}function H(e,t,r,i,a){ue[0]=e.x,ue[1]=e.y;const s=e.z;return ue[2]=void 0!==s?s:a,(0,w.projectBuffer)(ue,t,0,ue,i,0)?(r.x=ue[0],r.y=ue[1],r.spatialReference=i,void 0!==s||(0,u.xP)(i)?(r.z=ue[2],r.hasZ=!0):(r.z=void 0,r.hasZ=!1),void 0===e.m?(r.m=void 0,r.hasM=!1):(r.m=e.m,r.hasM=!0),r):null}function W(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=X(e,e.spatialReference,t,r,i)}function X(e,t,r,i,a){const{points:s,hasZ:n,hasM:l}=e,o=[],u=s.length,c=[];for(const e of s)c.push(e[0],e[1],n?e[2]:a);if(!(0,w.projectBuffer)(c,t,0,c,i,0,u))return null;const d=oe(n,i);for(let e=0;e<u;++e){const t=3*e,r=c[t],i=c[t+1];d&&l?o.push([r,i,c[t+2],s[e][3]]):d?o.push([r,i,c[t+2]]):l?o.push([r,i,s[e][2]]):o.push([r,i])}return r.points=o,r.spatialReference=i,r.hasZ=n,r.hasM=l,r}function ee(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=te(e,e.spatialReference,t,r,i)}function te(e,t,r,i,a){const{curvePaths:s,paths:n,hasZ:l,hasM:o}=e;if(!(s?le(s,l??!1,o??!1,t,r.curvePaths=[],i,a):ne(n,l??!1,o??!1,t,r.paths,i,a)))return null;const u=oe(l,i);return r.spatialReference=i,r.hasZ=u,r.hasM=o,r}function re(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=ie(e,e.spatialReference,t,r,i)}function ie(e,t,r,i,a){const{curveRings:s,rings:n,hasZ:l,hasM:o}=e;return(s?le(s,l??!1,o??!1,t,r.curveRings=[],i,a):ne(n,l??!1,o??!1,t,r.rings,i,a))?(r.spatialReference=i,r.hasZ=oe(l,i),r.hasM=o,r):null}function ae(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=se(e,e.spatialReference,t,r,i)}function se(e,t,r,i,a){const{xmin:s,ymin:n,xmax:l,ymax:o,hasZ:u,hasM:c}=e;if(!b(s,n,u?e.zmin:a,t,ue,i))return null;const d=oe(u,i);return r.xmin=ue[0],r.ymin=ue[1],d&&(r.zmin=ue[2]),b(l,o,u?e.zmax:a,t,ue,i)?(r.xmax=ue[0],r.ymax=ue[1],d&&(r.zmax=ue[2]),c&&(r.mmin=e.mmin,r.mmax=e.mmax),r.spatialReference=i,r):null}function ne(e,t,r,i,a,s,n=0){const l=new Array;for(const r of e)for(const e of r)l.push(e[0],e[1],t?e[2]:n);if(!(0,w.projectBuffer)(l,i,0,l,s,0))return!1;let o=0;a.length=0;const u=t?3:2,c=oe(t,s);for(const t of e){const e=new Array;for(const i of t){const t=l.slice(o,o+=3);c||t.pop(),r&&t.push(i[u]),e.push(t)}a.push(e)}return!0}function le(e,t,r,i,a,s,n=0){const l=new Array;for(const r of e)for(const e of r){if((0,T.FG)(e))return!1;if((0,T.aO)(e)){const[r,i]=e.c;l.push(r[0],r[1],t?r[2]:n,i[0],i[1],n);continue}if((0,T.n1)(e)){const[r,i,a]=e.b;l.push(r[0],r[1],t?r[2]:n,i[0],i[1],n,a[0],a[1],n);continue}const r=e;l.push(r[0],r[1],t?r[2]:n)}if(!(0,w.projectBuffer)(l,i,0,l,s,0))return!1;let o=0;a.length=0;const u=t?3:2,c=oe(t,s);for(const t of e){const e=new Array;for(const i of t){const t=l.slice(o,o+=3);if(c||t.pop(),r&&t.push((0,T.yP)(i)[u]),(0,T.FG)(i))return!1;if((0,T.aO)(i)){const r=l[o++],i=l[o++];++o,e.push({c:[t,[r,i]]});continue}if((0,T.n1)(i)){const r=l[o++],i=l[o++];++o;const a=l[o++],s=l[o++];++o,e.push({b:[t,[r,i],[a,s]]});continue}e.push(t)}a.push(e)}return!0}function oe(e,t){return e||(0,u.xP)(t)||(0,v.aI)(t,g.Y0)}const ue=(0,l.vt)()},98764(e,t,r){r.d(t,{GD:()=>n,Y0:()=>u,lO:()=>c});var i=r(73941),a=r(16930),s=r(21325);const n=new a.A(i.fv),l=new a.A(i.FY),o=new a.A(i.LJ),u=new a.A(i.Ro);function c(e){const t=d.get(e);if(t)return t;let r=n;if(e)if(e===l)r=l;else if(e===o)r=o;else{const t=e.wkid,i=e.latestWkid;if(null!=t||null!=i)(0,s.tl)(t)||(0,s.tl)(i)?r=l:((0,s.ZL)(t)||(0,s.ZL)(i))&&(r=o);else{const t=e.wkt2??e.wkt;if(t){const e=t.toUpperCase();e===h?r=l:e===p&&(r=o)}}}return d.set(e,r),r}const d=new Map,h=l.wkt.toUpperCase(),p=o.wkt.toUpperCase()},34403(e,t,r){r.d(t,{TP:()=>n});var i=r(79258);Math.PI;const a=i.$O.radius,s=i.$O.eccentricitySquared,n={a1:a*s,a2:a*s*a*s,a3:a*s*s/2,a4:a*s*a*s*2.5,a5:a*s+a*s*s/2,a6:1-s};i.$O.radius,i.$O.flattening,i.Sw.radius,i.Sw.flattening,i.sH.radius,i.sH.flattening,i.sH.radius},4146(e,t,r){r.d(t,{A:()=>_});var i=r(5482),a=r(11254),s=r(49186),n=r(65529),l=r(4902),o=r(92474),u=r(53966),c=r(17676),d=r(84952),h=r(91429),p=r(5443),y=r(16930),f=r(92602),m=r(79677);let g=0,_=class extends((0,n.Zt)((0,l.s)(o.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new p.A(-180,-90,180,90,y.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=y.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([r.e(812),r.e(7982)]).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await Promise.all([r.e(812),r.e(5613),r.e(909)]).then(r.bind(r,45613));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",a=r?.portal?.url||f.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+a+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,c.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,d.An)(this.url)}createLayerView(e,t){return Promise.reject(new s.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,a.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,h.MZ)({type:String})],_.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],_.prototype,"effectiveVisible",null),(0,i.Cg)([(0,h.MZ)({type:p.A})],_.prototype,"fullExtent",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],_.prototype,"hasAttributionData",null),(0,i.Cg)([(0,h.MZ)({type:String,clonable:!1})],_.prototype,"id",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:["show","hide","hide-children"]})],_.prototype,"listMode",void 0),(0,i.Cg)([(0,h.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],_.prototype,"opacity",void 0),(0,i.Cg)([(0,h.MZ)({clonable:!1})],_.prototype,"parent",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean})],_.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean})],_.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,h.MZ)({type:y.A})],_.prototype,"spatialReference",void 0),(0,i.Cg)([(0,h.MZ)({type:String})],_.prototype,"title",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],_.prototype,"type",void 0),(0,i.Cg)([(0,h.MZ)()],_.prototype,"url",void 0),(0,i.Cg)([(0,h.MZ)({type:m.A})],_.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"visible",void 0),_=(0,i.Cg)([(0,h.$K)("esri.layers.Layer")],_)},52136(e,t,r){r.d(t,{p:()=>s});var i=r(5482),a=r(91429);const s=e=>{const t=e;let r=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i.Cg)([(0,a.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,i.Cg)([(0,a.$K)("esri.layers.mixins.APIKeyMixin")],r),r}},47685(e,t,r){r.d(t,{Mk:()=>p,Zk:()=>d,w6:()=>m});var i=r(5482),a=r(65529),s=r(4718),n=r(91429),l=r(20816);const o=new a.bk;function u(e){return o.on("apply-edits",new WeakRef(e))}function c(e){return o.on("update-moment",new WeakRef(e))}function d(e,t,r=null,i=!1){const a=Promise.withResolvers();return i=null==t||i,o.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:r,mayReceiveServiceEdits:i,result:a.promise}),a}const h=Symbol();function p(e){return null!=e&&"object"==typeof e&&h in e}function y(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function f(e,t,r){const i=new URL(e).host,a=l.Z3.get(i),s=e=>!e||e===a;return s(t)&&s(r)||t===r}const m=e=>{var t;const r=e;let a=class extends r{static{t=h}constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:r,gdbVersion:i,mayReceiveServiceEdits:a,result:n}=e,l=t===this.url,o=null!=r&&null!=this.layerId&&r===this.layerId,u=y(this),c=y(this)&&f(t,i,this.gdbVersion);if(!l||u&&!c||!o&&!a)return;const d=n.then(e=>{if(this.lastEditsEventDate=new Date,o&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,s.o8)(e)),e;const r=e.editedFeatures?.find(({layerId:e})=>e===this.layerId);if(r){const{adds:t,updates:i,deletes:a}=r.editedFeatures,n={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:t?t.map(({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],deletedFeatures:a?a.map(({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],updatedFeatures:i?i.map(({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],editedFeatures:(0,s.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,s.o8)(e.historicMoment)};return this.emit("edits",n),n}const a={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,s.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,s.o8)(e.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,a.historicMoment)&&this.emit("edits",a),a}).then(e=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,e.historicMoment)&&(this.historicMoment=e.historicMoment),e));this.emit("apply-edits",{result:d})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:r,moment:i}=e,a=t===this.url,s=y(this),n=y(this)&&f(t,r,this.gdbVersion),l=y(this)&&!f(t,this.gdbVersion,null);a&&s&&n&&l&&"historicMoment"in this&&this.historicMoment!==i&&(this.historicMoment=i)},this.when().then(()=>{this.addHandles(u(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(c(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(e,t,r){return"historicMoment"in this&&this.historicMoment!==r&&(0,l.w5)(e,t)}};return(0,i.Cg)([(0,n.MZ)()],a.prototype,"lastEditsEventDate",void 0),a=(0,i.Cg)([(0,n.$K)("esri.layers.mixins.EditBusLayer")],a),a}},28032(e,t,r){r.d(t,{A:()=>o});var i=r(5482),a=r(69540),s=r(25482),n=r(91429),l=r(56400);let o=class extends((0,a.OU)(s.o)){constructor(e){super(e),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};(0,i.Cg)([(0,n.MZ)()],o.prototype,"creatorField",void 0),(0,i.Cg)([(0,n.MZ)()],o.prototype,"creationDateField",void 0),(0,i.Cg)([(0,n.MZ)()],o.prototype,"editorField",void 0),(0,i.Cg)([(0,n.MZ)()],o.prototype,"editDateField",void 0),(0,i.Cg)([(0,n.MZ)()],o.prototype,"realm",void 0),(0,i.Cg)([(0,n.MZ)((0,l.P6)("dateFieldsTimeReference",!0))],o.prototype,"timeZone",void 0),o=(0,i.Cg)([(0,n.$K)("esri.layers.support.EditFieldsInfo")],o)},33143(e,t,r){r.d(t,{A:()=>d});var i=r(5482),a=r(69540),s=r(25482),n=r(91429),l=r(8631),o=r(29005),u=r(36005),c=r(43937);let d=class extends((0,a.OU)(s.o)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,l.r)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i.Cg)([(0,n.MZ)({json:{write:!0}})],d.prototype,"id",void 0),(0,i.Cg)([(0,n.MZ)({json:{write:!0}})],d.prototype,"name",void 0),(0,i.Cg)([(0,n.MZ)({json:{write:!0}})],d.prototype,"domains",void 0),(0,i.Cg)([(0,u.w)("domains")],d.prototype,"readDomains",null),(0,i.Cg)([(0,c.K)("domains")],d.prototype,"writeDomains",null),(0,i.Cg)([(0,n.MZ)({type:[o.A],json:{write:!0}})],d.prototype,"templates",void 0),d=(0,i.Cg)([(0,n.$K)("esri.layers.support.FeatureType")],d)},37352(e,t,r){r.d(t,{A:()=>o});var i,a=r(5482),s=r(7762),n=r(25482),l=r(91429);let o=i=class extends n.o{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new s.A}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,a.Cg)([(0,l.MZ)({type:String,json:{write:{isRequired:!0}}})],o.prototype,"floorField",void 0),(0,a.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],o.prototype,"viewAllMode",void 0),(0,a.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],o.prototype,"viewAllLevelIds",void 0),o=i=(0,a.Cg)([(0,l.$K)("esri.layers.support.LayerFloorInfo")],o)},45067(e,t,r){r.d(t,{A:()=>c});var i=r(5482),a=r(69540),s=r(66552),n=r(25482),l=r(91429);const o=new s.J({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),u=new s.J({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let c=class extends((0,a.OU)(n.o)){constructor(e){super(e),this.cardinality=null,this.catalogId=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};(0,i.Cg)([(0,l.MZ)({json:{read:o.read,write:o.write}})],c.prototype,"cardinality",void 0),(0,i.Cg)([(0,l.MZ)({json:{name:"catalogID"}})],c.prototype,"catalogId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"composite",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"id",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"keyField",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"keyFieldInRelationshipTable",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"name",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"relatedTableId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"relationshipTableId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:u.read,write:u.write}})],c.prototype,"role",void 0),c=(0,i.Cg)([(0,l.$K)("esri.layers.support.Relationship")],c)},17311(e,t,r){r.d(t,{A:()=>p});var i=r(5482),a=r(69622),s=r(4576),n=r(60999),l=r(7762),o=r(16494),u=r(91429),c=r(30524),d=r(43668);const h=/<br\s*\/*>/gi;let p=class extends a.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,n.UT)(()=>(0,d.l)()):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??Promise.all([r.e(4560),r.e(9301)]).then(r.bind(r,99301)).then(e=>this._featureUtils=e)}get calculatedExpressions(){const e=new l.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter(t=>e.includes(`{expression/${t.name.toLowerCase()}}`))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some(e=>!0===e.invalid)}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),i=this.fieldsIndex.get(r.at(-1)??"");i&&e.add(i.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return null!=this.objectIdField&&e.add(this.objectIdField),e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){const i=t.getObjectId()??t.attributes[e.objectIdField];return(await this.getTitles(e,[t],r)).get(i)??""}async getTitles(e,t,r){const i=new Map,a=r?.timeZone??"system";try{const[{substituteFieldsInLinksAndAttributes:s}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);r?.fetchMissingFields&&(t=await this._checkAndReQueryGraphics(e,t));const{fieldInfoMap:n,workingTitle:l}=this,u=l&&n;t.forEach(t=>{const c=t.getObjectId()??t.attributes[e.objectIdField];let d=u?s({attributes:t.attributes,expressionAttributes:null,fieldInfoMap:n,globalAttributes:this._createFormattedAttributes(e,t,a).global,layer:e,text:l}):"";r?.removeHTML&&(d=o.Nd.sanitize(d).replaceAll(h," ")),i.set(c,d)})}catch{}return i}async _checkAndReQueryGraphics(e,t){const r=t.map(t=>t.getObjectId()??t.attributes[e.objectIdField]).filter(s.Ru);if(r.length!==t.length)return t;if(t.some(e=>!(0,c.Kl)(e,this.requiredFields))){const i=e.createQuery();i.where="1=1",i.outFields=[...this.requiredFields],i.objectIds=r;const a=await e.queryFeatures(i);if(a?.features.length===t.length)return a.features}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),i=e?.name??r.fieldName;r.fieldName=i,t.set(i.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const i=this.effectivePopupTemplate?.fieldInfos??[],a={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{a[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const s={...t.attributes,...a};return{global:this._featureUtils.formatAttributes({fieldInfos:i,attributes:s,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,c.nw)(e).filter(e=>!(e.startsWith("relationships/")||e.startsWith("expression/")))}};(0,i.Cg)([(0,u.MZ)({readOnly:!0})],p.prototype,"_arcadeTask",null),(0,i.Cg)([(0,u.MZ)()],p.prototype,"_featureUtils",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],p.prototype,"featureUtilsPromise",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],p.prototype,"calculatedExpressions",null),(0,i.Cg)([(0,u.MZ)()],p.prototype,"displayField",void 0),(0,i.Cg)([(0,u.MZ)()],p.prototype,"effectivePopupTemplate",void 0),(0,i.Cg)([(0,u.MZ)()],p.prototype,"expressionsUsedInTitle",null),(0,i.Cg)([(0,u.MZ)()],p.prototype,"fieldsIndex",void 0),(0,i.Cg)([(0,u.MZ)()],p.prototype,"fieldInfoMap",null),(0,i.Cg)([(0,u.MZ)()],p.prototype,"fields",void 0),(0,i.Cg)([(0,u.MZ)()],p.prototype,"objectIdField",void 0),(0,i.Cg)([(0,u.MZ)()],p.prototype,"requiredFields",null),p=(0,i.Cg)([(0,u.$K)("esri.layers.support.TitleCreator")],p)},41560(e,t,r){r.d(t,{Ch:()=>n,mW:()=>s});var i=r(34727),a=r(39516);function s(e,t){return{...t,filterMode:e.mode}}function n(e,t,r){const s=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:i}of e.filters)t[0]=Math.max(t[0],c(r)),t[1]=Math.min(t[1],d(i));return t}(e);if(s&&((0,i.gg)(t,s[0])||(0,i.ZH)(r,s[1])))return"";const n=Array.from(l(e,t,r)),o=function(e,t,r){if(0===e.length)return!0;const a=c(e.at(0)?.minScale),s=d(e.at(-1)?.maxScale);if((0,i.ZH)(a,t)||(0,i.gg)(s,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],a=e[t+1];if((0,i.ZH)(c(a.minScale),d(r.maxScale)))return!0}return!1}(n,t,r)?"1=1":n.map(e=>e.where||"1=1").reduce((e,t)=>(0,a.IW)(e,t),"");return o&&"1=1"!==o?o:""}function*l(e,t,r){if("manual"===u(e)){const t=e.filters.find(t=>t.id===e.activeFilterId);t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const i of e.filters)o(i.minScale,i.maxScale,t,r)&&(yield i)}}function o(e,t,r,a){return e=c(e),r=c(r),t=d(t),!(!(0,i.Sp)(r,e)&&(a??r)>e||(0,i.Hx)(t,r)||void 0!==a&&(0,i.Sp)(a,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function c(e){return e||Number.POSITIVE_INFINITY}function d(e){return e||0}},77548(e,t,r){r.d(t,{Gh:()=>x,tk:()=>R,BR:()=>A,p2:()=>v,qd:()=>C,wI:()=>T,G$:()=>L,$x:()=>M,Ov:()=>w,cM:()=>h,UC:()=>p,W_:()=>F,Qz:()=>y,OP:()=>j,TU:()=>_,F2:()=>f,XX:()=>g,Qi:()=>b,jy:()=>I});var i=r(70333),a=r(11254),s=r(7762),n=(r(84952),r(36563)),l=r(36708),o=r(4146);const u=new WeakMap;function c(e){return!e.destroyed&&(u.has(e)||e.addHandles([(0,l.wB)(()=>{const{parent:t}=e;return!!(t&&t instanceof o.A)&&("catalog-dynamic-group"===t.type||c(t))},t=>u.set(e,t),l.pc),(0,n.hA)(()=>u.delete(e))]),u.get(e))}function d(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function h(e){return d(e,"knowledge-graph")&&"layers"in e}function p(e){return d(e,"knowledge-graph-sublayer")}function y(e){return d(e,"link-chart")&&"layers"in e}function f(e){return d(e,"subtype-group")&&"sublayers"in e}function m(e){const t=e.parent;return function(e){return"group"===e?.type}(t)&&t.tables.includes(e)}r(16215);const g={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function _(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function w(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function F(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t||"annotation-feature"===t||"dimension-feature"===t)&&"feature-layer"===e?.source?.type}function b(e){return null!=e&&"object"==typeof e&&"featureReduction"in e}function I(e){return function(e){return d(e,"catalog-footprint")}(e)||function(e){return d(e,"feature")}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)||function(e){return d(e,"oriented-imagery")}(e)||function(e){return"subtype-sublayer"===e?.type}(e)}function S(e){const t=e?.type;return"binning"===t||"cluster"===t}function v(e,t){if(!I(e))return;const r=t?.graphic,i="featureReduction"in e?e.featureReduction:null;if(r){if(r.isAggregate){const e=r.origin;return e&&"featureReductionProvider"in e&&i?S(i)?i:null:void 0}return e}return t?.checkFeatureReduction&&i?S(i)?i:null:e}async function T(e,t){const r=i.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const s=e.toLowerCase().indexOf("/rest/services");if(-1===s)return null;const n=`${e.slice(0,s)}/rest/info`,l=null!=t?t.signal:null,{data:o}=await(0,a.A)(n,{query:{f:"json"},responseType:"json",signal:l});return o?.owningSystemUrl||null}function A(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"parquet":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function R(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function C(e){const t=new s.A;for(const r of e.allLayers.concat(e.allTables))c(r)||m(r)||"annotation-feature"===r.type||"dimension-feature"===r.type||("charts"in r&&t.push(r),"subtype-group"===r.type&&t.push(...r.sublayers));return t}function M(e,t){return null}function L(e){return null}function j(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function x(e,t){if(!t||!j(e))return;const r=(e.url,null);r&&(e.url=r)}},73133(e,t,r){r.d(t,{j:()=>i});const i=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"})},10536(e,t,r){function i(e){const t={};for(const r in e){if("declaredClass"===r)continue;const a=e[r];if(null!=a&&"function"!=typeof a)if(Array.isArray(a)){t[r]=[];for(let e=0;e<a.length;e++)t[r][e]=i(a[e])}else"object"==typeof a?a.toJSON&&(t[r]=JSON.stringify(a)):t[r]=a}return t}r.d(t,{z:()=>i})},17126(e,t,r){r.d(t,{dw:()=>n,qD:()=>l,qW:()=>o});var i=r(11254),a=r(21325),s=r(10536);function n(e,t){const r=e.toJSON();return r.objectIds&&(r.objectIds=r.objectIds.join(",")),r.orderByFields&&(r.orderByFields=r.orderByFields.join(",")),r.outFields&&!t?.returnCountOnly?r.outFields.includes("*")?r.outFields="*":r.outFields=r.outFields.join(","):delete r.outFields,r.outSR&&(r.outSR=(0,a.YX)(r.outSR)),r.dynamicDataSource&&(r.layer=JSON.stringify({source:r.dynamicDataSource}),delete r.dynamicDataSource),r}async function l(e,t,r){const i=await u(e,t,r),a=i.data,s=a.geometryType,n=a.spatialReference,l={};for(const e of a.relatedRecordGroups){const t={fields:void 0,geometryType:s,spatialReference:n,hasZ:!!a.hasZ,hasM:!!a.hasM,features:e.relatedRecords};if(null!=e.objectId)l[e.objectId]=t;else for(const r of Object.keys(e))"relatedRecords"!==r&&(l[e[r]]=t)}return{...i,data:l}}async function o(e,t,r){const i=await u(e,t,r,{returnCountOnly:!0}),a=i.data,s={};for(const e of a.relatedRecordGroups)null!=e.objectId&&(s[e.objectId]=e.count);return{...i,data:s}}async function u(e,t,r={},a){const l=(0,s.z)({...e.query,f:"json",...a,...n(t,a)});return(0,i.A)(e.path+"/queryRelatedRecords",{...r,query:{...r.query,...l}})}},16215(e,t,r){r.d(t,{S:()=>a,Y:()=>i});const i=Symbol("BasemapInstance");function a(e){return null!=e&&"object"==typeof e&&i in e}},79677(e,t,r){r.d(t,{A:()=>h});var i,a=r(5482),s=r(25482),n=r(88930),l=r(91429),o=r(98623),u=r(10184),c=r(36005),d=r(43937);let h=class extends s.o{static{i=this}static get allTime(){return p}static get empty(){return y}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,a=e.end?.getTime()??e.end;return t===i&&r===a}expandTo(e,t=o.qU){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let r=this.start;r&&(r=(0,n.lL)(r,new u.A({value:1,unit:e}),t));let a=this.end;if(a){const r=(0,n.lL)(a,new u.A({value:1,unit:e}),t);a=a.getTime()===r.getTime()?r:(0,n.S1)(r,1,e,t)}return new i({start:r,end:a})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,a=e.start?.getTime()??-1/0,s=e.end?.getTime()??1/0;let n,l;return a>=t&&a<=r?n=a:t>=a&&t<=s&&(n=t),r>=a&&r<=s?l=r:s>=t&&s<=r&&(l=s),null==n||null==l||isNaN(n)||isNaN(l)?i.empty:new i({start:n===-1/0?null:new Date(n),end:l===1/0?null:new Date(l)})}offset(e,t,r=o.qU){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();const a=new i,{start:s,end:l}=this;return null!=s&&(a.start=(0,n.S1)(s,e,t,r)),null!=l&&(a.end=(0,n.S1)(l,e,t,r)),a}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,a.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,a.Cg)([(0,c.w)("end")],h.prototype,"readEnd",null),(0,a.Cg)([(0,d.K)("end")],h.prototype,"writeEnd",null),(0,a.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,a.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,a.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,a.Cg)([(0,c.w)("start")],h.prototype,"readStart",null),(0,a.Cg)([(0,d.K)("start")],h.prototype,"writeStart",null),h=i=(0,a.Cg)([(0,l.$K)("esri.time.TimeExtent")],h);const p=new h,y=new h({start:void 0,end:void 0})},10184(e,t,r){r.d(t,{A:()=>c});var i=r(5482),a=r(69540),s=r(25482),n=r(88930),l=r(91429),o=r(73133),u=r(93223);let c=class extends((0,a.OU)(s.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,n.t)(this.value,this.unit,"milliseconds")}};(0,i.Cg)([(0,u.e)(o.j,{nonNullable:!0})],c.prototype,"unit",void 0),(0,i.Cg)([(0,l.MZ)({type:Number,json:{write:!0},nonNullable:!0})],c.prototype,"value",void 0),c=(0,i.Cg)([(0,l.$K)("esri.time.TimeInterval")],c)},20816(e,t,r){r.d(t,{TA:()=>a,We:()=>l,Z3:()=>s,ZJ:()=>o,w5:()=>u});var i=r(11254);const a=(0,r(13069).vD)(),s=new Map,n=new Map;async function l(e,t,r){if(!e||!r)return!1;if(!t)return!0;const a=new URL(e).host;let n=s.get(a);if(!n){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");n=(await(0,i.A)(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return n===t}async function o(e,t,i=!1){if(!e||!t)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),l=n.get(s)?.entries();if(l)for(const[e,n]of l)if(n.name===t){const t=!n.stack?.hasForwardEdits();if(!t&&i){const[{deleteForwardEdits:t},{default:i}]=await Promise.all([r.e(2186).then(r.bind(r,32186)),r.e(2558).then(r.bind(r,32558))]),l=await t(s,e,new i({sessionId:a,moment:n.moment}));return l.success&&n.stack?.clearForwardEdits(),l.success}return t}return!0}function u(e,t){if(!e)return!1;const r=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=n.get(r)?.entries();if(i)for(const[e,r]of i)if(r.name===t)return"edit"===r.lockType;return!1}new Map}}]);
|