@arcgis/core 4.28.0-next.20230729 → 4.28.0-next.20230801

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/1b55a562f8dba4d0f44f.js +1 -0
  3. package/assets/esri/core/workers/chunks/{182d6d264c27cba0679e.js → 1ccb2c4007e2729bc7de.js} +1 -1
  4. package/assets/esri/core/workers/chunks/253b4da40a0808c8419d.js +1 -0
  5. package/assets/esri/core/workers/chunks/2bb4d1e09fc7b182fc2c.js +1 -0
  6. package/assets/esri/core/workers/chunks/{47e39ea18d665208a5e5.js → 2e4d550751be7031783f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{eb240dc2570e3649665d.js → 35c65646b2c8c5f9c926.js} +1 -1
  8. package/assets/esri/core/workers/chunks/46c245daf1244625d353.js +1 -0
  9. package/assets/esri/core/workers/chunks/{14a6067d462b75794d24.js → 68657e7a845fbec517b6.js} +1 -1
  10. package/assets/esri/core/workers/chunks/6a7fb6f95bcc5953a581.js +1 -0
  11. package/assets/esri/core/workers/chunks/6c96e0e5e4af72d88b8b.js +1 -0
  12. package/assets/esri/core/workers/chunks/7bba310c4a8787864159.js +1 -0
  13. package/assets/esri/core/workers/chunks/8ab084d7c7f3f44712f4.js +1 -0
  14. package/assets/esri/core/workers/chunks/914adb8839e250bb8390.js +1 -0
  15. package/assets/esri/core/workers/chunks/{2d9d80b2d0042a9c09fb.js → 92ed6ca73ca080d9f1a7.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{0dccbc6c2559fdc0c2ad.js → a82cbf399ff34c63d265.js} +1 -1
  17. package/assets/esri/core/workers/chunks/aadbdc5f09bb6d39f0e2.js +1 -0
  18. package/assets/esri/core/workers/chunks/b6ba935da9884de355d3.js +1 -0
  19. package/assets/esri/core/workers/chunks/bce770970078fc4549a8.js +1 -0
  20. package/assets/esri/core/workers/chunks/{c7ceba668013e9740ce2.js → c79368559fad8e7ca9cf.js} +1 -1
  21. package/assets/esri/core/workers/chunks/e21315601e2e3301aa3a.js +1 -0
  22. package/assets/esri/core/workers/chunks/e5e59fff4e41a69eb477.js +1 -0
  23. package/assets/esri/core/workers/chunks/e83c9a71d2cce98c5a57.js +1 -0
  24. package/assets/esri/core/workers/chunks/{5f36b5fe1ee4194a4824.js → f9738ee5a97115e8735f.js} +1 -1
  25. package/assets/esri/themes/base/widgets/_Features.scss +35 -1
  26. package/assets/esri/themes/dark/main.css +1 -1
  27. package/assets/esri/themes/light/main.css +1 -1
  28. package/assets/esri/themes/light/view.css +1 -1
  29. package/chunks/index.js +1 -1
  30. package/core/image/apng.js +1 -1
  31. package/core/image/gif.js +1 -1
  32. package/core/imageUtils.js +1 -1
  33. package/interfaces.d.ts +1 -1
  34. package/layers/SubtypeGroupLayer.js +1 -1
  35. package/layers/mixins/RefreshableLayer.js +1 -1
  36. package/layers/support/Subtype.js +1 -1
  37. package/layers/support/SubtypeSublayer.js +1 -1
  38. package/layers/support/rasterFunctions/ContrastBrightnessFunction.js +5 -0
  39. package/layers/support/rasterFunctions/ContrastBrightnessFunctionArguments.js +5 -0
  40. package/layers/support/rasterFunctions/StatisticsFunctionArguments.js +1 -1
  41. package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
  42. package/package.json +1 -1
  43. package/support/revision.js +1 -1
  44. package/views/2d/engine/imagery/processor/contrastProcessor.js +5 -0
  45. package/views/2d/engine/imagery/processor/rasterProcessor.js +1 -1
  46. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  47. package/views/2d/layers/MediaLayerView2D.js +1 -1
  48. package/views/2d/layers/TileLayerView2D.js +1 -1
  49. package/views/draw/support/HighlightHelper.js +1 -1
  50. package/webdoc/webdocLoadUtils.js +1 -1
  51. package/widgets/Editor/EditorViewModel.js +1 -1
  52. package/widgets/FeatureForm/FieldInput.js +1 -1
  53. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  54. package/widgets/FeatureForm.js +1 -1
  55. package/widgets/FeatureTable/FieldColumn.js +1 -1
  56. package/widgets/Features/FeaturesRelatedRecords.js +1 -1
  57. package/widgets/Features/FeaturesVisibleElements.js +1 -1
  58. package/widgets/Features/css.js +1 -1
  59. package/widgets/Features.js +1 -1
  60. package/widgets/Popup/PopupViewModel.js +1 -1
  61. package/widgets/Popup/actions.js +1 -1
  62. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  63. package/widgets/support/Selector2D/SelectionOperation2D.js +1 -1
  64. package/widgets/support/Selector2D.js +1 -1
  65. package/widgets/support/chartUtils.js +1 -1
  66. package/widgets/support/dateUtils.js +5 -0
  67. package/assets/esri/core/workers/chunks/0d656759ea733b21d018.js +0 -1
  68. package/assets/esri/core/workers/chunks/2c57c9bd71637c5bed8a.js +0 -1
  69. package/assets/esri/core/workers/chunks/317a39368da0c03b6315.js +0 -1
  70. package/assets/esri/core/workers/chunks/3c95800e6f8d6a8f7ec3.js +0 -1
  71. package/assets/esri/core/workers/chunks/467a780059e4725e5bd7.js +0 -1
  72. package/assets/esri/core/workers/chunks/4afe954fa8ab750d0edd.js +0 -1
  73. package/assets/esri/core/workers/chunks/5361afe34a5c95ea2526.js +0 -1
  74. package/assets/esri/core/workers/chunks/721ac89b13134f2377bf.js +0 -1
  75. package/assets/esri/core/workers/chunks/9c133fd8c1fbd0295b86.js +0 -1
  76. package/assets/esri/core/workers/chunks/a2a403b24f6a9618f619.js +0 -1
  77. package/assets/esri/core/workers/chunks/bea5428738e358379620.js +0 -1
  78. package/assets/esri/core/workers/chunks/c9dfe3fe8c17406a7223.js +0 -1
  79. package/assets/esri/core/workers/chunks/d86ec98a0582cd3dfe8c.js +0 -1
  80. package/assets/esri/core/workers/chunks/ec86a1b86ef43e5caf20.js +0 -1
  81. package/chunks/index2.js +0 -5
  82. package/chunks/index3.js +0 -5
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[24,8008,8062],{10699:(e,a,r)=>{r.d(a,{IG:()=>l,iv:()=>o});var t=r(43697),n=r(52011);let i=0;const l=e=>{let a=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+i++})}};return a=(0,t._)([(0,n.j)("esri.core.Identifiable")],a),a},o=e=>{let a=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:i++})}};return a=(0,t._)([(0,n.j)("esri.core.NumericIdentifiable")],a),a};let s=class extends(l(class{})){};s=(0,t._)([(0,n.j)("esri.core.Identifiable")],s)},87085:(e,a,r)=>{r.d(a,{Z:()=>w});var t=r(43697),n=(r(66577),r(3172)),i=r(20102),l=r(32448),o=r(10699),s=r(83379),y=r(92604),c=r(95330),u=r(17452),d=r(5600),p=(r(75215),r(67676),r(80442),r(52011)),L=r(68773),f=r(6570),m=r(82971);let S=0,b=class extends(l.Z.EventedMixin((0,o.IG)(s.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.Z(-180,-90,180,90,m.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+S++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=m.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const a="string"==typeof e?{url:e}:e;return(await r.e(3529).then(r.bind(r,63529))).fromUrl(a)}static fromPortalItem(e){return async function(e){const a="portalItem"in e?e:{portalItem:e},{fromItem:t}=await r.e(8008).then(r.bind(r,28008));try{return await t(a)}catch(e){const r=a&&a.portalItem,t=r&&r.id||"unset",n=r&&r.portal&&r.portal.url||L.default.portalUrl;throw y.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+n+"', id: '"+t+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,c.D_)(e)||y.Z.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const a=this;"layers"in e&&e.layers.includes(a)?e.layers.remove(a):"tables"in e&&e.tables.includes(a)?e.tables.remove(a):"baseLayers"in e&&e.baseLayers.includes(a)?e.baseLayers.remove(a):"referenceLayers"in e&&e.referenceLayers.includes(a)&&e.referenceLayers.remove(a),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,u.mN)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,n.Z)(e,{query:{f:"json"},responseType:"json"})).data;throw new i.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,t._)([(0,d.Cb)({type:String})],b.prototype,"attributionDataUrl",void 0),(0,t._)([(0,d.Cb)({type:f.Z})],b.prototype,"fullExtent",void 0),(0,t._)([(0,d.Cb)({readOnly:!0})],b.prototype,"hasAttributionData",null),(0,t._)([(0,d.Cb)({type:String,clonable:!1})],b.prototype,"id",void 0),(0,t._)([(0,d.Cb)({type:Boolean,nonNullable:!0})],b.prototype,"legendEnabled",void 0),(0,t._)([(0,d.Cb)({type:["show","hide","hide-children"]})],b.prototype,"listMode",void 0),(0,t._)([(0,d.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],b.prototype,"opacity",void 0),(0,t._)([(0,d.Cb)({clonable:!1})],b.prototype,"parent",void 0),(0,t._)([(0,d.Cb)({readOnly:!0})],b.prototype,"parsedUrl",null),(0,t._)([(0,d.Cb)({type:Boolean})],b.prototype,"popupEnabled",void 0),(0,t._)([(0,d.Cb)({type:Boolean})],b.prototype,"attributionVisible",void 0),(0,t._)([(0,d.Cb)({type:m.Z})],b.prototype,"spatialReference",void 0),(0,t._)([(0,d.Cb)({type:String})],b.prototype,"title",void 0),(0,t._)([(0,d.Cb)({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0),(0,t._)([(0,d.Cb)()],b.prototype,"url",void 0),(0,t._)([(0,d.Cb)({type:Boolean,nonNullable:!0})],b.prototype,"visible",void 0),b=(0,t._)([(0,p.j)("esri.layers.Layer")],b);const w=b},52104:(e,a,r)=>{r.d(a,{V:()=>n});var t=r(96187);async function n(e,a){const r=await(0,t.T)(e,a);r.layers=r.layers.filter(i);const n={serviceJSON:r};if((r.currentVersion??0)<10.5)return n;const l=await(0,t.T)(e+"/layers",a);return n.layersJSON={layers:l.layers.filter(i),tables:l.tables},n}function i(e){return!e.type||"Feature Layer"===e.type}},70024:(e,a,r)=>{r.d(a,{populateOperationalLayers:()=>y});var t=r(46791),n=(r(80442),r(87344)),i=r(15235);function l(e,a){return!(!e.layerType||"ArcGISFeatureLayer"!==e.layerType)&&e.featureCollectionType===a}var o=r(28008),s=r(40555);async function y(e,a,r){if(!a)return;const t=[];for(const e of a){const a=w(e,r);"GroupLayer"===e.layerType?t.push(T(a,e,r)):t.push(a)}const n=await Promise.allSettled(t);for(const a of n)"rejected"===a.status||a.value&&e.add(a.value)}const c={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},u={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},d={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},p={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},L={ArcGISFeatureLayer:"FeatureLayer"},f={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},m={...p,LinkChartLayer:"LinkChartLayer"},S={...L},b={...f};async function w(e,a){return async function(e,a,r){const t=new e;return t.read(a,r.context),"group"===t.type&&h(a)&&await async function(e,a,r){const t=n.T.FeatureLayer,i=await t(),l=a.featureCollection,o=l?.showLegend,s=l?.layers?.map(((t,n)=>{const l=new i;l.read(t,r);const s={...r,ignoreDefaults:!0};return l.read({id:`${e.id}-sublayer-${n}`,visibility:a.visibleLayers?.includes(n)??!0},s),null!=o&&l.read({showLegend:o},s),l}));e.layers.addMany(s??[])}(t,a,r.context),await(0,s.y)(t,r.context),t}(await async function(e,a){const r=a.context,t=g(r);let s=e.layerType||e.type;!s&&a&&a.defaultLayerType&&(s=a.defaultLayerType);const y=t[s];let c=y?n.T[y]:n.T.UnknownLayer;if(I(e)){const a=r?.portal;if(e.itemId){const r=new i.default({id:e.itemId,portal:a});await r.load();const t=(await(0,o.v)(r)).className||"UnknownLayer";c=n.T[t]}}else"ArcGISFeatureLayer"===s?function(e){return l(e,"notes")}(e)||function(e){return l(e,"markup")}(e)?c=n.T.MapNotesLayer:function(e){return l(e,"route")}(e)?c=n.T.RouteLayer:h(e)&&(c=n.T.GroupLayer):e.wmtsInfo&&e.wmtsInfo.url&&e.wmtsInfo.layerIdentifier?c=n.T.WMTSLayer:"WFS"===s&&"2.0.0"!==e.wfsInfo?.version&&(c=n.T.UnsupportedLayer);return c()}(e,a),e,a)}function h(e){return"ArcGISFeatureLayer"===e.layerType&&!I(e)&&(e.featureCollection?.layers?.length??0)>1}function I(e){return"Feature Collection"===e.type}function g(e){let a;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":a=d;break;case"ground":a=u;break;default:a=c}break;case"link-chart":switch(e.layerContainerType){case"basemap":a=b;break;case"tables":a=S;break;default:a=m}break;default:switch(e.layerContainerType){case"basemap":a=f;break;case"tables":a=L;break;default:a=p}}return a}async function T(e,a,r){const n=new t.Z,i=y(n,Array.isArray(a.layers)?a.layers:[],r);try{const a=await e;try{if(await i,"group"===a.type)return a.layers.addMany(n),a}catch(e){a.destroy();for(const e of n)e.destroy();throw e}}catch(e){throw e}}},87344:(e,a,r)=>{r.d(a,{T:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(8153)]).then(r.bind(r,2723))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(3712),r.e(9238),r.e(889),r.e(5243),r.e(37),r.e(4202)]).then(r.bind(r,30223))).default,CSVLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(3712),r.e(9238),r.e(3025)]).then(r.bind(r,45425))).default,DimensionLayer:async()=>(await Promise.all([r.e(163),r.e(9717)]).then(r.bind(r,40081))).default,ElevationLayer:async()=>(await Promise.all([r.e(163),r.e(6569),r.e(223),r.e(1596)]).then(r.bind(r,65665))).default,FeatureLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(3712),r.e(9238),r.e(3582)]).then(r.bind(r,19238))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(3398)]).then(r.bind(r,23477))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(8024)]).then(r.bind(r,3723))).default,GroupLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9059)]).then(r.bind(r,40504))).default,ImageryLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(5983),r.e(4599),r.e(6610),r.e(4885),r.e(1194)]).then(r.bind(r,90444))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(223),r.e(6610),r.e(8579),r.e(4885),r.e(4578)]).then(r.bind(r,74878))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(163),r.e(889),r.e(1537)]).then(r.bind(r,9310))).default,KMLLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(1423),r.e(853)]).then(r.bind(r,42756))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(163),r.e(4998)]).then(r.bind(r,21786))).default,LinkChartLayer:async()=>(await Promise.all([r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(1534),r.e(3194),r.e(5647)]).then(r.bind(r,28552))).default,MapImageLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(5983),r.e(1423),r.e(3887),r.e(4599),r.e(8855),r.e(7374)]).then(r.bind(r,27374))).default,MapNotesLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(3712),r.e(9238),r.e(9370)]).then(r.bind(r,62128))).default,MediaLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(4828)]).then(r.bind(r,57765))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(8263)]).then(r.bind(r,88068))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9971),r.e(6237)]).then(r.bind(r,66237))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(3712),r.e(9238),r.e(17)]).then(r.bind(r,76604))).default,PointCloudLayer:async()=>(await Promise.all([r.e(163),r.e(1773),r.e(889),r.e(4266),r.e(6138)]).then(r.bind(r,10608))).default,RouteLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(1423),r.e(1007)]).then(r.bind(r,40153))).default,SceneLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(3712),r.e(9238),r.e(889),r.e(5243),r.e(37),r.e(7476)]).then(r.bind(r,57476))).default,StreamLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(5242)]).then(r.bind(r,88387))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(5983),r.e(1423),r.e(3887),r.e(3712),r.e(2637)]).then(r.bind(r,30359))).default,TileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(5983),r.e(1423),r.e(3887),r.e(4599),r.e(223),r.e(8855),r.e(8636)]).then(r.bind(r,98636))).default,UnknownLayer:async()=>(await r.e(4166).then(r.bind(r,44166))).default,UnsupportedLayer:async()=>(await r.e(9296).then(r.bind(r,39296))).default,VectorTileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(223),r.e(4325),r.e(9805),r.e(5481)]).then(r.bind(r,94756))).default,VoxelLayer:async()=>(await Promise.all([r.e(163),r.e(1773),r.e(889),r.e(7528)]).then(r.bind(r,28865))).default,WFSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(7153),r.e(6569),r.e(5983),r.e(1423),r.e(3887),r.e(6404),r.e(3155)]).then(r.bind(r,12653))).default,WMSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9790),r.e(1773),r.e(2462)]).then(r.bind(r,25906))).default,WMTSLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9971),r.e(2594)]).then(r.bind(r,72594))).default,WebTileLayer:async()=>(await Promise.all([r.e(163),r.e(4609),r.e(9971)]).then(r.bind(r,16199))).default}},33516:(e,a,r)=>{r.d(a,{Y:()=>l,h:()=>i});var t=r(17452),n=r(48522);function i(e){return{origin:"portal-item",url:(0,t.mN)(e.itemUrl),portal:e.portal||n.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function l(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?(0,t.mN)(e.itemUrl):null,portal:e.portal||n.Z.getDefault(),portalItem:e}}},18062:(e,a,r)=>{r.d(a,{$O:()=>b,Ok:()=>w,Q4:()=>h,XX:()=>I,load:()=>p});var t=r(20102),n=r(87085),i=r(66677),l=r(52104),o=r(48522),s=r(15235),y=r(33516),c=r(14661),u=r(40555),d=r(96187);async function p(e,a){const r=e.instance.portalItem;if(r&&r.id)return await r.load(a),function(e){const a=e.instance.portalItem;if(!a?.type||!e.supportedTypes.includes(a.type))throw new t.Z("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a?.type,expectedType:e.supportedTypes.join(", ")})}(e),async function(e,a){const r=e.instance,n=r.portalItem;if(!n)return;const{url:i,title:o}=n,s=(0,y.h)(n);if("group"===r.type)return r.read({title:o},s),async function(e,a){let r;const{portalItem:n}=e;if(!n)return;const i=n.type,o=a.layerModuleTypeMap,s=(0,c._$)(n,"Oriented Imagery Layer")??!1;switch(i){case"Feature Service":r=s?o.OrientedImageryLayer:o.FeatureLayer;break;case"Stream Service":r=o.StreamLayer;break;case"Scene Service":r=o.SceneLayer;break;case"Feature Collection":r=o.FeatureLayer;break;default:throw new t.Z("portal:unsupported-item-type-as-group",`The item type '${i}' is not supported as a 'IGroupLayer'`)}let[y,u]=await Promise.all([r(),S(a)]),p=()=>y;if("Feature Service"===i){if(u=n.url?await b(u,n.url):{},I(u).length){const e=o.SubtypeGroupLayer,a=await e();p=e=>"SubtypeGroupLayer"===e.layerType?a:y}return f(e,p,u,await async function(e){const{layersJSON:a}=await(0,l.V)(e);if(!a)return null;const r=[...a.layers,...a.tables];return e=>r.find((a=>a.id===e.id))}(n.url))}return h(u)>0?f(e,p,u):async function(e,a){const{portalItem:r}=e;if(!r?.url)return;const t=await(0,d.T)(r.url);t&&f(e,a,{layers:t.layers?.map(L),tables:t.tables?.map(L)})}(e,p)}(r,e);i&&r.read({url:i},s);const p=await S(e,a);return p&&r.read(p,s),r.resourceReferences={portalItem:n,paths:s.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:o},s),(0,u.y)(r,s)}(e,a)}function L(e){return{id:e.id,name:e.name}}function f(e,a,r,l){let o=r.layers||[];const y=r.tables||[];if("Feature Collection"===e.portalItem?.type&&(o.forEach((e=>{"Table"===e?.layerDefinition?.type&&y.push(e)})),o=o.filter((e=>"Table"!==e?.layerDefinition?.type))),"coverage"in r){const a=function(e){const{coverage:a}=e;if(!a)return null;const r=new URL(a);if(a.toLowerCase().includes("item.html")){const e=r.searchParams.get("id"),a=r.origin;return n.Z.fromPortalItem({portalItem:new s.default({id:e,url:a})})}if((0,i.B5)(a))return n.Z.fromArcGISServerUrl({url:a});throw new t.Z("portal:oriented-imagery-layer-coverage","the provided coverage url couldn't be loaded as a layer")}(r);a&&e.add(a)}o.reverse().forEach((t=>{const n=l?.(t);if(n||!l){const i=m(e,a(t),r,t,n);e.add(i)}})),y.reverse().forEach((t=>{const n=l?.(t);if(n||!l){const i=m(e,a(t),r,t,n);e.tables.add(i)}}))}function m(e,a,r,t,n){const i=e.portalItem,l=new a({portalItem:i.clone(),layerId:t.id});if("sourceJSON"in l&&(l.sourceJSON=n),"subtype-group"!==l.type&&(l.sublayerTitleMode="service-name"),"Feature Collection"===i.type){const e={origin:"portal-item",portal:i.portal||o.Z.getDefault()};l.read(t,e);const a=r.showLegend;null!=a&&l.read({showLegend:a},e)}return l}async function S(e,a){if(!1===e.supportsData)return;const r=e.instance,t=r.portalItem;if(!t)return;let n=null;try{n=await t.fetchData("json",a)}catch(e){}if(function(e){return"stream"!==e.type&&"oriented-imagery"!==e.type&&"layerId"in e}(r)){let e=null,a=!0;if(n&&h(n)>0){if(null==r.layerId){const e=I(n);r.layerId="subtype-group"===r.type?e?.[0]:w(n)}e=function(e,a){const{layerId:r}=a,t=e.layers?.find((e=>e.id===r))||e.tables?.find((e=>e.id===r));return t&&function(e,a){return!("feature"===a.type&&"layerType"in e&&"SubtypeGroupLayer"===e.layerType||"subtype-group"===a.type&&!("layerType"in e))}(t,a)?t:null}(n,r),e&&(1===h(n)&&(a=!1),null!=n.showLegend&&(e.showLegend=n.showLegend))}return a&&"sublayerTitleMode"in r&&"service-name"!==r.sublayerTitleMode&&(r.sublayerTitleMode="item-title-and-service-name"),e}return n}async function b(e,a){if(null==e?.layers||null==e?.tables){const r=await(0,d.T)(a);(e=e||{}).layers=e.layers||r?.layers,e.tables=e.tables||r?.tables}return e}function w(e){const a=e.layers;if(a&&a.length)return a[0].id;const r=e.tables;return r&&r.length?r[0].id:null}function h(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function I(e){const a=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&a.push(e.id)})),a}},14661:(e,a,r)=>{r.d(a,{$o:()=>u,Ct:()=>c,Fj:()=>s,Kz:()=>d,Ss:()=>p,_$:()=>o,ck:()=>y,qj:()=>l});var t=r(44547),n=r(82971),i=r(40488);function l(e,a){if(!o(e,a)){const r=e.typeKeywords;r?r.push(a):e.typeKeywords=[a]}}function o(e,a){return!!e.typeKeywords?.includes(a)}function s(e){return o(e,d.HOSTED_SERVICE)}function y(e,a){const r=e.typeKeywords;if(r){const e=r.indexOf(a);e>-1&&r.splice(e,1)}}function c(e,a,r){r?l(e,a):y(e,a)}async function u(e){const a=e.clone().normalize();let r;if(a.length>1)for(const e of a)r?e.width>r.width&&(r=e):r=e;else r=a[0];return async function(e){const a=e.spatialReference;if(a.isWGS84)return e.clone();if(a.isWebMercator)return(0,i.Sx)(e);const r=n.Z.WGS84;return await(0,t.initializeProjection)(a,r),(0,t.iV)(e,r)}(r)}const d={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local"};function p(e){const{portal:a,isOrgItem:r,itemControl:t}=e,n=a.user?.privileges;let i=!n||n.includes("features:user:edit"),l=!!r&&!!n?.includes("features:user:fullEdit");const o="update"===t||"admin"===t;return o?l=i=!0:l&&(i=!0),{features:{edit:i,fullEdit:l},content:{updateItem:o}}}},28008:(e,a,r)=>{r.d(a,{fromItem:()=>c,v:()=>u});var t=r(20102),n=r(84230),i=r(87344),l=r(15235),o=r(18062),s=r(14661),y=r(96187);async function c(e){!e.portalItem||e.portalItem instanceof l.default||(e={...e,portalItem:new l.default(e.portalItem)});const a=await async function(e){return await e.load(),async function(e){const a=e.className,r=i.T[a];return{constructor:await r(),properties:e.properties}}(await u(e))}(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function u(e){switch(e.type){case"Map Service":return async function(e){return await async function(e){return(await(0,y.T)(e.url)).tileInfo}(e)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e);case"Feature Service":return async function(e){if((0,s._$)(e,"Oriented Imagery Layer"))return async function(e){return await e.load(),{className:"OrientedImageryLayer",properties:await e.fetchData()}}(e);const a=await d(e);if("object"==typeof a){const e={};return null!=a.id&&(e.layerId=a.id),{className:a.className||"FeatureLayer",properties:e}}return{className:"GroupLayer"}}(e);case"Feature Collection":return async function(e){await e.load();const a=(0,s._$)(e,"Map Notes"),r=(0,s._$)(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if((0,s._$)(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===(0,o.Q4)(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Scene Service":return async function(e){const a=await d(e);if("object"==typeof a){const r={};let t;if(null!=a.id?(r.layerId=a.id,t=`${e.url}/layers/${a.id}`):t=e.url,e.typeKeywords?.length)for(const a of Object.keys(n.fb))if(e.typeKeywords.includes(a))return{className:n.fb[a]};const i=await(0,y.T)(t);return{className:n.fb[i?.layerType]||"SceneLayer",properties:r}}if(!1===a){const a=await(0,y.T)(e.url);return"Voxel"===a?.layerType?{className:"VoxelLayer"}:{className:"GroupLayer"}}return{className:"GroupLayer"}}(e);case"Image Service":return async function(e){await e.load();const a=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(a.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(a.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await e.fetchData(),t=r?.layerType;if("ArcGISTiledImageServiceLayer"===t)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===t)return{className:"ImageryLayer"};const n=await(0,y.T)(e.url),i=n.cacheType?.toLowerCase(),l=n.capabilities?.toLowerCase().includes("tilesonly");return"map"===i||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e);case"Stream Service":case"Feed":return{className:"StreamLayer"};case"Vector Tile Service":return{className:"VectorTileLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"CSV":return{className:"CSVLayer"};case"KML":return{className:"KMLLayer"};case"WFS":return{className:"WFSLayer"};case"WMTS":return{className:"WMTSLayer"};case"WMS":return{className:"WMSLayer"};default:throw new t.Z("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function d(e){const a=e.url;if(!a||/\/\d+$/.test(a))return{};await e.load();const r=await e.fetchData();if("Feature Service"===e.type){const e=p(await(0,o.$O)(r,a));if("object"==typeof e){const a=(0,o.XX)(r);e.className=null!=e.id&&a.includes(e.id)?"SubtypeGroupLayer":"FeatureLayer"}return e}return(0,o.Q4)(r)>0?p(r):p(await(0,y.T)(a))}function p(e){return 1===(0,o.Q4)(e)&&{id:(0,o.Ok)(e)}}},40555:(e,a,r)=>{r.d(a,{y:()=>l});var t=r(66643),n=r(95330),i=r(20941);async function l(e,a,r){const l=e&&e.getAtOrigin&&e.getAtOrigin("renderer",a.origin);if(l&&"unique-value"===l.type&&l.styleOrigin){const o=await(0,t.q6)(l.populateFromStyle());if((0,n.k_)(r),!1===o.ok){const r=o.error;a&&a.messages&&a.messages.push(new i.Z("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:a})),e.clear("renderer",a?.origin)}}}},96187:(e,a,r)=>{r.d(a,{T:()=>n});var t=r(3172);async function n(e,a){const{data:r}=await(0,t.Z)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[853,5732],{92835:(e,t,s)=>{s.d(t,{Z:()=>p});var r,i=s(43697),n=s(96674),o=s(35463),l=s(5600),a=(s(75215),s(67676),s(80442),s(71715)),u=s(52011),h=s(30556);let c=r=class extends n.wq{static get allTime(){return d}static get empty(){return f}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?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?e.getTime():null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=null!=this.start?this.start.getTime():this.start,s=null!=this.end?this.end.getTime():this.end,r=null!=e.start?e.start.getTime():e.start,i=null!=e.end?e.end.getTime():e.end;return t===r&&s===i}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();let t=this.start;t&&(t=(0,o.JE)(t,e));let s=this.end;if(s){const t=(0,o.JE)(s,e);s=s.getTime()===t.getTime()?t:(0,o.Nm)(t,1,e)}return new r({start:t,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,s=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let o,l;if(i>=t&&i<=s?o=i:t>=i&&t<=n&&(o=t),s>=i&&s<=n?l=s:n>=t&&n<=s&&(l=n),null!=o&&null!=l&&!isNaN(o)&&!isNaN(l)){const e=new r;return e.start=o===-1/0?null:new Date(o),e.end=l===1/0?null:new Date(l),e}return r.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const s=new r,{start:i,end:n}=this;return null!=i&&(s.start=(0,o.Nm)(i,e,t)),null!=n&&(s.end=(0,o.Nm)(n,e,t)),s}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return d.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:s})}};(0,i._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"end",void 0),(0,i._)([(0,a.r)("end")],c.prototype,"readEnd",null),(0,i._)([(0,h.c)("end")],c.prototype,"writeEnd",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],c.prototype,"isAllTime",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],c.prototype,"isEmpty",null),(0,i._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"start",void 0),(0,i._)([(0,a.r)("start")],c.prototype,"readStart",null),(0,i._)([(0,h.c)("start")],c.prototype,"writeStart",null),c=r=(0,i._)([(0,u.j)("esri.TimeExtent")],c);const d=new c,f=new c({start:void 0,end:void 0}),p=c},5732:(e,t,s)=>{s.d(t,{c:()=>r,g:()=>i});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},57435:(e,t,s)=>{s.d(t,{Z:()=>u});var r=s(43697),i=s(46791),n=(s(66643),s(20102),s(92604),s(26258),s(87538)),o=s(5600),l=s(52011);let a=class extends i.Z{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,n.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=null!=this.getCollections?this.getCollections():null;if(null==e)return void this.removeAll();let t=0;for(const s of e)null!=s&&(t=this._processCollection(t,s));this.splice(t,this.length)}_createNewInstance(e){return new i.Z(e)}_processCollection(e,t){if(!t)return e;const s=this.itemFilterFunction??(e=>!!e);for(const r of t)if(r){if(s(r)){const t=this.indexOf(r,e);t>=0?t!==e&&this.reorder(r,e):this.add(r,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(r);if(Array.isArray(t))for(const s of t)e=this._processCollection(e,s);else e=this._processCollection(e,t)}}return e}};(0,r._)([(0,o.Cb)()],a.prototype,"getCollections",void 0),(0,r._)([(0,o.Cb)()],a.prototype,"getChildrenFunction",void 0),(0,r._)([(0,o.Cb)()],a.prototype,"itemFilterFunction",void 0),a=(0,r._)([(0,l.j)("esri.core.CollectionFlattener")],a);const u=a},13867:(e,t,s)=>{s.d(t,{z:()=>i});var r=s(69801);class i{constructor(e,t){this._storage=new r.WJ,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,s=1){this._storage.put(this,e,t,s,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},69801:(e,t,s)=>{s.d(t,{WJ:()=>l,Xq:()=>o});var r,i,n=s(44553);(i=r||(r={}))[i.ALL=0]="ALL",i[i.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=a+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(e,t,s,r=0){this._storage.put(this,e,t,s,r)}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}updateSize(e,t,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class l{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new n.Z,this._users=new n.Z}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimits()}put(e,t,s,i,n){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==s&&this._notifyRemove(t,o.entry,r.ALL)),i>this._maxSize)return void this._notifyRemove(t,s,r.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!i||i<0)return void console.warn("Refusing to cache entry with invalid size "+i);const l=1+Math.max(n,-3)- -3;this._db.set(t,{entry:s,size:i,lifetime:l,lives:l}),this._size+=i,e.size+=i,this._checkSizeLimits()}updateSize(e,t,s,i){t=e.id+t;const n=this._db.get(t);if(n&&n.entry===s){for(this._size-=n.size,e.size-=n.size;i>this._maxSize;){const e=this._notifyRemove(t,s,r.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);i=e}n.size=i,this._size+=i,e.size+=i,this._checkSizeLimits()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},s=new Array;this._db.forEach(((e,r)=>{const i=e.lifetime;s[i]=(s[i]||0)+e.size,this._users.forAll((s=>{const{id:i,name:n}=s;if(r.startsWith(i)){const s=t[n]||0;t[n]=s+e.size}}))}));const r={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const i=t[s]||0;t[s]=i,r[s]=Math.round(100*e.hitRate)+"%"}else r[s]="0%"}));const i=Object.keys(t);i.sort(((e,s)=>t[s]-t[e])),i.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+r[s]));for(let t=s.length-1;t>=0;--t){const r=s[t];r&&(e["Priority "+(t+-3-1)]=Math.round(r/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,e.entry,r.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,r.ALL))),this._users.forEach((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,s){let r;return this._removeFuncs.some((i=>{if(e.startsWith(i[0])){const e=i[1](t,s);return"number"==typeof e&&(r=e),!0}return!1})),r}_checkSizeLimits(){if(this._size>this._maxSize)for(const[e,t]of this._db)if(this._purgeItem(e,t),this._size<=.9*this.maxSize)return;this._users.forEach((e=>{if(e.maxSize>0&&e.size>e.maxSize)for(const[t,s]of this._db)if(t.startsWith(e.id)&&(this._purgeItem(t,s,e),e.size<=.9*e.maxSize))return}))}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const i=this._notifyRemove(e,t.entry,r.SOME);null!=i&&i>0&&(this._size+=i,s&&(s.size+=i),t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let a=0},22862:(e,t,s)=>{s.d(t,{Hg:()=>p,V7:()=>f,uD:()=>d});var r=s(92036),i=s(46791),n=s(1153);const o=["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"];function l(e){return e instanceof r.Z}function a(e){return e instanceof i.Z?Object.keys(e.items):l(e)?(0,n.vw)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof i.Z?e.items[t]:e[t]}function h(e){return e?e.declaredClass:null}function c(e,t){const s=e.diff;if(s&&"function"==typeof s)return s(e,t);const r=a(e),i=a(t);if(0===r.length&&0===i.length)return;if(!r.length||!i.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const n=i.filter((e=>!r.includes(e))),d=r.filter((e=>!i.includes(e))),f=r.filter((s=>i.includes(s)&&u(e,s)!==u(t,s))).concat(n,d).sort(),p=h(e);if(p&&o.includes(p)&&f.length)return{type:"complete",oldValue:e,newValue:t};let y;const m=l(e)&&l(t);for(const r of f){const i=u(e,r),n=u(t,r);let o;if((m||"function"!=typeof i&&"function"!=typeof n)&&i!==n&&(null!=i||null!=n)){if(s&&s[r]&&"function"==typeof s[r])o=s[r]?.(i,n);else if(i instanceof Date&&n instanceof Date){if(i.getTime()===n.getTime())continue;o={type:"complete",oldValue:i,newValue:n}}else o="object"==typeof i&&"object"==typeof n&&h(i)===h(n)?c(i,n):{type:"complete",oldValue:i,newValue:n};null!=o&&(null!=y?y.diff[r]=o:y={type:"partial",diff:{[r]:o}})}}return y}function d(e,t){if(null==e)return!1;const s=t.split(".");let r=e;for(const e of s){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}function f(e,t){for(const s of t)if(d(e,s))return!0;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&&h(e)!==h(t)?{type:"complete",oldValue:e,newValue:t}:c(e,t)}},17445:(e,t,s)=>{s.d(t,{N1:()=>d,YP:()=>a,Z_:()=>y,gx:()=>u,nn:()=>m,on:()=>c,tX:()=>g}),s(66643),s(46791);var r=s(91460),i=s(50758),n=s(70586),o=s(95330),l=s(26258);function a(e,t,s={}){return h(e,t,s,f)}function u(e,t,s={}){return h(e,t,s,p)}function h(e,t,s={},r){let i=null;const o=s.once?(e,s)=>{r(e)&&((0,n.hw)(i),t(e,s))}:(e,s)=>{r(e)&&t(e,s)};if(i=(0,l.aQ)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return i}function c(e,t,s,o={}){let l=null,u=null,h=null;function c(){l&&u&&(u.remove(),o.onListenerRemove?.(l),l=null,u=null)}function d(e){o.once&&o.once&&(0,n.hw)(h),s(e)}const f=a(e,((e,s)=>{c(),(0,r.vT)(e)&&(l=e,u=(0,r.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,i.kB)((()=>{f.remove(),c()})),h}function d(e,t){return function(e,t,s){if((0,o.Hc)(s))return Promise.reject((0,o.zE)());const r=e();if(t?.(r))return Promise.resolve(r);let l=null;function a(){l=(0,n.hw)(l)}return new Promise(((r,n)=>{l=(0,i.AL)([(0,o.fu)(s,(()=>{a(),n((0,o.zE)())})),h(e,(e=>{a(),r(e)}),{sync:!1,once:!0},t??f)])}))}(e,p,t)}function f(e){return!0}function p(e){return!!e}s(87538);const y={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},35463:(e,t,s)=>{s.d(t,{JE:()=>o,Nm:()=>n,rJ:()=>l}),s(80442);const r={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},i={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function n(e,t,s){const r=new Date(e.getTime());if(t&&s){const e=i[s],{getter:n,setter:o,multiplier:l}=e;if("months"===s){const e=function(e,t){const s=new Date(e,t+1,1);return s.setDate(0),s.getDate()}(r.getFullYear(),r.getMonth()+t);r.getDate()>e&&r.setDate(e)}r[o](r[n]()+t*l)}return r}function o(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function l(e,t,s){return 0===e?0:e*r[t]/r[s]}},42756:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var r=s(43697),i=(s(66577),s(46791)),n=s(57435),o=s(16453),l=s(95330),a=s(17445),u=s(17452),h=s(5600),c=s(75215),d=(s(67676),s(80442),s(71715)),f=s(52011),p=s(30556),y=s(82971),m=s(87085),g=s(71612),_=s(38009),v=s(16859),b=s(34760),w=s(72965),S=s(21506),z=s(32448),C=s(96674),x=s(83379),F=s(19153),E=s(68773),P=s(40330),I=(s(51773),s(3172)),T=s(22974),M=s(60437),R=s(20322);s(91423),s(74889);const D={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function k(e){const t=e.folders||[],s=t.slice(),r=new Map,i=new Map,n=new Map,o=new Map,l=new Map,a={esriGeometryPoint:i,esriGeometryPolyline:n,esriGeometryPolygon:o};(e.featureCollection&&e.featureCollection.layers||[]).forEach((e=>{const t=(0,T.d9)(e);t.featureSet.features=[];const s=e.featureSet.geometryType;r.set(s,t);const l=e.layerDefinition.objectIdField;"esriGeometryPoint"===s?O(i,l,e.featureSet.features):"esriGeometryPolyline"===s?O(n,l,e.featureSet.features):"esriGeometryPolygon"===s&&O(o,l,e.featureSet.features)})),e.groundOverlays&&e.groundOverlays.forEach((e=>{l.set(e.id,e)})),t.forEach((t=>{t.networkLinkIds.forEach((r=>{const i=function(e,t,s){const r=function(e,t){let s;return t.some((t=>t.id===e&&(s=t,!0))),s}(e,s);return r&&(r.parentFolderId=t,r.networkLink=r),r}(r,t.id,e.networkLinks);i&&s.push(i)}))})),s.forEach((e=>{if(e.featureInfos){e.points=(0,T.d9)(r.get("esriGeometryPoint")),e.polylines=(0,T.d9)(r.get("esriGeometryPolyline")),e.polygons=(0,T.d9)(r.get("esriGeometryPolygon")),e.mapImages=[];for(const t of e.featureInfos)switch(t.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const s=a[t.type].get(t.id);s&&e[D[t.type]]?.featureSet.features.push(s);break}case"GroundOverlay":{const s=l.get(t.id);s&&e.mapImages.push(s);break}}e.fullExtent=j([e])}}));const u=j(s);return{folders:t,sublayers:s,extent:u}}function L(e,t,s,r){const i=P.id&&P.id.findCredential(e);e=(0,u.fl)(e,{token:i&&i.token});const n=E.default.kmlServiceUrl;return(0,I.Z)(n,{query:{url:e,model:"simple",folders:"",refresh:0!==s||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:r})}function Z(e,t,s=null,r=[]){const i=[],n={},o=t.sublayers,l=t.folders.map((e=>e.id));return o.forEach((t=>{const o=new e;if(s?o.read(t,s):o.read(t),r.length&&l.includes(o.id)&&(o.visible=r.includes(o.id)),n[t.id]=o,null!=t.parentFolderId&&-1!==t.parentFolderId){const e=n[t.parentFolderId];e.sublayers||(e.sublayers=[]),e.sublayers?.unshift(o)}else i.unshift(o)})),i}function O(e,t,s){s.forEach((s=>{e.set(s.attributes[t],s)}))}function j(e){const t=(0,M.Ue)(M.Gv),s=(0,M.Ue)(M.Gv);for(const r of e){if(r.polygons&&r.polygons.featureSet&&r.polygons.featureSet.features)for(const e of r.polygons.featureSet.features)(0,R.Yg)(t,e.geometry),(0,M.TC)(s,t);if(r.polylines&&r.polylines.featureSet&&r.polylines.featureSet.features)for(const e of r.polylines.featureSet.features)(0,R.Yg)(t,e.geometry),(0,M.TC)(s,t);if(r.points&&r.points.featureSet&&r.points.featureSet.features)for(const e of r.points.featureSet.features)(0,R.Yg)(t,e.geometry),(0,M.TC)(s,t);if(r.mapImages)for(const e of r.mapImages)(0,R.Yg)(t,e.extent),(0,M.TC)(s,t)}return(0,M.fS)(s,M.Gv)?void 0:{xmin:s[0],ymin:s[1],zmin:s[2],xmax:s[3],ymax:s[4],zmax:s[5],spatialReference:y.Z.WGS84}}var A,N=s(6570);let G=A=class extends(z.Z.EventedMixin((0,C.eC)(x.Z))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([(0,a.on)((()=>this.sublayers),"after-add",(({item:e})=>{e.parent=this,e.layer=this.layer}),a.Z_),(0,a.on)((()=>this.sublayers),"after-remove",(({item:e})=>{e.layer=e.parent=null}),a.Z_),(0,a.YP)((()=>this.sublayers),((e,t)=>{if(t)for(const e of t)e.layer=e.parent=null;if(e)for(const t of e)t.parent=this,t.layer=this.layer}),a.Z_),(0,a.YP)((()=>this.layer),(e=>{if(this.sublayers)for(const t of this.sublayers)t.layer=e}),a.Z_)])}initialize(){(0,a.N1)((()=>this.networkLink)).then((()=>(0,a.N1)((()=>!0===this.visible)))).then((()=>this.load()))}load(e){if(!this.networkLink)return;if(this.networkLink.viewFormat)return;const t=null!=e?e.signal:null,s=this._fetchService(this._get("networkLink")?.href??"",t).then((e=>{const t=j(e.sublayers);this.fullExtent=N.Z.fromJSON(t),this.sourceJSON=e;const s=(0,c.se)(i.Z.ofType(A),Z(A,e));this.sublayers?this.sublayers.addMany(s):this.sublayers=s,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")}));return this.addResolvingPromise(s),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}_fetchService(e,t){return L(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then((e=>k(e.data)))}};(0,r._)([(0,h.Cb)()],G.prototype,"description",void 0),(0,r._)([(0,h.Cb)({type:N.Z})],G.prototype,"fullExtent",void 0),(0,r._)([(0,h.Cb)()],G.prototype,"id",void 0),(0,r._)([(0,h.Cb)({readOnly:!0,value:null})],G.prototype,"networkLink",void 0),(0,r._)([(0,h.Cb)({json:{write:{allowNull:!0}}})],G.prototype,"parent",void 0),(0,r._)([(0,h.Cb)({type:i.Z.ofType(A),json:{write:{allowNull:!0}}})],G.prototype,"sublayers",void 0),(0,r._)([(0,h.Cb)({value:null,json:{read:{source:"name",reader:e=>(0,F.Cb)(e)}}})],G.prototype,"title",void 0),(0,r._)([(0,h.Cb)({value:!0})],G.prototype,"visible",null),(0,r._)([(0,d.r)("visible",["visibility"])],G.prototype,"readVisible",null),(0,r._)([(0,h.Cb)()],G.prototype,"sourceJSON",void 0),(0,r._)([(0,h.Cb)()],G.prototype,"layer",void 0),G=A=(0,r._)([(0,f.j)("esri.layers.support.KMLSublayer")],G);const H=G,U=["kml","xml"];let Y=class extends((0,g.h)((0,b.Q)((0,w.M)((0,_.q)((0,v.I)((0,o.R)(m.Z))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new n.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=y.Z.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([(0,a.YP)((()=>this.sublayers),((e,t)=>{t&&t.forEach((e=>{e.parent=null,e.layer=null})),e&&e.forEach((e=>{e.parent=this,e.layer=this}))}),a.Z_),this.on("sublayer-update",(()=>this.notifyChange("fullExtent")))])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,s){return Z(H,t,s,this._visibleFolders)}writeSublayers(e,t){const s=[],r=e.toArray();for(;r.length;){const e=r[0];e.networkLink||(e.visible&&s.push(e.id),e.sublayers&&r.push(...e.sublayers.toArray())),r.shift()}t.visibleFolders=s}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,u.vt)(this.url,U)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],s=e=>{e.visible&&(t.push(e),e.sublayers&&e.sublayers.forEach(s))};return e&&e.forEach(s),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(l.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=k((await Promise.resolve().then((()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:L(this.url??"",this.outSpatialReference,this.refreshInterval,e)))).data);t&&this.read(t,{origin:"service"})}_recomputeFullExtent(){let e=null;null!=this.extent&&(e=this.extent.clone());const t=s=>{if(s.sublayers)for(const r of s.sublayers.items)t(r),r.visible&&r.fullExtent&&(null!=e?e.union(r.fullExtent):e=r.fullExtent.clone())};return t(this),e}};(0,r._)([(0,h.Cb)({readOnly:!0})],Y.prototype,"allSublayers",void 0),(0,r._)([(0,h.Cb)({type:y.Z})],Y.prototype,"outSpatialReference",void 0),(0,r._)([(0,h.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Y.prototype,"path",void 0),(0,r._)([(0,h.Cb)({readOnly:!0,json:{read:!1,write:!1}})],Y.prototype,"legendEnabled",void 0),(0,r._)([(0,h.Cb)({type:["show","hide","hide-children"]})],Y.prototype,"listMode",void 0),(0,r._)([(0,h.Cb)({type:["KML"]})],Y.prototype,"operationalLayerType",void 0),(0,r._)([(0,h.Cb)({})],Y.prototype,"resourceInfo",void 0),(0,r._)([(0,h.Cb)({type:i.Z.ofType(H),json:{write:{ignoreOrigin:!0}}})],Y.prototype,"sublayers",void 0),(0,r._)([(0,d.r)(["web-map","portal-item"],"sublayers",["visibleFolders"])],Y.prototype,"readSublayersFromItemOrWebMap",null),(0,r._)([(0,d.r)("service","sublayers",["sublayers"])],Y.prototype,"readSublayers",null),(0,r._)([(0,p.c)("sublayers")],Y.prototype,"writeSublayers",null),(0,r._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],Y.prototype,"type",void 0),(0,r._)([(0,h.Cb)({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],Y.prototype,"title",null),(0,r._)([(0,h.Cb)(S.HQ)],Y.prototype,"url",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],Y.prototype,"visibleSublayers",null),(0,r._)([(0,h.Cb)({type:N.Z})],Y.prototype,"extent",void 0),(0,r._)([(0,h.Cb)()],Y.prototype,"fullExtent",null),Y=(0,r._)([(0,f.j)("esri.layers.KMLLayer")],Y);const q=Y},16859:(e,t,s)=>{s.d(t,{I:()=>w});var r=s(43697),i=s(68773),n=s(40330),o=s(3172),l=s(66643),a=s(20102),u=s(92604),h=s(95330),c=s(17452),d=s(5600),f=(s(75215),s(67676),s(80442),s(71715)),p=s(52011),y=s(30556),m=s(84230),g=s(48522),_=s(15235),v=s(86082),b=s(14661);const w=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=null,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,s){if(t.itemId)return new _.default({id:t.itemId,portal:s&&s.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const{load:r}=await s.e(8062).then(s.bind(s,18062));return(0,h.k_)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,h.D_)(e)||u.Z.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,h.r9)(e),!0))))}async setUserPrivileges(e,t){if(!i.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:s,fullEdit:r},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",s),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,h.r9)(e)}}async _fetchUserPrivileges(e,t){let s=this.portalItem;if(!e||!s||!s.loaded||s.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=e===s.id;if(r&&s.portal.user)return(0,b.Ss)(s);let i,o;if(r)i=s.portal.url;else try{i=await(0,m.oP)(this.url,t)}catch(e){(0,h.r9)(e)}if(!i||!(0,c.Zo)(i,s.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(n.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.r9)(e)}if(!o)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(r?await s.reload():(s=new _.default({id:e,portal:{url:i}}),await s.load(t)),s.portal.user)return(0,b.Ss)(s)}catch(e){(0,h.r9)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const s=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=s,null==s||null==s.privileges||s.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const s=n.id.findServerInfo(this.url??"");if(!s?.owningSystemUrl)return null;const r=`${s.owningSystemUrl}/sharing/rest`,i=g.Z.getDefault();if(i&&i.loaded&&(0,c.Fv)(i.restUrl)===(0,c.Fv)(r))return i.user;const a=`${r}/community/self`,u=null!=e?e.signal:null,h=await(0,l.q6)((0,o.Z)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return h.ok?v.Z.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const s=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||g.Z.getDefault());return s&&r&&!(0,c.tm)(r.restUrl,s.restUrl)?(t.messages&&t.messages.push(new a.Z("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,r._)([(0,d.Cb)({type:_.default})],t.prototype,"portalItem",null),(0,r._)([(0,f.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,y.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,r._)([(0,p.j)("esri.layers.mixins.PortalLayer")],t),t},S={credential:null,user:null}},34760:(e,t,s)=>{s.d(t,{Q:()=>g});var r=s(43697),i=s(92604),n=s(95330),o=s(5600),l=(s(75215),s(67676),s(80442),s(52011)),a=s(46791),u=(s(66643),s(20102),s(26258),s(87538));const h=new a.Z,c=new WeakMap;function d(e){return null!=e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function f(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:f(t,e%t):0}let p=0,y=0;function m(){const e=Date.now();for(const t of h)t.refreshInterval&&e-(c.get(t)??0)+5>=6e4*t.refreshInterval&&(c.set(t,e),t.refresh(e))}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const s of h)t=f(Math.round(6e4*s.refreshInterval),t),s.refreshInterval?c.get(s)||c.set(s,e):c.delete(s);if(t!==y){if(y=t,clearInterval(p),0===y)return void(p=0);p=setInterval(m,y)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,n.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{this.destroyed||function(e){d(e)&&h.push(e)}(this)}),(()=>{}))}destroy(){var e;d(e=this)&&h.includes(e)&&h.remove(e)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,n.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,r._)([(0,o.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,r._)([(0,o.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,r._)([(0,o.Cb)()],t.prototype,"refreshParameters",null),t=(0,r._)([(0,l.j)("esri.layers.mixins.RefreshableLayer")],t),t}},74889:(e,t,s)=>{s.d(t,{Z:()=>v});var r,i=s(43697),n=s(66577),o=s(38171),l=s(35454),a=s(96674),u=s(22974),h=s(5600),c=(s(75215),s(71715)),d=s(52011),f=s(30556),p=s(82971),y=s(33955),m=s(1231);const g=new l.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let _=r=class extends a.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const s=p.Z.fromJSON(t.spatialReference),r=[];for(let t=0;t<e.length;t++){const i=e[t],n=o.Z.fromJSON(i),l=i.geometry&&i.geometry.spatialReference;null==n.geometry||l||(n.geometry.spatialReference=s);const a=i.aggregateGeometries,u=n.aggregateGeometries;if(a&&null!=u)for(const e in u){const t=u[e],r=a[e],i=r?.spatialReference;null==t||i||(t.spatialReference=s)}r.push(n)}return r}writeGeometryType(e,t,s,r){if(e)return void g.write(e,t,s,r);const{features:i}=this;if(i)for(const e of i)if(e&&null!=e.geometry)return void g.write(e.geometry.type,t,s,r)}readQueryGeometry(e,t){if(!e)return null;const s=!!e.spatialReference,r=(0,y.im)(e);return r&&!s&&t.spatialReference&&(r.spatialReference=p.Z.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:s}=this;if(s)for(const e of s)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,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let s=0;s<t.features.length;s++){const r=t.features[s];if(r.geometry){const t=e&&e[s];r.geometry=t&&t.toJSON()||r.geometry}}return t}quantize(e){const{scale:[t,s],translate:[r,i]}=e,n=this.features,o=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-r)/t)),(e=>Math.round((i-e)/s)));for(let e=0,t=n.length;e<t;e++)o?.(n[e].geometry)||(n.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:s}=this;if(!s)return this;const{translate:[r,i],scale:[n,o]}=s;let l=null,a=null;if(this.hasZ&&null!=s?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=s;l=s=>s*t+e}if(this.hasM&&null!=s?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=s;a=s=>null==s?s:s*t+e}const u=this._getHydrationFunction(e,(e=>e*n+r),(e=>i-e*o),l,a);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,s){let r,i;const n=[];for(let o=0,l=e.length;o<l;o++){const l=e[o];if(o>0){const e=t(l[0]),o=s(l[1]);e===r&&o===i||(n.push([e-r,o-i]),r=e,i=o)}else r=t(l[0]),i=s(l[1]),n.push([r,i])}return n.length>0?n:null}_getQuantizationFunction(e,t,s){return"point"===e?e=>(e.x=t(e.x),e.y=s(e.y),e):"polyline"===e||"polygon"===e?e=>{const r=(0,y.oU)(e)?e.rings:e.paths,i=[];for(let e=0,n=r.length;e<n;e++){const n=r[e],o=this._quantizePoints(n,t,s);o&&i.push(o)}return i.length>0?((0,y.oU)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const r=this._quantizePoints(e.points,t,s);return r&&r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,s,r,i){return"point"===e?e=>{e.x=t(e.x),e.y=s(e.y),r&&(e.z=r(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=(0,y.oU)(e)?e.rings:e.paths;let o,l;for(let e=0,r=n.length;e<r;e++){const r=n[e];for(let e=0,i=r.length;e<i;e++){const i=r[e];e>0?(o+=i[0],l+=i[1]):(o=i[0],l=i[1]),i[0]=t(o),i[1]=s(l)}}if(r&&i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,s=t.length;e<s;e++){const s=t[e];s[2]=r(s[2]),s[3]=i(s[3])}}else if(r)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,s=t.length;e<s;e++){const s=t[e];s[2]=r(s[2])}}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,s=t.length;e<s;e++){const s=t[e];s[2]=i(s[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=s(e.ymin),e.xmax=t(e.xmax),e.ymax=s(e.ymax),r&&null!=e.zmax&&null!=e.zmin&&(e.zmax=r(e.zmax),e.zmin=r(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let o,l;for(let e=0,r=n.length;e<r;e++){const r=n[e];e>0?(o+=r[0],l+=r[1]):(o=r[0],l=r[1]),r[0]=t(o),r[1]=s(l)}if(r&&i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=r(t[2]),t[3]=i(t[3])}else if(r)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=r(t[2])}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=i(t[2])}}:null}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],_.prototype,"displayFieldName",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,h.Cb)({type:[o.Z],json:{write:!0}})],_.prototype,"features",void 0),(0,i._)([(0,c.r)("features")],_.prototype,"readFeatures",null),(0,i._)([(0,h.Cb)({type:[m.Z],json:{write:!0}})],_.prototype,"fields",void 0),(0,i._)([(0,h.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],_.prototype,"geometryType",void 0),(0,i._)([(0,f.c)("geometryType")],_.prototype,"writeGeometryType",null),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasM",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasZ",void 0),(0,i._)([(0,h.Cb)({types:n.qM,json:{write:!0}})],_.prototype,"queryGeometry",void 0),(0,i._)([(0,c.r)("queryGeometry")],_.prototype,"readQueryGeometry",null),(0,i._)([(0,h.Cb)({type:p.Z,json:{write:!0}})],_.prototype,"spatialReference",void 0),(0,i._)([(0,f.c)("spatialReference")],_.prototype,"writeSpatialReference",null),(0,i._)([(0,h.Cb)({json:{write:!0}})],_.prototype,"transform",void 0),_=r=(0,i._)([(0,d.j)("esri.rest.support.FeatureSet")],_),_.prototype.toJSON.isDefaultToJSON=!0;const v=_}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[853,5732],{92835:(e,t,s)=>{s.d(t,{Z:()=>p});var r,i=s(43697),n=s(96674),o=s(35463),l=s(5600),a=(s(75215),s(67676),s(80442),s(71715)),u=s(52011),h=s(30556);let c=r=class extends n.wq{static get allTime(){return d}static get empty(){return f}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?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?e.getTime():null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=null!=this.start?this.start.getTime():this.start,s=null!=this.end?this.end.getTime():this.end,r=null!=e.start?e.start.getTime():e.start,i=null!=e.end?e.end.getTime():e.end;return t===r&&s===i}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();let t=this.start;t&&(t=(0,o.JE)(t,e));let s=this.end;if(s){const t=(0,o.JE)(s,e);s=s.getTime()===t.getTime()?t:(0,o.Nm)(t,1,e)}return new r({start:t,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,s=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let o,l;if(i>=t&&i<=s?o=i:t>=i&&t<=n&&(o=t),s>=i&&s<=n?l=s:n>=t&&n<=s&&(l=n),null!=o&&null!=l&&!isNaN(o)&&!isNaN(l)){const e=new r;return e.start=o===-1/0?null:new Date(o),e.end=l===1/0?null:new Date(l),e}return r.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const s=new r,{start:i,end:n}=this;return null!=i&&(s.start=(0,o.Nm)(i,e,t)),null!=n&&(s.end=(0,o.Nm)(n,e,t)),s}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return d.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:s})}};(0,i._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"end",void 0),(0,i._)([(0,a.r)("end")],c.prototype,"readEnd",null),(0,i._)([(0,h.c)("end")],c.prototype,"writeEnd",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],c.prototype,"isAllTime",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],c.prototype,"isEmpty",null),(0,i._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"start",void 0),(0,i._)([(0,a.r)("start")],c.prototype,"readStart",null),(0,i._)([(0,h.c)("start")],c.prototype,"writeStart",null),c=r=(0,i._)([(0,u.j)("esri.TimeExtent")],c);const d=new c,f=new c({start:void 0,end:void 0}),p=c},5732:(e,t,s)=>{s.d(t,{c:()=>r,g:()=>i});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},57435:(e,t,s)=>{s.d(t,{Z:()=>u});var r=s(43697),i=s(46791),n=(s(66643),s(20102),s(92604),s(26258),s(87538)),o=s(5600),l=s(52011);let a=class extends i.Z{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,n.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=null!=this.getCollections?this.getCollections():null;if(null==e)return void this.removeAll();let t=0;for(const s of e)null!=s&&(t=this._processCollection(t,s));this.splice(t,this.length)}_createNewInstance(e){return new i.Z(e)}_processCollection(e,t){if(!t)return e;const s=this.itemFilterFunction??(e=>!!e);for(const r of t)if(r){if(s(r)){const t=this.indexOf(r,e);t>=0?t!==e&&this.reorder(r,e):this.add(r,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(r);if(Array.isArray(t))for(const s of t)e=this._processCollection(e,s);else e=this._processCollection(e,t)}}return e}};(0,r._)([(0,o.Cb)()],a.prototype,"getCollections",void 0),(0,r._)([(0,o.Cb)()],a.prototype,"getChildrenFunction",void 0),(0,r._)([(0,o.Cb)()],a.prototype,"itemFilterFunction",void 0),a=(0,r._)([(0,l.j)("esri.core.CollectionFlattener")],a);const u=a},13867:(e,t,s)=>{s.d(t,{z:()=>i});var r=s(69801);class i{constructor(e,t){this._storage=new r.WJ,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,s=1){this._storage.put(this,e,t,s,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},69801:(e,t,s)=>{s.d(t,{WJ:()=>l,Xq:()=>o});var r,i,n=s(44553);(i=r||(r={}))[i.ALL=0]="ALL",i[i.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=a+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(e,t,s,r=0){this._storage.put(this,e,t,s,r)}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}updateSize(e,t,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class l{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new n.Z,this._users=new n.Z}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimits()}put(e,t,s,i,n){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==s&&this._notifyRemove(t,o.entry,r.ALL)),i>this._maxSize)return void this._notifyRemove(t,s,r.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!i||i<0)return void console.warn("Refusing to cache entry with invalid size "+i);const l=1+Math.max(n,-3)- -3;this._db.set(t,{entry:s,size:i,lifetime:l,lives:l}),this._size+=i,e.size+=i,this._checkSizeLimits()}updateSize(e,t,s,i){t=e.id+t;const n=this._db.get(t);if(n&&n.entry===s){for(this._size-=n.size,e.size-=n.size;i>this._maxSize;){const e=this._notifyRemove(t,s,r.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);i=e}n.size=i,this._size+=i,e.size+=i,this._checkSizeLimits()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},s=new Array;this._db.forEach(((e,r)=>{const i=e.lifetime;s[i]=(s[i]||0)+e.size,this._users.forAll((s=>{const{id:i,name:n}=s;if(r.startsWith(i)){const s=t[n]||0;t[n]=s+e.size}}))}));const r={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const i=t[s]||0;t[s]=i,r[s]=Math.round(100*e.hitRate)+"%"}else r[s]="0%"}));const i=Object.keys(t);i.sort(((e,s)=>t[s]-t[e])),i.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+r[s]));for(let t=s.length-1;t>=0;--t){const r=s[t];r&&(e["Priority "+(t+-3-1)]=Math.round(r/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,e.entry,r.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,r.ALL))),this._users.forEach((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,s){let r;return this._removeFuncs.some((i=>{if(e.startsWith(i[0])){const e=i[1](t,s);return"number"==typeof e&&(r=e),!0}return!1})),r}_checkSizeLimits(){if(this._size>this._maxSize)for(const[e,t]of this._db)if(this._purgeItem(e,t),this._size<=.9*this.maxSize)return;this._users.forEach((e=>{if(e.maxSize>0&&e.size>e.maxSize)for(const[t,s]of this._db)if(t.startsWith(e.id)&&(this._purgeItem(t,s,e),e.size<=.9*e.maxSize))return}))}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const i=this._notifyRemove(e,t.entry,r.SOME);null!=i&&i>0&&(this._size+=i,s&&(s.size+=i),t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let a=0},22862:(e,t,s)=>{s.d(t,{Hg:()=>p,V7:()=>f,uD:()=>d});var r=s(92036),i=s(46791),n=s(1153);const o=["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"];function l(e){return e instanceof r.Z}function a(e){return e instanceof i.Z?Object.keys(e.items):l(e)?(0,n.vw)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof i.Z?e.items[t]:e[t]}function h(e){return e?e.declaredClass:null}function c(e,t){const s=e.diff;if(s&&"function"==typeof s)return s(e,t);const r=a(e),i=a(t);if(0===r.length&&0===i.length)return;if(!r.length||!i.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const n=i.filter((e=>!r.includes(e))),d=r.filter((e=>!i.includes(e))),f=r.filter((s=>i.includes(s)&&u(e,s)!==u(t,s))).concat(n,d).sort(),p=h(e);if(p&&o.includes(p)&&f.length)return{type:"complete",oldValue:e,newValue:t};let y;const m=l(e)&&l(t);for(const r of f){const i=u(e,r),n=u(t,r);let o;if((m||"function"!=typeof i&&"function"!=typeof n)&&i!==n&&(null!=i||null!=n)){if(s&&s[r]&&"function"==typeof s[r])o=s[r]?.(i,n);else if(i instanceof Date&&n instanceof Date){if(i.getTime()===n.getTime())continue;o={type:"complete",oldValue:i,newValue:n}}else o="object"==typeof i&&"object"==typeof n&&h(i)===h(n)?c(i,n):{type:"complete",oldValue:i,newValue:n};null!=o&&(null!=y?y.diff[r]=o:y={type:"partial",diff:{[r]:o}})}}return y}function d(e,t){if(null==e)return!1;const s=t.split(".");let r=e;for(const e of s){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}function f(e,t){for(const s of t)if(d(e,s))return!0;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&&h(e)!==h(t)?{type:"complete",oldValue:e,newValue:t}:c(e,t)}},17445:(e,t,s)=>{s.d(t,{N1:()=>d,YP:()=>a,Z_:()=>y,gx:()=>u,nn:()=>m,on:()=>c,tX:()=>g}),s(66643),s(46791);var r=s(91460),i=s(50758),n=s(70586),o=s(95330),l=s(26258);function a(e,t,s={}){return h(e,t,s,f)}function u(e,t,s={}){return h(e,t,s,p)}function h(e,t,s={},r){let i=null;const o=s.once?(e,s)=>{r(e)&&((0,n.hw)(i),t(e,s))}:(e,s)=>{r(e)&&t(e,s)};if(i=(0,l.aQ)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return i}function c(e,t,s,o={}){let l=null,u=null,h=null;function c(){l&&u&&(u.remove(),o.onListenerRemove?.(l),l=null,u=null)}function d(e){o.once&&o.once&&(0,n.hw)(h),s(e)}const f=a(e,((e,s)=>{c(),(0,r.vT)(e)&&(l=e,u=(0,r.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,i.kB)((()=>{f.remove(),c()})),h}function d(e,t){return function(e,t,s){if((0,o.Hc)(s))return Promise.reject((0,o.zE)());const r=e();if(t?.(r))return Promise.resolve(r);let l=null;function a(){l=(0,n.hw)(l)}return new Promise(((r,n)=>{l=(0,i.AL)([(0,o.fu)(s,(()=>{a(),n((0,o.zE)())})),h(e,(e=>{a(),r(e)}),{sync:!1,once:!0},t??f)])}))}(e,p,t)}function f(e){return!0}function p(e){return!!e}s(87538);const y={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},35463:(e,t,s)=>{s.d(t,{JE:()=>o,Nm:()=>n,rJ:()=>l}),s(80442);const r={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},i={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function n(e,t,s){const r=new Date(e.getTime());if(t&&s){const e=i[s],{getter:n,setter:o,multiplier:l}=e;if("months"===s){const e=function(e,t){const s=new Date(e,t+1,1);return s.setDate(0),s.getDate()}(r.getFullYear(),r.getMonth()+t);r.getDate()>e&&r.setDate(e)}r[o](r[n]()+t*l)}return r}function o(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function l(e,t,s){return 0===e?0:e*r[t]/r[s]}},42756:(e,t,s)=>{s.r(t),s.d(t,{default:()=>q});var r=s(43697),i=(s(66577),s(46791)),n=s(57435),o=s(16453),l=s(95330),a=s(17445),u=s(17452),h=s(5600),c=s(75215),d=(s(67676),s(80442),s(71715)),f=s(52011),p=s(30556),y=s(82971),m=s(87085),g=s(71612),_=s(38009),v=s(16859),b=s(34760),w=s(72965),S=s(21506),z=s(32448),C=s(96674),x=s(83379),F=s(19153),I=s(68773),E=s(40330),P=(s(51773),s(3172)),T=s(22974),M=s(60437),R=s(20322);s(91423),s(74889);const D={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function k(e){const t=e.folders||[],s=t.slice(),r=new Map,i=new Map,n=new Map,o=new Map,l=new Map,a={esriGeometryPoint:i,esriGeometryPolyline:n,esriGeometryPolygon:o};(e.featureCollection&&e.featureCollection.layers||[]).forEach((e=>{const t=(0,T.d9)(e);t.featureSet.features=[];const s=e.featureSet.geometryType;r.set(s,t);const l=e.layerDefinition.objectIdField;"esriGeometryPoint"===s?O(i,l,e.featureSet.features):"esriGeometryPolyline"===s?O(n,l,e.featureSet.features):"esriGeometryPolygon"===s&&O(o,l,e.featureSet.features)})),e.groundOverlays&&e.groundOverlays.forEach((e=>{l.set(e.id,e)})),t.forEach((t=>{t.networkLinkIds.forEach((r=>{const i=function(e,t,s){const r=function(e,t){let s;return t.some((t=>t.id===e&&(s=t,!0))),s}(e,s);return r&&(r.parentFolderId=t,r.networkLink=r),r}(r,t.id,e.networkLinks);i&&s.push(i)}))})),s.forEach((e=>{if(e.featureInfos){e.points=(0,T.d9)(r.get("esriGeometryPoint")),e.polylines=(0,T.d9)(r.get("esriGeometryPolyline")),e.polygons=(0,T.d9)(r.get("esriGeometryPolygon")),e.mapImages=[];for(const t of e.featureInfos)switch(t.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const s=a[t.type].get(t.id);s&&e[D[t.type]]?.featureSet.features.push(s);break}case"GroundOverlay":{const s=l.get(t.id);s&&e.mapImages.push(s);break}}e.fullExtent=j([e])}}));const u=j(s);return{folders:t,sublayers:s,extent:u}}function L(e,t,s,r){const i=E.id&&E.id.findCredential(e);e=(0,u.fl)(e,{token:i&&i.token});const n=I.default.kmlServiceUrl;return(0,P.Z)(n,{query:{url:e,model:"simple",folders:"",refresh:0!==s||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:r})}function Z(e,t,s=null,r=[]){const i=[],n={},o=t.sublayers,l=t.folders.map((e=>e.id));return o.forEach((t=>{const o=new e;if(s?o.read(t,s):o.read(t),r.length&&l.includes(o.id)&&(o.visible=r.includes(o.id)),n[t.id]=o,null!=t.parentFolderId&&-1!==t.parentFolderId){const e=n[t.parentFolderId];e.sublayers||(e.sublayers=[]),e.sublayers?.unshift(o)}else i.unshift(o)})),i}function O(e,t,s){s.forEach((s=>{e.set(s.attributes[t],s)}))}function j(e){const t=(0,M.Ue)(M.Gv),s=(0,M.Ue)(M.Gv);for(const r of e){if(r.polygons&&r.polygons.featureSet&&r.polygons.featureSet.features)for(const e of r.polygons.featureSet.features)(0,R.Yg)(t,e.geometry),(0,M.TC)(s,t);if(r.polylines&&r.polylines.featureSet&&r.polylines.featureSet.features)for(const e of r.polylines.featureSet.features)(0,R.Yg)(t,e.geometry),(0,M.TC)(s,t);if(r.points&&r.points.featureSet&&r.points.featureSet.features)for(const e of r.points.featureSet.features)(0,R.Yg)(t,e.geometry),(0,M.TC)(s,t);if(r.mapImages)for(const e of r.mapImages)(0,R.Yg)(t,e.extent),(0,M.TC)(s,t)}return(0,M.fS)(s,M.Gv)?void 0:{xmin:s[0],ymin:s[1],zmin:s[2],xmax:s[3],ymax:s[4],zmax:s[5],spatialReference:y.Z.WGS84}}var A,N=s(6570);let G=A=class extends(z.Z.EventedMixin((0,C.eC)(x.Z))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([(0,a.on)((()=>this.sublayers),"after-add",(({item:e})=>{e.parent=this,e.layer=this.layer}),a.Z_),(0,a.on)((()=>this.sublayers),"after-remove",(({item:e})=>{e.layer=e.parent=null}),a.Z_),(0,a.YP)((()=>this.sublayers),((e,t)=>{if(t)for(const e of t)e.layer=e.parent=null;if(e)for(const t of e)t.parent=this,t.layer=this.layer}),a.Z_),(0,a.YP)((()=>this.layer),(e=>{if(this.sublayers)for(const t of this.sublayers)t.layer=e}),a.Z_)])}initialize(){(0,a.N1)((()=>this.networkLink)).then((()=>(0,a.N1)((()=>!0===this.visible)))).then((()=>this.load()))}load(e){if(!this.networkLink)return;if(this.networkLink.viewFormat)return;const t=null!=e?e.signal:null,s=this._fetchService(this._get("networkLink")?.href??"",t).then((e=>{const t=j(e.sublayers);this.fullExtent=N.Z.fromJSON(t),this.sourceJSON=e;const s=(0,c.se)(i.Z.ofType(A),Z(A,e));this.sublayers?this.sublayers.addMany(s):this.sublayers=s,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")}));return this.addResolvingPromise(s),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}_fetchService(e,t){return L(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then((e=>k(e.data)))}};(0,r._)([(0,h.Cb)()],G.prototype,"description",void 0),(0,r._)([(0,h.Cb)({type:N.Z})],G.prototype,"fullExtent",void 0),(0,r._)([(0,h.Cb)()],G.prototype,"id",void 0),(0,r._)([(0,h.Cb)({readOnly:!0,value:null})],G.prototype,"networkLink",void 0),(0,r._)([(0,h.Cb)({json:{write:{allowNull:!0}}})],G.prototype,"parent",void 0),(0,r._)([(0,h.Cb)({type:i.Z.ofType(A),json:{write:{allowNull:!0}}})],G.prototype,"sublayers",void 0),(0,r._)([(0,h.Cb)({value:null,json:{read:{source:"name",reader:e=>(0,F.Cb)(e)}}})],G.prototype,"title",void 0),(0,r._)([(0,h.Cb)({value:!0})],G.prototype,"visible",null),(0,r._)([(0,d.r)("visible",["visibility"])],G.prototype,"readVisible",null),(0,r._)([(0,h.Cb)()],G.prototype,"sourceJSON",void 0),(0,r._)([(0,h.Cb)()],G.prototype,"layer",void 0),G=A=(0,r._)([(0,f.j)("esri.layers.support.KMLSublayer")],G);const H=G,U=["kml","xml"];let Y=class extends((0,g.h)((0,b.Q)((0,w.M)((0,_.q)((0,v.I)((0,o.R)(m.Z))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new n.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=y.Z.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([(0,a.YP)((()=>this.sublayers),((e,t)=>{t&&t.forEach((e=>{e.parent=null,e.layer=null})),e&&e.forEach((e=>{e.parent=this,e.layer=this}))}),a.Z_),this.on("sublayer-update",(()=>this.notifyChange("fullExtent")))])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,s){return Z(H,t,s,this._visibleFolders)}writeSublayers(e,t){const s=[],r=e.toArray();for(;r.length;){const e=r[0];e.networkLink||(e.visible&&s.push(e.id),e.sublayers&&r.push(...e.sublayers.toArray())),r.shift()}t.visibleFolders=s}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,u.vt)(this.url,U)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],s=e=>{e.visible&&(t.push(e),e.sublayers&&e.sublayers.forEach(s))};return e&&e.forEach(s),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(l.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=k((await Promise.resolve().then((()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:L(this.url??"",this.outSpatialReference,this.refreshInterval,e)))).data);t&&this.read(t,{origin:"service"})}_recomputeFullExtent(){let e=null;null!=this.extent&&(e=this.extent.clone());const t=s=>{if(s.sublayers)for(const r of s.sublayers.items)t(r),r.visible&&r.fullExtent&&(null!=e?e.union(r.fullExtent):e=r.fullExtent.clone())};return t(this),e}};(0,r._)([(0,h.Cb)({readOnly:!0})],Y.prototype,"allSublayers",void 0),(0,r._)([(0,h.Cb)({type:y.Z})],Y.prototype,"outSpatialReference",void 0),(0,r._)([(0,h.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Y.prototype,"path",void 0),(0,r._)([(0,h.Cb)({readOnly:!0,json:{read:!1,write:!1}})],Y.prototype,"legendEnabled",void 0),(0,r._)([(0,h.Cb)({type:["show","hide","hide-children"]})],Y.prototype,"listMode",void 0),(0,r._)([(0,h.Cb)({type:["KML"]})],Y.prototype,"operationalLayerType",void 0),(0,r._)([(0,h.Cb)({})],Y.prototype,"resourceInfo",void 0),(0,r._)([(0,h.Cb)({type:i.Z.ofType(H),json:{write:{ignoreOrigin:!0}}})],Y.prototype,"sublayers",void 0),(0,r._)([(0,d.r)(["web-map","portal-item"],"sublayers",["visibleFolders"])],Y.prototype,"readSublayersFromItemOrWebMap",null),(0,r._)([(0,d.r)("service","sublayers",["sublayers"])],Y.prototype,"readSublayers",null),(0,r._)([(0,p.c)("sublayers")],Y.prototype,"writeSublayers",null),(0,r._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],Y.prototype,"type",void 0),(0,r._)([(0,h.Cb)({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],Y.prototype,"title",null),(0,r._)([(0,h.Cb)(S.HQ)],Y.prototype,"url",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],Y.prototype,"visibleSublayers",null),(0,r._)([(0,h.Cb)({type:N.Z})],Y.prototype,"extent",void 0),(0,r._)([(0,h.Cb)()],Y.prototype,"fullExtent",null),Y=(0,r._)([(0,f.j)("esri.layers.KMLLayer")],Y);const q=Y},16859:(e,t,s)=>{s.d(t,{I:()=>w});var r=s(43697),i=s(68773),n=s(40330),o=s(3172),l=s(66643),a=s(20102),u=s(92604),h=s(95330),c=s(17452),d=s(5600),f=(s(75215),s(67676),s(80442),s(71715)),p=s(52011),y=s(30556),m=s(84230),g=s(48522),_=s(15235),v=s(86082),b=s(14661);const w=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=null,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,s){if(t.itemId)return new _.default({id:t.itemId,portal:s&&s.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const{load:r}=await s.e(8062).then(s.bind(s,18062));return(0,h.k_)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,h.D_)(e)||u.Z.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,h.r9)(e),!0))))}async setUserPrivileges(e,t){if(!i.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:s,fullEdit:r},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",s),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,h.r9)(e)}}async _fetchUserPrivileges(e,t){let s=this.portalItem;if(!e||!s||!s.loaded||s.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=e===s.id;if(r&&s.portal.user)return(0,b.Ss)(s);let i,o;if(r)i=s.portal.url;else try{i=await(0,m.oP)(this.url,t)}catch(e){(0,h.r9)(e)}if(!i||!(0,c.Zo)(i,s.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(n.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.r9)(e)}if(!o)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(r?await s.reload():(s=new _.default({id:e,portal:{url:i}}),await s.load(t)),s.portal.user)return(0,b.Ss)(s)}catch(e){(0,h.r9)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const s=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=s,null==s||null==s.privileges||s.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const s=n.id.findServerInfo(this.url??"");if(!s?.owningSystemUrl)return null;const r=`${s.owningSystemUrl}/sharing/rest`,i=g.Z.getDefault();if(i&&i.loaded&&(0,c.Fv)(i.restUrl)===(0,c.Fv)(r))return i.user;const a=`${r}/community/self`,u=null!=e?e.signal:null,h=await(0,l.q6)((0,o.Z)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return h.ok?v.Z.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const s=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||g.Z.getDefault());return s&&r&&!(0,c.tm)(r.restUrl,s.restUrl)?(t.messages&&t.messages.push(new a.Z("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,r._)([(0,d.Cb)({type:_.default})],t.prototype,"portalItem",null),(0,r._)([(0,f.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,y.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,r._)([(0,p.j)("esri.layers.mixins.PortalLayer")],t),t},S={credential:null,user:null}},34760:(e,t,s)=>{s.d(t,{Q:()=>b});var r=s(43697),i=s(92604),n=s(95330),o=s(5600),l=s(90578),a=(s(67676),s(80442),s(52011)),u=s(46791),h=(s(66643),s(20102),s(26258),s(87538));const c=new u.Z,d=new WeakMap;function f(e){y(e)&&c.push(e)}function p(e){y(e)&&c.includes(e)&&c.remove(e)}function y(e){return null!=e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function m(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:m(t,e%t):0}let g=0,_=0;function v(){const e=Date.now();for(const t of c)t.refreshInterval&&e-(d.get(t)??0)+5>=6e4*t.refreshInterval&&(d.set(t,e),t.refresh(e))}(0,h.EH)((()=>{const e=Date.now();let t=0;for(const s of c)t=m(Math.round(6e4*s.refreshInterval),t),s.refreshInterval?d.get(s)||d.set(s,e):d.delete(s);if(t!==_){if(_=t,clearInterval(g),0===_)return void(g=0);g=setInterval(v,_)}}));const b=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,n.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{this.destroyed||f(this)}),(()=>{}))}destroy(){p(this)}castRefreshInterval(e){return e>=.1?e:e<=0?0:.1}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,n.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}get test(){const e=this;return{set refreshInterval(t){e._set("refreshInterval",t)}}}};return(0,r._)([(0,o.Cb)({type:Number,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,r._)([(0,l.p)("refreshInterval")],t.prototype,"castRefreshInterval",null),(0,r._)([(0,o.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,r._)([(0,o.Cb)()],t.prototype,"refreshParameters",null),t=(0,r._)([(0,a.j)("esri.layers.mixins.RefreshableLayer")],t),t}},74889:(e,t,s)=>{s.d(t,{Z:()=>v});var r,i=s(43697),n=s(66577),o=s(38171),l=s(35454),a=s(96674),u=s(22974),h=s(5600),c=(s(75215),s(71715)),d=s(52011),f=s(30556),p=s(82971),y=s(33955),m=s(1231);const g=new l.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let _=r=class extends a.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const s=p.Z.fromJSON(t.spatialReference),r=[];for(let t=0;t<e.length;t++){const i=e[t],n=o.Z.fromJSON(i),l=i.geometry&&i.geometry.spatialReference;null==n.geometry||l||(n.geometry.spatialReference=s);const a=i.aggregateGeometries,u=n.aggregateGeometries;if(a&&null!=u)for(const e in u){const t=u[e],r=a[e],i=r?.spatialReference;null==t||i||(t.spatialReference=s)}r.push(n)}return r}writeGeometryType(e,t,s,r){if(e)return void g.write(e,t,s,r);const{features:i}=this;if(i)for(const e of i)if(e&&null!=e.geometry)return void g.write(e.geometry.type,t,s,r)}readQueryGeometry(e,t){if(!e)return null;const s=!!e.spatialReference,r=(0,y.im)(e);return r&&!s&&t.spatialReference&&(r.spatialReference=p.Z.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:s}=this;if(s)for(const e of s)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,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let s=0;s<t.features.length;s++){const r=t.features[s];if(r.geometry){const t=e&&e[s];r.geometry=t&&t.toJSON()||r.geometry}}return t}quantize(e){const{scale:[t,s],translate:[r,i]}=e,n=this.features,o=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-r)/t)),(e=>Math.round((i-e)/s)));for(let e=0,t=n.length;e<t;e++)o?.(n[e].geometry)||(n.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:s}=this;if(!s)return this;const{translate:[r,i],scale:[n,o]}=s;let l=null,a=null;if(this.hasZ&&null!=s?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=s;l=s=>s*t+e}if(this.hasM&&null!=s?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=s;a=s=>null==s?s:s*t+e}const u=this._getHydrationFunction(e,(e=>e*n+r),(e=>i-e*o),l,a);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,s){let r,i;const n=[];for(let o=0,l=e.length;o<l;o++){const l=e[o];if(o>0){const e=t(l[0]),o=s(l[1]);e===r&&o===i||(n.push([e-r,o-i]),r=e,i=o)}else r=t(l[0]),i=s(l[1]),n.push([r,i])}return n.length>0?n:null}_getQuantizationFunction(e,t,s){return"point"===e?e=>(e.x=t(e.x),e.y=s(e.y),e):"polyline"===e||"polygon"===e?e=>{const r=(0,y.oU)(e)?e.rings:e.paths,i=[];for(let e=0,n=r.length;e<n;e++){const n=r[e],o=this._quantizePoints(n,t,s);o&&i.push(o)}return i.length>0?((0,y.oU)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const r=this._quantizePoints(e.points,t,s);return r&&r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,s,r,i){return"point"===e?e=>{e.x=t(e.x),e.y=s(e.y),r&&(e.z=r(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=(0,y.oU)(e)?e.rings:e.paths;let o,l;for(let e=0,r=n.length;e<r;e++){const r=n[e];for(let e=0,i=r.length;e<i;e++){const i=r[e];e>0?(o+=i[0],l+=i[1]):(o=i[0],l=i[1]),i[0]=t(o),i[1]=s(l)}}if(r&&i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,s=t.length;e<s;e++){const s=t[e];s[2]=r(s[2]),s[3]=i(s[3])}}else if(r)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,s=t.length;e<s;e++){const s=t[e];s[2]=r(s[2])}}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,s=t.length;e<s;e++){const s=t[e];s[2]=i(s[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=s(e.ymin),e.xmax=t(e.xmax),e.ymax=s(e.ymax),r&&null!=e.zmax&&null!=e.zmin&&(e.zmax=r(e.zmax),e.zmin=r(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let o,l;for(let e=0,r=n.length;e<r;e++){const r=n[e];e>0?(o+=r[0],l+=r[1]):(o=r[0],l=r[1]),r[0]=t(o),r[1]=s(l)}if(r&&i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=r(t[2]),t[3]=i(t[3])}else if(r)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=r(t[2])}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=i(t[2])}}:null}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],_.prototype,"displayFieldName",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,h.Cb)({type:[o.Z],json:{write:!0}})],_.prototype,"features",void 0),(0,i._)([(0,c.r)("features")],_.prototype,"readFeatures",null),(0,i._)([(0,h.Cb)({type:[m.Z],json:{write:!0}})],_.prototype,"fields",void 0),(0,i._)([(0,h.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],_.prototype,"geometryType",void 0),(0,i._)([(0,f.c)("geometryType")],_.prototype,"writeGeometryType",null),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasM",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],_.prototype,"hasZ",void 0),(0,i._)([(0,h.Cb)({types:n.qM,json:{write:!0}})],_.prototype,"queryGeometry",void 0),(0,i._)([(0,c.r)("queryGeometry")],_.prototype,"readQueryGeometry",null),(0,i._)([(0,h.Cb)({type:p.Z,json:{write:!0}})],_.prototype,"spatialReference",void 0),(0,i._)([(0,f.c)("spatialReference")],_.prototype,"writeSpatialReference",null),(0,i._)([(0,h.Cb)({json:{write:!0}})],_.prototype,"transform",void 0),_=r=(0,i._)([(0,d.j)("esri.rest.support.FeatureSet")],_),_.prototype.toJSON.isDefaultToJSON=!0;const v=_}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4828,5732],{92835:(t,e,n)=>{n.d(e,{Z:()=>p});var i,r=n(43697),s=n(96674),o=n(35463),a=n(5600),l=(n(75215),n(67676),n(80442),n(71715)),u=n(52011),c=n(30556);let h=i=class extends s.wq{static get allTime(){return d}static get empty(){return m}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?t.getTime():null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?t.getTime():null}clone(){return new i({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=null!=this.start?this.start.getTime():this.start,n=null!=this.end?this.end.getTime():this.end,i=null!=t.start?t.start.getTime():t.start,r=null!=t.end?t.end.getTime():t.end;return e===i&&n===r}expandTo(t){if(this.isEmpty||this.isAllTime)return this.clone();let e=this.start;e&&(e=(0,o.JE)(e,t));let n=this.end;if(n){const e=(0,o.JE)(n,t);n=n.getTime()===e.getTime()?e:(0,o.Nm)(e,1,t)}return new i({start:e,end:n})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return i.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,r=t.start?.getTime()??-1/0,s=t.end?.getTime()??1/0;let o,a;if(r>=e&&r<=n?o=r:e>=r&&e<=s&&(o=e),n>=r&&n<=s?a=n:s>=e&&s<=n&&(a=s),null!=o&&null!=a&&!isNaN(o)&&!isNaN(a)){const t=new i;return t.start=o===-1/0?null:new Date(o),t.end=a===1/0?null:new Date(a),t}return i.empty}offset(t,e){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:r,end:s}=this;return null!=r&&(n.start=(0,o.Nm)(r,t,e)),null!=s&&(n.end=(0,o.Nm)(s,t,e)),n}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return d.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,n=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new i({start:e,end:n})}};(0,r._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,r._)([(0,l.r)("end")],h.prototype,"readEnd",null),(0,r._)([(0,c.c)("end")],h.prototype,"writeEnd",null),(0,r._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,r._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,r._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,r._)([(0,l.r)("start")],h.prototype,"readStart",null),(0,r._)([(0,c.c)("start")],h.prototype,"writeStart",null),h=i=(0,r._)([(0,u.j)("esri.TimeExtent")],h);const d=new h,m=new h({start:void 0,end:void 0}),p=h},5732:(t,e,n)=>{n.d(e,{c:()=>i,g:()=>r});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}},21787:(t,e,n)=>{n.d(e,{b:()=>l,c:()=>s,d:()=>c,e:()=>a,f:()=>r,i:()=>d,m:()=>u,t:()=>o});var i=n(46851);function r(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function s(t,e,n,i,r,s,o,a,l,u){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=o,t[6]=a,t[7]=l,t[8]=u,t}function o(t,e){if(t===e){const n=e[1],i=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=i,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function a(t,e){const n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=c*o-a*u,d=-c*s+a*l,m=u*s-o*l;let p=n*h+i*d+r*m;return p?(p=1/p,t[0]=h*p,t[1]=(-c*i+r*u)*p,t[2]=(a*i-r*o)*p,t[3]=d*p,t[4]=(c*n-r*l)*p,t[5]=(-a*n+r*s)*p,t[6]=m*p,t[7]=(-u*n+i*l)*p,t[8]=(o*n-i*s)*p,t):null}function l(t,e){const n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8];return t[0]=o*c-a*u,t[1]=r*u-i*c,t[2]=i*a-r*o,t[3]=a*l-s*c,t[4]=n*c-r*l,t[5]=r*s-n*a,t[6]=s*u-o*l,t[7]=i*l-n*u,t[8]=n*o-i*s,t}function u(t,e,n){const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=n[0],m=n[1],p=n[2],f=n[3],_=n[4],g=n[5],y=n[6],x=n[7],M=n[8];return t[0]=d*i+m*o+p*u,t[1]=d*r+m*a+p*c,t[2]=d*s+m*l+p*h,t[3]=f*i+_*o+g*u,t[4]=f*r+_*a+g*c,t[5]=f*s+_*l+g*h,t[6]=y*i+x*o+M*u,t[7]=y*r+x*a+M*c,t[8]=y*s+x*l+M*h,t}function c(t,e){const n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],m=e[11],p=e[12],f=e[13],_=e[14],g=e[15],y=n*a-i*o,x=n*l-r*o,M=n*u-s*o,v=i*l-r*a,w=i*u-s*a,b=r*u-s*l,P=c*f-h*p,R=c*_-d*p,C=c*g-m*p,I=h*_-d*f,T=h*g-m*f,B=d*g-m*_;let Z=y*B-x*T+M*I+v*C-w*R+b*P;return Z?(Z=1/Z,t[0]=(a*B-l*T+u*I)*Z,t[1]=(l*C-o*B-u*R)*Z,t[2]=(o*T-a*C+u*P)*Z,t[3]=(r*T-i*B-s*I)*Z,t[4]=(n*B-r*C+s*R)*Z,t[5]=(i*C-n*T-s*P)*Z,t[6]=(f*b-_*w+g*v)*Z,t[7]=(_*M-p*b-g*x)*Z,t[8]=(p*w-f*M+g*y)*Z,t):null}function h(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function d(t){const e=(0,i.g)(),n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],u=t[6],c=t[7],h=t[8];return Math.abs(1-(n*n+o*o+u*u))<=e&&Math.abs(1-(r*r+a*a+c*c))<=e&&Math.abs(1-(s*s+l*l+h*h))<=e}const m=u,p=h;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},adjoint:l,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},determinant:function(t){const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],u=t[8];return e*(u*s-o*l)+n*(-u*r+o*a)+i*(l*r-s*a)},equals:function(t,e){const n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=e[0],m=e[1],p=e[2],f=e[3],_=e[4],g=e[5],y=e[6],x=e[7],M=e[8],v=(0,i.g)();return Math.abs(n-d)<=v*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(r-m)<=v*Math.max(1,Math.abs(r),Math.abs(m))&&Math.abs(s-p)<=v*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(o-f)<=v*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-_)<=v*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(l-g)<=v*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(u-y)<=v*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-x)<=v*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(h-M)<=v*Math.max(1,Math.abs(h),Math.abs(M))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},fromMat4:r,fromQuat:function(t,e){const n=e[0],i=e[1],r=e[2],s=e[3],o=n+n,a=i+i,l=r+r,u=n*o,c=i*o,h=i*a,d=r*o,m=r*a,p=r*l,f=s*o,_=s*a,g=s*l;return t[0]=1-h-p,t[3]=c-g,t[6]=d+_,t[1]=c+g,t[4]=1-u-p,t[7]=m-f,t[2]=d-_,t[5]=m+f,t[8]=1-u-h,t},fromRotation:function(t,e){const n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:a,isOrthoNormal:d,mul:m,multiply:u,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},multiplyScalarAndAdd:function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t},normalFromMat4:c,normalFromMat4Legacy:function(t,e){const n=e[0],i=e[1],r=e[2],s=e[4],o=e[5],a=e[6],l=e[8],u=e[9],c=e[10],h=c*o-a*u,d=-c*s+a*l,m=u*s-o*l,p=n*h+i*d+r*m;if(!p)return null;const f=1/p;return t[0]=h*f,t[1]=(-c*i+r*u)*f,t[2]=(a*i-r*o)*f,t[3]=d*f,t[4]=(c*n-r*l)*f,t[5]=(-a*n+r*s)*f,t[6]=m*f,t[7]=(-u*n+i*l)*f,t[8]=(o*n-i*s)*f,t},projection:function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,e,n){const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=Math.sin(n),m=Math.cos(n);return t[0]=m*i+d*o,t[1]=m*r+d*a,t[2]=m*s+d*l,t[3]=m*o-d*i,t[4]=m*a-d*r,t[5]=m*l-d*s,t[6]=u,t[7]=c,t[8]=h,t},scale:function(t,e,n){const i=n[0],r=n[1],s=n[2];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=s*e[6],t[7]=s*e[7],t[8]=s*e[8],t},scaleByVec2:function(t,e,n){const i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t},set:s,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:p,subtract:h,translate:function(t,e,n){const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=n[0],m=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=d*i+m*o+u,t[7]=d*r+m*a+c,t[8]=d*s+m*l+h,t},transpose:o},Symbol.toStringTag,{value:"Module"}))},46521:(t,e,n)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function r(t,e,n,i,r,s,o,a,l){return[t,e,n,i,r,s,o,a,l]}function s(t,e){return new Float64Array(t,e,9)}n.d(e,{a:()=>s,c:()=>i,f:()=>r}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:i,createView:s,fromValues:r},Symbol.toStringTag,{value:"Module"}))},88764:(t,e,n)=>{n.d(e,{q:()=>l});var i,r,s,o=n(5732),a={exports:{}};i=a,r=function(){function t(n,i,r,s,o){for(;s>r;){if(s-r>600){var a=s-r+1,l=i-r+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1);t(n,i,Math.max(r,Math.floor(i-l*c/a+h)),Math.min(s,Math.floor(i+(a-l)*c/a+h)),o)}var d=n[i],m=r,p=s;for(e(n,r,i),o(n[s],d)>0&&e(n,r,s);m<p;){for(e(n,m,p),m++,p--;o(n[m],d)<0;)m++;for(;o(n[p],d)>0;)p--}0===o(n[r],d)?e(n,r,p):e(n,++p,s),p<=i&&(r=p+1),i<=p&&(s=p-1)}}function e(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function n(t,e){return t<e?-1:t>e?1:0}return function(e,i,r,s,o){t(e,i,r||0,s||e.length-1,o||n)}},void 0!==(s=r())&&(i.exports=s);const l=(0,o.g)(a.exports)},4307:(t,e,n)=>{n.d(e,{d:()=>l,l:()=>d,r:()=>p,s:()=>r,t:()=>m});var i=n(46851);function r(t,e,n){return t[0]=e,t[1]=n,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function o(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function a(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function l(t,e){const n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)}function u(t,e){const n=e[0]-t[0],i=e[1]-t[1];return n*n+i*i}function c(t){const e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function h(t){const e=t[0],n=t[1];return e*e+n*n}function d(t,e,n,i){const r=e[0],s=e[1];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t}function m(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t}function p(t,e,n,i){const r=e[0]-n[0],s=e[1]-n[1],o=Math.sin(i),a=Math.cos(i);return t[0]=r*a-s*o+n[0],t[1]=r*o+s*a+n[1],t}const f=c,_=s,g=o,y=a,x=l,M=u,v=h;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},angle:function(t,e){const n=t[0],i=t[1],r=e[0],s=e[1];let o=n*n+i*i;o>0&&(o=1/Math.sqrt(o));let a=r*r+s*s;a>0&&(a=1/Math.sqrt(a));const l=(n*r+i*s)*o*a;return l>1?0:l<-1?Math.PI:Math.acos(l)},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},cross:function(t,e,n){const i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t},dist:x,distance:l,div:y,divide:a,dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},equals:function(t,e){const n=t[0],r=t[1],s=e[0],o=e[1],a=(0,i.g)();return Math.abs(n-s)<=a*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-o)<=a*Math.max(1,Math.abs(r),Math.abs(o))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},len:f,length:c,lerp:d,max:function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},min:function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},mul:g,multiply:o,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},normalize:function(t,e){const n=e[0],i=e[1];let r=n*n+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},projectAndScale:function(t,e,n,i,r){let s=e[0]-n[0],o=e[1]-n[1];const a=(i[0]*s+i[1]*o)*(r-1);return s=i[0]*a,o=i[1]*a,t[0]=e[0]+s,t[1]=e[1]+o,t},random:function(t,e){e=e||1;const n=2*(0,i.R)()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},rotate:p,round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},scaleAndAdd:function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},set:r,sqrDist:M,sqrLen:v,squaredDistance:u,squaredLength:h,str:function(t){return"vec2("+t[0]+", "+t[1]+")"},sub:_,subtract:s,transformMat2:function(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t},transformMat2d:m,transformMat3:function(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t},transformMat4:function(t,e,n){const i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t}},Symbol.toStringTag,{value:"Module"}))},97323:(t,e,n)=>{function i(){return[0,0]}function r(t,e){return[t,e]}function s(t,e){return new Float64Array(t,e,2)}function o(){return r(1,1)}function a(){return r(1,0)}function l(){return r(0,1)}n.d(e,{a:()=>i,c:()=>s,f:()=>r});const u=o(),c=a(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:c,UNIT_Y:h,ZEROS:[0,0],clone:function(t){return[t[0],t[1]]},create:i,createView:s,fromArray:function(t,e=[0,0]){const n=Math.min(2,t.length);for(let i=0;i<n;++i)e[i]=t[i];return e},fromValues:r,ones:o,unitX:a,unitY:l,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},70921:(t,e,n)=>{n.d(e,{R:()=>s,Z:()=>r});var i=n(46791);function r(t,e,n=i.Z){return e||(e=new n),e===t||(e.removeAll(),(r=t)&&(Array.isArray(r)||"items"in r&&Array.isArray(r.items))?e.addMany(t):t&&e.add(t)),e;var r}function s(t){return t}},70163:(t,e,n)=>{n.d(e,{Jl:()=>c,n$:()=>h});var i=n(3172),r=n(20102),s=n(95330),o=n(17452),a=n(49917);let l=null,u=!0;function c(t,e,n,i){if(!e||!n)throw new Error("Cannot construct image data without dimensions");if(u)try{return new ImageData(t,e,n)}catch(t){u=!1}const r=function(t,e,n){return n||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),n=l),n.getContext("2d").createImageData(t,e)}(e,n,i);return r.data.set(t,0),r}async function h(t,e){const{arrayBuffer:l,mediaType:u}=await async function(t,e){const n=(0,o.sJ)(t);if(n?.isBase64)return{arrayBuffer:(0,a.R)(n.data),mediaType:n.mediaType};const r=await(0,i.Z)(t,{responseType:"array-buffer",...e});return{arrayBuffer:r.data,mediaType:r.getHeader("Content-Type")}}(t,e),c="image/png"===u;if("image/gif"===u){const{isAnimatedGIF:t,parseGif:i}=await n.e(3310).then(n.bind(n,83310));if(t(l))return i(l,e)}if(c){const{isAnimatedPNG:t,parseApng:i}=await n.e(4492).then(n.bind(n,54492));if(t(l))return i(l,e)}return async function(t,e){const n=window.URL.createObjectURL(t);try{const{data:t}=await(0,i.Z)(n,{...e,responseType:"image"});return t}catch(t){if(!(0,s.D_)(t))throw new r.Z("invalid-image",`Could not fetch requested image at ${n}`);throw t}finally{window.URL.revokeObjectURL(n)}}(new Blob([l],{type:u}),e)}},24133:(t,e,n)=>{n.d(e,{Q:()=>o});var i=n(67676),r=n(44553),s=n(88764);class o{constructor(t=9,e){this._compareMinX=c,this._compareMinY=h,this._toBBox=t=>t,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&("function"==typeof e?this._toBBox=e:this._initFormat(e)),this.clear()}destroy(){this.clear(),x.prune(),M.prune(),v.prune(),w.prune()}all(t){this._all(this._data,t)}search(t,e){let n=this._data;const i=this._toBBox;if(g(t,n))for(x.clear();n;){for(let r=0,s=n.children.length;r<s;r++){const s=n.children[r],o=n.leaf?i(s):s;g(t,o)&&(n.leaf?e(s):_(t,o)?this._all(s,e):x.push(s))}n=x.pop()}}collides(t){let e=this._data;const n=this._toBBox;if(!g(t,e))return!1;for(x.clear();e;){for(let i=0,r=e.children.length;i<r;i++){const r=e.children[i],s=e.leaf?n(r):r;if(g(t,s)){if(e.leaf||_(t,s))return!0;x.push(r)}}e=x.pop()}return!1}load(t){if(!t.length)return this;if(t.length<this._minEntries){for(let e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}let e=this._build(t.slice(0,t.length),0,t.length-1,0);if(this._data.children.length)if(this._data.height===e.height)this._splitRoot(this._data,e);else{if(this._data.height<e.height){const t=this._data;this._data=e,e=t}this._insert(e,this._data.height-e.height-1,!0)}else this._data=e;return this}insert(t){return t&&this._insert(t,this._data.height-1),this}clear(){return this._data=new R([]),this}remove(t){if(!t)return this;let e,n=this._data,r=null,s=0,o=!1;const a=this._toBBox(t);for(v.clear(),w.clear();n||v.length>0;){if(n||(n=v.pop(),r=v.data[v.length-1],s=w.pop()??0,o=!0),n.leaf&&(e=(0,i.cq)(n.children,t,n.children.length,n.indexHint),-1!==e))return n.children.splice(e,1),v.push(n),this._condense(v),this;o||n.leaf||!_(n,a)?r?(s++,n=r.children[s],o=!1):n=null:(v.push(n),w.push(s),s=0,r=n,n=n.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,e){let n=t;for(M.clear();n;){if(!0===n.leaf)for(const t of n.children)e(t);else M.pushArray(n.children);n=M.pop()??null}}_build(t,e,n,i){const r=n-e+1;let s=this._maxEntries;if(r<=s){const i=new R(t.slice(e,n+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/s**(i-1)));const o=new C([]);o.height=i;const l=Math.ceil(r/s),u=l*Math.ceil(Math.sqrt(s));y(t,e,n,u,this._compareMinX);for(let r=e;r<=n;r+=u){const e=Math.min(r+u-1,n);y(t,r,e,l,this._compareMinY);for(let n=r;n<=e;n+=l){const r=Math.min(n+l-1,e);o.children.push(this._build(t,n,r,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(t,e,n,i){for(;i.push(e),!0!==e.leaf&&i.length-1!==n;){let n,i=1/0,r=1/0;for(let s=0,o=e.children.length;s<o;s++){const o=e.children[s],a=d(o),l=p(t,o)-a;l<r?(r=l,i=a<i?a:i,n=o):l===r&&a<i&&(i=a,n=o)}e=n||e.children[0]}return e}_insert(t,e,n){const i=this._toBBox,r=n?t:i(t);v.clear();const s=this._chooseSubtree(r,this._data,e,v);for(s.children.push(t),u(s,r);e>=0&&v.data[e].children.length>this._maxEntries;)this._split(v,e),e--;this._adjustParentBBoxes(r,v,e)}_split(t,e){const n=t.data[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);const s=this._chooseSplitIndex(n,r,i);if(!s)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=n.children.splice(s,n.children.length-s),l=n.leaf?new R(o):new C(o);l.height=n.height,a(n,this._toBBox),a(l,this._toBBox),e?t.data[e-1].children.push(l):this._splitRoot(n,l)}_splitRoot(t,e){this._data=new C([t,e]),this._data.height=t.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(t,e,n){let i,r,s;i=r=1/0;for(let o=e;o<=n-e;o++){const e=l(t,0,o,this._toBBox),a=l(t,o,n,this._toBBox),u=f(e,a),c=d(e)+d(a);u<i?(i=u,s=o,r=c<r?c:r):u===i&&c<r&&(r=c,s=o)}return s}_chooseSplitAxis(t,e,n){const i=t.leaf?this._compareMinX:c,r=t.leaf?this._compareMinY:h;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,r)&&t.children.sort(i)}_allDistMargin(t,e,n,i){t.children.sort(i);const r=this._toBBox,s=l(t,0,e,r),o=l(t,n-e,n,r);let a=m(s)+m(o);for(let i=e;i<n-e;i++){const e=t.children[i];u(s,t.leaf?r(e):e),a+=m(s)}for(let i=n-e-1;i>=e;i--){const e=t.children[i];u(o,t.leaf?r(e):e),a+=m(o)}return a}_adjustParentBBoxes(t,e,n){for(let i=n;i>=0;i--)u(e.data[i],t)}_condense(t){for(let e=t.length-1;e>=0;e--){const n=t.data[e];if(0===n.children.length)if(e>0){const r=t.data[e-1],s=r.children;s.splice((0,i.cq)(s,n,s.length,r.indexHint),1)}else this.clear();else a(n,this._toBBox)}}_initFormat(t){const e=["return a"," - b",";"];this._compareMinX=new Function("a","b",e.join(t[0])),this._compareMinY=new Function("a","b",e.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function a(t,e){l(t,0,t.children.length,e,t)}function l(t,e,n,i,r){r||(r=new R([])),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s,o=e;o<n;o++)s=t.children[o],u(r,t.leaf?i(s):s);return r}function u(t,e){t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY)}function c(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function d(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function m(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function f(t,e){const n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),s=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,s-i)}function _(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function g(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t,e,n,i,r){const o=[e,n];for(;o.length;){const e=o.pop(),n=o.pop();if(e-n<=i)continue;const a=n+Math.ceil((e-n)/i/2)*i;(0,s.q)(t,a,n,e,r),o.push(n,a,a,e)}}const x=new r.Z,M=new r.Z,v=new r.Z,w=new r.Z({deallocator:void 0});class b{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class P extends b{constructor(){super(...arguments),this.height=1,this.indexHint=new i.SO}}class R extends P{constructor(t){super(),this.children=t,this.leaf=!0}}class C extends P{constructor(t){super(),this.children=t,this.leaf=!1}}},17445:(t,e,n)=>{n.d(e,{N1:()=>d,YP:()=>l,Z_:()=>f,gx:()=>u,nn:()=>_,on:()=>h,tX:()=>g}),n(66643),n(46791);var i=n(91460),r=n(50758),s=n(70586),o=n(95330),a=n(26258);function l(t,e,n={}){return c(t,e,n,m)}function u(t,e,n={}){return c(t,e,n,p)}function c(t,e,n={},i){let r=null;const o=n.once?(t,n)=>{i(t)&&((0,s.hw)(r),e(t,n))}:(t,n)=>{i(t)&&e(t,n)};if(r=(0,a.aQ)(t,o,n.sync,n.equals),n.initial){const e=t();o(e,e)}return r}function h(t,e,n,o={}){let a=null,u=null,c=null;function h(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(t){o.once&&o.once&&(0,s.hw)(c),n(t)}const m=l(t,((t,n)=>{h(),(0,i.vT)(t)&&(a=t,u=(0,i.on)(t,e,d),o.onListenerAdd?.(t))}),{sync:o.sync,initial:!0});return c=(0,r.kB)((()=>{m.remove(),h()})),c}function d(t,e){return function(t,e,n){if((0,o.Hc)(n))return Promise.reject((0,o.zE)());const i=t();if(e?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,s.hw)(a)}return new Promise(((i,s)=>{a=(0,r.AL)([(0,o.fu)(n,(()=>{l(),s((0,o.zE)())})),c(t,(t=>{l(),i(t)}),{sync:!1,once:!0},e??m)])}))}(t,p,e)}function m(t){return!0}function p(t){return!!t}n(87538);const f={sync:!0},_={initial:!0},g={sync:!0,initial:!0}},35463:(t,e,n)=>{n.d(e,{JE:()=>o,Nm:()=>s,rJ:()=>a}),n(80442);const i={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},r={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function s(t,e,n){const i=new Date(t.getTime());if(e&&n){const t=r[n],{getter:s,setter:o,multiplier:a}=t;if("months"===n){const t=function(t,e){const n=new Date(t,e+1,1);return n.setDate(0),n.getDate()}(i.getFullYear(),i.getMonth()+e);i.getDate()>t&&i.setDate(t)}i[o](i[s]()+e*a)}return i}function o(t,e){switch(e){case"milliseconds":return new Date(t.getTime());case"seconds":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());case"minutes":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes());case"hours":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours());case"days":return new Date(t.getFullYear(),t.getMonth(),t.getDate());case"weeks":return new Date(t.getFullYear(),t.getMonth(),t.getDate()-t.getDay());case"months":return new Date(t.getFullYear(),t.getMonth(),1);case"years":return new Date(t.getFullYear(),0,1);case"decades":return new Date(t.getFullYear()-t.getFullYear()%10,0,1);case"centuries":return new Date(t.getFullYear()-t.getFullYear()%100,0,1);default:return new Date}}function a(t,e,n){return 0===t?0:t*i[e]/i[n]}},41123:(t,e,n)=>{n.d(e,{D:()=>r,z:()=>s});const i="randomUUID"in crypto;function r(){if(i)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=e=>t[e].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function s(){return`{${r()}}`}},73913:(t,e,n)=>{n.d(e,{Sy:()=>l,UZ:()=>o,XZ:()=>a,x3:()=>u});var i=n(58901),r=n(82971),s=n(33955);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:r.Z.WebMercator}),minus180Line:new i.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:r.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.Z({paths:[[[180,-180],[180,180]]],spatialReference:r.Z.WGS84}),minus180Line:new i.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:r.Z.WGS84})}};function a(t,e){return Math.ceil((t-e)/(2*e))}function l(t,e){const n=u(t);for(const t of n)for(const n of t)n[0]+=e;return t}function u(t){return(0,s.oU)(t)?t.rings:t.paths}},57765:(t,e,n)=>{n.r(e),n.d(e,{default:()=>re});var i=n(43697),r=n(46791),s=n(20102),o=n(92604),a=n(16453),l=n(5600),u=n(90578),c=(n(67676),n(80442),n(71715)),h=n(52011),d=n(30556),m=n(87085),p=n(71612),f=n(38009),_=n(72965),g=n(3172),y=n(70163),x=n(17452),M=n(41123),v=(n(75215),n(10699)),w=n(96674),b=n(83379),P=n(92036),R=n(21787),C=n(46521),I=n(4307),T=n(17896);const B=(0,n(65617).c)(),Z=(0,C.c)(),S=(0,C.c)(),j=(0,C.c)();function Y(t,e,n){return(0,T.s)(B,e[0],e[1],1),(0,T.t)(B,B,(0,R.t)(Z,n)),0===B[2]?(0,I.s)(t,B[0],B[1]):(0,I.s)(t,B[0]/B[2],B[1]/B[2])}function O(t,e,n){return E(S,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),E(j,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),(0,R.m)(t,(0,R.b)(S,S),j),0!==t[8]&&(t[0]/=t[8],t[1]/=t[8],t[2]/=t[8],t[3]/=t[8],t[4]/=t[8],t[5]/=t[8],t[6]/=t[8],t[7]/=t[8],t[8]/=t[8]),t}function E(t,e,n,i,r,s,o,a,l){(0,R.c)(t,e,i,s,n,r,o,1,1,1),(0,T.s)(B,a,l,1),(0,R.b)(Z,t);const[u,c,h]=(0,T.t)(B,B,(0,R.t)(Z,Z));return(0,R.c)(Z,u,0,0,0,c,0,0,0,h),(0,R.m)(t,Z,t)}var X=n(62357),L=n(97323),D=n(94139),A=n(38913),F=n(44547),z=n(82971),q=n(2368);let N=class extends q.j{projectOrWarn(t,e){if(null==t)return t;const{geometry:n,pending:i}=(0,F.dz)(t,e);return i?null:i||n?n:(o.Z.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:t,sourceSpatialReference:t.spatialReference,targetSpatialReference:e}),null)}};N=(0,i._)([(0,h.j)("esri.layers.support.GeoreferenceBase")],N);const H=N,V=(0,C.c)(),U=(0,L.a)();let W=class extends P.Z{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};(0,i._)([(0,l.Cb)()],W.prototype,"sourcePoint",void 0),(0,i._)([(0,l.Cb)({type:D.Z})],W.prototype,"mapPoint",void 0),W=(0,i._)([(0,h.j)("esri.layers.support.ControlPoint")],W);let J=class extends((0,w.eC)(H)){constructor(t){super(t),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(t,e){const n=z.Z.fromJSON(e.spatialReference),i=(0,C.f)(...e.coefficients,1);return t.map((t=>((0,I.s)(U,t.x,t.y),Y(U,U,i),{sourcePoint:t,mapPoint:new D.Z({x:U[0],y:U[1],spatialReference:n})})))}writeControlPoints(t,e,n,i){if(null!=this.transform)null!=t&&k(t[0])&&(e.controlPoints=t.map((t=>{const e=t.sourcePoint;return{x:e.x,y:e.y}})),e.spatialReference=t[0].mapPoint.spatialReference.toJSON(),e.coefficients=this.transform.slice(0,8));else{const t=new s.Z("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration.",{layer:i?.layer,georeference:this});i?.messages?i.messages.push(t):o.Z.getLogger(this).error(t.name,t.message)}}get coords(){if(null==this.controlPoints)return null;const t=this._updateTransform(V);if(null==t||!k(this.controlPoints[0]))return null;const e=this.controlPoints[0].mapPoint.spatialReference;return function(t,e,n,i){const r=(0,L.f)(0,n),s=(0,L.f)(0,0),o=(0,L.f)(e,0),a=(0,L.f)(e,n);return Y(r,r,t),Y(s,s,t),Y(o,o,t),Y(a,a,t),new A.Z({rings:[[r,s,o,a,r]],spatialReference:i})}(t,this.width,this.height,e)}set coords(t){if(null==this.controlPoints||!k(this.controlPoints[0]))return;const e=this.controlPoints[0].mapPoint.spatialReference;if(null==(t=this.projectOrWarn(t,e)))return;const{width:n,height:i}=this,{rings:[[r,s,o,a]]}=t,l={sourcePoint:(0,X.vW)(0,i),mapPoint:new D.Z({x:r[0],y:r[1],spatialReference:e})},u={sourcePoint:(0,X.vW)(0,0),mapPoint:new D.Z({x:s[0],y:s[1],spatialReference:e})},c={sourcePoint:(0,X.vW)(n,0),mapPoint:new D.Z({x:o[0],y:o[1],spatialReference:e})},h={sourcePoint:(0,X.vW)(n,i),mapPoint:new D.Z({x:a[0],y:a[1],spatialReference:e})};k(l)&&k(u)&&k(c)&&k(h)&&(ot(V,l,u,c,h),this.controlPoints=this.controlPoints.map((({sourcePoint:t})=>((0,I.s)(U,t.x,t.y),Y(U,U,V),{sourcePoint:t,mapPoint:new D.Z({x:U[0],y:U[1],spatialReference:e})}))))}get inverseTransform(){return null==this.transform?null:(0,R.e)((0,C.c)(),this.transform)}get transform(){return this._updateTransform()}toMap(t){if(null==t||null==this.transform||null==this.controlPoints||!k(this.controlPoints[0]))return null;(0,I.s)(U,t.x,t.y);const e=this.controlPoints[0].mapPoint.spatialReference;return Y(U,U,this.transform),new D.Z({x:U[0],y:U[1],spatialReference:e})}toSource(t){if(null==t||null==this.inverseTransform||null==this.controlPoints||!k(this.controlPoints[0]))return null;const e=this.controlPoints[0].mapPoint.spatialReference;return t=t.normalize(),null==(t=(0,F.dz)(t,e).geometry)?null:((0,I.s)(U,t.x,t.y),Y(U,U,this.inverseTransform),(0,X.vW)(U[0],U[1]))}_updateTransform(t){const{controlPoints:e,width:n,height:i}=this;if(!(null!=e&&n>0&&i>0))return null;const[r,s,o,a]=e;if(!k(r))return null;const l=r.mapPoint.spatialReference,u=this._projectControlPoint(s,l),c=this._projectControlPoint(o,l),h=this._projectControlPoint(a,l);if(!u.valid||!c.valid||!h.valid)return null;if(!k(u.controlPoint))return null;null==t&&(t=(0,C.c)());let d=null;return d=k(c.controlPoint)&&k(h.controlPoint)?ot(t,r,u.controlPoint,c.controlPoint,h.controlPoint):k(c.controlPoint)?function(t,e,n,i){return st(G,tt,e),st($,et,n),st(K,nt,i),(0,I.l)(Q,G,$,.5),(0,I.r)(Q,K,Q,Math.PI),(0,I.l)(it,tt,et,.5),(0,I.r)(it,nt,it,Math.PI),ct(t,G,$,K,Q,tt,et,nt,it)}(t,r,u.controlPoint,c.controlPoint):function(t,e,n){return st(G,tt,e),st($,et,n),(0,I.r)(K,$,G,rt),(0,I.r)(Q,G,$,rt),(0,I.r)(nt,et,tt,-rt),(0,I.r)(it,tt,et,-rt),ct(t,G,$,K,Q,tt,et,nt,it)}(t,r,u.controlPoint),d.every((t=>0===t))?null:d}_projectControlPoint(t,e){if(!k(t))return{valid:!0,controlPoint:t};const{sourcePoint:n,mapPoint:i}=t,{geometry:r,pending:s}=(0,F.dz)(i,e);return s?{valid:!1,controlPoint:null}:s||r?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:r}}:(o.Z.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:t,sourceSpatialReference:i.spatialReference,targetSpatialReference:e}),{valid:!1,controlPoint:null})}};function k(t){return null!=t&&null!=t.sourcePoint&&null!=t.mapPoint}(0,i._)([(0,l.Cb)({type:[W],json:{write:{allowNull:!1,isRequired:!0}}})],J.prototype,"controlPoints",void 0),(0,i._)([(0,c.r)("controlPoints")],J.prototype,"readControlPoints",null),(0,i._)([(0,d.c)("controlPoints")],J.prototype,"writeControlPoints",null),(0,i._)([(0,l.Cb)()],J.prototype,"coords",null),(0,i._)([(0,l.Cb)({json:{write:!0}})],J.prototype,"height",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],J.prototype,"inverseTransform",null),(0,i._)([(0,l.Cb)({readOnly:!0})],J.prototype,"transform",null),(0,i._)([(0,l.Cb)({json:{write:!0}})],J.prototype,"width",void 0),J=(0,i._)([(0,h.j)("esri.layers.support.ControlPointsGeoreference")],J);const G=(0,L.a)(),$=(0,L.a)(),K=(0,L.a)(),Q=(0,L.a)(),tt=(0,L.a)(),et=(0,L.a)(),nt=(0,L.a)(),it=(0,L.a)(),rt=Math.PI/2;function st(t,e,n){(0,I.s)(t,n.sourcePoint.x,n.sourcePoint.y),(0,I.s)(e,n.mapPoint.x,n.mapPoint.y)}function ot(t,e,n,i,r){return st(G,tt,e),st($,et,n),st(K,nt,i),st(Q,it,r),ct(t,G,$,K,Q,tt,et,nt,it)}const at=new Array(8).fill(0),lt=new Array(8).fill(0);function ut(t,e,n,i,r){return t[0]=e[0],t[1]=e[1],t[2]=n[0],t[3]=n[1],t[4]=i[0],t[5]=i[1],t[6]=r[0],t[7]=r[1],t}function ct(t,e,n,i,r,s,o,a,l){return O(t,ut(at,e,n,i,r),ut(lt,s,o,a,l))}const ht=J;let dt=class extends H{constructor(t){super(t),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:t,topRight:e,bottomLeft:n,bottomRight:i}=this;if(null==t||null==e||null==n||null==i)return null;const r=t.spatialReference;return e=this.projectOrWarn(e,r),n=this.projectOrWarn(n,r),i=this.projectOrWarn(i,r),null==e||null==n||null==i?null:new A.Z({rings:[[[n.x,n.y],[t.x,t.y],[e.x,e.y],[i.x,i.y],[n.x,n.y]]],spatialReference:r})}set coords(t){const{topLeft:e}=this;if(null==e)return;const n=e.spatialReference;if(null==(t=this.projectOrWarn(t,n)))return;const{rings:[[i,r,s,o]]}=t;this.bottomLeft=new D.Z({x:i[0],y:i[1],spatialReference:n}),this.topLeft=new D.Z({x:r[0],y:r[1],spatialReference:n}),this.topRight=new D.Z({x:s[0],y:s[1],spatialReference:n}),this.bottomRight=new D.Z({x:o[0],y:o[1],spatialReference:n})}};(0,i._)([(0,l.Cb)()],dt.prototype,"coords",null),(0,i._)([(0,l.Cb)({type:D.Z})],dt.prototype,"bottomLeft",void 0),(0,i._)([(0,l.Cb)({type:D.Z})],dt.prototype,"bottomRight",void 0),(0,i._)([(0,l.Cb)({type:D.Z})],dt.prototype,"topLeft",void 0),(0,i._)([(0,l.Cb)({type:D.Z})],dt.prototype,"topRight",void 0),dt=(0,i._)([(0,h.j)("esri.layers.support.CornersGeoreference")],dt);const mt=dt;var pt=n(22021),ft=n(46851),_t=n(6570);let gt=class extends H{constructor(t){super(t),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(null==this.extent)return null;const{xmin:t,ymin:e,xmax:n,ymax:i,spatialReference:r}=this.extent;let s;if(this.rotation){const{x:r,y:o}=this.extent.center,a=yt(r,o,this.rotation);s=[a(t,e),a(t,i),a(n,i),a(n,e)],s.push(s[0])}else s=[[t,e],[t,i],[n,i],[n,e],[t,e]];return new A.Z({rings:[s],spatialReference:r})}set coords(t){if(null==t||null==this.extent)return;const e=this.extent.spatialReference;if(null==(t=this.projectOrWarn(t,e))||null==t.extent)return;const{rings:[[n,i,r]],extent:{center:{x:s,y:o}}}=t,a=(0,pt.BV)(Math.PI/2-Math.atan2(i[1]-n[1],i[0]-n[0])),l=yt(s,o,-a),[u,c]=l(n[0],n[1]),[h,d]=l(r[0],r[1]);this.extent=new _t.Z({xmin:u,ymin:c,xmax:h,ymax:d,spatialReference:e}),this.rotation=a}};function yt(t,e,n){const i=(0,ft.t)(n),r=Math.cos(i),s=Math.sin(i);return(n,i)=>[r*(n-t)+s*(i-e)+t,r*(i-e)-s*(n-t)+e]}(0,i._)([(0,l.Cb)()],gt.prototype,"coords",null),(0,i._)([(0,l.Cb)({type:_t.Z})],gt.prototype,"extent",void 0),(0,i._)([(0,l.Cb)({type:Number})],gt.prototype,"rotation",void 0),gt=(0,i._)([(0,h.j)("esri.layers.support.ExtentAndRotationGeoreference")],gt);const xt={key:"type",base:H,typeMap:{"control-points":ht,corners:mt,"extent-and-rotation":gt}};let Mt=class extends((0,v.iv)((0,w.eC)(b.Z))){constructor(t){super(t),this.georeference=null,this.opacity=1}readGeoreference(t){return ht.fromJSON(t)}};(0,i._)([(0,l.Cb)({types:xt,json:{write:!0}})],Mt.prototype,"georeference",void 0),(0,i._)([(0,c.r)("georeference")],Mt.prototype,"readGeoreference",null),(0,i._)([(0,l.Cb)()],Mt.prototype,"opacity",void 0),Mt=(0,i._)([(0,h.j)("esri.layers.support.MediaElementBase")],Mt);const vt=Mt;var wt=n(66094),bt=n(25929);let Pt=class extends vt{constructor(t){super(t),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const t=this.image;if("string"==typeof t){const e=(0,y.n$)(t).then((t=>{this._set("content",t)}));this.addResolvingPromise(e)}else if(t instanceof HTMLImageElement){const e=t.decode().then((()=>{this._set("content",t)}));this.addResolvingPromise(e)}else t?this._set("content",t):this.addResolvingPromise(Promise.reject(new s.Z("image-element:invalid-image-type","Invalid image type",{image:t})));return Promise.resolve(this)}readImage(t,e,n){return(0,bt.f)(e.url,n)}writeImage(t,e,n,i){if(null==t)return;const r=i?.portalItem,s=i?.resources;if(!r||!s)return void("string"==typeof t&&(e[n]=(0,bt.t)(t,i)));const o="string"!=typeof t||(0,x.HK)(t)||(0,x.jc)(t)?null:t;if(o){if(null==(0,bt.i)(o))return void(e[n]=o);const t=(0,bt.t)(o,{...i,verifyItemRelativeUrls:i&&i.verifyItemRelativeUrls?{writtenUrls:i.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},bt.M.NO);if(r&&t&&!(0,x.YP)(t))return s.toKeep.push({resource:r.resourceFromPath(t),compress:!1}),void(e[n]=t)}e[n]="<pending>",s.pendingOperations.push(Ct(t).then((t=>{const i=function(t,e){const n=(0,M.D)(),i=`${(0,x.v_)("media",n)}.${(0,wt.B)(t)}`;return e.resourceFromPath(i)}(t,r);e[n]=i.itemRelativeUrl,s.toAdd.push({resource:i,content:t,compress:!1,finish:t=>{this.image=t.url}})})))}};(0,i._)([(0,l.Cb)()],Pt.prototype,"animationOptions",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],Pt.prototype,"content",void 0),(0,i._)([(0,l.Cb)({json:{name:"url",type:String}})],Pt.prototype,"image",void 0),(0,i._)([(0,c.r)("image",["url"])],Pt.prototype,"readImage",null),(0,i._)([(0,d.c)("image")],Pt.prototype,"writeImage",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{name:"mediaType"}})],Pt.prototype,"type",void 0),Pt=(0,i._)([(0,h.j)("esri.layers.support.ImageElement")],Pt);const Rt=Pt;async function Ct(t){if("string"==typeof t){if((0,x.jc)(t)){const{data:e}=await(0,g.Z)(t,{responseType:"blob"});return e}return(0,x.HK)(t)?(0,x.fw)(t):Ct((await(0,g.Z)(t,{responseType:"image"})).data)}return new Promise((e=>function(t){if(t instanceof HTMLCanvasElement)return t;const e=t instanceof HTMLImageElement?t.naturalWidth:t.width,n=t instanceof HTMLImageElement?t.naturalHeight:t.height,i=document.createElement("canvas"),r=i.getContext("2d");return i.width=e,i.height=n,t instanceof HTMLImageElement?r.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&r.putImageData(t,0,0),i}(t).toBlob(e)))}n(66577);var It=n(70921),Tt=n(32448),Bt=n(609),Zt=n(95330),St=n(17445),jt=n(24470),Yt=n(87416),Ot=n(8744),Et=n(37549),Xt=n(20322),Lt=n(86662),Dt=n(33955),At=n(73913);function Ft(t,e,n){if(Array.isArray(t)){const i=t[0];if(i>e){const n=(0,At.XZ)(i,e);t[0]=i+n*(-2*e)}else if(i<n){const e=(0,At.XZ)(i,n);t[0]=i+e*(-2*n)}}else{const i=t.x;if(i>e){const n=(0,At.XZ)(i,e);t.x+=n*(-2*e)}else if(i<n){const e=(0,At.XZ)(i,n);t.x+=e*(-2*n)}}return t}function zt(t,e){const n=[],{ymin:i,ymax:r,xmin:s,xmax:o}=t,a=t.xmax-t.xmin,[l,u]=e.valid,{x:c,frameId:h}=qt(t.xmin,e),{x:d,frameId:m}=qt(t.xmax,e),p=c===d&&a>0;if(a>2*u){const t={xmin:s<o?c:d,ymin:i,xmax:u,ymax:r},e={xmin:l,ymin:i,xmax:s<o?d:c,ymax:r},a={xmin:0,ymin:i,xmax:u,ymax:r},p={xmin:l,ymin:i,xmax:0,ymax:r},f=[],_=[];Nt(t,a)&&f.push(h),Nt(t,p)&&_.push(h),Nt(e,a)&&f.push(m),Nt(e,p)&&_.push(m);for(let t=h+1;t<m;t++)f.push(t),_.push(t);n.push(new Ut(t,[h]),new Ut(e,[m]),new Ut(a,f),new Ut(p,_))}else c>d||p?n.push(new Ut({xmin:c,ymin:i,xmax:u,ymax:r},[h]),new Ut({xmin:l,ymin:i,xmax:d,ymax:r},[m])):n.push(new Ut({xmin:c,ymin:i,xmax:d,ymax:r},[h]));return n}function qt(t,e){const[n,i]=e.valid,r=2*i;let s,o=0;return t>i?(s=Math.ceil(Math.abs(t-i)/r),t-=s*r,o=s):t<n&&(s=Math.ceil(Math.abs(t-n)/r),t+=s*r,o=-s),{x:t,frameId:o}}function Nt(t,e){const{xmin:n,ymin:i,xmax:r,ymax:s}=e;return Ht(t,n,i)&&Ht(t,n,s)&&Ht(t,r,s)&&Ht(t,r,i)}function Ht(t,e,n){return e>=t.xmin&&e<=t.xmax&&n>=t.ymin&&n<=t.ymax}function Vt(t,e,n=!0){const i=!(0,Dt.l9)(t);if(i&&(0,Lt.Zy)(t),n)return(new Jt).cut(t,e);const r=i?t.rings:t.paths,s=i?4:2,o=r.length,a=-2*e;for(let t=0;t<o;t++){const e=r[t];if(e&&e.length>=s){const t=[];for(const n of e)t.push([n[0]+a,n[1]]);r.push(t)}}return i?t.rings=r:t.paths=r,t}class Ut{constructor(t,e){this.extent=t,this.frameIds=e}}const Wt=(0,jt.Ue)();class Jt{constructor(){this._linesIn=[],this._linesOut=[]}cut(t,e){let n;if(this._xCut=e,t.rings)this._closed=!0,n=t.rings,this._minPts=4;else{if(!t.paths)return null;this._closed=!1,n=t.paths,this._minPts=2}for(const t of n){if(!t||t.length<this._minPts)continue;let e=!0;for(const n of t)e?(this.moveTo(n),e=!1):this.lineTo(n);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),n=[];for(const t of this._linesIn)t&&t.length>=this._minPts&&n.push(t);const i=-2*this._xCut;for(const t of this._linesOut)if(t&&t.length>=this._minPts){for(const e of t)e[0]+=i;n.push(t)}return this._closed?t.rings=n:t.paths=n,t}moveTo(t){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(t[0]),this._moveTo(t[0],t[1],this._prevSide),this._prevPt=t,this._firstPt=t}lineTo(t){const e=this._side(t[0]);if(e*this._prevSide==-1){const n=this._intersect(this._prevPt,t);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(t[0],t[1],e)}else this._lineTo(t[0],t[1],e);this._prevSide=e,this._prevPt=t}close(){const t=this._firstPt,e=this._prevPt;t[0]===e[0]&&t[1]===e[1]||this.lineTo(t),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(t,e,n){this._closed?(this._lineIn.push([n<=0?t:this._xCut,e]),this._lineOut.push([n>=0?t:this._xCut,e])):(n<=0&&this._lineIn.push([t,e]),n>=0&&this._lineOut.push([t,e]))}_lineTo(t,e,n){this._closed?(this._addPolyVertex(this._lineIn,n<=0?t:this._xCut,e),this._addPolyVertex(this._lineOut,n>=0?t:this._xCut,e)):n<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([t,e])):n>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([t,e])):this._prevSide<0?(this._lineIn.push([t,e]),this._lineOut.push([t,e])):this._prevSide>0&&(this._lineOut.push([t,e]),this._lineIn.push([t,e]))}_addPolyVertex(t,e,n){const i=t.length;i>1&&t[i-1][0]===e&&t[i-2][0]===e?t[i-1][1]=n:t.push([e,n])}_checkClosingPt(t){const e=t.length;e>3&&t[0][0]===this._xCut&&t[e-2][0]===this._xCut&&t[1][0]===this._xCut&&(t[0][1]=t[e-2][1],t.pop())}_side(t){return t<this._xCut?-1:t>this._xCut?1:0}_intersect(t,e){const n=(this._xCut-t[0])/(e[0]-t[0]);return t[1]+n*(e[1]-t[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}let kt=class extends P.Z{constructor(t){super(t)}get bounds(){const t=this.coords;return null==t||null==t.extent?null:(0,jt.oJ)(t.extent)}get coords(){const t=this.element.georeference?.coords;return(0,F.dz)(t,this.spatialReference).geometry}get normalizedCoords(){return A.Z.fromJSON(function(t,e){if(null==t)return null;const n=t.spatialReference,i=(0,Ot.C5)(n),r=(0,w.AK)(t)?t.toJSON():t;if(!i)return r;const s=(0,Ot.sS)(n)?102100:4326,o=At.UZ[s].maxX,a=At.UZ[s].minX;if((0,Dt.wp)(r))return Ft(r,o,a);if((0,Dt.aW)(r))return r.points=r.points.map((t=>Ft(t,o,a))),r;if((0,Dt.YX)(r))return function(t,e){if(!e)return t;const n=zt(t,e).map((t=>t.extent));return n.length<2?n[0]||t:n.length>2?(t.xmin=e.valid[0],t.xmax=e.valid[1],t):{rings:n.map((t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]))}}(r,i);if((0,Dt.oU)(r)||(0,Dt.l9)(r)){const t=(0,Xt.$P)(Wt,r),n={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},i=(0,At.XZ)(n.xmin,a)*(2*o),s=0===i?r:(0,At.Sy)(r,i);return n.xmin+=i,n.xmax+=i,n.xmax>o?Vt(s,o,e):n.xmin<a?Vt(s,a,e):s}return r}(this.coords,!0))}get normalizedBounds(){const t=null!=this.normalizedCoords?this.normalizedCoords.extent:null;return null!=t?(0,jt.oJ)(t):null}};(0,i._)([(0,l.Cb)()],kt.prototype,"spatialReference",void 0),(0,i._)([(0,l.Cb)()],kt.prototype,"element",void 0),(0,i._)([(0,l.Cb)()],kt.prototype,"bounds",null),(0,i._)([(0,l.Cb)()],kt.prototype,"coords",null),(0,i._)([(0,l.Cb)()],kt.prototype,"normalizedCoords",null),(0,i._)([(0,l.Cb)()],kt.prototype,"normalizedBounds",null),kt=(0,i._)([(0,h.j)("esri.layers.support.MediaElementView")],kt);let Gt=class extends vt{constructor(t){super(t),this.content=null,this.type="video"}load(){const t=this.video;if("string"==typeof t){const e=document.createElement("video");e.src=t,e.crossOrigin="anonymous",e.autoplay=!0,e.muted=!0,e.loop=!0,this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)})))}else t instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(t).then((()=>{this._set("content",t)}))):this.addResolvingPromise(Promise.reject(new s.Z("video-element:invalid-video-type","Invalid video type",{video:t})));return Promise.resolve(this)}set video(t){"not-loaded"===this.loadStatus?this._set("video",t):o.Z.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}_loadVideo(t){return new Promise(((e,n)=>{t.oncanplay=()=>{t.oncanplay=null,t.play().then(e,n)},"anonymous"!==t.crossOrigin&&(t.crossOrigin="anonymous",t.src=t.src)}))}};(0,i._)([(0,l.Cb)({readOnly:!0})],Gt.prototype,"content",void 0),(0,i._)([(0,l.Cb)()],Gt.prototype,"video",null),Gt=(0,i._)([(0,h.j)("esri.layers.support.VideoElement")],Gt);const $t=Gt,Kt={key:"type",defaultKeyValue:"image",base:vt,typeMap:{image:Rt,video:$t}},Qt=r.Z.ofType(Kt);let te=class extends(b.Z.LoadableMixin((0,Bt.v)(Tt.Z.EventedAccessor))){constructor(t){super(t),this._index=new Et.H,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const e of t.removed){const t=this._elementViewsMap.get(e);this._elementViewsMap.delete(e),this._index.delete(t),this.removeHandles(t),t.destroy(),this.notifyChange("fullExtent")}const{spatialReference:e}=this;for(const n of t.added){if(this._elementViewsMap.get(n))continue;const t=new kt({spatialReference:e,element:n});this._elementViewsMap.set(n,t);const i=(0,St.YP)((()=>t.coords),(()=>this._updateIndexForElement(t,!1)));this._updateIndexForElement(t,!0),this.addHandles(i,t)}this._elementsIndexes.clear(),this.elements.forEach(((t,e)=>this._elementsIndexes.set(t,e))),this.emit("refresh")},this.elements=new Qt}async load(t){if((0,Zt.k_)(t),!this.spatialReference){const t=this.elements.find((t=>null!=t.georeference&&null!=t.georeference.coords));this._set("spatialReference",t?t.georeference.coords.spatialReference:z.Z.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(t){this._set("elements",(0,It.Z)(t,this._get("elements"),Qt))}get fullExtent(){if("not-loaded"===this.loadStatus)return null;const t=this._index.fullBounds;return null==t?null:new _t.Z({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:this.spatialReference})}set spatialReference(t){"not-loaded"===this.loadStatus?this._set("spatialReference",t):o.Z.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(t,e){await this.load(),await(0,F.initializeProjection)(t.spatialReference,this.spatialReference,null,e);const n=(0,Ot.fS)(t.spatialReference,this.spatialReference)?t:(0,F.iV)(t,this.spatialReference);if(!n)return[];const i=n.normalize(),r=[];for(const t of i)this._index.forEachInBounds((0,jt.oJ)(t),(({normalizedCoords:e,element:n})=>{null!=e&&(0,Yt.Nl)(t,e)&&r.push(n)}));return r.sort(((t,e)=>this._elementsIndexes.get(t)-this._elementsIndexes.get(e))),r}_updateIndexForElement(t,e){const n=t.normalizedBounds,i=this._index.has(t),r=null!=n;this._index.delete(t),r&&this._index.set(t,n),this.notifyChange("fullExtent"),e||(i!==r?this.emit("refresh"):this.emit("change",{element:t.element}))}};(0,i._)([(0,l.Cb)()],te.prototype,"elements",null),(0,i._)([(0,l.Cb)({readOnly:!0})],te.prototype,"fullExtent",null),(0,i._)([(0,l.Cb)()],te.prototype,"spatialReference",null),te=(0,i._)([(0,h.j)("esri.layers.support.LocalMediaElementSource")],te);const ee=te;function ne(t){return"object"==typeof t&&null!=t&&"type"in t}let ie=class extends((0,p.h)((0,_.M)((0,f.q)((0,a.R)(m.Z))))){constructor(t){super(t),this.effectiveSource=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this.source=new ee}load(t){const e=this.source;if(!e)return this.addResolvingPromise(Promise.reject(new s.Z("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer."))),Promise.resolve(this);const n=ne(e)?new ee({elements:new r.Z([e])}):e;this._set("effectiveSource",n),this.spatialReference&&(n.spatialReference=this.spatialReference);const i=n.load(t).then((()=>{this.spatialReference=n.spatialReference}));return this.addResolvingPromise(i),Promise.resolve(this)}destroy(){this.effectiveSource?.destroy(),this.source?.destroy()}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(t){"not-loaded"===this.loadStatus?this._set("source",t):o.Z.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(t){return t?Array.isArray(t)?new ee({elements:new r.Z(t)}):t instanceof r.Z?new ee({elements:t}):t:null}readSource(t,e,n){const i="image"===e.mediaType?new Rt:"video"===e.mediaType?new $t:null;return i?.read(e,n),i}writeSource(t,e,n,i){t&&ne(t)&&"image"===t.type?t.write(e,i):i?.messages&&i?.messages?.push(new s.Z("media-layer:unsupported-source","source must be an 'ImageElement'"))}};(0,i._)([(0,l.Cb)({readOnly:!0})],ie.prototype,"effectiveSource",void 0),(0,i._)([(0,l.Cb)({type:String})],ie.prototype,"copyright",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],ie.prototype,"fullExtent",null),(0,i._)([(0,l.Cb)({type:["MediaLayer"]})],ie.prototype,"operationalLayerType",void 0),(0,i._)([(0,l.Cb)({type:["show","hide"]})],ie.prototype,"listMode",void 0),(0,i._)([(0,l.Cb)({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1}}})],ie.prototype,"source",null),(0,i._)([(0,u.p)("source")],ie.prototype,"castSource",null),(0,i._)([(0,c.r)("source",["url"])],ie.prototype,"readSource",null),(0,i._)([(0,d.c)("source")],ie.prototype,"writeSource",null),(0,i._)([(0,l.Cb)()],ie.prototype,"spatialReference",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],ie.prototype,"type",void 0),ie=(0,i._)([(0,h.j)("esri.layers.MediaLayer")],ie);const re=ie},37549:(t,e,n)=>{n.d(e,{H:()=>a});var i=n(80442),r=n(24133),s=n(24470);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new r.Q(9,(0,i.Z)("esri-csp-restrictions")?t=>({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const t=new Array(this._idByBounds.size);let e=0;this._idByBounds.forEach(((n,i)=>{t[e++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(t)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((t=>this._idByBounds.has(t)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const t=(0,s.cS)();for(const e of this._boundsById.values())e&&(t[0]=Math.min(e[0],t[0]),t[1]=Math.min(e[1],t[1]),t[2]=Math.max(e[2],t[2]),t[3]=Math.max(e[3],t[3]));return t}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(t){const e=this._boundsById.get(t);this._boundsById.delete(t),e&&(this._idByBounds.delete(e),this._indexInvalid||this._index.remove(e))}forEachInBounds(t,e){this._loadIndex(),function(t,e,n){(function(t){o.minX=t[0],o.minY=t[1],o.maxX=t[2],o.maxY=t[3]})(e),t.search(o,n)}(this._index,t,(t=>e(this._idByBounds.get(t))))}get(t){return this._boundsById.get(t)}has(t){return this._boundsById.has(t)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(t,e){if(!this._indexInvalid){const e=this._boundsById.get(t);e&&(this._index.remove(e),this._idByBounds.delete(e))}this._boundsById.set(t,e),e&&(this._idByBounds.set(e,t),this._indexInvalid||(this._boundsToLoad.push(e),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},66094:(t,e,n)=>{n.d(e,{B:()=>r});var i=n(17452);function r(t){return s[function(t){return t instanceof Blob?t.type:function(t){const e=(0,i.Ml)(t);return l[e]||o}(t.url)}(t)]||a}const s={},o="text/plain",a=s[o],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const t in l)s[l[t]]=t}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3887],{42033:(e,t,r)=>{async function n(e,t){const{WhereClause:n}=await r.e(1534).then(r.bind(r,41534));return n.create(e,t)}function s(e,t){return null!=e?null!=t?`(${e}) AND (${t})`:e:t}r.d(t,{E:()=>n,_:()=>s})},34760:(e,t,r)=>{r.d(t,{Q:()=>x});var n=r(43697),s=r(92604),i=r(95330),o=r(5600),l=r(90578),a=(r(67676),r(80442),r(52011)),c=r(46791),p=(r(66643),r(20102),r(26258),r(87538));const u=new c.Z,h=new WeakMap;function d(e){f(e)&&u.push(e)}function b(e){f(e)&&u.includes(e)&&u.remove(e)}function f(e){return null!=e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function m(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:m(t,e%t):0}let w=0,v=0;function y(){const e=Date.now();for(const t of u)t.refreshInterval&&e-(h.get(t)??0)+5>=6e4*t.refreshInterval&&(h.set(t,e),t.refresh(e))}(0,p.EH)((()=>{const e=Date.now();let t=0;for(const r of u)t=m(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?h.get(r)||h.set(r,e):h.delete(r);if(t!==v){if(v=t,clearInterval(w),0===v)return void(w=0);w=setInterval(y,v)}}));const x=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,i.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{this.destroyed||d(this)}),(()=>{}))}destroy(){b(this)}castRefreshInterval(e){return e>=.1?e:e<=0?0:.1}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,i.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{s.Z.getLogger(this).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}get test(){const e=this;return{set refreshInterval(t){e._set("refreshInterval",t)}}}};return(0,n._)([(0,o.Cb)({type:Number,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,n._)([(0,l.p)("refreshInterval")],t.prototype,"castRefreshInterval",null),(0,n._)([(0,o.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,n._)([(0,o.Cb)()],t.prototype,"refreshParameters",null),t=(0,n._)([(0,a.j)("esri.layers.mixins.RefreshableLayer")],t),t}},54306:(e,t,r)=>{r.d(t,{Z:()=>L});var n,s=r(43697),i=r(9790),o=r(35454),l=r(96674),a=r(22974),c=r(62357),p=r(5600),u=(r(75215),r(71715)),h=r(52011),d=r(30556),b=(r(67676),r(80442),r(8813));let f=n=class extends l.wq{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,t){return t.value?(0,b.dI)(t.value):e}writeExpression(e,t,r){null!=this.value&&(e=(0,b.dI)(this.value)),null!=e&&(t[r]=e)}clone(){return new n({expression:this.expression,title:this.title,value:this.value})}};(0,s._)([(0,p.Cb)({type:String,json:{write:{writerEnsuresNonNull:!0}}})],f.prototype,"expression",void 0),(0,s._)([(0,u.r)("expression",["expression","value"])],f.prototype,"readExpression",null),(0,s._)([(0,d.c)("expression")],f.prototype,"writeExpression",null),(0,s._)([(0,p.Cb)({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],f.prototype,"title",void 0),(0,s._)([(0,p.Cb)({json:{read:!1,write:!1}})],f.prototype,"value",void 0),f=n=(0,s._)([(0,h.j)("esri.layers.support.LabelExpressionInfo")],f);const m=f;var w,v=r(84230),y=r(28412),x=r(21878);const g=new o.X({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function S(e,t,r){return{enabled:!(0,v.A2)(r?.layer)}}function C(e){return!e||"service"!==e.origin&&!("map-image"===e.layer?.type)}function E(e){return!!function(e){return"map-image"===e?.type}(e)&&!!e.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}let _=w=class extends l.wq{static evaluateWhere(e,t){const r=(e,t,r)=>{switch(t){case"=":return e==r;case"<>":return e!=r;case">":return e>r;case">=":return e>=r;case"<":return e<r;case"<=":return e<=r}return!1};try{if(null==e)return!0;const n=e.split(" ");if(3===n.length)return r(t[n[0]],n[1],n[2]);if(7===n.length){const e=r(t[n[0]],n[1],n[2]),s=n[3],i=r(t[n[4]],n[5],n[6]);switch(s){case"AND":return e&&i;case"OR":return e||i}}return!1}catch(t){console.log("Error.: can't parse = "+e)}}constructor(e){super(e),this.type="label",this.name=null,this.allowOverrun=!1,this.deconflictionStrategy="static",this.labelExpression=null,this.labelExpressionInfo=null,this.labelPlacement=null,this.labelPosition="curved",this.maxScale=0,this.minScale=0,this.repeatLabel=!0,this.repeatLabelDistance=null,this.symbol=y.Rz,this.useCodedValues=void 0,this.where=null}readLabelExpression(e,t){const r=t.labelExpressionInfo;if(!r||!r.value&&!r.expression)return e}writeLabelExpression(e,t,r){if(this.labelExpressionInfo)if(null!=this.labelExpressionInfo.value)e=(0,b.z7)(this.labelExpressionInfo.value);else if(null!=this.labelExpressionInfo.expression){const t=(0,b.el)(this.labelExpressionInfo.expression);t&&(e="["+t+"]")}null!=e&&(t[r]=e)}writeLabelExpressionInfo(e,t,r,n){if(null==e&&null!=this.labelExpression&&C(n))e=new m({expression:this.getLabelExpressionArcade()});else if(!e)return;const s=e.toJSON(n);s.expression&&(t[r]=s)}writeMaxScale(e,t){(e||this.minScale)&&(t.maxScale=e)}writeMinScale(e,t){(e||this.maxScale)&&(t.minScale=e)}getLabelExpression(){return(0,b.hV)(this)}getLabelExpressionArcade(){return(0,b.YI)(this)}getLabelExpressionSingleField(){return(0,b.UO)(this)}hash(){return JSON.stringify(this)}clone(){return new w({allowOverrun:this.allowOverrun,deconflictionStrategy:this.deconflictionStrategy,labelExpression:this.labelExpression,labelExpressionInfo:(0,a.d9)(this.labelExpressionInfo),labelPosition:this.labelPosition,labelPlacement:this.labelPlacement,maxScale:this.maxScale,minScale:this.minScale,name:this.name,repeatLabel:this.repeatLabel,repeatLabelDistance:this.repeatLabelDistance,symbol:(0,a.d9)(this.symbol),where:this.where,useCodedValues:this.useCodedValues})}};(0,s._)([(0,p.Cb)({type:String,json:{write:!0}})],_.prototype,"name",void 0),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1},"portal-item":{default:!1,write:{overridePolicy:S}}}}})],_.prototype,"allowOverrun",void 0),(0,s._)([(0,p.Cb)({type:String,json:{write:!0,default:"static",origins:{"web-scene":{write:!1},"portal-item":{default:"static",write:{overridePolicy:S}}}}})],_.prototype,"deconflictionStrategy",void 0),(0,s._)([(0,p.Cb)({type:String,json:{write:{overridePolicy(e,t,r){return this.labelExpressionInfo&&"service"===r?.origin&&E(r.layer)?{enabled:!1}:{allowNull:!0}}}}})],_.prototype,"labelExpression",void 0),(0,s._)([(0,u.r)("labelExpression")],_.prototype,"readLabelExpression",null),(0,s._)([(0,d.c)("labelExpression")],_.prototype,"writeLabelExpression",null),(0,s._)([(0,p.Cb)({type:m,json:{write:{overridePolicy:(e,t,r)=>function(e){return C(e)||E(e?.layer)}(r)?{allowNull:!0}:{enabled:!1}}}})],_.prototype,"labelExpressionInfo",void 0),(0,s._)([(0,d.c)("labelExpressionInfo")],_.prototype,"writeLabelExpressionInfo",null),(0,s._)([(0,p.Cb)({type:g.apiValues,json:{type:g.jsonValues,read:g.read,write:g.write}})],_.prototype,"labelPlacement",void 0),(0,s._)([(0,p.Cb)({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],_.prototype,"labelPosition",void 0),(0,s._)([(0,p.Cb)({type:Number})],_.prototype,"maxScale",void 0),(0,s._)([(0,d.c)("maxScale")],_.prototype,"writeMaxScale",null),(0,s._)([(0,p.Cb)({type:Number})],_.prototype,"minScale",void 0),(0,s._)([(0,d.c)("minScale")],_.prototype,"writeMinScale",null),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:S}}}}})],_.prototype,"repeatLabel",void 0),(0,s._)([(0,p.Cb)({type:Number,cast:c.t_,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:S}}}}})],_.prototype,"repeatLabelDistance",void 0),(0,s._)([(0,p.Cb)({types:i.yK,json:{origins:{"web-scene":{types:i.S6,write:x.vX,default:null}},write:x.vX,default:null}})],_.prototype,"symbol",void 0),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"useCodedValues",void 0),(0,s._)([(0,p.Cb)({type:String,json:{write:!0}})],_.prototype,"where",void 0),_=w=(0,s._)([(0,h.j)("esri.layers.support.LabelClass")],_);const L=_},8813:(e,t,r)=>{r.d(t,{UO:()=>m,YI:()=>f,dI:()=>w,el:()=>S,hV:()=>b,z7:()=>d});var n=r(19153);const s="__begin__",i="__end__",o=new RegExp(s,"ig"),l=new RegExp(i,"ig"),a=new RegExp("^"+s,"i"),c=new RegExp(i+"$","i"),p='"',u=p+" + ",h=" + "+p;function d(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function b(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=function(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}(e.labelExpression),t.type="conventional"),t}function f(e){const t=b(e);if(!t)return null;switch(t.type){case"conventional":return w(t.expression);case"arcade":return t.expression}return null}function m(e){const t=b(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(v);return t&&t[1].trim()||null}(t.expression);case"arcade":return S(t.expression)}return null}function w(e){let t;return e?(t=(0,n.gx)(e,(e=>s+'$feature["'+e+'"]'+i)),t=a.test(t)?t.replace(a,""):p+t,t=c.test(t)?t.replace(c,""):t+p,t=t.replaceAll(o,u).replaceAll(l,h)):t='""',t}const v=/^\s*\{([^}]+)\}\s*$/i,y=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,x=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,g=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function S(e){if(!e)return null;let t=y.exec(e)||x.exec(e);return t?t[1]||t[3]:(t=g.exec(e),t?t[2]:null)}},56545:(e,t,r)=>{r.d(t,{Z:()=>h});var n,s=r(43697),i=r(96674),o=r(22974),l=r(5600),a=r(75215),c=r(52011),p=r(30556);let u=n=class extends i.wq{constructor(e){super(e),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new n((0,o.d9)({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};(0,s._)([(0,l.Cb)({type:[String],json:{write:!0}})],u.prototype,"attachmentTypes",void 0),(0,s._)([(0,l.Cb)({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],u.prototype,"attachmentsWhere",void 0),(0,s._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],u.prototype,"cacheHint",void 0),(0,s._)([(0,l.Cb)({type:[String],json:{write:!0}})],u.prototype,"keywords",void 0),(0,s._)([(0,l.Cb)({type:[Number],json:{write:!0}})],u.prototype,"globalIds",void 0),(0,s._)([(0,l.Cb)({json:{write:!0}})],u.prototype,"name",void 0),(0,s._)([(0,l.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],u.prototype,"num",void 0),(0,s._)([(0,l.Cb)({type:[Number],json:{write:!0}})],u.prototype,"objectIds",void 0),(0,s._)([(0,l.Cb)({type:Boolean,json:{default:!1,write:!0}})],u.prototype,"returnMetadata",void 0),(0,s._)([(0,l.Cb)({type:[Number],json:{write:!0}})],u.prototype,"size",void 0),(0,s._)([(0,l.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],u.prototype,"start",void 0),(0,s._)([(0,p.c)("start"),(0,p.c)("num")],u.prototype,"writeStart",null),(0,s._)([(0,l.Cb)({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],u.prototype,"where",void 0),u=n=(0,s._)([(0,c.j)("esri.rest.support.AttachmentQuery")],u),u.from=(0,a.se)(u);const h=u},32163:(e,t,r)=>{r.d(t,{eZ:()=>c});var n=r(51773),s=r(35671),i=r(84649),o=(r(63801),r(48074),r(38745),r(9190)),l=(r(10214),r(71423),r(44951),r(422)),a=r(29986);function c({displayField:e,editFieldsInfo:t,fields:r,objectIdField:a,title:c},d){if(!r)return null;const f=function(e,t){const r=t?.visibleFieldNames;return function(e,t){const r=e;return t&&(e=e.filter((e=>!t.includes(e.type)))),e===r&&(e=e.slice()),e.sort(u),e}(e.fields??[],t?.ignoreFieldTypes||b).map((t=>new l.Z({fieldName:t.name,isEditable:(0,s.Hp)(t,e),label:t.alias,format:h(t),visible:p(t,{...e,visibleFieldNames:r})})))}({editFieldsInfo:t,fields:r,objectIdField:a},d);if(!f.length)return null;const m=function(e){const t=(0,s.O5)(e),{titleBase:r}=e;return t?`${r}: {${t.trim()}}`:r??""}({titleBase:c,fields:r,displayField:e}),w=[new o.Z,new i.Z];return new n.Z({title:m,content:w,fieldInfos:f})}const p=(e,t)=>t.visibleFieldNames?t.visibleFieldNames.has(e.name):(0,s.Fv)(e,t);function u(e,t){return"oid"===e.type?-1:"oid"===t.type?1:d(e)?-1:d(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function h(e){switch(e.type){case"small-integer":case"integer":case"single":return new a.Z({digitSeparator:!0,places:0});case"double":return new a.Z({digitSeparator:!0,places:2});case"date":return new a.Z({dateFormat:"long-month-day-year"});default:return"string"===e.type&&(0,s.Ec)(e.name)?new a.Z({digitSeparator:!0,places:0}):null}}function d(e){return"name"===(e.name&&e.name.toLowerCase())||"name"===(e.alias&&e.alias.toLowerCase())}const b=["geometry","blob","raster","guid","xml"]},28412:(e,t,r)=>{r.d(t,{CJ:()=>c,Rz:()=>u,xA:()=>a,z3:()=>p}),r(80442);var n=r(20256),s=r(4095),i=r(77987),o=r(78724),l=r(58333);const a=i.Z.fromJSON(l.I4),c=s.Z.fromJSON(l.ET),p=n.Z.fromJSON(l.lF),u=o.Z.fromJSON(l.qP);i.Z.fromJSON(l.eG),s.Z.fromJSON(l.wW),n.Z.fromJSON(l.lj)}}]);