UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines • 60.7 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5977],{6455(e,t,r){r.d(t,{FJ:()=>h,Dp:()=>v,KV:()=>w});var i=r(5482),n=r(93637),o=r(91429),s=r(89317),a=r(69540),l=r(7762),p=r(25482),u=r(83960),c=r(13069);const d={write:{overridePolicy:(e,t,r)=>({enabled:!r||"scale"===r.filterMode})}};let y=class extends((0,a.OU)(p.o)){constructor(e){super(e),this.id=(0,c.lk)(),this.maxScale=0,this.minScale=0,this.title="",this.where=null}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"id",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,json:d})],y.prototype,"maxScale",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,json:d})],y.prototype,"minScale",void 0),(0,i.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"title",void 0),(0,i.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"where",void 0),y=(0,i.Cg)([(0,o.$K)("esri.layers.support.DisplayFilter")],y);var f=r(41560),g=r(43937);let m=class extends((0,a.OU)(p.o)){constructor(e){super(e),this.activeFilterId=null,this.filters=new(l.A.ofType(y)),this.mode="manual"}writeFilters(e,t,r,i){const n=e.toArray();"scale"===this.mode&&n.sort((e,t)=>{const r=(0,u.oW)(t.minScale,e.minScale),i=e.maxScale-t.maxScale;return 0===r?i:r}),t[r]=n.map(e=>e.toJSON(i))}write(e,t){return super.write(e,(0,f.mW)(this,t))}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:{overridePolicy:(e,t,r)=>({enabled:"manual"===r.filterMode,isRequired:!0})}}})],m.prototype,"activeFilterId",void 0),(0,i.Cg)([(0,o.MZ)({type:l.A.ofType(y),nonNullable:!0,json:{write:!0}})],m.prototype,"filters",void 0),(0,i.Cg)([(0,g.K)("filters")],m.prototype,"writeFilters",null),(0,i.Cg)([(0,o.MZ)({type:["manual","scale"],nonNullable:!0,json:{name:"filterMode",write:!0}})],m.prototype,"mode",void 0),m=(0,i.Cg)([(0,o.$K)("esri.layers.support.DisplayFilterInfo")],m);const h=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.displayFilterEnabled=!0,this.displayFilterInfo=null}};return(0,i.Cg)([(0,o.MZ)(v)],r.prototype,"displayFilterEnabled",void 0),(0,i.Cg)([(0,o.MZ)(w)],r.prototype,"displayFilterInfo",void 0),r=(0,i.Cg)([(0,o.$K)("esri.layers.mixins.DisplayFilteredLayer")],r),r},v={type:Boolean,json:{name:"layerDefinition.disableDisplayFilter",read:{reader:e=>!e},write:{layerContainerTypes:s.K,writer(e,t,r){(0,n.sM)(r,!e,t)}},origins:{"web-scene":{write:!1,read:!1}}}},w={type:m,json:{name:"layerDefinition.displayFilterInfo",write:{enabled:!0,allowNull:!0,layerContainerTypes:s.K},origins:{"web-scene":{write:!1,read:!1}}}}},8303(e,t,r){r.d(t,{A:()=>I});var i=r(5482),n=r(92602),o=r(70333),s=r(11254),a=r(60999),l=r(49186),p=r(53966),u=r(97768),c=r(74887),d=r(84952),y=r(91429),f=r(77548),g=r(20655),m=r(80812),h=r(41318),v=r(10407),w=r(36005),C=r(43937);const I=e=>{const t=e;let I=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new m.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await r.e(1204).then(r.bind(r,41204));return(0,c.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,c.zf)(e)||p.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,c.QP)(e),!0)))}async setUserPrivileges(e,t){if(!n.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:n}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",n)}catch(e){(0,c.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!o.id?.findCredential(this.url),n=e===r.id;if(n&&r.portal.user)return this._getUserPrivileges(r,i);let s,a;if(n)s=r.portal.url;else try{s=await(0,f.wI)(this.url,t)}catch(e){(0,c.QP)(e)}if(!s||!(0,d.b8)(s,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;a=await(o.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.QP)(e)}const l=!0,p=!1,u=!1;if(!a)return{features:{edit:l,fullEdit:p},content:{updateItem:u}};try{if(n?await r.reload():(r=new m.default({id:e,portal:{url:s}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,i)}catch(e){(0,c.QP)(e)}return{features:{edit:l,fullEdit:p},content:{updateItem:u}}}_getUserPrivileges(e,t){const r=(0,v.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?o.id?.findCredential(this.url):null;if(!t)return!0;const r=b.credential===t?b.user:await this._fetchEditingUser(e);return b.credential=t,b.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=o.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,n=g.A.getDefault();if(n&&n.loaded&&(0,d.S8)(n.restUrl)===(0,d.S8)(i))return n.user;const l=`${i}/community/self`,p=null!=e?e.signal:null,u=await(0,a.Ke)((0,s.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:p}));return u.ok?h.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||g.A.getDefault());return r&&i&&!(0,d.ut)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i.Cg)([(0,y.MZ)({type:m.default})],I.prototype,"portalItem",null),(0,i.Cg)([(0,w.w)("web-document","portalItem",["itemId"])],I.prototype,"readPortalItem",null),(0,i.Cg)([(0,C.K)("web-document","portalItem",{itemId:{type:String}})],I.prototype,"writePortalItem",null),(0,i.Cg)([(0,y.MZ)({clonable:!1})],I.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],I.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],I.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],I.prototype,"userHasUpdateItemPrivileges",void 0),I=(0,i.Cg)([(0,y.$K)("esri.layers.mixins.PortalLayer")],I),I},b={credential:null,user:null}},10184(e,t,r){r.d(t,{A:()=>u});var i=r(5482),n=r(69540),o=r(25482),s=r(88930),a=r(91429),l=r(73133),p=r(93223);let u=class extends((0,n.OU)(o.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,s.t)(this.value,this.unit,"milliseconds")}};(0,i.Cg)([(0,p.e)(l.j,{nonNullable:!0})],u.prototype,"unit",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0},nonNullable:!0})],u.prototype,"value",void 0),u=(0,i.Cg)([(0,a.$K)("esri.time.TimeInterval")],u)},10407(e,t,r){r.d(t,{It:()=>y,LG:()=>s,OM:()=>p,Sm:()=>u,Y:()=>a,bK:()=>l,mm:()=>d,sQ:()=>c});var i=r(91218),n=r(16930),o=r(28735);function s(e,t){if(!a(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function a(e,t){return!!e.typeKeywords?.includes(t)}function l(e){return a(e,d.HOSTED_SERVICE)}function p(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function u(e,t,r){r?s(e,t):p(e,t)}async function c(e){const t=e.clone().normalize();let r;if(t.length>1)for(const e of t)r?e.width>r.width&&(r=e):r=e;else r=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,o.ci)(e);const r=n.A.WGS84;return await(0,i.initializeProjection)(t,r),(0,i.project)(e,r)}(r)}const d={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function y(e){const{portal:t,isOrgItem:r,itemControl:i}=e,n=t.user?.privileges;let o=!n||n.includes("features:user:edit"),s=!!r&&!!n?.includes("features:user:fullEdit");const a="update"===i||"admin"===i;return a?s=o=!0:s&&(o=!0),{features:{edit:o,fullEdit:s},content:{updateItem:a}}}},13069(e,t,r){r.d(t,{AG:()=>a,lk:()=>n,vD:()=>s,yS:()=>o});const i="randomUUID"in crypto;function n(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function o(){return`{${n().toUpperCase()}}`}function s(){return`{${n()}}`}function a(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},17036(e,t,r){r.d(t,{p:()=>l});var i=r(44208),n=r(53966),o=r(20437),s=r(95466),a=r(30524);function l(){return{fields:{type:[o.A],value:null,set:function(e){if(e&&(0,i.A)("big-integer-warning-enabled")){const t=e.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(t.length){const e=t.map(e=>`'${e.name}'`).join(", ");n.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return s.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||n.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.DB)(this.fieldsIndex,e)}}}}},22671(e,t,r){r.d(t,{A:()=>v});var i,n=r(5482),o=r(52106),s=r(66552),a=r(25482),l=r(4718),p=r(91429),u=r(16930),c=r(60408),d=r(65864),y=r(50498),f=r(20437),g=r(36005),m=r(43937);const h=new s.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=i=class extends a.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,o.A)}writeGeometryType(e,t,r,i){if(e)return void h.write(e,t,r,i);const{features:n}=this;if(n)for(const e of n)if(null!=e?.geometry)return void h.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,d.rS)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=u.A.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,l.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e?.[r];i.geometry=t?.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,n]}=e,o=this.features,s=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-i)/t),e=>Math.round((n-e)/r));for(let e=0,t=o.length;e<t;e++)s?.(o[e].geometry)||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,n],scale:[o,s]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const p=this._getHydrationFunction(e,e=>e*o+i,e=>n-e*s,a,l);for(const{geometry:e}of t)null!=e&&p&&p(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const i=u.A.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const o=e[t],s=r.fromJSON(o),a=o.geometry?.spatialReference;null==s.geometry||a||(s.geometry.spatialReference=i);const l=o.aggregateGeometries,p=s.aggregateGeometries;if(l&&null!=p)for(const e in p){const t=p[e],r=l[e],n=r?.spatialReference;null==t||n||(t.spatialReference=i)}n.push(s)}return n}_quantizePoints(e,t,r){let i,n;const o=[];for(let s=0,a=e.length;s<a;s++){const a=e[s];if(s>0){const e=t(a[0]),s=r(a[1]);e===i&&s===n||(o.push([e-i,s-n]),i=e,n=s)}else i=t(a[0]),n=r(a[1]),o.push([i,n])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,c.Bi)(e)?e.rings:e.paths,n=[];for(let e=0,o=i.length;e<o;e++){const o=i[e],s=this._quantizePoints(o,t,r);s&&n.push(s)}return n.length>0?((0,c.Bi)(e)?e.rings=n:e.paths=n,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,i,n){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),i&&(e.z=i(e.z))}:"polyline"===e||"polygon"===e?e=>{const o=(0,c.Bi)(e)?e.rings:e.paths;let s,a;for(let e=0,i=o.length;e<i;e++){const i=o[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];e>0?(s+=n[0],a+=n[1]):(s=n[0],a=n[1]),n[0]=t(s),n[1]=r(a)}}if(i&&n)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2]),r[3]=n(r[3])}}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}else if(n)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),i&&null!=e.zmax&&null!=e.zmin&&(e.zmax=i(e.zmax),e.zmin=i(e.zmin)),n&&null!=e.mmax&&null!=e.mmin&&(e.mmax=n(e.mmax),e.mmin=n(e.mmin))}:"multipoint"===e?e=>{const o=e.points;let s,a;for(let e=0,i=o.length;e<i;e++){const i=o[e];e>0?(s+=i[0],a+=i[1]):(s=i[0],a=i[1]),i[0]=t(s),i[1]=r(a)}if(i&&n)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=i(t[2]),t[3]=n(t[3])}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=i(t[2])}else if(n)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=n(t[2])}}:null}};(0,n.Cg)([(0,p.MZ)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,n.Cg)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,n.Cg)([(0,p.MZ)({type:[o.A],json:{write:!0}})],v.prototype,"features",void 0),(0,n.Cg)([(0,g.w)("features")],v.prototype,"readFeatures",null),(0,n.Cg)([(0,p.MZ)({type:[f.A],json:{write:!0}})],v.prototype,"fields",void 0),(0,n.Cg)([(0,p.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:h.read}}})],v.prototype,"geometryType",void 0),(0,n.Cg)([(0,m.K)("geometryType")],v.prototype,"writeGeometryType",null),(0,n.Cg)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,n.Cg)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,n.Cg)([(0,p.MZ)({types:y.yR,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,n.Cg)([(0,g.w)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,n.Cg)([(0,p.MZ)({type:u.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,n.Cg)([(0,m.K)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,n.Cg)([(0,p.MZ)({json:{write:!0}})],v.prototype,"transform",void 0),v=i=(0,n.Cg)([(0,p.$K)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0},29005(e,t,r){r.d(t,{A:()=>p});var i=r(5482),n=r(69540),o=r(66552),s=r(25482),a=r(91429);const l=new o.J({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let p=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],p.prototype,"name",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],p.prototype,"description",void 0),(0,i.Cg)([(0,a.MZ)({json:{read:l.read,write:l.write}})],p.prototype,"drawingTool",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],p.prototype,"prototype",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],p.prototype,"thumbnail",void 0),p=(0,i.Cg)([(0,a.$K)("esri.layers.support.FeatureTemplate")],p)},32756(e,t,r){r.d(t,{Rr:()=>a,fY:()=>p,ne:()=>l});var i=r(5482),n=r(93637),o=r(91429),s=r(91880);function a(e,t,r){if(!e)return null;const i=e.find(e=>!!e.field);if(!i)return null;const n=new s.A;return n.read(i,r),[n]}const l={type:[s.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:a},write:{writer:function(e,t,r,i){const o=e.find(e=>!!e.field);o&&(0,n.sM)(r,[o.toJSON()],t)}}}},p=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,i.Cg)([(0,o.MZ)(l)],r.prototype,"orderBy",void 0),r=(0,i.Cg)([(0,o.$K)("esri.layers.mixins.OrderedLayer")],r),r}},33143(e,t,r){r.d(t,{A:()=>c});var i=r(5482),n=r(69540),o=r(25482),s=r(91429),a=r(8631),l=r(29005),p=r(36005),u=r(43937);let c=class extends((0,n.OU)(o.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,a.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,s.MZ)({json:{write:!0}})],c.prototype,"id",void 0),(0,i.Cg)([(0,s.MZ)({json:{write:!0}})],c.prototype,"name",void 0),(0,i.Cg)([(0,s.MZ)({json:{write:!0}})],c.prototype,"domains",void 0),(0,i.Cg)([(0,p.w)("domains")],c.prototype,"readDomains",null),(0,i.Cg)([(0,u.K)("domains")],c.prototype,"writeDomains",null),(0,i.Cg)([(0,s.MZ)({type:[l.A],json:{write:!0}})],c.prototype,"templates",void 0),c=(0,i.Cg)([(0,s.$K)("esri.layers.support.FeatureType")],c)},41560(e,t,r){r.d(t,{Ch:()=>s,mW:()=>o});var i=r(34727),n=r(39516);function o(e,t){return{...t,filterMode:e.mode}}function s(e,t,r){const o=function(e){if("manual"===p(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],u(r)),t[1]=Math.min(t[1],c(i));return t}(e);if(o&&((0,i.gg)(t,o[0])||(0,i.ZH)(r,o[1])))return"";const s=Array.from(a(e,t,r)),l=function(e,t,r){if(0===e.length)return!0;const n=u(e.at(0)?.minScale),o=c(e.at(-1)?.maxScale);if((0,i.ZH)(n,t)||(0,i.gg)(o,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],n=e[t+1];if((0,i.ZH)(u(n.minScale),c(r.maxScale)))return!0}return!1}(s,t,r)?"1=1":s.map(e=>e.where||"1=1").reduce((e,t)=>(0,n.IW)(e,t),"");return l&&"1=1"!==l?l:""}function*a(e,t,r){if("manual"===p(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)l(i.minScale,i.maxScale,t,r)&&(yield i)}}function l(e,t,r,n){return e=u(e),r=u(r),t=c(t),!(!(0,i.Sp)(r,e)&&(n??r)>e||(0,i.Hx)(t,r)||void 0!==n&&(0,i.Sp)(n,e))}function p(e){return"mode"in e?e.mode:e.filterMode}function u(e){return e||Number.POSITIVE_INFINITY}function c(e){return e||0}},52136(e,t,r){r.d(t,{p:()=>o});var i=r(5482),n=r(91429);const o=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,n.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,i.Cg)([(0,n.$K)("esri.layers.mixins.APIKeyMixin")],r),r}},63396(e,t,r){r.d(t,{d:()=>b});var i=r(5482),n=r(91429),o=r(60950),s=r(99959);class a extends s.A{constructor(e){super(),this.type="track",this.trackInfoProvider=e}get id(){return this.trackInfoProvider.id}get[o.ym](){return this.trackInfoProvider.trackInfo}}var l=r(37838),p=r(69540),u=r(25482),c=r(93637),d=r(50820),y=r(10873),f=r(46499),g=r(41214);let m=class extends((0,p.OU)(u.o)){constructor(e){super(e),this.labelingInfo=null,this.labelsVisible=!0,this.renderer=null,this.visible=!0}};(0,i.Cg)([(0,n.MZ)({type:[f.A],json:{write:!0}})],m.prototype,"labelingInfo",void 0),(0,i.Cg)([(0,n.MZ)(y.kF)],m.prototype,"labelsVisible",void 0),(0,i.Cg)([(0,n.MZ)({types:g.Hg,json:{write:!0}})],m.prototype,"renderer",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,json:{write:!0}})],m.prototype,"visible",void 0),m=(0,i.Cg)([(0,n.$K)("esri.layers.support.TrackPartInfo")],m);var h=r(96576),v=r(59868),w=r(10184),C=r(43937);let I=class extends((0,p.OU)(u.o)){constructor(e){super(e),this.enabled=!0,this.fields=[],this.latestObservations=new m({renderer:new h.A({symbol:v.UK.clone()})}),this.maxDisplayDuration=null,this.maxDisplayObservationsPerTrack=0,this.popupEnabled=!0,this.popupTemplate=null,this.previousObservations=new m({renderer:new h.A({symbol:v.UK.clone()})}),this.trackLines=new m({renderer:new h.A({symbol:v.A7.clone()})}),this.timeField="startTimeField"}writeFields(e,t,r){const i=e.filter(e=>"avg_angle"!==e.statisticType).map(e=>e.toJSON());(0,c.sM)(r,i,t)}};(0,i.Cg)([(0,n.MZ)({type:Boolean,json:{write:!0}})],I.prototype,"enabled",void 0),(0,i.Cg)([(0,n.MZ)({type:[d.A],json:{write:!0}})],I.prototype,"fields",void 0),(0,i.Cg)([(0,C.K)("fields")],I.prototype,"writeFields",null),(0,i.Cg)([(0,n.MZ)({type:m,json:{write:!0}})],I.prototype,"latestObservations",void 0),(0,i.Cg)([(0,n.MZ)({type:w.A,json:{write:!0}})],I.prototype,"maxDisplayDuration",void 0),(0,i.Cg)([(0,n.MZ)({type:Number,json:{write:!0}})],I.prototype,"maxDisplayObservationsPerTrack",void 0),(0,i.Cg)([(0,n.MZ)(y.M6)],I.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,n.MZ)({type:l.A,json:{name:"popupInfo",write:!0}})],I.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,n.MZ)({type:m,json:{write:!0}})],I.prototype,"previousObservations",void 0),(0,i.Cg)([(0,n.MZ)({type:m,json:{write:!0}})],I.prototype,"trackLines",void 0),(0,i.Cg)([(0,n.MZ)({type:["timeReceived","startTimeField","endTimeField"],json:{read:!0,write:!0}})],I.prototype,"timeField",void 0),I=(0,i.Cg)([(0,n.$K)("esri.layers.support.TrackInfo")],I);const b=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.trackGraphicOrigin=new a(this),this.trackInfo=null}};return(0,i.Cg)([(0,n.MZ)({readOnly:!0,clonable:!1})],r.prototype,"trackGraphicOrigin",void 0),(0,i.Cg)([(0,n.MZ)({type:I})],r.prototype,"trackInfo",void 0),r=(0,i.Cg)([(0,n.$K)("esri.layers.mixins.TrackableLayer")],r),r}},64714(e,t,r){r.d(t,{F0:()=>a,Vx:()=>u,e2:()=>d,f:()=>y});var i=r(44208),n=r(4718),o=r(99352),s=r(93470);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?s.Cb:"esriGeometryPolyline"===e?s.yM:s.WR}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let p=1;function u(e,t){if((0,i.A)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this${c(t)} = null;`;for(const t in e)r+=`this${c(t)} = ${JSON.stringify(e[t])};`;const i=new Function(`\n return class AttributesClass$${p++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new i}catch(r){return()=>({[t]:null,...e})}}function c(e){return l.test(e)?`.${e}`:`[${JSON.stringify(e)}]`}function d(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,n.o8)(e)}}]}function y(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:o.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:o.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:t,supportsTrueCurveUpdateByTrueCurveClientsOnly:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},65977(e,t,r){r.r(t),r.d(t,{default:()=>W});var i=r(5482),n=r(37838),o=r(49186),s=r(25728),a=r(91429),l=r(5443),p=r(16930),u=r(50498),c=r(55156),d=r(60950),y=r(89808),f=r(99959);const g=Symbol("isOGCFeatureGraphicOrigin");var m;class h extends f.A{get[(m=g,d.ym)](){return this.layer}get[c.e](){return this.layer}get[y.Q](){return this.layer}constructor(e){super(),this[m]=!0,this.type="ogc-feature",this.layer=e}get id(){return this.layer.id}}var v=r(4146),w=r(92474),C=r(799),I=r(75321),b=r(4071),T=r(22671);let S=class extends w.x_{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:r,supportedCrs:i},layer:{apiKey:n,customParameters:o,effectiveMaxRecordCount:s}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:s,queryParameters:{apiKey:n,customParameters:o},spatialReference:r,supportedCrs:i}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(e=>T.A.fromJSON(e))}queryFeaturesJSON(e,t={}){const r=this.getSource();return this.load(t).then(()=>(0,I.bW)(r,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){const{isWebMercator:t,isWGS84:r,latestWkid:i,wkid:n}=e,{supportedCrs:o}=this.featureDefinition;return r||t||!!n&&!!o[n]||!!i&&!!o[i]}_conformsToType(e,t){const r=new RegExp(`^${(0,C.Cj)(t)}$`,"i");return e.conformsTo.some(e=>r.test(e))??!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:b.$,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const t=e?.components?.parameters;return t?.limit?.schema?.maximum??t?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const t=e.storageCrs??I.QE,r=(0,I.J0)(t);return null==r?p.A.WGS84:new p.A({wkid:r})}_getSupportedSpatialReferences(e,t){const r="#/crs",i=e.crs??[I.QE],n=i.includes(r)?i.filter(e=>e!==r).concat(t.crs??[]):i,o=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return n.filter(e=>!o.test(e))}async _loadOGCServices(e,t){const r=null!=t?t.signal:null,{apiKey:i,collectionId:n,customParameters:s,fields:a,geometryType:l,hasZ:p,objectIdField:c,timeInfo:d,url:y}=e,f={fields:a?.map(e=>e.toJSON()),geometryType:u.Ye.toJSON(l),hasZ:p,objectIdField:c,timeInfo:d?.toJSON()},g={apiKey:i,customParameters:s,signal:r},m=await(0,I.Ki)(y,g),[h,v]=await Promise.all([(0,I.Px)(m,g),(0,I.CJ)(m,g)]);if(!this._conformsToType(h,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new o.A("ogc-feature-layer:no-geojson-support","Server does not support geojson");const w=v.collections.find(({id:e})=>e===n);if(!w)throw new o.A("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const b=this._conformsToType(h,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await(0,I.GA)(m,g):null,T=await(0,I.GL)(w,f,g),S=this._getMaxRecordCount(b),F=this._getCapabilities(T.hasZ,S),M=this._getStorageSpatialReference(w).toJSON(),A=this._getSupportedSpatialReferences(w,v),x=new RegExp(`^${(0,C.Cj)(I.vJ)}`,"i"),O={};for(const e of A){const t=(0,I.J0)(e);null!=t&&(O[t]||(O[t]=e.replace(x,"")))}this.featureDefinition={capabilities:F,collection:w,layerDefinition:T,spatialReference:M,supportedCrs:O}}};(0,i.Cg)([(0,a.MZ)()],S.prototype,"featureDefinition",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],S.prototype,"layer",void 0),(0,i.Cg)([(0,a.MZ)()],S.prototype,"type",void 0),S=(0,i.Cg)([(0,a.$K)("esri.layers.graphics.sources.OGCFeatureSource")],S);var F=r(52136),M=r(63074),A=r(69208),x=r(6455),O=r(87718),P=r(56658),j=r(16131),E=r(32756),Z=r(8303),R=r(54310),D=r(25036),N=r(82935),G=r(63396),_=r(10873),U=r(33143),k=r(20437),B=r(17036),L=r(30524),$=r(46499),K=r(39383),q=r(41214),J=r(61956),Q=r(30291);const z=(0,B.p)();let H=class extends((0,x.FJ)((0,F.p)((0,A.d)((0,P.J)((0,O.F)((0,M.dM)((0,E.fY)((0,N.e)((0,G.d)((0,D.j)((0,j.q)((0,Z.A)((0,R.J)((0,s.M)(v.A))))))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new h(this),this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new S({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){return this.maxRecordCount??this.capabilities?.query.maxRecordCount??5e3}get isTable(){return this.loaded&&null==this.geometryType}set renderer(e){(0,L.yp)(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return(0,Q.tn)(this,e)}createQuery(){return new J.A}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){let r,i=!1;const n=t?.feature?.attributes,o=this.typeIdField&&n?.[this.typeIdField];return null!=o&&this.types&&(i=this.types.some(t=>t.id==o&&(r=t.domains?.[e],"inherited"===r?.type&&(r=this._getLayerDomain(e)),!0))),i||r||(r=this._getLayerDomain(e)),r}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(J.A.from(e)||this.createQuery(),t)).then(e=>(e?.features?.forEach(e=>{e.layer=e.sourceLayer=this,e.origin=this.graphicOrigin}),e))}async queryAttributeBins(e,t){throw new o.A("OGCFeatureLayer","Layer source does not support queryAttributeBins capability")}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),(0,L.yp)(this.renderer,this.fieldsIndex),(0,L.sv)(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const t of this.fields)if(t.name===e&&t.domain)return t.domain;return null}};(0,i.Cg)([(0,a.MZ)({readOnly:!0,json:{origins:{service:{read:!0}}}})],H.prototype,"capabilities",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],H.prototype,"collectionId",void 0),(0,i.Cg)([(0,a.MZ)({type:String})],H.prototype,"copyright",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],H.prototype,"defaultPopupTemplate",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],H.prototype,"description",void 0),(0,i.Cg)([(0,a.MZ)({type:String})],H.prototype,"displayField",void 0),(0,i.Cg)([(0,a.MZ)({type:Number})],H.prototype,"effectiveMaxRecordCount",null),(0,i.Cg)([(0,a.MZ)(_.Yj)],H.prototype,"elevationInfo",void 0),(0,i.Cg)([(0,a.MZ)({type:[k.A],json:{origins:{service:{name:"layerDefinition.fields"}}}})],H.prototype,"fields",void 0),(0,i.Cg)([(0,a.MZ)(z.fieldsIndex)],H.prototype,"fieldsIndex",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0,type:l.A,json:{origins:{service:{name:"layerDefinition.extent"}}}})],H.prototype,"fullExtent",void 0),(0,i.Cg)([(0,a.MZ)({type:u.gy.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:u.gy.read}}}}})],H.prototype,"geometryType",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0,clonable:!1})],H.prototype,"graphicOrigin",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],H.prototype,"hasZ",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,readOnly:!0})],H.prototype,"isTable",null),(0,i.Cg)([(0,a.MZ)({type:[$.A],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:K.w},write:!0}}}})],H.prototype,"labelingInfo",void 0),(0,i.Cg)([(0,a.MZ)(_.kF)],H.prototype,"labelsVisible",void 0),(0,i.Cg)([(0,a.MZ)(_.fV)],H.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,a.MZ)({type:Number})],H.prototype,"maxRecordCount",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],H.prototype,"objectIdField",void 0),(0,i.Cg)([(0,a.MZ)({type:["OGCFeatureLayer"]})],H.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,a.MZ)(_.M6)],H.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,a.MZ)({type:n.A,json:{name:"popupInfo",write:!0}})],H.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,a.MZ)({types:q.Hg,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:q.XJ,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],H.prototype,"renderer",null),(0,i.Cg)([(0,a.MZ)(_.PY)],H.prototype,"screenSizePerspectiveEnabled",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],H.prototype,"source",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0,type:p.A,json:{origins:{service:{read:!0}}}})],H.prototype,"spatialReference",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],H.prototype,"title",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],H.prototype,"type",void 0),(0,i.Cg)([(0,a.MZ)({type:String,readOnly:!0})],H.prototype,"typeIdField",void 0),(0,i.Cg)([(0,a.MZ)({type:[U.A]})],H.prototype,"types",void 0),(0,i.Cg)([(0,a.MZ)(_.OZ)],H.prototype,"url",void 0),H=(0,i.Cg)([(0,a.$K)("esri.layers.OGCFeatureLayer")],H);const W=H},67482(e,t,r){function i(e){return null!=a(e)||null!=s(e)}function n(e){return l.test(e)}function o(e){return a(e)??s(e)}function s(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let r=!0;if(u&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,i=0;for(;!t&&i<=e.length;)t=!p.test(e[i]),i++;r=!t}}return r}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=l.exec(e);if(!t?.groups)return null;const r=t.groups,i=+r.year,n=+r.month-1,o=+r.day,s=+(r.hours??"0"),a=+(r.minutes??"0"),p=+(r.seconds??"0");if(s>23)return null;if(a>59)return null;if(p>59)return null;const u=r.ms??"0",c=u?+u.padEnd(3,"0").slice(0,3):0;let d;if(r.isUTC||!r.offsetSign)d=Date.UTC(i,n,o,s,a,p,c);else{const e=+r.offsetHours,t=+r.offsetMinutes;d=6e4*("+"===r.offsetSign?-1:1)*(60*e+t)+Date.UTC(i,n,o,s,a,p,c)}return Number.isNaN(d)?null:d}r.d(t,{Br:()=>n,Cq:()=>i,_U:()=>o});const l=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,p=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,u=!Number.isNaN(new Date("technology 10").getTime())},69208(e,t,r){r.d(t,{d:()=>o});var i=r(5482),n=r(91429);const o=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,i.Cg)([(0,n.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,i.Cg)([(0,n.$K)("esri.layers.mixins.CustomParametersMixin")],r),r}},75321(e,t,r){r.d(t,{CJ:()=>S,GA:()=>A,GL:()=>T,I:()=>P,J0:()=>x,Ki:()=>M,Px:()=>F,QE:()=>b,bW:()=>O,vJ:()=>I});var i=r(11254),n=r(49186),o=r(53966),s=r(84952),a=r(16930),l=r(21325),p=r(28735),u=r(90708),c=r(58512),d=r(85113),y=r(64714),f=r(82832),g=r(95466),m=r(98453),h=r(98623);const v=()=>o.A.getLogger("esri.layers.ogc.ogcFeatureUtils"),w="startindex",C=new Set([w,"offset"]),I="http://www.opengis.net/def/crs/",b=`${I}OGC/1.3/CRS84`;async function T(e,t,r={},o=5){const{links:a}=e,l=D(a,"items","application/geo+json")||D(a,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(null==l)throw new n.A("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:p,customParameters:u,signal:c}=r,f=(0,s.s2)(l.href,e.landingPage.url),C={limit:o,...u,token:p},I=(0,s.a6)(f,C),{data:b}=await(0,i.A)(I,{signal:c,headers:{accept:"application/geo+json"}}),T=N(I,o,b.links)??w;(0,d.sO)(b);const S=b.numberMatched,F=(0,d.BM)(b,{geometryType:t.geometryType}),M=t.fields||F.fields||[],A=null!=t.hasZ?t.hasZ:F.hasZ,x=F.geometryType,O=t.objectIdField||F.objectIdFieldName||"OBJECTID";let P=t.timeInfo;const j=M.find(({name:e})=>e===O);if(j)j.editable=!1,j.nullable=!1;else{if(!F.objectIdFieldType)throw new n.A("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");M.unshift({name:O,alias:O,type:"number"===F.objectIdFieldType?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(O!==F.objectIdFieldName){const e=M.find(({name:e})=>e===F.objectIdFieldName);e&&(e.type="esriFieldTypeInteger")}M===F.fields&&F.unknownFields.length>0&&v().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:F.unknownFields}});for(const e of M){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),"esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type&&(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable),!e.name)throw new n.A("ogc-feature-layer:invalid-field-name","field name is missing",{field:e});if(!m.m.jsonValues.includes(e.type))throw new n.A("ogc-feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e})}if(P){const e=new g.A(M);if(P.startTimeField){const t=e.get(P.startTimeField);t?(P.startTimeField=t.name,t.type="esriFieldTypeDate"):P.startTimeField=null}if(P.endTimeField){const t=e.get(P.endTimeField);t?(P.endTimeField=t.name,t.type="esriFieldTypeDate"):P.endTimeField=null}if(P.trackIdField){const t=e.get(P.trackIdField);t?P.trackIdField=t.name:(P.trackIdField=null,v().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:P}}))}P.timeReference||={timeZoneIANA:h.n$},P.startTimeField||P.endTimeField||(v().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:P}}),P=void 0)}return{drawingInfo:x?(0,y.F0)(x):null,extent:R(e),geometryType:x,fields:M,hasZ:!!A,objectIdField:O,paginationParameter:T,timeInfo:P,featureCount:S}}async function S(e,t={}){const{links:r,url:o}=e,a=D(r,"data","application/json")??D(r,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(!a)throw new n.A("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:l,customParameters:p,signal:u}=t,c=(0,s.s2)(a.href,o),{data:d}=await(0,i.A)(c,{signal:u,headers:{accept:"application/json"},query:{...p,token:l}});for(const t of d.collections)t.landingPage=e;return d}async function F(e,t={}){const{links:r,url:o}=e,a=D(r,"conformance","application/json")||D(r,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(null==a)throw new n.A("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:l,customParameters:p,signal:u}=t,c=(0,s.s2)(a.href,o),{data:d}=await(0,i.A)(c,{signal:u,headers:{accept:"application/json"},query:{...p,token:l}});return d}async function M(e,t={}){const{apiKey:r,customParameters:n,signal:o}=t,{data:s}=await(0,i.A)(e,{signal:o,headers:{accept:"application/json"},query:{...n,token:r}});return s.url=e,s}async function A(e,t={}){const{links:r,url:n}=e,o=D(r,"service-desc","application/vnd.oai.openapi+json;version=3.0");if(null==o)return v().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:a,customParameters:l,signal:p}=t,u=(0,s.s2)(o.href,n),{data:c}=await(0,i.A)(u,{signal:p,headers:{accept:"application/vnd.oai.openapi+json;version=3.0"},query:{...l,token:a}});return c}function x(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?<authority>.*)\/(?<version>.*)\/(?<code>.*)$/i.exec(e),r=t?.groups;if(!r)return null;const{authority:i,code:n}=r;switch(i.toLowerCase()){case"ogc":switch(n.toLowerCase()){case"crs27":return a.A.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return a.A.WGS84.wkid;default:return null}case"esri":case"epsg":{const e=Number.parseInt(n,10);return Number.isNaN(e)?null:e}default:return null}}async function O(e,t,r){const i=await P(e,t,r);return(0,u.ZF)(i)}async function P(e,t,r){const{collection:{links:o,landingPage:{url:y}},layerDefinition:m,maxRecordCount:h,queryParameters:{apiKey:v,customParameters:w},spatialReference:C,supportedCrs:I}=e,b=D(o,"items","application/geo+json")||D(o,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(!b)throw new n.A("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:T,num:S,start:F,timeExtent:M,where:A}=t;if(t.objectIds)throw new n.A("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const x=a.A.fromJSON(C),O=t.outSpatialReference??x,P=O.isWGS84?null:j(O,I),E=Z(T,I),R=function(e){if(!e)return null;const{start:t,end:r}=e;return`${null!=t?t.toISOString():".."}/${null!=r?r.toISOString():".."}`}(M),N=(H=A)&&"1=1"!==H?H:null,G=S??(null==F?h:10),_=0===F?void 0:F,{fields:U,geometryType:k,hasZ:B,objectIdField:L,paginationParameter:$}=m,K=(0,s.s2)(b.href,y),{data:q}=await(0,i.A)(K,{...r,query:{...w,...E,crs:P,datetime:R,query:N,limit:G,[$]:_,token:v},headers:{accept:"application/geo+json"}}),J=(0,d.bd)(q,{geometryType:k,hasZ:B,objectIdField:L}),Q=J.length===G&&!!D(q.links??[],"next","application/geo+json"),z=new g.A(U);var H;for(const e of J){const t={};(0,f.MB)(z,t,e.attributes,!0);for(const e of z.fields)e.nullable&&!(e.name in t)&&(t[e.name]=null);t[L]=e.attributes[L],e.attributes=t}if(!P&&O.isWebMercator)for(const e of J)if(null!=e.geometry&&null!=k){const t=(0,u.zv)(e.geometry,k,B,!1);t.spatialReference=a.A.WGS84,e.geometry=(0,u.Ux)((0,p.Cv)(t,O))}for(const e of J)e.objectId=e.attributes[L];const W=P||!P&&O.isWebMercator?O.toJSON():l.KK,V=new c.A;return V.exceededTransferLimit=Q,V.features=J,V.fields=U,V.geometryType=k,V.hasZ=B,V.spatialReference=W,V}function j(e,t){const{isWebMercator:r,wkid:i,latestWkid:n}=e;if(!i&&!n)return null;const o=r?t[3857]??t[102100]??t[102113]??t[900913]:i&&t[i]||n&&t[n];return o?`${I}${o}`:null}function E(e){if(!e)return"";const{xmin:t,ymin:r,xmax:i,ymax:n}=e;return`${t},${r},${i},${n}`}function Z(e,t){if(!function(e){return null!=e&&"extent"===e.type}(e))return null;const{spatialReference:r}=e;if(!r||r.isWGS84)return{bbox:E(e)};const i=j(r,t);return null!=i?{bbox:E(e),"bbox-crs":i}:r.isWebMercator?{bbox:E((0,p.Cv)(e,a.A.WGS84))}:null}function R(e){const t=e.extent?.spatial;if(!t)return null;const r=t.bbox[0],i=4===r.length,[n,o]=r,s=i?void 0:r[2];return{xmin:n,ymin:o,xmax:i?r[2]:r[3],ymax:i?r[3]:r[4],zmin:s,zmax:i?void 0:r[5],spatialReference:a.A.WGS84.toJSON()}}function D(e,t,r){return e.find(({rel:e,type:i})=>e===t&&i===r)??e.find(({rel:e,type:r})=>e===t&&!r)}function N(e,t,r){if(!r)return;const i=D(r,"next","application/geo+json"),n=(0,s.An)(i?.href)?.query;if(!n)return;const o=(0,s.An)(e).query,a=Object.keys(o??{}),l=Object.entries(n).filter(([e])=>!a.includes(e)).find(([e,r])=>C.has(e.toLowerCase())&&Number.parseInt(r,10)===t),p=l?.[0];return p}},82832(e,t,r){r.d(t,{$1:()=>m,CR:()=>g,MB:()=>d,PC:()=>h,Yx:()=>l,bP:()=>u});var i=r(67482),n=r(21325),o=r(30524);class s{constructor(e){this.description=e,this.code=null}}class a{constructor(e){this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error=new s(e)}}function l(e){return new a(e)}class p{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function u(e){return new p(e)}const c=new Set;function d(e,t,r,i=!1){c.clear();for(const n in r){const s=e.get(n);if(!s)continue;const a=y(s,r[n]);if(c.add(s.name),s&&(i||s.editable)){const e=(0,o.CJ)(s,a);if(e)return l((0,o.uo)(e,s,a));t[s.name]=a}}for(const t of e.requiredFields??[])if(!c.has(t.name))return l(`missing required field "${t.name}"`);return null}function y(e,t){let r=t;return(0,o.WA)(e)&&"string"==typeof t?r=parseFloat(t):(0,o.yM)(e)&&null!=t&&"string"!=typeof t?r=String(t):(0,o.vE)(e)&&"string"==typeof t&&(r=(0,i._U)(t)),(0,o.WX)(r)}let f;function g(e,t){if(!e||!(0,n.fn)(t))return e;if("rings"in e||"paths"in e){if(null==f)throw new TypeError("geometry engine not loaded");return f.simplify(t,e)}return e}async function m(e,t){!(0,n.fn)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==f&&(f=await r.e(1023).then(r.bind(r,81023))),f}()}const h={supportsAutoInt