@arcgis/core 4.34.0-next.76 → 4.34.0-next.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Basemap.js +1 -1
- package/Ground.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/025f1d78dfa5ec93178b.js +1 -0
- package/assets/esri/core/workers/chunks/050429f516149ce3b517.js +1 -0
- package/assets/esri/core/workers/chunks/0652d7e525d99e39c957.js +1 -0
- package/assets/esri/core/workers/chunks/0668eee42b3169e1bf66.js +1 -0
- package/assets/esri/core/workers/chunks/07a355a9c95154971aab.js +1 -0
- package/assets/esri/core/workers/chunks/0dd6b8b3e634bb5f0ca7.js +1 -0
- package/assets/esri/core/workers/chunks/124f8757ea18bfd158ec.js +1 -0
- package/assets/esri/core/workers/chunks/1990162dcf73601d54f7.js +1 -0
- package/assets/esri/core/workers/chunks/20850b0fdb55fb17bc90.js +1 -0
- package/assets/esri/core/workers/chunks/{6a1b652ccbf58ac44658.js → 23e17b745adf71a5efc7.js} +1 -1
- package/assets/esri/core/workers/chunks/2605062e44f2d4e73f14.js +1 -0
- package/assets/esri/core/workers/chunks/29a86d51407310bb7745.js +1 -0
- package/assets/esri/core/workers/chunks/2a2a925c45d5fd58628b.js +1 -0
- package/assets/esri/core/workers/chunks/2fe96bf7dedef11a3b63.js +1 -0
- package/assets/esri/core/workers/chunks/3452ba299f6ce0582f09.js +1 -0
- package/assets/esri/core/workers/chunks/36a006c55766f9540bfc.js +1 -0
- package/assets/esri/core/workers/chunks/{18641332bee3e9b9c44a.js → 388482cea4b9fdeaf06e.js} +1 -1
- package/assets/esri/core/workers/chunks/3b23c37e5bc552dc81d4.js +1 -0
- package/assets/esri/core/workers/chunks/{9325000c87295c473291.js → 3b2ef975831eb75b40fb.js} +1 -1
- package/assets/esri/core/workers/chunks/3ff3e1507220d3869c76.js +1 -0
- package/assets/esri/core/workers/chunks/43818bf53dd5445a7bdb.js +1 -0
- package/assets/esri/core/workers/chunks/4823e4522bd7379d858e.js +1 -0
- package/assets/esri/core/workers/chunks/49e6202da7a20f06c661.js +353 -0
- package/assets/esri/core/workers/chunks/{b818b5e392d5eb7c7e70.js → 4e6e8dda6c12f6fbed8e.js} +1 -1
- package/assets/esri/core/workers/chunks/5019f1b8186a65a0313b.js +1 -0
- package/assets/esri/core/workers/chunks/512dcd6e34e217029391.js +1 -0
- package/assets/esri/core/workers/chunks/5248581d23ada240c78d.js +1 -0
- package/assets/esri/core/workers/chunks/614a00a3179f8fe23f45.js +1 -0
- package/assets/esri/core/workers/chunks/{5477ff0ce432c9e5b3ab.js → 6201356f7f91e5c06425.js} +1 -1
- package/assets/esri/core/workers/chunks/6271a706ac3fcba91432.js +1 -0
- package/assets/esri/core/workers/chunks/6593b419339e7598b760.js +1 -0
- package/assets/esri/core/workers/chunks/{51ddda291bbbf5db9905.js → 65e279516170ddbd4a65.js} +1 -1
- package/assets/esri/core/workers/chunks/67fdc8074cdcf374af9a.js +1 -0
- package/assets/esri/core/workers/chunks/6dafb2b95bae552c1cc2.js +1 -0
- package/assets/esri/core/workers/chunks/7680d4d739f7aa3f7ae1.js +1 -0
- package/assets/esri/core/workers/chunks/7889a909394c61a9d3e0.js +1 -0
- package/assets/esri/core/workers/chunks/79e965e8f7cf822b4f45.js +1 -0
- package/assets/esri/core/workers/chunks/804e3b3df375177e6c86.js +1 -0
- package/assets/esri/core/workers/chunks/81a8addcb858086ff9ee.js +1 -0
- package/assets/esri/core/workers/chunks/83065bef261314f9b2c5.js +1 -0
- package/assets/esri/core/workers/chunks/8a5e40f48a8265fd1b42.js +1 -0
- package/assets/esri/core/workers/chunks/8bd6c27a93a697a7fa3d.js +1 -0
- package/assets/esri/core/workers/chunks/8c94448a44fb27054a22.js +1 -0
- package/assets/esri/core/workers/chunks/92d0e0155563c6355079.js +1 -0
- package/assets/esri/core/workers/chunks/{c86f5bb199cf046b8952.js → 930322c9790572bd0c49.js} +1 -1
- package/assets/esri/core/workers/chunks/96a14689815bec741308.js +1 -0
- package/assets/esri/core/workers/chunks/97d71459ad72b4b780a3.js +1 -0
- package/assets/esri/core/workers/chunks/9835c579edfc08125d31.js +1 -0
- package/assets/esri/core/workers/chunks/9971de3f38a55735cec9.js +1 -0
- package/assets/esri/core/workers/chunks/99ac292a858bbedc6a89.js +1 -0
- package/assets/esri/core/workers/chunks/9ce599dc1d385e6893c1.js +1 -0
- package/assets/esri/core/workers/chunks/{fec572f03f9514244972.js → a05a7df07b74e1957538.js} +1 -1
- package/assets/esri/core/workers/chunks/a7e649b3b02e664ada80.js +1 -0
- package/assets/esri/core/workers/chunks/a8a79a5c804ef715aa94.js +1 -0
- package/assets/esri/core/workers/chunks/acb49f3d2b783e81a215.js +1 -0
- package/assets/esri/core/workers/chunks/adc61d88c3c6936ad75a.js +1 -0
- package/assets/esri/core/workers/chunks/afa3ca2bd2648774f133.js +1 -0
- package/assets/esri/core/workers/chunks/afb76f9d6abedef771df.js +1 -0
- package/assets/esri/core/workers/chunks/b168b6ffc16cd509d316.js +1 -0
- package/assets/esri/core/workers/chunks/b19d723d09f5bea9ca27.js +1 -0
- package/assets/esri/core/workers/chunks/b246ed6d86c2c8df56fb.js +1 -0
- package/assets/esri/core/workers/chunks/b4a053063e6022080d31.js +1 -0
- package/assets/esri/core/workers/chunks/b4ba7f8ea81522ad1e2e.js +1 -0
- package/assets/esri/core/workers/chunks/b97f224972f1b1abaee8.js +1 -0
- package/assets/esri/core/workers/chunks/b9e725d2b5a7d0132663.js +1 -0
- package/assets/esri/core/workers/chunks/bbb3b32affde9ea78534.js +1 -0
- package/assets/esri/core/workers/chunks/bbb585f0b484ab5eabb3.js +1 -0
- package/assets/esri/core/workers/chunks/bc83bcfe123525d21884.js +1 -0
- package/assets/esri/core/workers/chunks/c799f1c03cb22ef52f5f.js +1 -0
- package/assets/esri/core/workers/chunks/cac5732f9dfece4bf2c5.js +1 -0
- package/assets/esri/core/workers/chunks/cafc19bf2caaf7a8c2e8.js +1 -0
- package/assets/esri/core/workers/chunks/cc7423413747566f56e2.js +1 -0
- package/assets/esri/core/workers/chunks/ccd157ede169b93eea65.js +1 -0
- package/assets/esri/core/workers/chunks/ce0bf0d0cd9e9a90093b.js +1 -0
- package/assets/esri/core/workers/chunks/ce49ff6bf20cff349726.js +1 -0
- package/assets/esri/core/workers/chunks/d1657a29321adb259166.js +1 -0
- package/assets/esri/core/workers/chunks/d2b69f91eb85b561fe01.js +1 -0
- package/assets/esri/core/workers/chunks/d51e8eeb1e1eb0605cc9.js +1 -0
- package/assets/esri/core/workers/chunks/d69bd6b5d781a6c527d1.js +1 -0
- package/assets/esri/core/workers/chunks/d7fc8ea2ff527a09f4b9.js +1 -0
- package/assets/esri/core/workers/chunks/d8494617cebc68e50d35.js +1 -0
- package/assets/esri/core/workers/chunks/d89832617bac4890893e.js +1 -0
- package/assets/esri/core/workers/chunks/{d55c55d39a253630d228.js → db2396bf062468ee8b60.js} +1 -1
- package/assets/esri/core/workers/chunks/e4833b718a813a8d125b.js +1 -0
- package/assets/esri/core/workers/chunks/{d1f181f91b36351f1d3b.js → e7af5caab9aa9b6a12e3.js} +1 -1
- package/assets/esri/core/workers/chunks/e81386199a6db9a50fd3.js +1 -0
- package/assets/esri/core/workers/chunks/f45c343527709f6f91c2.js +1 -0
- package/assets/esri/core/workers/chunks/f5710ced8d38f9a90fc5.js +1 -0
- package/assets/esri/core/workers/chunks/f592c4e5e1746d4619db.js +1 -0
- package/assets/esri/core/workers/chunks/f8d2c52cc51d5f1bbce2.js +1 -0
- package/assets/esri/core/workers/chunks/feed74ed275f21a68a1b.js +1 -0
- package/assets/esri/core/workers/chunks/ffee8cc83d703c1dc0c0.js +1 -0
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/catalog/catalogUtils.js +1 -1
- package/layers/mixins/ScaleRangeLayer.js +1 -1
- package/package.json +1 -1
- package/support/LayersMixin.js +1 -1
- package/support/TablesMixin.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/assets/esri/core/workers/chunks/03fac1122eb73bb14d2d.js +0 -1
- package/assets/esri/core/workers/chunks/0434a490326c0de47c22.js +0 -1
- package/assets/esri/core/workers/chunks/0618ea8bf9da93d713b1.js +0 -1
- package/assets/esri/core/workers/chunks/06b65105b15abf4d0fbf.js +0 -1
- package/assets/esri/core/workers/chunks/0b71100fa1e7ca706dbb.js +0 -1
- package/assets/esri/core/workers/chunks/13de06e614adf92239fe.js +0 -1
- package/assets/esri/core/workers/chunks/14a22d1a0eefa970efa1.js +0 -1
- package/assets/esri/core/workers/chunks/181b3564a0e3939020bc.js +0 -1
- package/assets/esri/core/workers/chunks/199a17b0a0f75cbaed16.js +0 -1
- package/assets/esri/core/workers/chunks/19c1f1431c0b2f4525a2.js +0 -1
- package/assets/esri/core/workers/chunks/21bfad7283620766d9cd.js +0 -1
- package/assets/esri/core/workers/chunks/28a2f74d4a449386d082.js +0 -1
- package/assets/esri/core/workers/chunks/2afafaf40293d5ab1d8e.js +0 -1
- package/assets/esri/core/workers/chunks/2c399991e8627baa51b3.js +0 -1
- package/assets/esri/core/workers/chunks/2f44848916051f5501eb.js +0 -1
- package/assets/esri/core/workers/chunks/3064320d54a9b48bd697.js +0 -1
- package/assets/esri/core/workers/chunks/38e7d1c6987aaa9b520b.js +0 -1
- package/assets/esri/core/workers/chunks/3a5f0c759dd2f4638343.js +0 -1
- package/assets/esri/core/workers/chunks/3bf99037befdedd75cb4.js +0 -1
- package/assets/esri/core/workers/chunks/3e9c3e7c5cf7c0afbc80.js +0 -1
- package/assets/esri/core/workers/chunks/3fecfe4f8ca2a5fd7360.js +0 -1
- package/assets/esri/core/workers/chunks/43095bed5456251940b9.js +0 -1
- package/assets/esri/core/workers/chunks/433c4dc666a6b2c99063.js +0 -353
- package/assets/esri/core/workers/chunks/451761c7bd2da530e1d0.js +0 -1
- package/assets/esri/core/workers/chunks/4832faefd3b7edc17c84.js +0 -1
- package/assets/esri/core/workers/chunks/48449abe795cb7a831eb.js +0 -1
- package/assets/esri/core/workers/chunks/4bc091770bab38874848.js +0 -1
- package/assets/esri/core/workers/chunks/52286d4135b8395a3400.js +0 -1
- package/assets/esri/core/workers/chunks/540506802776f77e47f3.js +0 -1
- package/assets/esri/core/workers/chunks/56f54d007b0da0d908aa.js +0 -1
- package/assets/esri/core/workers/chunks/5879cebb22157b0b4998.js +0 -1
- package/assets/esri/core/workers/chunks/58cc06ed86301f4cee75.js +0 -1
- package/assets/esri/core/workers/chunks/61896e64e9ef49b4bb1b.js +0 -1
- package/assets/esri/core/workers/chunks/6531f33d6710960079e9.js +0 -1
- package/assets/esri/core/workers/chunks/6e59ba2afd444eb4be18.js +0 -1
- package/assets/esri/core/workers/chunks/70367da4ba916376f40c.js +0 -1
- package/assets/esri/core/workers/chunks/7430c462c350fdd26349.js +0 -1
- package/assets/esri/core/workers/chunks/7aaa6b318195d7342e6c.js +0 -1
- package/assets/esri/core/workers/chunks/7b73a808922b52755abd.js +0 -1
- package/assets/esri/core/workers/chunks/7e746427375e83fc4351.js +0 -1
- package/assets/esri/core/workers/chunks/810e4c16c6eae420508b.js +0 -1
- package/assets/esri/core/workers/chunks/8b587affaaa0b1e4368c.js +0 -1
- package/assets/esri/core/workers/chunks/8bc8caa384b24af12411.js +0 -1
- package/assets/esri/core/workers/chunks/8fc13e0e1a5a8f3e4798.js +0 -1
- package/assets/esri/core/workers/chunks/90540fdfb0c5f68aa959.js +0 -1
- package/assets/esri/core/workers/chunks/92d5b0559e128d62fbda.js +0 -1
- package/assets/esri/core/workers/chunks/9304c3cdf732745577fd.js +0 -1
- package/assets/esri/core/workers/chunks/9421389888d4d9e4e809.js +0 -1
- package/assets/esri/core/workers/chunks/98c94a99e2e04d5ae65f.js +0 -1
- package/assets/esri/core/workers/chunks/9c35860439948638cb8f.js +0 -1
- package/assets/esri/core/workers/chunks/a0a519f498e9ea7623ff.js +0 -1
- package/assets/esri/core/workers/chunks/a2baeb9fa805c3537049.js +0 -1
- package/assets/esri/core/workers/chunks/a33e1a031ba9f028023d.js +0 -1
- package/assets/esri/core/workers/chunks/a9f6054d86982b9e5a7c.js +0 -1
- package/assets/esri/core/workers/chunks/ad3ebd4f05cc673140f3.js +0 -1
- package/assets/esri/core/workers/chunks/b6c6f82df3b60c2f831f.js +0 -1
- package/assets/esri/core/workers/chunks/b70d71144a060f7eeeeb.js +0 -1
- package/assets/esri/core/workers/chunks/b7f5a26ff3a73c64552d.js +0 -1
- package/assets/esri/core/workers/chunks/bd2dc1282c49125ede89.js +0 -1
- package/assets/esri/core/workers/chunks/bd4e64d6e73cd4db9695.js +0 -1
- package/assets/esri/core/workers/chunks/bfbbf180c2c8fdbb6731.js +0 -1
- package/assets/esri/core/workers/chunks/c07507a42def2bd2a222.js +0 -1
- package/assets/esri/core/workers/chunks/c34a164a8ece4cb33e81.js +0 -1
- package/assets/esri/core/workers/chunks/c6fecf2bbd2a711f15d3.js +0 -1
- package/assets/esri/core/workers/chunks/d95554f43694b4769675.js +0 -1
- package/assets/esri/core/workers/chunks/dd587d51dad2d82708d1.js +0 -1
- package/assets/esri/core/workers/chunks/e086b835a98b71a46825.js +0 -1
- package/assets/esri/core/workers/chunks/e3f2cdf5d71a7040894b.js +0 -1
- package/assets/esri/core/workers/chunks/e54df2128039425a9090.js +0 -1
- package/assets/esri/core/workers/chunks/e58c5c8639aa837c84d1.js +0 -1
- package/assets/esri/core/workers/chunks/e92d9e0ac789bcf1cdf4.js +0 -1
- package/assets/esri/core/workers/chunks/eb0a5d592f5805836203.js +0 -1
- package/assets/esri/core/workers/chunks/eccb4550edc4752cf41a.js +0 -1
- package/assets/esri/core/workers/chunks/f3ef59991c577ff5e825.js +0 -1
- package/assets/esri/core/workers/chunks/f749e2a89a14ab89ae59.js +0 -1
- package/assets/esri/core/workers/chunks/f7f5c4f30e5a0ddbf9a4.js +0 -1
- package/assets/esri/core/workers/chunks/fb0f729eff2f2911d6c3.js +0 -1
- package/assets/esri/core/workers/chunks/fdf2b980e8a8aa47ce91.js +0 -1
- package/assets/esri/core/workers/chunks/fe24c6d61a50898549a5.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8692],{8303:(e,t,i)=>{i.d(t,{A:()=>v});var a=i(31635),s=i(92602),r=i(70333),n=i(78888),o=i(60999),l=i(49186),d=i(53966),h=i(97768),p=i(74887),u=i(84952),y=i(10107),c=(i(44208),i(87811),i(36005)),g=i(40608),f=i(43937),m=i(77548),w=i(20655),M=i(80812),b=i(41318),T=i(10407);const v=e=>{const t=e;let v=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,h.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new M.default({id:t.itemId,portal:i?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:a}=await i.e(1204).then(i.bind(i,41204));return(0,p.Te)(t),await a({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||d.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:i,fullEdit:a},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let i=this.portalItem;if(!e||!i||!i.loaded||i.sourceUrl)return this._fetchFallbackUserPrivileges(t);const a=!r.id?.findCredential(this.url),s=e===i.id;if(s&&i.portal.user)return this._getUserPrivileges(i,a);let n,o;if(s)n=i.portal.url;else try{n=await(0,m.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!n||!(0,u.b8)(n,i.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(r.id?.getCredential(`${n}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const l=!0,d=!1,h=!1;if(!o)return{features:{edit:l,fullEdit:d},content:{updateItem:h}};try{if(s?await i.reload():(i=new M.default({id:e,portal:{url:n}}),await i.load(t)),i.portal.user)return this._getUserPrivileges(i,a)}catch(e){(0,p.QP)(e)}return{features:{edit:l,fullEdit:d},content:{updateItem:h}}}_getUserPrivileges(e,t){const i=(0,T.It)(e);return t&&(i.features.edit=!0),i}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?r.id?.findCredential(this.url):null;if(!t)return!0;const i=_.credential===t?_.user:await this._fetchEditingUser(e);return _.credential=t,_.user=i,null==i?.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=r.id?.findServerInfo(this.url??"");if(!i?.owningSystemUrl)return null;const a=`${i.owningSystemUrl}/sharing/rest`,s=w.A.getDefault();if(s&&s.loaded&&(0,u.S8)(s.restUrl)===(0,u.S8)(a))return s.user;const l=`${a}/community/self`,d=null!=e?e.signal:null,h=await(0,o.Ke)((0,n.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:d}));return h.ok?b.A.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t?.portal,a=this.portalItem?.id&&(this.portalItem.portal||w.A.getDefault());return i&&a&&!(0,u.ut)(a.restUrl,i.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,a.Cg)([(0,y.MZ)({type:M.default})],v.prototype,"portalItem",null),(0,a.Cg)([(0,c.w)("web-document","portalItem",["itemId"])],v.prototype,"readPortalItem",null),(0,a.Cg)([(0,f.K)("web-document","portalItem",{itemId:{type:String}})],v.prototype,"writePortalItem",null),(0,a.Cg)([(0,y.MZ)({clonable:!1})],v.prototype,"resourceReferences",void 0),(0,a.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],v.prototype,"userHasEditingPrivileges",void 0),(0,a.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],v.prototype,"userHasFullEditingPrivileges",void 0),(0,a.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],v.prototype,"userHasUpdateItemPrivileges",void 0),v=(0,a.Cg)([(0,g.$)("esri.layers.mixins.PortalLayer")],v),v},_={credential:null,user:null}},18768:(e,t,i)=>{i.d(t,{b:()=>l});var a=i(31635),s=i(53966),r=i(10107),n=(i(44208),i(87811),i(40608)),o=i(60694);const l=e=>{const t=e;let i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,o.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,o.Jf)(e,s.A.getLogger(this)))}};return(0,a.Cg)([(0,r.MZ)()],i.prototype,"title",null),(0,a.Cg)([(0,r.MZ)({type:String})],i.prototype,"url",null),i=(0,a.Cg)([(0,n.$)("esri.layers.mixins.ArcGISService")],i),i}},28692:(e,t,i)=>{i.r(t),i.d(t,{default:()=>G});var a=i(31635),s=i(67996),r=i(7762),n=i(49186),o=i(53966),l=i(91869),d=i(92071),h=i(74887),p=i(36708),u=i(84952),y=i(13069),c=i(10107),g=(i(44208),i(87811),i(36005)),f=i(40608),m=i(43937),w=i(35666),M=i(4146),b=i(80340),T=i(62796),v=i(85342),_=i(18768),D=i(63074),A=i(69208),I=i(16131),C=i(8303),S=i(54310),L=i(25036),P=i(10873),k=i(62568),E=i(97159);let N=class extends((0,D.dM)((0,L.j)((0,S.J)((0,_.b)((0,I.q)((0,C.A)((0,d.P)((0,A.d)(M.A))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(r.A.ofType(T.A)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(r.A.ofType(T.A)),this.type="knowledge-graph",this.url=null,this.addHandles((0,p.wB)(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),p.OH))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(e){(0,h.QP)(e)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await(0,v.qN)(this)}async _fetchMetadata(){if(!this.url)throw new n.A("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await(0,k.fetchKnowledgeGraph)(this.url);this.knowledgeGraph=e,this._forEachGraphType(e=>{e.name&&this._graphTypeLookup.set(e.name,e)})}async _initializeLayerProperties(){7===this.originIdOf("inclusionModeDefinition")?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new b.P({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await(0,s.cZ)(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(t=>{const i=this._graphTypeLookup.get(t.graphTypeName);i&&!e.namedTypeDefinitions.has(i.name)&&e.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",e,(0,w.OL)(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach((e,i)=>{const a=this._graphTypeLookup.get(i);if(!a)return o.A.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(i);"relationship"!==a.type&&"entity"!==a.type&&(o.A.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(i))});else if(!e.generateAllSublayers)throw new n.A("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,a=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach((i,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":t.push(s);break;case"entity":e.push(s)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(t=>{e(t)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=new Set,i=[];for(const a of e)this._graphTypeLookup.has(a.typeName)&&(!1===this.layers.concat(this.tables).some(e=>e.objectType.name===a.typeName)&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),t.add(a.typeName)),(0,l.tE)(this.sublayerIdsCache,a.typeName,()=>new Set).add(a.id),i.push(a));this.dataManager.addToLayer(i);for(const e of t){const t=this._graphTypeLookup.get(e);t&&(this._addSublayer(t),"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e))}await(0,v.qN)(this,Array.from(t)),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach(e=>{const a=this._createSublayer(e);i(a)&&t.push(a),this._updateSublayerCaches(e)})}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new T.A({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const i=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);i&&(t.objectType=i,this._updateSublayerCaches(i))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_saveUrlAsNewResource(e,t,i,a){e[t]="<pending>",i.pendingOperations.push(async function(e){const t=await(0,s.fe)(e);return new Blob([t],{type:"application/x-protobuf"})}(this.inclusionModeDefinition).then(s=>{const r=function(e){const t=`definitionSetMap-${(0,y.lk)()}.dat`,i=(0,u.fj)("knowledgeGraphLayer",t);return e.resourceFromPath(i)}(a);e[t]=r.itemRelativeUrl,i.toAdd.push({resource:r,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}readDefinitionSetMap(e,t,i){return(0,E.f)(e,i)}writeDefinitionSetMap(e,t,i,a){const s=a?.portalItem,r=a?.resources,n=(0,w.aB)(a?.origin);if(!s||!r||null==n)return void(e&&(t[i]=(0,E.t)(e,a)));const{inclusionModeDefinition:o}=this;if(!o||this._displaysAllRecords(o))return void(this.definitionSetMap=null);const l=this.originIdOf("inclusionModeDefinition");if(7===l||this._namedTypesModified||n<l)this._saveUrlAsNewResource(t,i,r,s);else if(n===l&&e){const n=(0,E.t)(e,a);(0,u.oP)(n)?this._saveUrlAsNewResource(t,i,r,s):t[i]=n}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):o.A.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new r.A,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new r.A,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const i=(0,l.tE)(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(e=>{i.add(e.id)})})}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),(0,l.tE)(this.sublayerIdsCache,e,()=>new Set);const i=this._addSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await(0,v.qN)(this,[e]),this._refreshNamedTypes(),i}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new n.A("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const t=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);t?.useAllData?o.A.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new n.A("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const t=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!t||t.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else o.A.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition||o.A.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made"),this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this._refreshNamedTypes()}convertToExplicitMembership(){this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&o.A.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made"),this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map};for(const e of this.dataManager.sublayerCaches.keys())(0,l.tE)(this.sublayerIdsCache,e,()=>new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._refreshNamedTypes()}async removeRecords(e){await this.load();const t=[];for(const i of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const e of t)this.sublayerIdsCache.get(e.typeName)?.delete(e.id);return this._refreshNamedTypes(),t}};(0,a.Cg)([(0,c.MZ)()],N.prototype,"dataManager",void 0),(0,a.Cg)([(0,c.MZ)({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],N.prototype,"definitionSetMap",void 0),(0,a.Cg)([(0,g.w)("definitionSetMap")],N.prototype,"readDefinitionSetMap",null),(0,a.Cg)([(0,m.K)("definitionSetMap")],N.prototype,"writeDefinitionSetMap",null),(0,a.Cg)([(0,c.MZ)()],N.prototype,"inclusionModeDefinition",null),(0,a.Cg)([(0,c.MZ)()],N.prototype,"knowledgeGraph",void 0),(0,a.Cg)([(0,c.MZ)({type:r.A.ofType(T.A),json:{write:{ignoreOrigin:!0}}})],N.prototype,"layers",void 0),(0,a.Cg)([(0,c.MZ)()],N.prototype,"memberEntityTypes",void 0),(0,a.Cg)([(0,c.MZ)()],N.prototype,"memberRelationshipTypes",void 0),(0,a.Cg)([(0,c.MZ)({type:["KnowledgeGraphLayer"]})],N.prototype,"operationalLayerType",void 0),(0,a.Cg)([(0,c.MZ)()],N.prototype,"sublayerIdsCache",void 0),(0,a.Cg)([(0,c.MZ)({type:r.A.ofType(T.A),json:{write:{ignoreOrigin:!0}}})],N.prototype,"tables",void 0),(0,a.Cg)([(0,c.MZ)({json:{read:!1}})],N.prototype,"type",void 0),(0,a.Cg)([(0,c.MZ)(P.OZ)],N.prototype,"url",void 0),N=(0,a.Cg)([(0,f.$)("esri.layers.KnowledgeGraphLayer")],N);const G=N},69208:(e,t,i)=>{i.d(t,{d:()=>n});var a=i(31635),s=i(10107),r=(i(44208),i(53966),i(87811),i(40608));const n=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,a.Cg)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],i.prototype,"customParameters",void 0),i=(0,a.Cg)([(0,r.$)("esri.layers.mixins.CustomParametersMixin")],i),i}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[409],{17136:(n,e,t)=>{t.d(e,{Y_:()=>j,O7:()=>v,el:()=>k});var s=t(92602),i=t(69052),r=t(49186),o=t(53966),c=t(39829),l=t(82799),u=t(16930),a=t(80754),f=t(21325),h=t(28735),p=t(78888),m=t(65864),g=t(2272),y=t(84952),d=t(92300);const A=()=>o.A.getLogger("esri.geometry.support.normalizeUtils");function M(n){return"polygon"===n[0].type}function w(n){return"polyline"===n[0].type}function x(n,e,t){if(e){const e=function(n,e){if(!(n instanceof l.A||n instanceof c.A)){const n="straightLineDensify: the input geometry is neither polyline nor polygon";throw A().error(n),new r.A("internal:geometry",n)}const t=(0,a.r8)(n),s=[];for(const n of t){const t=[];s.push(t),t.push([n[0][0],n[0][1]]);for(let s=0;s<n.length-1;s++){const i=n[s][0],r=n[s][1],o=n[s+1][0],c=n[s+1][1],l=Math.sqrt((o-i)*(o-i)+(c-r)*(c-r)),u=(c-r)/l,a=(o-i)/l,f=l/e;if(f>1){for(let n=1;n<=f-1;n++){const s=n*e,o=a*s+i,c=u*s+r;t.push([o,c])}const n=(l+Math.floor(f-1)*e)/2,s=a*n+i,o=u*n+r;t.push([s,o])}t.push([o,c])}}return function(n){return"polygon"===n.type}(n)?new c.A({rings:s,spatialReference:n.spatialReference}):new l.A({paths:s,spatialReference:n.spatialReference})}(n,1e6);n=(0,h.ci)(e,!0)}return t&&(n=(0,a.kS)(n,t)),n}function b(n,e,t){if(Array.isArray(n)){const s=n[0];if(s>e){const t=(0,a.kd)(s,e);n[0]=s+t*(-2*e)}else if(s<t){const e=(0,a.kd)(s,t);n[0]=s+e*(-2*t)}}else{const s=n.x;if(s>e){const t=(0,a.kd)(s,e);n=n.clone().offset(t*(-2*e),0)}else if(s<t){const e=(0,a.kd)(s,t);n=n.clone().offset(e*(-2*t),0)}}return n}function R(n,e){let t=-1;for(let s=0;s<e.cutIndexes.length;s++){const i=e.cutIndexes[s],r=e.geometries[s],o=(0,a.r8)(r);for(let n=0;n<o.length;n++){const e=o[n];e.some(t=>{if(t[0]<180)return!0;{let t=0;for(let n=0;n<e.length;n++){const s=e[n][0];t=s>t?s:t}t=Number(t.toFixed(9));const s=-360*(0,a.kd)(t,180);for(let t=0;t<e.length;t++){const e=r.getPoint(n,t);r.setPoint(n,t,e.clone().offset(s,0))}return!0}})}if(i===t){if(M(n))for(const e of(0,a.r8)(r))n[i]=n[i].addRing(e);else if(w(n))for(const e of(0,a.r8)(r))n[i]=n[i].addPath(e)}else t=i,n[i]=r}return n}async function k(n,e,t){if(!Array.isArray(n))return k([n],e);e&&"string"!=typeof e&&A().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const i="string"==typeof e?e:e?.url??s.A.geometryServiceUrl;let r,o,u,M,w,v,S,j,L=0;const P=[],X=[];for(const e of n)if(null!=e)if(r||(r=e.spatialReference,o=(0,f.Vp)(r),u=r.isWebMercator,v=u?102100:4326,M=a.j7[v].maxX,w=a.j7[v].minX,S=a.j7[v].plus180Line,j=a.j7[v].minus180Line),o)if("mesh"===e.type)X.push(e);else if("point"===e.type)X.push(b(e.clone(),M,w));else if("multipoint"===e.type){const n=e.clone();n.points=n.points.map(n=>b(n,M,w)),X.push(n)}else if("extent"===e.type){const n=e.clone()._normalize(!1,!1,o);X.push(n.rings?new c.A(n):n)}else if(e.extent){const n=e.extent,t=(0,a.kd)(n.xmin,w)*(2*M);let s=0===t?e.clone():(0,a.kS)(e.clone(),t);n.offset(t,0);let{xmin:i,xmax:r}=n;i=Number(i.toFixed(9)),r=Number(r.toFixed(9)),n.intersects(S)&&r!==M?(L=r>L?r:L,s=x(s,u),P.push(s),X.push("cut")):n.intersects(j)&&i!==w?(L=r*(2*M)>L?r*(2*M):L,s=x(s,u,360),P.push(s),X.push("cut")):X.push(s)}else X.push(e.clone());else X.push(e);else X.push(e);let z=(0,a.kd)(L,M),C=-90;const N=z,q=new l.A;for(;z>0;){const n=360*z-180;q.addPath([[n,C],[n,-1*C]]),C*=-1,z--}if(P.length>0&&N>0){const e=R(P,await async function(n,e,t,s){const i=(0,g.Dl)(n),r=e[0].spatialReference,o={...s,responseType:"json",query:{...i.query,f:"json",sr:(0,f.YX)(r),target:JSON.stringify({geometryType:(0,m.$B)(e[0]),geometries:e}),cutter:JSON.stringify(t)}},c=await(0,p.A)(i.path+"/cut",o),{cutIndexes:l,geometries:u=[]}=c.data;return{cutIndexes:l,geometries:u.map(n=>{const e=(0,m.rS)(n);return e.spatialReference=r,e})}}(i,P,q,t)),s=[],r=[];for(let t=0;t<X.length;t++){const i=X[t];if("cut"!==i)r.push(i);else{const i=e.shift(),o=n[t];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&i.rings.length>=o.rings.length?(s.push(i),r.push("simplify")):r.push(u?(0,h.Gh)(i):i)}}if(!s.length)return r;const o=await async function(n,e,t){const s="string"==typeof n?(0,y.An)(n):n,i=e[0].spatialReference,r=(0,m.$B)(e[0]),o={...t,query:{...s.query,f:"json",sr:(0,f.YX)(i),geometries:JSON.stringify((0,d.X)(e))}},{data:c}=await(0,p.A)(s.path+"/simplify",o);return(0,d.V)(c.geometries,r,i)}(i,s,t),c=[];for(let n=0;n<r.length;n++){const e=r[n];"simplify"!==e?c.push(e):c.push(u?(0,h.Gh)(o.shift()):o.shift())}return c}const G=[];for(let n=0;n<X.length;n++){const e=X[n];if("cut"!==e)G.push(e);else{const n=P.shift();G.push(!0===u?(0,h.Gh)(n):n)}}return G}function v(n,e,t){const s=(0,f.Vp)(t);if(null==s)return n;const[i,r]=s.valid,o=2*r;let c=0,l=0;e>r?c=Math.ceil(Math.abs(e-r)/o):e<i&&(c=-Math.ceil(Math.abs(e-i)/o)),n>r?l=Math.ceil(Math.abs(n-r)/o):n<i&&(l=-Math.ceil(Math.abs(n-i)/o));let u=n+(c-l)*o;const a=u-e;return a>r?u-=o:a<i&&(u+=o),u}function S(n){const e=(0,f.Vp)(n);if(null==e)return null;const[t,s]=e.valid;return new i.hr(t,s)}const j=S(u.A.WGS84);S(u.A.WebMercator)},36708:(n,e,t)=>{t.d(e,{C_:()=>h,OH:()=>g,Vh:()=>y,on:()=>f,pc:()=>d,wB:()=>l,z7:()=>u});var s=t(37955),i=t(36563),r=t(97768),o=t(74887),c=t(14012);function l(n,e,t={}){return a(n,e,t,p)}function u(n,e,t={}){return a(n,e,t,m)}function a(n,e,t={},s){let i=null;const o=t.once?(n,t)=>{s(n)&&((0,r.xt)(i),e(n,t))}:(n,t)=>{s(n)&&e(n,t)};if(i=(0,c.Cn)(n,o,t.sync,t.equals),t.initial){const e=n();o(e,e)}return i}function f(n,e,t,o={}){let c=null,u=null,a=null;function f(){c&&u&&(u.remove(),o.onListenerRemove?.(c),c=null,u=null)}function h(n){o.once&&o.once&&(0,r.xt)(a),t(n)}const p=l(n,(n,t)=>{f(),(0,s.wb)(n)&&(c=n,u=(0,s.on)(n,e,h),o.onListenerAdd?.(n))},{sync:o.sync,initial:!0});return a=(0,i.hA)(()=>{p.remove(),f()}),a}function h(n,e){return function(n,e,t){if((0,o.G4)(t))return Promise.reject((0,o.NK)());const s=n();if(e?.(s))return Promise.resolve(s);let c=null;function l(){c=(0,r.xt)(c)}return new Promise((s,r)=>{c=(0,i.vE)([(0,o.u7)(t,()=>{l(),r((0,o.NK)())}),a(n,n=>{l(),s(n)},{sync:!1,once:!0},e??p)])})}(n,m,e)}function p(n){return!0}function m(n){return!!n}t(80559);const g={sync:!0},y={initial:!0},d={sync:!0,initial:!0}},69052:(n,e,t)=>{t.d(e,{hr:()=>i,ie:()=>l,uC:()=>c});var s=t(34727);class i{constructor(n,e){this.min=n,this.max=e,this.range=e-n}normalize(n,e=0,t=!1){return r(this.range,this.min,this.max,n,e,t)}clamp(n,e=0){return(0,s.qE)(n-e,this.min,this.max)+e}monotonic(n,e,t){return n<e?e:e+o(this.range,n-e,t)}minimalMonotonic(n,e,t){return r(this.range,n,n+this.range,e,t)}center(n,e,t){return e=this.monotonic(n,e,t),this.normalize((n+e)/2,t)}diff(n,e,t){return this.monotonic(n,e,t)-n}shortestSignedDiff(n,e){n=this.normalize(n);const t=(e=this.normalize(e))-n,s=e<n?this.minimalMonotonic(n,e)-n:e-this.minimalMonotonic(e,n);return Math.abs(t)<Math.abs(s)?t:s}contains(n,e,t){return e=this.minimalMonotonic(n,e),(t=this.minimalMonotonic(n,t))>n&&t<e}}function r(n,e,t,s,i=0,r=!1){return(s-=i)<e?s+=o(n,e-s):s>t&&(s-=o(n,s-t)),r&&s===t&&(s=e),s+i}function o(n,e,t=0){return Math.ceil((e-t)/n)*n+t}const c=new i(0,2*Math.PI),l=(new i(-Math.PI,Math.PI),new i(0,360))},80754:(n,e,t)=>{t.d(e,{j7:()=>o,kS:()=>l,kd:()=>c,r8:()=>u});var s=t(82799),i=t(16930),r=t(65864);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator}),minus180Line:new s.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.A({paths:[[[180,-180],[180,180]]],spatialReference:i.A.WGS84}),minus180Line:new s.A({paths:[[[-180,-180],[-180,180]]],spatialReference:i.A.WGS84})}};function c(n,e){return Math.ceil((n-e)/(2*e))}function l(n,e){const t=u(n);for(const n of t)for(const t of n)t[0]+=e;return n}function u(n){return(0,r.Bi)(n)?n.rings:n.paths}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[788,4342,5294,6719,7097,7694,8407],{6797:(e,t,i)=>{i.d(t,{Mj:()=>h,Ui:()=>p,w2:()=>f});var r=i(65008),n=i(7762),s=i(88620);const a=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function l(e){return e instanceof r.A}function o(e){return e instanceof n.A?Object.keys(e.items):l(e)?(0,s.oY)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof n.A?e.items[t]:e[t]}function c(e){return e?e.declaredClass:null}function d(e,t){const i=e.diff;if(i&&"function"==typeof i)return i(e,t);const r=o(e),n=o(t);if(0===r.length&&0===n.length)return;if(!r.length||!n.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const s=n.filter(e=>!r.includes(e)),h=r.filter(e=>!n.includes(e)),f=r.filter(i=>n.includes(i)&&u(e,i)!==u(t,i)).concat(s,h).sort(),p=c(e);if(p&&a.has(p)&&f.length)return{type:"complete",oldValue:e,newValue:t};let y;const g=l(e)&&l(t);for(const r of f){const n=u(e,r),s=u(t,r);let a;if((g||"function"!=typeof n&&"function"!=typeof s)&&n!==s&&(null!=n||null!=s)){if(i&&i[r]&&"function"==typeof i[r])a=i[r]?.(n,s);else if(n instanceof Date&&s instanceof Date){if(n.getTime()===s.getTime())continue;a={type:"complete",oldValue:n,newValue:s}}else a="object"==typeof n&&"object"==typeof s&&c(n)===c(s)?d(n,s):{type:"complete",oldValue:n,newValue:s};null!=a&&(null!=y?y.diff[r]=a:y={type:"partial",diff:{[r]:a}})}}return y}function h(e,t){return function(e,t){if(null==e)return!1;const i=t.split(".");let r=e;for(const e of i){if("complete"===r.type)return!0;if("partial"!==r.type)return!1;{const t=r.diff[e];if(!t)return!1;r=t}}return!0}(e,t)}function f(e,t){if(!e)return!1;if("partial"===e.type){const i=Object.keys(e.diff);return 1===i.length&&i[0]===t}return!1}function p(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&c(e)!==c(t)?{type:"complete",oldValue:e,newValue:t}:d(e,t)}},9762:(e,t,i)=>{i.r(t),i.d(t,{projectBuffer:()=>n});var r=i(37539);function n(e,t,i,n,s,a,l=Math.floor(e.length/3)){const o=(0,r.jd)(t,s);if(null==o)return!1;if(o===r.pO){if(e===n&&i===a)return!0;const t=i+3*l;for(let r=i,s=a;r<t;r++,s++)n[s]=e[r];return!0}const u=i+3*l;for(let t=i,r=a;t<u;t+=3,r+=3)o(e,t,n,r);return!0}},10407:(e,t,i)=>{i.d(t,{It:()=>f,LG:()=>a,OM:()=>u,Sm:()=>c,Y:()=>l,bK:()=>o,mm:()=>h,sQ:()=>d});var r=i(98988),n=i(16930),s=i(28735);function a(e,t){if(!l(e,t)){const i=e.typeKeywords;i?i.push(t):e.typeKeywords=[t]}}function l(e,t){return!!e.typeKeywords?.includes(t)}function o(e){return l(e,h.HOSTED_SERVICE)}function u(e,t){const i=e.typeKeywords;if(i){const e=i.indexOf(t);e>-1&&i.splice(e,1)}}function c(e,t,i){i?a(e,t):u(e,t)}async function d(e){const t=e.clone().normalize();let i;if(t.length>1)for(const e of t)i?e.width>i.width&&(i=e):i=e;else i=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,s.ci)(e);const i=n.A.WGS84;return await(0,r.initializeProjection)(t,i),(0,r.project)(e,i)}(i)}const h={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function f(e){const{portal:t,isOrgItem:i,itemControl:r}=e,n=t.user?.privileges;let s=!n||n.includes("features:user:edit"),a=!!i&&!!n?.includes("features:user:fullEdit");const l="update"===r||"admin"===r;return l?a=s=!0:a&&(s=!0),{features:{edit:s,fullEdit:a},content:{updateItem:l}}}},17311:(e,t,i)=>{i.d(t,{A:()=>h});var r=i(31635),n=i(65008),s=i(4576),a=i(60999),l=i(7762),o=i(10107),u=(i(44208),i(53966),i(40608)),c=i(30524),d=i(43668);let h=class extends n.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,a.UT)(()=>(0,d.l)()):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??i.e(9926).then(i.bind(i,29926)).then(e=>this._featureUtils=e)}get calculatedExpressions(){const e=new l.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const i=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(i.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:i,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(i,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter(t=>e.includes(`{expression/${t.name.toLowerCase()}}`))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some(e=>!0===e.invalid)}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const i=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of i){const i=t.split("."),r=this.fieldsIndex.get(i.at(-1)??"");r&&e.add(r.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const i of t){const t=this.fieldsIndex.get(i);t&&e.add(t.name)}return null!=this.objectIdField&&e.add(this.objectIdField),e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,i){const r=t.getObjectId()??t.attributes[e.objectIdField];return(await this.getTitles(e,[t],i)).get(r)??""}async getTitles(e,t,i){const r=new Map,n=i?.timeZone??"system";try{const[{substituteFieldsInLinksAndAttributes:s}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);i?.fetchMissingFields&&(t=await this._checkAndReQueryGraphics(e,t));const{fieldInfoMap:a,workingTitle:l}=this,o=l&&a;t.forEach(t=>{const i=t.getObjectId()??t.attributes[e.objectIdField],u=o?s({attributes:t.attributes,expressionAttributes:null,fieldInfoMap:a,globalAttributes:this._createFormattedAttributes(e,t,n).global,layer:e,text:l}):"";r.set(i,u)})}catch{}return r}async _checkAndReQueryGraphics(e,t){const i=t.map(t=>t.getObjectId()??t.attributes[e.objectIdField]).filter(s.Ru);if(i.length!==t.length)return t;if(t.some(e=>!(0,c.Kl)(e,this.requiredFields))){const r=e.createQuery();r.where="1=1",r.outFields=[...this.requiredFields],r.objectIds=i;const n=await e.queryFeatures(r);if(n?.features.length===t.length)return n.features}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const i of e){if(!i.fieldName)continue;const e=this.fieldsIndex.get(i.fieldName),r=e?.name??i.fieldName;i.fieldName=r,t.set(r.toLowerCase(),i)}return t}_createFormattedAttributes(e,t,i="system"){const r=this.effectivePopupTemplate?.fieldInfos??[],n={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const i=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{n[`expression/${e.name}`]=e.func({vars:{$feature:i}})}catch{}}const s={...t.attributes,...n};return{global:this._featureUtils.formatAttributes({fieldInfos:r,attributes:s,graphic:t,timeZone:i,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,c.nw)(e).filter(e=>!(e.startsWith("relationships/")||e.startsWith("expression/")))}};(0,r.Cg)([(0,o.MZ)({readOnly:!0})],h.prototype,"_arcadeTask",null),(0,r.Cg)([(0,o.MZ)()],h.prototype,"_featureUtils",void 0),(0,r.Cg)([(0,o.MZ)({readOnly:!0})],h.prototype,"featureUtilsPromise",null),(0,r.Cg)([(0,o.MZ)({readOnly:!0})],h.prototype,"calculatedExpressions",null),(0,r.Cg)([(0,o.MZ)()],h.prototype,"displayField",void 0),(0,r.Cg)([(0,o.MZ)()],h.prototype,"effectivePopupTemplate",void 0),(0,r.Cg)([(0,o.MZ)()],h.prototype,"expressionsUsedInTitle",null),(0,r.Cg)([(0,o.MZ)()],h.prototype,"fieldsIndex",void 0),(0,r.Cg)([(0,o.MZ)()],h.prototype,"fieldInfoMap",null),(0,r.Cg)([(0,o.MZ)()],h.prototype,"fields",void 0),(0,r.Cg)([(0,o.MZ)()],h.prototype,"objectIdField",void 0),(0,r.Cg)([(0,o.MZ)()],h.prototype,"requiredFields",null),h=(0,r.Cg)([(0,u.$)("esri.layers.support.TitleCreator")],h)},22671:(e,t,i)=>{i.d(t,{A:()=>m});var r,n=i(31635),s=i(52106),a=i(66552),l=i(25482),o=i(4718),u=i(10107),c=(i(44208),i(53966),i(36005)),d=i(40608),h=i(43937),f=i(16930),p=i(65864),y=i(50498),g=i(20437);const _=new a.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let m=r=class extends l.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,s.A)}writeGeometryType(e,t,i,r){if(e)return void _.write(e,t,i,r);const{features:n}=this;if(n)for(const e of n)if(null!=e?.geometry)return void _.write(e.geometry.type,t,i,r)}readQueryGeometry(e,t){if(!e)return null;const i=!!e.spatialReference,r=(0,p.rS)(e);return r&&!i&&t.spatialReference&&(r.spatialReference=f.A.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:i}=this;if(i)for(const e of i)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new r(this.cloneProperties())}cloneProperties(){return(0,o.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let i=0;i<t.features.length;i++){const r=t.features[i];if(r.geometry){const t=e?.[i];r.geometry=t?.toJSON()||r.geometry}}return t}quantize(e){const{scale:[t,i],translate:[r,n]}=e,s=this.features,a=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-r)/t),e=>Math.round((n-e)/i));for(let e=0,t=s.length;e<t;e++)a?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:i}=this;if(!i)return this;const{translate:[r,n],scale:[s,a]}=i;let l=null,o=null;if(this.hasZ&&null!=i?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=i;l=i=>i*t+e}if(this.hasM&&null!=i?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=i;o=i=>null==i?i:i*t+e}const u=this._getHydrationFunction(e,e=>e*s+r,e=>n-e*a,l,o);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,i){const r=f.A.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const s=e[t],a=i.fromJSON(s),l=s.geometry?.spatialReference;null==a.geometry||l||(a.geometry.spatialReference=r);const o=s.aggregateGeometries,u=a.aggregateGeometries;if(o&&null!=u)for(const e in u){const t=u[e],i=o[e],n=i?.spatialReference;null==t||n||(t.spatialReference=r)}n.push(a)}return n}_quantizePoints(e,t,i){let r,n;const s=[];for(let a=0,l=e.length;a<l;a++){const l=e[a];if(a>0){const e=t(l[0]),a=i(l[1]);e===r&&a===n||(s.push([e-r,a-n]),r=e,n=a)}else r=t(l[0]),n=i(l[1]),s.push([r,n])}return s.length>0?s:null}_getQuantizationFunction(e,t,i){return"point"===e?e=>(e.x=t(e.x),e.y=i(e.y),e):"polyline"===e||"polygon"===e?e=>{const r=(0,p.Bi)(e)?e.rings:e.paths,n=[];for(let e=0,s=r.length;e<s;e++){const s=r[e],a=this._quantizePoints(s,t,i);a&&n.push(a)}return n.length>0?((0,p.Bi)(e)?e.rings=n:e.paths=n,e):null}:"multipoint"===e?e=>{const r=this._quantizePoints(e.points,t,i);return r&&r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,i,r,n){return"point"===e?e=>{e.x=t(e.x),e.y=i(e.y),r&&(e.z=r(e.z))}:"polyline"===e||"polygon"===e?e=>{const s=(0,p.Bi)(e)?e.rings:e.paths;let a,l;for(let e=0,r=s.length;e<r;e++){const r=s[e];for(let e=0,n=r.length;e<n;e++){const n=r[e];e>0?(a+=n[0],l+=n[1]):(a=n[0],l=n[1]),n[0]=t(a),n[1]=i(l)}}if(r&&n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=r(i[2]),i[3]=n(i[3])}}else if(r)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=r(i[2])}}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=n(i[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=i(e.ymin),e.xmax=t(e.xmax),e.ymax=i(e.ymax),r&&null!=e.zmax&&null!=e.zmin&&(e.zmax=r(e.zmax),e.zmin=r(e.zmin)),n&&null!=e.mmax&&null!=e.mmin&&(e.mmax=n(e.mmax),e.mmin=n(e.mmin))}:"multipoint"===e?e=>{const s=e.points;let a,l;for(let e=0,r=s.length;e<r;e++){const r=s[e];e>0?(a+=r[0],l+=r[1]):(a=r[0],l=r[1]),r[0]=t(a),r[1]=i(l)}if(r&&n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=r(t[2]),t[3]=n(t[3])}else if(r)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=r(t[2])}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2])}}:null}};(0,n.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],m.prototype,"displayFieldName",void 0),(0,n.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"exceededTransferLimit",void 0),(0,n.Cg)([(0,u.MZ)({type:[s.A],json:{write:!0}})],m.prototype,"features",void 0),(0,n.Cg)([(0,c.w)("features")],m.prototype,"readFeatures",null),(0,n.Cg)([(0,u.MZ)({type:[g.A],json:{write:!0}})],m.prototype,"fields",void 0),(0,n.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:_.read}}})],m.prototype,"geometryType",void 0),(0,n.Cg)([(0,h.K)("geometryType")],m.prototype,"writeGeometryType",null),(0,n.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"hasM",void 0),(0,n.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"hasZ",void 0),(0,n.Cg)([(0,u.MZ)({types:y.yR,json:{write:!0}})],m.prototype,"queryGeometry",void 0),(0,n.Cg)([(0,c.w)("queryGeometry")],m.prototype,"readQueryGeometry",null),(0,n.Cg)([(0,u.MZ)({type:f.A,json:{write:!0}})],m.prototype,"spatialReference",void 0),(0,n.Cg)([(0,h.K)("spatialReference")],m.prototype,"writeSpatialReference",null),(0,n.Cg)([(0,u.MZ)({json:{write:!0}})],m.prototype,"transform",void 0),m=r=(0,n.Cg)([(0,d.$)("esri.rest.support.FeatureSet")],m),m.prototype.toJSON.isDefaultToJSON=!0},30235:(e,t,i)=>{i.d(t,{A:()=>p});var r=i(52106),n=i(87449),s=i(11221),a=i(89169),l=i(33325),o=i(80609),u=i(39516),c=i(91075),d=i(29784),h=i(33143),f=i(20437);class p extends s.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return l.gO}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type||this._layer.objectIdField===i.name)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this._databaseType=0,this.hasZ=!0===this._layer?.capabilities?.data?.supportsZ,this.hasM=!0===this._layer?.capabilities?.data?.supportsM,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType}_isInFeatureSet(){return 0}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,e.outFields=this._overrideFields??["*"],e.returnGeometry=!this._removeGeometry,e}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new r.A({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,n){let s="",l=!1;if(null!==r&&(s=r.constructClause(),l=!0),this.isTable()&&t&&null!==e&&""!==e)return new a.A([],[],!0,null);const c=this._createQuery();c.where=(0,u.mA)(c.where,null===i?null===t?"1=1":"":(0,o.YY)(i,0)),c.spatialRelationship=this._makeRelationshipEnum(e),c.outSpatialReference=this.spatialReference,c.orderByFields=""!==s?s.split(","):null,c.geometry=null===t?null:t,c.relationParameter=this._makeRelationshipParam(e);const d=await this._layer.queryFeatures(c);if(null===d)return new a.A([],[],l,null);this._checkCancelled(n);const h=[];return d.features.forEach(e=>{const t=e.attributes[this._layer.objectIdField];h.push(t),this._featureCache[t]=this._changeFeature(e)}),new a.A([],h,l,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;if(await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const e=[];return this._layer.source.items.forEach(t=>{const i=t.attributes[this._layer.objectIdField];e.push(i),this._featureCache[i]=this._changeFeature(t)}),this._wset=new a.A([],e,!1,null),this._wset}const e=this._createQuery();e.where="1=1";const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(e=>{const t=e.attributes[this._layer.objectIdField];i.push(t),this._featureCache[t]=this._changeFeature(e)}),this._wset=new a.A([],i,!1,null),this._wset}async _getFeatures(e,t,i){const r=[];-1!==t&&void 0===this._featureCache[t]&&r.push(t);for(let n=e._lastFetchedIndex;n<e._known.length&&(e._lastFetchedIndex+=1,!(void 0===this._featureCache[e._known[n]]&&(e._known[n]!==t&&r.push(e._known[n]),r.length>i)));n++);if(0===r.length)return"success";throw new n.d("MissingFeatures")}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let i=e.layerDefinition.objectIdField;const r=e.layerDefinition.typeIdField??"",n=[];if(e.layerDefinition.types)for(const t of e.layerDefinition.types)n.push(h.A.fromJSON(t));let s=e.layerDefinition.geometryType;void 0===s&&(s=e.featureSet.geometryType||"");let a=e.featureSet.features;const l=t.toJSON();if(!i){let t=!1;for(const r of e.layerDefinition.fields)if("oid"===r.type||"esriFieldTypeOID"===r.type){i=r.name,t=!0;break}if(!1===t){let t="FID",r=!0,n=0;for(;r;){let i=!0;for(const r of e.layerDefinition.fields)if(r.name===t){i=!1;break}!0===i?r=!1:(n++,t="FID"+n.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});const s=[];for(let i=0;i<a.length;i++)s.push({geometry:e.featureSet.features[i].geometry,attributes:e.featureSet.features[i].attributes?this._cloneAttr(e.featureSet.features[i].attributes):{}}),s[i].attributes[t]=i;a=s,i=t}}const o=[];for(const t of e.layerDefinition.fields)t instanceof f.A?o.push(t):o.push(f.A.fromJSON(t));let u=s;switch(u||(u=""),u){case"esriGeometryPoint":u="point";break;case"esriGeometryPolyline":u="polyline";break;case"esriGeometryPolygon":u="polygon";break;case"esriGeometryEnvelope":u="extent";break;case"esriGeometryMultipoint":u="multipoint";break;case"":case"esriGeometryNull":u="esriGeometryNull"}if("esriGeometryNull"!==u)for(const e of a)e.geometry&&e.geometry instanceof c.A==0&&(e.geometry.type=u,void 0===e.geometry.spatialReference&&(e.geometry.spatialReference=l));else for(const e of a)e.geometry&&(e.geometry=null);const y={outFields:["*"],source:a,fields:o,hasZ:!0===e?.layerDefinition?.hasZ||!0===e?.featureSet?.hasZ,hasM:!0===e?.layerDefinition?.hasM||!0===e?.featureSet?.hasM,types:n,typeIdField:r,objectIdField:i,spatialReference:t},g="esriGeometryNull"===u||null===u;g||(y.geometryType=u);const _=new d.default(y);return e?.layerDefinition?.subtypeField&&e?.layerDefinition?.subtypes&&_.read({subtypes:e.layerDefinition.subtypes,subtypeField:e.layerDefinition.subtypeField}),new p({layer:_,spatialReference:t,isTable:g})}async queryAttachments(){return[]}async getFeatureByObjectId(e){const t=this._createQuery();t.where=this.objectIdField+"="+e.toString();const i=await this._layer.queryFeatures(t);return 1===i.features.length?i.features[0]:null}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return"preferredTimeZone"in this._layer?this._layer.preferredTimeZone:null}get dateFieldsTimeZone(){return"dateFieldsTimeZone"in this._layer?this._layer.dateFieldsTimeZone:null}get datesInUnknownTimezone(){return"datesInUnknownTimezone"in this._layer&&this._layer.datesInUnknownTimezone}get editFieldsInfo(){return"editFieldsInfo"in this._layer?this._layer.editFieldsInfo:null}get timeInfo(){return this._layer?.timeInfo}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return this.fsetInfo??{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}},32730:(e,t,i)=>{i.d(t,{BI:()=>g,D3:()=>p,XJ:()=>y,lc:()=>f,mX:()=>m,rU:()=>_,tH:()=>S});var r=i(799);const n="__begin__",s="__end__",a=new RegExp(n,"ig"),l=new RegExp(s,"ig"),o=new RegExp("^"+n,"i"),u=new RegExp(s+"$","i"),c='"',d=c+" + ",h=" + "+c;function f(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function p(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function y(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=f(e.labelExpression),t.type="conventional"),t}function g(e){const t=y(e);if(!t)return null;switch(t.type){case"conventional":return m(t.expression);case"arcade":return t.expression}return null}function _(e){const t=y(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(w);return t?.[1].trim()||null}(t.expression);case"arcade":return S(t.expression)}return null}function m(e){let t;return e?(t=(0,r.HC)(e,e=>n+'$feature["'+e+'"]'+s),t=o.test(t)?t.replace(o,""):c+t,t=u.test(t)?t.replace(u,""):t+c,t=t.replaceAll(a,d).replaceAll(l,h)):t='""',t}const w=/^\s*\{([^}]+)\}\s*$/i,b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,F=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,I=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function S(e){if(!e)return null;let t=b.exec(e)||F.exec(e);return t?t[1]||t[3]:(t=I.exec(e),t?t[2]:null)}},32756:(e,t,i)=>{i.d(t,{Rr:()=>o,fY:()=>c,ne:()=>u});var r=i(31635),n=i(93637),s=i(10107),a=(i(44208),i(53966),i(87811),i(40608)),l=i(91880);function o(e,t,i){if(!e)return null;const r=e.find(e=>!!e.field);if(!r)return null;const n=new l.A;return n.read(r,i),[n]}const u={type:[l.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:o},write:{writer:function(e,t,i,r){const s=e.find(e=>!!e.field);s&&(0,n.sM)(i,[s.toJSON()],t)}}}},c=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,r.Cg)([(0,s.MZ)(u)],i.prototype,"orderBy",void 0),i=(0,r.Cg)([(0,a.$)("esri.layers.mixins.OrderedLayer")],i),i}},33143:(e,t,i)=>{i.d(t,{A:()=>h});var r=i(31635),n=i(69540),s=i(25482),a=i(10107),l=(i(44208),i(53966),i(87811),i(36005)),o=i(40608),u=i(43937),c=i(80451),d=i(29005);let h=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const i of Object.keys(e))t[i]=(0,c.rS)(e[i]);return t}writeDomains(e,t){const i={};for(const t of Object.keys(e))e[t]&&(i[t]=e[t]?.toJSON());t.domains=i}};(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],h.prototype,"id",void 0),(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],h.prototype,"name",void 0),(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],h.prototype,"domains",void 0),(0,r.Cg)([(0,l.w)("domains")],h.prototype,"readDomains",null),(0,r.Cg)([(0,u.K)("domains")],h.prototype,"writeDomains",null),(0,r.Cg)([(0,a.MZ)({type:[d.A],json:{write:!0}})],h.prototype,"templates",void 0),h=(0,r.Cg)([(0,o.$)("esri.layers.support.FeatureType")],h)},35704:(e,t,i)=>{i.d(t,{A:()=>d});var r=i(87449),n=i(11221),s=i(89169),a=i(33325),l=i(80609),o=i(74887),u=i(88368),c=i(16930);class d extends n.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof u.A?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new c.A({wkid:4326}),this.geometryType=a.ik.point)}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getFilteredSet("",null,this._whereclause,null,e);return this._checkCancelled(e),null!==this._whereClauseFunction?this._wset=new s.A(t._candidates.slice().concat(t._known.slice()),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new s.A(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent?._isInFeatureSet(e);return 1===t?t:(t=this._idstates[e],void 0===t?2:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){return this._whereclause?.testFeature(e)??!1}async executeWhereClauseDeferred(e){if(null!==this._whereClauseFunction){const t=this._whereClauseFunction(e);return(0,o.$X)(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,i){const r=new s.A([],e,!1,null),n=Math.min(t,e.length);if(await(this._parent?._getFeatures(r,-1,n,i)),this._checkCancelled(i),null==this._whereClauseFunction){for(let t=0;t<n;t++){const i=this._parent?._featureFromCache(e[t]);!0===this.executeWhereClause(i)?this._idstates[e[t]]=0:this._idstates[e[t]]=1}return"success"}const a=[];for(let t=0;t<n;t++){const i=this._parent?._featureFromCache(e[t]);a.push(await this.executeWhereClauseDeferred(i))}for(let i=0;i<t;i++)!0===a[i]?this._idstates[e[i]]=0:this._idstates[e[i]]=1;return"success"}async _getFilteredSet(e,t,i,r,n){null!==this._whereClauseFunction||(null!==i?null!==this._whereclause&&(i=(0,l.kg)(this._whereclause,i)):i=this._whereclause),await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,i,r,n);let o;return this._checkCancelled(n),o=null!==this._whereClauseFunction?new s.A(a._candidates.slice().concat(a._known.slice()),[],a._ordered,this._clonePageDefinition(a.pagesDefinition)):new s.A(a._candidates.slice(),a._known.slice(),a._ordered,this._clonePageDefinition(a.pagesDefinition)),o}async _stat(e,t,i,r,n,s,a){if(null!==this._whereClauseFunction)return null===n&&""===i&&null===r?this._manualStat(e,t,s,a):{calculated:!1};let o=this._whereclause;null!==n&&null!==this._whereclause&&(o=(0,l.kg)(this._whereclause,n));const u=await this._parent._stat(e,t,i,r,o,s,a);return!1===u.calculated?null===n&&""===i&&null===r?this._manualStat(e,t,s,a):{calculated:!1}:u}async _canDoAggregates(e,t,i,r,n){return null===this._whereClauseFunction&&(null!==n?null!==this._whereclause&&(n=(0,l.kg)(this._whereclause,n)):n=this._whereclause,null!==this._parent&&this._parent._canDoAggregates(e,t,i,r,n))}async _getAggregatePagesDataSourceDefinition(e,t,i,n,s,a,o){if(null===this._parent)throw new r.d("NeverReach");return null!==s?null!==this._whereclause&&(s=(0,l.kg)(this._whereclause,s)):s=this._whereclause,this._parent._getAggregatePagesDataSourceDefinition(e,t,i,n,s,a,o)}static registerAction(){n.A._featuresetFunctions.filter=function(e){if("function"==typeof e)return new d({parentfeatureset:this,whereclause:e});let t=null;return e instanceof u.A&&(t=e),new d({parentfeatureset:this,whereclause:t})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}},36708:(e,t,i)=>{i.d(t,{C_:()=>h,OH:()=>y,Vh:()=>g,on:()=>d,pc:()=>_,wB:()=>o,z7:()=>u});var r=i(37955),n=i(36563),s=i(97768),a=i(74887),l=i(14012);function o(e,t,i={}){return c(e,t,i,f)}function u(e,t,i={}){return c(e,t,i,p)}function c(e,t,i={},r){let n=null;const a=i.once?(e,i)=>{r(e)&&((0,s.xt)(n),t(e,i))}:(e,i)=>{r(e)&&t(e,i)};if(n=(0,l.Cn)(e,a,i.sync,i.equals),i.initial){const t=e();a(t,t)}return n}function d(e,t,i,a={}){let l=null,u=null,c=null;function d(){l&&u&&(u.remove(),a.onListenerRemove?.(l),l=null,u=null)}function h(e){a.once&&a.once&&(0,s.xt)(c),i(e)}const f=o(e,(e,i)=>{d(),(0,r.wb)(e)&&(l=e,u=(0,r.on)(e,t,h),a.onListenerAdd?.(e))},{sync:a.sync,initial:!0});return c=(0,n.hA)(()=>{f.remove(),d()}),c}function h(e,t){return function(e,t,i){if((0,a.G4)(i))return Promise.reject((0,a.NK)());const r=e();if(t?.(r))return Promise.resolve(r);let l=null;function o(){l=(0,s.xt)(l)}return new Promise((r,s)=>{l=(0,n.vE)([(0,a.u7)(i,()=>{o(),s((0,a.NK)())}),c(e,e=>{o(),r(e)},{sync:!1,once:!0},t??f)])})}(e,p,t)}function f(e){return!0}function p(e){return!!e}i(80559);const y={sync:!0},g={initial:!0},_={sync:!0,initial:!0}},37539:(e,t,i)=>{i.d(t,{pO:()=>y,jd:()=>h,Tp:()=>f,w5:()=>d});var r=i(34727),n=i(83047),s=i(73941),a=i(79258);Math.PI;const l=a.$O.radius,o=a.$O.eccentricitySquared,u={a1:l*o,a2:l*o*l*o,a3:l*o*o/2,a4:l*o*l*o*2.5,a5:l*o+l*o*o/2,a6:1-o};a.$O.radius,a.$O.flattening,a.Sw.radius,a.Sw.flattening,a.sH.radius,a.sH.flattening,a.sH.radius;var c=i(21325);const d={2:{5:y,7:null,9:null,10:y,1:S,6:null,8:null,0:null,3:_,11:m,2:y,4:x},5:{5:y,7:null,9:null,10:y,1:S,6:null,8:null,0:null,3:_,11:m,2:y,4:x},7:{5:null,7:y,9:null,10:y,1:null,6:I,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:y,10:y,1:null,6:null,8:F,0:null,3:null,11:null,2:null,4:null},3:{5:g,7:null,9:null,10:g,1:function(e,t,i,r){const n=e[t]/N,s=P-2*Math.atan(Math.exp(-e[t+1]/N)),a=N+e[t+2],l=Math.cos(s)*a;i[r]=Math.cos(n)*l,i[r+1]=Math.sin(n)*l,i[r+2]=Math.sin(s)*a},6:null,8:null,0:null,3:y,11:function(e,t,i,r){g(e,t,i,r),m(i,r,i,r)},2:g,4:function(e,t,i,r){g(e,t,i,r),x(i,r,i,r)}},4:{5:R,7:null,9:null,10:R,1:function(e,t,i,r){R(e,t,i,r),S(i,r,i,r)},6:null,8:null,0:null,3:function(e,t,i,r){R(e,t,i,r),_(i,r,i,r)},11:function(e,t,i,r){R(e,t,i,r),m(i,r,i,r)},2:R,4:y},1:{5:C,7:null,9:null,10:C,1:y,6:null,8:null,0:null,3:function(e,t,i,r){C(e,t,i,r),_(i,r,i,r)},11:function(e,t,i,r){C(e,t,i,r),m(i,r,i,r)},2:C,4:function(e,t,i,r){C(e,t,i,r),x(i,r,i,r)}},6:{5:null,7:T,9:null,10:T,1:null,6:y,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:A,10:A,1:null,6:null,8:y,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:y,3:null,11:null,2:null,4:null},10:{5:y,7:y,9:y,10:y,1:S,6:I,8:F,0:null,3:_,11:m,2:y,4:x},11:{5:w,7:null,9:null,10:w,1:function(e,t,i,r){w(e,t,i,r),S(i,r,i,r)},6:null,8:null,0:null,3:function(e,t,i,r){w(e,t,i,r),_(i,r,i,r)},11:y,2:w,4:function(e,t,i,r){w(e,t,i,r),x(i,r,i,r)}}};function h(e,t){return f(e,t)?.projector}function f(e,t){if(null==e||null==t)return null;if(k.source.spatialReference===e&&k.dest.spatialReference===t)return k;const i=p(e,k.source),r=p(t,k.dest);return 0===i&&0===r?(0,c.aI)(e,t)?k.projector=y:k.projector=null:k.projector=d[i][r],k}function p(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,n.GA)(e,1)),(0,s.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===s.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===s.FY.wkt?t.spatialReferenceId=6:e.wkt===s.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function y(e,t,i,r){e!==i&&(i[r++]=e[t++],i[r++]=e[t++],i[r]=e[t])}function g(e,t,i,r){i[r]=L*(e[t]/N),i[r+1]=L*(P-2*Math.atan(Math.exp(-e[t+1]/N))),i[r+2]=e[t+2]}function _(e,t,i,n){!function(e,t,i,n,s){const a=.4999999*Math.PI,l=(0,r.qE)(D*e[t+1],-a,a),o=Math.sin(l);i[n++]=D*e[t]*s.radius,i[n++]=s.halfSemiMajorAxis*Math.log((1+o)/(1-o)),i[n]=e[t+2]}(e,t,i,n,a.$O)}function m(e,t,i,r){i[r]=e[t]*M,i[r+1]=e[t+1]*M,i[r+2]=e[t+2]}function w(e,t,i,r){i[r]=e[t]*E,i[r+1]=e[t+1]*E,i[r+2]=e[t+2]}function b(e,t,i,r,n){const s=n+e[t+2],a=D*e[t+1],l=D*e[t],o=Math.cos(a)*s;i[r]=Math.cos(l)*o,i[r+1]=Math.sin(l)*o,i[r+2]=Math.sin(a)*s}function F(e,t,i,r){b(e,t,i,r,a.Sw.radius)}function I(e,t,i,r){b(e,t,i,r,a.sH.radius)}function S(e,t,i,r){b(e,t,i,r,a.$O.radius)}function v(e,t,i,n,s){const a=e[t],l=e[t+1],o=e[t+2],u=Math.sqrt(a*a+l*l+o*o),c=(0,r.YN)(o/(0===u?1:u)),d=Math.atan2(l,a);i[n++]=L*d,i[n++]=L*c,i[n]=u-s}function A(e,t,i,r){v(e,t,i,r,a.Sw.radius)}function T(e,t,i,r){v(e,t,i,r,a.sH.radius)}function C(e,t,i,r){v(e,t,i,r,a.$O.radius)}function x(e,t,i,r){!function(e,t,i,r,n){const s=D*e[t],a=D*e[t+1],l=e[t+2],o=Math.sin(a),u=Math.cos(a),c=n.radius/Math.sqrt(1-n.eccentricitySquared*o*o);i[r++]=(c+l)*u*Math.cos(s),i[r++]=(c+l)*u*Math.sin(s),i[r++]=(c*(1-n.eccentricitySquared)+l)*o}(e,t,i,r,a.$O)}function R(e,t,i,r){const n=u,s=e[t],l=e[t+1],o=e[t+2];let c,d,h,f,p,y,g,_,m,w,b,F,I,S,v,A,T,C,x,R,k;c=Math.abs(o),d=s*s+l*l,h=Math.sqrt(d),f=d+o*o,p=Math.sqrt(f),R=Math.atan2(l,s),y=o*o/f,g=d/f,S=n.a2/p,v=n.a3-n.a4/p,g>.3?(_=c/p*(1+g*(n.a1+S+y*v)/p),x=Math.asin(_),w=_*_,m=Math.sqrt(1-w)):(m=h/p*(1-y*(n.a5-S-g*v)/p),x=Math.acos(m),w=1-m*m,_=Math.sqrt(w)),b=1-a.$O.eccentricitySquared*w,F=a.$O.radius/Math.sqrt(b),I=n.a6*F,S=h-F*m,v=c-I*_,T=m*S+_*v,A=m*v-_*S,C=A/(I/b+T),x+=C,k=T+A*C/2,o<0&&(x=-x),i[r++]=L*R,i[r++]=L*x,i[r]=k}const k={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:y},D=(0,r.kU)(1),L=(0,r.KJ)(1),P=.5*Math.PI,N=a.$O.radius,M=N*Math.PI/180,E=180/(N*Math.PI)},40334:(e,t,i)=>{i.r(t),i.d(t,{constructAssociationMetaDataFeatureSetFromUrl:()=>re,constructFeatureSet:()=>te,constructFeatureSetFromPortalItem:()=>ce,constructFeatureSetFromRelationship:()=>ne,constructFeatureSetFromUrl:()=>ee,convertToFeatureSet:()=>ue,createFeatureSetCollectionFromMap:()=>le,createFeatureSetCollectionFromService:()=>oe,initialiseMetaDataCache:()=>H});var r=i(78888);class n{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,i){this._layerById[t]=i,this._layerByName[e]=i}async featureSetByName(e,t=!0,i=["*"]){return void 0===this._layerByName[e]?null:this._layerByName[e]}async featureSetById(e,t=!0,i=["*"]){return void 0===this._layerById[e]?null:this._layerById[e]}castToText(e=!1){return"object, FeatureSetCollection"}}var s=i(78878),a=i(35704),l=i(52106),o=i(59534),u=i(68423),c=i(86691),d=i(87449),h=i(11221),f=i(89169),p=i(87594),y=i(33325),g=i(80609),_=i(1262),m=i(88368);class w{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new w;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,r){const n=new w;n.field=e;const s=m.A.create(t,{fieldsIndex:i,timeZone:r}),a=function(e){if("function"===e.parseTree.type){if(0===e.parseTree.args.value.length)return{name:e.parseTree.name,expr:null};if(e.parseTree.args.value.length>1)throw new _.L("MissingStatisticParameters");const t=m.A.create((0,g.Mi)(e.parseTree.args.value[0],0,e.parameters),{fieldsIndex:e.fieldsIndex,timeZone:e.timeZone,currentUser:e.currentUser});return{name:e.parseTree.name,expr:t}}return null}(s);if(null===a)throw new _.L("UnsupportedSqlFunction",{function:""});const l=a.name.toUpperCase().trim();if("MIN"===l){if(n.typeofstat="MIN",n.workingexpr=a.expr,null===s)throw new _.L("InvalidFunctionParameters",{function:"min"})}else if("MAX"===l){if(n.typeofstat="MAX",n.workingexpr=a.expr,null===s)throw new _.L("InvalidFunctionParameters",{function:"max"})}else if("COUNT"===l)n.typeofstat="COUNT",n.workingexpr=a.expr;else if("STDEV"===l){if(n.typeofstat="STDDEV",n.workingexpr=a.expr,null===s)throw new _.L("InvalidFunctionParameters",{function:"stdev"})}else if("SUM"===l){if(n.typeofstat="SUM",n.workingexpr=a.expr,null===s)throw new _.L("InvalidFunctionParameters",{function:"sum"})}else if("MEAN"===l){if(n.typeofstat="AVG",n.workingexpr=a.expr,null===s)throw new _.L("InvalidFunctionParameters",{function:l})}else if("AVG"===l){if(n.typeofstat="AVG",n.workingexpr=a.expr,null===s)throw new _.L("InvalidFunctionParameters",{function:"avg"})}else{if("VAR"!==l)throw new _.L("UnsupportedSqlFunction",{function:l});if(n.typeofstat="VAR",n.workingexpr=a.expr,null===s)throw new _.L("InvalidFunctionParameters",{function:"var"})}return n}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}}var b=i(80200),F=i(74639),I=i(44729),S=i(55612),v=i(15032),A=i(16930),T=i(20437),C=i(95466);const x=new o.b(["MIN","MAX","VAR","STDDEV","COUNT","SUM","AVG"],[["VARIANCE","VAR"],["AVERAGE","AVG"],["MEAN","AVG"],["STDEV","STDDEV"]]);class R extends h.A{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(null===this._wset){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return 0}_nextUniqueName(e){for(;1===e["T"+this._uniqueIds.toString()];)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const r=this._parent?this._parent.getFieldsIndex():new C.A([]);for(this.objectIdField="ROW__ID",this.globalIdField="";!1===t;){let e=!1;for(let t=0;t<this._config.groupbyfields.length;t++)if(this._config.groupbyfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}if(!1===e)for(let t=0;t<this._config.statsfields.length;t++)if(this._config.statsfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}!1===e?t=!0:(this.objectIdField="ROW__ID"+i.toString(),i++)}for(const e of this._config.statsfields){const t=new w;t.field=e.name,t.tofieldname=e.name,t.workingexpr=e.expression instanceof m.A?e.expression:m.A.create(e.expression,{fieldsIndex:r,timeZone:this.dateFieldsTimeZoneDefaultUTC}),t.typeofstat=x.lookup(e.statistic)??"COUNT",this._decodedStatsfield.push(t)}this._decodedGroupbyfield=[];for(const e of this._config.groupbyfields){const t={name:e.name,singlefield:null,tofieldname:e.name,expression:e.expression instanceof m.A?e.expression:m.A.create(e.expression,{fieldsIndex:r,timeZone:this.dateFieldsTimeZoneDefaultUTC}),sqlType:null};this._decodedGroupbyfield.push(t)}if(null!==this._parent){this.geometryType=this._parent.geometryType,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField="";for(const t of this._parent.fields)e[t.name.toUpperCase()]=1;this.types=null,this.subtypes=null,this.subtypeField=""}else this.geometryType=y.ik.point,this.typeIdField="",this.types=null,this.subtypes=null,this.subtypeField="",this.spatialReference=new A.A({wkid:4326});this.fields=[];const n=new w;n.field=this._nextUniqueName(e),n.tofieldname=this.objectIdField,n.workingexpr=m.A.create(this._parent.objectIdField,{fieldsIndex:this._parent.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),n.typeofstat="MIN",this._decodedStatsfield.push(n);for(const t of this._decodedGroupbyfield){const i=new T.A;if(t.name=this._nextUniqueName(e),i.name=t.tofieldname,i.alias=i.name,(0,g.DA)(t.expression)){const e=this._parent.getField((0,g.YY)(t.expression,0));if(!e)throw new d.d("AggregationFieldNotFound");t.name=e.name,t.singlefield=e.name,this.phsyicalgroupbyfields.push(e.name),i.type=e.type,t.sqlType=e.type}else{i.type=this._convertToEsriFieldType((0,g.IY)(t.expression,this._parent.fields));const e=new T.A;e.name=t.name,e.alias=e.name,this.phsyicalgroupbyfields.push(t.name),this._adaptedFields.push(new u.Gr(e,t.expression)),this._candosimplegroupby=!1,t.sqlType=i.type}this.fields.push(i)}if(this._adaptedFields.length>0)for(const e of this._parent.fields)this._adaptedFields.push(new u.IO(e));for(let t=0;t<this._decodedStatsfield.length;t++){const i=new T.A;let r=null;const n=this._decodedStatsfield[t];n.field=this._nextUniqueName(e),n.tofieldname===this.objectIdField&&(this._internalObjectIdField=n.field),i.name=n.tofieldname,i.alias=i.name;const s=null!==n.workingexpr&&(0,g.DA)(n.workingexpr)?(0,g.YY)(n.workingexpr,0):"";switch(this._decodedStatsfield[t].typeofstat){case"SUM":if(""!==s){if(r=this._parent.getField(s),!r)throw new d.d("AggregationFieldNotFound");i.type=r.type}else i.type="double";break;case"MIN":case"MAX":if(""!==s){if(r=this._parent.getField(s),!r)throw new d.d("AggregationFieldNotFound");i.type=r.type}else i.type="double";break;case"COUNT":i.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==s&&(r=this._parent.getField(s),!r))throw new d.d("AggregationFieldNotFound");i.type="double"}this.fields.push(i)}}async _canDoAggregates(){return!1}async _getFeatures(e,t,i,r){-1!==t&&this._featureCache[t];const n=this._maxQuery;return!0===this._checkIfNeedToExpandKnownPage(e,n)?(await this._expandPagedSet(e,n,0,0,r),this._getFeatures(e,t,i,r)):"success"}async _getFilteredSet(e,t,i,r,n){if(""!==e)return new f.A([],[],!0,null);let s=null;const l={ordered:!1,nowhereclause:!1};if(await this._ensureLoaded(),null!==i)for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===(0,g.Ju)(i,this._decodedStatsfield[e].tofieldname)){l.nowhereclause=!0,i=null;break}if(null!==r){l.ordered=!0;for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===r.scanForField(this._decodedStatsfield[e].tofieldname)){r=null,l.ordered=!1;break}if(null!==r)for(const e of this._decodedGroupbyfield)if(null===e.singlefield&&!0===r.scanForField(e.tofieldname)){r=null,l.ordered=!1;break}}if(!1!==this._candosimplegroupby&&await this._parent._canDoAggregates(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,null)){let e=null;i&&(e=this._reformulateWhereClauseWithoutGroupByFields(i));let t=null;r&&(t=this._reformulateOrderClauseWithoutGroupByFields(r));const a=await this._parent._getAggregatePagesDataSourceDefinition(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,e,t,this._internalObjectIdField);return this._checkCancelled(n),s=!0===l.nowhereclause?new f.A(a._candidates.slice().concat(a._known.slice()),[],!0===l.ordered&&a._ordered,this._clonePageDefinition(a.pagesDefinition)):new f.A(a._candidates.slice(),a._known.slice(),!0===l.ordered&&a._ordered,this._clonePageDefinition(a.pagesDefinition)),s}let o=this._parent;if(this._adaptedFields.length>0&&(o=new u.a({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),!0===l.nowhereclause)s=new f.A(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new c.A({parentfeatureset:o,orderbyclause:new p.A(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let e=o;if(null!==i){let t=null;i&&(t=this._reformulateWhereClauseWithoutGroupByFields(i)),e=new a.A({parentfeatureset:e,whereclause:t})}s=new f.A(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new c.A({parentfeatureset:e,orderbyclause:new p.A(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return s}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=(0,g.bD)(e,t.tofieldname,(0,g.YY)(t.workingexpr,0),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=(0,g.bD)(e,t.tofieldname,(0,g.YY)(t.expression,0),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const e of this._decodedGroupbyfield)e.tofieldname!==e.name&&t.push({field:e.tofieldname,newfield:e.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return null===e?null:!0===e.aggregatefeaturesetpagedefinition?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,r,n){return this._expandPagedSetFeatureSet(e,t,i,r,n)}async _getPhysicalPage(e,t,i){if(!0===e.pagesDefinition.aggregatefeaturesetpagedefinition)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const r=await this._getAgregagtePhysicalPage(e,t,i);for(const e of r){const t={geometry:e.geometry,attributes:{}},i={};for(const t in e.attributes)i[t.toLowerCase()]=e.attributes[t];for(const e of this._decodedGroupbyfield)t.attributes[e.tofieldname]=i[e.name.toLowerCase()];for(const e of this._decodedStatsfield)t.attributes[e.tofieldname]=i[e.field.toLowerCase()];this._featureCache[t.attributes[this.objectIdField]]=new l.A(t)}return r.length}_sequentialGetPhysicalItem(e,t,i,r){return new Promise((n,s)=>{null===e.pagesDefinition.internal.iterator&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),!0===e.pagesDefinition.internal.fullyResolved||0===t?n(r.length):this._nextAggregateItem(e,t,i,r,s=>{null===s?n(r.length):(t-=1,n(this._sequentialGetPhysicalItem(e,t,i,r)))},s)})}_nextAggregateItem(e,t,i,r,n,a){try{(0,s.a1)(e.pagesDefinition.internal.iterator.next()).then(s=>{if(null===s)if(null!==e.pagesDefinition.internal.workingItem){const t=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.push(t),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(t.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,n(null)}else e.pagesDefinition.internal.fullyResolved=!0,n(null);else{const l=this._generateAggregateHash(s);if(null===e.pagesDefinition.internal.workingItem)e.pagesDefinition.internal.workingItem={features:[s],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const i=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(i),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(i.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[s],id:l},void n(i)}e.pagesDefinition.internal.workingItem.features.push(s)}this._nextAggregateItem(e,t,i,r,n,a)}},a)}catch(e){a(e)}}_calculateFieldStat(e,t,i){const r=[];for(const i of e.features)if(null!==t.workingexpr){const e=t.workingexpr.calculateValue(i);null!==e&&(e instanceof I.n||e instanceof v.k?r.push(e.toNumber()):e instanceof S.g?r.push(e.toMilliseconds()):r.push(e))}else r.push(null);i.attributes[t.tofieldname]=(0,F.s)(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const i of this._decodedGroupbyfield){const r=i.singlefield?e.features[0].attributes[i.singlefield]:m.A.convertValueToStorageFormat(i.expression.calculateValue(e.features[0]),i.sqlType);t.attributes[i.tofieldname]=r}for(const i of this._decodedStatsfield)this._calculateFieldStat(e,i,t);const i=[];for(let r=0;r<this._decodedStatsfield.length;r++)i.push(this._calculateFieldStat(e,this._decodedStatsfield[r],t));return this._featureCache[t.attributes[this.objectIdField]]=new l.A({attributes:t.attributes,geometry:t.geometry}),t}_generateAggregateHash(e){let t="";for(const i of this._decodedGroupbyfield){const r=i.singlefield?e.attributes[i.singlefield]:i.expression.calculateValue(e);t+=null==r?":":":"+r.toString()}return(0,b.d)(t,b.T.String)}async _stat(){return{calculated:!1}}async getFeatureByObjectId(){return null}static registerAction(){h.A._featuresetFunctions.groupby=function(e,t){return new R({parentfeatureset:this,groupbyfields:e,statsfields:t})}}}var k=i(54784),D=i(54461),L=i(70333),P=i(61454),N=i(66395),M=i(50145),E=i(4576),O=i(39516),j=i(65864),G=i(21325),q=i(29784),B=i(54546),U=i(61956),Z=i(7562);class W extends h.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return y.gO}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+(0,y.JB)(e.toJSON());return(0,b.d)(t,b.T.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer?.capabilities?.data?.supportsZ,this.hasM=!0===this._layer?.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=1,null!=e&&e>=10.61&&(this._databaseType=0)):null!=e&&(e>=10.5&&(this._databaseType=1,this._requestStandardised=!0),e>=10.61&&(this._databaseType=0))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}_isInFeatureSet(){return 0}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new U.A;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch(e){return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?"subtype-group"===this._layer.type&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const i="execute"===t?this._layer.queryFeatures.bind(this._layer):"executeForCount"===t?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let r=null;if(this.recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(t),null===r&&(r=i(e),this.recentlyUsedQueries.addToCache(t,r),r=r.catch(e=>{throw this.recentlyUsedQueries?.removeFromCache(t),e}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===r&&(r=i(e)),r}async _getFilteredSet(e,t,i,r,n){const s=await this.databaseType();if(this.isTable()&&t&&null!==e&&""!==e)return new f.A([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,r,n);let a="",l=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(a=r.constructClause(),l=!0);const o=this._createQuery();o.where=(0,O.mA)(o.where,null===i?null===t?"1=1":"":(0,g.YY)(i,s)),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=""!==a?a.split(","):null,o.geometry=null===t?null:t,o.relationParameter=this._makeRelationshipParam(e);let u=await this.executeQuery(o,"executeForIds");return null===u&&(u=[]),this._checkCancelled(n),new f.A([],u,l,null)}_expandPagedSet(e,t,i,r,n){return this._expandPagedSetFeatureSet(e,t,i,r,n)}async _getFilteredSetUsingPaging(e,t,i,r,n){let s="",a=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(s=r.constructClause(),a=!0);const l=await this.databaseType(),o=null===i?null===t?"1=1":"":(0,g.YY)(i,l);let u=this._maxQueryRate();const c=this._layer.capabilities?.query.maxRecordCount;null!=c&&c<u&&(u=c);let d=null;if(!0===this._pageJustIds)d=new f.A([],["GETPAGES"],a,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:this._layer.objectIdField,resultRecordCount:u,resultOffset:0,geometry:null===t?null:t,where:o,orderByFields:s,returnGeometry:!1,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}});else{let i=!0;!0===this._removeGeometry&&(i=!1);const r=this._overrideFields??this._fieldsIncludingObjectId(["*"]);d=new f.A([],["GETPAGES"],a,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:r.join(","),resultRecordCount:u,resultOffset:0,geometry:null===t?null:t,where:o,orderByFields:s,returnGeometry:i,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}})}return await this._expandPagedSet(d,u,0,1,n),d}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,n=r,s=e.pagesDefinition.internal.lastPage,a=this._createQuery();a.spatialRelationship=e.pagesDefinition.spatialRel,a.relationParameter=e.pagesDefinition.relationParam,a.outFields=e.pagesDefinition.outFields.split(","),a.num=e.pagesDefinition.resultRecordCount,a.start=e.pagesDefinition.internal.lastPage,a.geometry=e.pagesDefinition.geometry,a.where=(0,O.mA)(a.where,e.pagesDefinition.where),a.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,a.returnGeometry=e.pagesDefinition.returnGeometry,a.outSpatialReference=this.spatialReference;const l=await this.executeQuery(a,"execute");if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==s)return"done";const o=this._layer.objectIdField;for(let t=0;t<l.features.length;t++)e.pagesDefinition.internal.set[n+t]=l.features[t].attributes[o];if(!1===this._pageJustIds)for(let e=0;e<l.features.length;e++)this._featureCache[l.features[e].attributes[o]]=l.features[e];return(void 0===l.exceededTransferLimit&&l.features.length!==e.pagesDefinition.resultRecordCount||!1===l.exceededTransferLimit)&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=r+l.features.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,"done"}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let i=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}async _getFeatures(e,t,i,r){const n=[];if(-1!==t&&void 0===this._featureCache[t]&&n.push(t),!0===this._checkIfNeedToExpandKnownPage(e,this._maxProcessingRate()))return await this._expandPagedSet(e,this._maxProcessingRate(),0,0,r),this._getFeatures(e,t,i,r);let s=0;for(let r=e._lastFetchedIndex;r<e._known.length;r++){if(e._lastFetchedIndex+=1,s++,void 0===this._featureCache[e._known[r]]){let i=!1;if(null!==this._layer._mode&&void 0!==this._layer._mode){const t=this._layer._mode;if(void 0!==t._featureMap[e._known[r]]){const n=t._featureMap[e._known[r]];null!==n&&(i=!0,this._featureCache[e._known[r]]=n)}}if(!1===i&&(e._known[r]!==t&&n.push(e._known[r]),n.length>=this._maxProcessingRate()-1))break}if(s>=i&&0===n.length)break}if(0===n.length)return"success";const a=this._createQuery();a.objectIds=n,a.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),a.returnGeometry=!0,!0===this._removeGeometry&&(a.returnGeometry=!1),a.outSpatialReference=this.spatialReference;const l=await this.executeQuery(a,"execute");if(this._checkCancelled(r),void 0!==l.error)throw new d.d("RequestFailed",{reason:l.error});const o=this._layer.objectIdField;for(let e=0;e<l.features.length;e++)this._featureCache[l.features[e].attributes[o]]=l.features[e];return"success"}async _getDistinctPages(e,t,i,r,n,s,a,l,o){await this._ensureLoaded();const u=await this.databaseType();let c=i.parseTree.column;const h=this._layer.fields??[];for(let e=0;e<h.length;e++)if(h[e].name.toLowerCase()===c.toLowerCase()){c=h[e].name;break}const f=this._createQuery();f.where=(0,O.mA)(f.where,null===s?null===n?"1=1":"":(0,g.YY)(s,u)),f.spatialRelationship=this._makeRelationshipEnum(r),f.relationParameter=this._makeRelationshipParam(r),f.geometry=null===n?null:n,f.returnDistinctValues=!0,f.returnGeometry=!1,f.outFields=[c];const p=await this.executeQuery(f,"execute");if(this._checkCancelled(o),!p.hasOwnProperty("features"))throw new d.d("InvalidStatResponse");let y=!1;for(let e=0;e<h.length;e++)if(h[e].name===c){"date"===h[e].type&&(y=!0);break}for(let e=0;e<p.features.length;e++){if(y){const t=p.features[e].attributes[c];null!==t?l.push(new Date(t)):l.push(t)}else l.push(p.features[e].attributes[c]);if(l.length>=a)break}return 0===p.features.length?l:p.features.length===this._layer.capabilities?.query.maxRecordCount&&l.length<a?{calculated:!0,result:await this._getDistinctPages(e+p.features.length,t,i,r,n,s,a,l,o)}:l}async _distinctStat(e,t,i,r,n,s,a){return{calculated:!0,result:await this._getDistinctPages(0,e,t,i,r,n,s,[],a)}}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType||"esriGeometryNull"===this._layer.geometryType}async _countstat(e,t,i,r){const n=await this.databaseType();if(this.isTable()&&i&&null!==t&&""!==t)return{calculated:!0,result:0};const s=this._createQuery();return s.where=(0,O.mA)(s.where,null===r?null===i?"1=1":"":(0,g.YY)(r,n)),s.spatialRelationship=this._makeRelationshipEnum(t),s.relationParameter=this._makeRelationshipParam(t),s.geometry=null===i?null:i,s.returnGeometry=!1,{calculated:!0,result:await this.executeQuery(s,"executeForCount")}}async _stats(e,t,i,r,n,s,a){await this._ensureLoaded();const l=this._layer.capabilities?.query,o=!!l?.supportsSqlExpression,u=!!l?.supportsStatistics,c=!!l?.supportsDistinct;if("count"===e)return c?this._countstat(e,i,r,n):{calculated:!1};if(!1===u||!1===(0,g.DA)(t)&&!1===o||!1===t.isStandardized)return""!==i||null!==n?{calculated:!1}:this._manualStat(e,t,s,a);if("distinct"===e)return!1===c?""!==i||null!==n?{calculated:!1}:this._manualStat(e,t,s,a):this._distinctStat(e,t,i,r,n,s,a);const h=await this.databaseType();if(this.isTable()&&r&&null!==i&&""!==i)return{calculated:!0,result:null};const f=this._createQuery();f.where=(0,O.mA)(f.where,null===n?null===r?"1=1":"":(0,g.YY)(n,h)),f.spatialRelationship=this._makeRelationshipEnum(i),f.relationParameter=this._makeRelationshipParam(i),f.geometry=null===r?null:r;const p=new Z.A;p.statisticType=(0,M.Dp)(e),p.onStatisticField=(0,g.YY)(t,h),p.outStatisticFieldName="ARCADE_STAT_RESULT",f.returnGeometry=!1;let y="ARCADE_STAT_RESULT";f.outStatistics=[p];const _=await this.executeQuery(f,"execute");if(!_.hasOwnProperty("features")||0===_.features.length)throw new d.d("InvalidStatResponse");let m=!1;const w=_.fields??[];for(let e=0;e<w.length;e++)if("ARCADE_STAT_RESULT"===w[e].name.toUpperCase()){y=w[e].name,"date"===w[e].type&&(m=!0);break}if(m){let e=_.features[0].attributes[y];return null!==e&&(e=new Date(_.features[0].attributes[y])),{calculated:!0,result:e}}return{calculated:!0,result:_.features[0].attributes[y]}}_stat(e,t,i,r,n,s,a){return this._stats(e,t,i,r,n,s,a)}async _canDoAggregates(e,t){await this._ensureLoaded();let i=!1;const r=this._layer.capabilities?.query,n=!0===r?.supportsSqlExpression;if(null!=r&&!0===r.supportsStatistics&&!0===r.supportsOrderBy&&(i=!0),i)for(let e=0;e<t.length-1;e++)(!1===t[e].workingexpr?.isStandardized||!1===(0,g.DA)(t[e].workingexpr)&&!1===n)&&(i=!1);return!1!==i}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _getAggregatePagesDataSourceDefinition(e,t,i,r,n,s,a){await this._ensureLoaded();const l=await this.databaseType();let o=null;if(!this._layer.capabilities.query.supportsPaginationOnAggregatedQueries){const t=this.getFieldsIndex();o={keyFields:e.map((e,i)=>({name:t.normalizeFieldName(e)??e,asc:null==s||1===s._directions[i]}))}}let u="",c=!1;null!=s&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(null==o||(0,E.MJ)(e,0,e.length,s._fields,0,Math.min(s._fields.length,e.length),(e,t)=>e.toLowerCase()===t.toLowerCase()))&&(u=s.constructClause(),c=!0),""===u&&(u=e.join(","));const d=[];for(let e=0;e<t.length;e++){const i=new Z.A;i.onStatisticField=null!==t[e].workingexpr?(0,g.YY)(t[e].workingexpr,l):"",i.outStatisticFieldName=t[e].field,i.statisticType=t[e].toStatisticsName(),d.push(i)}let h=this._maxQueryRate();const p=this._layer.capabilities?.query.maxRecordCount;null!=p&&p<h&&(h=p);const y=null===n?null===r?"1=1":"":(0,g.YY)(n,l);return new f.A([],["GETPAGES"],c,{groupbypage:!0,spatialRel:this._makeRelationshipEnum(i),relationParam:this._makeRelationshipParam(i),outFields:["*"],useOIDpagination:!1,generatedOid:a,resultRecordCount:h,resultOffset:0,groupByFieldsForStatistics:e,outStatistics:d,geometry:null===r?null:r,where:y,orderByFields:u,returnGeometry:!1,returnIdsOnly:!1,internal:{lastMaxId:-1,set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1,keysetPagination:o}})}async _getAgregagtePhysicalPage(e,t,i){let r=e.pagesDefinition.where;if(!0===e.pagesDefinition.useOIDpagination&&(r=(0,O.mA)(r,e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString())),null!=e.pagesDefinition.internal.keysetPagination?.clause){if(!this._layer.capabilities.query.supportsOrderBy)throw new d.d("NotImplemented");r=(0,O.mA)(r,(0,g.YY)(e.pagesDefinition.internal.keysetPagination.clause,await this.databaseType()))}const n=e.pagesDefinition.internal.lastRetrieved,s=n,a=e.pagesDefinition.internal.lastPage,o=this._createQuery();if(o.where=(0,O.mA)(o.where,r),o.spatialRelationship=e.pagesDefinition.spatialRel,o.relationParameter=e.pagesDefinition.relationParam,o.outFields=e.pagesDefinition.outFields,o.outStatistics=e.pagesDefinition.outStatistics,o.geometry=e.pagesDefinition.geometry,o.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,o.num=e.pagesDefinition.resultRecordCount,o.start=e.pagesDefinition.internal.lastPage,o.returnGeometry=e.pagesDefinition.returnGeometry,o.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&o.geometry&&o.spatialRelationship)return[];const u=await this.executeQuery(o,"execute");if(this._checkCancelled(i),!u.hasOwnProperty("features"))throw new d.d("InvalidStatResponse");const c=[];if(e.pagesDefinition.internal.lastPage!==a)return[];u.features.length>0&&void 0===u.features[0].attributes[e.pagesDefinition.generatedOid]&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let t=0;t<u.features.length;t++)e.pagesDefinition.internal.set[s+t]=u.features[t].attributes[e.pagesDefinition.generatedOid];for(let e=0;e<u.features.length;e++)c.push(new l.A({attributes:u.features[e].attributes,geometry:null}));return e.pagesDefinition.internal.keysetPagination?0!==u.features.length&&u.exceededTransferLimit?function(e,t){null==e.clause&&(e.clause=function(e){if(0===e.length)throw new d.d("NeverReach");const t=[];for(let i=0;i<e.length;i++){const r=e[i],n=[`"${r.name.replaceAll('"','""')}" ${r.asc?">":"<"} @last_${i}`];for(let t=0;t<i;t++){const i=e[t];n.push(`"${i.name.replaceAll('"','""')}" = @last_${t}`)}t.push(n.join(" AND "))}const i=t.join(" OR ");return m.A.create(i)}(e.keyFields));for(let i=0;i<e.keyFields.length;i++){const r=e.keyFields[i].name;e.clause.parameters[`last_${i}`]=t.attributes[r]}}(e.pagesDefinition.internal.keysetPagination,c.at(-1)):e.pagesDefinition.internal.fullyResolved=!0:!0===e.pagesDefinition.useOIDpagination?0===u.features.length?e.pagesDefinition.internal.fullyResolved=!0:e.pagesDefinition.internal.lastMaxId=u.features[u.features.length-1].attributes[e.pagesDefinition.generatedOid]:(void 0===u.exceededTransferLimit&&u.features.length!==e.pagesDefinition.resultRecordCount||!1===u.exceededTransferLimit)&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=n+u.features.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,c}static create(e,t,i,r,n){const s=new q.default({url:e,outFields:null===t?["*"]:t});return new W({layer:s,spatialReference:i,lrucache:r,interceptor:n})}relationshipMetaData(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON?.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return(0,y.Qi)(this._layer.parsedUrl.path)}async queryAttachments(e,t,i,r,n){const s=this._layer;if(function(e){const t=e.capabilities;return t?.data.supportsAttachment&&t?.operations.supportsQueryAttachments}(s)){const a={objectIds:[e],returnMetadata:n};(t&&t>0||i&&i>0)&&(a.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(a.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:s,query:a,method:"attachments"});const l=await s.queryAttachments(new B.A(a)),o=[];return l&&l[e]&&l[e].forEach(t=>{const i=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+t.id.toString();let r=null;n&&t.exifInfo&&(r=N.A.convertJsonToArcade(t.exifInfo,"system",!0)),o.push(new P.A(t.id,t.name,t.contentType,t.size,i,r,t.keywords??null))}),o}return[]}async queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields?.join(","),returnGeometry:e.returnGeometry.toString()};void 0!==e.resultOffset&&null!==e.resultOffset&&(t.resultOffset=e.resultOffset.toString()),void 0!==e.resultRecordCount&&null!==e.resultRecordCount&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=(0,G.YX)(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await(0,r.A)(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const e={},t=i.data;if(t?.relatedRecordGroups){const i=t.spatialReference;for(const r of t.relatedRecordGroups){const n=r.objectId,s=[];for(const e of r.relatedRecords){e.geometry&&(e.geometry.spatialReference=i);const t=new l.A({geometry:e.geometry?(0,j.rS)(e.geometry):null,attributes:e.attributes});s.push(t)}e[n]={features:s,exceededTransferLimit:!0===t.exceededTransferLimit}}}return e}throw new d.d("InvalidRequest")}async getFeatureByObjectId(e,t){const i=this._createQuery();i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=(0,O.mA)(i.where,this.objectIdField+"="+e.toString()),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const r=await this._layer.queryFeatures(i);return 1===r.features.length?r.features[0]:null}async getIdentityUser(){await this.load();const e=L.id?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=L.id?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.slice(0,i):t,t){t+="/rest/info";try{const e=await(0,r.A)(t,{query:{f:"json"}});let i="";return e.data?.owningSystemUrl&&(i=e.data.owningSystemUrl),i}catch(e){return""}}return""}getDataSourceFeatureSet(){const e=new W({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this.fsetInfo)return this.fsetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const i=this._layer.parsedUrl?.path??null;if(i){const n=await(0,r.A)(i,{responseType:"json",query:{f:"json"}});e=n?.data?.name??null,t=n?.data?.serviceItemId??null}const n=this._layer.title&&null!==(this._layer.parent??null);return this.featureSetInfo={layerId:this._layer.layerId,layerName:""===e?null:e,itemId:""===t?null:t,serviceLayerUrl:""===i?null:i,webMapLayerId:n?this._layer.id??null:null,webMapLayerTitle:n?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}var V=i(30235),Q=i(26591);class z extends h.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._findObjectId=-1,this._requestStandardised=!1,this._removeGeometry=!1,this._overrideFields=null,this.featureObjectId=null,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,this._findObjectId=e.objectId,this.featureObjectId=e.objectId,this.relationship=e.relationship,this._relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return y.gO}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return await Promise.all([this._layer.load(),this._relatedLayer?.load()]),this._initialiseFeatureSet(),this}nativeCapabilities(){return this._relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._relatedLayer.geometryType,this.fields=this._relatedLayer.fields.slice(),this.hasZ=this._relatedLayer.hasZ,this.hasM=this._relatedLayer.hasM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType,this._requestStandardised=e.requestStandardised),this.objectIdField=this._relatedLayer.objectIdField,this.globalIdField=this._relatedLayer.globalIdField,this.hasM=this._relatedLayer.supportsM,this.hasZ=this._relatedLayer.supportsZ,this.typeIdField=this._relatedLayer.typeIdField,this.types=this._relatedLayer.types,this.subtypeField=this._relatedLayer.subtypeField,this.subtypes=this._relatedLayer.subtypes}async databaseType(){return await this._relatedLayer.databaseType(),this._databaseType=this._relatedLayer._databaseType,this._databaseType}isTable(){return this._relatedLayer.isTable()}_isInFeatureSet(){return 0}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new l.A({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,n){if(await this.databaseType(),this.isTable()&&t&&null!==e&&""!==e)return new f.A([],[],!0,null);const s=this._layer.nativeCapabilities();if(!1===s.canQueryRelated)return new f.A([],[],!0,null);if(s.capabilities?.queryRelated.supportsPagination)return this._getFilteredSetUsingPaging(e,t,i,r,n);let a="",l=!1;null!==r&&!0===s.capabilities?.queryRelated.supportsOrderBy&&(a=r.constructClause(),l=!0);const o=new Q.default;o.objectIds=[this._findObjectId];const u=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]);o.outFields=u,o.relationshipId=this.relationship.id,o.where="1=1";let c=!0;!0===this._removeGeometry&&(c=!1),o.returnGeometry=c,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=""!==a?a.split(","):null;const d=await s.source.queryRelatedFeatures(o);this._checkCancelled(n);const h=d[this._findObjectId]?d[this._findObjectId].features:[],p=[];for(let e=0;e<h.length;e++)this._featureCache[h[e].attributes[this._relatedLayer.objectIdField]]=h[e],p.push(h[e].attributes[this._relatedLayer.objectIdField]);const y=t&&null!==e&&""!==e,g=null!=i;return new f.A(y||g?p:[],y||g?[]:p,l,null)}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let i=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}async _getFilteredSetUsingPaging(e,t,i,r,n){let s="",a=!1;const l=this._layer.nativeCapabilities();null!==r&&!0===l.capabilities?.queryRelated.supportsOrderBy&&(s=r.constructClause(),a=!0),await this.databaseType();let o=this._maxQueryRate();const u=l.capabilities?.query.maxRecordCount;null!=u&&u<o&&(o=u);const c=t&&null!==e&&""!==e,d=null!=i;let h=null,p=!0;!0===this._removeGeometry&&(p=!1);const y=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]);return h=new f.A(c||d?["GETPAGES"]:[],c||d?[]:["GETPAGES"],a,{outFields:y.join(","),resultRecordCount:o,resultOffset:0,objectIds:[this._findObjectId],where:"1=1",orderByFields:s,returnGeometry:p,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(h,o,0,0,n),h}_expandPagedSet(e,t,i,r,n){return this._expandPagedSetFeatureSet(e,t,i,r,n)}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,n=r,s=e.pagesDefinition.internal.lastPage,a=this._layer.nativeCapabilities(),l=new Q.default;!0===this._requestStandardised&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const o=await a.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==s)return 0;const u=o[this._findObjectId]?o[this._findObjectId].features:[];for(let t=0;t<u.length;t++)e.pagesDefinition.internal.set[n+t]=u[t].attributes[this._relatedLayer.objectIdField];for(let e=0;e<u.length;e++)this._featureCache[u[e].attributes[this._relatedLayer.objectIdField]]=u[e];const c=!o[this._findObjectId]||!1===o[this._findObjectId].exceededTransferLimit;return u.length!==e.pagesDefinition.resultRecordCount&&c&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=r+u.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,u.length}async _getFeatures(e,t,i,r){const n=[];-1!==t&&void 0===this._featureCache[t]&&n.push(t);const s=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,s))return await this._expandPagedSet(e,s,0,0,r),this._getFeatures(e,t,i,r);let a=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(a++,a<=i&&(e._lastFetchedIndex+=1),!("GETPAGES"!==e._known[r]&&void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&n.push(e._known[r]),n.length>i)))&&!(a>=i&&0===n.length);r++);if(0===n.length)return"success";throw new d.d("MissingFeatures")}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,n,s,a){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,n){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,n){return this._relatedLayer.queryAttachments(e,t,i,r,n)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}var $=i(23732),J=i(92474),Y=i(4146),K=i(80812);function H(){null===$.A.applicationCache&&($.A.applicationCache=new $.A)}async function X(e,t,i){if($.A.applicationCache){const i=$.A.applicationCache.getLayerInfo(e);if(i){const r=await i;return new q.default({url:e,outFields:t,sourceJSON:r})}const r=new q.default({url:e,outFields:t}),n=(async()=>(await r.load(),r.sourceJSON))();if($.A.applicationCache){$.A.applicationCache.setLayerInfo(e,n);try{return await n,r}catch(t){throw $.A.applicationCache.clearLayerInfo(e),t}}return await n,r}if(null!=i){const r=i.getCachedLayerMetadata(e);if(r){const i=await r;return new q.default({url:e,outFields:t,sourceJSON:i})}const n=new q.default({url:e,outFields:t}),s=(async()=>(await n.load(),n.sourceJSON))();i.setCachedLayerMetadata(e,s);try{return await s,n}catch(t){throw i.removeCachedLayerMetadata(e,s),t}}return new q.default({url:e,outFields:t})}async function ee(e,t,i,r,n,s=null){return te(await X(e,["*"],n),t,i,r,n,s)}function te(e,t=null,i=null,r=!0,n=null,s=null){switch(e.type){case"catalog-footprint":return te(e.parent,t,i,r,n,s);case"subtype-sublayer":{const a=te(e.parent,t,i,r,n,s);return a.filter(m.A.create(e.parent.subtypeField+"="+e.subtypeCode.toString(),{fieldsIndex:e.parent.fieldsIndex,timeZone:a.dateFieldsTimeZoneDefaultUTC}))}case"csv":case"geojson":case"knowledge-graph-sublayer":case"wfs":return new V.A({layer:e,spatialReference:t,outFields:i,includeGeometry:r,lrucache:n,interceptor:s});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const a={layer:e,spatialReference:t,outFields:i,includeGeometry:r,lrucache:n,interceptor:s};return!e.url&&e.source?new V.A(a):new W(a)}default:throw new Error(`Unsupported layer type: ${e.type}`)}}async function ie(e,t){if(null!==$.A.applicationCache){const t=$.A.applicationCache.getLayerInfo(e);if(null!==t)return t}if(null!=t){const i=t.getCachedServiceMetadata(e);if(null!=i)return i}const i=(async()=>{const t=await(0,r.A)(e,{responseType:"json",query:{f:"json"}});if(t.data){const e=t.data;return e.layers||(e.layers=[]),e.tables||(e.tables=[]),e}return{layers:[],tables:[]}})();if(null!==$.A.applicationCache){$.A.applicationCache.setLayerInfo(e,i);try{return await i}catch(t){throw $.A.applicationCache.clearLayerInfo(e),t}}if(null!=t){t.setCachedServiceMetadata(e,i);try{return await i}catch(r){throw t.removeCachedServiceMetadata(e,i),r}}return i}async function re(e,t,i){const n={metadata:null,networkId:-1,unVersion:3,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map,queryelem:null,layerNameLkp:{},lkp:null},s=await ie(e,null);if(n.metadata=s,void 0!==s.controllerDatasetLayers?.utilityNetworkLayerId&&null!==s.controllerDatasetLayers.utilityNetworkLayerId){if(s.layers)for(const e of s.layers)n.layerNameLkp[e.id]=e.name;if(s.tables)for(const e of s.tables)n.layerNameLkp[e.id]=e.name;const a=s.controllerDatasetLayers.utilityNetworkLayerId;n.networkId=a;const l=await async function(e,t){const i="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==$.A.applicationCache){const e=$.A.applicationCache.getLayerInfo(i);if(null!==e)return e}const n=(async()=>{const i=await(0,r.A)(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}});if(i.data){const e=i.data;if(e.layerDataElements?.[0])return e.layerDataElements[0]}throw new d.d("DataElementsNotFound")})();if(null!==$.A.applicationCache){$.A.applicationCache.setLayerInfo(i,n);try{return await n}catch(e){throw $.A.applicationCache.clearLayerInfo(i),e}}return n}(e,a);if(l){n.queryelem=l,n.queryelem?.dataElement&&void 0!==n.queryelem.dataElement.schemaGeneration&&(n.unVersion=n.queryelem.dataElement.schemaGeneration),n.lkp={},n.queryelem.dataElement.domainNetworks||(n.queryelem.dataElement.domainNetworks=[]);for(const e of n.queryelem.dataElement.domainNetworks){for(const t of e.edgeSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:n.layerNameLkp[t.layerId]??null};n.layerIdLookup.set(e.layerId,e),n.sourceIdLookup.set(e.sourceId,e),e.className&&(n.lkp[e.className]=e)}for(const t of e.junctionSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:n.layerNameLkp[t.layerId]??null};n.layerIdLookup.set(e.layerId,e),n.sourceIdLookup.set(e.sourceId,e),e.className&&(n.lkp[e.className]=e)}}if(n.queryelem.dataElement.terminalConfigurations)for(const e of n.queryelem.dataElement.terminalConfigurations)for(const t of e.terminals)n.terminals.push({terminalId:t.terminalId,terminalName:t.terminalName});const s=await async function(e){if(null!==$.A.applicationCache){const t=$.A.applicationCache.getLayerInfo(e);if(null!==t)return t}const t=(async()=>{const t=await(0,r.A)(e,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(null!==$.A.applicationCache){$.A.applicationCache.setLayerInfo(e,t);try{return await t}catch(t){throw $.A.applicationCache.clearLayerInfo(e),t}}return t}(e+"/"+a);if(void 0!==s.systemLayers?.associationsTableId&&null!==s.systemLayers.associationsTableId){let r=null;if(i&&n.unVersion<8){const i=[];n.unVersion>=4&&(i.push("STATUS"),i.push("PERCENTALONG")),r=await ee(e+"/"+s.systemLayers.associationsTableId,t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...i],!1,null,null),await r.load(),n.unVersion>=4&&(r=r.filter(m.A.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:r.getFieldsIndex(),timeZone:r.dateFieldsTimeZoneDefaultUTC})),await r.load())}return{lkp:n.lkp,associations:r,unVersion:n.unVersion,terminals:n.terminals,layerIdLookup:n.layerIdLookup,sourceIdLookup:n.sourceIdLookup}}return{associations:null,unVersion:n.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:n.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:n.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}async function ne(e,t,i,r=null,n=null,s=!0,a=null,l=null){let o=e.serviceUrl();if(!o)return null;o=o.endsWith("/")?o+t.relatedTableId.toString():o+"/"+t.relatedTableId.toString();const u=await ee(o,r,n,s,a,l);return new z({layer:e,relatedLayer:u,relationship:t,objectId:i,spatialReference:r,outFields:n,includeGeometry:s,lrucache:a,interceptor:l})}a.A.registerAction(),R.registerAction(),c.A.registerAction(),k.A.registerAction(),D.A.registerAction();class se extends n{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=te(e,this._overrideSpatialReference,null===i?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async featureSetByName(e,t=!0,i=null){if((0,J.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,i);null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const n=this._instantLayers[i];if(n.opitem.title===e&&n.includeGeometry===t&&n.outFields===r)return this._instantLayers[i].featureset}const n=this._map.allLayers.find(t=>(0,y.eB)(t)&&t.title===e);if(null!=n)return this._makeAndAddFeatureSet(n,t,i);if(this._map.allTables){const r=this._map.allTables.find(t=>(0,y.eB)(t)&&t.title===e);if(null!=r)return this._makeAndAddFeatureSet(r,t,i)}return null}async featureSetById(e,t=!0,i=["*"]){if((0,J.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,i);null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const n=this._instantLayers[i];if(n.opitem.id===e&&n.includeGeometry===t&&n.outFields===r)return this._instantLayers[i].featureset}const n=this._map.allLayers.find(t=>(0,y.eB)(t)&&t.id===e);if(n)return this._makeAndAddFeatureSet(n,t,i);if(this._map.allTables){const r=this._map.allTables.find(t=>(0,y.eB)(t)&&t.id===e);if(null!=r)return this._makeAndAddFeatureSet(r,t,i)}return null}}class ae extends n{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=te(e,this._overrideSpatialReference,null===i?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async _loadMetaData(){const e=await ie(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ae(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const n=this._instantLayers[i];if(n.opitem.title===e&&n.includeGeometry===t&&n.outFields===r)return this._instantLayers[i].featureset}const n=await this._loadMetaData();let s=null;for(const t of n.layers??[])t.name===e&&(s=t);if(!s)for(const t of n.tables??[])t.name===e&&(s=t);if(s){const e=await X(this._url+"/"+s.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,i)}return null}async featureSetById(e,t=!0,i=["*"]){null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);e=null!=e?e.toString():"";for(let i=0;i<this._instantLayers.length;i++){const n=this._instantLayers[i];if(n.opitem.id===e&&n.includeGeometry===t&&n.outFields===r)return this._instantLayers[i].featureset}const n=await this._loadMetaData();let s=null;for(const t of n.layers??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(s=t);if(!s)for(const t of n.tables??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(s=t);if(s){const e=await X(this._url+"/"+s.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,i)}return null}}function le(e,t,i=null,r=null){return new se(e,t,i,r)}function oe(e,t,i=null,r=null){return new ae(e,t,i,r)}function ue(e,t,i,r,n){if(null===e)return null;if((0,s.m)(e)){switch(t){case"datasource":return e.getDataSourceFeatureSet();case"parent":return e;case"root":return e.getRootFeatureSet()}return null}if(e instanceof Y.A&&(0,y.NI)(e)){const s=e;switch(t){case"datasource":return te(s,n,"outFields"in s?s.outFields:null,!0,i,r).getDataSourceFeatureSet();case"parent":case"root":return te(s,n,"outFields"in s?s.outFields:null,!0,i,r)}return null}if((0,s.a0)(e)){switch(t){case"datasource":return te(e.parent,n,e.parent.outFields,!0,i,r).getDataSourceFeatureSet();case"parent":case"root":return te(e,n,e.parent.outFields,!0,i,r)}return null}return null}async function ce(e,t,i,r,n,s,a,l=null){if($.A.applicationCache){const o=$.A.applicationCache.getLayerInfo(e+":"+s.url);if(o)return de(await o,t,i,r,n,a,l)}if(null!=a){const o=a.getCachedPortalItem(s.url,e);if(null!=o)return await de(await o,t,i,r,n,a,l)}const o=new K.default({id:e,portal:s}).load();$.A.applicationCache?$.A.applicationCache.setLayerInfo(e+":"+s.url,o):null!=a&&a.setCachedPortalItem(s.url,e,o);try{return await de(await o,t,i,r,n,a,l)}catch(t){throw $.A.applicationCache&&$.A.applicationCache.clearLayerInfo(e+":"+s.url),null!=a&&a.removeCachedPortalItem(s.url,e,o),t}}async function de(e,t,i,r,n,s,a){let l;if("Feature Service"===e.type||"Map Service"===e.type)l=await X((0,y.Qi)(e.url??"")+"/"+t,["*"],s);else{if(t)throw new Error(`layerId=${t} provided for ${e.type} item`);if(null!=s){const t=s.getCachedPortalItemLayer(e.portal.url,e.id);if(null!=t)l=await t;else{const t=Y.A.fromPortalItem(e);s.setCachedPortalItemLayer(e.portal.url,e.id,t);try{l=await t}catch(i){throw s.removeCachedPortalItemLayer(e.portal.url,e.id,t),i}}}else l=await Y.A.fromPortalItem(e)}return te(l,i,r,n,s,a)}},41366:(e,t,i)=>{i.d(t,{K:()=>h,Q:()=>u});var r=i(31635),n=i(66552),s=i(53966),a=i(10107),l=(i(44208),i(87811),i(93223)),o=i(40608);const u=(0,n.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),c="percent-of-total",d="field",h=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=null!=this.normalizationTotal;return t||i?(e=t&&d||i&&c||null,t&&i&&s.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==d&&e!==c||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,r.Cg)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),(0,r.Cg)([(0,l.e)(u,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=(0,r.Cg)([(0,o.$)("esri.rest.support.NormalizationBinParametersMixin")],i),i}},41560:(e,t,i)=>{i.d(t,{Ch:()=>a,mW:()=>s});var r=i(34727),n=i(39516);function s(e,t){return{...t,filterMode:e.mode}}function a(e,t,i){const s=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:i,maxScale:r}of e.filters)t[0]=Math.max(t[0],c(i)),t[1]=Math.min(t[1],d(r));return t}(e);if(s&&((0,r.gg)(t,s[0])||(0,r.ZH)(i,s[1])))return"";const a=Array.from(l(e,t,i)),o=function(e,t,i){if(0===e.length)return!0;const n=c(e.at(0)?.minScale),s=d(e.at(-1)?.maxScale);if((0,r.ZH)(n,t)||(0,r.gg)(s,i))return!0;for(let t=0;t<e.length-1;t++){const i=e[t],n=e[t+1];if((0,r.ZH)(c(n.minScale),d(i.maxScale)))return!0}return!1}(a,t,i)?"1=1":a.map(e=>e.where||"1=1").reduce((e,t)=>(0,n.IW)(e,t),"");return o&&"1=1"!==o?o:""}function*l(e,t,i){if("manual"===u(e)){const t=e.filters.find(t=>t.id===e.activeFilterId);t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const r of e.filters)o(r.minScale,r.maxScale,t,i)&&(yield r)}}function o(e,t,i,n){return e=c(e),i=c(i),t=d(t),!(!(0,r.Sp)(i,e)&&(n??i)>e||(0,r.Hx)(t,i)||void 0!==n&&(0,r.Sp)(n,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function c(e){return e||Number.POSITIVE_INFINITY}function d(e){return e||0}},46140:(e,t,i)=>{i.d(t,{R:()=>n});var r=i(49186);let n=class e{constructor(e,t,i=""){this.major=e,this.minor=t,this._context=i}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",i=this._context&&this._context+" ";throw new r.A(t+"unsupported-version",`Required major ${i}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,i=""){const[n,s]=t.split("."),a=/^\s*\d+\s*$/;if(!n?.match||!a.test(n))throw new r.A((i&&i+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!s?.match||!a.test(s))throw new r.A((i&&i+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const l=parseInt(n,10),o=parseInt(s,10);return new e(l,o,i)}}},50498:(e,t,i)=>{i.d(t,{Ye:()=>d,gy:()=>c,yR:()=>h});var r=i(66552),n=i(5443),s=i(91075),a=i(48526),l=i(86738),o=i(39829),u=i(82799);const c=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),d=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),h={base:s.A,key:"type",typeMap:{extent:n.A,multipoint:a.A,point:l.A,polyline:u.A,polygon:o.A}}},52106:(e,t,i)=>{i.d(t,{A:()=>I});var r,n=i(31635),s=i(37838),a=i(69540),l=i(51447),o=i(25482),u=i(53966),c=i(36708),d=i(24326),h=i(10107),f=(i(44208),i(87811),i(40608)),p=i(12195),y=i(65864),g=i(50498),_=i(55156),m=i(60950),w=i(54339),b=i(33910);function F(e){if(null==e)return null;const t={};for(const i in e){const r=e[i];r&&(t[i]=r.toJSON())}return 0!==Object.keys(t).length?t:null}let I=class extends((0,a.OU)(o.o)){static{r=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,d.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,l.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new r({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,m.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const i=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[i,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const i=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",i,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,_.I)(this.origin);if(e)return(0,w.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,w.r)(this,t):null}getGlobalId(){const e=(0,_.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){return{aggregateGeometries:F(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,p.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const i={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",i,i,e.action)}}_notifyLayer(e,t,i,r){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const n={graphic:this,property:e,oldValue:t,newValue:i};"origin-transform"===e&&(n.action=r),"attributes"===e&&(n.attributeName=r),this.layer.graphicChanged(n)}_watchMeshGeometryChanges(){this.addHandles([(0,c.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,c.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,n.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const i in e){const r=(0,y.rS)(e[i]);r&&(t[i]=r)}return 0!==Object.keys(t).length?t:null}}})],I.prototype,"aggregateGeometries",null),(0,n.Cg)([(0,h.MZ)({value:null})],I.prototype,"attributes",null),(0,n.Cg)([(0,h.MZ)({value:null,types:g.yR,json:{read:y.rS}})],I.prototype,"geometry",null),(0,n.Cg)([(0,h.MZ)({type:Boolean})],I.prototype,"isAggregate",void 0),(0,n.Cg)([(0,h.MZ)({clonable:!1})],I.prototype,"layer",void 0),(0,n.Cg)([(0,h.MZ)({clonable:"reference"})],I.prototype,"origin",void 0),(0,n.Cg)([(0,h.MZ)({type:s.A,value:null})],I.prototype,"popupTemplate",null),(0,n.Cg)([(0,h.MZ)({clonable:"reference"})],I.prototype,"sourceLayer",void 0),(0,n.Cg)([(0,h.MZ)({value:null,types:b.Es})],I.prototype,"symbol",null),(0,n.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],I.prototype,"_version",void 0),(0,n.Cg)([(0,h.MZ)({type:Boolean,value:!0})],I.prototype,"visible",null),I=r=(0,n.Cg)([(0,f.$)("esri.Graphic")],I)},54461:(e,t,i)=>{i.d(t,{A:()=>a});var r=i(87449),n=i(11221),s=i(89169);class a extends n.A{constructor(e){super(e),this._topnum=0,this.declaredClass="esri.arcade.featureset.actions.Top",this._countedin=0,this._maxProcessing=100,this._topnum=e.topnum,this._parent=e.parentfeatureset}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getSet(e);return this._wset=new s.A(t._candidates.slice(),t._known.slice(),!1,this._clonePageDefinition(t.pagesDefinition)),this._setKnownLength(this._wset)>this._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&"GETPAGES"===e._known[e._known.length-1]?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(1===t)return t;const i=this._idstates[e];return 0===i||1===i?i:0===t&&void 0===i?this._countedin<this._topnum?(this._idstates[e]=0,this._countedin++,0):(this._idstates[e]=1,1):2}async _expandPagedSet(e,t,i,n,s){if(null===this._parent)throw new r.d("NotImplemented");if(t>this._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let t=e._known.length;return t>0&&"GETPAGES"===e._known[t-1]&&(e._known.length=t-1),t=e._candidates.length,t>0&&"GETPAGES"===e._candidates[t-1]&&(e._candidates.length=t-1),"success"}const a=await this._parent._expandPagedSet(e,t,i,n,s);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),a}async _getFeatures(e,t,i,r){const n=[],a=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,a))return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);-1!==t&&void 0===this._featureCache[t]&&n.push(t);let l=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(l++,l<=i&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&n.push(e._known[r]),n.length>a)));r++);if(0===n.length)return"success";const o=new s.A([],n,!1,null),u=Math.min(n.length,i);await this._parent._getFeatures(o,-1,u,r);for(let e=0;e<u;e++){const t=this._parent._featureFromCache(n[e]);void 0!==t&&(this._featureCache[n[e]]=t)}return"success"}async _getFilteredSet(e,t,i,r,n){await this._ensureLoaded();const a=await this._getSet(n);return new s.A(a._candidates.slice().concat(a._known.slice()),[],!1,this._clonePageDefinition(a.pagesDefinition))}_refineKnowns(e,t){let i=0,r=null;const n=[];for(let s=0;s<e._candidates.length;s++){const a=this._isInFeatureSet(e._candidates[s]);if(0===a){if(e._known.push(e._candidates[s]),i+=1,null===r?r={start:s,end:s}:r.end===s-1?r.end=s:(n.push(r),r={start:s,end:s}),e._known.length>=this._topnum)break}else if(1===a)null===r?r={start:s,end:s}:r.end===s-1?r.end=s:(n.push(r),r={start:s,end:s}),i+=1;else if(2===a)break;if(i>=t)break}null!==r&&n.push(r);for(let t=n.length-1;t>=0;t--)e._candidates.splice(n[t].start,n[t].end-n[t].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){n.A._featuresetFunctions.top=function(e){return new a({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}},55156:(e,t,i)=>{i.d(t,{I:()=>n,e:()=>r});const r=Symbol("idFieldsProviderSymbol");function n(e){return(t=e)&&r in t?e[r]:void 0;var t}},55674:(e,t,i)=>{i.d(t,{Ad:()=>f,Gj:()=>g,QY:()=>h,lL:()=>_,xR:()=>p});var r=i(66131),n=i(49186),s=(i(44208),i(44729)),a=i(15032),l=i(65864),o=i(95466),u=i(43668),c=i(98623);const d=["geometry","scale","timeProperties"];function h(e,t){if(null!=t)for(const i of d)t.hasArcadeDependency(i)&&e.add(i);return e}function f(e,t){return y.create(e,t,null,["$feature","$view"])}function p(e,t,i){return y.create(e,t,i,["$feature","$view","$config"])}class y{static async create(e,t,i,r){const{arcade:s,Dictionary:a}=await(0,u.l)();let l;try{l=s.parseScript(e)}catch(t){throw new n.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const o=s.scriptUsesGeometryEngine(l);o&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,l,null,!1,o);const c={vars:r.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},d=s.compileScript(l,c);let h=null;null!=i&&(h=new a(i),h.immutable=!0);const f=new a;return f.immutable=!1,f.setField("scale",0),new y(e,s,l,d,t,f,h,a)}constructor(e,t,i,r,n,s,a,l){this.script=e,this._arcade=t,this._syntaxTree=i,this._compiled=r,this._spatialReference=n,this._viewDict=s,this._configDict=a,this._dictionaryCtor=l,this._dependencies=new Map,this._featureReader=new g,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const i=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:n,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=n?null!=i?r.lY.epochToArcadeDate(n,i):r.lY.unknownEpochToArcadeDate(n):void 0,currentEnd:null!=s?null!=i?r.lY.epochToArcadeDate(s,i):r.lY.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:i})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class g{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,i){const r=t??new o.A(_(e.attributes));this._boundTarget=e,this._boundSchema.fields=r.fields,this._boundSchema.fieldsIndex=r,this._boundSchema.spatialReference=i}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,l.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===c.L5}field(e,t=!0){const i=this._getField(e);if(i){const t=this._boundTarget.attributes[i.name];if(null==t)return null;switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return s.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return a.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return r.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?r.lY.unknownEpochToArcadeDate(t):r.lY.epochToArcadeDate(t,this.contextTimeZone??c.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function _(e){const t=[];for(const i in e)t.push({name:i,alias:i,type:"string"==typeof e[i]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},58501:(e,t,i)=>{i.d(t,{q:()=>n});var r=i(62815);function n(e,t,i){if(!i?.features||!i.hasZ)return;const n=(0,r.N)(i.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of i.features)n(e.geometry)}},60999:(e,t,i)=>{i.d(t,{DZ:()=>p,Ke:()=>f,Tj:()=>c,UT:()=>y,jJ:()=>u});var r=i(31635),n=i(65008),s=i(97768),a=i(74887),l=i(10107),o=i(40608);function u(e,t,i){return(0,a.Lx)(e.map((e,r)=>t.apply(i,[e,r])))}async function c(e,t,i){return(await(0,a.Lx)(e.map((e,r)=>t.apply(i,[e,r])))).map(e=>e.value)}function d(e){return{ok:!0,value:e}}function h(e){return{ok:!1,error:e}}async function f(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return d(await e)}catch(e){return h(e)}}async function p(e){try{return d(await e)}catch(e){return(0,a.QP)(e),h(e)}}function y(e,t){return new g(e,t)}let g=class extends n.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,s.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then(e=>{this._result=d(e),this._cleanup()},e=>{this._result=h(e),this._cleanup()}),this._abortHandle=(0,a.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,s.xt)(this._abortHandle),this._abortController=null}};(0,r.Cg)([(0,l.MZ)()],g.prototype,"value",null),(0,r.Cg)([(0,l.MZ)()],g.prototype,"error",null),(0,r.Cg)([(0,l.MZ)()],g.prototype,"finished",null),(0,r.Cg)([(0,l.MZ)()],g.prototype,"promise",void 0),(0,r.Cg)([(0,l.MZ)()],g.prototype,"_result",void 0),g=(0,r.Cg)([(0,o.$)("esri.core.asyncUtils.ReactiveTask")],g)},62815:(e,t,i)=>{i.d(t,{N:()=>a});var r=i(83047),n=i(73941),s=i(21325);function a(e,t,i){if(null==t||null==i||i.vcsWkid||(0,s.aI)(t,i)||(0,n.xP)(t)||(0,n.xP)(i))return null;const a=(0,r.G9)(t)/(0,r.G9)(i);if(1===a)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,a);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,a);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,a);default:return null}}},68423:(e,t,i)=>{i.d(t,{Gr:()=>m,IO:()=>y,a:()=>w,bV:()=>_,p8:()=>g});var r=i(52106),n=i(78502),s=i(87449),a=i(11221),l=i(89169),o=i(33325),u=i(80609),c=i(97768),d=i(1262),h=i(88368),f=i(16930);class p{constructor(e){this.field=e,this.sqlRewritable=!1}postInitialization(e,t){}}class y extends p{constructor(e){super(e),this.sqlRewritable=!0}extractValue(e){return e.attributes[this.field.name]}rewriteSql(e){return{rewritten:this.sqlRewritable,where:e}}}class g extends p{constructor(e,t,i){super((0,o.ke)(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=i}rewriteSql(e,t){return{rewritten:this.sqlRewritable,where:(0,u.bD)(e,this.field.name,this.originalField.name,t.getFieldsIndex())}}extractValue(e){return e.attributes[this.originalField.name]}}class _ extends p{constructor(e,t,i){super(e),this.codefield=t,this.lkp=i,this.reverseLkp={};for(const e in i)this.reverseLkp[i[e]]=e;this.sqlRewritable=!0}static{this.BADNESS="_!!!_BAD_LKP_!!!!"}rewriteSql(e,t){const i=this.evaluateNodeToWhereClause(e.parseTree,0,this.field.name,this.codefield instanceof h.A?(0,u.YY)(this.codefield,0):this.codefield,e.parameters);return i.includes(_.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:h.A.create(i,{fieldsIndex:t._parent.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})}}evaluateNodeToWhereClause(e,t,i=null,r=null,n){let s,a,l,c;switch(e.type){case"interval":return(0,u.oj)(this.evaluateNodeToWhereClause(e.value,t,i,r,n),e.qualifier,e.op);case"case-expression":{let r=" CASE ";"simple"===e.format&&(r+=this.evaluateNodeToWhereClause(e.operand,t,i,_.BADNESS,n));for(let s=0;s<e.clauses.length;s++)r+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[s].operand,t,i,_.BADNESS,n)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[s].value,t,i,_.BADNESS,n);return null!==e.else&&(r+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,i,_.BADNESS,n)),r+=" END ",r}case"parameter":{const i=n[e.value.toLowerCase()];if("string"==typeof i)return"'"+i.toString().replaceAll("'","''")+"'";if((0,o.$P)(i))return(0,u.bm)(i,t);if((0,o.Lk)(i))return(0,u.bm)(i,t);if((0,o.eg)(i))return(0,u.F1)(i,t);if((0,o.rX)(i))return(0,u.R8)(i,t);if((0,o.f0)(i))return(0,u.Nf)(i,t);if(Array.isArray(i)){const e=[];for(let r=0;r<i.length;r++)"string"==typeof i[r]?e.push("'"+i[r].toString().replaceAll("'","''")+"'"):(0,o.$P)(i[r])||(0,o.Lk)(i[r])?e.push((0,u.bm)(i[r],t)):(0,o.eg)(i[r])?e.push((0,u.F1)(i[r],t)):(0,o.rX)(i[r])?e.push((0,u.R8)(i[r],t)):(0,o.f0)(i[r])?e.push((0,u.Nf)(i[r],t)):e.push(i[r].toString());return e}return i.toString()}case"expression-list":a=[];for(const s of e.value)a.push(this.evaluateNodeToWhereClause(s,t,i,r,n));return a;case"unary-expression":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,i,_.BADNESS,n)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" AND "+this.evaluateNodeToWhereClause(e.right,t,i,r,n)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" OR "+this.evaluateNodeToWhereClause(e.right,t,i,r,n)+") ";case"IS":if("null"!==e.right.type)throw new d.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new d.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IS NOT NULL )";case"IN":if(s=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const s=[];let a=!0;for(const t of e.right.value){if("string"!==t.type){a=!1;break}if(void 0===this.lkp[t.value]){a=!1;break}s.push(this.lkp[t.value].toString())}if(a)return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IN ("+s.join(",")+")) "}return s=this.evaluateNodeToWhereClause(e.right,t,i,r,n)," ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IN ("+s.join(",")+")) "}return c=this.evaluateNodeToWhereClause(e.right,t,i,r,n),Array.isArray(c)?" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IN ("+c.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" IN ("+c+")) ";case"NOT IN":if(s=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const s=[];let a=!0;for(const t of e.right.value){if("string"!==t.type){a=!1;break}if(void 0===this.lkp[t.value]){a=!1;break}s.push(this.lkp[t.value].toString())}if(a)return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" NOT IN ("+s.join(",")+")) "}return s=this.evaluateNodeToWhereClause(e.right,t,i,r,n)," ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" NOT IN ("+s.join(",")+")) "}return c=this.evaluateNodeToWhereClause(e.right,t,i,r,n),Array.isArray(c)?" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" NOT IN ("+c.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,n)+" NOT IN ("+c+")) ";case"BETWEEN":return l=this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,n)," ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,n)+" BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"NOTBETWEEN":return l=this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,n)," ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,n)+" NOT BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,n)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,n)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,n)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,n)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,n)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,n)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,n)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,n)+") ";case"<>":case"=":if("column-reference"===e.left.type&&"string"===e.right.type){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&void 0!==this.lkp[e.right.value.toString()])return" ("+r+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if("column-reference"===e.right.type&&"string"===e.left.type&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,n)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,n)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,n)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,n)+") "}case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return(0,u.C6)(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":(0,u.Kb)(e.column);case"data-type":return e.value;case"function":{const r=this.evaluateNodeToWhereClause(e.args,t,i,_.BADNESS,n);return(0,u.F6)(e.name,r,t)}}throw new d.L("UnsupportedSyntax",{node:e.type})}extractValue(e){if(this.codefield instanceof h.A){const t=this.codefield.calculateValueCompiled(e);return this.reverseLkp[h.A.convertValueToStorageFormat(t)]}return this.reverseLkp[e.attributes[this.codefield]]}}class m extends p{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:(0,u.bD)(e,this.field.name,(0,u.YY)(this._sql,0),t.getFieldsIndex())}}extractValue(e){return h.A.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}class w extends a.A{static findField(e,t){for(const i of e)if(i.name.toLowerCase()===t.toString().toLowerCase())return i;return null}constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}_initialiseFeatureSet(){null!==this._parent?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new f.A({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=o.ik.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){if(null===this._wset){await this._ensureLoaded();let t=null;return t=this._extraFilter?await this._getFilteredSet("",null,null,null,e):await(this._parent?._getSet(e)),this._checkCancelled(e),(0,c.Lw)(t),this._wset=new l.A(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}async _getFeatures(e,t,i,s){const a=[];-1!==t&&void 0===this._featureCache[t]&&a.push(t);const o=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,o))return await this._expandPagedSet(e,o,0,0,s),this._getFeatures(e,t,i,s);let u=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(u++,u<=i&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&a.push(e._known[r]),a.length>=o)));r++);if(0===a.length)return"success";e=new l.A([],a,e._ordered,null);const c=Math.min(a.length,i);await(this._parent?._getFeatures(e,-1,c,s)),this._checkCancelled(s);const d=[];for(let e=0;e<c;e++){const t=this._parent?._featureFromCache(a[e]);void 0!==t&&d.push({geometry:t.geometry,attributes:t.attributes,id:a[e]})}for(const e of d){const t=[];for(const i of this.adaptedFields)t[i.field.name]=i.extractValue(e);this._featureCache[e.id]=new r.A({attributes:t,geometry:(0,n.Yq)(e.geometry)})}return"success"}async _fetchAndRefineFeatures(){throw new s.d("NeverReach")}async _getFilteredSet(e,t,i,r,n){let s=!1;const a=this._reformulateWithoutAdaptions(i);s=a.cannot,i=a.where;let o=!1;if(null!==r){o=!0;const e=[];for(const t of this.adaptedFields)if(!(t instanceof y)&&!0===r.scanForField(t.field.name)){if(!(t instanceof g)){r=null,o=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}r&&e.length>0&&(r=r.replaceFields(e))}null!==i?null!==this._extraFilter&&(i=(0,u.kg)(this._extraFilter,i)):i=this._extraFilter,await this._ensureLoaded();const c=await this._parent._getFilteredSet(e,t,i,r,n);let d;return this._checkCancelled(n),d=!0===s?new l.A(c._candidates.slice().concat(c._known.slice()),[],!0===o&&c._ordered,this._clonePageDefinition(c.pagesDefinition)):new l.A(c._candidates.slice(),c._known.slice(),!0===o&&c._ordered,this._clonePageDefinition(c.pagesDefinition)),d}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const i of this.adaptedFields)if(!0===(0,u.Ju)(e,i.field.name)){const r=i.rewriteSql(e,this);if(!0!==r.rewritten){t.cannot=!0,t.where=null;break}t.where=r.where}return t}async _stat(e,t,i,r,n,s,a){let l=!1,o=this._reformulateWithoutAdaptions(t);if(l=o.cannot,t=o.where,o=this._reformulateWithoutAdaptions(n),l=l||o.cannot,null!==(n=o.where)?null!==this._extraFilter&&(n=(0,u.kg)(this._extraFilter,n)):n=this._extraFilter,!0===l)return null===n&&""===i&&null===r?this._manualStat(e,t,s,a):{calculated:!1};const c=await this._parent._stat(e,t,i,r,n,s,a);return!1===c.calculated?null===n&&""===i&&null===r?this._manualStat(e,t,s,a):{calculated:!1}:c}async _canDoAggregates(e,t,i,r,n){if(null===this._parent)return!1;for(let t=0;t<e.length;t++)for(const i of this.adaptedFields)if(e[t].toLowerCase()===i.field.name.toLowerCase()&&!(i instanceof y))return!1;const s=[];for(let e=0;e<t.length;e++){const i=t[e];if(null!==i.workingexpr){const e=this._reformulateWithoutAdaptions(i.workingexpr);if(e.cannot)return!1;const t=i.clone();t.workingexpr=e.where,s.push(t)}else s.push(i)}const a=this._reformulateWithoutAdaptions(n);return!a.cannot&&(null!==(n=a.where)?null!==this._extraFilter&&(n=(0,u.kg)(this._extraFilter,n)):n=this._extraFilter,this._parent._canDoAggregates(e,s,i,r,n))}async _getAggregatePagesDataSourceDefinition(e,t,i,r,n,a,l){if(null===this._parent)throw new s.d("NeverReach");const o=[];for(let e=0;e<t.length;e++){const i=t[e];if(null!==i.workingexpr){const e=this._reformulateWithoutAdaptions(i.workingexpr);if(e.cannot)throw new s.d("NeverReach");const t=i.clone();t.workingexpr=e.where,o.push(t)}else o.push(i)}const c=this._reformulateWithoutAdaptions(n);if(c.cannot)throw new s.d("NeverReach");return null!==(n=c.where)?null!==this._extraFilter&&(n=(0,u.kg)(this._extraFilter,n)):n=this._extraFilter,this._parent._getAggregatePagesDataSourceDefinition(e,o,i,r,n,a,l)}}},73681:(e,t,i)=>{i.d(t,{n:()=>o});var r=i(49186),n=i(53966),s=i(46140),a=i(95466),l=i(55674);class o{static async from(e,t,i){const a=e.dictionary_version?s.R.parse(e.dictionary_version):null,c=new Set(e.itemsNames),d={};if(t)for(const e in t)d[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)d.hasOwnProperty(t.name)||(d[t.name]=t.value);const h=new Set(e.authoringInfo.symbol);for(const e of Object.keys(i))h.delete(e);h.size&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:h});const f=await(0,l.xR)(e.expression,null,d);if(!f)throw new r.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const p=!a||!a.greaterEqual(4,0);p&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:a});const y=new u(i,p);return new o(p,c,f,y)}constructor(e,t,i,r){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=i,this._reader=r}get itemNames(){return this._itemNames}evaluate(e,t,i,r){try{return this._reader.bind(e,i,r),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new a.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new a.A(t)}}class u extends l.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},77548:(e,t,i)=>{i.d(t,{Gh:()=>y,tk:()=>d,BR:()=>c,wI:()=>u,G$:()=>f,$x:()=>h,Ov:()=>l,W_:()=>o,OP:()=>p,TU:()=>a,XX:()=>s});var r=i(70333),n=i(78888);i(7762),i(84952),i(36563),i(36708),new WeakMap;const s={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function a(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function l(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function o(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function u(e,t){const i=r.id?.findServerInfo(e);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const s=e.toLowerCase().indexOf("/rest/services");if(-1===s)return null;const a=`${e.slice(0,s)}/rest/info`,l=null!=t?t.signal:null,{data:o}=await(0,n.A)(a,{query:{f:"json"},responseType:"json",signal:l});return o?.owningSystemUrl||null}function c(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function d(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function h(e,t){return null}function f(e){return null}function p(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function y(e,t){if(!t||!p(e))return;const i=(e.url,null);i&&(e.url=i)}},86691:(e,t,i)=>{i.d(t,{A:()=>o});var r=i(78878),n=i(87449),s=i(11221),a=i(89169),l=i(87594);class o extends s.A{constructor(e){super(e),this._orderbyclause=null,this.declaredClass="esri.arcade.featureset.actions.OrderBy",this._maxProcessing=100,this._orderbyclause=e.orderbyclause,this._parent=e.parentfeatureset}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,this._orderbyclause,e);return this._checkCancelled(e),this._wset=t,this._wset}return this._wset}async manualOrderSet(e,t){const i=await this.getIdColumnDictionary(e,[],-1,t);this._orderbyclause?.order(i);const r=new a.A([],[],!0,null);for(let e=0;e<i.length;e++)r._known.push(i[e].id);return r}async getIdColumnDictionary(e,t,i,n){if(i<e._known.length-1){const s=this._maxQueryRate();if("GETPAGES"===e._known[i+1])return await(0,r.a1)(this._parent._expandPagedSet(e,s,0,0,n)),this.getIdColumnDictionary(e,t,i,n);let a=i+1;const l=[];for(;a<e._known.length&&"GETPAGES"!==e._known[a];)l.push(e._known[a]),a++;i+=l.length;const o=await(0,r.a1)(this._parent._getFeatureBatch(l,n));this._checkCancelled(n);for(const e of o)t.push({id:e.attributes[this.objectIdField],feature:e});return this.getIdColumnDictionary(e,t,i,n)}return e._candidates.length>0?(await(0,r.a1)(this._refineSetBlock(e,this._maxProcessingRate(),n)),this._checkCancelled(n),this.getIdColumnDictionary(e,t,i,n)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){if(void 0===this._featureCache[e]){const t=this._parent._featureFromCache(e);if(void 0===t)return;return null===t?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new n.d("NeverReach")}async _getFilteredSet(e,t,i,r,n){await this._ensureLoaded();const s=await this._parent._getFilteredSet(e,t,i,null===r?this._orderbyclause:r,n);this._checkCancelled(n);const l=new a.A(s._candidates.slice(),s._known.slice(),s._ordered,this._clonePageDefinition(s.pagesDefinition));let o=!0;if(s._candidates.length>0&&(o=!1),!1===l._ordered){let e=await this.manualOrderSet(l,n);return!1===o&&(null===t&&null===i||(e=new a.A(e._candidates.slice().concat(e._known.slice()),[],e._ordered,this._clonePageDefinition(e.pagesDefinition)))),e}return l}static registerAction(){s.A._featuresetFunctions.orderBy=function(e){return""===e?this:new o({parentfeatureset:this,orderbyclause:new l.A(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}},87594:(e,t,i)=>{function r(e,t){return e===t?0:null===e?-1:null===t?1:e<t?-1:1}i.d(t,{A:()=>n});class n{constructor(e){const t=e.split(",");this._fields=[],this._directions=[];for(let e=0;e<t.length;e++){const i=t[e].match(/\S+/g);this._fields.push(i[0]),2===i.length?"asc"===i[1].toLowerCase()?this._directions.push(1):this._directions.push(0):this._directions.push(1)}}constructClause(){let e="";for(let t=0;t<this._fields.length;t++)0!==t&&(e+=","),e+=this._fields[t],1===this._directions[t]?e+=" ASC":e+=" DESC";return e}order(e){e.sort((e,t)=>{for(let i=0;i<this._fields.length;i++){const n=this.featureValue(e.feature,this._fields[i],i),s=this.featureValue(t.feature,this._fields[i],i);let a=0;if(a=1===this._directions[i]?r(n,s):-1*r(n,s),0!==a)return a}return 0})}scanForField(e){for(let t=0;t<this._fields.length;t++)if(this._fields[t].toLowerCase().trim()===e.toLowerCase().trim())return!0;return!1}replaceFields(e){let t="";for(let i=0;i<this._fields.length;i++){0!==i&&(t+=",");let r=this._fields[i];for(const t of e)if(r.toLowerCase()===t.field.toLowerCase()){r=t.newfield;break}t+=r,1===this._directions[i]?t+=" ASC":t+=" DESC"}return new n(t)}featureValue(e,t,i){const r=e.attributes[t];if(void 0!==r)return r;for(const r in e.attributes)if(t.toLowerCase()===r.toLowerCase())return this._fields[i]=r,e.attributes[r];return null}}},91880:(e,t,i)=>{i.d(t,{A:()=>c});var r,n=i(31635),s=i(66552),a=i(25482),l=i(10107),o=(i(44208),i(53966),i(87811),i(40608));const u=new s.J({asc:"ascending",desc:"descending"});let c=class extends a.o{static{r=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new r({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],c.prototype,"field",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],c.prototype,"valueExpression",void 0),(0,n.Cg)([(0,l.MZ)({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],c.prototype,"order",void 0),c=r=(0,n.Cg)([(0,o.$)("esri.layers.support.OrderByInfo")],c)},98988:(e,t,i)=>{i.r(t),i.d(t,{canProjectWithoutEngine:()=>z,getTransformation:()=>q,getTransformations:()=>B,initializeProjection:()=>J,isEqualBaseGCS:()=>$,isLoaded:()=>D,isLoadedOrLoad:()=>L,isLoadedOrLoadFor:()=>P,load:()=>M,project:()=>E,projectExtent:()=>se,projectMany:()=>O,projectMultipoint:()=>X,projectOrLoad:()=>j,projectOrLoadMany:()=>G,projectPoint:()=>K,projectPolygon:()=>re,projectPolyline:()=>te,projectWithZConversion:()=>Q,projectWithoutEngine:()=>Y,requiresLoad:()=>N,test:()=>W,tryProjectWithZConversion:()=>V,unload:()=>Z});var r=i(49186),n=i(74887),s=i(62788),a=i(95488),l=i(51850),o=i(21276),u=i(73941),c=i(5443),d=i(48526),h=i(83290),f=i(86738),p=i(39829),y=i(82799),g=i(16930),_=i(9762),m=i(37539);function w(e,t,i,r,n,s){return b[0]=e,b[1]=t,b[2]=i,(0,_.projectBuffer)(b,r,0,n,s,0)}const b=(0,l.vt)();let F=0;class I{static fromGE(e){const t=new I;return t._wkt=e.wkt,t._wkid=e.wkid,t._isInverse=e.isInverse,t}constructor(e){this.uid=F++,e?(this._wkt=null!=e.wkt?e.wkt:null,this._wkid=null!=e.wkid?e.wkid:-1,this._isInverse=null!=e.isInverse&&!0===e.isInverse):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}get wkt(){return this._wkt}set wkt(e){this._wkt=e,this.uid=F++}get wkid(){return this._wkid}set wkid(e){this._wkid=e,this.uid=F++}get isInverse(){return this._isInverse}set isInverse(e){this._isInverse=e,this.uid=F++}getInverse(){const e=new I;return e._wkt=this.wkt,e._wkid=this._wkid,e._isInverse=!this.isInverse,e}}class S{static cacheKey(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}static fromGE(e){const t=new S;let i="";for(const r of e.steps){const e=I.fromGE(r);t.steps.push(e),i+=e.uid.toString()+","}return t._cachedProjection={},t._gtlistentry=null,t._chain=i,t}constructor(e){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,e?.steps)for(const t of e.steps)t instanceof I?this.steps.push(t):this.steps.push(new I({wkid:t.wkid,wkt:t.wkt,isInverse:t.isInverse}))}getInverse(){const e=new S;e.steps=[];for(let t=this.steps.length-1;t>=0;t--){const i=this.steps[t];e.steps.push(i.getInverse())}return e}getGTListEntry(){let e="";for(const t of this.steps)e+=t.uid.toString()+",";return e!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=e),this._gtlistentry}assignCachedGe(e,t,i){this._cachedProjection[S.cacheKey(e,t)]=i}getCachedGeTransformation(e,t){let i="";for(const e of this.steps)i+=e.uid.toString()+",";i!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=i);const r=this._cachedProjection[S.cacheKey(e,t)];return void 0===r?null:r}}var v=i(21325),A=i(62815);let T=null,C=null,x=null,R={};const k=new a.I;function D(){return!!T&&(0,h.i)()}function L(){return!!D()||((0,s.gc)(k),M(),!1)}function P(e,t){return!e||!t||z(e,t)||L()}function N(e,t){return!z(e,t)&&!D()}function M(e){return null==x&&(x=Promise.all([(0,h.l)(),i.e(9930).then(i.bind(i,49930)).then(e=>e.g),i.e(2731).then(i.bind(i,12731))])),x.then(([,t,{hydratedAdapter:i}])=>{(0,n.Te)(e),C=i,T=t.default,T._enableProjection(h.p),k.notify()})}function E(e,t,i=null,r=null){return Array.isArray(e)?0===e.length?[]:((0,o.H)(e),O(C,e,e[0].spatialReference,t,i,r)):((0,o.f)(e),O(C,[e],e.spatialReference,t,i,r)[0])}function O(e,t,i,r,n=null,s=null){if(null==i||null==r)return t;if(z(i,r,n))return t.map(e=>Y(e,i,r));if(null==n&&(0,u.jA)(i))return t.map(e=>Y(e,i,g.A.WGS84)).map(e=>V(e,r));if(null==n&&(0,u.jA)(r))return t.map(e=>V(e,g.A.WGS84)).map(e=>Y(e,g.A.WGS84,r));if(null==n){const e=S.cacheKey(i,r);void 0!==R[e]?n=R[e]:(null==(n=q(i,r,void 0))&&(n=new S),R[e]=n)}if(null==T||null==e)throw new U;return null!=s?T._project(e,t,i,r,n,s):T._project(e,t,i,r,n)}function j(e,t){const i=G([e],t);return null!=i.pending?{pending:i.pending,geometry:null}:null!=i.geometries?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function G(e,t){if(!D())for(const i of e)if(null!=i&&!(0,v.aI)(i.spatialReference,t)&&(0,v.fn)(i.spatialReference)&&(0,v.fn)(t)&&!z(i.spatialReference,t))return(0,s.gc)(k),{pending:M(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,v.aI)(e.spatialReference,t)?e:(0,v.fn)(e.spatialReference)&&(0,v.fn)(t)?V(e,t):null)}}function q(e,t,i=null){if(null==e||null==t)return null;if(null==T||null==C)throw new U;const r=T._getTransformation(C,e,t,i,i?.spatialReference);return null!==r?S.fromGE(r):null}function B(e,t,i=null){if(null==T||null==C)throw new U;const r=T._getTransformationBySuitability(C,e,t,i,i?.spatialReference);if(null!==r){const e=[];for(const t of r)e.push(S.fromGE(t));return e}return[]}class U extends r.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function Z(){T=null,C=null,x=null,R={}}const W={get loadPromise(){return x}};function V(e,t){try{const i=E(e,t);if(null==i)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const r=(0,A.N)(i.type,e.spatialReference,t);return null!=r&&r(i),i}catch(e){if(!(e instanceof U))throw e;return null}}async function Q(e,t,i){const r=e.spatialReference;return null!=r&&null!=t&&await J(r,t,null,i),V(e,t)}function z(e,t,i){return!i&&(!!(0,v.aI)(e,t)||(0,v.fn)(e)&&(0,v.fn)(t)&&!!(0,m.jd)(e,t))}function $(e,t){if((0,v.aI)(e,t))return!0;if(!(0,v.fn)(e)||!(0,v.fn)(t))return!1;const i=(0,v.oT)(e)||(0,v.K8)(e)||(0,v.x1)(e),r=(0,v.oT)(t)||(0,v.K8)(t)||(0,v.x1)(t);return i&&r}async function J(e,t,i,r){if(D())return(0,n.NO)(r);if(Array.isArray(e)){for(const{source:t,dest:i,geographicTransformation:n}of e)if(t&&i&&!z(t,i,n))return M(r)}else if(e&&t&&!z(e,t,i))return M(r);return(0,n.NO)(r)}function Y(e,t,i){return e?"x"in e?H(e,t,new f.A,i,0):"xmin"in e?ae(e,t,new c.A,i,0):"rings"in e?ne(e,t,new p.A,i,0):"paths"in e?ie(e,t,new y.A,i,0):"points"in e?ee(e,t,new d.A,i,0):null:null}function K(e,t,i=t.spatialReference,r=0){return null!=i&&null!=e.spatialReference&&null!=H(e,e.spatialReference,t,i,r)}function H(e,t,i,r,n){oe[0]=e.x,oe[1]=e.y;const s=e.z;return oe[2]=void 0!==s?s:n,(0,_.projectBuffer)(oe,t,0,oe,r,0)?(i.x=oe[0],i.y=oe[1],i.spatialReference=r,void 0!==s||(0,u.xP)(r)?(i.z=oe[2],i.hasZ=!0):(i.z=void 0,i.hasZ=!1),void 0===e.m?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function X(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=ee(e,e.spatialReference,t,i,r)}function ee(e,t,i,r,n){const{points:s,hasZ:a,hasM:l}=e,o=[],c=s.length,d=[];for(const e of s)d.push(e[0],e[1],a?e[2]:n);if(!(0,_.projectBuffer)(d,t,0,d,r,0,c))return null;const h=a||(0,u.xP)(r);for(let e=0;e<c;++e){const t=3*e,i=d[t],r=d[t+1];h&&l?o.push([i,r,d[t+2],s[e][3]]):h?o.push([i,r,d[t+2]]):l?o.push([i,r,s[e][2]]):o.push([i,r])}return i.points=o,i.spatialReference=r,i.hasZ=a,i.hasM=l,i}function te(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=ie(e,e.spatialReference,t,i,r)}function ie(e,t,i,r,n){const{paths:s,hasZ:a,hasM:l}=e,o=[];if(!le(s,a??!1,l??!1,t,o,r,n))return null;const c=a||(0,u.xP)(r);return i.paths=o,i.spatialReference=r,i.hasZ=c,i.hasM=l,i}function re(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=ne(e,e.spatialReference,t,i,r)}function ne(e,t,i,r,n){const{rings:s,hasZ:a,hasM:l}=e,o=[];if(!le(s,a??!1,l??!1,t,o,r,n))return null;const c=a||(0,u.xP)(r);return i.rings=o,i.spatialReference=r,i.hasZ=c,i.hasM=l,i}function se(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=ae(e,e.spatialReference,t,i,r)}function ae(e,t,i,r,n){const{xmin:s,ymin:a,xmax:l,ymax:o,hasZ:c,hasM:d}=e;if(!w(s,a,c?e.zmin:n,t,oe,r))return null;const h=c||(0,u.xP)(r);return i.xmin=oe[0],i.ymin=oe[1],h&&(i.zmin=oe[2]),w(l,o,c?e.zmax:n,t,oe,r)?(i.xmax=oe[0],i.ymax=oe[1],h&&(i.zmax=oe[2]),d&&(i.mmin=e.mmin,i.mmax=e.mmax),i.spatialReference=r,i):null}function le(e,t,i,r,n,s,a=0){const l=new Array;for(const i of e)for(const e of i)l.push(e[0],e[1],t?e[2]:a);if(!(0,_.projectBuffer)(l,r,0,l,s,0))return!1;let o=0;n.length=0;const c=t||(0,u.xP)(s);for(const t of e){const e=new Array;for(const r of t)c&&i?e.push([l[o++],l[o++],l[o++],r[3]]):c?e.push([l[o++],l[o++],l[o++]]):i?(e.push([l[o++],l[o++],r[2]]),o++):(e.push([l[o++],l[o++]]),o++);n.push(e)}return!0}const oe=(0,l.vt)()}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1449],{4902:(e,t,i)=>{i.d(t,{PH:()=>o,sA:()=>l});var r=i(31635),s=i(40608);let n=0;const l=e=>{const t=e;let i=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n++})}};return i=(0,r.Cg)([(0,s.$)("esri.core.Identifiable")],i),i},o=e=>{const t=e;let i=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:n++})}};return i=(0,r.Cg)([(0,s.$)("esri.core.Identifiable.NumericIdentifiable")],i),i};l(class{})},17029:(e,t,i)=>{i.r(t),i.d(t,{default:()=>z});var r,s=i(31635),n=i(78888),l=i(51447),o=i(49186),a=i(66552),u=i(53966),c=i(92071),p=i(10107),d=(i(44208),i(87811),i(40608)),g=i(86738),h=i(16930),y=i(5443),w=i(19419),f=i(4146),m=i(63074),v=i(54310),b=i(25036),M=i(33446),A=i(87045);const T=new(i(72802).U)("0/0/0",0,0,0,void 0);let C=r=class extends((0,m.dM)((0,b.j)((0,v.J)(f.A)))){constructor(){super(...arguments),this.tileInfo=A.A.create({spatialReference:h.A.WebMercator,size:256}),this.type="base-tile",this.fullExtent=new y.A(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,h.A.WebMercator),this.spatialReference=h.A.WebMercator}addResolvingPromise(e){super.addResolvingPromise(e)}getTileBounds(e,t,i,r){const s=r||(0,w.vt)();return T.level=e,T.row=t,T.col=i,T.extent=s,this.tileInfo.updateTileInfo(T),T.extent=void 0,s}fetchTile(e,t,i,r={}){const{signal:s}=r,l=this.getTileUrl(e,t,i),o={responseType:"image",signal:s,query:{...this.refreshParameters}};return(0,n.A)(l??"",o).then(e=>e.data)}async fetchImageBitmapTile(e,t,i,s={}){const{signal:l}=s;if(this.fetchTile!==r.prototype.fetchTile){const r=await this.fetchTile(e,t,i,s);return(0,M.C)(r,e,t,i,l)}const o=this.getTileUrl(e,t,i)??"",a={responseType:"blob",signal:l,query:{...this.refreshParameters}},{data:u}=await(0,n.A)(o,a);return(0,M.C)(u,e,t,i,l)}getTileUrl(){throw new o.A("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};(0,s.Cg)([(0,p.MZ)({type:A.A})],C.prototype,"tileInfo",void 0),(0,s.Cg)([(0,p.MZ)({type:["show","hide"]})],C.prototype,"listMode",void 0),(0,s.Cg)([(0,p.MZ)({readOnly:!0,value:"base-tile"})],C.prototype,"type",void 0),(0,s.Cg)([(0,p.MZ)({nonNullable:!0})],C.prototype,"fullExtent",void 0),(0,s.Cg)([(0,p.MZ)()],C.prototype,"spatialReference",void 0),C=r=(0,s.Cg)([(0,d.$)("esri.layers.BaseTileLayer")],C);var x=i(16131),j=i(91806);const S=new a.J({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"});(0,l.uW)(u.A.getLogger("esri.layers.BingMapsLayer"),"esri.layers.BingMapsLayer",{version:"4.33",warnOnce:!0});let Z=class extends((0,m.dM)((0,x.q)((0,c.P)(C)))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new A.A({size:[256,256],dpi:96,origin:new g.A({x:-20037508.342787,y:20037508.342787,spatialReference:h.A.WebMercator}),spatialReference:h.A.WebMercator,lods:[new j.A({level:1,resolution:78271.5169639999,scale:295828763.795777}),new j.A({level:2,resolution:39135.7584820001,scale:147914381.897889}),new j.A({level:3,resolution:19567.8792409999,scale:73957190.948944}),new j.A({level:4,resolution:9783.93962049996,scale:36978595.474472}),new j.A({level:5,resolution:4891.96981024998,scale:18489297.737236}),new j.A({level:6,resolution:2445.98490512499,scale:9244648.868618}),new j.A({level:7,resolution:1222.99245256249,scale:4622324.434309}),new j.A({level:8,resolution:611.49622628138,scale:2311162.217155}),new j.A({level:9,resolution:305.748113140558,scale:1155581.108577}),new j.A({level:10,resolution:152.874056570411,scale:577790.554289}),new j.A({level:11,resolution:76.4370282850732,scale:288895.277144}),new j.A({level:12,resolution:38.2185141425366,scale:144447.638572}),new j.A({level:13,resolution:19.1092570712683,scale:72223.819286}),new j.A({level:14,resolution:9.55462853563415,scale:36111.909643}),new j.A({level:15,resolution:4.77731426794937,scale:18055.954822}),new j.A({level:16,resolution:2.38865713397468,scale:9027.977411}),new j.A({level:17,resolution:1.19432856685505,scale:4513.988705}),new j.A({level:18,resolution:.597164283559817,scale:2256.994353}),new j.A({level:19,resolution:.298582141647617,scale:1128.497176}),new j.A({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return null!=this.bingMetadata?this.bingMetadata.copyright:null}get operationalLayerType(){return S.toJSON(this.style)}get bingLogo(){return null!=this.bingMetadata?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new o.A("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||null==this.bingMetadata)return null;const r=this.bingMetadata.resourceSets[0].resources[0],s=r.imageUrlSubdomains[t%r.imageUrlSubdomains.length],n=this._getQuadKey(e,t,i);return r.imageUrl.replace("{subdomain}",s).replace("{quadkey}",n)}async fetchAttributionData(){return this.load().then(()=>null==this.bingMetadata?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(e=>({zoomMin:e.zoomMin,zoomMax:e.zoomMax,score:1,bbox:[e.bbox[0],e.bbox[1],e.bbox[2],e.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return(0,n.A)(`https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(e=>{const t=e.data;if(200!==t.statusCode)throw new o.A("bingmapslayer:getmetadata",t.statusDescription);if(this.bingMetadata=t,0===this.bingMetadata.resourceSets.length)throw new o.A("bingmapslayer:getmetadata","no bing resourcesets");if(0===this.bingMetadata.resourceSets[0].resources.length)throw new o.A("bingmapslayer:getmetadata","no bing resources")}).catch(e=>{throw new o.A("bingmapslayer:getmetadata",e.message)})}_getPortalBingKey(){return(0,n.A)(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new o.A("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new o.A("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let r="";for(let s=e;s>0;s--){let e=0;const n=1<<s-1;0!==(i&n)&&(e+=1),0!==(t&n)&&(e+=2),r+=e.toString()}return r}};(0,s.Cg)([(0,p.MZ)({json:{read:!1,write:!1},value:null})],Z.prototype,"bingMetadata",null),(0,s.Cg)([(0,p.MZ)({json:{read:!1,write:!1},value:"bing-maps",readOnly:!0})],Z.prototype,"type",void 0),(0,s.Cg)([(0,p.MZ)({type:A.A})],Z.prototype,"tileInfo",void 0),(0,s.Cg)([(0,p.MZ)({type:String,readOnly:!0,json:{read:!1,write:!1}})],Z.prototype,"copyright",null),(0,s.Cg)([(0,p.MZ)({type:String,json:{write:!1,read:!1}})],Z.prototype,"key",void 0),(0,s.Cg)([(0,p.MZ)({type:S.apiValues,nonNullable:!0,json:{read:{source:"layerType",reader:S.read}}})],Z.prototype,"style",void 0),(0,s.Cg)([(0,p.MZ)({type:["BingMapsAerial","BingMapsHybrid","BingMapsRoad"]})],Z.prototype,"operationalLayerType",null),(0,s.Cg)([(0,p.MZ)({type:String,json:{write:!1,read:!1}})],Z.prototype,"culture",void 0),(0,s.Cg)([(0,p.MZ)({type:String,json:{write:!1,read:!1}})],Z.prototype,"region",void 0),(0,s.Cg)([(0,p.MZ)({type:String,json:{write:!0,read:!0}})],Z.prototype,"portalUrl",void 0),(0,s.Cg)([(0,p.MZ)({type:Boolean,json:{write:!1,read:!1}})],Z.prototype,"hasAttributionData",void 0),(0,s.Cg)([(0,p.MZ)({type:String,readOnly:!0})],Z.prototype,"bingLogo",null),Z=(0,s.Cg)([(0,d.$)("esri.layers.BingMapsLayer")],Z);const z=Z},33446:(e,t,i)=>{i.d(t,{C:()=>l,m:()=>n});var r=i(49186),s=i(74887);async function n(e,t,i){let n;try{n=await createImageBitmap(e)}catch(e){throw new r.A("request:server",`Unable to load ${t}`,{url:t,error:e})}return(0,s.Te)(i),n}async function l(e,t,i,n,l){let o;try{o=await createImageBitmap(e)}catch(e){throw new r.A("request:server",`Unable to load tile ${t}/${i}/${n}`,{error:e,level:t,row:i,col:n})}return(0,s.Te)(l),o}},69540:(e,t,i)=>{i.d(t,{OU:()=>c,Pw:()=>p});var r=i(31635),s=i(65008),n=(i(44208),i(4718)),l=(i(53966),i(97768)),o=i(88620),a=i(40608);const u=Symbol("ClonableMixin"),c=e=>{var t;const i=e;let s=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){const t=(0,o.oY)(this);(0,l.Lw)(t,"unable to clone instance of non-accessor class");const i=t.metadata,r=t.store,s={},a=new Map;for(const t in i){const l=i[t],o=r?.originOf(t),u=l.clonable;if(l.readOnly||!1===u||7!==o&&0!==o&&5!==o&&4!==o)continue;const c=this[t];let p=null;if("function"==typeof u)p=u(c,e);else if("reference"===u)p=c;else if(p=(0,n.TU)(c,e),null!=c&&null==p)continue;0===o?a.set(t,p):s[t]=p}const u=new(0,Object.getPrototypeOf(this).constructor)(s);if(a.size){const e=(0,o.oY)(u)?.store;if(e)for(const[t,i]of a)e.set(t,i,0)}return u}};return s=(0,r.Cg)([(0,a.$)("esri.core.Clonable")],s),s},p=c(s.A)},72802:(e,t,i)=>{i.d(t,{U:()=>r});class r{constructor(e,t,i,r,s=void 0){this.id=e,this.level=t,this.row=i,this.col=r,this.extent=s}}},78553:(e,t,i)=>{i.d(t,{D:()=>n,p:()=>s});var r=i(56507);function s(e){const t=(0,r.Vr)(100*(1-e));return Math.max(0,Math.min(t,100))}function n(e){const t=1-e/100;return Math.max(0,Math.min(t,1))}},79677:(e,t,i)=>{i.d(t,{A:()=>d});var r,s=i(31635),n=i(25482),l=i(88930),o=i(10107),a=(i(44208),i(53966),i(87811),i(36005)),u=i(40608),c=i(43937),p=i(98623);let d=class extends n.o{static{r=this}static get allTime(){return g}static get empty(){return h}static fromArray(e){return new r({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,i=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===r&&i===s}expandTo(e,t=p.qU){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=(0,l.lL)(i,e,t));let s=this.end;if(s){const i=(0,l.lL)(s,e,t);s=s.getTime()===i.getTime()?i:(0,l.S1)(i,1,e,t)}return new r({start:i,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,i=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let l,o;return s>=t&&s<=i?l=s:t>=s&&t<=n&&(l=t),i>=s&&i<=n?o=i:n>=t&&n<=i&&(o=n),null==l||null==o||isNaN(l)||isNaN(o)?r.empty:new r({start:l===-1/0?null:new Date(l),end:o===1/0?null:new Date(o)})}offset(e,t,i=p.qU){if(this.isEmpty||this.isAllTime)return this.clone();const s=new r,{start:n,end:o}=this;return null!=n&&(s.start=(0,l.S1)(n,e,t,i)),null!=o&&(s.end=(0,l.S1)(o,e,t,i)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return g.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:i})}};(0,s.Cg)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,s.Cg)([(0,a.w)("end")],d.prototype,"readEnd",null),(0,s.Cg)([(0,c.K)("end")],d.prototype,"writeEnd",null),(0,s.Cg)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,s.Cg)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,s.Cg)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,s.Cg)([(0,a.w)("start")],d.prototype,"readStart",null),(0,s.Cg)([(0,c.K)("start")],d.prototype,"writeStart",null),d=r=(0,s.Cg)([(0,u.$)("esri.time.TimeExtent")],d);const g=new d,h=new d({start:void 0,end:void 0})},87045:(e,t,i)=>{i.d(t,{A:()=>M});var r,s=i(31635),n=i(66552),l=i(25482),o=i(83047),a=i(10107),u=i(56507),c=(i(44208),i(87811),i(36005)),p=i(40608),d=i(43937),g=i(86738),h=i(16930),y=i(19419),w=i(21325),f=i(28735),m=i(91806),v=i(72802);const b=new n.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let M=class extends l.o{static{r=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:s=256,spatialReference:n=h.A.WebMercator,numLODs:l=24}=e;if(!(0,w.fn)(n)){const e=[];if(i)for(let t=0;t<i.length;t++){const r=i[t];e.push(new m.A({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=l-1;i>=0;i--)e.unshift(new m.A({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new g.A(0,0,n),size:[s,s],spatialReference:n})}const a=(0,w.Vp)(n),u=e.origin?new g.A({x:e.origin.x,y:e.origin.y,spatialReference:n}):new g.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),c=1/(39.37*(0,o.GA)(n)*96),p=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],r=t*c;p.push(new m.A({level:e,scale:t,resolution:r}))}else{let e=(0,w.EA)(n)?512/s*591657527.5917094:256/s*591657527.591555;const i=Math.ceil(l/t);p.push(new m.A({level:0,scale:e,resolution:e*c}));for(let r=1;r<i;r++){const i=e/2**t,s=i*c;p.push(new m.A({level:r,scale:i,resolution:s})),e=i}}return new r({dpi:96,lods:p,origin:u,size:[s,s],spatialReference:n})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,w.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return g.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const r=[],s=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{r.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,s[e.level]=e})),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let r=0;for(;r<i;r++){const i=t[r],s=t[r+1];if(i<=e)return r;if(s===e)return r+1;if(i>e&&s<e)return r+Math.log(i/e)/Math.log(i/s)}return r}tileAt(e,t,i,r){const s=this.lodAt(e);if(!s)return null;let n,l;if("number"==typeof t)n=t,l=i;else if((0,w.aI)(t.spatialReference,this.spatialReference))n=t.x,l=t.y,r=i;else{const e=(0,f.Cv)(t,this.spatialReference);if(null==e)return null;n=e.x,l=e.y,r=i}const o=s.resolution*this.size[0],a=s.resolution*this.size[1];return r||(r=new v.U(null,0,0,0,(0,y.vt)())),r.level=e,r.row=Math.floor((this.origin.y-l)/a+.001),r.col=Math.floor((n-this.origin.x)/o+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=0){let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const r=e.level-i.level,s=i.resolution*this.size[0]/2**r,n=i.resolution*this.size[1]/2**r;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,y.vt)()),e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+n}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:r}=i,s=r*this.size[0],n=r*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*n,e[2]=e[0]+s,e[3]=e[1]+n,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],s=this.lods.length-t;for(let e=0;e<s;e++){const r=e+t,{scale:s,resolution:n}=r>=0?this.lods[r]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new m.A({level:e,scale:s,resolution:n}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};(0,s.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],M.prototype,"compressionQuality",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],M.prototype,"dpi",void 0),(0,s.Cg)([(0,a.MZ)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],M.prototype,"format",void 0),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],M.prototype,"isWrappable",null),(0,s.Cg)([(0,a.MZ)({type:g.A,json:{write:!0}})],M.prototype,"origin",void 0),(0,s.Cg)([(0,c.w)("origin")],M.prototype,"readOrigin",null),(0,s.Cg)([(0,a.MZ)({type:[m.A],value:null,json:{write:!0}})],M.prototype,"lods",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],M.prototype,"scales",void 0),(0,s.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],M.prototype,"size",void 0),(0,s.Cg)([(0,c.w)("size",["rows","cols"])],M.prototype,"readSize",null),(0,s.Cg)([(0,d.K)("size",{cols:{type:u.jz},rows:{type:u.jz}})],M.prototype,"writeSize",null),(0,s.Cg)([(0,a.MZ)({type:h.A,json:{write:!0}})],M.prototype,"spatialReference",void 0),M=r=(0,s.Cg)([(0,p.$)("esri.layers.support.TileInfo")],M)},91806:(e,t,i)=>{i.d(t,{A:()=>u});var r,s=i(31635),n=i(25482),l=i(10107),o=i(56507),a=(i(44208),i(87811),i(40608));let u=class extends n.o{static{r=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,s.Cg)([(0,l.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"cols",void 0),(0,s.Cg)([(0,l.MZ)({type:o.jz,json:{write:!0}})],u.prototype,"level",void 0),(0,s.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],u.prototype,"levelValue",void 0),(0,s.Cg)([(0,l.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"origin",void 0),(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],u.prototype,"resolution",void 0),(0,s.Cg)([(0,l.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"rows",void 0),(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],u.prototype,"scale",void 0),u=r=(0,s.Cg)([(0,a.$)("esri.layers.support.LOD")],u)}}]);
|