@arcgis/core 4.25.1 → 4.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{c90bca033e64cfad8b43.js → 04dbebaeb2d4d778f0e1.js} +1 -1
  3. package/assets/esri/core/workers/chunks/253d5c44f6cfd32b6548.js +1 -0
  4. package/assets/esri/core/workers/chunks/{5be314edd66cddf6c67c.js → 3a0268b5d0bb8ead8622.js} +1 -1
  5. package/assets/esri/core/workers/chunks/4ef7d9c19bc3a95748a4.js +1 -0
  6. package/assets/esri/core/workers/chunks/5e71fb59cff1ca8b6adb.js +1 -0
  7. package/assets/esri/core/workers/chunks/{ab05015ded44c1f8f0e2.js → 60ff321a20b3f8c0bb3c.js} +1 -1
  8. package/assets/esri/core/workers/chunks/7495f2a9713eb8e5ccc5.js +1 -0
  9. package/assets/esri/core/workers/chunks/85f56a2bc01b611533d9.js +1 -0
  10. package/assets/esri/core/workers/chunks/{6ec223bcd2c3bd40ffee.js → 92f4e92aa7398ca58265.js} +1 -1
  11. package/assets/esri/core/workers/chunks/a83274fd379b4fc73728.js +1 -0
  12. package/assets/esri/core/workers/chunks/{7f96fd3844cd6eda0ec3.js → b766aa60a1cc728042c9.js} +1 -1
  13. package/assets/esri/core/workers/chunks/fa962030bc7e24036aaf.js +1 -0
  14. package/assets/esri/core/workers/chunks/{63ce5262d97c2afb4464.js → ffdb5c1133a45787cd63.js} +1 -1
  15. package/config.js +1 -1
  16. package/layers/graphics/sources/csv/csv.js +1 -1
  17. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  18. package/layers/graphics/sources/geojson/geojson.js +1 -1
  19. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  20. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  21. package/layers/mixins/EditBusLayer.js +1 -1
  22. package/layers/support/FieldsIndex.js +1 -1
  23. package/layers/support/fieldUtils.js +1 -1
  24. package/package.json +1 -1
  25. package/rest/networks/validateNetworkTopology.js +1 -1
  26. package/support/revision.js +1 -1
  27. package/assets/esri/core/workers/chunks/17d6c243ca6269b0f7ef.js +0 -1
  28. package/assets/esri/core/workers/chunks/60ff0086832d6fc6d610.js +0 -1
  29. package/assets/esri/core/workers/chunks/6316bea2130bb9cb515d.js +0 -1
  30. package/assets/esri/core/workers/chunks/7125c94ba8ef5efd63b0.js +0 -1
  31. package/assets/esri/core/workers/chunks/95ee476d101968ff4925.js +0 -1
  32. package/assets/esri/core/workers/chunks/96933809f486480aae0d.js +0 -1
  33. package/assets/esri/core/workers/chunks/fa76467bfd7b1829b995.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3810,4889],{3920:(e,t,r)=>{r.d(t,{p:()=>u,r:()=>c});var n=r(43697),s=r(15923),o=r(61247),i=r(5600),a=r(52011),l=r(72762);const u=e=>{let t=class extends e{destroy(){this.destroyed||(this._get("handles")?.destroy(),this._get("updatingHandles")?.destroy())}get handles(){return this._get("handles")||new o.Z}get updatingHandles(){return this._get("updatingHandles")||new l.t}};return(0,n._)([(0,i.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,n._)([(0,i.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,n._)([(0,a.j)("esri.core.HandleOwner")],t),t};let c=class extends(u(s.Z)){};c=(0,n._)([(0,a.j)("esri.core.HandleOwner")],c)},64830:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(70586);class s{constructor(e=(e=>e.values().next().value)){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(0===this._items.size)return;let e;for(e of this._items);return e}peek(){if(0!==this._items.size)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete((0,n.j0)(e)),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete((0,n.j0)(e)),e}remove(e){this._items.delete(e)}filter(e){return this._items.forEach((t=>{e(t)||this._items.delete(t)})),this}}},72762:(e,t,r)=>{r.d(t,{t:()=>p});var n=r(43697),s=r(15923),o=r(61247),i=r(70586),a=r(17445),l=r(1654),u=r(5600),c=r(52011);let p=class extends s.Z{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._handles=new o.Z,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll(),this._handles.destroy()}add(e,t,r={}){return this._installWatch(e,t,r,a.YP)}addWhen(e,t,r={}){return this._installWatch(e,t,r,a.gx)}addOnCollectionChange(e,t,{initial:r=!1,final:n=!1}={}){const s=++this._handleId;return this._handles.add([(0,a.on)(e,"after-changes",this._createSyncUpdatingCallback(),a.Z_),(0,a.on)(e,"change",t,{onListenerAdd:r?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:n?e=>t({added:[],removed:e.toArray()}):void 0})],s),{remove:()=>this._handles.remove(s)}}addPromise(e){if((0,i.Wi)(e))return e;const t=++this._handleId;this._handles.add({remove:()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this._handles.has(d)||this._set("updating",!1))}},t),this._pendingPromises.add(e),this._set("updating",!0);const r=()=>this._handles.remove(t);return e.then(r,r),e}removeAll(){this._pendingPromises.clear(),this._handles.removeAll(),this._set("updating",!1)}_installWatch(e,t,r={},n){const s=++this._handleId;r.sync||this._installSyncUpdatingWatch(e,s);const o=n(e,t,r);return this._handles.add(o,s),{remove:()=>this._handles.remove(s)}}_installSyncUpdatingWatch(e,t){const r=this._createSyncUpdatingCallback(),n=(0,a.YP)(e,r,{sync:!0,equals:()=>!1});return this._handles.add(n,t),n}_createSyncUpdatingCallback(){return()=>{this._handles.remove(d),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this._handles.add((0,l.Os)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this._handles.remove(d))})),d)}}};(0,n._)([(0,u.Cb)({readOnly:!0})],p.prototype,"updating",void 0),p=(0,n._)([(0,c.j)("esri.core.support.WatchUpdatingTracking")],p);const d=-42},80903:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(50758),s=r(92604),o=r(95330),i=r(64830),a=r(25045);class l{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new i.Z}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,t){return new Promise(((r,n)=>{let s=!0;const i=e=>{(0,o.k_)(t.signal),s&&(s=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let s=0;s<e.length;++s){const l=e[s];(0,o.y8)(l)?this._clientPromises[s]=l.then((e=>(this._clients[s]=new a.default(e,t,(()=>this._ongoingJobsQueue.pop()??null)),i(r),this._clients[s])),(()=>(i(n),null))):(this._clients[s]=new a.default(l,t,(()=>this._ongoingJobsQueue.pop()??null)),this._clientPromises[s]=Promise.resolve(this._clients[s]),i(r))}}))}broadcast(e,t,r){const n=new Array(this._clientPromises.length);for(let s=0;s<this._clientPromises.length;++s){const o=this._clientPromises[s];n[s]=o.then((n=>n?.invoke(e,t,r)))}return n}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.deferred.reject((0,o.zE)(`Worker closing, aborting job calling '${e.methodName}'`));for(const e of this._clientPromises)e.then((e=>e?.close()));this._clients.length=0,this._clientPromises.length=0}invoke(e,t,r){let n;Array.isArray(r)?(s.Z.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),n={transferList:r}):n=r;const i=(0,o.dD)();this._ongoingJobsQueue.push({methodName:e,data:t,invokeOptions:n,deferred:i});for(let e=0;e<this._clientPromises.length;e++){const t=this._clients[e];t?t.jobAdded():this._clientPromises[e].then((e=>e?.jobAdded()))}return i.promise}on(e,t){return Promise.all(this._clientPromises).then((()=>(0,n.AL)(this._clients.map((r=>r.on(e,t))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let r=t.length;for(let n=0;n<this._clientPromises.length;++n)this._clientPromises[n].then((s=>{s&&(t[n]=s.openPort()),0==--r&&e(t)}))}))}get test(){return{numClients:this._clients.length}}}},78346:(e,t,r)=>{r.d(t,{bA:()=>L});var n=r(20102),s=r(80442),o=r(95330),i=r(80903),a=r(25045),l=r(40330),u=r(92604),c=r(70586),p=r(94362),d=r(99880),y=r(68773),f=(r(2587),r(17452));const h={};function m(e){const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=h.baseUrl),h.packages?.forEach((e=>{!function(e,t){for(const r of e)if(r.name===t.name)return;e.push(t)}(t.packages??[],e)})),t}var g=r(41213);class w{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class b{constructor(){this._dispatcher=new w,this._workerPostMessage({type:p.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,g.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,g.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,p.QM)(e);if(t&&t.type===p.Cs.OPEN){const{modulePath:e,jobId:r}=t;let n=await a.default.loadWorker(e);n||(n=await import(e));const s=a.default.connect(n);this._workerPostMessage({type:p.Cs.OPENED,jobId:r,data:s})}}}var v=r(70171),_=r(17202);const S=u.Z.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:C}=p.Cs;let k,F;const P="Failed to create Worker. Fallback to execute module in main thread";async function x(e){return new Promise((t=>{function r(s){const o=(0,p.QM)(s);o&&o.type===C&&(e.removeEventListener("message",r),e.removeEventListener("error",n),t(e))}function n(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",n),S.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new b).addEventListener("message",r),e.addEventListener("error",n)}e.addEventListener("message",r),e.addEventListener("error",n)}))}let O=0;const{ABORT:E,INVOKE:R,OPEN:T,OPENED:N,RESPONSE:I}=p.Cs;class j{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),u.Z.getLogger("esri.core.workers.WorkerOwner").error(e)}))}static async create(e){const t=await async function(){if(!(0,s.Z)("esri-workers")||((0,s.Z)("mozilla"),0))return x(new b);if(!k&&!F)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,version:r}=configuration.kernelInfo,{revision:t,version:n}=e.kernelInfo;!esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS API for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let n;function t(e){const o=n.connect(e);self.postMessage({type:2,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const i=outgoing.get(r);outgoing.delete(r),o.error?i.reject(JSON.parse(o.error)):i.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.split('"{CONFIGURATION}"').join(`'${function(){let e;if(null!=y.Z.default){const t={...y.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(y.Z));e.assetsPath=(0,f.hF)(e.assetsPath),e.defaultAssetsPath=e.defaultAssetsPath?(0,f.hF)(e.defaultAssetsPath):void 0,e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,v.Kd)(),e.has={"esri-csp-restrictions":(0,s.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,s.Z)("esri-2d-update-debug"),"featurelayer-pbf":(0,s.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,s.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,s.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,s.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,s.Z)("esri-atomics"),"esri-shared-array-buffer":(0,s.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,s.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,s.Z)("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":(0,s.Z)("feature-polyline-generalization-factor"),"host-webworker":1,"polylabel-placement-enabled":(0,s.Z)("polylabel-placement-enabled")},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,f.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,f.hF)(e.workers.workerPath):e.workers.workerPath=(0,f.hF)((0,d.V)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=y.Z.workers.loaderConfig,r=m({baseUrl:t?.baseUrl,locale:(0,v.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t?.has},map:{...t?.map},paths:{...t?.paths},packages:t?.packages||[]}),n={version:l.i8,buildDate:_.r,revision:_.$};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:n})}()}'`);k=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){F=e||{}}let e;if(k)try{e=new Worker(k,{name:"esri-worker-"+O++})}catch(t){S.warn(P,F),e=new b}else S.warn(P,F),e=new b;return x(e)}();return new j(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,n=(0,p.jt)();return new Promise(((t,s)=>{const i={resolve:t,reject:s,abortHandle:(0,o.$F)(r,(()=>{this._outJobs.delete(n),this._post({type:E,jobId:n})}))};this._outJobs.set(n,i),this._post({type:T,jobId:n,modulePath:e})}))}_onMessage(e){const t=(0,p.QM)(e);if(t)switch(t.type){case N:this._onOpenedMessage(t);break;case I:this._onResponseMessage(t);break;case E:this._onAbortMessage(t);break;case R:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);n&&(n.controller&&n.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:s}=e,i=s?new AbortController:null,a=this._inJobs,u=l.Nv[t];let c;try{if("function"!=typeof u)throw new TypeError(`${t} is not a function`);c=u.call(null,n,{signal:i?i.signal:null})}catch(e){return void this._post({type:I,jobId:r,error:(0,p.AB)(e)})}(0,o.y8)(c)?(a.set(r,{controller:i,promise:c}),c.then((e=>{a.has(r)&&(a.delete(r),this._post({type:I,jobId:r},e))}),(e=>{a.has(r)&&(a.delete(r),e||(e={message:"Error encountered at method"+t}),(0,o.D_)(e)||this._post({type:I,jobId:r,error:(0,p.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:I,jobId:r},c)}_onOpenedMessage(e){const{jobId:t,data:r}=e,n=this._outJobs.get(t);n&&(this._outJobs.delete(t),(0,c.hw)(n.abortHandle),n.resolve(r))}_onResponseMessage(e){const{jobId:t,error:r,data:s}=e,o=this._outJobs.get(t);o&&(this._outJobs.delete(t),(0,c.hw)(o.abortHandle),r?o.reject(n.Z.fromJSON(JSON.parse(r))):o.resolve(s))}_post(e,t,r){return(0,p.oi)(this.worker,e,t,r)}}let Z=(0,s.Z)("esri-workers-debug")?1:(0,s.Z)("esri-mobile")?Math.min(navigator.hardwareConcurrency-1,3):(0,s.Z)("host-browser")?navigator.hardwareConcurrency-1:0;Z||(Z=(0,s.Z)("safari")&&(0,s.Z)("mac")||(0,s.Z)("trident")?7:2);let A=0;const M=[];async function U(e,t){const r=new i.Z;return await r.open(e,t),r}async function L(e,t={}){if("string"!=typeof e)throw new n.Z("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,s.Z)("host-webworker")&&!(0,s.Z)("esri-workers")&&(r="local"),"local"===r){let r=await a.default.loadWorker(e);r||(r=await import(e)),(0,o.k_)(t.signal);const n=t.client||r;return U([a.default.connect(r)],{...t,client:n})}if(await async function(){if(D)return D;G=new AbortController;const e=[];for(let t=0;t<Z;t++){const r=j.create(t).then((e=>(M[t]=e,e)));e.push(r)}return D=Promise.all(e),D}(),(0,o.k_)(t.signal),"dedicated"===r){const r=A++%Z;return U([await M[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,Z);if(r<Z){const n=new Array(r);for(let s=0;s<r;++s){const r=A++%Z;n[s]=M[r].open(e,t)}return U(n,t)}}return U(M.map((r=>r.open(e,t))),t)}let G,D=null},69285:(e,t,r)=>{r.d(t,{k:()=>i});var n=r(70586),s=r(67900),o=r(8744);function i(e,t,r){if((0,n.Wi)(t)||(0,n.Wi)(r)||r.vcsWkid||(0,o.fS)(t,r))return null;const i=(0,s._R)(t)/(0,s._R)(r);if(1===i)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){e&&null!=e.z&&(e.z*=t)}(e,i);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const r of e.paths)for(const e of r)e.length>2&&(e[2]*=t)}(e,i);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const r of e.rings)for(const e of r)e.length>2&&(e[2]*=t)}(e,i);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const r of e.points)r.length>2&&(r[2]*=t)}(e,i);case"extent":case"esriGeometryExtent":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,i);default:return null}}},2587:(e,t,r)=>{r(90344),r(18848),r(940),r(70171);var n=r(94443),s=r(3172),o=r(20102),i=r(70586);async function a(e){if((0,i.pC)(u.fetchBundleAsset))return u.fetchBundleAsset(e);const t=await(0,s.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let n;n="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,s){const i=t.exec(r);if(!i)throw new o.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=i[1]?`${i[1]}/`:"",u=i[2],c=(0,n.Su)(s),p=`${l}${u}.json`,d=c?`${l}${u}_${c}.json`:p;let y;try{y=await a(e(d))}catch(t){if(d===p)throw new o.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{y=await a(e(p))}catch(e){throw new o.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return y}(this.getAssetUrl,this.matcher,e,t)}}const u={};var c,p=r(99880);(0,n.tz)((c={pattern:"esri/",location:p.V},new l(c)))},940:(e,t,r)=>{r.d(t,{n:()=>u});var n=r(92604),s=r(78286),o=r(19153),i=r(90344),a=r(18848);const l=n.Z.getLogger("esri.intl.substitute");function u(e,t,r={}){const{format:n={}}=r;return(0,o.gx)(e,(e=>function(e,t,r){let n,o;const i=e.indexOf(":");if(-1===i?n=e.trim():(n=e.slice(0,i).trim(),o=e.slice(i+1).trim()),!n)return"";const a=(0,s.hS)(n,t);if(null==a)return"";const l=(o?r?.[o]:null)??r?.[n];return l?c(a,l):o?p(a,o):d(a)}(e,t,n)))}function c(e,t){switch(t.type){case"date":return(0,i.p6)(e,t.intlOptions);case"number":return(0,a.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),d(e)}}function p(e,t){switch(t.toLowerCase()){case"dateformat":return(0,i.p6)(e);case"numberformat":return(0,a.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,i.p6)(e):/^numberformat/i.test(t)?(0,a.uf)(e):d(e)}}function d(e){switch(typeof e){case"string":return e;case"number":return(0,a.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,i.p6)(e):""}}},12653:(e,t,r)=>{r.r(t),r.d(t,{default:()=>B});var n=r(43697),s=(r(66577),r(51773)),o=(r(16050),r(12501),r(28756),r(92271),r(72529),r(5499),r(84382),r(81571),r(91423),r(32400)),i=r(70586),a=r(16453),l=r(78286),u=r(17452),c=r(5600),p=(r(67676),r(75215)),d=r(52011),y=r(30556),f=r(86973),h=r(87085),m=r(20102),g=r(3920),w=r(80442),b=r(83379),v=r(95330),_=r(78346),S=r(25278),C=r(51432),k=r(74889),F=r(6570);let P=class extends((0,g.p)(b.Z)){constructor(){super(...arguments),this._connection=null,this.capabilities=(0,S.MS)(!1,!1),this.type="wfs",this.refresh=(0,v.Ds)((async e=>{await this.load();const{extent:t}=await this._connection.invoke("refresh",e);return t&&(this.sourceJSON.extent=t),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}}))}load(e){const t=(0,i.pC)(e)?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return k.default.fromJSON(r)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const r=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:r.count,extent:F.Z.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _createLoadOptions(e){const{url:t,customParameters:r,name:n,namespaceUri:s,spatialReference:o,fields:a,geometryType:l,swapXY:u}=this.layer;if(!t)throw new m.Z("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await(0,C.FU)(t,{customParameters:r,...e}));const c=["fields","geometryType","name","namespaceUri","spatialReference","swapXY"].some((e=>null==this.layer[e])),p=c?await(0,C.be)(this.wfsCapabilities,n,s,{spatialReference:o,customParameters:r,signal:e?.signal}):{...(0,C.eB)(a??[]),geometryType:l,name:n,namespaceUri:s,spatialReference:o,swapXY:u},d=(0,i.Wg)((0,C.ft)(this.wfsCapabilities.readFeatureTypes(),p.name,p.namespaceUri)),y=f.Mk.toJSON(p.geometryType);return{customParameters:r,featureType:d,fields:p.fields?.map((e=>e.toJSON()))??[],geometryField:p.geometryField,geometryType:y,getFeatureUrl:this.wfsCapabilities.operations.GetFeature.url,getFeatureOutputFormat:this.wfsCapabilities.operations.GetFeature.outputFormat,objectIdField:p.objectIdField,spatialReference:p.spatialReference.toJSON(),swapXY:!!p.swapXY}}async _startWorker(e){const[t,r]=await(0,v.as)([this._createLoadOptions(e),(0,_.bA)("WFSSourceWorker",{...e,strategy:(0,w.Z)("feature-layers-workers")?"dedicated":"local"})]),n=t.error||r.error||null,s=r.value||null;if(n)throw s&&s.close(),n;const o=t.value;this._connection=r.value;const{extent:i}=await this._connection.invoke("load",o,e);this.sourceJSON={extent:i,fields:o.fields,geometryType:o.geometryType,objectIdField:o.objectIdField,geometryField:o.geometryField,drawingInfo:(0,S.bU)(o.geometryType),name:o.featureType.title,wfsInfo:{name:o.featureType.name,featureUrl:o.getFeatureUrl,maxFeatures:3e3,swapXY:o.swapXY,supportedSpatialReferences:o.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:o.featureType.namespaceUri}}}};(0,n._)([(0,c.Cb)()],P.prototype,"capabilities",void 0),(0,n._)([(0,c.Cb)({constructOnly:!0})],P.prototype,"layer",void 0),(0,n._)([(0,c.Cb)()],P.prototype,"sourceJSON",void 0),(0,n._)([(0,c.Cb)()],P.prototype,"type",void 0),(0,n._)([(0,c.Cb)()],P.prototype,"wfsCapabilities",void 0),P=(0,n._)([(0,d.j)("esri.layers.graphics.sources.WFSSource")],P);var x,O=r(71612),E=r(17017),R=r(69637),T=r(6404),N=r(38009),I=r(68825),j=r(16859),Z=r(34760),A=r(72965),M=r(28294),U=r(21506),L=r(1231),G=r(53518),D=r(35671),q=r(54306),W=r(30707),J=r(14165),H=r(32163),z=r(82971);const $=(0,G.v)();let Q=x=class extends((0,I.c)((0,E.N)((0,T.M)((0,R.b)((0,O.h)((0,M.n)((0,Z.Q)((0,A.M)((0,N.q)((0,j.I)((0,a.R)(h.Z)))))))))))){constructor(e){super(e),this.copyright=null,this.customParameters=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new P({layer:this}),this.spatialReference=z.Z.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}static fromWFSLayerInfo(e){const{customParameters:t,fields:r,geometryField:n,geometryType:s,name:o,namespaceUri:i,objectIdField:a,spatialReference:l,swapXY:u,url:c,wfsCapabilities:p}=e;return new x({customParameters:t,fields:r,geometryField:n,geometryType:s,name:o,namespaceUri:i,objectIdField:a,spatialReference:l,swapXY:u,url:c,wfsCapabilities:p})}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),(0,D.YN)(this.renderer,this.fieldsIndex),(0,D.UF)(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,r){const n=e.filter((e=>e.name!==C.M8));this.geometryField&&n.unshift(new L.Z({name:this.geometryField,alias:this.geometryField,type:"geometry"})),(0,l.RB)(r,n.map((e=>e.toJSON())),t)}get parsedUrl(){return(0,u.mN)(this.url)}set renderer(e){(0,D.YN)(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return(0,H.eZ)(this,e)}createQuery(){const e=new J.Z;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:t,timeExtent:r}=this;return e.timeExtent=null!=t&&null!=r?r.offset(-t.value,t.unit):r||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(J.Z.from(e)||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(J.Z.from(e)||this.createQuery(),t)))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(J.Z.from(e)||this.createQuery(),t)))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(J.Z.from(e)||this.createQuery(),t)))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return(0,i.pC)(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};(0,n._)([(0,c.Cb)({readOnly:!0})],Q.prototype,"capabilities",null),(0,n._)([(0,c.Cb)({type:String})],Q.prototype,"copyright",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],Q.prototype,"createQueryVersion",null),(0,n._)([(0,c.Cb)({json:{name:"wfsInfo.customParameters",write:{ignoreOrigin:!0}}})],Q.prototype,"customParameters",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],Q.prototype,"defaultPopupTemplate",null),(0,n._)([(0,c.Cb)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Q.prototype,"definitionExpression",void 0),(0,n._)([(0,c.Cb)({type:String})],Q.prototype,"displayField",void 0),(0,n._)([(0,c.Cb)(U.PV)],Q.prototype,"elevationInfo",void 0),(0,n._)([(0,c.Cb)({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"featureUrl",void 0),(0,n._)([(0,c.Cb)({type:[L.Z],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],Q.prototype,"fields",void 0),(0,n._)([(0,y.c)("fields")],Q.prototype,"writeFields",null),(0,n._)([(0,c.Cb)($.fieldsIndex)],Q.prototype,"fieldsIndex",void 0),(0,n._)([(0,c.Cb)({type:F.Z,json:{name:"extent"}})],Q.prototype,"fullExtent",void 0),(0,n._)([(0,c.Cb)()],Q.prototype,"geometryField",void 0),(0,n._)([(0,c.Cb)({type:String,json:{read:{source:"layerDefinition.geometryType",reader:f.Mk.read},write:{target:"layerDefinition.geometryType",writer:f.Mk.write,ignoreOrigin:!0},origins:{service:{read:f.Mk.read}}}})],Q.prototype,"geometryType",void 0),(0,n._)([(0,c.Cb)({type:String})],Q.prototype,"id",void 0),(0,n._)([(0,c.Cb)(U.iR)],Q.prototype,"labelsVisible",void 0),(0,n._)([(0,c.Cb)({type:[q.Z],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:W.r},write:!0}})],Q.prototype,"labelingInfo",void 0),(0,n._)([(0,c.Cb)(U.rn)],Q.prototype,"legendEnabled",void 0),(0,n._)([(0,c.Cb)({type:["show","hide"]})],Q.prototype,"listMode",void 0),(0,n._)([(0,c.Cb)({type:String})],Q.prototype,"objectIdField",void 0),(0,n._)([(0,c.Cb)({type:["WFS"]})],Q.prototype,"operationalLayerType",void 0),(0,n._)([(0,c.Cb)({type:p.z8,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"maxFeatures",void 0),(0,n._)([(0,c.Cb)({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],Q.prototype,"mode",void 0),(0,n._)([(0,c.Cb)({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"name",void 0),(0,n._)([(0,c.Cb)({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"namespaceUri",void 0),(0,n._)([(0,c.Cb)(U.bT)],Q.prototype,"opacity",void 0),(0,n._)([(0,c.Cb)($.outFields)],Q.prototype,"outFields",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],Q.prototype,"parsedUrl",null),(0,n._)([(0,c.Cb)(U.C_)],Q.prototype,"popupEnabled",void 0),(0,n._)([(0,c.Cb)({type:s.Z,json:{name:"popupInfo",write:!0}})],Q.prototype,"popupTemplate",void 0),(0,n._)([(0,c.Cb)({types:o.A,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:o.o,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],Q.prototype,"renderer",null),(0,n._)([(0,c.Cb)(U.YI)],Q.prototype,"screenSizePerspectiveEnabled",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],Q.prototype,"source",void 0),(0,n._)([(0,c.Cb)({type:z.Z,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],Q.prototype,"spatialReference",void 0),(0,n._)([(0,c.Cb)({readOnly:!0,type:[p.z8],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"spatialReferences",void 0),(0,n._)([(0,c.Cb)({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"swapXY",void 0),(0,n._)([(0,c.Cb)({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],Q.prototype,"title",void 0),(0,n._)([(0,c.Cb)({json:{read:!1},readOnly:!0})],Q.prototype,"type",void 0),(0,n._)([(0,c.Cb)(U.HQ)],Q.prototype,"url",void 0),(0,n._)([(0,c.Cb)({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"version",void 0),(0,n._)([(0,c.Cb)()],Q.prototype,"wfsCapabilities",null),Q=x=(0,n._)([(0,d.j)("esri.layers.WFSLayer")],Q);const B=Q},61159:(e,t,r)=>{r.d(t,{g:()=>n});const n={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},92722:(e,t,r)=>{r.d(t,{O3:()=>_,lG:()=>C,my:()=>S,q9:()=>l});var n=r(20102),s=r(70272),o=r(5428),i=r(35671);const a={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function l(e){return a[e]}function*u(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*c(e){if(!e)return null;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 p(e){for(const t of e)if(t.length>2)return!0;return!1}function d(e){let t=0;for(let r=0;r<e.length;r++){const n=e[r],s=e[(r+1)%e.length];t+=n[0]*s[1]-s[0]*n[1]}return t<=0}function y(e){const t=e[0],r=e[e.length-1];return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]||e.push(t),e}function f(e,t,r){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,r){return g(e,t.coordinates,r),e}(e,t,r);case"MultiLineString":return function(e,t,r){for(const n of t.coordinates)g(e,n,r);return e}(e,t,r);case"MultiPolygon":return function(e,t,r){for(const n of t.coordinates){h(e,n[0],r);for(let t=1;t<n.length;t++)m(e,n[t],r)}return e}(e,t,r);case"Point":return function(e,t,r){return b(e,t.coordinates,r),e}(e,t,r);case"Polygon":return function(e,t,r){const n=t.coordinates;h(e,n[0],r);for(let t=1;t<n.length;t++)m(e,n[t],r);return e}(e,t,r)}}function h(e,t,r){const n=y(t);!function(e){return!d(e)}(n)?g(e,n,r):w(e,n,r)}function m(e,t,r){const n=y(t);!function(e){return d(e)}(n)?g(e,n,r):w(e,n,r)}function g(e,t,r){for(const n of t)b(e,n,r);e.lengths.push(t.length)}function w(e,t,r){for(let n=t.length-1;n>=0;n--)b(e,t[n],r);e.lengths.push(t.length)}function b(e,t,r){const[n,s,o]=t;e.coords.push(n,s),r.hasZ&&e.coords.push(o||0)}function v(e){switch(typeof e){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function _(e){if(!e)throw new n.Z("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new n.Z("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:t}=e;if(!t)return;const r="string"==typeof t?t:"name"===t.type?t.properties.name:"EPSG"===t.type?t.properties.code:null,s=new RegExp(".*(CRS84H?|4326)$","i");if(!r||!s.test(r))throw new n.Z("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function S(e,t={}){const r=[],n=new Set,s=new Set;let o,a=!1,d=null,y=!1,{geometryType:f=null}=t,h=!1;for(const t of u(e)){const{geometry:e,properties:i,id:u}=t;if((!e||(f||(f=l(e.type)),l(e.type)===f))&&(a||(a=p(c(e))),y||(y=null!=u,y&&(o=typeof u,d=Object.keys(i).filter((e=>i[e]===u)))),y&&null!=u&&(d.length>1?d=d.filter((e=>i[e]===u)):1===d.length&&(d=i[d[0]]===u?d:[])),!h&&i)){let e=!0;for(const t in i){if(n.has(t))continue;const o=i[t];if(null==o){e=!1,s.add(t);continue}const a=v(o);"unknown"!==a?(s.delete(t),n.add(t),r.push({name:t,alias:t,type:a})):s.add(t)}h=e}}const m=d&&1===d.length&&d[0]||null;if(m)for(const e of r)if(e.name===m&&(0,i.H7)(e)){e.type="esriFieldTypeOID";break}return{fields:r,geometryType:f,hasZ:a,objectIdFieldName:m,objectIdFieldType:o,unknownFields:Array.from(s)}}function C(e,t){return Array.from(function*(e,t={}){const{geometryType:r,objectIdField:n}=t;for(const i of e){const{geometry:e,properties:a,id:u}=i;if(e&&l(e.type)!==r)continue;const c=a||{};let p=c[n]??null;n&&null!=u&&!c[n]&&(c[n]=p=u);const d=new s.u_(e?f(new o.Z,e,t):null,c,null,p);yield d}}(u(e),t))}},25278:(e,t,r)=>{r.d(t,{Dm:()=>c,Hq:()=>p,MS:()=>d,bU:()=>a});var n=r(80442),s=r(22974),o=r(61159),i=r(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?i.I4:"esriGeometryPolyline"===e?i.ET:i.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function c(e,t){if((0,n.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this.${t} = null;`;for(const t in e)r+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const n=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new n}catch(r){return()=>({[t]:null,...e})}}function p(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,s.d9)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0},query:o.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1}}}},68825:(e,t,r)=>{r.d(t,{c:()=>h});var n,s=r(43697),o=r(78286),i=r(5600),a=(r(67676),r(75215),r(52011)),l=r(35454),u=r(96674);const c=new l.X({asc:"ascending",desc:"descending"});let p=n=class extends u.wq{constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new n({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,s._)([(0,i.Cb)({type:String,json:{write:!0}})],p.prototype,"field",void 0),(0,s._)([(0,i.Cb)({type:String,json:{write:!0}})],p.prototype,"valueExpression",void 0),(0,s._)([(0,i.Cb)({type:c.apiValues,json:{read:c.read,write:c.write}})],p.prototype,"order",void 0),p=n=(0,s._)([(0,a.j)("esri.layers.support.OrderByInfo")],p);const d=p;function y(e,t,r){if(!e)return null;const n=e.find((e=>!!e.field));if(!n)return null;const s=new d;return s.read(n,r),[s]}function f(e,t,r,n){const s=e.find((e=>!!e.field));s&&(0,o.RB)(r,[s.toJSON()],t)}const h=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,s._)([(0,i.Cb)({type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:y},write:{target:"layerDefinition.orderBy",writer:f}}})],t.prototype,"orderBy",void 0),t=(0,s._)([(0,a.j)("esri.layers.mixins.OrderedLayer")],t),t}},51432:(e,t,r)=>{r.d(t,{M8:()=>_,ft:()=>x,FU:()=>k,Bm:()=>I,be:()=>O,eB:()=>E}),r(66577);var n=r(3172),s=r(20102),o=r(66374),i=r(70586),a=r(95330),l=r(17452),u=r(44547),c=r(8744),p=r(86973),d=r(92722);function y(e){return function(e){const t=f.exec(e);if(!t?.groups)return null;const r=t.groups,n=+r.year,s=+r.month-1,o=+r.day,i=+(r.hours??"0"),a=+(r.minutes??"0"),l=+(r.seconds??"0");if(i>23)return null;if(a>59)return null;if(l>59)return null;const u=r.ms??"0",c=u?+u.padEnd(3,"0").substring(0,3):0;let p;if(r.isUTC)p=Date.UTC(n,s,o,i,a,l,c);else if(r.offsetSign){const e=+r.offsetHours,t=+r.offsetMinutes;p=6e4*("+"===r.offsetSign?-1:1)*(60*e+t)+Date.UTC(n,s,o,i,a,l,c)}else p=new Date(n,s,o,i,a,l,c).getTime();return Number.isNaN(p)?null:p}(e)??function(e){const t=new Date(e).getTime();return Number.isNaN(t)?null:t}(e)}const f=/^(?:(?<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})))?$/;var h=r(88724),m=r(1231),g=r(82971),w=r(6570);const b="xlink:href",v="2.0.0",_="__esri_wfs_id__",S="wfs-layer:feature-type-not-found",C="wfs-layer:unknown-geometry-type";async function k(e,t){const r=function(e){const t=Z(e);(function(e){const t=e.firstElementChild?.getAttribute("version");if(t&&t!==v)throw new s.Z("wfs-layer:unsupported-wfs-version",`Unsupported WFS version ${t}. Supported version: ${v}`)})(t),M(t);const r=t.firstElementChild,n=(0,o.Fs)(function(e){return(0,h.H)(e,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",supportedSpatialReferences:[]},r=new Set([4326]),n=e=>{const t=parseInt(e.textContent?.match(/(?<wkid>\d+$)/i)?.groups?.wkid??"",10);Number.isNaN(t)||r.add(t)};return(0,h.h)(e,{Name:e=>{const{name:r,prefix:n}=A(e.textContent);t.typeName=`${n}:${r}`,t.name=r,t.namespacePrefix=n,t.namespaceUri=e.lookupNamespaceURI(n)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=function(e){let t,r,n,s;for(const o of e.children)switch(o.localName){case"LowerCorner":[t,r]=o.textContent.split(" ").map((e=>Number.parseFloat(e)));break;case"UpperCorner":[n,s]=o.textContent.split(" ").map((e=>Number.parseFloat(e)))}return{xmin:t,ymin:r,xmax:n,ymax:s,spatialReference:c.Zn}}(e)},DefaultSRS:n,DefaultCRS:n,OtherSRS:n,OtherCRS:n}),t.title||(t.title=t.name),t.supportedSpatialReferences.push(...r),t}}})}(r));return{operations:P(r),get featureTypes(){return Array.from(n())},readFeatureTypes:n}}((await(0,n.default)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:v,...t?.customParameters},signal:t?.signal})).data);return function(e,t){(0,l.$U)(e)&&((0,l.D6)(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=(0,l.hO)(t.operations.DescribeFeatureType.url)),(0,l.D6)(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=(0,l.hO)(t.operations.GetFeature.url)))}(e,r),r}const F=new Set(["json","application/json","geojson","application/json; subtype=geojson"]);function P(e){let t=!1;const r={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}};if((0,h.h)(e,{OperationsMetadata:{Operation:e=>{switch(e.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:e=>{r.GetCapabilities.url=e.getAttribute(b)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:e=>{r.DescribeFeatureType.url=e.getAttribute(b)}}}};case"GetFeature":return{DCP:{HTTP:{Get:e=>{r.GetFeature.url=e.getAttribute(b)}}},Parameter:e=>{if("outputFormat"===e.getAttribute("name"))return{AllowedValues:{Value:e=>{const t=e.textContent;t&&F.has(t.toLowerCase())&&(r.GetFeature.outputFormat=t)}}}}}}},Constraint:e=>{switch(e.getAttribute("name")){case"KVPEncoding":return{DefaultValue:e=>{t="true"===e.textContent.toLowerCase()}};case"ImplementsResultPaging":return{DefaultValue:e=>{r.GetFeature.supportsPagination="true"===e.textContent.toLowerCase()}}}}}}),!t)throw new s.Z("wfs-layer:kvp-encoding-not-supported","WFS service doesn't support key/value pair (KVP) encoding");if((0,i.Wi)(r.GetFeature.outputFormat))throw new s.Z("wfs-layer:geojson-not-supported","WFS service doesn't support GeoJSON output format");return r}function x(e,t,r){return(0,o.sE)(e,(e=>r?e.name===t&&e.namespaceUri===r:e.typeName===t||e.name===t))}async function O(e,t,r,n={}){const{featureType:o,extent:l}=await async function(e,t,r,n={}){const{spatialReference:o=g.Z.WGS84}=n,a=e.readFeatureTypes(),l=t?x(a,t,r):a.next().value;if((0,i.Wi)(l))throw t?new s.Z(S,`The type '${t}' could not be found in the service`):new s.Z("wfs-layer:empty-service","The service is empty");let p=new w.Z({...l.extent,spatialReference:o});if(!(0,c.fS)(o,c.Zn))try{await(0,u.iQ)(c.Zn,o,void 0,n),p=(0,u.iV)(p,c.Zn)}catch{throw new s.Z("wfs-layer:unsupported-spatial-reference","Projection not supported")}return{extent:p,spatialReference:o,featureType:l}}(e,t,r,n),{fields:p,geometryType:d,swapXY:y,objectIdField:f,geometryField:h}=await async function(e,t,r={}){const[n,o]=await(0,a.as)([T(e.operations.DescribeFeatureType.url,t,r),R(e,t,r)]);if(n.error||o.error)throw new s.Z("wfs-layer:getWFSLayerTypeInfo-error",`An error occurred while getting info about the feature type '${t}'`,{error:n.error||o.error});const{fields:l,errors:u}=n.value??{},c=n.value?.geometryType||o.value?.geometryType,p=o.value?.swapXY??!1;if((0,i.Wi)(c))throw new s.Z(C,`The geometry type could not be determined for type '${t}`,{typeName:t,geometryType:c,fields:l,errors:u});return{...E(l??[]),geometryType:c,swapXY:p}}(e,o.typeName,n);return{url:e.operations.GetCapabilities.url,name:o.name,namespaceUri:o.namespaceUri,fields:p,geometryField:h,geometryType:d,objectIdField:f,spatialReference:n.spatialReference??g.Z.WGS84,extent:l,swapXY:y,wfsCapabilities:e,customParameters:n.customParameters}}function E(e){const t=e.find((e=>"geometry"===e.type));let r=e.find((e=>"oid"===e.type));return e=e.filter((e=>"geometry"!==e.type)),r||(r=new m.Z({name:_,type:"oid",alias:_}),e.unshift(r)),{geometryField:t?.name??null,objectIdField:r.name,fields:e}}async function R(e,t,r={}){let s,o=!1;const[i,a]=await Promise.all([I(e.operations.GetFeature.url,t,e.operations.GetFeature.outputFormat,{...r,count:1}),(0,n.default)(e.operations.GetFeature.url,{responseType:"text",query:j(t,void 0,{...r,count:1}),signal:r?.signal})]),l="FeatureCollection"===i.type&&i.features[0]?.geometry;if(l){let e;switch(s=p.Mk.fromJSON((0,d.q9)(l.type)),l.type){case"Point":e=l.coordinates;break;case"LineString":case"MultiPoint":e=l.coordinates[0];break;case"MultiLineString":case"Polygon":e=l.coordinates[0][0];break;case"MultiPolygon":e=l.coordinates[0][0][0]}const t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(a.data);if(t){const r=e[0].toFixed(3),n=e[1].toFixed(3),s=parseFloat(t[1]).toFixed(3);r===parseFloat(t[2]).toFixed(3)&&n===s&&(o=!0)}}return{geometryType:s,swapXY:o}}async function T(e,t,r){return function(e,t){const{name:r}=A(e),n=Z(t);M(n);const a=(0,o.sE)((0,h.H)(n.firstElementChild,{element:e=>({name:e.getAttribute("name"),typeName:A(e.getAttribute("type")).name})}),(({name:e})=>e===r));if((0,i.pC)(a)){const e=(0,o.sE)((0,h.H)(n.firstElementChild,{complexType:e=>e}),(e=>e.getAttribute("name")===a.typeName));if((0,i.pC)(e))return function(e){const t=[],r=[];let n;const o=(0,h.H)(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(const i of o){const o=i.getAttribute("name");if(!o)continue;let a,l;if(i.hasAttribute("type")?a=A(i.getAttribute("type")).name:(0,h.h)(i,{simpleType:{restriction:e=>(a=A(e.getAttribute("base")).name,{maxLength:e=>{l=+e.getAttribute("value")}})}}),!a)continue;const u="true"===i.getAttribute("nillable");let c=!1;switch(a.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":r.push(new m.Z({name:o,alias:o,type:"integer",nullable:u}));break;case"float":case"double":case"decimal":r.push(new m.Z({name:o,alias:o,type:"double",nullable:u}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":r.push(new m.Z({name:o,alias:o,type:"string",nullable:u,length:l??255}));break;case"datetime":case"date":r.push(new m.Z({name:o,alias:o,type:"date",nullable:u,length:l??36}));break;case"pointpropertytype":n="point",c=!0;break;case"multipointpropertytype":n="multipoint",c=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":n="polyline",c=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":n="polygon",c=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":c=!0,t.push(new s.Z(C,`geometry type '${a}' is not supported`,{type:(new XMLSerializer).serializeToString(e)}));break;default:t.push(new s.Z("wfs-layer:unknown-field-type",`Unknown field type '${a}'`,{type:(new XMLSerializer).serializeToString(e)}))}c&&r.push(new m.Z({name:o,alias:o,type:"geometry",nullable:u}))}for(const e of r)if("integer"===e.type&&!e.nullable&&N.has(e.name.toLowerCase())){e.type="oid";break}return{geometryType:n,fields:r,errors:t}}(e)}throw new s.Z(S,`Type '${e}' not found in document`,{document:(new XMLSerializer).serializeToString(n)})}(t,(await(0,n.default)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:v,TYPENAME:t,...r?.customParameters},signal:r?.signal})).data)}const N=new Set(["objectid","fid"]);async function I(e,t,r,o){let{data:i}=await(0,n.default)(e,{responseType:"text",query:j(t,r,o),signal:o?.signal});i=i.replace(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{if(o?.dateFields?.length){const e=new Set(o.dateFields);return JSON.parse(i,((t,r)=>e.has(t)?y(r):r))}return JSON.parse(i)}catch(e){throw new s.Z("wfs-layer:malformed-json","Error while parsing the response",{response:i,error:e})}}function j(e,t,r){return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:v,TYPENAMES:e,OUTPUTFORMAT:t,SRSNAME:"EPSG:4326",STARTINDEX:r?.startIndex,COUNT:r?.count,...r?.customParameters}}function Z(e){return(new DOMParser).parseFromString(e.trim(),"text/xml")}function A(e){const[t,r]=e.split(":");return{prefix:r?t:"",name:r??t}}function M(e){let t="",r="";if((0,h.h)(e.firstElementChild,{Exception:e=>(t=e.getAttribute("exceptionCode"),{ExceptionText:e=>{r=e.textContent}})}),t)throw new s.Z(`wfs-layer:${t}`,r)}},88724:(e,t,r)=>{function n(e,t){if(e&&t)for(const r of e.children)if(r.localName in t){const e=t[r.localName];if("function"==typeof e){const t=e(r);t&&n(r,t)}else n(r,e)}}function*s(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];"function"==typeof e?yield e(r):yield*s(r,e)}}r.d(t,{H:()=>s,h:()=>n})},51706:(e,t,r)=>{var n,s;function o(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function i(e){return null!=e&&!isNaN(e)&&isFinite(e)}function a(e){return e.valueExpression?n.Expression:e.field&&"string"==typeof e.field?n.Field:n.Unknown}function l(e,t){const r=t||a(e),o=e.valueUnit||"unknown";return r===n.Unknown?s.Constant:e.stops?s.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?s.ClampedLinear:"unknown"===o?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?s.Proportional:s.Additive:s.Identity:s.RealWorldSize}r.d(t,{PS:()=>a,QW:()=>l,RY:()=>n,hL:()=>s,iY:()=>o,qh:()=>i}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(n||(n={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(s||(s={}))},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>v});var n,s=r(43697),o=r(66577),i=r(38171),a=r(35454),l=r(96674),u=r(22974),c=r(70586),p=r(5600),d=(r(75215),r(71715)),y=r(52011),f=r(30556),h=r(82971),m=r(33955),g=r(1231);const w=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=n=class extends l.wq{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){const r=h.Z.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const s=e[t],o=i.Z.fromJSON(s),a=s.geometry&&s.geometry.spatialReference;(0,c.pC)(o.geometry)&&!a&&(o.geometry.spatialReference=r);const l=s.aggregateGeometries,u=o.aggregateGeometries;if(l&&(0,c.pC)(u))for(const e in u){const t=u[e],n=l[e]?.spatialReference;(0,c.pC)(t)&&!n&&(t.spatialReference=r)}n.push(o)}return n}writeGeometryType(e,t,r,n){if(e)return void w.write(e,t,r,n);const{features:s}=this;if(s)for(const e of s)if(e&&(0,c.pC)(e.geometry))return void w.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,m.im)(e);return n&&!r&&t.spatialReference&&(n.spatialReference=h.Z.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,c.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,u.d9)({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 n=t.features[r];if(n.geometry){const t=e&&e[r];n.geometry=t&&t.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,s]}=e,o=this.features,i=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-n)/t)),(e=>Math.round((s-e)/r)));for(let e=0,t=o.length;e<t;e++)i?.((0,c.Wg)(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:[n,s],scale:[o,i]}=r,a=this._getHydrationFunction(e,(e=>e*o+n),(e=>s-e*i));for(const{geometry:e}of t)(0,c.pC)(e)&&a&&a(e);return this.transform=null,this}_quantizePoints(e,t,r){let n,s;const o=[];for(let i=0,a=e.length;i<a;i++){const a=e[i];if(i>0){const e=t(a[0]),i=r(a[1]);e===n&&i===s||(o.push([e-n,i-s]),n=e,s=i)}else n=t(a[0]),s=r(a[1]),o.push([n,s])}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 n=(0,m.oU)(e)?e.rings:e.paths,s=[];for(let e=0,o=n.length;e<o;e++){const o=n[e],i=this._quantizePoints(o,t,r);i&&s.push(i)}return s.length>0?((0,m.oU)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n&&n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const n=(0,m.oU)(e)?e.rings:e.paths;let s,o;for(let e=0,i=n.length;e<i;e++){const i=n[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];e>0?(s+=n[0],o+=n[1]):(s=n[0],o=n[1]),n[0]=t(s),n[1]=r(o)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const n=e.points;let s,o;for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(s+=i[0],o+=i[1]):(s=i[0],o=i[1]),i[0]=t(s),i[1]=r(o)}}:null}};(0,s._)([(0,p.Cb)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,s._)([(0,p.Cb)({type:[i.Z],json:{write:!0}})],b.prototype,"features",void 0),(0,s._)([(0,d.r)("features")],b.prototype,"readFeatures",null),(0,s._)([(0,p.Cb)({type:[g.Z],json:{write:!0}})],b.prototype,"fields",void 0),(0,s._)([(0,p.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],b.prototype,"geometryType",void 0),(0,s._)([(0,f.c)("geometryType")],b.prototype,"writeGeometryType",null),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,s._)([(0,p.Cb)({types:o.qM,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,s._)([(0,d.r)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,s._)([(0,p.Cb)({type:h.Z,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,s._)([(0,f.c)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,s._)([(0,p.Cb)({json:{write:!0}})],b.prototype,"transform",void 0),b=n=(0,s._)([(0,y.j)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0;const v=b},58333:(e,t,r)=>{r.d(t,{ET:()=>o,I4:()=>s,eG:()=>l,lF:()=>i,lj:()=>c,qP:()=>a,wW:()=>u});const n=[252,146,31,255],s={type:"esriSMS",style:"esriSMSCircle",size:6,color:n,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:n},i={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},c={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3810,4889],{3920:(e,t,r)=>{r.d(t,{p:()=>u,r:()=>c});var n=r(43697),s=r(15923),o=r(61247),i=r(5600),a=r(52011),l=r(72762);const u=e=>{let t=class extends e{destroy(){this.destroyed||(this._get("handles")?.destroy(),this._get("updatingHandles")?.destroy())}get handles(){return this._get("handles")||new o.Z}get updatingHandles(){return this._get("updatingHandles")||new l.t}};return(0,n._)([(0,i.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,n._)([(0,i.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,n._)([(0,a.j)("esri.core.HandleOwner")],t),t};let c=class extends(u(s.Z)){};c=(0,n._)([(0,a.j)("esri.core.HandleOwner")],c)},64830:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(70586);class s{constructor(e=(e=>e.values().next().value)){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(0===this._items.size)return;let e;for(e of this._items);return e}peek(){if(0!==this._items.size)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete((0,n.j0)(e)),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete((0,n.j0)(e)),e}remove(e){this._items.delete(e)}filter(e){return this._items.forEach((t=>{e(t)||this._items.delete(t)})),this}}},72762:(e,t,r)=>{r.d(t,{t:()=>p});var n=r(43697),s=r(15923),o=r(61247),i=r(70586),a=r(17445),l=r(1654),u=r(5600),c=r(52011);let p=class extends s.Z{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._handles=new o.Z,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll(),this._handles.destroy()}add(e,t,r={}){return this._installWatch(e,t,r,a.YP)}addWhen(e,t,r={}){return this._installWatch(e,t,r,a.gx)}addOnCollectionChange(e,t,{initial:r=!1,final:n=!1}={}){const s=++this._handleId;return this._handles.add([(0,a.on)(e,"after-changes",this._createSyncUpdatingCallback(),a.Z_),(0,a.on)(e,"change",t,{onListenerAdd:r?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:n?e=>t({added:[],removed:e.toArray()}):void 0})],s),{remove:()=>this._handles.remove(s)}}addPromise(e){if((0,i.Wi)(e))return e;const t=++this._handleId;this._handles.add({remove:()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this._handles.has(d)||this._set("updating",!1))}},t),this._pendingPromises.add(e),this._set("updating",!0);const r=()=>this._handles.remove(t);return e.then(r,r),e}removeAll(){this._pendingPromises.clear(),this._handles.removeAll(),this._set("updating",!1)}_installWatch(e,t,r={},n){const s=++this._handleId;r.sync||this._installSyncUpdatingWatch(e,s);const o=n(e,t,r);return this._handles.add(o,s),{remove:()=>this._handles.remove(s)}}_installSyncUpdatingWatch(e,t){const r=this._createSyncUpdatingCallback(),n=(0,a.YP)(e,r,{sync:!0,equals:()=>!1});return this._handles.add(n,t),n}_createSyncUpdatingCallback(){return()=>{this._handles.remove(d),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this._handles.add((0,l.Os)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this._handles.remove(d))})),d)}}};(0,n._)([(0,u.Cb)({readOnly:!0})],p.prototype,"updating",void 0),p=(0,n._)([(0,c.j)("esri.core.support.WatchUpdatingTracking")],p);const d=-42},80903:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(50758),s=r(92604),o=r(95330),i=r(64830),a=r(25045);class l{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new i.Z}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,t){return new Promise(((r,n)=>{let s=!0;const i=e=>{(0,o.k_)(t.signal),s&&(s=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let s=0;s<e.length;++s){const l=e[s];(0,o.y8)(l)?this._clientPromises[s]=l.then((e=>(this._clients[s]=new a.default(e,t,(()=>this._ongoingJobsQueue.pop()??null)),i(r),this._clients[s])),(()=>(i(n),null))):(this._clients[s]=new a.default(l,t,(()=>this._ongoingJobsQueue.pop()??null)),this._clientPromises[s]=Promise.resolve(this._clients[s]),i(r))}}))}broadcast(e,t,r){const n=new Array(this._clientPromises.length);for(let s=0;s<this._clientPromises.length;++s){const o=this._clientPromises[s];n[s]=o.then((n=>n?.invoke(e,t,r)))}return n}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.deferred.reject((0,o.zE)(`Worker closing, aborting job calling '${e.methodName}'`));for(const e of this._clientPromises)e.then((e=>e?.close()));this._clients.length=0,this._clientPromises.length=0}invoke(e,t,r){let n;Array.isArray(r)?(s.Z.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),n={transferList:r}):n=r;const i=(0,o.dD)();this._ongoingJobsQueue.push({methodName:e,data:t,invokeOptions:n,deferred:i});for(let e=0;e<this._clientPromises.length;e++){const t=this._clients[e];t?t.jobAdded():this._clientPromises[e].then((e=>e?.jobAdded()))}return i.promise}on(e,t){return Promise.all(this._clientPromises).then((()=>(0,n.AL)(this._clients.map((r=>r.on(e,t))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let r=t.length;for(let n=0;n<this._clientPromises.length;++n)this._clientPromises[n].then((s=>{s&&(t[n]=s.openPort()),0==--r&&e(t)}))}))}get test(){return{numClients:this._clients.length}}}},78346:(e,t,r)=>{r.d(t,{bA:()=>L});var n=r(20102),s=r(80442),o=r(95330),i=r(80903),a=r(25045),l=r(40330),u=r(92604),c=r(70586),p=r(94362),d=r(99880),y=r(68773),f=(r(2587),r(17452));const h={};function m(e){const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=h.baseUrl),h.packages?.forEach((e=>{!function(e,t){for(const r of e)if(r.name===t.name)return;e.push(t)}(t.packages??[],e)})),t}var g=r(41213);class w{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class b{constructor(){this._dispatcher=new w,this._workerPostMessage({type:p.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,g.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,g.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,p.QM)(e);if(t&&t.type===p.Cs.OPEN){const{modulePath:e,jobId:r}=t;let n=await a.default.loadWorker(e);n||(n=await import(e));const s=a.default.connect(n);this._workerPostMessage({type:p.Cs.OPENED,jobId:r,data:s})}}}var v=r(70171),_=r(17202);const S=u.Z.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:C}=p.Cs;let k,F;const P="Failed to create Worker. Fallback to execute module in main thread";async function x(e){return new Promise((t=>{function r(s){const o=(0,p.QM)(s);o&&o.type===C&&(e.removeEventListener("message",r),e.removeEventListener("error",n),t(e))}function n(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",n),S.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new b).addEventListener("message",r),e.addEventListener("error",n)}e.addEventListener("message",r),e.addEventListener("error",n)}))}let O=0;const{ABORT:E,INVOKE:R,OPEN:T,OPENED:N,RESPONSE:I}=p.Cs;class j{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),u.Z.getLogger("esri.core.workers.WorkerOwner").error(e)}))}static async create(e){const t=await async function(){if(!(0,s.Z)("esri-workers")||((0,s.Z)("mozilla"),0))return x(new b);if(!k&&!F)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,version:r}=configuration.kernelInfo,{revision:t,version:n}=e.kernelInfo;!esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS API for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let n;function t(e){const o=n.connect(e);self.postMessage({type:2,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const i=outgoing.get(r);outgoing.delete(r),o.error?i.reject(JSON.parse(o.error)):i.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.split('"{CONFIGURATION}"').join(`'${function(){let e;if(null!=y.Z.default){const t={...y.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(y.Z));e.assetsPath=(0,f.hF)(e.assetsPath),e.defaultAssetsPath=e.defaultAssetsPath?(0,f.hF)(e.defaultAssetsPath):void 0,e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,v.Kd)(),e.has={"esri-csp-restrictions":(0,s.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,s.Z)("esri-2d-update-debug"),"featurelayer-pbf":(0,s.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,s.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,s.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,s.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,s.Z)("esri-atomics"),"esri-shared-array-buffer":(0,s.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,s.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,s.Z)("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":(0,s.Z)("feature-polyline-generalization-factor"),"host-webworker":1,"polylabel-placement-enabled":(0,s.Z)("polylabel-placement-enabled")},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,f.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,f.hF)(e.workers.workerPath):e.workers.workerPath=(0,f.hF)((0,d.V)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=y.Z.workers.loaderConfig,r=m({baseUrl:t?.baseUrl,locale:(0,v.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t?.has},map:{...t?.map},paths:{...t?.paths},packages:t?.packages||[]}),n={version:l.i8,buildDate:_.r,revision:_.$};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:n})}()}'`);k=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){F=e||{}}let e;if(k)try{e=new Worker(k,{name:"esri-worker-"+O++})}catch(t){S.warn(P,F),e=new b}else S.warn(P,F),e=new b;return x(e)}();return new j(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,n=(0,p.jt)();return new Promise(((t,s)=>{const i={resolve:t,reject:s,abortHandle:(0,o.$F)(r,(()=>{this._outJobs.delete(n),this._post({type:E,jobId:n})}))};this._outJobs.set(n,i),this._post({type:T,jobId:n,modulePath:e})}))}_onMessage(e){const t=(0,p.QM)(e);if(t)switch(t.type){case N:this._onOpenedMessage(t);break;case I:this._onResponseMessage(t);break;case E:this._onAbortMessage(t);break;case R:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);n&&(n.controller&&n.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:s}=e,i=s?new AbortController:null,a=this._inJobs,u=l.Nv[t];let c;try{if("function"!=typeof u)throw new TypeError(`${t} is not a function`);c=u.call(null,n,{signal:i?i.signal:null})}catch(e){return void this._post({type:I,jobId:r,error:(0,p.AB)(e)})}(0,o.y8)(c)?(a.set(r,{controller:i,promise:c}),c.then((e=>{a.has(r)&&(a.delete(r),this._post({type:I,jobId:r},e))}),(e=>{a.has(r)&&(a.delete(r),e||(e={message:"Error encountered at method"+t}),(0,o.D_)(e)||this._post({type:I,jobId:r,error:(0,p.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:I,jobId:r},c)}_onOpenedMessage(e){const{jobId:t,data:r}=e,n=this._outJobs.get(t);n&&(this._outJobs.delete(t),(0,c.hw)(n.abortHandle),n.resolve(r))}_onResponseMessage(e){const{jobId:t,error:r,data:s}=e,o=this._outJobs.get(t);o&&(this._outJobs.delete(t),(0,c.hw)(o.abortHandle),r?o.reject(n.Z.fromJSON(JSON.parse(r))):o.resolve(s))}_post(e,t,r){return(0,p.oi)(this.worker,e,t,r)}}let Z=(0,s.Z)("esri-workers-debug")?1:(0,s.Z)("esri-mobile")?Math.min(navigator.hardwareConcurrency-1,3):(0,s.Z)("host-browser")?navigator.hardwareConcurrency-1:0;Z||(Z=(0,s.Z)("safari")&&(0,s.Z)("mac")||(0,s.Z)("trident")?7:2);let A=0;const M=[];async function U(e,t){const r=new i.Z;return await r.open(e,t),r}async function L(e,t={}){if("string"!=typeof e)throw new n.Z("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,s.Z)("host-webworker")&&!(0,s.Z)("esri-workers")&&(r="local"),"local"===r){let r=await a.default.loadWorker(e);r||(r=await import(e)),(0,o.k_)(t.signal);const n=t.client||r;return U([a.default.connect(r)],{...t,client:n})}if(await async function(){if(D)return D;G=new AbortController;const e=[];for(let t=0;t<Z;t++){const r=j.create(t).then((e=>(M[t]=e,e)));e.push(r)}return D=Promise.all(e),D}(),(0,o.k_)(t.signal),"dedicated"===r){const r=A++%Z;return U([await M[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,Z);if(r<Z){const n=new Array(r);for(let s=0;s<r;++s){const r=A++%Z;n[s]=M[r].open(e,t)}return U(n,t)}}return U(M.map((r=>r.open(e,t))),t)}let G,D=null},69285:(e,t,r)=>{r.d(t,{k:()=>i});var n=r(70586),s=r(67900),o=r(8744);function i(e,t,r){if((0,n.Wi)(t)||(0,n.Wi)(r)||r.vcsWkid||(0,o.fS)(t,r))return null;const i=(0,s._R)(t)/(0,s._R)(r);if(1===i)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){e&&null!=e.z&&(e.z*=t)}(e,i);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const r of e.paths)for(const e of r)e.length>2&&(e[2]*=t)}(e,i);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const r of e.rings)for(const e of r)e.length>2&&(e[2]*=t)}(e,i);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const r of e.points)r.length>2&&(r[2]*=t)}(e,i);case"extent":case"esriGeometryExtent":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,i);default:return null}}},2587:(e,t,r)=>{r(90344),r(18848),r(940),r(70171);var n=r(94443),s=r(3172),o=r(20102),i=r(70586);async function a(e){if((0,i.pC)(u.fetchBundleAsset))return u.fetchBundleAsset(e);const t=await(0,s.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let n;n="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,s){const i=t.exec(r);if(!i)throw new o.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=i[1]?`${i[1]}/`:"",u=i[2],c=(0,n.Su)(s),p=`${l}${u}.json`,d=c?`${l}${u}_${c}.json`:p;let y;try{y=await a(e(d))}catch(t){if(d===p)throw new o.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{y=await a(e(p))}catch(e){throw new o.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return y}(this.getAssetUrl,this.matcher,e,t)}}const u={};var c,p=r(99880);(0,n.tz)((c={pattern:"esri/",location:p.V},new l(c)))},940:(e,t,r)=>{r.d(t,{n:()=>u});var n=r(92604),s=r(78286),o=r(19153),i=r(90344),a=r(18848);const l=n.Z.getLogger("esri.intl.substitute");function u(e,t,r={}){const{format:n={}}=r;return(0,o.gx)(e,(e=>function(e,t,r){let n,o;const i=e.indexOf(":");if(-1===i?n=e.trim():(n=e.slice(0,i).trim(),o=e.slice(i+1).trim()),!n)return"";const a=(0,s.hS)(n,t);if(null==a)return"";const l=(o?r?.[o]:null)??r?.[n];return l?c(a,l):o?p(a,o):d(a)}(e,t,n)))}function c(e,t){switch(t.type){case"date":return(0,i.p6)(e,t.intlOptions);case"number":return(0,a.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),d(e)}}function p(e,t){switch(t.toLowerCase()){case"dateformat":return(0,i.p6)(e);case"numberformat":return(0,a.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,i.p6)(e):/^numberformat/i.test(t)?(0,a.uf)(e):d(e)}}function d(e){switch(typeof e){case"string":return e;case"number":return(0,a.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,i.p6)(e):""}}},12653:(e,t,r)=>{r.r(t),r.d(t,{default:()=>B});var n=r(43697),s=(r(66577),r(51773)),o=(r(16050),r(12501),r(28756),r(92271),r(72529),r(5499),r(84382),r(81571),r(91423),r(32400)),i=r(70586),a=r(16453),l=r(78286),u=r(17452),c=r(5600),p=(r(67676),r(75215)),d=r(52011),y=r(30556),f=r(86973),h=r(87085),m=r(20102),g=r(3920),w=r(80442),b=r(83379),v=r(95330),_=r(78346),S=r(25278),C=r(51432),k=r(74889),F=r(6570);let P=class extends((0,g.p)(b.Z)){constructor(){super(...arguments),this._connection=null,this.capabilities=(0,S.MS)(!1,!1),this.type="wfs",this.refresh=(0,v.Ds)((async e=>{await this.load();const{extent:t}=await this._connection.invoke("refresh",e);return t&&(this.sourceJSON.extent=t),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}}))}load(e){const t=(0,i.pC)(e)?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return k.default.fromJSON(r)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const r=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:r.count,extent:F.Z.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _createLoadOptions(e){const{url:t,customParameters:r,name:n,namespaceUri:s,spatialReference:o,fields:a,geometryType:l,swapXY:u}=this.layer;if(!t)throw new m.Z("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await(0,C.FU)(t,{customParameters:r,...e}));const c=["fields","geometryType","name","namespaceUri","spatialReference","swapXY"].some((e=>null==this.layer[e])),p=c?await(0,C.be)(this.wfsCapabilities,n,s,{spatialReference:o,customParameters:r,signal:e?.signal}):{...(0,C.eB)(a??[]),geometryType:l,name:n,namespaceUri:s,spatialReference:o,swapXY:u},d=(0,i.Wg)((0,C.ft)(this.wfsCapabilities.readFeatureTypes(),p.name,p.namespaceUri)),y=f.Mk.toJSON(p.geometryType);return{customParameters:r,featureType:d,fields:p.fields?.map((e=>e.toJSON()))??[],geometryField:p.geometryField,geometryType:y,getFeatureUrl:this.wfsCapabilities.operations.GetFeature.url,getFeatureOutputFormat:this.wfsCapabilities.operations.GetFeature.outputFormat,objectIdField:p.objectIdField,spatialReference:p.spatialReference.toJSON(),swapXY:!!p.swapXY}}async _startWorker(e){const[t,r]=await(0,v.as)([this._createLoadOptions(e),(0,_.bA)("WFSSourceWorker",{...e,strategy:(0,w.Z)("feature-layers-workers")?"dedicated":"local"})]),n=t.error||r.error||null,s=r.value||null;if(n)throw s&&s.close(),n;const o=t.value;this._connection=r.value;const{extent:i}=await this._connection.invoke("load",o,e);this.sourceJSON={extent:i,fields:o.fields,geometryType:o.geometryType,objectIdField:o.objectIdField,geometryField:o.geometryField,drawingInfo:(0,S.bU)(o.geometryType),name:o.featureType.title,wfsInfo:{name:o.featureType.name,featureUrl:o.getFeatureUrl,maxFeatures:3e3,swapXY:o.swapXY,supportedSpatialReferences:o.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:o.featureType.namespaceUri}}}};(0,n._)([(0,c.Cb)()],P.prototype,"capabilities",void 0),(0,n._)([(0,c.Cb)({constructOnly:!0})],P.prototype,"layer",void 0),(0,n._)([(0,c.Cb)()],P.prototype,"sourceJSON",void 0),(0,n._)([(0,c.Cb)()],P.prototype,"type",void 0),(0,n._)([(0,c.Cb)()],P.prototype,"wfsCapabilities",void 0),P=(0,n._)([(0,d.j)("esri.layers.graphics.sources.WFSSource")],P);var x,O=r(71612),E=r(17017),R=r(69637),T=r(6404),N=r(38009),I=r(68825),j=r(16859),Z=r(34760),A=r(72965),M=r(28294),U=r(21506),L=r(1231),G=r(53518),D=r(35671),q=r(54306),W=r(30707),J=r(14165),H=r(32163),z=r(82971);const $=(0,G.v)();let Q=x=class extends((0,I.c)((0,E.N)((0,T.M)((0,R.b)((0,O.h)((0,M.n)((0,Z.Q)((0,A.M)((0,N.q)((0,j.I)((0,a.R)(h.Z)))))))))))){constructor(e){super(e),this.copyright=null,this.customParameters=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new P({layer:this}),this.spatialReference=z.Z.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}static fromWFSLayerInfo(e){const{customParameters:t,fields:r,geometryField:n,geometryType:s,name:o,namespaceUri:i,objectIdField:a,spatialReference:l,swapXY:u,url:c,wfsCapabilities:p}=e;return new x({customParameters:t,fields:r,geometryField:n,geometryType:s,name:o,namespaceUri:i,objectIdField:a,spatialReference:l,swapXY:u,url:c,wfsCapabilities:p})}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),(0,D.YN)(this.renderer,this.fieldsIndex),(0,D.UF)(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,r){const n=e.filter((e=>e.name!==C.M8));this.geometryField&&n.unshift(new L.Z({name:this.geometryField,alias:this.geometryField,type:"geometry"})),(0,l.RB)(r,n.map((e=>e.toJSON())),t)}get parsedUrl(){return(0,u.mN)(this.url)}set renderer(e){(0,D.YN)(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return(0,H.eZ)(this,e)}createQuery(){const e=new J.Z;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:t,timeExtent:r}=this;return e.timeExtent=null!=t&&null!=r?r.offset(-t.value,t.unit):r||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(J.Z.from(e)||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(J.Z.from(e)||this.createQuery(),t)))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(J.Z.from(e)||this.createQuery(),t)))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(J.Z.from(e)||this.createQuery(),t)))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return(0,i.pC)(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};(0,n._)([(0,c.Cb)({readOnly:!0})],Q.prototype,"capabilities",null),(0,n._)([(0,c.Cb)({type:String})],Q.prototype,"copyright",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],Q.prototype,"createQueryVersion",null),(0,n._)([(0,c.Cb)({json:{name:"wfsInfo.customParameters",write:{ignoreOrigin:!0}}})],Q.prototype,"customParameters",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],Q.prototype,"defaultPopupTemplate",null),(0,n._)([(0,c.Cb)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Q.prototype,"definitionExpression",void 0),(0,n._)([(0,c.Cb)({type:String})],Q.prototype,"displayField",void 0),(0,n._)([(0,c.Cb)(U.PV)],Q.prototype,"elevationInfo",void 0),(0,n._)([(0,c.Cb)({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"featureUrl",void 0),(0,n._)([(0,c.Cb)({type:[L.Z],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],Q.prototype,"fields",void 0),(0,n._)([(0,y.c)("fields")],Q.prototype,"writeFields",null),(0,n._)([(0,c.Cb)($.fieldsIndex)],Q.prototype,"fieldsIndex",void 0),(0,n._)([(0,c.Cb)({type:F.Z,json:{name:"extent"}})],Q.prototype,"fullExtent",void 0),(0,n._)([(0,c.Cb)()],Q.prototype,"geometryField",void 0),(0,n._)([(0,c.Cb)({type:String,json:{read:{source:"layerDefinition.geometryType",reader:f.Mk.read},write:{target:"layerDefinition.geometryType",writer:f.Mk.write,ignoreOrigin:!0},origins:{service:{read:f.Mk.read}}}})],Q.prototype,"geometryType",void 0),(0,n._)([(0,c.Cb)({type:String})],Q.prototype,"id",void 0),(0,n._)([(0,c.Cb)(U.iR)],Q.prototype,"labelsVisible",void 0),(0,n._)([(0,c.Cb)({type:[q.Z],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:W.r},write:!0}})],Q.prototype,"labelingInfo",void 0),(0,n._)([(0,c.Cb)(U.rn)],Q.prototype,"legendEnabled",void 0),(0,n._)([(0,c.Cb)({type:["show","hide"]})],Q.prototype,"listMode",void 0),(0,n._)([(0,c.Cb)({type:String})],Q.prototype,"objectIdField",void 0),(0,n._)([(0,c.Cb)({type:["WFS"]})],Q.prototype,"operationalLayerType",void 0),(0,n._)([(0,c.Cb)({type:p.z8,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"maxFeatures",void 0),(0,n._)([(0,c.Cb)({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],Q.prototype,"mode",void 0),(0,n._)([(0,c.Cb)({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"name",void 0),(0,n._)([(0,c.Cb)({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"namespaceUri",void 0),(0,n._)([(0,c.Cb)(U.bT)],Q.prototype,"opacity",void 0),(0,n._)([(0,c.Cb)($.outFields)],Q.prototype,"outFields",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],Q.prototype,"parsedUrl",null),(0,n._)([(0,c.Cb)(U.C_)],Q.prototype,"popupEnabled",void 0),(0,n._)([(0,c.Cb)({type:s.Z,json:{name:"popupInfo",write:!0}})],Q.prototype,"popupTemplate",void 0),(0,n._)([(0,c.Cb)({types:o.A,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:o.o,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],Q.prototype,"renderer",null),(0,n._)([(0,c.Cb)(U.YI)],Q.prototype,"screenSizePerspectiveEnabled",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],Q.prototype,"source",void 0),(0,n._)([(0,c.Cb)({type:z.Z,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],Q.prototype,"spatialReference",void 0),(0,n._)([(0,c.Cb)({readOnly:!0,type:[p.z8],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"spatialReferences",void 0),(0,n._)([(0,c.Cb)({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"swapXY",void 0),(0,n._)([(0,c.Cb)({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],Q.prototype,"title",void 0),(0,n._)([(0,c.Cb)({json:{read:!1},readOnly:!0})],Q.prototype,"type",void 0),(0,n._)([(0,c.Cb)(U.HQ)],Q.prototype,"url",void 0),(0,n._)([(0,c.Cb)({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],Q.prototype,"version",void 0),(0,n._)([(0,c.Cb)()],Q.prototype,"wfsCapabilities",null),Q=x=(0,n._)([(0,d.j)("esri.layers.WFSLayer")],Q);const B=Q},61159:(e,t,r)=>{r.d(t,{g:()=>n});const n={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},92722:(e,t,r)=>{r.d(t,{O3:()=>_,lG:()=>C,my:()=>S,q9:()=>l});var n=r(20102),s=r(70272),o=r(5428),i=r(35671);const a={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function l(e){return a[e]}function*u(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*c(e){if(!e)return null;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 p(e){for(const t of e)if(t.length>2)return!0;return!1}function d(e){let t=0;for(let r=0;r<e.length;r++){const n=e[r],s=e[(r+1)%e.length];t+=n[0]*s[1]-s[0]*n[1]}return t<=0}function y(e){const t=e[0],r=e[e.length-1];return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]||e.push(t),e}function f(e,t,r){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,r){return g(e,t.coordinates,r),e}(e,t,r);case"MultiLineString":return function(e,t,r){for(const n of t.coordinates)g(e,n,r);return e}(e,t,r);case"MultiPolygon":return function(e,t,r){for(const n of t.coordinates){h(e,n[0],r);for(let t=1;t<n.length;t++)m(e,n[t],r)}return e}(e,t,r);case"Point":return function(e,t,r){return b(e,t.coordinates,r),e}(e,t,r);case"Polygon":return function(e,t,r){const n=t.coordinates;h(e,n[0],r);for(let t=1;t<n.length;t++)m(e,n[t],r);return e}(e,t,r)}}function h(e,t,r){const n=y(t);!function(e){return!d(e)}(n)?g(e,n,r):w(e,n,r)}function m(e,t,r){const n=y(t);!function(e){return d(e)}(n)?g(e,n,r):w(e,n,r)}function g(e,t,r){for(const n of t)b(e,n,r);e.lengths.push(t.length)}function w(e,t,r){for(let n=t.length-1;n>=0;n--)b(e,t[n],r);e.lengths.push(t.length)}function b(e,t,r){const[n,s,o]=t;e.coords.push(n,s),r.hasZ&&e.coords.push(o||0)}function v(e){switch(typeof e){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function _(e){if(!e)throw new n.Z("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new n.Z("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:t}=e;if(!t)return;const r="string"==typeof t?t:"name"===t.type?t.properties.name:"EPSG"===t.type?t.properties.code:null,s=new RegExp(".*(CRS84H?|4326)$","i");if(!r||!s.test(r))throw new n.Z("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function S(e,t={}){const r=[],n=new Set,s=new Set;let o,a=!1,d=null,y=!1,{geometryType:f=null}=t,h=!1;for(const t of u(e)){const{geometry:e,properties:u,id:m}=t;if((!e||(f||(f=l(e.type)),l(e.type)===f))&&(a||(a=p(c(e))),y||(y=null!=m,y&&(o=typeof m,d=Object.keys(u).filter((e=>u[e]===m)))),y&&null!=m&&(d.length>1?d=d.filter((e=>u[e]===m)):1===d.length&&(d=u[d[0]]===m?d:[])),!h&&u)){let e=!0;for(const t in u){if(n.has(t))continue;const o=u[t];if(null==o){e=!1,s.add(t);continue}const a=v(o);"unknown"!==a?(s.delete(t),n.add(t),r.push({name:(0,i.q6)(t),alias:t,type:a})):s.add(t)}h=e}}const m=(0,i.q6)(1===d?.length&&d[0]||null);if(m)for(const e of r)if(e.name===m&&(0,i.H7)(e)){e.type="esriFieldTypeOID";break}return{fields:r,geometryType:f,hasZ:a,objectIdFieldName:m,objectIdFieldType:o,unknownFields:Array.from(s)}}function C(e,t){return Array.from(function*(e,t={}){const{geometryType:r,objectIdField:n}=t;for(const i of e){const{geometry:e,properties:a,id:u}=i;if(e&&l(e.type)!==r)continue;const c=a||{};let p=c[n]??null;n&&null!=u&&!c[n]&&(c[n]=p=u);const d=new s.u_(e?f(new o.Z,e,t):null,c,null,p);yield d}}(u(e),t))}},25278:(e,t,r)=>{r.d(t,{Dm:()=>c,Hq:()=>p,MS:()=>d,bU:()=>a});var n=r(80442),s=r(22974),o=r(61159),i=r(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?i.I4:"esriGeometryPolyline"===e?i.ET:i.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function c(e,t){if((0,n.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this.${t} = null;`;for(const t in e)r+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const n=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new n}catch(r){return()=>({[t]:null,...e})}}function p(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,s.d9)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0},query:o.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1}}}},68825:(e,t,r)=>{r.d(t,{c:()=>h});var n,s=r(43697),o=r(78286),i=r(5600),a=(r(67676),r(75215),r(52011)),l=r(35454),u=r(96674);const c=new l.X({asc:"ascending",desc:"descending"});let p=n=class extends u.wq{constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new n({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,s._)([(0,i.Cb)({type:String,json:{write:!0}})],p.prototype,"field",void 0),(0,s._)([(0,i.Cb)({type:String,json:{write:!0}})],p.prototype,"valueExpression",void 0),(0,s._)([(0,i.Cb)({type:c.apiValues,json:{read:c.read,write:c.write}})],p.prototype,"order",void 0),p=n=(0,s._)([(0,a.j)("esri.layers.support.OrderByInfo")],p);const d=p;function y(e,t,r){if(!e)return null;const n=e.find((e=>!!e.field));if(!n)return null;const s=new d;return s.read(n,r),[s]}function f(e,t,r,n){const s=e.find((e=>!!e.field));s&&(0,o.RB)(r,[s.toJSON()],t)}const h=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,s._)([(0,i.Cb)({type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:y},write:{target:"layerDefinition.orderBy",writer:f}}})],t.prototype,"orderBy",void 0),t=(0,s._)([(0,a.j)("esri.layers.mixins.OrderedLayer")],t),t}},51432:(e,t,r)=>{r.d(t,{M8:()=>_,ft:()=>x,FU:()=>k,Bm:()=>I,be:()=>O,eB:()=>E}),r(66577);var n=r(3172),s=r(20102),o=r(66374),i=r(70586),a=r(95330),l=r(17452),u=r(44547),c=r(8744),p=r(86973),d=r(92722);function y(e){return function(e){const t=f.exec(e);if(!t?.groups)return null;const r=t.groups,n=+r.year,s=+r.month-1,o=+r.day,i=+(r.hours??"0"),a=+(r.minutes??"0"),l=+(r.seconds??"0");if(i>23)return null;if(a>59)return null;if(l>59)return null;const u=r.ms??"0",c=u?+u.padEnd(3,"0").substring(0,3):0;let p;if(r.isUTC)p=Date.UTC(n,s,o,i,a,l,c);else if(r.offsetSign){const e=+r.offsetHours,t=+r.offsetMinutes;p=6e4*("+"===r.offsetSign?-1:1)*(60*e+t)+Date.UTC(n,s,o,i,a,l,c)}else p=new Date(n,s,o,i,a,l,c).getTime();return Number.isNaN(p)?null:p}(e)??function(e){const t=new Date(e).getTime();return Number.isNaN(t)?null:t}(e)}const f=/^(?:(?<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})))?$/;var h=r(88724),m=r(1231),g=r(82971),w=r(6570);const b="xlink:href",v="2.0.0",_="__esri_wfs_id__",S="wfs-layer:feature-type-not-found",C="wfs-layer:unknown-geometry-type";async function k(e,t){const r=function(e){const t=Z(e);(function(e){const t=e.firstElementChild?.getAttribute("version");if(t&&t!==v)throw new s.Z("wfs-layer:unsupported-wfs-version",`Unsupported WFS version ${t}. Supported version: ${v}`)})(t),M(t);const r=t.firstElementChild,n=(0,o.Fs)(function(e){return(0,h.H)(e,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",supportedSpatialReferences:[]},r=new Set([4326]),n=e=>{const t=parseInt(e.textContent?.match(/(?<wkid>\d+$)/i)?.groups?.wkid??"",10);Number.isNaN(t)||r.add(t)};return(0,h.h)(e,{Name:e=>{const{name:r,prefix:n}=A(e.textContent);t.typeName=`${n}:${r}`,t.name=r,t.namespacePrefix=n,t.namespaceUri=e.lookupNamespaceURI(n)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=function(e){let t,r,n,s;for(const o of e.children)switch(o.localName){case"LowerCorner":[t,r]=o.textContent.split(" ").map((e=>Number.parseFloat(e)));break;case"UpperCorner":[n,s]=o.textContent.split(" ").map((e=>Number.parseFloat(e)))}return{xmin:t,ymin:r,xmax:n,ymax:s,spatialReference:c.Zn}}(e)},DefaultSRS:n,DefaultCRS:n,OtherSRS:n,OtherCRS:n}),t.title||(t.title=t.name),t.supportedSpatialReferences.push(...r),t}}})}(r));return{operations:P(r),get featureTypes(){return Array.from(n())},readFeatureTypes:n}}((await(0,n.default)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:v,...t?.customParameters},signal:t?.signal})).data);return function(e,t){(0,l.$U)(e)&&((0,l.D6)(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=(0,l.hO)(t.operations.DescribeFeatureType.url)),(0,l.D6)(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=(0,l.hO)(t.operations.GetFeature.url)))}(e,r),r}const F=new Set(["json","application/json","geojson","application/json; subtype=geojson"]);function P(e){let t=!1;const r={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}};if((0,h.h)(e,{OperationsMetadata:{Operation:e=>{switch(e.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:e=>{r.GetCapabilities.url=e.getAttribute(b)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:e=>{r.DescribeFeatureType.url=e.getAttribute(b)}}}};case"GetFeature":return{DCP:{HTTP:{Get:e=>{r.GetFeature.url=e.getAttribute(b)}}},Parameter:e=>{if("outputFormat"===e.getAttribute("name"))return{AllowedValues:{Value:e=>{const t=e.textContent;t&&F.has(t.toLowerCase())&&(r.GetFeature.outputFormat=t)}}}}}}},Constraint:e=>{switch(e.getAttribute("name")){case"KVPEncoding":return{DefaultValue:e=>{t="true"===e.textContent.toLowerCase()}};case"ImplementsResultPaging":return{DefaultValue:e=>{r.GetFeature.supportsPagination="true"===e.textContent.toLowerCase()}}}}}}),!t)throw new s.Z("wfs-layer:kvp-encoding-not-supported","WFS service doesn't support key/value pair (KVP) encoding");if((0,i.Wi)(r.GetFeature.outputFormat))throw new s.Z("wfs-layer:geojson-not-supported","WFS service doesn't support GeoJSON output format");return r}function x(e,t,r){return(0,o.sE)(e,(e=>r?e.name===t&&e.namespaceUri===r:e.typeName===t||e.name===t))}async function O(e,t,r,n={}){const{featureType:o,extent:l}=await async function(e,t,r,n={}){const{spatialReference:o=g.Z.WGS84}=n,a=e.readFeatureTypes(),l=t?x(a,t,r):a.next().value;if((0,i.Wi)(l))throw t?new s.Z(S,`The type '${t}' could not be found in the service`):new s.Z("wfs-layer:empty-service","The service is empty");let p=new w.Z({...l.extent,spatialReference:o});if(!(0,c.fS)(o,c.Zn))try{await(0,u.iQ)(c.Zn,o,void 0,n),p=(0,u.iV)(p,c.Zn)}catch{throw new s.Z("wfs-layer:unsupported-spatial-reference","Projection not supported")}return{extent:p,spatialReference:o,featureType:l}}(e,t,r,n),{fields:p,geometryType:d,swapXY:y,objectIdField:f,geometryField:h}=await async function(e,t,r={}){const[n,o]=await(0,a.as)([T(e.operations.DescribeFeatureType.url,t,r),R(e,t,r)]);if(n.error||o.error)throw new s.Z("wfs-layer:getWFSLayerTypeInfo-error",`An error occurred while getting info about the feature type '${t}'`,{error:n.error||o.error});const{fields:l,errors:u}=n.value??{},c=n.value?.geometryType||o.value?.geometryType,p=o.value?.swapXY??!1;if((0,i.Wi)(c))throw new s.Z(C,`The geometry type could not be determined for type '${t}`,{typeName:t,geometryType:c,fields:l,errors:u});return{...E(l??[]),geometryType:c,swapXY:p}}(e,o.typeName,n);return{url:e.operations.GetCapabilities.url,name:o.name,namespaceUri:o.namespaceUri,fields:p,geometryField:h,geometryType:d,objectIdField:f,spatialReference:n.spatialReference??g.Z.WGS84,extent:l,swapXY:y,wfsCapabilities:e,customParameters:n.customParameters}}function E(e){const t=e.find((e=>"geometry"===e.type));let r=e.find((e=>"oid"===e.type));return e=e.filter((e=>"geometry"!==e.type)),r||(r=new m.Z({name:_,type:"oid",alias:_}),e.unshift(r)),{geometryField:t?.name??null,objectIdField:r.name,fields:e}}async function R(e,t,r={}){let s,o=!1;const[i,a]=await Promise.all([I(e.operations.GetFeature.url,t,e.operations.GetFeature.outputFormat,{...r,count:1}),(0,n.default)(e.operations.GetFeature.url,{responseType:"text",query:j(t,void 0,{...r,count:1}),signal:r?.signal})]),l="FeatureCollection"===i.type&&i.features[0]?.geometry;if(l){let e;switch(s=p.Mk.fromJSON((0,d.q9)(l.type)),l.type){case"Point":e=l.coordinates;break;case"LineString":case"MultiPoint":e=l.coordinates[0];break;case"MultiLineString":case"Polygon":e=l.coordinates[0][0];break;case"MultiPolygon":e=l.coordinates[0][0][0]}const t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(a.data);if(t){const r=e[0].toFixed(3),n=e[1].toFixed(3),s=parseFloat(t[1]).toFixed(3);r===parseFloat(t[2]).toFixed(3)&&n===s&&(o=!0)}}return{geometryType:s,swapXY:o}}async function T(e,t,r){return function(e,t){const{name:r}=A(e),n=Z(t);M(n);const a=(0,o.sE)((0,h.H)(n.firstElementChild,{element:e=>({name:e.getAttribute("name"),typeName:A(e.getAttribute("type")).name})}),(({name:e})=>e===r));if((0,i.pC)(a)){const e=(0,o.sE)((0,h.H)(n.firstElementChild,{complexType:e=>e}),(e=>e.getAttribute("name")===a.typeName));if((0,i.pC)(e))return function(e){const t=[],r=[];let n;const o=(0,h.H)(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(const i of o){const o=i.getAttribute("name");if(!o)continue;let a,l;if(i.hasAttribute("type")?a=A(i.getAttribute("type")).name:(0,h.h)(i,{simpleType:{restriction:e=>(a=A(e.getAttribute("base")).name,{maxLength:e=>{l=+e.getAttribute("value")}})}}),!a)continue;const u="true"===i.getAttribute("nillable");let c=!1;switch(a.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":r.push(new m.Z({name:o,alias:o,type:"integer",nullable:u}));break;case"float":case"double":case"decimal":r.push(new m.Z({name:o,alias:o,type:"double",nullable:u}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":r.push(new m.Z({name:o,alias:o,type:"string",nullable:u,length:l??255}));break;case"datetime":case"date":r.push(new m.Z({name:o,alias:o,type:"date",nullable:u,length:l??36}));break;case"pointpropertytype":n="point",c=!0;break;case"multipointpropertytype":n="multipoint",c=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":n="polyline",c=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":n="polygon",c=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":c=!0,t.push(new s.Z(C,`geometry type '${a}' is not supported`,{type:(new XMLSerializer).serializeToString(e)}));break;default:t.push(new s.Z("wfs-layer:unknown-field-type",`Unknown field type '${a}'`,{type:(new XMLSerializer).serializeToString(e)}))}c&&r.push(new m.Z({name:o,alias:o,type:"geometry",nullable:u}))}for(const e of r)if("integer"===e.type&&!e.nullable&&N.has(e.name.toLowerCase())){e.type="oid";break}return{geometryType:n,fields:r,errors:t}}(e)}throw new s.Z(S,`Type '${e}' not found in document`,{document:(new XMLSerializer).serializeToString(n)})}(t,(await(0,n.default)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:v,TYPENAME:t,...r?.customParameters},signal:r?.signal})).data)}const N=new Set(["objectid","fid"]);async function I(e,t,r,o){let{data:i}=await(0,n.default)(e,{responseType:"text",query:j(t,r,o),signal:o?.signal});i=i.replace(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{if(o?.dateFields?.length){const e=new Set(o.dateFields);return JSON.parse(i,((t,r)=>e.has(t)?y(r):r))}return JSON.parse(i)}catch(e){throw new s.Z("wfs-layer:malformed-json","Error while parsing the response",{response:i,error:e})}}function j(e,t,r){return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:v,TYPENAMES:e,OUTPUTFORMAT:t,SRSNAME:"EPSG:4326",STARTINDEX:r?.startIndex,COUNT:r?.count,...r?.customParameters}}function Z(e){return(new DOMParser).parseFromString(e.trim(),"text/xml")}function A(e){const[t,r]=e.split(":");return{prefix:r?t:"",name:r??t}}function M(e){let t="",r="";if((0,h.h)(e.firstElementChild,{Exception:e=>(t=e.getAttribute("exceptionCode"),{ExceptionText:e=>{r=e.textContent}})}),t)throw new s.Z(`wfs-layer:${t}`,r)}},88724:(e,t,r)=>{function n(e,t){if(e&&t)for(const r of e.children)if(r.localName in t){const e=t[r.localName];if("function"==typeof e){const t=e(r);t&&n(r,t)}else n(r,e)}}function*s(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];"function"==typeof e?yield e(r):yield*s(r,e)}}r.d(t,{H:()=>s,h:()=>n})},51706:(e,t,r)=>{var n,s;function o(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function i(e){return null!=e&&!isNaN(e)&&isFinite(e)}function a(e){return e.valueExpression?n.Expression:e.field&&"string"==typeof e.field?n.Field:n.Unknown}function l(e,t){const r=t||a(e),o=e.valueUnit||"unknown";return r===n.Unknown?s.Constant:e.stops?s.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?s.ClampedLinear:"unknown"===o?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?s.Proportional:s.Additive:s.Identity:s.RealWorldSize}r.d(t,{PS:()=>a,QW:()=>l,RY:()=>n,hL:()=>s,iY:()=>o,qh:()=>i}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(n||(n={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(s||(s={}))},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>v});var n,s=r(43697),o=r(66577),i=r(38171),a=r(35454),l=r(96674),u=r(22974),c=r(70586),p=r(5600),d=(r(75215),r(71715)),y=r(52011),f=r(30556),h=r(82971),m=r(33955),g=r(1231);const w=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=n=class extends l.wq{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){const r=h.Z.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const s=e[t],o=i.Z.fromJSON(s),a=s.geometry&&s.geometry.spatialReference;(0,c.pC)(o.geometry)&&!a&&(o.geometry.spatialReference=r);const l=s.aggregateGeometries,u=o.aggregateGeometries;if(l&&(0,c.pC)(u))for(const e in u){const t=u[e],n=l[e]?.spatialReference;(0,c.pC)(t)&&!n&&(t.spatialReference=r)}n.push(o)}return n}writeGeometryType(e,t,r,n){if(e)return void w.write(e,t,r,n);const{features:s}=this;if(s)for(const e of s)if(e&&(0,c.pC)(e.geometry))return void w.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,m.im)(e);return n&&!r&&t.spatialReference&&(n.spatialReference=h.Z.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,c.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,u.d9)({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 n=t.features[r];if(n.geometry){const t=e&&e[r];n.geometry=t&&t.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,s]}=e,o=this.features,i=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-n)/t)),(e=>Math.round((s-e)/r)));for(let e=0,t=o.length;e<t;e++)i?.((0,c.Wg)(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:[n,s],scale:[o,i]}=r,a=this._getHydrationFunction(e,(e=>e*o+n),(e=>s-e*i));for(const{geometry:e}of t)(0,c.pC)(e)&&a&&a(e);return this.transform=null,this}_quantizePoints(e,t,r){let n,s;const o=[];for(let i=0,a=e.length;i<a;i++){const a=e[i];if(i>0){const e=t(a[0]),i=r(a[1]);e===n&&i===s||(o.push([e-n,i-s]),n=e,s=i)}else n=t(a[0]),s=r(a[1]),o.push([n,s])}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 n=(0,m.oU)(e)?e.rings:e.paths,s=[];for(let e=0,o=n.length;e<o;e++){const o=n[e],i=this._quantizePoints(o,t,r);i&&s.push(i)}return s.length>0?((0,m.oU)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n&&n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const n=(0,m.oU)(e)?e.rings:e.paths;let s,o;for(let e=0,i=n.length;e<i;e++){const i=n[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];e>0?(s+=n[0],o+=n[1]):(s=n[0],o=n[1]),n[0]=t(s),n[1]=r(o)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const n=e.points;let s,o;for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(s+=i[0],o+=i[1]):(s=i[0],o=i[1]),i[0]=t(s),i[1]=r(o)}}:null}};(0,s._)([(0,p.Cb)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,s._)([(0,p.Cb)({type:[i.Z],json:{write:!0}})],b.prototype,"features",void 0),(0,s._)([(0,d.r)("features")],b.prototype,"readFeatures",null),(0,s._)([(0,p.Cb)({type:[g.Z],json:{write:!0}})],b.prototype,"fields",void 0),(0,s._)([(0,p.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],b.prototype,"geometryType",void 0),(0,s._)([(0,f.c)("geometryType")],b.prototype,"writeGeometryType",null),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,s._)([(0,p.Cb)({types:o.qM,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,s._)([(0,d.r)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,s._)([(0,p.Cb)({type:h.Z,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,s._)([(0,f.c)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,s._)([(0,p.Cb)({json:{write:!0}})],b.prototype,"transform",void 0),b=n=(0,s._)([(0,y.j)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0;const v=b},58333:(e,t,r)=>{r.d(t,{ET:()=>o,I4:()=>s,eG:()=>l,lF:()=>i,lj:()=>c,qP:()=>a,wW:()=>u});const n=[252,146,31,255],s={type:"esriSMS",style:"esriSMSCircle",size:6,color:n,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:n},i={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},c={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.25.1";s.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.25.2";s.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_parseInfo as e}from"../../../../core/number.js";const t=/^\s*"([\S\s]*)"\s*$/,n=/""/g,i="\n",r=[","," ",";","|","\t"];function*o(e,t,n){let i=0;for(;i<=e.length;){const r=e.indexOf(t,i),o=e.substring(i,r>-1?r:void 0);i+=o.length+t.length,n&&!o.trim()||(yield o)}}function l(e){const t=e.includes("\r\n")?"\r\n":i;return o(e,t,!0)}function s(e,t){return o(e,t,!1)}function u(e,t,n){e=e.trim(),t=t?.trim();const i=[],o=Array.from(new Set([n?.delimiter,...r])).filter((e=>null!=e));for(const r of o){const n=a(e,r).length,o=a(t,r).length??n;n>1&&i.push({weight:Math.min(n,o),delimiter:r})}const l=i.sort((({weight:e},{weight:t})=>t-e)).map((({delimiter:e})=>e));for(const r of l){const t=f(a(e,r).filter(Boolean),n?.longitudeField,n?.latitudeField);if(t.longitudeFieldName&&t.latitudeFieldName)return{delimiter:r,locationInfo:t}}return{delimiter:l[0],locationInfo:null}}function*c(e,r,o,u=(()=>Object.create(null))){const c=l(e);c.next();let a="",f="",g=0,m=u(),p=0;e:for(const l of c){const e=s(l,o);for(const i of e)if(a+=f+i,f="",g+=d(i),g%2==0){if(g>0){const e=t.exec(a);if(!e){m=u(),p=0,a="",g=0;continue e}m[r[p]]=e[1].replace(n,'"'),p++}else m[r[p]]=a,p++;a="",g=0}else f=o;0===g?(yield m,m=u(),p=0):f=i}}function a(e,i){if(!e?.length)return[];const r=[];let o="",l="",u=0;const c=s(e,i);for(const s of c)if(o+=l+s,l="",u+=d(s),u%2==0){if(u>0){const e=t.exec(o);e&&r.push(e[1].replace(n,'"'))}else r.push(o);o="",u=0}else l=i;return r}function d(e){let t=0,n=0;for(n=e.indexOf('"',n);n>=0;)t++,n=e.indexOf('"',n+1);return t}function f(e,t,n){e=e.map((e=>e.trim())),t=t?.toLowerCase().trim(),n=n?.toLowerCase().trim();const i=e.map((e=>e.toLowerCase())),r=t?e[i.indexOf(t)]:void 0,o=n?e[i.indexOf(n)]:void 0;return{longitudeFieldName:r||e[i.indexOf(y.find((e=>i.includes(e))))],latitudeFieldName:o||e[i.indexOf(x.find((e=>i.includes(e))))]}}function g(e,t,n,i){const r=[],o=c(e,n,t),l=[];for(const s of o){if(10===l.length)break;l.push(s)}for(const s of n)if(s===i.longitudeFieldName||s===i.latitudeFieldName)r.push({name:s,type:"esriFieldTypeDouble",alias:s});else{let e,t;switch(m(l.map((e=>e[s])))){case"integer":e="esriFieldTypeInteger";break;case"double":e="esriFieldTypeDouble";break;case"date":e="esriFieldTypeDate",t=36;break;default:e="esriFieldTypeString",t=255}r.push({name:s,type:e,alias:s,length:t})}return r}function m(e){if(!e.length)return"string";const t=/[^+-.,0-9]/;return e.map((e=>{let n=!1;if(""!==e){if(t.test(e))n=!0;else{let t=b(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")){if(t=Number(e),!isNaN(t))return"double";if(e.includes(",")){if(e=e.replace(",","."),t=Number(e),!isNaN(t))return"double";n=!0}else n=!0}else n=!0}if(n){if(!/^[-]?\d*[.,]?\d*$/.test(e)){return p(new Date(e),e)?"date":"string"}return"string"}return"string"}})).reduce(((e,t)=>void 0===e?t:void 0===t?e:e===t?t:"string"===e||"string"===t?"string":"double"===e||"double"===t?"double":void 0))}function p(e,t){if(!e||"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))return!1;let n=!0;if(!N&&/\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=!h.test(e[i]),i++;n=!t}}return n}const b=function(){const t=e(),n=new RegExp("^"+t.regexp+"$"),i=new RegExp("["+t.group+"\\s\\xa0]","g"),r=t.factor;return e=>{const o=n.exec(e);if(t.factor=r,!o)return NaN;let l=o[1];if(!o[1]){if(!o[2])return NaN;l=o[2],t.factor*=-1}return l=l.replace(i,"").replace(t.decimal,"."),+l*t.factor}}(),h=/^((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,N=Number.isNaN(new Date("technology 10").getTime()),x=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point-y"],y=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point-x"];export{u as inferDelimiterAndLocationInfo,m as inferFieldType,g as inferFields,p as isValidDate,b as parseNumber,c as parseRows,s as readRowParts,l as readRows,a as splitSingleRow};
5
+ import{_parseInfo as e}from"../../../../core/number.js";const t=/^\s*"([\S\s]*)"\s*$/,n=/""/g,i="\n",r=[","," ",";","|","\t"];function*l(e,t,n){let i=0;for(;i<=e.length;){const r=e.indexOf(t,i),l=e.substring(i,r>-1?r:void 0);i+=l.length+t.length,n&&!l.trim()||(yield l)}}function o(e){const t=e.includes("\r\n")?"\r\n":i;return l(e,t,!0)}function u(e,t){return l(e,t,!1)}function s(e,t,n){e=e.trim(),t=t?.trim();const i=[],l=Array.from(new Set([n?.delimiter,...r])).filter((e=>null!=e));for(const r of l){const n=f(e,r).length,l=f(t,r).length??n;n>1&&i.push({weight:Math.min(n,l),delimiter:r})}const o=i.sort((({weight:e},{weight:t})=>t-e)).map((({delimiter:e})=>e));for(const r of o){const t=g(a(e,r).names,n?.longitudeField,n?.latitudeField);if(t.longitudeFieldName&&t.latitudeFieldName)return{delimiter:r,locationInfo:t}}return{delimiter:o[0],locationInfo:null}}function*c(e,r,l,s=(()=>Object.create(null))){const c=o(e);c.next();let a="",f="",g=0,m=s(),p=0;e:for(const o of c){const e=u(o,l);for(const i of e)if(a+=f+i,f="",g+=d(i),g%2==0){if(g>0){const e=t.exec(a);if(!e){m=s(),p=0,a="",g=0;continue e}m[r[p]]=e[1].replace(n,'"'),p++}else m[r[p]]=a,p++;a="",g=0}else f=l;0===g?(yield m,m=s(),p=0):f=i}}function a(e,t){const n=f(e,t).filter((e=>null!=e)),i=n.map((e=>$(e)));for(let r=i.length-1;r>=0;r--)i[r]||(i.splice(r,1),n.splice(r,1));return{names:i,aliases:n}}function f(e,i){if(!e?.length)return[];const r=[];let l="",o="",s=0;const c=u(e,i);for(const u of c)if(l+=o+u,o="",s+=d(u),s%2==0){if(s>0){const e=t.exec(l);e&&r.push(e[1].replace(n,'"'))}else r.push(l);l="",s=0}else o=i;return r}function d(e){let t=0,n=0;for(n=e.indexOf('"',n);n>=0;)t++,n=e.indexOf('"',n+1);return t}function g(e,t,n){t=$(t)?.toLowerCase(),n=$(n)?.toLowerCase();const i=e.map((e=>e.toLowerCase())),r=t?e[i.indexOf(t)]:null,l=n?e[i.indexOf(n)]:null;return{longitudeFieldName:r||e[i.indexOf(F.find((e=>i.includes(e))))],latitudeFieldName:l||e[i.indexOf(y.find((e=>i.includes(e))))]}}function m(e,t,n,i,r){const l=[],o=c(e,n,t),u=[];for(const s of o){if(10===u.length)break;u.push(s)}for(let s=0;s<n.length;s++){const e=n[s],t=i[s];if(e===r.longitudeFieldName||e===r.latitudeFieldName)l.push({name:e,type:"esriFieldTypeDouble",alias:t});else{let n,i;switch(p(u.map((t=>t[e])))){case"integer":n="esriFieldTypeInteger";break;case"double":n="esriFieldTypeDouble";break;case"date":n="esriFieldTypeDate",i=36;break;default:n="esriFieldTypeString",i=255}l.push({name:e,type:n,alias:t,length:i})}}return l}function p(e){if(!e.length)return"string";const t=/[^+-.,0-9]/;return e.map((e=>{let n=!1;if(""!==e){if(t.test(e))n=!0;else{let t=h(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")){if(t=Number(e),!isNaN(t))return"double";if(e.includes(",")){if(e=e.replace(",","."),t=Number(e),!isNaN(t))return"double";n=!0}else n=!0}else n=!0}if(n){if(!/^[-]?\d*[.,]?\d*$/.test(e)){return b(new Date(e),e)?"date":"string"}return"string"}return"string"}})).reduce(((e,t)=>void 0===e?t:void 0===t?e:e===t?t:"string"===e||"string"===t?"string":"double"===e||"double"===t?"double":void 0))}function b(e,t){if(!e||"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))return!1;let n=!0;if(!x&&/\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=!N.test(e[i]),i++;n=!t}}return n}const h=function(){const t=e(),n=new RegExp("^"+t.regexp+"$"),i=new RegExp("["+t.group+"\\s\\xa0]","g"),r=t.factor;return e=>{const l=n.exec(e);if(t.factor=r,!l)return NaN;let o=l[1];if(!l[1]){if(!l[2])return NaN;o=l[2],t.factor*=-1}return o=o.replace(i,"").replace(t.decimal,"."),+o*t.factor}}(),N=/^((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,x=Number.isNaN(new Date("technology 10").getTime()),y=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],F=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],w=/^([0-9])/,_=/[^A-Za-z0-9_\u0080-\uffff]/g,O=/_{2,}/g,j=/^_/,T=/_$/;function $(e){return e?e.trim().replace(_,"_").replace(O,"_").replace(j,"").replace(T,"").replace(w,"F$1"):null}export{a as extractFieldNamesAndAliasesFromRow,s as inferDelimiterAndLocationInfo,p as inferFieldType,m as inferFields,b as isValidDate,$ as normalizeFieldName,h as parseNumber,c as parseRows,u as readRowParts,o as readRows,f as splitSingleRow};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{isSome as r}from"../../../../core/maybe.js";import{isAbortError as n}from"../../../../core/promiseUtils.js";import{getJsonType as a}from"../../../../geometry/support/jsonUtils.js";import{WGS84 as o,equals as l}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as u,convertToGeometry as d,convertFromFeatures as p,convertToFeature as c,convertFromFeature as y}from"../../featureConversionUtils.js";import h from"../../data/FeatureStore.js";import{checkProjectionSupport as m,project as f}from"../../data/projectionSupport.js";import{QueryEngine as g}from"../../data/QueryEngine.js";import{inferLayerProperties as _,createOptimizedFeatures as I,validateGeoJSON as j}from"./geojson.js";import{createDrawingInfo as F,createDefaultTemplate as E,createDefaultAttributesFunction as b}from"../support/clientSideDefaults.js";import{loadGeometryEngineForSimplify as T,mixAttributes as w,createFeatureEditSuccessResult as q,createFeatureEditErrorResult as x,simplify as S}from"../support/sourceUtils.js";import R from"../../../support/FieldsIndex.js";import{kebabDict as k}from"../../../support/fieldType.js";import{getFieldDefaultValue as D}from"../../../support/fieldUtils.js";const O={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class C{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[];await this._checkProjection(e.spatialReference);let r=null;e.url&&(r=await this._fetch(t?.signal));const n=_(r,{geometryType:e.geometryType}),a=e.fields||n.fields||[],l=null!=e.hasZ?e.hasZ:n.hasZ,u=n.geometryType,d=e.objectIdField||n.objectIdFieldName||"__OBJECTID",p=e.spatialReference||o;let c=e.timeInfo;a===n.fields&&n.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:n.unknownFields}});let y=a.find((e=>e.name===d));y?("esriFieldTypeString"!==y.type&&(y.type="esriFieldTypeOID"),y.editable=!1,y.nullable=!1):(y={alias:d,name:d,type:"string"===n.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},a.unshift(y));const m={};for(const o of a){if(null==o.name&&(o.name=o.alias),null==o.alias&&(o.alias=o.name),!o.name)throw new s("geojson-layer:invalid-field-name","field name is missing",{field:o});if(!k.jsonValues.includes(o.type))throw new s("geojson-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});if(o.name!==y.name){const e=D(o);void 0!==e&&(m[o.name]=e)}}this._fieldsIndex=new R(a);const f=this._fieldsIndex.requiredFields.indexOf(y);if(f>-1&&this._fieldsIndex.requiredFields.splice(f,1),c){if(c.startTimeField){const e=this._fieldsIndex.get(c.startTimeField);e?(c.startTimeField=e.name,e.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const e=this._fieldsIndex.get(c.endTimeField);e?(c.endTimeField=e.name,e.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const e=this._fieldsIndex.get(c.trackIdField);e?c.trackIdField=e.name:(c.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:c}}))}c.startTimeField||c.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:c}}),c=null)}const I=u?F(u):null,j={warnings:i,featureErrors:[],layerDefinition:{...O,drawingInfo:I,templates:E(m),extent:null,geometryType:u,objectIdField:d,fields:a,hasZ:!!l,timeInfo:c}};this._queryEngine=new g({fields:a,geometryType:u,hasM:!1,hasZ:l,objectIdField:d,spatialReference:p,timeInfo:c,featureStore:new h({geometryType:u,hasM:!1,hasZ:l}),cacheSpatialQueries:!0}),this._createDefaultAttributes=b(m,d);const T=await this._createFeatures(r);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,T);const w=this._normalizeFeatures(T,j.warnings,j.featureErrors);if(this._queryEngine.featureStore.addMany(w),j.layerDefinition.extent=this._queryEngine.fullExtent,j.layerDefinition.timeInfo){const{start:e,end:t}=this._queryEngine.timeExtent;j.layerDefinition.timeInfo.timeExtent=[e,t]}return j}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([T(t,s),m(e.adds,t),m(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)}),(e=>{this._queryEngine.featureStore.clear(),n(e)||i.getLogger("esri.layers.GeoJSONLayer").error(new s("geojson-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete(),{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent}}async _createFeatures(e){const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,n=I(e,{geometryType:t,hasZ:s,objectIdField:i});if(!l(this._queryEngine.spatialReference,o))for(const a of n)r(a.geometry)&&(a.geometry=u(f(d(a.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),o,this._queryEngine.spatialReference)));return n}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:s,customParameters:i}=this._loadOptions,r=(await e(s,{responseType:"json",query:{...i},signal:t})).data;return await j(r),r}_normalizeFeatures(e,t,s){const{objectIdField:i}=this._queryEngine,r=[];for(const n of e){const e=this._createDefaultAttributes(),a=w(this._fieldsIndex,e,n.attributes,!0,t);a?s?.push(a):(this._assignObjectId(e,n.attributes,!0),n.attributes=e,n.objectId=e[i],r.push(n))}return r}_applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t&&t.length&&this._applyAddEdits(r,t),s&&s.length&&this._applyUpdateEdits(r,s),i&&i.length){for(const e of i)r.deleteResults.push(q(e));this._queryEngine.featureStore.removeManyById(i)}return{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:n,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d}=this._queryEngine,c=[];for(const p of t){if(p.geometry&&i!==a(p.geometry)){s.push(x("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),n=w(this._fieldsIndex,t,p.attributes);if(n)s.push(n);else{if(this._assignObjectId(t,p.attributes),p.attributes=t,null!=p.uid){const t=p.attributes[l];e.uidToObjectId[p.uid]=t}if(r(p.geometry)){const e=p.geometry.spatialReference??u;p.geometry=f(S(p.geometry,e),e,u)}c.push(p),s.push(q(p.attributes[l]))}}d.addMany(p([],c,i,o,n,l))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:n,objectIdField:o,spatialReference:l,featureStore:u}=this._queryEngine;for(const d of t){const{attributes:t,geometry:p}=d,h=t&&t[o];if(null==h){e.push(x(`Identifier field ${o} missing`));continue}if(!u.has(h)){e.push(x(`Feature with object id ${h} missing`));continue}const m=c(u.getFeature(h),s,n,i);if(r(p)){if(s!==a(p)){e.push(x("Incorrect geometry type."));continue}const t=p.spatialReference??l;m.geometry=f(S(p,t),t,l)}if(t){const s=w(this._fieldsIndex,m.attributes,t);if(s){e.push(s);continue}}u.add(y(m,s,n,i,o)),e.push(q(h))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if("esriFieldTypeString"===s.type)return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await m(o,e)}catch{throw new s("geojson-layer","Projection not supported")}}}export{C as default};
5
+ import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{isSome as r}from"../../../../core/maybe.js";import{isAbortError as n}from"../../../../core/promiseUtils.js";import{getJsonType as a}from"../../../../geometry/support/jsonUtils.js";import{WGS84 as o,equals as l}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as u,convertToGeometry as d,convertFromFeatures as p,convertToFeature as c,convertFromFeature as y}from"../../featureConversionUtils.js";import h from"../../data/FeatureStore.js";import{checkProjectionSupport as m,project as f}from"../../data/projectionSupport.js";import{QueryEngine as g}from"../../data/QueryEngine.js";import{inferLayerProperties as _,createOptimizedFeatures as I,validateGeoJSON as j}from"./geojson.js";import{createDrawingInfo as F,createDefaultTemplate as E,createDefaultAttributesFunction as b}from"../support/clientSideDefaults.js";import{loadGeometryEngineForSimplify as w,mixAttributes as T,createFeatureEditSuccessResult as q,createFeatureEditErrorResult as x,simplify as S}from"../support/sourceUtils.js";import R from"../../../support/FieldsIndex.js";import{kebabDict as k}from"../../../support/fieldType.js";import{getFieldDefaultValue as D}from"../../../support/fieldUtils.js";const O={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class C{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[];await this._checkProjection(e.spatialReference);let r=null;e.url&&(r=await this._fetch(t?.signal));const n=_(r,{geometryType:e.geometryType}),a=e.fields||n.fields||[],l=null!=e.hasZ?e.hasZ:n.hasZ,u=n.geometryType;let d=e.objectIdField||n.objectIdFieldName||"__OBJECTID";const p=e.spatialReference||o;let c=e.timeInfo;a===n.fields&&n.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:n.unknownFields}});let y=new R(a).get(d);y?("esriFieldTypeString"!==y.type&&(y.type="esriFieldTypeOID"),y.editable=!1,y.nullable=!1,d=y.name):(y={alias:d,name:d,type:"string"===n.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},a.unshift(y));const m={};for(const o of a){if(null==o.name&&(o.name=o.alias),null==o.alias&&(o.alias=o.name),!o.name)throw new s("geojson-layer:invalid-field-name","field name is missing",{field:o});if(!k.jsonValues.includes(o.type))throw new s("geojson-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});if(o.name!==y.name){const e=D(o);void 0!==e&&(m[o.name]=e)}}this._fieldsIndex=new R(a);const f=this._fieldsIndex.requiredFields.indexOf(y);if(f>-1&&this._fieldsIndex.requiredFields.splice(f,1),c){if(c.startTimeField){const e=this._fieldsIndex.get(c.startTimeField);e?(c.startTimeField=e.name,e.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const e=this._fieldsIndex.get(c.endTimeField);e?(c.endTimeField=e.name,e.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const e=this._fieldsIndex.get(c.trackIdField);e?c.trackIdField=e.name:(c.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:c}}))}c.startTimeField||c.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:c}}),c=null)}const I=u?F(u):null,j={warnings:i,featureErrors:[],layerDefinition:{...O,drawingInfo:I,templates:E(m),extent:null,geometryType:u,objectIdField:d,fields:a,hasZ:!!l,timeInfo:c}};this._queryEngine=new g({fields:a,geometryType:u,hasM:!1,hasZ:l,objectIdField:d,spatialReference:p,timeInfo:c,featureStore:new h({geometryType:u,hasM:!1,hasZ:l}),cacheSpatialQueries:!0}),this._createDefaultAttributes=b(m,d);const w=await this._createFeatures(r);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,w);const T=this._normalizeFeatures(w,j.warnings,j.featureErrors);if(this._queryEngine.featureStore.addMany(T),j.layerDefinition.extent=this._queryEngine.fullExtent,j.layerDefinition.timeInfo){const{start:e,end:t}=this._queryEngine.timeExtent;j.layerDefinition.timeInfo.timeExtent=[e,t]}return j}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([w(t,s),m(e.adds,t),m(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)}),(e=>{this._queryEngine.featureStore.clear(),n(e)||i.getLogger("esri.layers.GeoJSONLayer").error(new s("geojson-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete(),{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent}}async _createFeatures(e){const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,n=I(e,{geometryType:t,hasZ:s,objectIdField:i});if(!l(this._queryEngine.spatialReference,o))for(const a of n)r(a.geometry)&&(a.geometry=u(f(d(a.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),o,this._queryEngine.spatialReference)));return n}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:s,customParameters:i}=this._loadOptions,r=(await e(s,{responseType:"json",query:{...i},signal:t})).data;return await j(r),r}_normalizeFeatures(e,t,s){const{objectIdField:i}=this._queryEngine,r=[];for(const n of e){const e=this._createDefaultAttributes(),a=T(this._fieldsIndex,e,n.attributes,!0,t);a?s?.push(a):(this._assignObjectId(e,n.attributes,!0),n.attributes=e,n.objectId=e[i],r.push(n))}return r}_applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t&&t.length&&this._applyAddEdits(r,t),s&&s.length&&this._applyUpdateEdits(r,s),i&&i.length){for(const e of i)r.deleteResults.push(q(e));this._queryEngine.featureStore.removeManyById(i)}return{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:n,hasZ:o,objectIdField:l,spatialReference:u,featureStore:d}=this._queryEngine,c=[];for(const p of t){if(p.geometry&&i!==a(p.geometry)){s.push(x("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),n=T(this._fieldsIndex,t,p.attributes);if(n)s.push(n);else{if(this._assignObjectId(t,p.attributes),p.attributes=t,null!=p.uid){const t=p.attributes[l];e.uidToObjectId[p.uid]=t}if(r(p.geometry)){const e=p.geometry.spatialReference??u;p.geometry=f(S(p.geometry,e),e,u)}c.push(p),s.push(q(p.attributes[l]))}}d.addMany(p([],c,i,o,n,l))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:n,objectIdField:o,spatialReference:l,featureStore:u}=this._queryEngine;for(const d of t){const{attributes:t,geometry:p}=d,h=t&&t[o];if(null==h){e.push(x(`Identifier field ${o} missing`));continue}if(!u.has(h)){e.push(x(`Feature with object id ${h} missing`));continue}const m=c(u.getFeature(h),s,n,i);if(r(p)){if(s!==a(p)){e.push(x("Incorrect geometry type."));continue}const t=p.spatialReference??l;m.geometry=f(S(p,t),t,l)}if(t){const s=T(this._fieldsIndex,m.attributes,t);if(s){e.push(s);continue}}u.add(y(m,s,n,i,o)),e.push(q(h))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if("esriFieldTypeString"===s.type)return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await m(o,e)}catch{throw new s("geojson-layer","Projection not supported")}}}export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{OptimizedFeature as t}from"../../OptimizedFeature.js";import n from"../../OptimizedGeometry.js";import{isNumericField as o}from"../../../support/fieldUtils.js";const r={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function i(e){return r[e]}function*s(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*c(e){if(!e)return null;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*u(e,o={}){const{geometryType:r,objectIdField:s}=o;for(const c of e){const{geometry:e,properties:u,id:l}=c;if(e&&i(e.type)!==r)continue;const f=u||{};let a=f[s]??null;s&&null!=l&&!f[s]&&(f[s]=a=l);const y=new t(e?d(new n,e,o):null,f,null,a);yield y}}function l(e){for(const t of e)if(t.length>2)return!0;return!1}function f(e){return!y(e)}function a(e){return y(e)}function y(e){let t=0;for(let n=0;n<e.length;n++){const o=e[n],r=e[(n+1)%e.length];t+=o[0]*r[1]-r[0]*o[1]}return t<=0}function p(e){const t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]||e.push(t),e}function d(e,t,n){switch(t.type){case"LineString":return g(e,t,n);case"MultiLineString":return m(e,t,n);case"MultiPoint":return h(e,t,n);case"MultiPolygon":return w(e,t,n);case"Point":return P(e,t,n);case"Polygon":return b(e,t,n)}}function g(e,t,n){return F(e,t.coordinates,n),e}function m(e,t,n){for(const o of t.coordinates)F(e,o,n);return e}function h(e,t,n){return F(e,t.coordinates,n),e}function w(e,t,n){for(const o of t.coordinates){j(e,o[0],n);for(let t=1;t<o.length;t++)S(e,o[t],n)}return e}function P(e,t,n){return M(e,t.coordinates,n),e}function b(e,t,n){const o=t.coordinates;j(e,o[0],n);for(let r=1;r<o.length;r++)S(e,o[r],n);return e}function j(e,t,n){const o=p(t);f(o)?G(e,o,n):F(e,o,n)}function S(e,t,n){const o=p(t);a(o)?G(e,o,n):F(e,o,n)}function F(e,t,n){for(const o of t)M(e,o,n);e.lengths.push(t.length)}function G(e,t,n){for(let o=t.length-1;o>=0;o--)M(e,t[o],n);e.lengths.push(t.length)}function M(e,t,n){const[o,r,i]=t;e.coords.push(o,r),n.hasZ&&e.coords.push(i||0)}function k(e){switch(typeof e){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function O(t){if(!t)throw new e("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==t.type&&"FeatureCollection"!==t.type)throw new e("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:n}=t;if(!n)return;const o="string"==typeof n?n:"name"===n.type?n.properties.name:"EPSG"===n.type?n.properties.code:null,r=new RegExp(".*(CRS84H?|4326)$","i");if(!o||!r.test(o))throw new e("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:n})}function T(e,t={}){const n=[],r=new Set,u=new Set;let f,a=!1,y=null,p=!1,{geometryType:d=null}=t,g=!1;for(const o of s(e)){const{geometry:e,properties:t,id:s}=o;if(!e||(d||(d=i(e.type)),i(e.type)===d)){if(!a){a=l(c(e))}if(p||(p=null!=s,p&&(f=typeof s,y=Object.keys(t).filter((e=>t[e]===s)))),p&&null!=s&&(y.length>1?y=y.filter((e=>t[e]===s)):1===y.length&&(y=t[y[0]]===s?y:[])),!g&&t){let e=!0;for(const o in t){if(r.has(o))continue;const i=t[o];if(null==i){e=!1,u.add(o);continue}const s=k(i);"unknown"!==s?(u.delete(o),r.add(o),n.push({name:o,alias:o,type:s})):u.add(o)}g=e}}}const m=y&&1===y.length&&y[0]||null;if(m)for(const i of n)if(i.name===m&&o(i)){i.type="esriFieldTypeOID";break}return{fields:n,geometryType:d,hasZ:a,objectIdFieldName:m,objectIdFieldType:f,unknownFields:Array.from(u)}}function L(e,t){return Array.from(u(s(e),t))}export{L as createOptimizedFeatures,i as getGeometryType,T as inferLayerProperties,O as validateGeoJSON};
5
+ import e from"../../../../core/Error.js";import{OptimizedFeature as t}from"../../OptimizedFeature.js";import n from"../../OptimizedGeometry.js";import{normalizeFieldName as o,isNumericField as r}from"../../../support/fieldUtils.js";const i={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function s(e){return i[e]}function*c(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*u(e){if(!e)return null;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*l(e,o={}){const{geometryType:r,objectIdField:i}=o;for(const c of e){const{geometry:e,properties:u,id:l}=c;if(e&&s(e.type)!==r)continue;const f=u||{};let a=f[i]??null;i&&null!=l&&!f[i]&&(f[i]=a=l);const y=new t(e?g(new n,e,o):null,f,null,a);yield y}}function f(e){for(const t of e)if(t.length>2)return!0;return!1}function a(e){return!p(e)}function y(e){return p(e)}function p(e){let t=0;for(let n=0;n<e.length;n++){const o=e[n],r=e[(n+1)%e.length];t+=o[0]*r[1]-r[0]*o[1]}return t<=0}function d(e){const t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]||e.push(t),e}function g(e,t,n){switch(t.type){case"LineString":return m(e,t,n);case"MultiLineString":return h(e,t,n);case"MultiPoint":return w(e,t,n);case"MultiPolygon":return P(e,t,n);case"Point":return b(e,t,n);case"Polygon":return j(e,t,n)}}function m(e,t,n){return G(e,t.coordinates,n),e}function h(e,t,n){for(const o of t.coordinates)G(e,o,n);return e}function w(e,t,n){return G(e,t.coordinates,n),e}function P(e,t,n){for(const o of t.coordinates){S(e,o[0],n);for(let t=1;t<o.length;t++)F(e,o[t],n)}return e}function b(e,t,n){return k(e,t.coordinates,n),e}function j(e,t,n){const o=t.coordinates;S(e,o[0],n);for(let r=1;r<o.length;r++)F(e,o[r],n);return e}function S(e,t,n){const o=d(t);a(o)?M(e,o,n):G(e,o,n)}function F(e,t,n){const o=d(t);y(o)?M(e,o,n):G(e,o,n)}function G(e,t,n){for(const o of t)k(e,o,n);e.lengths.push(t.length)}function M(e,t,n){for(let o=t.length-1;o>=0;o--)k(e,t[o],n);e.lengths.push(t.length)}function k(e,t,n){const[o,r,i]=t;e.coords.push(o,r),n.hasZ&&e.coords.push(i||0)}function O(e){switch(typeof e){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function T(t){if(!t)throw new e("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==t.type&&"FeatureCollection"!==t.type)throw new e("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:n}=t;if(!n)return;const o="string"==typeof n?n:"name"===n.type?n.properties.name:"EPSG"===n.type?n.properties.code:null,r=new RegExp(".*(CRS84H?|4326)$","i");if(!o||!r.test(o))throw new e("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:n})}function L(e,t={}){const n=[],i=new Set,l=new Set;let a,y=!1,p=null,d=!1,{geometryType:g=null}=t,m=!1;for(const r of c(e)){const{geometry:e,properties:t,id:c}=r;if(!e||(g||(g=s(e.type)),s(e.type)===g)){if(!y){y=f(u(e))}if(d||(d=null!=c,d&&(a=typeof c,p=Object.keys(t).filter((e=>t[e]===c)))),d&&null!=c&&(p.length>1?p=p.filter((e=>t[e]===c)):1===p.length&&(p=t[p[0]]===c?p:[])),!m&&t){let e=!0;for(const r in t){if(i.has(r))continue;const s=t[r];if(null==s){e=!1,l.add(r);continue}const c=O(s);"unknown"!==c?(l.delete(r),i.add(r),n.push({name:o(r),alias:r,type:c})):l.add(r)}m=e}}}const h=o(1===p?.length&&p[0]||null);if(h)for(const o of n)if(o.name===h&&r(o)){o.type="esriFieldTypeOID";break}return{fields:n,geometryType:g,hasZ:y,objectIdFieldName:h,objectIdFieldType:a,unknownFields:Array.from(l)}}function I(e,t){return Array.from(l(c(e),t))}export{I as createOptimizedFeatures,s as getGeometryType,L as inferLayerProperties,T as validateGeoJSON};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../geometry.js";import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{isAbortError as n}from"../../../../core/promiseUtils.js";import{urlToObject as s,getFilename as o}from"../../../../core/urlUtils.js";import{projectMany as a}from"../../../../geometry/projection.js";import{jsonAdapter as l}from"../../../../geometry/geometryAdapters/json.js";import{equals as m,isWebMercator as c,WGS84 as u}from"../../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as d}from"../../../../geometry/support/webMercatorUtils.js";import{OptimizedFeature as f}from"../../OptimizedFeature.js";import p from"../../OptimizedGeometry.js";import y from"../../data/FeatureStore.js";import{checkProjectionSupport as h}from"../../data/projectionSupport.js";import{QueryEngine as g}from"../../data/QueryEngine.js";import{parseRows as _,isValidDate as I,parseNumber as F,readRows as w,inferDelimiterAndLocationInfo as E,splitSingleRow as T,inferFields as j}from"../csv/csv.js";import{createDefaultAttributesFunction as x,createDrawingInfo as S}from"./clientSideDefaults.js";import N from"../../../support/FieldsIndex.js";import{getFieldDefaultValue as q}from"../../../support/fieldUtils.js";import C from"../../../../geometry/SpatialReference.js";const b=S("esriGeometryPoint"),v=["csv"],D=[0,0];class O{constructor(e,t){this.x=e,this.y=t}}class k{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){this._loadOptions=e;const[i]=await Promise.all([this._fetch(t.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),r=P(i,e);this._locationInfo=r.locationInfo,this._delimiter=r.delimiter,this._queryEngine=this._createQueryEngine(r);const n=await this._createFeatures(i);if(this._queryEngine.featureStore.addMany(n),r.layerDefinition.extent=this._queryEngine.fullExtent,r.layerDefinition.timeInfo){const{start:e,end:t}=this._queryEngine.timeExtent;r.layerDefinition.timeInfo.timeExtent=[e,t]}return r}async applyEdits(){throw new i("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),e&&this._queryEngine.featureStore.addMany(e)}),(e=>{this._queryEngine.featureStore.clear(),n(e)||r.getLogger("esri.layers.CSVLayer").error(new i("csv-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete(),{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:r,customParameters:n}=this._loadOptions;if(!r)throw new i("csv-layer:invalid-source","url not defined");const o=s(r);return(await e(o.path,{query:{...o.query,...n},responseType:"text",signal:t})).data}_createQueryEngine(e){const{objectIdField:t,fields:i,extent:r,timeInfo:n}=e.layerDefinition,s=new y({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new g({fields:i,geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:n,objectIdField:t,spatialReference:r.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:s})}async _createFeatures(e){const{latitudeFieldName:t,longitudeFieldName:i}=this._locationInfo,{objectIdField:r,fieldsIndex:n,spatialReference:s}=this._queryEngine;let o=[];const u=[],y=n.fields.filter((e=>e.name!==r)).map((e=>e.name));let h=0;const g={};for(const a of n.fields)if("esriFieldTypeOID"!==a.type&&"esriFieldTypeGlobalID"!==a.type){const e=q(a);void 0!==e&&(g[a.name]=e)}const w=_(e,y,this._delimiter,x(g,r));for(const a of w){const e=this._parseCoordinateValue(a[t]),s=this._parseCoordinateValue(a[i]);if(null!=s&&null!=e&&!isNaN(e)&&!isNaN(s)){a[t]=e,a[i]=s;for(const e in a)if(e!==t&&e!==i)if(n.isDateField(e)){const t=new Date(a[e]);a[e]=I(t,a[e])?t.getTime():null}else if(n.isNumericField(e)){const t=F(a[e]);isNaN(t)?a[e]=null:a[e]=t}a[r]=h,h++,o.push(new O(s,e)),u.push(a)}}if(!m({wkid:4326},s))if(c(s))for(const a of o)[a.x,a.y]=d(a.x,a.y,D);else o=a(l,o,C.WGS84,s,null,null);const E=[];for(let a=0;a<o.length;a++){const{x:e,y:t}=o[a],i=u[a];i[r]=a+1,E.push(new f(new p([],[e,t]),i,null,i[r]))}return E}_parseCoordinateValue(e){if(null==e||""===e)return null;let t=F(e);return(isNaN(t)||Math.abs(t)>181)&&(t=parseFloat(e)),t}async _checkProjection(e){try{await h(u,e)}catch{throw new i("csv-layer:projection-not-supported","Projection not supported")}}}function P(e,t){const r=t.parsingOptions||{},n={delimiter:r.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:r.latitudeField,longitudeFieldName:r.longitudeField}},s=n.layerDefinition={name:o(t.url,v)||"csv",drawingInfo:b,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:r.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:r.spatialReference||{wkid:102100}}},a=w(e),l=a.next().value?.trim(),m=a.next().value?.trim();if(!l)throw new i("csv-layer:empty-csv","CSV is empty",{csv:e});const{delimiter:c,locationInfo:u}=E(l,m,r);if(!c)throw new i("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV");if(!u)throw new i("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file");n.locationInfo=u,n.delimiter=c;const d=T(l,c).filter(Boolean),f=j(e,n.delimiter,d,n.locationInfo);if(r.fields&&r.fields.length){const e=new Map;for(const t of r.fields)e.set(t.name.toLowerCase(),t);for(const t of f){const i=e.get(t.name.toLowerCase());if(i){const e=t.name;Object.assign(t,i),t.name=e}}}s.fields=f;if(!s.fields.some((e=>"esriFieldTypeOID"===e.type&&(s.objectIdField=e.name,!0)))){const e={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};s.objectIdField=e.name,s.fields.unshift(e)}if(s.timeInfo){const e=new N(s.fields),t=s.timeInfo;if(t.startTimeField){const i=e.get(t.startTimeField);i?(t.startTimeField=i.name,i.type="esriFieldTypeDate"):t.startTimeField=null}if(t.endTimeField){const i=e.get(t.endTimeField);i?(t.endTimeField=i.name,i.type="esriFieldTypeDate"):t.endTimeField=null}if(t.trackIdField){const i=e.get(t.trackIdField);t.trackIdField=i?i.name:null}t.startTimeField||t.endTimeField||(s.timeInfo=null)}return n}export{k as default};
5
+ import"../../../../geometry.js";import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{isAbortError as n}from"../../../../core/promiseUtils.js";import{urlToObject as s,getFilename as o}from"../../../../core/urlUtils.js";import{projectMany as a}from"../../../../geometry/projection.js";import{jsonAdapter as l}from"../../../../geometry/geometryAdapters/json.js";import{equals as m,isWebMercator as c,WGS84 as u}from"../../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as d}from"../../../../geometry/support/webMercatorUtils.js";import{OptimizedFeature as p}from"../../OptimizedFeature.js";import f from"../../OptimizedGeometry.js";import y from"../../data/FeatureStore.js";import{checkProjectionSupport as h}from"../../data/projectionSupport.js";import{QueryEngine as g}from"../../data/QueryEngine.js";import{parseRows as _,isValidDate as I,parseNumber as F,readRows as w,inferDelimiterAndLocationInfo as E,extractFieldNamesAndAliasesFromRow as T,inferFields as j}from"../csv/csv.js";import{createDefaultAttributesFunction as x,createDrawingInfo as S}from"./clientSideDefaults.js";import N from"../../../support/FieldsIndex.js";import{getFieldDefaultValue as q}from"../../../support/fieldUtils.js";import b from"../../../../geometry/SpatialReference.js";const C=S("esriGeometryPoint"),v=["csv"],D=[0,0];class O{constructor(e,t){this.x=e,this.y=t}}class k{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){this._loadOptions=e;const[i]=await Promise.all([this._fetch(t.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),r=P(i,e);this._locationInfo=r.locationInfo,this._delimiter=r.delimiter,this._queryEngine=this._createQueryEngine(r);const n=await this._createFeatures(i);if(this._queryEngine.featureStore.addMany(n),r.layerDefinition.extent=this._queryEngine.fullExtent,r.layerDefinition.timeInfo){const{start:e,end:t}=this._queryEngine.timeExtent;r.layerDefinition.timeInfo.timeExtent=[e,t]}return r}async applyEdits(){throw new i("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),e&&this._queryEngine.featureStore.addMany(e)}),(e=>{this._queryEngine.featureStore.clear(),n(e)||r.getLogger("esri.layers.CSVLayer").error(new i("csv-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete(),{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:r,customParameters:n}=this._loadOptions;if(!r)throw new i("csv-layer:invalid-source","url not defined");const o=s(r);return(await e(o.path,{query:{...o.query,...n},responseType:"text",signal:t})).data}_createQueryEngine(e){const{objectIdField:t,fields:i,extent:r,timeInfo:n}=e.layerDefinition,s=new y({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new g({fields:i,geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:n,objectIdField:t,spatialReference:r.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:s})}async _createFeatures(e){const{latitudeFieldName:t,longitudeFieldName:i}=this._locationInfo,{objectIdField:r,fieldsIndex:n,spatialReference:s}=this._queryEngine;let o=[];const u=[],y=n.fields.filter((e=>e.name!==r)).map((e=>e.name));let h=0;const g={};for(const a of n.fields)if("esriFieldTypeOID"!==a.type&&"esriFieldTypeGlobalID"!==a.type){const e=q(a);void 0!==e&&(g[a.name]=e)}const w=_(e,y,this._delimiter,x(g,r));for(const a of w){const e=this._parseCoordinateValue(a[t]),s=this._parseCoordinateValue(a[i]);if(null!=s&&null!=e&&!isNaN(e)&&!isNaN(s)){a[t]=e,a[i]=s;for(const e in a)if(e!==t&&e!==i)if(n.isDateField(e)){const t=new Date(a[e]);a[e]=I(t,a[e])?t.getTime():null}else if(n.isNumericField(e)){const t=F(a[e]);isNaN(t)?a[e]=null:a[e]=t}a[r]=h,h++,o.push(new O(s,e)),u.push(a)}}if(!m({wkid:4326},s))if(c(s))for(const a of o)[a.x,a.y]=d(a.x,a.y,D);else o=a(l,o,b.WGS84,s,null,null);const E=[];for(let a=0;a<o.length;a++){const{x:e,y:t}=o[a],i=u[a];i[r]=a+1,E.push(new p(new f([],[e,t]),i,null,i[r]))}return E}_parseCoordinateValue(e){if(null==e||""===e)return null;let t=F(e);return(isNaN(t)||Math.abs(t)>181)&&(t=parseFloat(e)),t}async _checkProjection(e){try{await h(u,e)}catch{throw new i("csv-layer:projection-not-supported","Projection not supported")}}}function P(e,t){const r=t.parsingOptions||{},n={delimiter:r.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:r.latitudeField,longitudeFieldName:r.longitudeField}},s=n.layerDefinition={name:o(t.url,v)||"csv",drawingInfo:C,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:r.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:r.spatialReference||{wkid:102100}}},a=w(e),l=a.next().value?.trim(),m=a.next().value?.trim();if(!l)throw new i("csv-layer:empty-csv","CSV is empty",{csv:e});const{delimiter:c,locationInfo:u}=E(l,m,r);if(!c)throw new i("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV");if(!u)throw new i("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file");n.locationInfo=u,n.delimiter=c;const{names:d,aliases:p}=T(l,c),f=j(e,n.delimiter,d,p,n.locationInfo);if(r.fields?.length){const e=new N(r.fields);for(const t of f){const i=e.get(t.name);i&&Object.assign(t,i)}}s.fields=f;if(!s.fields.some((e=>"esriFieldTypeOID"===e.type&&(s.objectIdField=e.name,!0)))){const e={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};s.objectIdField=e.name,s.fields.unshift(e)}if(s.timeInfo){const e=new N(s.fields),t=s.timeInfo;if(t.startTimeField){const i=e.get(t.startTimeField);i?(t.startTimeField=i.name,i.type="esriFieldTypeDate"):t.startTimeField=null}if(t.endTimeField){const i=e.get(t.endTimeField);i?(t.endTimeField=i.name,i.type="esriFieldTypeDate"):t.endTimeField=null}if(t.trackIdField){const i=e.get(t.trackIdField);t.trackIdField=i?i.name:null}t.startTimeField||t.endTimeField||(s.timeInfo=null)}return n}export{k as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as e}from"../../../../core/maybe.js";import{isValid as t}from"../../../../geometry/support/spatialReferenceUtils.js";import{validateFieldValue as n,validationErrorToString as i,isNumericField as r,isStringField as s,sanitizeNullFieldValue as o}from"../../../support/fieldUtils.js";class l{constructor(){this.code=null,this.description=null}}class u{constructor(e){this.error=new l,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}}function a(e){return new u(e)}class c{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function f(e){return new c(e)}const d=new Set;function m(e,t,r,s=!1,o){d.clear();for(const l in r){const u=e?.get(l);if(!u)continue;const c=r[l],f=p(u,c);if(f!==c&&o&&o.push({name:"invalid-value-type",message:"attribute value was converted to match the field type",details:{field:u,originalValue:c,sanitizedValue:f}}),d.add(u.name),u&&(s||u.editable)){const e=n(u,f);if(e)return a(i(e,u,f));t[u.name]=f}}for(const n of e?.requiredFields??[])if(!d.has(n.name))return a(`missing required field "${n.name}"`);return null}function p(e,t){let n=t;return"string"==typeof t&&r(e)?n=parseFloat(t):null!=t&&s(e)&&"string"!=typeof t&&(n=String(t)),o(n)}let h;function g(n,i){if(!n||!t(i))return n;if("rings"in n||"paths"in n){if(e(h))throw new TypeError("geometry engine not loaded");return h.simplify(i,n)}return n}async function y(){return e(h)&&(h=await import("../../../../geometry/geometryEngineJSON.js")),h}async function w(e,n){!t(e)||"esriGeometryPolygon"!==n&&"esriGeometryPolyline"!==n||await y()}export{a as createFeatureEditErrorResult,f as createFeatureEditSuccessResult,w as loadGeometryEngineForSimplify,m as mixAttributes,g as simplify};
5
+ import{isNone as e}from"../../../../core/maybe.js";import{isValid as t}from"../../../../geometry/support/spatialReferenceUtils.js";import{validateFieldValue as n,validationErrorToString as i,isNumericField as r,isStringField as s,sanitizeNullFieldValue as o}from"../../../support/fieldUtils.js";class l{constructor(){this.code=null,this.description=null}}class u{constructor(e){this.error=new l,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}}function a(e){return new u(e)}class c{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function f(e){return new c(e)}const d=new Set;function m(e,t,r,s=!1,o){d.clear();for(const l in r){const u=e.get(l);if(!u)continue;const c=r[l],f=p(u,c);if(f!==c&&o&&o.push({name:"invalid-value-type",message:"attribute value was converted to match the field type",details:{field:u,originalValue:c,sanitizedValue:f}}),d.add(u.name),u&&(s||u.editable)){const e=n(u,f);if(e)return a(i(e,u,f));t[u.name]=f}}for(const n of e?.requiredFields??[])if(!d.has(n.name))return a(`missing required field "${n.name}"`);return null}function p(e,t){let n=t;return"string"==typeof t&&r(e)?n=parseFloat(t):null!=t&&s(e)&&"string"!=typeof t&&(n=String(t)),o(n)}let h;function g(n,i){if(!n||!t(i))return n;if("rings"in n||"paths"in n){if(e(h))throw new TypeError("geometry engine not loaded");return h.simplify(i,n)}return n}async function y(){return e(h)&&(h=await import("../../../../geometry/geometryEngineJSON.js")),h}async function w(e,n){!t(e)||"esriGeometryPolygon"!==n&&"esriGeometryPolyline"!==n||await y()}export{a as createFeatureEditErrorResult,f as createFeatureEditSuccessResult,w as loadGeometryEngineForSimplify,m as mixAttributes,g as simplify};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{clone as s}from"../../core/lang.js";import"../../core/Logger.js";import"../../core/accessorSupport/ensureType.js";import"../../core/Error.js";import"../../core/has.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";const d=new t.EventEmitter,i="esri.layers.mixins.EditBusLayer",l=Symbol(i);function o(e){return null!=e&&"object"==typeof e&&l in e}const a=t=>{var o;let a=class extends t{constructor(...e){super(...e),this[o]=!0,this.when().then((()=>{this.own([d.on("edits",(e=>{const t="layer"in e?e.layer:null,r="layer"in e?e.layer?.url:e.serviceUrl,d="layer"in e?e.layer?.layerId:e.layerId,i=e.event;if(t===this||r!==this.url)return;if(null!=d&&null!=this.layerId&&d===this.layerId)return void this.emit("edits",s(i));const l=i.editedFeatures?.find((({layerId:e})=>e===this.layerId));if(l){const{adds:e,updates:t,deletes:r}=l.editedFeatures,d={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:e.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))),deletedFeatures:r.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))),updatedFeatures:t.map((({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))),editedFeatures:s(i.editedFeatures)};this.emit("edits",d)}}))])}),(()=>{}))}};return o=l,a=e([r(i)],a),a};export{a as EditBusLayer,d as editEventBus,o as isEditBusLayer};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{clone as s}from"../../core/lang.js";import"../../core/Logger.js";import"../../core/accessorSupport/ensureType.js";import"../../core/Error.js";import"../../core/has.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";const d=new t.EventEmitter,i="esri.layers.mixins.EditBusLayer",l=Symbol(i);function o(e){return null!=e&&"object"==typeof e&&l in e}const a=t=>{var o;let a=class extends t{constructor(...e){super(...e),this[o]=!0,this.when().then((()=>{this.own([d.on("edits",(e=>{const t="layer"in e?e.layer:null,r="layer"in e?e.layer?.url:e.serviceUrl,d="layer"in e?e.layer?.layerId:e.layerId,i=e.event;if(t===this||r!==this.url)return;if(null!=d&&null!=this.layerId&&d===this.layerId)return void this.emit("edits",s(i));const l=i.editedFeatures?.find((({layerId:e})=>e===this.layerId));if(l){const{adds:e,updates:t,deletes:r}=l.editedFeatures,d={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:e?e.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],deletedFeatures:r?r.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],updatedFeatures:t?t.map((({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],editedFeatures:s(i.editedFeatures)};this.emit("edits",d)}}))])}),(()=>{}))}};return o=l,a=e([r(i)],a),a};export{a as EditBusLayer,d as editEventBus,o as isEditBusLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isNumericField as e,getFieldDefaultValue as i}from"./fieldUtils.js";function t(e){return"date"===e.type||"esriFieldTypeDate"===e.type}function s(e){return"oid"===e.type||"esriFieldTypeOID"===e.type}function l(e){return"global-id"===e.type||"esriFieldTypeGlobalID"===e.type}class d{constructor(i=[]){if(this.fields=[],this._fieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!i)return;this.fields=i;const d=[];for(const n of i){const i=n&&n.name;if(i){const u=r(i);this._fieldsMap.set(i,n),this._fieldsMap.set(u,n),d.push(u),t(n)?(this.dateFields.push(n),this._dateFieldsSet.add(n)):e(n)&&(this._numericFieldsSet.add(n),this.numericFields.push(n)),s(n)||l(n)||(n.editable=null==n.editable||!!n.editable,n.nullable=null==n.nullable||!!n.nullable)}}d.sort(),this.uid=d.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)s(e)||l(e)||e.nullable||void 0!==i(e)||this._requiredFields.push(e)}return this._requiredFields}has(e){return null!=this.get(e)}get(e){return null!=e?this._fieldsMap.get(e)||this._fieldsMap.get(r(e)):void 0}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){const i=this.get(e);if(i)return i.name??void 0}}function r(e){return e.toLowerCase().trim()}export{d as default};
5
+ import{isNumericField as e,getFieldDefaultValue as i,normalizeFieldName as t}from"./fieldUtils.js";function s(e){return"date"===e.type||"esriFieldTypeDate"===e.type}function l(e){return"oid"===e.type||"esriFieldTypeOID"===e.type}function d(e){return"global-id"===e.type||"esriFieldTypeGlobalID"===e.type}class r{constructor(i=[]){if(this.fields=[],this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!i)return;this.fields=i;const t=[];for(const r of i){const i=r&&r.name;if(i){const u=n(i),h=a(i);this._fieldsMap.set(i,r),this._fieldsMap.set(u,r),this._normalizedFieldsMap.set(h,r),t.push(u),s(r)?(this.dateFields.push(r),this._dateFieldsSet.add(r)):e(r)&&(this._numericFieldsSet.add(r),this.numericFields.push(r)),l(r)||d(r)||(r.editable=null==r.editable||!!r.editable,r.nullable=null==r.nullable||!!r.nullable)}}t.sort(),this.uid=t.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)l(e)||d(e)||e.nullable||void 0!==i(e)||this._requiredFields.push(e)}return this._requiredFields}has(e){return null!=this.get(e)}get(e){if(!e)return;let i=this._fieldsMap.get(e);return i||(i=this._fieldsMap.get(n(e))??this._normalizedFieldsMap.get(a(e)),i&&this._fieldsMap.set(e,i),i)}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){const i=this.get(e);if(i)return i.name??void 0}}function n(e){return e.trim().toLowerCase()}function a(e){return t(e).toLowerCase()}export{r as default};