@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
1 lines • 411 kB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4104,6061],{5808(e,t,s){s.d(t,{O:()=>i});const i={geodesic:0,loxodrome:1,"great-elliptic":2,"normal-section":3,"shape-preserving":4}},6797(e,t,s){s.d(t,{Ui:()=>d});var i=s(69622),r=s(7762),n=s(88620);const o=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function a(e){return e instanceof i.A}function h(e){return e instanceof r.A?Object.keys(e.items):a(e)?(0,n.oY)(e).keys():e?Object.keys(e):[]}function c(e,t){return e instanceof r.A?e.items[t]:e[t]}function l(e){return e?e.declaredClass:null}function u(e,t){const s=e.diff;if(s&&"function"==typeof s)return s(e,t);const i=h(e),r=h(t);if(0===i.length&&0===r.length)return;if(!i.length||!r.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const n=r.filter(e=>!i.includes(e)),d=i.filter(e=>!r.includes(e)),p=i.filter(s=>r.includes(s)&&c(e,s)!==c(t,s)).concat(n,d).sort(),f=l(e);if(f&&o.has(f)&&p.length)return{type:"complete",oldValue:e,newValue:t};let _;const m=a(e)&&a(t);for(const i of p){const r=c(e,i),n=c(t,i);let o;if((m||"function"!=typeof r&&"function"!=typeof n)&&r!==n&&(null!=r||null!=n)){if(s&&s[i]&&"function"==typeof s[i])o=s[i]?.(r,n);else if(r instanceof Date&&n instanceof Date){if(r.getTime()===n.getTime())continue;o={type:"complete",oldValue:r,newValue:n}}else o="object"==typeof r&&"object"==typeof n&&l(r)===l(n)?u(r,n):{type:"complete",oldValue:r,newValue:n};null!=o&&(null!=_?_.diff[i]=o:_={type:"partial",diff:{[i]:o}})}}return _}function d(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&l(e)!==l(t)?{type:"complete",oldValue:e,newValue:t}:u(e,t)}},30624(e,t,s){s.r(t),s.d(t,{createConnection:()=>S});var i=s(5482),r=s(11254),n=s(49186),o=s(53966),a=s(74887),h=s(84952),c=s(91429),l=s(16930),u=s(65864),d=s(62815),p=s(65529);let f=class extends p.nJ{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new n.A("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,i.Cg)([(0,c.MZ)({readOnly:!0})],f.prototype,"connectionError",null),f=(0,i.Cg)([(0,c.$K)("esri.layers.support.StreamConnection")],f);let _=class extends f{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:i}=e;this._config=e,this._featureZScaler=(0,d.N)(t,i,s),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case 0:case 1:return"connected";case 2:case 3:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,s=0){try{if(this.destroyed)return;const t=(0,h.a6)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(i){const r=t/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(o.A.getLogger(this).error(new n.A("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(o.A.getLogger(this).error(new n.A("websocket-connection",`Failed to connect. Attempting to reconnect in ${r}s`,i)),await(0,a.Pl)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void o.A.getLogger(this).error(new n.A("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise((t,s)=>{const i=new WebSocket(e);i.onopen=()=>{if(i.onopen=null,this.destroyed)return i.onclose=null,void i.close();i.onclose=e=>this._onClose(e),i.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(i),t(i)},i.onclose=e=>{i.onopen=i.onclose=null,s(e)}})}async _handshake(e=1e4){const t=this._websocket;if(null==t)return;const s=(0,a.Tw)(),i=t.onmessage,{filter:r,outFields:h,spatialReference:c}=this._config;return s.timeout(e),t.onmessage=e=>{let a=null;try{a=JSON.parse(e.data)}catch(e){}a&&"object"==typeof a||(o.A.getLogger(this).error(new n.A("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),s.reject(),this.destroy()),a.spatialReference?.wkid!==c?.wkid&&(o.A.getLogger(this).error(new n.A("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${c.wkid}`,e.data)),s.reject(),this.destroy()),"json"!==a.format&&(o.A.getLogger(this).error(new n.A("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),s.reject(),this.destroy()),r&&a.filter!==r&&o.A.getLogger(this).error(new n.A("websocket-connection","Tried to set filter, but server doesn't support it")),h&&a.outFields!==h&&o.A.getLogger(this).error(new n.A("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=i;for(const e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],s.resolve()},t.send(JSON.stringify({filter:r,outFields:h,format:"json",spatialReference:{wkid:c.wkid}})),s.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),o.A.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&o.A.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,i.Cg)([(0,c.MZ)()],_.prototype,"connectionStatus",null),(0,i.Cg)([(0,c.MZ)()],_.prototype,"errorString",void 0),_=(0,i.Cg)([(0,c.$K)("esri.layers.graphics.sources.connections.WebSocketConnection")],_);var m=s(80893),g=s(61956);const y={maxQueryDepth:5,maxRecordCountFactor:3};let x=class extends _{constructor(e){super({...y,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||o.A.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:s,outFields:i}=this._config;this.destroyed||this._setFilter(s,i)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void o.A.getLogger(this).error(new n.A("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},s=(0,r.A)(e.path,{query:t,responseType:"json"}),i=(await s).data;return this._serviceDefinition=i,i}_fetchWebSocketUrl(e,t){const s=e[0],{urls:i,token:r}=s,n=this._inferWebSocketBaseUrl(i);return(0,h.a6)(`${n}/subscribe`,{outSR:""+t.wkid,token:r})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return o.A.getLogger(this).error(new n.A("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const s=this._websocket;if(null==s||null==e&&null==t)return;const i=JSON.stringify({filter:this._serializeFilter(e,t)});let r=!1;const h=(0,a.Tw)();return s.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(o.A.getLogger(this).error(new n.A("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),h.reject(t.error)),this._setWebSocketJSONParseHandler(s),r=!0,h.resolve())},s.send(i),setTimeout(()=>{r||(this.destroyed||this._websocket!==s||o.A.getLogger(this).error(new n.A("geoevent-connection","Server timed out when setting filter")),h.reject())},1e4),h.promise}_serializeFilter(e,t){const s={};if(null==e&&null==t)return s;if(e?.geometry)try{const t=(0,u.rS)(e.geometry);if("extent"!==t.type)throw new n.A("geoevent-connection",`Expected extent but found type ${t.type}`);s.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){o.A.getLogger(this).error(new n.A("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(s.where=e.where),null!=t&&(s.outFields=t.join(",")),s}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,s=e.attributes[t],i=this._relatedFeatures.get(s);if(!i)return o.A.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:r,geometry:a}=i;for(const t in r)e.attributes[t]=r[t];return a&&(e.geometry=a),e.geometry||e.centroid||o.A.getLogger(this).error(new n.A("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,s=this._queryRelatedFeatures(e),i=this._queryArchive(t);await s;const r=await i;if(!r)return;for(const e of r.features)this.onFeature(this._enrich(e))}catch(e){o.A.getLogger(this).error(new n.A("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([s.e(7632),s.e(3508),s.e(6554),s.e(2869),s.e(3910),s.e(9953),s.e(4903),s.e(1214),s.e(8399),s.e(1017),s.e(4674),s.e(6606),s.e(9784),s.e(7609),s.e(812),s.e(9550)]).then(s.bind(s,29784))).default)({url:e}),{capabilities:i}=await t.load(),r=i.query.supportsMaxRecordCountFactor,n=i.query.supportsPagination,o=i.query.supportsCentroid,a=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,c=r?h*a:h,u=new g.A;if(u.outFields=this._config.outFields??["*"],u.where=this._config.filter?.where??"1=1",u.returnGeometry=!0,u.returnExceededLimitFeatures=!0,u.outSpatialReference=l.A.fromJSON(this._config.spatialReference),o&&(u.returnCentroid=!0),r&&(u.maxRecordCountFactor=a),n)return u.num=c,t.destroy(),this._queryPages(e,u);const d=await(0,m.eW)(e,u,this._config.sourceSpatialReference);return t.destroy(),d}async _queryPages(e,t,s=[],i=0){t.start=null!=t.num?i*t.num:null;const r=await(0,m.eW)(e,t,this._config.sourceSpatialReference);return r.exceededTransferLimit&&i<(this._config.maxQueryDepth??0)?(r.features.forEach(e=>s.push(e)),this._queryPages(e,t,s,i+1)):(s.forEach(e=>r.features.push(e)),r)}_addRelatedFeatures(e){const t=new Map,s=e.features,i=this._serviceDefinition.relatedFeatures.joinField;for(const e of s){const s=e.attributes[i];t.set(s,e)}this._relatedFeatures=t}};x=(0,i.Cg)([(0,c.$K)("esri.layers.graphics.sources.connections.GeoEventConnection")],x);var b=s(64108);let w=class extends f{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:i}=e;this._featureZScaler=(0,d.N)(t,i,s)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function v(e,t){if(null==e&&null==t)return null;const s={};return null!=t&&(s.geometry=t),null!=e&&(s.where=e),s}function S(e,t,s,i,r,n,o,a,h){const c={source:e,sourceSpatialReference:t,spatialReference:s,geometryType:i,filter:v(r,n),maxReconnectionAttempts:o,maxReconnectionInterval:a,customParameters:h};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new _(c):new x(c):new w(c)}(0,i.Cg)([(0,c.MZ)()],w.prototype,"connectionStatus",void 0),(0,i.Cg)([(0,c.MZ)()],w.prototype,"errorString",void 0),w=(0,i.Cg)([(0,b.$)("esri.layers.support.ClientSideConnection")],w)},32730(e,t,s){s.d(t,{BI:()=>p,D3:()=>u,XJ:()=>d,lc:()=>l,mX:()=>_,rU:()=>f,tH:()=>b});var i=s(799);const r="__begin__",n="__end__",o=new RegExp(r,"ig"),a=new RegExp(n,"ig"),h=new RegExp("^"+r,"i"),c=new RegExp(n+"$","i");function l(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function u(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function d(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=l(e.labelExpression),t.type="conventional"),t}function p(e){const t=d(e);if(!t)return null;switch(t.type){case"conventional":return _(t.expression);case"arcade":return t.expression}return null}function f(e){const t=d(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(m);return t?.[1].trim()||null}(t.expression);case"arcade":return b(t.expression)}return null}function _(e){let t;return e?(t=(0,i.HC)(e,e=>r+'$feature["'+e+'"]'+n),t=h.test(t)?t.replace(h,""):'"'+t,t=c.test(t)?t.replace(c,""):t+'"',t=t.replaceAll(o,'" + ').replaceAll(a,' + "')):t='""',t}const m=/^\s*\{([^}]+)\}\s*$/i,g=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,y=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,x=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function b(e){if(!e)return null;let t=g.exec(e)||y.exec(e);return t?t[1]||t[3]:(t=x.exec(e),t?t[2]:null)}},37730(e,t,s){s.d(t,{T:()=>r});var i=s(43334);const r={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t,s)=>new i.Om(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)}},41560(e,t,s){s.d(t,{Ch:()=>o,mW:()=>n});var i=s(34727),r=s(39516);function n(e,t){return{...t,filterMode:e.mode}}function o(e,t,s){const n=function(e){if("manual"===c(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:s,maxScale:i}of e.filters)t[0]=Math.max(t[0],l(s)),t[1]=Math.min(t[1],u(i));return t}(e);if(n&&((0,i.gg)(t,n[0])||(0,i.ZH)(s,n[1])))return"";const o=Array.from(a(e,t,s)),h=function(e,t,s){if(0===e.length)return!0;const r=l(e.at(0)?.minScale),n=u(e.at(-1)?.maxScale);if((0,i.ZH)(r,t)||(0,i.gg)(n,s))return!0;for(let t=0;t<e.length-1;t++){const s=e[t],r=e[t+1];if((0,i.ZH)(l(r.minScale),u(s.maxScale)))return!0}return!1}(o,t,s)?"1=1":o.map(e=>e.where||"1=1").reduce((e,t)=>(0,r.IW)(e,t),"");return h&&"1=1"!==h?h:""}function*a(e,t,s){if("manual"===c(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)h(i.minScale,i.maxScale,t,s)&&(yield i)}}function h(e,t,s,r){return e=l(e),s=l(s),t=u(t),!(!(0,i.Sp)(s,e)&&(r??s)>e||(0,i.Hx)(t,s)||void 0!==r&&(0,i.Sp)(r,e))}function c(e){return"mode"in e?e.mode:e.filterMode}function l(e){return e||Number.POSITIVE_INFINITY}function u(e){return e||0}},44159(e,t,s){s.d(t,{A:()=>r});var i=s(93687);class r{static{this.pool=new i.A(()=>new r(""),null,null,25,50)}static getId(e,t,s,i){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${s}/${i}`}constructor(e,t,s,i){this.set(e,t,s,i)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,s=63&this.level;return(3&this.world)<<30|t<<22|e<<8|s}acquire(e,t,s,i){this.set(e,t,s,i)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){const t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new r(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,s,i){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,s,i,r]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(s),this.col=parseFloat(i),this.world=parseFloat(r)}else this.level=+e,this.row=+t,this.col=+s,this.world=+i||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new r(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,t,s){const i=this.clone();return i.col+=e,i.row+=t,s.normalizeKey(i),i}getChildKeys(){const e=this.level+1,t=this.row<<1,s=this.col<<1,i=this.world;return[new r(e,t,s,i),new r(e,t,s+1,i),new r(e,t+1,s,i),new r(e,t+1,s+1,i)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}},46140(e,t,s){s.d(t,{A:()=>r});var i=s(49186);class r{constructor(e,t,s=""){this.major=e,this.minor=t,this._context=s}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",s=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${s}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new r(this.major,this.minor,this._context)}static parse(e,t=""){const[s,n]=e.split("."),o=/^\s*\d+\s*$/;if(!s?.match||!o.test(s))throw new i.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n?.match||!o.test(n))throw new i.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const a=parseInt(s,10),h=parseInt(n,10);return new r(a,h,t)}}},55674(e,t,s){s.d(t,{Ad:()=>p,Gj:()=>m,QY:()=>d,lL:()=>g,xR:()=>f});var i=s(66131),r=s(49186),n=(s(44208),s(44729)),o=s(15032),a=s(65864),h=s(95466),c=s(43668),l=s(98623);const u=["geometry","scale","timeProperties"];function d(e,t){if(null!=t)for(const s of u)t.hasArcadeDependency(s)&&e.add(s);return e}function p(e,t){return _.create(e,t,null,["$feature","$view"])}function f(e,t,s){return _.create(e,t,s,["$feature","$view","$config"])}class _{static async create(e,t,s,i){const{arcade:n,Dictionary:o}=await(0,c.l)();let a;try{a=n.parseScript(e)}catch(t){throw new r.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const h=n.scriptUsesGeometryEngine(a);h&&await n.enableGeometrySupport(),await n.loadDependentModules(new Set,a,null,!1,h);const l={vars:i.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},u=n.compileScript(a,l);let d=null;null!=s&&(d=new o(s),d.immutable=!0);const p=new o;return p.immutable=!1,p.setField("scale",0),new _(e,n,a,u,t,p,d,o)}constructor(e,t,s,i,r,n,o,a){this.script=e,this._arcade=t,this._syntaxTree=s,this._compiled=i,this._spatialReference=r,this._viewDict=n,this._configDict=o,this._dictionaryCtor=a,this._dependencies=new Map,this._featureReader=new m,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const s=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:r,currentEnd:n}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=r?null!=s?i.lY.epochToArcadeDate(r,s):i.lY.unknownEpochToArcadeDate(r):void 0,currentEnd:null!=n?null!=s?i.lY.epochToArcadeDate(n,s):i.lY.unknownEpochToArcadeDate(n):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:s})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class m{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,s){const i=t??new h.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=s}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,a.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}_hasGeometry(){return null!=this._boundTarget.geometry}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===l.L5}field(e,t=!0){const s=this._getField(e);if(s){const t=this._boundTarget.attributes[s.name];if(null==t)return null;switch(s.type){case"date-only":case"esriFieldTypeDateOnly":return n.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return i.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?i.lY.unknownEpochToArcadeDate(t):i.lY.epochToArcadeDate(t,this.contextTimeZone??l.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}isEmpty(){return this._boundSchema.fields.length<=0&&!this._hasGeometry()}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const s in e)t.push({name:s,alias:s,type:"string"==typeof e[s]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},61691(e,t,s){s.d(t,{G:()=>i});class i{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}},67482(e,t,s){function i(e){return null!=a(e)||null!=o(e)}function r(e){return h.test(e)}function n(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let s=!0;if(l&&/\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=!c.test(e[i]),i++;s=!t}}return s}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=h.exec(e);if(!t?.groups)return null;const s=t.groups,i=+s.year,r=+s.month-1,n=+s.day,o=+(s.hours??"0"),a=+(s.minutes??"0"),c=+(s.seconds??"0");if(o>23)return null;if(a>59)return null;if(c>59)return null;const l=s.ms??"0",u=l?+l.padEnd(3,"0").slice(0,3):0;let d;if(s.isUTC||!s.offsetSign)d=Date.UTC(i,r,n,o,a,c,u);else{const e=+s.offsetHours,t=+s.offsetMinutes;d=6e4*("+"===s.offsetSign?-1:1)*(60*e+t)+Date.UTC(i,r,n,o,a,c,u)}return Number.isNaN(d)?null:d}s.d(t,{Br:()=>r,Cq:()=>i,_U:()=>n});const h=/^(?:(?<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})))?$/,c=/^((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,l=!Number.isNaN(new Date("technology 10").getTime())},72691(e,t,s){s.d(t,{Aw:()=>o,DN:()=>i,EA:()=>n,Gm:()=>r,xq:()=>a});const i="__esri_stream_id__",r="__esri_timestamp__",n="__esri_track_part__",o="__esri_time_received__",a="__esri_track_line__"},73681(e,t,s){s.d(t,{n:()=>h});var i=s(49186),r=s(53966),n=s(46140),o=s(95466),a=s(55674);class h{static async from(e,t,s){const o=e.dictionary_version?n.A.parse(e.dictionary_version):null,l=new Set(e.itemsNames),u={};if(t)for(const e in t)u[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)u.hasOwnProperty(t.name)||(u[t.name]=t.value);const d=new Set(e.authoringInfo.symbol);for(const e of Object.keys(s))d.delete(e);d.size&&r.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:d});const p=await(0,a.xR)(e.expression,null,u);if(!p)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const f=!o||!o.greaterEqual(4,0);f&&r.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const _=new c(s,f);return new h(f,l,p,_)}constructor(e,t,s,i){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=s,this._reader=i}get itemNames(){return this._itemNames}evaluate(e,t,s,i){try{return this._reader.bind(e,s,i),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){r.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new o.A(t)}}class c extends a.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},75321(e,t,s){s.d(t,{CJ:()=>I,GA:()=>k,GL:()=>S,I:()=>T,J0:()=>C,Ki:()=>M,Px:()=>P,QE:()=>v,bW:()=>A,vJ:()=>w});var i=s(11254),r=s(49186),n=s(53966),o=s(84952),a=s(16930),h=s(21325),c=s(28735),l=s(90708),u=s(58512),d=s(85113),p=s(64714),f=s(82832),_=s(95466),m=s(98453),g=s(98623);const y=()=>n.A.getLogger("esri.layers.ogc.ogcFeatureUtils"),x="startindex",b=new Set([x,"offset"]),w="http://www.opengis.net/def/crs/",v=`${w}OGC/1.3/CRS84`;async function S(e,t,s={},n=5){const{links:a}=e,h=R(a,"items","application/geo+json")||R(a,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(null==h)throw new r.A("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:c,customParameters:l,signal:u}=s,f=(0,o.s2)(h.href,e.landingPage.url),b={limit:n,...l,token:c},w=(0,o.a6)(f,b),{data:v}=await(0,i.A)(w,{signal:u,headers:{accept:"application/geo+json"}}),S=L(w,n,v.links)??x;(0,d.sO)(v);const I=v.numberMatched,P=(0,d.BM)(v,{geometryType:t.geometryType}),M=t.fields||P.fields||[],k=null!=t.hasZ?t.hasZ:P.hasZ,C=P.geometryType,A=t.objectIdField||P.objectIdFieldName||"OBJECTID";let T=t.timeInfo;const F=M.find(({name:e})=>e===A);if(F)F.editable=!1,F.nullable=!1;else{if(!P.objectIdFieldType)throw new r.A("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");M.unshift({name:A,alias:A,type:"number"===P.objectIdFieldType?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(A!==P.objectIdFieldName){const e=M.find(({name:e})=>e===P.objectIdFieldName);e&&(e.type="esriFieldTypeInteger")}M===P.fields&&P.unknownFields.length>0&&y().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:P.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 r.A("ogc-feature-layer:invalid-field-name","field name is missing",{field:e});if(!m.m.jsonValues.includes(e.type))throw new r.A("ogc-feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e})}if(T){const e=new _.A(M);if(T.startTimeField){const t=e.get(T.startTimeField);t?(T.startTimeField=t.name,t.type="esriFieldTypeDate"):T.startTimeField=null}if(T.endTimeField){const t=e.get(T.endTimeField);t?(T.endTimeField=t.name,t.type="esriFieldTypeDate"):T.endTimeField=null}if(T.trackIdField){const t=e.get(T.trackIdField);t?T.trackIdField=t.name:(T.trackIdField=null,y().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:T}}))}T.timeReference||={timeZoneIANA:g.n$},T.startTimeField||T.endTimeField||(y().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:T}}),T=void 0)}return{drawingInfo:C?(0,p.F0)(C):null,extent:O(e),geometryType:C,fields:M,hasZ:!!k,objectIdField:A,paginationParameter:S,timeInfo:T,featureCount:I}}async function I(e,t={}){const{links:s,url:n}=e,a=R(s,"data","application/json")??R(s,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(!a)throw new r.A("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:h,customParameters:c,signal:l}=t,u=(0,o.s2)(a.href,n),{data:d}=await(0,i.A)(u,{signal:l,headers:{accept:"application/json"},query:{...c,token:h}});for(const t of d.collections)t.landingPage=e;return d}async function P(e,t={}){const{links:s,url:n}=e,a=R(s,"conformance","application/json")||R(s,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(null==a)throw new r.A("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:h,customParameters:c,signal:l}=t,u=(0,o.s2)(a.href,n),{data:d}=await(0,i.A)(u,{signal:l,headers:{accept:"application/json"},query:{...c,token:h}});return d}async function M(e,t={}){const{apiKey:s,customParameters:r,signal:n}=t,{data:o}=await(0,i.A)(e,{signal:n,headers:{accept:"application/json"},query:{...r,token:s}});return o.url=e,o}async function k(e,t={}){const{links:s,url:r}=e,n=R(s,"service-desc","application/vnd.oai.openapi+json;version=3.0");if(null==n)return y().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:a,customParameters:h,signal:c}=t,l=(0,o.s2)(n.href,r),{data:u}=await(0,i.A)(l,{signal:c,headers:{accept:"application/vnd.oai.openapi+json;version=3.0"},query:{...h,token:a}});return u}function C(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?<authority>.*)\/(?<version>.*)\/(?<code>.*)$/i.exec(e),s=t?.groups;if(!s)return null;const{authority:i,code:r}=s;switch(i.toLowerCase()){case"ogc":switch(r.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(r,10);return Number.isNaN(e)?null:e}default:return null}}async function A(e,t,s){const i=await T(e,t,s);return(0,l.ZF)(i)}async function T(e,t,s){const{collection:{links:n,landingPage:{url:p}},layerDefinition:m,maxRecordCount:g,queryParameters:{apiKey:y,customParameters:x},spatialReference:b,supportedCrs:w}=e,v=R(n,"items","application/geo+json")||R(n,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(!v)throw new r.A("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:S,num:I,start:P,timeExtent:M,where:k}=t;if(t.objectIds)throw new r.A("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const C=a.A.fromJSON(b),A=t.outSpatialReference??C,T=A.isWGS84?null:F(A,w),E=z(S,w),O=function(e){if(!e)return null;const{start:t,end:s}=e;return`${null!=t?t.toISOString():".."}/${null!=s?s.toISOString():".."}`}(M),L=($=k)&&"1=1"!==$?$:null,D=I??(null==P?g:10),q=0===P?void 0:P,{fields:G,geometryType:N,hasZ:B,objectIdField:W,paginationParameter:U}=m,j=(0,o.s2)(v.href,p),{data:V}=await(0,i.A)(j,{...s,query:{...x,...E,crs:T,datetime:O,query:L,limit:D,[U]:q,token:y},headers:{accept:"application/geo+json"}}),Y=(0,d.bd)(V,{geometryType:N,hasZ:B,objectIdField:W}),H=Y.length===D&&!!R(V.links??[],"next","application/geo+json"),X=new _.A(G);var $;for(const e of Y){const t={};(0,f.MB)(X,t,e.attributes,!0);for(const e of X.fields)e.nullable&&!(e.name in t)&&(t[e.name]=null);t[W]=e.attributes[W],e.attributes=t}if(!T&&A.isWebMercator)for(const e of Y)if(null!=e.geometry&&null!=N){const t=(0,l.zv)(e.geometry,N,B,!1);t.spatialReference=a.A.WGS84,e.geometry=(0,l.Ux)((0,c.Cv)(t,A))}for(const e of Y)e.objectId=e.attributes[W];const Z=T||!T&&A.isWebMercator?A.toJSON():h.KK,Q=new u.A;return Q.exceededTransferLimit=H,Q.features=Y,Q.fields=G,Q.geometryType=N,Q.hasZ=B,Q.spatialReference=Z,Q}function F(e,t){const{isWebMercator:s,wkid:i,latestWkid:r}=e;if(!i&&!r)return null;const n=s?t[3857]??t[102100]??t[102113]??t[900913]:i&&t[i]||r&&t[r];return n?`${w}${n}`:null}function E(e){if(!e)return"";const{xmin:t,ymin:s,xmax:i,ymax:r}=e;return`${t},${s},${i},${r}`}function z(e,t){if(!function(e){return null!=e&&"extent"===e.type}(e))return null;const{spatialReference:s}=e;if(!s||s.isWGS84)return{bbox:E(e)};const i=F(s,t);return null!=i?{bbox:E(e),"bbox-crs":i}:s.isWebMercator?{bbox:E((0,c.Cv)(e,a.A.WGS84))}:null}function O(e){const t=e.extent?.spatial;if(!t)return null;const s=t.bbox[0],i=4===s.length,[r,n]=s,o=i?void 0:s[2];return{xmin:r,ymin:n,xmax:i?s[2]:s[3],ymax:i?s[3]:s[4],zmin:o,zmax:i?void 0:s[5],spatialReference:a.A.WGS84.toJSON()}}function R(e,t,s){return e.find(({rel:e,type:i})=>e===t&&i===s)??e.find(({rel:e,type:s})=>e===t&&!s)}function L(e,t,s){if(!s)return;const i=R(s,"next","application/geo+json"),r=(0,o.An)(i?.href)?.query;if(!r)return;const n=(0,o.An)(e).query,a=Object.keys(n??{}),h=Object.entries(r).filter(([e])=>!a.includes(e)).find(([e,s])=>b.has(e.toLowerCase())&&Number.parseInt(s,10)===t),c=h?.[0];return c}},76061(e,t,s){s.d(t,{S:()=>r});var i=s(61691);class r extends i.G{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},77085(e,t,s){s.d(t,{Hh:()=>a,fz:()=>l,g7:()=>h,s1:()=>o,zo:()=>c});var i=s(76061),r=s(83290);let n;function o(){return!!n&&(0,r.i)()}async function a(){if(!o()){const[e,t]=await Promise.all([Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(1088)]).then(s.bind(s,31088)),Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756)]).then(s.bind(s,15756)).then(e=>e.aP).then(({injectPe:e})=>e),(0,r.l)()]);n=new e.OperatorGeodeticDensifyByLength,t(r.p)}}function h(e,t,s,i){return n.execute(e,t,s,i,null)}function c(e,t,s,r){const o=n.executeMany(new i.S(e),t,s,r,null);return Array.from(o)}function l(){return n.supportsCurves()}},82832(e,t,s){s.d(t,{$1:()=>m,CR:()=>_,MB:()=>d,PC:()=>g,Yx:()=>h,bP:()=>l});var i=s(67482),r=s(21325),n=s(30524);class o{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 o(e)}}function h(e){return new a(e)}class c{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function l(e){return new c(e)}const u=new Set;function d(e,t,s,i=!1){u.clear();for(const r in s){const o=e.get(r);if(!o)continue;const a=p(o,s[r]);if(u.add(o.name),o&&(i||o.editable)){const e=(0,n.CJ)(o,a);if(e)return h((0,n.uo)(e,o,a));t[o.name]=a}}for(const t of e.requiredFields??[])if(!u.has(t.name))return h(`missing required field "${t.name}"`);return null}function p(e,t){let s=t;return(0,n.WA)(e)&&"string"==typeof t?s=parseFloat(t):(0,n.yM)(e)&&null!=t&&"string"!=typeof t?s=String(t):(0,n.vE)(e)&&"string"==typeof t&&(s=(0,i._U)(t)),(0,n.WX)(s)}let f;function _(e,t){if(!e||!(0,r.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,r.fn)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==f&&(f=await s.e(1023).then(s.bind(s,81023))),f}()}const g={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]}},85113(e,t,s){s.d(t,{BM:()=>P,bd:()=>M,sO:()=>I,xD:()=>u});var i=s(67482),r=s(49186),n=s(21325),o=s(90708),a=s(43334),h=s(92722),c=s(30524);const l={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function u(e){return l[e]}function*d(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*p(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function f(e){for(const t of e)if(t.length>2)return!0;return!1}function _(e){let t=0;for(let s=0;s<e.length;s++){const i=e[s],r=e[(s+1)%e.length];t+=i[0]*r[1]-r[0]*i[1]}return t<=0}function m(e){const t=e[0],s=e[e.length-1];t[0]===s[0]&&t[1]===s[1]&&t[2]===s[2]||e.push(t)}function g(e,t){const{coordinates:s,type:i}=e,r=t.hasZ??!1,n=!0;switch(i){case"Point":return new h.A([],[...s],r,!1);case"LineString":return(0,o.Ap)({paths:[s],hasZ:n},r,!1);case"MultiLineString":return(0,o.Ap)({paths:s,hasZ:n},r,!1);case"MultiPoint":return(0,o.PR)({points:s,hasZ:n},r,!1);case"Polygon":case"MultiPolygon":{const e=new h.A([],[],r,!1);for(const t of"Polygon"===i?[s]:s){y(e,t[0],r);for(let s=1;s<t.length;s++)x(e,t[s],r)}return e}}}function y(e,t,s){m(t),function(e){return!_(e)}(t)?w(e,t,s):b(e,t,s)}function x(e,t,s){m(t),function(e){return _(e)}(t)?w(e,t,s):b(e,t,s)}function b(e,t,s){for(const i of t)v(e,i,s);e.lengths.push(t.length)}function w(e,t,s){for(let i=t.length-1;i>=0;i--)v(e,t[i],s);e.lengths.push(t.length)}function v(e,[t,s,i],r){e.coords.push(t,s),r&&e.coords.push(i||0)}function S(e){switch(typeof e){case"string":return(0,i.Br)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function I(e,t=4326){if(!e)throw new r.A("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new r.A("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:s}=e;if(!s)return;const i="string"==typeof s?s:"name"===s.type?s.properties.name:"EPSG"===s.type?s.properties.code:null,o=(0,n.oT)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!i||!o.test(i))throw new r.A("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:s})}function P(e,t={}){const s=[],i=new Set,r=new Set;let n,o=!1,a=null,h=!1,{geometryType:l=null}=t;for(const t of d(e)){const{geometry:e,properties:d,id:_}=t;if((!e||(l||(l=u(e.type)),u(e.type)===l))&&(o||(o=f(p(e))),h||(h=null!=_,h&&(n=typeof _,d&&(a=Object.keys(d).filter(e=>d[e]===_)))),d&&a&&h&&null!=_&&(a.length>1?a=a.filter(e=>d[e]===_):1===a.length&&(a=d[a[0]]===_?a:[])),d))for(const e in d){if(i.has(e))continue;const t=S(d[e]);if("unknown"===t){r.add(e);continue}r.delete(e),i.add(e);const n=(0,c.rS)(e);n&&s.push({name:n,alias:e,type:t})}}const _=(0,c.rS)(1===a?.length&&a[0]||null)??void 0;if(_)for(const e of s)if(e.name===_&&(0,c.WA)(e)){e.type="esriFieldTypeOID";break}return{fields:s,geometryType:l,hasZ:o,objectIdFieldName:_,objectIdFieldType:n,unknownFields:Array.from(r)}}function M(e,t){return Array.from(function*(e,t={}){const{geometryType:s,objectIdField:i}=t;for(const r of e){const{geometry:e,properties:n,id:o}=r;if(e&&u(e.type)!==s)continue;const h=n||{};let c;i&&(c=h[i],null==o||c||(h[i]=c=o)),yield new a.Om(e&&g(e,t),h,null,c)}}(d(e),t))}},88340(e,t,s){function i(){return new Float32Array(2)}function r(e,t){const s=new Float32Array(2);return s[0]=e,s[1]=t,s}function n(){return i()}function o(){return r(1,1)}function a(){return r(1,0)}function h(){return r(0,1)}s.d(t,{Un:()=>l,fA:()=>r,uY:()=>c,vt:()=>i});const c=n(),l=o(),u=a(),d=h();Object.freeze(Object.defineProperty({__proto__:null,ONES:l,UNIT_X:u,UNIT_Y:d,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:r,ones:o,unitX:a,unitY:h,zeros:n},Symbol.toStringTag,{value:"Module"}))},89056(e,t,s){s.d(t,{b3:()=>u,jZ:()=>l});var i=s(12195),r=s(19419),n=s(537),o=s(95108),a=s(60408),h=s(80754),c=s(21325);function l(e){return d(e,!0)}function u(e){return d(e,!1)}function d(e,t){if(null==e)return null;const s=e.spatialReference,r=(0,c.Vp)(s),o=(0,i.W)(e)?e.toJSON():e;if(!r)return o;const l=(0,c.K8)(s)?102100:4326,u=h.j7[l].maxX,d=h.j7[l].minX;if((0,a.fT)(o))return f(o,u,d);if((0,a.U9)(o))return o.points=o.points.map(e=>f(e,u,d)),o;if((0,a.ZC)(o))return p(o,r);if((0,a.Bi)(o)||(0,a.Rg)(o)){const e=(0,n.Rg)(b,o),s={xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]},i=(0,h.kd)(s.xmin,d)*(2*u),r=0===i?o:(0,h.kS)(o,i);return s.xmin+=i,s.xmax+=i,s.xmax>u?y(r,u,t):s.xmin<d?y(r,d,t):r}return o}function p(e,t){if(!t)return e;const s=function(e,t){const s=[],{ymin:i,ymax:r,xmin:n,xmax:o}=e,a=e.xmax-e.xmin,[h,c]=t.valid,{x:l,frameId:u}=_(e.xmin,t),{x:d,frameId:p}=_(e.xmax,t),f=l===d&&a>0;if(a>2*c){const e={xmin:n<o?l:d,ymin:i,xmax:c,ymax:r},t={xmin:h,ymin:i,xmax:n<o?d:l,ymax:r},a={xmin:0,ymin:i,xmax:c,ymax:r},f={xmin:h,ymin:i,xmax:0,ymax:r},_=[],g=[];m(e,a)&&_.push(u),m(e,f)&&g.push(u),m(t,a)&&_.push(p),m(t,f)&&g.push(p);for(let e=u+1;e<p;e++)_.push(e),g.push(e);s.push(new x(e,[u]),new x(t,[p]),new x(a,_),new x(f,g))}else l>d||f?s.push(new x({xmin:l,ymin:i,xmax:c,ymax:r},[u]),new x({xmin:h,ymin:i,xmax:d,ymax:r},[p])):s.push(new x({xmin:l,ymin:i,xmax:d,ymax:r},[u]));return s}(e,t).map(e=>e.extent);return s.length<2?s[0]||e:s.length>2?(e.xmin=t.valid[0],e.xmax=t.valid[1],e):{rings:s.map(e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]])}}function f(e,t,s){if(Array.isArray(e)){const i=e[0];if(i>t){const s=(0,h.kd)(i,t);e[0]=i+s*(-2*t)}else if(i<s){const t=(0,h.kd)(i,s);e[0]=i+t*(-2*s)}}else{const i=e.x;if(i>t){const s=(0,h.kd)(i,t);e.x+=s*(-2*t)}else if(i<s){const t=(0,h.kd)(i,s);e.x+=t*(-2*s)}}return e}function _(e,t){const[s,i]=t.valid,r=2*i;let n,o=0;return e>i?(n=Math.ceil(Math.abs(e-i)/r),e-=n*r,o=n):e<s&&(n=Math.ceil(Math.abs(e-s)/r),e+=n*r,o=-n),{x:e,frameId:o}}function m(e,t){const{xmin:s,ymin:i,xmax:r,ymax:n}=t;return g(e,s,i)&&g(e,s,n)&&g(e,r,n)&&g(e,r,i)}function g(e,t,s){return t>=e.xmin&&t<=e.xmax&&s>=e.ymin&&s<=e.ymax}function y(e,t,s=!0){const i=!(0,a.Rg)(e);if(i&&(0,o.m3)(e),s)return(new w).cut(e,t);const r=i?e.rings:e.paths,n=i?4:2,h=r.length,c=-2*t;for(let e=0;e<h;e++){const t=r[e];if(t&&t.length>=n){const e=[];for(const[s,...i]of t)e.push([s+c,...i]);r.push(e)}}return i?e.rings=r:e.paths=r,e}class x{constructor(e,t){this.extent=e,this.frameIds=t}}const b=(0,r.vt)();class w{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,t){let s;if(this._xCut=t,e.rings)this._closed=!0,s=e.rings,this._minPts=4;else{if(!e.paths)return null;this._closed=!1,s=e.paths,this._minPts=2}for(const e of s){if(!e||e.length<this._minPts)continue;let t=!0;for(const s of e)t?(this.moveTo(s),t=!1):this.lineTo(s);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),s=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&s.push(e);const i=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=i;s.push(e)}return this._closed?e.rings=s:e.paths=s,e}moveTo(e){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(e[0]),this._moveTo(e[0],e[1],this._prevSide),this._prevPt=e,this._firstPt=e}lineTo(e){const t=this._side(e[0]);if(t*this._prevSide===-1){const s=this._intersect(this._prevPt,e);this._lineTo(this._xCut,s,0),this._prevSide=0,this._lineTo(e[0],e[1],t)}else this._lineTo(e[0],e[1],t);this._prevSide=t,this._prevPt=e}close(){const e=this._firstPt,t=this._prevPt;e[0]===t[0]&&e[1]===t[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,t,s){this._closed?(this._lineIn.push([s<=0?e:this._xCut,t]),this._lineOut.push([s>=0?e:this._xCut,t])):(s<=0&&this._lineIn.push([e,t]),s>=0&&this._lineOut.push([e,t]))}_lineTo(e,t,s){this._closed?(v(this._lineIn,s<=0?e:this._xCut,t),v(this._lineOut,s>=0?e:this._xCut,t)):s<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([e,t])):s>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([e,t])):this._prevSide<0?(this._lineIn.push([e,t]),this._lineOut.push([e,t])):this._prevSide>0&&(this._lineOut.push([e,t]),this._lineIn.push([e,t]))}_checkClosingPt(e){const t=e.length;t>3&&e[0][0]===this._xCut&&e[t-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[t-2][1],e.pop())}_side(e){return e<this._xCut?-1:e>this._xCut?1:0}_intersect(e,t){const s=(this._xCut-e[0])/(t[0]-e[0]);return e[1]+s*(t[1]-e[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function v(e,t,s){const i=e.length;i>1&&e[i-1][0]===t&&e[i-2][0]===t?e[i-1][1]=s:e.push([t,s])}},94104(e,t,s){s.r(t),s.d(t,{default:()=>Uc});var i=s(49186),r=s(36563),n=s(44208),o=s(26390),a=s(74887),h=s(87811),c=s(36708),l=s(90629),u=s(8341),d=s(87045),p=s(76213);class f{constructor(e){this._client=e,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(e){"error"===e.type&&e.error&&"toJSON"in e.error&&(e.error=e.error.toJSON()),(0,u.oV)(this._eventLog.onEvent(e))}}var _=s(97768),m=s(93637),g=s(6797),y=s(62577),x=s(21325),b=s(44159);function w(e,t){return[e,t]}function v(e,t,s){return e[0]=t,e[1]=s,e}const S=new b.A("0/0/0/0");class I{static create(e,t,s=null){const i=(0,x.Vp)(e.spatialReference),r=t.origin||w(e.origin.x,e.origin.y),n=w(e.size[0]*t.resolution,e.size[1]*t.resolution),o=w(-1/0,-1/0),a=w(1/0,1/0),h=w(1/0,1/0);null!=s&&(v(o,Math.max(0,Math.floor((s.xmin-r[0])/n[0])),Math.max(0,Math.floor((r[1]-s.ymax)/n[1]))),v(a,Math.max(0,Math.floor((s.xmax-r[0])/n[0])),Math.max(0,Math.floor((r[1]-s.ymin)/n[1]))),v(h,a[0]-o[0]+1,a[1]-o[1]+1));const{cols:c,rows:l}=t;let u,d,p,f;return!s&&c&&l&&(v(o,c[0],l[0]),v(a,c[1],l[1]),v(h,c[1]-c[0]+1,l[1]-l[0]+1)),e.isWrappable?(u=w(Math.ceil(Math.round((i.valid[1]-i.valid[0])/t.resolution)/e.size[0]),h[1]),d=!0,p=i.origin,f=i.valid):(u=h,d=!1),new I(t.level,t.resolution,t.scale,r,o,a,h,n,u,d,p,f)}constructor(e,t,s,i,r,n,o,a,h,c,l,u){this.level=e,this.resolution=t,this.scale=s,this.origin=i,this.first=r,this.last=n,this.size=o,this.norm=a,this.worldSize=h,this.wrap=c,this._spatialReferenceOrigin=l,this._spatialReferenceValid=u}normalizeCol(e){if(!this.wrap)return e;const t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}normalizeKey(e){if(!this.wrap)return;const t=this.worldSize[0],s=e.col;s<0?(e.col=s+t,e.world-=1):s>=t&&(e.col=s-t,e.world+=1)}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){const t=this.origin[0]+e*this.norm[0],s=this._spatialReferenceOrigin,i=this._spatialReferenceValid;return this.wrap&&s&&i?t===s[0]?i[0]:this.origin[0]===s[0]&&e===this.worldS