@arcgis/core 5.2.0-next.154 → 5.2.0-next.155

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 (91) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/28b74bc77f7c13080074.js +1 -0
  3. package/assets/esri/core/workers/chunks/2a226b69d38c72a47a08.js +1 -0
  4. package/assets/esri/core/workers/chunks/{53e2f2b922116a45fe8f.js → 49ff0985fb307ac193ab.js} +1 -1
  5. package/assets/esri/core/workers/chunks/5f4feca26102088ea565.js +1 -0
  6. package/assets/esri/core/workers/chunks/{407f1e8176f3b0af73b4.js → 66867e523cc82f8fe35b.js} +1 -1
  7. package/assets/esri/core/workers/chunks/6c469b43089767176ced.js +1 -0
  8. package/assets/esri/core/workers/chunks/{693873b3eb99fba58fa9.js → 78c4e43cfa1eda06b4d9.js} +1 -1
  9. package/assets/esri/core/workers/chunks/81cad8d2f62a5f671c55.js +1 -0
  10. package/assets/esri/core/workers/chunks/{588e677f33df86a595bf.js → 820c8aaf3632edb0150c.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{5924ec3167a2941ebb1f.js → 88c74f3316f1fc253207.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a4162a8660bf763d542d.js → 967b4992b400517ee712.js} +1 -1
  13. package/assets/esri/core/workers/chunks/96b6ea199ad949fef17c.js +1 -0
  14. package/assets/esri/core/workers/chunks/{adf25e5ed99615b83c68.js → a62c12925303ff802c3d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/acdfd275dbf8533a67f3.js +1 -0
  16. package/assets/esri/core/workers/chunks/b3007aedbf731dacaff1.js +1 -0
  17. package/assets/esri/core/workers/chunks/c1254cd131a62750ff6f.js +1 -0
  18. package/assets/esri/core/workers/chunks/c19f238b55ff2893f7c2.js +1 -0
  19. package/assets/esri/core/workers/chunks/c72a904e01dc8c17d992.js +1 -0
  20. package/assets/esri/core/workers/chunks/de6081df29183bf80787.js +1 -0
  21. package/assets/esri/core/workers/chunks/e653c81ffb3d818645dd.js +1 -0
  22. package/assets/esri/core/workers/chunks/fda83bcb8e40e8044c24.js +1 -0
  23. package/assets/esri/libs/pdfjs/wasm/openjpeg_nowasm_fallback.js +1 -0
  24. package/assets/esri/widgets/support/uriUtils/t9n/messages.fr.json +1 -1
  25. package/config.js +1 -1
  26. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  27. package/geometry/support/curves/mathUtils.js +1 -1
  28. package/interfaces.d.ts +18 -9
  29. package/kernel.js +1 -1
  30. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  31. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  32. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  33. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  34. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  35. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  36. package/layers/support/fieldUtils.js +1 -1
  37. package/layers/support/vectorTileLayerLoader.js +1 -1
  38. package/package.json +2 -2
  39. package/portal/schemas/definitions.js +1 -1
  40. package/symbols/cim/cimAnalyzer.js +1 -1
  41. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  42. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSource.js +1 -1
  43. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +1 -1
  44. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +2 -0
  45. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  46. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  47. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
  48. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  49. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  50. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  51. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  52. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  53. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  54. package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
  55. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  56. package/views/draw/DrawTool.js +1 -1
  57. package/views/draw/support/PluginContext.js +1 -1
  58. package/views/draw/support/managers/TooltipManager.js +1 -1
  59. package/views/draw/support/types.d.ts +5 -2
  60. package/webdoc/applicationProperties/SearchLayerField.d.ts +7 -1
  61. package/webdoc/applicationProperties/SearchLayerField.js +1 -1
  62. package/webdoc/applicationProperties/SearchTableField.d.ts +7 -1
  63. package/webdoc/applicationProperties/SearchTableField.js +1 -1
  64. package/webdoc/applicationProperties/searchMode.js +2 -0
  65. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  66. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  67. package/widgets/BatchAttributeForm.js +1 -1
  68. package/widgets/Editor/EditorViewModel.d.ts +10 -1
  69. package/widgets/Editor.d.ts +10 -1
  70. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  71. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  72. package/widgets/Legend.d.ts +1 -0
  73. package/widgets/Search/LayerSearchSource.d.ts +23 -1
  74. package/widgets/Search/LayerSearchSource.js +1 -1
  75. package/widgets/Search/support/layerSearchUtils.js +1 -1
  76. package/widgets/Search/types.d.ts +7 -0
  77. package/widgets/support/forms/formUtils.js +1 -1
  78. package/widgets/support/forms/types.d.ts +1 -1
  79. package/assets/esri/core/workers/chunks/03afeefb9d16b6f1d844.js +0 -1
  80. package/assets/esri/core/workers/chunks/09b9a886363bc1197785.js +0 -1
  81. package/assets/esri/core/workers/chunks/4fc337240e7cddd0e988.js +0 -1
  82. package/assets/esri/core/workers/chunks/5732fdf6d8b87739aeea.js +0 -1
  83. package/assets/esri/core/workers/chunks/5fa1ec357c3ad1f91bc7.js +0 -1
  84. package/assets/esri/core/workers/chunks/7d1fd2df579a4b535e0e.js +0 -1
  85. package/assets/esri/core/workers/chunks/7e0cf70c0eb5a2ddfcec.js +0 -1
  86. package/assets/esri/core/workers/chunks/879b2de825c1dfc8849d.js +0 -1
  87. package/assets/esri/core/workers/chunks/917f53833b853898facc.js +0 -1
  88. package/assets/esri/core/workers/chunks/937824bc7948f7bc7845.js +0 -1
  89. package/assets/esri/core/workers/chunks/b132ffa7e8bb461b6786.js +0 -1
  90. package/assets/esri/core/workers/chunks/e01aeac34474540f61ee.js +0 -1
  91. package/assets/esri/core/workers/chunks/e15ba90af0faf873b42d.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[700,8768],{66344(e,t,i){i.d(t,{q:()=>n});const r=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class l{get size(){return this._size}constructor(e=10485760,t=.3){this._maxSize=e,this._maxClientSizeRatio=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._clients=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._clients.clear(),this._db.clear()}register(e){this._clients.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._clients.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}get _maxClientSize(){return this._maxSize*this._maxClientSizeRatio}getSize(e,t){return this._db.get(e.id+t)?.size??0}put(e,t,i,l,o){t=e.id+t;let n=this._db.get(t);if(n&&(this._size-=n.size,e.size-=n.size,this._db.delete(t),n.entry!==i&&this._notifyRemove(t,n.entry,n.size,0)),l>this._maxSize)return void this._notifyRemove(t,i,l,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!l||l<0)return r||console.warn(`Refusing to cache entry with size ${l} for key ${t}`),void this._notifyRemove(t,i,0,0);let a=1+Math.max(o,-4)- -3;this._db.set(t,new s(i,l,a)),this._size+=l,e.size+=l,this._checkSize()}updateSize(e,t){t=e.id+t;let i=this._db.get(t);if(!i)return;this._size-=i.size,e.size-=i.size;let r=i.entry.usedMemory;for(;r>this._maxSize;){let e=this._notifyRemove(t,i.entry,r,1);if(!(null!=e&&e>0))return void this._db.delete(t);r=e}i.size=r,this._size+=r,e.size+=r,this._checkSize()}pop(e,t){t=e.id+t;let i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;let i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){let i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){let 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={},i=[];this._db.forEach((e,r)=>{let l=e.lifetime;i[l]=(i[l]||0)+e.size,this._clients.forEach(i=>{let{id:l,name:s}=i;if(r.startsWith(l)){let i=t[s]||0;t[s]=i+e.size}})});let r={};this._clients.forEach(e=>{let i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){let l=t[i]||0;t[i]=l,r[i]=Math.round(100*e.hitRate)+"%"}else r[i]="0%"});let l=Object.keys(t);l.sort((e,i)=>t[i]-t[e]),l.forEach(i=>e[i]=Math.round(t[i]/2**20)+"MB / "+r[i]);for(let t=i.length-1;t>=0;--t){let r=i[t];r&&(e["Priority "+(t+-3-1)]=Math.round(r/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._clients.forEach(e=>e.resetHitRate())}clear(e){let t=e.id;this._db.forEach((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._clients.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(let[t,i]of this._db)t.startsWith(e.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,r){let l=this._clients.get(e.split(o)[0])?.removeFunc,s=l?.(t,r,i);return"number"==typeof s?s:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._clients.forEach(e=>this._checkSizeLimits(this._maxClientSize,e)),this._checkSizeLimits(this.maxSize)}setMaxClientSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){let i=t??this;if(i.size<=e)return;let r=t?.id,l=!0;for(;l;){l=!1;for(let[s,n]of this._db)if(0===n.lifetime&&(!r||s.startsWith(r))){let r=t??this._clients.get(s.split(o)[0]);if(this._purgeItem(s,n,r),i.size<=.9*e)return;l||=this._db.has(s)}}for(let[l,s]of this._db)if(!r||l.startsWith(r)){let r=t??this._clients.get(l.split(o)[0]);if(this._purgeItem(l,s,r),i.size<=.9*e)return}}_purgeItem(e,t,i){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);let r=this._notifyRemove(e,t.entry,t.size,1);null!=r&&r>0&&(this._size+=r,i&&(i.size+=r),t.lives=t.lifetime,t.size=r,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new l(0);class s{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}const o=":";class n{constructor(e,t){this.removeFunc=t,this.id="",this.name="",this.size=0,this._storage=new l(e,1),this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,i=1){this._storage.put(this,e,t,i,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(){}}},60999(e,t,i){i.d(t,{DZ:()=>f,Ke:()=>d,QA:()=>y,Tj:()=>u,UT:()=>m,aD:()=>v,jJ:()=>h});var r=i(32198),l=i(69622),s=i(97768),o=i(17676),n=i(10107),a=i(64108);function h(e,t,i){return(0,o.Lx)(e.map((e,r)=>t.apply(i,[e,r])))}async function u(e,t,i){return(await(0,o.Lx)(e.map((e,r)=>t.apply(i,[e,r])))).map(e=>e.value)}function c(e){return{ok:!0,value:e}}function p(e){return{ok:!1,error:e}}async function d(e){if(null==e)return{ok:!1,error:Error("no promise provided")};try{return c(await e)}catch(e){return p(e)}}async function f(e){try{return c(await e)}catch(e){return(0,o.QP)(e),p(e)}}function y(e){if(!0===e.ok)return e.value;throw e.error}function m(e,t){return new g(e,t)}let g=class extends l.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,s.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;let{signal:i}=this._abortController;this.promise=e(i),this.promise.then(e=>{this._result=c(e),this._cleanup()},e=>{this._result=p(e),this._cleanup()}),this._abortHandle=(0,o.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,s.xt)(this._abortHandle),this._abortController=null}};(0,r.Cg)([(0,n.MZ)()],g.prototype,"value",null),(0,r.Cg)([(0,n.MZ)()],g.prototype,"error",null),(0,r.Cg)([(0,n.MZ)()],g.prototype,"finished",null),(0,r.Cg)([(0,n.MZ)()],g.prototype,"promise",void 0),(0,r.Cg)([(0,n.MZ)()],g.prototype,"_result",void 0),g=(0,r.Cg)([(0,a.$)("esri.core.asyncUtils.ReactiveTask")],g);class v{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});let t=await e;return{[Symbol.dispose]:t}}async run(e){let t={stack:[],error:void 0,hasError:!1};try{return(0,r.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,r.hk)(t)}}}},90629(e,t,i){i.d(t,{Lz:()=>l,PN:()=>s,cr:()=>o,gs:()=>a,r_:()=>h,tc:()=>n}),i(39829);const r=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i;function l(e){return e?e/72*96:0}function s(e){return e?72*e/96:0}function o(e){if("string"==typeof e){let t=e.match(r);if(t){let i=Number(t[1]),r=t[3]&&t[3].toLowerCase(),l=e.startsWith("-"),o="px"===r?s(i):i;return l?-o:o}return console.warn("screenUtils.toPt: input not recognized!"),null}return e}function n(e=0,t=0){return{x:e,y:t}}function a(e=0,t=0){return[e,t]}function h(e=0,t=0,i=0){return[e,t,i]}},83027(e,t,i){const r=i(29953).ho;i.d(t,["h",0,r])},67190(e,t,i){i.r(t),i.d(t,{default:()=>Se});var r=i(32198),l=i(56507),s=i(60999),o=i(4718),n=i(25728),a=i(17676),h=i(84952),u=i(91429),c=i(5443),p=i(16930),d=i(4146),f=i(52136),y=i(89186),m=i(18768),g=i(63074),v=i(69208),w=i(34287),_=i(8303),A=i(54310),S=i(25036),x=i(10873);let b=null;function C(e){if(b)return b;let t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return b=new Promise(i=>{let r=new Image;r.onload=()=>{r.onload=r.onerror=null,i(r.width>0&&r.height>0)},r.onerror=()=>{r.onload=r.onerror=null,i(!1)},r.src="data:image/webp;base64,"+t[e]}),b}var M=i(49186),I=i(53966),z=i(34275);class R{constructor(e,t){this._spriteSource=e,this._maxTextureSize=t,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded","url"===e.type&&e.spriteFormat&&(this._spriteImageFormat=e.spriteFormat),e.pixelRatio&&(this.devicePixelRatio=e.pixelRatio),this.baseURL=e.spriteUrl}get spriteNames(){let e=[];for(let t in this._spritesData)e.push(t);return e.sort(),e}getSpriteInfo(e){return this._spritesData?this._spritesData[e]:null}async load(e){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(e),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(e){this._isRetina=this.devicePixelRatio>1.15;let{width:t,height:i,data:r,json:l}=await this._getSpriteData(this._spriteSource,e),s=Object.keys(l);if(!s||0===s.length||!r)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=l,this.width=t,this.height=i;let o,n=Math.max(this._maxTextureSize,4096);if(t>n||i>n){let e=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${n} pixels}`;throw I.A.getLogger("esri.layers.support.SpriteSource").error(e),new M.A("SpriteSource",e)}for(let e=0;e<r.length;e+=4)o=r[e+3]/255,r[e]=r[e]*o,r[e+1]=r[e+1]*o,r[e+2]=r[e+2]*o;this.image=r}async _getSpriteData(e,t){if("image"===e.type){let t,i;if(this.devicePixelRatio<1.15){if(!e.spriteSource1x)throw new M.A("SpriteSource","no image data provided for low resolution sprites!");t=e.spriteSource1x.image,i=e.spriteSource1x.json}else{if(!e.spriteSource2x)throw new M.A("SpriteSource","no image data provided for high resolution sprites!");t=e.spriteSource2x.image,i=e.spriteSource2x.json}return"width"in t&&"height"in t&&"data"in t&&((0,z.mw)(t.data)||(0,z.UR)(t.data))?{width:t.width,height:t.height,data:new Uint8Array(t.data),json:i}:{...T(t),json:i}}let i=(0,h.An)(this.baseURL),r=i.query?"?"+(0,h.x0)(i.query):"",s=this._isRetina?"@2x":"",o=`${i.path}${s}.${this._spriteImageFormat}${r}`,n=`${i.path}${s}.json${r}`,[a,u]=await Promise.all([(0,l.A)(n,t),(0,l.A)(o,{responseType:"image",...t})]);return{...T(u.data),json:a.data}}}function T(e){let t=document.createElement("canvas"),i=t.getContext("2d");t.width=e.width,t.height=e.height,i.drawImage(e,0,0,e.width,e.height);let r=i.getImageData(0,0,e.width,e.height);return{width:e.width,height:e.height,data:new Uint8Array(r.data)}}var L=i(87045),P=i(25943),O=i(21325),E=i(28735),U=i(91806),D=i(83027);class F{constructor(e,t,i){this.tileServers=[],this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=e,this.sourceUrl=t;let r=(0,o.o8)(i),l=i.capabilities&&i.capabilities.split(",").map(e=>e.toLowerCase().trim()),s=!0===i?.exportTilesAllowed,n=!0===l?.includes("tilemap"),a=s&&i.hasOwnProperty("maxExportTilesCount")?i.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:s,supportsTileMap:n},exportTiles:s?{maxExportTilesCount:+a}:null},this.tileInfo=L.A.fromJSON(r.tileInfo),this.fullExtent=c.A.fromJSON(i.fullExtent),this.initialExtent=c.A.fromJSON(i.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(e,t){return this.tilemap?this.tilemap.dataKey(e,t):e}isCompatibleWith(e){let t=this.tileInfo,i=e.tileInfo;if(!t.spatialReference.equals(i.spatialReference)||!t.origin.equals(i.origin)||Math.round(t.dpi)!==Math.round(i.dpi))return!1;let r=t.lods,l=i.lods,s=Math.min(r.length,l.length);for(let e=0;e<s;e++){let t=r[e],i=l[e];if(t.level!==i.level||Math.round(t.scale)!==Math.round(i.scale))return!1}return!0}}var j=i(44159);class $ extends F{static async create(e,t,i,r,l){if(!0===r.cluster)throw Error("Clustered GeoJSON vector tile sources are not supported.");if(null==r.data)throw Error(`GeoJSON source '${e}' must define a data property.`);let s,o=r.maxzoom??18,n=await(0,D.h)("GeoJSONVectorTileSourceWorker",{signal:l?.signal,strategy:"dedicated"});try{s=await n.invoke("initialize",{definition:r,name:e,requestOptions:B(l)},{signal:l?.signal}),(0,a.Te)(l)}catch(e){throw n.close(),e}return new $(e,t,i,n,r.minzoom??0,o,s.geometryTypes)}constructor(e,t,i,r,l,s,o){super(e,t,i),this._connection=r,this._minZoom=l,this._maxZoom=s,this.geometryTypes=o,this.type="geojson"}destroy(){super.destroy(),this._connection?.close(),this._connection=null}async getRefKey(e,t){if((0,a.Te)(t),e.level<this._minZoom)return null;if(e.level<=this._maxZoom)return e;let i=e.level-this._maxZoom;return new j.A(this._maxZoom,e.row>>i,e.col>>i,e.world)}requestTile(e,t,i,r,l=this.tileInfo){return(0,a.Te)(r),this._connection?this._connection.invoke("requestTile",{col:i,row:t,origin:{x:l.origin.x,y:l.origin.y},tileSpan:l.size[0]*l.lodAt(e).resolution,spatialReference:l.spatialReference.toJSON()},r):Promise.reject((0,a.NK)())}}function B(e){if(!e)return{};let{signal:t,...i}=e;return i}var k=i(83960);i(57451).A;class N{constructor(e){this.url=e}destroy(){this._tileIndexPromise=null}async fetchTileIndex(){return this._tileIndexPromise||=(0,l.A)(this.url).then(e=>e.data.index),this._tileIndexPromise}async dataKey(e,t){let i=await this.fetchTileIndex();return(0,a.Te)(t),this._getIndexedDataKey(i,e)}_getIndexedDataKey(e,t){let i=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let r=t;for(;0!==r.level;)r=new j.A(r.level-1,r.row>>1,r.col>>1,r.world),i.push(r);let l,s,o=e,n=i.pop();if(1===o)return n;for(;i.length;)if(l=i.pop(),s=(1&l.col)+((1&l.row)<<1),o){if(0===o[s]){n=null;break}if(1===o[s]){n=l;break}n=l,o=o[s]}return n}}var Z=i(97768);class G{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=(0,Z.pR)(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||=(0,l.A)(this._tileIndexUrl,{query:{...e?.query}}).then(e=>e.data.index),this._tileIndexPromise}dataKey(e,t){let{level:i,row:r,col:l}=e,s=new j.A(e);return this._tilemap.fetchAvailabilityUpsample(i,r,l,s,t).then(()=>(s.world=e.world,s)).catch(e=>{if((0,a.zf)(e))throw e;return null})}}var K=i(91869);class q{constructor(e){this._tileUrl=e,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(e){(null==this._promise||(0,a.G4)(this._abortController?.signal))&&(this._promise=this._makeRequest(this._tileUrl));let t=this._abortOptions;return t.push(e),(0,a.u7)(e,()=>{t.every(e=>(0,a.G4)(e))&&this._abortController.abort()}),this._promise.then(e=>(0,o.o8)(e))}async _makeRequest(e){this._abortController=new AbortController;let{data:t}=await(0,l.A)(e,{responseType:"array-buffer",signal:this._abortController.signal});return t}}const W=new Map;class V extends F{constructor(e,t,i){super(e,t,i);let r=(0,h.An)(this.sourceUrl),l=(0,o.o8)(i),s=l.tiles;if(r)for(let e=0;e<s.length;e++){let t=(0,h.An)(s[e]);t&&((0,h.oP)(t.path)||(t.path=(0,h.fj)(r.path,t.path)),s[e]=(0,h.a6)(t.path,{...r.query,...t.query}))}this.tileServers=s;let n=i.tileMap&&r?(0,h.a6)((0,h.fj)(r.path,i.tileMap),r.query??{}):null;this.capabilities.operations.supportsTileMap?(this.type="vector-tile",this.tilemap=new G(new P.d({layer:{parsedUrl:r,tileInfo:this.tileInfo},minLOD:l.minLOD??this.tileInfo.lods[0].level,maxLOD:l.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),n)):n&&(this.tilemap=new N(n))}requestTile(e,t,i,r){return function(e,t,i,r,l){let s=(0,h.An)(e),o=s.query;if(o)for(let[e,l]of Object.entries(o))switch(l){case"{x}":o[e]=r.toString();break;case"{y}":o[e]=i.toString();break;case"{z}":o[e]=t.toString()}let n=s.path;return function(e,t){return(0,K.tE)(W,e,()=>new q(e)).getData(t).finally(()=>W.delete(e))}((0,h.a6)(n.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,i.toString()).replaceAll(/\{x\}/gi,r.toString()),{...s.query}),l)}(this.tileServers[t%this.tileServers.length],e,t,i,r)}}function H(...e){let t;for(let i of e)null!=i&&((0,h.BQ)(i)?t&&=t.split("://")[0]+":"+i.trim():t=(0,h.oP)(i)?i:(0,h.fj)(t,i));return t?(0,h.UC)(t):void 0}async function J(e,t,i,r,s){let o,n,u;if((0,a.Te)(s),"string"==typeof i){let e=(0,h.S8)(i);u=await(0,l.A)(e,{...s,responseType:"json",query:{f:"json",...s?.query}}),u.ssl&&(o&&=o.replace(/^http:/i,"https:"),n&&=n.replace(/^http:/i,"https:")),o=e,n=e}else null!=i&&(u={data:i},o=i.jsonUrl||null,n=r);let c=u?.data;switch(c?.type){case"Feature":case"FeatureCollection":return e.sourceUrl=o||null,X(e,function(e){return{version:8,sprite:"",glyphs:"",sources:{geojson:{type:"geojson",data:e}},layers:[]}}(c),n,s)}if(Y(c))return e.styleUrl=o||null,X(e,c,n,s);if(function(e){return!!e&&!Y(e)}(c))return e.primarySourceName?ie(e,c,n,!1,t,s):(e.sourceUrl=o||null,Q(c)&&null==e.style&&(t="tilejson"),ie(e,c,n,!0,t,s));throw Error("You must specify the URL or the JSON for a service or for a style.")}function Q(e){return"object"==typeof e&&!!e&&"tilejson"in e&&null!=e.tilejson}function Y(e){return!!e&&"sources"in e&&!!e.sources}async function X(e,t,i,r){let l=i?(0,h.nM)(i):(0,h.gd)(),s=null==t.layers||0===t.layers.length,o=s?{...t,layers:[]}:t;e.styleBase=l,e.style=o,"webp"===o["sprite-format"]?.toLowerCase()&&(e.spriteFormat="webp");let n=[];if(o.sources&&o.sources.esri&&"geojson"!==o.sources.esri.type){let t=o.sources.esri;t.url?await J(e,"esri",H(l,t.url),void 0,r):n.push(J(e,"esri",t,l,r))}for(let t of Object.keys(o.sources))"esri"!==t&&"tilejson"!==t&&"vector"===o.sources[t].type&&(o.sources[t].url?n.push(J(e,t,H(l,o.sources[t].url),void 0,r)):o.sources[t].tiles&&n.push(J(e,t,o.sources[t],l,r)));await Promise.all(n);for(let t of Object.keys(o.sources)){let i=o.sources[t];if("geojson"===i.type){let n=await ee(e,t,i,l,r);s&&o.layers.push(...te(t,n.geometryTypes))}}}async function ee(e,t,i,r,l){if(null==i.data)throw Error(`GeoJSON source '${t}' must define a data property.`);let s={...i,type:"geojson",data:"string"==typeof i.data?H(r,i.data):i.data},o=e.sourceNameToSource[e.primarySourceName],n=o?.tileInfo?.spatialReference,a=n?.isWGS84||n?.isWebMercator?o.tileInfo.clone():function(e,t=22){let i=(0,O.Vp)(e),r=e.isWGS84?360/512:78271.51696400007,l=e.isWGS84?(0,k.gB)(r,e):295828763.7957775;return L.A.fromJSON({rows:512,cols:512,dpi:96,format:"pbf",origin:{x:i.origin[0],y:i.origin[1]},spatialReference:e.toJSON(),lods:Array.from({length:t+1},(e,t)=>({level:t,resolution:r/2**t,scale:l/2**t}))})}(p.A.WGS84,s.maxzoom),h=s.maxzoom??22;for(let e=a.lods[a.lods.length-1];e.level<h;)e=new U.A({level:e.level+1,resolution:e.resolution/2,scale:e.scale/2}),a.lods.push(e);let u=a.spatialReference.isWebMercator?{xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:a.spatialReference.toJSON()}:{xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}},c={capabilities:"TilesOnly",tileInfo:a.toJSON(),fullExtent:u,initialExtent:u,minScale:0,maxScale:0},d=await $.create(t,r,c,s,l);return re(e,t,i,c,d,!e.primarySourceName,r),d}function te(e,t){return t.map(t=>{switch(t){case"polygon":return{id:`${e}_polygon`,type:"fill",source:e,filter:["==","$type","Polygon"],paint:{"fill-color":"#808080"}};case"line":return{id:`${e}_line`,type:"line",source:e,filter:["==","$type","LineString"],paint:{"line-color":"#808080","line-width":1}};case"point":return{id:`${e}_point`,type:"circle",source:e,filter:["==","$type","Point"],paint:{"circle-color":"#808080","circle-radius":3}}}})}async function ie(e,t,i,r,l,s){let n=i?(0,h.UC)(i)+"/":(0,h.gd)(),a=function(e,t){if(function(e){return e.hasOwnProperty("tileInfo")}(e)){let t=e?.tileInfo;return null!=t&&(t.rows??=512,t.cols??=512),e}let i,r={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100,latestWkid:3857}},l=null;if(Q(e)){let{bounds:r,vector_layers:s}=e;if(r){let e=(0,E.Gh)({x:r[0],y:r[1],spatialReference:(0,o.o8)(O.KK)}),t=(0,E.Gh)({x:r[2],y:r[3],spatialReference:(0,o.o8)(O.KK)});l={xmin:e.x,ymin:e.y,xmax:t.x,ymax:t.y,spatialReference:(0,o.o8)(O.ch)}}if(s&&s.length>0)i={version:8,sprite:"",glyphs:"",sources:{tilejson:{type:"vector",url:e.tilejson}},layers:le(s)};else if(null==t.style)throw Error("The TileJSON source does not contain any vector_layers. This VectorTileLayer cannot be loaded.")}null===l&&(l=r);let s=78271.51696400007,n=295828763.7957775,a=[],h=e.hasOwnProperty("maxzoom")&&null!=e.maxzoom?Math.abs(+e.maxzoom):22;for(let e=0;e<=h;e++)a.push({level:e,scale:n,resolution:s}),s/=2,n/=2;return{capabilities:"TilesOnly",initialExtent:l,fullExtent:r,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:512,cols:512,dpi:96,format:"pbf",origin:{x:-20037508.342787,y:20037508.342787},lods:a,spatialReference:(0,o.o8)(O.ch)},defaultStyles:i}}(t,e);if(re(e,l,t,a,new V(l,(0,h.a6)(n,s?.query??{}),a),r,n),!Q(e)&&"defaultStyles"in t&&!e.style){if(null==t.defaultStyles)throw Error();return"string"==typeof t.defaultStyles?J(e,"",H(n,t.defaultStyles,"root.json"),void 0,s):J(e,"",t.defaultStyles,H(n,"root.json"),s)}if(Q(t)&&null==e.style&&a.defaultStyles)return J(e,"",a.defaultStyles,H(n,"root.json"),s)}function re(e,t,i,r,l,s,o){if(!s&&e.primarySourceName in e.sourceNameToSource){let i=e.sourceNameToSource[e.primarySourceName];if(!i.isCompatibleWith(l))return I.A.getLogger("esri.layers.support.vectorTileLayerLoader").warn(`Ignoring source '${t}' because its tiling scheme is incompatible with the primary source '${e.primarySourceName}'.`),void l.destroy();null!=l.fullExtent&&(null==i.fullExtent?i.fullExtent=l.fullExtent.clone():i.fullExtent.union(l.fullExtent)),i.tileInfo&&l.tileInfo&&i.tileInfo.lods.length<l.tileInfo.lods.length&&(i.tileInfo=l.tileInfo)}s&&(e.sourceBase=o,e.source=i,e.validatedSource=r,e.primarySourceName=t),e.sourceNameToSource[t]=l}function le(e){let t=[];for(let i of e)i.geometry_type?t.push(se(i.geometry_type.toLowerCase(),i,!1)):(t.push(se("polygon",i,!0)),t.push(se("line",i,!0)),t.push(se("circle",i,!0)));return t}function se(e,t,i){let{id:r,minzoom:l,maxzoom:s}=t,o={type:"polygon"===e||"polygons"===e?"fill":"line"===e||"lines"===e?"line":"circle",id:r,source:"tilejson","source-layer":r,minzoom:l,maxzoom:s};switch(e){case"fill":i&&(o.id+="_polygon",o.filter='(["==", "$type", "Polygon"])'),o.paint={"fill-color":"#808080"};break;case"line":i&&(o.id+="_line",o.filter='(["==", "$type", "LineString"])');break;case"circle":i&&(o.id+="_point",o.filter='(["==", "$type", "Point"])')}return o}var oe=i(88788),ne=i(39131),ae=i(97159),he=i(86738);const ue=1e-6;function ce(e,t){if(e===t)return!0;if(null==e&&null!=t||null!=e&&null==t||null==e||null==t||!e.spatialReference.equals(t.spatialReference)||e.dpi!==t.dpi)return!1;let i,r,l=e.origin,s=t.origin;if(Math.abs(l.x-s.x)>=ue||Math.abs(l.y-s.y)>=ue)return!1;e.lods[0].scale>t.lods[0].scale?(i=e,r=t):(r=e,i=t);for(let e=i.lods[0].scale;e>=r.lods[r.lods.length-1].scale-ue;e/=2)if(Math.abs(e-r.lods[0].scale)<ue)return!0;return!1}function pe(e,t){if(e===t)return e;if(null==e&&null!=t)return t;if(null!=e&&null==t)return e;if(null==e||null==t)return null;let i=e.size[0],r=e.format,l=e.dpi,s=new he.A({x:e.origin.x,y:e.origin.y}),o=e.spatialReference,n=e.lods[0].scale>t.lods[0].scale?e.lods[0]:t.lods[0],a=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],h=n.scale,u=n.resolution,c=a.scale,p=[],d=h,f=u,y=0;for(;d>=c;)p.push(new U.A({level:y,resolution:f,scale:d})),y++,d/=2,f/=2;return new L.A({size:[i,i],dpi:l,format:r||"pbf",origin:s,lods:p,spatialReference:o})}var de=i(45013);class fe{constructor(e){this.getUnmaskedRenderer=e}}let ye;function me(){return ye??=function(){let e=new ge,t=function(e){if(typeof WebGL2RenderingContext>"u")return null;let t=document.createElement("canvas");if(!t)return null;let i=t.getContext("webgl2",{failIfMajorPerformanceCaveat:!0});if(i??(i=t.getContext("webgl2"),null!=i&&(e.majorPerformanceCaveat=!0,e.unmaskedRenderer=function(e){let t=e.getExtension("WEBGL_debug_renderer_info");return t?new fe(()=>e.getParameter(t.UNMASKED_RENDERER_WEBGL)):null}(i)?.getUnmaskedRenderer()??"unknown")),null==i)return i;e.available=!0,e.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;let r=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);return r&&(e.supportsHighPrecisionFragment=r.precision>0),i}(e);return null==t||(e.supportsColorBufferFloat=null!==t.getExtension("EXT_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==t.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||null!==t.getExtension("EXT_color_buffer_half_float")),e}(),ye}class ge{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1,this.unmaskedRenderer="unloaded"}}var ve=i(59923),we=i(43937),_e=i(36005);let Ae=class extends((0,g.dM)((0,S.j)((0,A.J)((0,y.f)((0,m.b)((0,w.q)((0,_.A)((0,v.d)((0,f.p)((0,n.M)(d.A))))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.graphicOrigin=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(let e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){let t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(a.QP).then(async()=>{if(!this.portalItem?.id)return;let t=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await(0,l.A)(t,{...e,query:{f:"json",...this.customParameters,token:this.apiKey},authMode:this.portalItem.portal.authMode})).data&&this.read({url:t},(0,oe.v)(this.portalItem,"portal-item"))}).catch(a.QP).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get apiKey(){return super.apiKey}set apiKey(e){super.apiKey=e}get portalItem(){return super.portalItem}set portalItem(e){super.portalItem=e}get attributionDataUrl(){let e=this.currentStyleInfo,t=e?.serviceUrl&&(0,h.An)(e.serviceUrl);if(!t)return null;let i=this._getDefaultAttribution(t.path);return i?(0,h.a6)(i,{...this.customParameters,token:this.apiKey}):null}get capabilities(){let e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?(0,h.An)(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&(0,h.BQ)(e)&&(e=`https:${e}`);let i=(0,ne.py)(e);t.styleUrl=(0,ae.e)(e,i)}get tileInfo(){let e=[];for(let t in this.sourceNameToSource)e.push(this.sourceNameToSource[t]);let t=this.primarySource?.tileInfo||new L.A;if(e.length>1)for(let i=0;i<e.length;i++)ce(t,e[i].tileInfo)&&(t=pe(t,e[i].tileInfo));return t}readTilemapCache(e,t){return t.capabilities?.includes("Tilemap")?new P.d({layer:this}):null}set url(e){if(!e)return void this._set("url",e);let t=(0,h.An)(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){let i=me().maxTextureSize,r=this.currentStyleInfo?.spriteUrl?(0,h.a6)(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,l=new R({type:"url",spriteUrl:r,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},i);await l.load(t),this._spriteSourceMap.set(e,l)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;let i=me().maxTextureSize,r=e.spriteUrl,l=r?(0,h.a6)(r,{...this.customParameters,token:this.apiKey}):null;if(!l&&"url"===e.type)return null;let s=new R(e,i);try{await s.load(t);let i=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(i,s),l&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=l),this.emit("spriteSource-change",{spriteSource:s}),s}catch(e){(0,a.QP)(e)}return null}async loadStyle(e,t){let i=e||this.style||this.url;return this._loadingTask&&"string"==typeof i&&this.url===i||(this._loadingTask?.abort(),this._loadingTask=(0,s.UT)(e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(i,{signal:e})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return(0,o.o8)(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){let i=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);let r=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:i||r})}getStyleLayer(e){return(0,o.o8)(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return(0,o.o8)(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)?"visible":"none"}write(e,t){return t?.origin&&!this.styleUrl?((0,ve.U4)(t,this,"style defined by JSON only are not supported"),null):super.write(e,t)}getTileUrl(e,t,i){return null}async _getSourceAndStyle(e,t){if(!e)throw Error("invalid style!");let i=await async function(e,t){let i={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:"",spriteFormat:"png"},[r,l]="string"==typeof e?[e,null]:[null,e.jsonUrl];return await J(i,"esri",e,l,t),{layerDefinition:i.validatedSource,url:r,serviceUrl:i.sourceUrl,style:i.style,styleUrl:i.styleUrl,spriteUrl:i.style&&i.style.sprite&&H(i.styleBase,i.style.sprite),spriteFormat:i.spriteFormat,glyphsUrl:i.style&&i.style.glyphs&&H(i.styleBase,i.style.glyphs),sourceNameToSource:i.sourceNameToSource,primarySourceName:i.primarySourceName}}(e,{...t,query:{...this.customParameters,token:this.apiKey}});"webp"===i.spriteFormat&&(await C("lossy")||(i.spriteFormat="png")),this._set("currentStyleInfo",{...i}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",i.sourceNameToSource),this._set("primarySource",i.sourceNameToSource[i.primarySourceName]),this._set("styleRepository",new de.A(i.style,!1)),this.read(i.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){let t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),i=["OpenBasemap_v2","OpenBasemap_GCS_v2","OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2","World_Hillshade_v2"];if(!t)return;let r=t[2]&&t[2].toLowerCase();if(!r)return;let l=t[1]||"";for(let e of i)if(e.toLowerCase().includes(r))return(0,h.S8)(`//static.arcgis.com/attribution/Vector${l}/${e}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};(0,r.Cg)([(0,u.MZ)({readOnly:!0})],Ae.prototype,"attributionDataUrl",null),(0,r.Cg)([(0,u.MZ)({type:["show","hide"]})],Ae.prototype,"listMode",void 0),(0,r.Cg)([(0,u.MZ)({json:{read:!0,write:!0}})],Ae.prototype,"blendMode",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1}})],Ae.prototype,"capabilities",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],Ae.prototype,"currentStyleInfo",void 0),(0,r.Cg)([(0,u.MZ)({json:{read:!1},readOnly:!0,type:c.A})],Ae.prototype,"fullExtent",null),(0,r.Cg)([(0,u.MZ)({json:{read:!1},readOnly:!0,type:c.A})],Ae.prototype,"initialExtent",null),(0,r.Cg)([(0,u.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Ae.prototype,"isReference",void 0),(0,r.Cg)([(0,u.MZ)({type:["VectorTileLayer"]})],Ae.prototype,"operationalLayerType",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],Ae.prototype,"parsedUrl",null),(0,r.Cg)([(0,u.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Ae.prototype,"path",void 0),(0,r.Cg)([(0,u.MZ)({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],Ae.prototype,"refreshInterval",void 0),(0,r.Cg)([(0,u.MZ)()],Ae.prototype,"style",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],Ae.prototype,"serviceUrl",null),(0,r.Cg)([(0,u.MZ)({type:p.A,readOnly:!0})],Ae.prototype,"spatialReference",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],Ae.prototype,"styleRepository",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],Ae.prototype,"sourceNameToSource",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],Ae.prototype,"primarySource",void 0),(0,r.Cg)([(0,u.MZ)({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],Ae.prototype,"styleUrl",null),(0,r.Cg)([(0,we.K)(["portal-item","web-document"],"styleUrl")],Ae.prototype,"writeStyleUrl",null),(0,r.Cg)([(0,u.MZ)({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:L.A})],Ae.prototype,"tileInfo",null),(0,r.Cg)([(0,u.MZ)()],Ae.prototype,"tilemapCache",void 0),(0,r.Cg)([(0,_e.w)("service","tilemapCache",["capabilities","tileInfo"])],Ae.prototype,"readTilemapCache",null),(0,r.Cg)([(0,u.MZ)({json:{read:!1},readOnly:!0,value:"vector-tile"})],Ae.prototype,"type",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0,clonable:!1})],Ae.prototype,"graphicOrigin",void 0),(0,r.Cg)([(0,u.MZ)({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}}),(0,u.MZ)(x.OZ)],Ae.prototype,"url",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],Ae.prototype,"version",void 0),(0,r.Cg)([(0,_e.w)("version",["version","currentVersion"])],Ae.prototype,"readVersion",null),Ae=(0,r.Cg)([(0,u.$K)("esri.layers.VectorTileLayer")],Ae);const Se=Ae},52136(e,t,i){var r=i(32198),l=i(91429);i.d(t,["p",0,e=>{let t=e,i=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null==e?(this._clearOverride("apiKey"),this.clear("apiKey","user")):this._override("apiKey",e)}};return(0,r.Cg)([(0,l.MZ)({type:String})],i.prototype,"apiKey",null),i=(0,r.Cg)([(0,l.$K)("esri.layers.mixins.APIKeyMixin")],i),i}])},89186(e,t,i){var r=i(32198),l=i(91429),s=i(16930),o=i(87045),n=i(65509),a=i(25943),h=i(36005);i.d(t,["f",0,e=>{let t=e,i=class extends t{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(e,t,i){let r=t.capabilities?.toLowerCase().includes("tilemap"),{minLOD:l,maxLOD:s,minScale:h,maxScale:u}=t;if(null==l&&null==s&&(0!==h||0!==u)){let e=e=>Math.round(1e4*e)/1e4;h=e(h||t.tileInfo.lods[0].scale),u=e(u||t.tileInfo.lods[t.tileInfo.lods.length-1].scale);for(let i of t.tileInfo.lods){let t=e(i.scale);l=t>=h?i.level:l,s=t>=u?i.level:s}}if(r)return new a.d({layer:this,minLOD:l,maxLOD:s});if(t.tileInfo){let e=new o.A;return e.read(t.tileInfo,i),new n.A(e,l,s)}return null}};return(0,r.Cg)([(0,l.MZ)({json:{read:{source:"copyrightText"}}})],i.prototype,"copyright",void 0),(0,r.Cg)([(0,l.MZ)()],i.prototype,"minScale",void 0),(0,r.Cg)([(0,h.w)("service","minScale")],i.prototype,"readMinScale",null),(0,r.Cg)([(0,l.MZ)()],i.prototype,"maxScale",void 0),(0,r.Cg)([(0,h.w)("service","maxScale")],i.prototype,"readMaxScale",null),(0,r.Cg)([(0,l.MZ)({type:s.A})],i.prototype,"spatialReference",void 0),(0,r.Cg)([(0,l.MZ)({readOnly:!0})],i.prototype,"supportsBlankTile",null),(0,r.Cg)([(0,l.MZ)({type:o.A})],i.prototype,"tileInfo",void 0),(0,r.Cg)([(0,l.MZ)()],i.prototype,"tilemapCache",void 0),(0,r.Cg)([(0,h.w)("service","tilemapCache",["capabilities","tileInfo"])],i.prototype,"readTilemapCache",null),(0,r.Cg)([(0,l.MZ)()],i.prototype,"version",void 0),i=(0,r.Cg)([(0,l.$K)("esri.layers.mixins.ArcGISCachedService")],i),i}])},18768(e,t,i){var r=i(32198),l=i(53966),s=i(91429),o=i(60694);i.d(t,["b",0,e=>{let t=e,i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){let e=(0,o.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,o.Jf)(e,l.A.getLogger(this)))}};return(0,r.Cg)([(0,s.MZ)()],i.prototype,"title",null),(0,r.Cg)([(0,s.MZ)({type:String})],i.prototype,"url",null),i=(0,r.Cg)([(0,s.$K)("esri.layers.mixins.ArcGISService")],i),i}])},69208(e,t,i){var r=i(32198),l=i(91429);i.d(t,["d",0,e=>{let t=e,i=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,r.Cg)([(0,l.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],i.prototype,"customParameters",void 0),i=(0,r.Cg)([(0,l.$K)("esri.layers.mixins.CustomParametersMixin")],i),i}])},8303(e,t,i){var r=i(32198),l=i(92602),s=i(70333),o=i(56507),n=i(60999),a=i(49186),h=i(36563),u=i(53966),c=i(97768),p=i(17676),d=i(84952),f=i(91429),y=i(77548),m=i(20655),g=i(80812),v=i(41318),w=i(10407),_=i(26121),A=i(36005),S=i(43937);const x={credential:null,user:null};i.d(t,["A",0,e=>{let t=e,b=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){super.destroy(),this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new g.default({id:t.itemId,portal:i?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{let{load:r}=await i.e(1204).then(()=>i(41204));return(0,p.Te)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async reloadFromPortal(e,t){if(!this.loaded||!this.portalItem?.id)return!1;let r=t?.signal?null:new AbortController;try{let{reload:l}=await i.e(1204).then(()=>i(41204));return r&&this.addHandles((0,h.rE)(r),"reloadFromPortal"),await l({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t?.signal?t:{signal:r.signal})}catch(e){throw(0,p.zf)(e)||u.A.getLogger(this).warn(`Failed to reload layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}finally{r&&this.removeHandles("reloadFromPortal")}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!l.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{let{features:{edit:i,fullEdit:r},content:{updateItem:l}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",l)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let i=this.portalItem;if(!e||!i||!i.loaded||i.sourceUrl)return this._fetchFallbackUserPrivileges(t);let r,l,o=!s.id?.findCredential(this.url),n=e===i.id;if(n&&i.portal.user)return this._getUserPrivileges(i,o);if(n)r=i.portal.url;else try{r=await(0,y.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!r||!(0,d.b8)(r,i.portal.url))return this._fetchFallbackUserPrivileges(t);try{let e=null==t?null:t.signal;l=await(s.id?.getCredential(`${r}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}if(!l)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(n?await i.reload():(i=new g.default({id:e,portal:{url:r}}),await i.load(t)),i.portal.user)return this._getUserPrivileges(i,o)}catch(e){(0,p.QP)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}_getUserPrivileges(e,t){let i=(0,w.It)(e);return t&&(i.features.edit=!0),i}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){let t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;let i=x.credential===t?x.user:await this._fetchEditingUser(e);return x.credential=t,x.user=i,null==i?.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){let t=this.portalItem?.portal?.user;if(t)return t;let i=s.id?.findServerInfo(this.url??"");if(!i?.owningSystemUrl)return null;let r=`${i.owningSystemUrl}/sharing/rest`,l=m.A.getDefault();if(l&&l.loaded&&(0,d.S8)(l.restUrl)===(0,d.S8)(r))return l.user;let a=`${r}/community/self`,h=null==e?null:e.signal,u=await(0,n.Ke)((0,o.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:h}));return u.ok?v.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){return(0,_.wN)(this.portalItem,t)?(t?.messages?.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r.Cg)([(0,f.MZ)({type:g.default})],b.prototype,"portalItem",null),(0,r.Cg)([(0,A.w)("web-document","portalItem",["itemId"])],b.prototype,"readPortalItem",null),(0,r.Cg)([(0,S.K)("web-document","portalItem",{itemId:{type:String}})],b.prototype,"writePortalItem",null),(0,r.Cg)([(0,f.MZ)({clonable:!1})],b.prototype,"resourceReferences",void 0),(0,r.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],b.prototype,"userHasEditingPrivileges",void 0),(0,r.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],b.prototype,"userHasFullEditingPrivileges",void 0),(0,r.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],b.prototype,"userHasUpdateItemPrivileges",void 0),b=(0,r.Cg)([(0,f.$K)("esri.layers.mixins.PortalLayer")],b),b}])},91806(e,t,i){i.d(t,{A:()=>a});var r,l=i(32198),s=i(25482),o=i(91429),n=i(78888);let a=class extends s.o{static{r=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,l.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"cols",void 0),(0,l.Cg)([(0,o.MZ)({type:n.jz,json:{write:!0}})],a.prototype,"level",void 0),(0,l.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],a.prototype,"levelValue",void 0),(0,l.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"origin",void 0),(0,l.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],a.prototype,"resolution",void 0),(0,l.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"rows",void 0),(0,l.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],a.prototype,"scale",void 0),a=r=(0,l.Cg)([(0,o.$K)("esri.layers.support.LOD")],a)},87045(e,t,i){i.d(t,{A:()=>w});var r,l=i(32198),s=i(66552),o=i(25482),n=i(86211),a=i(91429),h=i(78888),u=i(86738),c=i(16930),p=i(21325),d=i(28735),f=i(91806),y=i(72802),m=i(36005),g=i(43937);const v=new s.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let w=class extends o.o{static{r=this}static create(e={}){let{resolutionFactor:t=1,scales:i,size:l=256,spatialReference:s=c.A.WebMercator,numLODs:o=24}=e;if(!(0,p.fn)(s)){let e=[];if(i)for(let t=0;t<i.length;t++){let r=i[t];e.push(new f.A({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new u.A(0,0,s),size:[l,l],spatialReference:s})}let a=(0,p.Vp)(s),h=e.origin?new u.A({x:e.origin.x,y:e.origin.y,spatialReference:s}):a?new u.A({x:a.origin[0],y:a.origin[1],spatialReference:s}):new u.A({x:0,y:0,spatialReference:s}),d=1/(39.37*(0,n.GA)(s)*96),y=[];if(i)for(let e=0;e<i.length;e++){let t=i[e],r=t*d;y.push(new f.A({level:e,scale:t,resolution:r}))}else{let e=(0,p.EA)(s)?512/l*591657527.5917094:256/l*591657527.591555,i=Math.ceil(o/t);y.push(new f.A({level:0,scale:e,resolution:e*d}));for(let r=1;r<i;r++){let i=e/2**t,l=i*d;y.push(new f.A({level:r,scale:i,resolution:l})),e=i}}return new r({dpi:96,lods:y,origin:h,size:[l,l],spatialReference:s})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){let{spatialReference:e,origin:t}=this;if(e&&t){let i=(0,p.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return u.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0,r=[],l=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{r.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,l[e.level]=e})),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){let t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];let i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){let t=this.scales,i=t.length-1,r=0;for(;r<i;r++){let i=t[r],l=t[r+1];if(i<=e)return r;if(l===e)return r+1;if(i>e&&l<e)return r+Math.log(i/e)/Math.log(i/l)}return r}tileAt(e,t,i,r){let l,s,o=this.lodAt(e);if(!o)return null;if("number"==typeof t)l=t,s=i;else if((0,p.aI)(t.spatialReference,this.spatialReference))l=t.x,s=t.y,r=i;else{let e=(0,d.Cv)(t,this.spatialReference);if(null==e)return null;l=e.x,s=e.y,r=i}let n=o.resolution*this.size[0],a=o.resolution*this.size[1];return r??=new y.U(0,0,0),r.level=e,r.row=Math.floor((this.origin.y-s)/a+.001),r.col=Math.floor((l-this.origin.x)/n+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){let t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;let r=e.level-i.level,l=i.resolution*this.size[0]/2**r,s=i.resolution*this.size[1]/2**r;return e.extent[0]=this.origin.x+e.col*l,e.extent[1]=this.origin.y-(e.row+1)*s,e.extent[2]=e.extent[0]+l,e.extent[3]=e.extent[1]+s,!0}upsampleTile(e){let t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){let i=this.lodAt(t.level);if(null==i)return null;let{resolution:r}=i,l=r*this.size[0],s=r*this.size[1];return e[0]=this.origin.x+t.col*l,e[1]=this.origin.y-(t.row+1)*s,e[2]=e[0]+l,e[3]=e[1]+s,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;let t=(512===this.size[0]&&256===e?-1:0)+ +!!this.spatialReference.isGeographic;if(this.size[0]===e&&0===t)return this;let i=[],l=this.lods.length-t;for(let e=0;e<l;e++){let r=e+t,{scale:l,resolution:s}=r>=0?this.lods[r]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new f.A({level:e,scale:l,resolution:s}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){let e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){let r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};(0,l.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,l.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,l.Cg)([(0,a.MZ)({type:String,json:{read:v.read,write:v.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,l.Cg)([(0,a.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,l.Cg)([(0,a.MZ)({type:u.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,l.Cg)([(0,m.w)("origin")],w.prototype,"readOrigin",null),(0,l.Cg)([(0,a.MZ)({type:[f.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,l.Cg)([(0,a.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,l.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,l.Cg)([(0,m.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,l.Cg)([(0,g.K)("size",{cols:{type:h.jz},rows:{type:h.jz}})],w.prototype,"writeSize",null),(0,l.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=r=(0,l.Cg)([(0,a.$K)("esri.layers.support.TileInfo")],w)},65509(e,t,i){i.d(t,{A:()=>s});var r=i(49186),l=i(17676);class s{constructor(e,t=0,i=e.lods[e.lods.length-1].level){this.tileInfo=e,this.minLOD=t,this.maxLOD=i,e.lodAt(t)||(this.minLOD=e.lods[0].level),e.lodAt(i)||(this.maxLOD=e.lods[e.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(e,t,i){let r=this.tileInfo?.lodAt(e);return!r||e<this.minLOD||e>this.maxLOD?"unavailable":r.cols&&r.rows?i>=r.cols[0]&&i<=r.cols[1]&&t>=r.rows[0]&&t<=r.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(e,t,i,s){await(0,l.NO)(s);let o=this.getAvailability(e,t,i);if("unavailable"===o)throw new r.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return o}async fetchAvailabilityUpsample(e,t,i,r,s){await(0,l.NO)(s),r.level=e,r.row=t,r.col=i;let o=this.tileInfo;return o.updateTileInfo(r),this.fetchAvailability(e,t,i,s).catch(e=>{if((0,l.zf)(e))throw e;if(o.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,s);throw e})}}},72802(e,t,i){i.d(t,{U:()=>l});var r=i(19419);class l{constructor(e,t,i,l=(0,r.vt)()){this._level=e,this._row=t,this._col=i,this.extent=l}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new l(e.level,e.row,e.col,e.extent)}}},25943(e,t,i){i.d(t,{d:()=>S});var r,l=i(32198),s=i(56507),o=i(69622),n=i(49186),a=i(36563),h=(i(44208),i(66344)),u=i(15142),c=i(17676),p=i(36708),d=i(76030),f=i(84952),y=i(91429),m=i(72802),g=i(4718),v=i(69397);class w{constructor(e){!function(e){if(!e?.location)throw new n.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new n.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new n.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new n.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new n.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);let{location:t,data:i}=e;this.location=Object.freeze((0,g.o8)(t));let r=this.location.width,l=this.location.height,s=!0,o=!0,a=function(e,t=!1){return e<=1024?t?Array(e).fill(0):Array(e):new Uint32Array(e)}(Math.ceil(r*l/32)),h=0;for(let e=0;e<i.length;e++){let t=e%32;i[e]?(o=!1,a[h]|=1<<t):s=!1,31===t&&++h}o?(this._availability="unavailable",this.byteSize=40):s?(this._availability="available",this.byteSize=40):(this._availability=a,this.byteSize=40+(0,v.Qf)(a))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;let i=(e-this.location.top)*this.location.width+(t-this.location.left),r=i%32,l=i>>5,s=this._availability;return l<0||l>s.length?"unknown":s[l]&1<<r?"available":"unavailable"}static fromDefinition(e,t){let i=e.service.request||s.A,{row:r,col:l,width:o,height:a}=e,h={query:{f:"json"}};return t=t?{...h,...t}:h,i(function(e){let t;if(e.service.tileServers?.length){let i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;let i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:r,left:l,width:o,height:a},valid:!0,data:Array(o*a).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==r||e.location.left!==l||e.location.width!==o||e.location.height!==a))throw new n.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:r,left:l,width:o,height:a}});return w.fromJSON(e)})}static fromJSON(e){return Object.freeze(new w(e))}}function _(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function A(e,t,i){return new n.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let S=class extends o.A{static{r=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=s.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new h.q(2097152),this.addHandles((0,p.wB)(()=>{let{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),p.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";let r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(A(e,t,i)):this._fetchTilemap(e,t,i,r).catch(e=>e).then(r=>{if(r instanceof w){let l=r.getAvailability(t,i);if("unavailable"===l)throw A(e,t,i);return l}if((0,c.zf)(r))throw r;return"unknown"})}fetchAvailabilityUpsample(e,t,i,r,l){r.level=e,r.row=t,r.col=i;let s=this.layer.tileInfo;s.updateTileInfo(r);let o=this.fetchAvailability(e,t,i,l).catch(e=>{if((0,c.zf)(e))throw e;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,l);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,l,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,i,l,s){if(!this._prefetchingEnabled)return;let o=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(o))return;let n=new AbortController;s.then(()=>n.abort(),()=>n.abort());let h=!1,u=(0,a.hA)(()=>{h||(h=!0,n.abort())});if(this.addHandles(u,o),await(0,d.md)(10,n.signal).catch(()=>{}),h||(h=!0,this.removeHandles(o)),(0,c.G4)(n))return;let p=new m.U(e,t,i),f={...l,signal:n.signal},y=this.layer.tileInfo;for(let e=0;r._prefetches.length<r._maxPrefetch&&y.upsampleTile(p);++e){let e=this.fetchAvailability(p.level,p.row,p.col,f);r._prefetches.push(e);let t=()=>{r._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new u.A({initialSize:r._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,r){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new n.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));let l=this._tmpTilemapDefinition,s=this._tilemapFromCache(e,t,i,l);if(s)return Promise.resolve(s);let o=r?.signal;return r={...r,signal:null},new Promise((e,t)=>{(0,c.u7)(o,()=>t((0,c.NK)()));let i=_(l),s=this._pendingTilemapRequests[i];if(!s){s=w.fromDefinition(l,r).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));let e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=s,s.then(e,e)}s.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;let{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,f.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;let l=_(r);return this._tilemapCache.get(l)}get test(){}};(0,l.Cg)([(0,y.MZ)({constructOnly:!0})],S.prototype,"layer",void 0),(0,l.Cg)([(0,y.MZ)({constructOnly:!0})],S.prototype,"minLOD",void 0),(0,l.Cg)([(0,y.MZ)({constructOnly:!0})],S.prototype,"maxLOD",void 0),(0,l.Cg)([(0,y.MZ)({constructOnly:!0})],S.prototype,"request",void 0),(0,l.Cg)([(0,y.MZ)({constructOnly:!0})],S.prototype,"size",void 0),S=r=(0,l.Cg)([(0,y.$K)("esri.layers.support.TilemapCache")],S)},88788(e,t,i){i.d(t,{m:()=>o,v:()=>s});var r=i(84952),l=i(20655);function s(e,t){return{...n(e,t),readResourcePaths:[]}}function o(e,t,i){let l=(0,r.An)(i?.forceNewItemContext?null:e.itemUrl);return{...n(e,t,i),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:l?{rootPath:l.path,writtenUrls:[]}:null,resources:i?.withResources?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function n(e,t,i){return{origin:t,url:(0,r.An)(i?.forceNewItemContext?null:e.itemUrl),portal:e.portal||l.A.getDefault(),portalItem:e}}},10407(e,t,i){i.d(t,{It:()=>d,LG:()=>o,OM:()=>h,Sm:()=>u,Y:()=>n,bK:()=>a,sQ:()=>c});var r=i(99917),l=i(16930),s=i(28735);function o(e,t){if(!n(e,t)){let i=e.typeKeywords;i?i.push(t):e.typeKeywords=[t]}}function n(e,t){return!!e.typeKeywords?.includes(t)}function a(e){return n(e,p.HOSTED_SERVICE)}function h(e,t){let i=e.typeKeywords;if(i){let e=i.indexOf(t);e>-1&&i.splice(e,1)}}function u(e,t,i){i?o(e,t):h(e,t)}async function c(e){let t,i=e.clone().normalize();if(i.length>1)for(let e of i)t?e.width>t.width&&(t=e):t=e;else t=i[0];return async function(e){let t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,s.ci)(e);let i=l.A.WGS84;return await(0,r.initializeProjection)(t,i),(0,r.project)(e,i)}(t)}const p={CHARTS:"Charts",CATALOG_LAYER:"CatalogLayer",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",PARCEL_FABRIC:"ParcelFabric",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery",UTILITY_NETWORK:"UtilityNetwork"};function d(e){let{portal:t,isOrgItem:i,itemControl:r}=e,l=t.user?.privileges,s=!l||l.includes("features:user:edit"),o=!!i&&!!l?.includes("features:user:fullEdit"),n="update"===r||"admin"===r;return n?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:n}}}i.d(t,["mm",0,p])},76188(e,t,i){i.d(t,{A:()=>s});var r=i(93687),l=i(44159);class s{constructor(){this.spans=[]}static{this.pool=new r.A(()=>new s)}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}*keys(){let e=this.lodInfo;for(let{row:t,colFrom:i,colTo:r}of this.spans)for(let s=i;s<=r;s++){let i=e.getWorldForColumn(s);yield new l.A(e.level,t,e.normalizeCol(s),i)}}forEach(e,t){let{spans:i,lodInfo:r}=this,{level:l}=r;if(0!==i.length)for(let{row:s,colFrom:o,colTo:n}of i)for(let i=o;i<=n;i++)e.call(t,l,s,r.normalizeCol(i),r.getWorldForColumn(i))}}},57451(e,t,i){i.d(t,{A:()=>f});var r=i(21325),l=i(44159);function s(e,t){return[e,t]}function o(e,t,i){return e[0]=t,e[1]=i,e}const n=new l.A("0/0/0/0");class a{static create(e,t,i=null){let l=(0,r.Vp)(e.spatialReference),n=t.origin||s(e.origin.x,e.origin.y),h=s(e.size[0]*t.resolution,e.size[1]*t.resolution),u=s(-1/0,-1/0),c=s(1/0,1/0),p=s(1/0,1/0);null!=i&&(o(u,Math.max(0,Math.floor((i.xmin-n[0])/h[0])),Math.max(0,Math.floor((n[1]-i.ymax)/h[1]))),o(c,Math.max(0,Math.floor((i.xmax-n[0])/h[0])),Math.max(0,Math.floor((n[1]-i.ymin)/h[1]))),o(p,c[0]-u[0]+1,c[1]-u[1]+1));let d,f,y,m,{cols:g,rows:v}=t;return!i&&g&&v&&(o(u,g[0],v[0]),o(c,g[1],v[1]),o(p,g[1]-g[0]+1,v[1]-v[0]+1)),e.isWrappable?(d=s(Math.round(Math.round((l.valid[1]-l.valid[0])/t.resolution)/e.size[0]),p[1]),f=!0,y=l.origin,m=l.valid):(d=p,f=!1),new a(t.level,t.resolution,t.scale,n,u,c,p,h,d,f,y,m)}constructor(e,t,i,r,l,s,o,n,a,h,u,c){this.level=e,this.resolution=t,this.scale=i,this.origin=r,this.first=l,this.last=s,this.size=o,this.norm=n,this.worldSize=a,this.wrap=h,this._spatialReferenceOrigin=u,this._spatialReferenceValid=c}normalizeCol(e){if(!this.wrap)return e;let t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}normalizeKey(e){if(!this.wrap)return;let t=this.worldSize[0],i=e.col;i<0?(e.col=i+t,--e.world):i>=t&&(e.col=i-t,e.world+=1)}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){let t=this.origin[0]+e*this.norm[0],i=this._spatialReferenceOrigin,r=this._spatialReferenceValid;return this.wrap&&i&&r?t===i[0]?r[0]:this.origin[0]===i[0]&&e===this.worldSize[0]?r[1]:t:t}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,t,i=!1){n.set(t);let r=i?n.col:this.denormalizeCol(n.col,n.world),l=n.row;return function(e,t,i,r,l){e[0]=t,e[1]=i,e[2]=r,e[3]=l}(e,this.getXForColumn(r),this.getYForRow(l+1),this.getXForColumn(r+1),this.getYForRow(l)),e}getTileCoords(e,t,i=!1){n.set(t);let r=i?n.col:this.denormalizeCol(n.col,n.world);return Array.isArray(e)?o(e,this.getXForColumn(r),this.getYForRow(n.row)):(e.x=this.getXForColumn(r),e.y=this.getYForRow(n.row)),e}}var h=i(76188);class u{constructor(e,t,i){this.row=e,this.colFrom=t,this.colTo=i}}const c=new l.A("0/0/0/0");class p{static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);let[i,r]=e,[l,s]=t,o=l-i,n=s-r,a=0===n?0:o/n,h=(Math.ceil(r)-r)*a,u=(Math.floor(r)-r)*a;return new p(i,Math.floor(r),Math.ceil(s),a,o<0?h:u,o<0?u:h,o<0?l:i,o<0?i:l)}constructor(e,t,i,r,l,s,o,n){this.x=e,this.ymin=t,this.ymax=i,this.invM=r,this.leftAdjust=l,this.rightAdjust=s,this.leftBound=o,this.rightBound=n}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const d=[[0,0],[0,0],[0,0],[0,0]];class f{constructor(e,t=null,i=e.lods[0].level,r=e.lods[e.lods.length-1].level){this.tileInfo=e,this.fullExtent=t,this.scales=[],this._infoByScale={},this._infoByLevel={};let l=e.lods.filter(e=>e.level>=i&&e.level<=r);this.minScale=l[0].scale,this.maxScale=l[l.length-1].scale;let s=this._lodInfos=l.map(i=>a.create(e,i,t));l.forEach((e,t)=>{this._infoByLevel[e.level]=s[t],this._infoByScale[e.scale]=s[t],this.scales[t]=e.scale},this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}get origin(){return this.tileInfo.origin}get size(){return this.tileInfo.size}getLODInfoAt(e){return this._infoByLevel["number"==typeof e?e:e.level]}getTileBounds(e,t,i=!1){c.set(t);let r=this._infoByLevel[c.level];return r?r.getTileBounds(e,c,i):e}getTileCoords(e,t,i=!1){c.set(t);let r=this._infoByLevel[c.level];return r?r.getTileCoords(e,c,i):e}getTileCoverage(e,t=192,i=!0,r="closest"){if(!i&&(e.scale>this.minScale||e.scale<this.maxScale))return null;let l,s,o,n="closest"===r?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale),a=h.A.pool.acquire(n),c=this._wrap,f=1/0,y=-1/0,m=a.spans;d[0][0]=d[0][1]=d[1][1]=d[3][0]=-t,d[1][0]=d[2][0]=e.size[0]+t,d[2][1]=d[3][1]=e.size[1]+t;for(let t of d)e.toMap(t,t),t[0]=n.getColumnForX(t[0]),t[1]=n.getRowForY(t[1]);let g=[],v=3;for(let e=0;e<4;e++){if(d[e][1]===d[v][1]){v=e;continue}let t=p.create(d[e],d[v]);f=Math.min(t.ymin,f),y=Math.max(t.ymax,y),void 0===g[t.ymin]&&(g[t.ymin]=[]),g[t.ymin].push(t),v=e}if(null==f||null==y||y-f>100)return null;let w=[];for(l=f;l<y;){null!=g[l]&&(w=w.concat(g[l])),s=1/0,o=-1/0;for(let e=w.length-1;e>=0;e--){let t=w[e];s=Math.min(s,t.getLeftCol()),o=Math.max(o,t.getRightCol())}if(s=Math.floor(s),o=Math.floor(o),l>=n.first[1]&&l<=n.last[1])if(c)if(n.size[0]<n.worldSize[0]){let e=Math.floor(o/n.worldSize[0]);for(let t=Math.floor(s/n.worldSize[0]);t<=e;t++)m.push(new u(l,Math.max(n.getFirstColumnForWorld(t),s),Math.min(n.getLastColumnForWorld(t),o)))}else m.push(new u(l,s,o));else s>n.last[0]||o<n.first[0]||(s=Math.max(s,n.first[0]),o=Math.min(o,n.last[0]),m.push(new u(l,s,o)));l+=1;for(let e=w.length-1;e>=0;e--){let t=w[e];t.ymax>=l?t.incrRow():w.splice(e,1)}}return a}getTileParentId(e){c.set(e);let t=this._infoByLevel[c.level],i=this._lodInfos.indexOf(t)-1;return i<0?null:(this._getTileIdAtLOD(c,this._lodInfos[i],c),c.id)}getTileResolution(e){let t=this._infoByLevel["object"==typeof e?e.level:e];return t?t.resolution:-1}getTileScale(e){let t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){c.set(t);let i=this._infoByLevel[c.level],r=e.lodInfo;if(r.resolution>i.resolution){this._getTileIdAtLOD(c,r,c);let t=r.denormalizeCol(c.col,c.world);for(let i of e.spans)if(i.row===c.row&&i.colFrom<=t&&i.colTo>=t)return!0}if(r.resolution<i.resolution){let[t,l,s,o]=e.spans.reduce((e,t)=>(e[0]=Math.min(e[0],t.row),e[1]=Math.max(e[1],t.row),e[2]=Math.min(e[2],t.colFrom),e[3]=Math.max(e[3],t.colTo),e),[1/0,-1/0,1/0,-1/0]),n=i.denormalizeCol(c.col,c.world),a=r.getColumnForX(i.getXForColumn(n)),h=r.getRowForY(i.getYForRow(c.row)),u=r.getColumnForX(i.getXForColumn(n+1))-1,p=r.getRowForY(i.getYForRow(c.row+1))-1;return!(a>o||u<s||h>l||p<t)}let l=r.denormalizeCol(c.col,c.world);return e.spans.some(e=>e.row===c.row&&e.colFrom<=l&&e.colTo>=l)}normalizeBounds(e,t,i){if(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._wrap){let t=(0,r.Vp)(this.tileInfo.spatialReference),l=-i*(t.valid[1]-t.valid[0]);e[0]+=l,e[2]+=l}return e}getSmallestInfoForScale(e){let t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let i=1;i<t.length-1;i++)if(e>t[i]+1e-6)return this._infoByScale[t[i-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){let t=this.scales;return this._infoByScale[e]||(e=t.reduce((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t,t[0])),this._infoByScale[e]}scaleToLevel(e){let t=this.scales;if(this._infoByScale[e])return this._infoByScale[e].level;for(let i=t.length-1;i>=0;i--)if(e<t[i])return i===t.length-1?this._infoByScale[t[t.length-1]].level:this._infoByScale[t[i]].level+(t[i]-e)/(t[i]-t[i+1]);return this._infoByScale[t[0]].level}scaleToZoom(e){return this.tileInfo.scaleToZoom(e)}zoomToScale(e){return this.tileInfo.zoomToScale(e)}_getTileIdAtLOD(e,t,i){let r=this._infoByLevel[i.level];return e.set(i),t.resolution<r.resolution?null:(t.resolution===r.resolution||(e.level=t.level,e.col=Math.floor(i.col*r.resolution/t.resolution+.01),e.row=Math.floor(i.row*r.resolution/t.resolution+.01)),e)}}},44159(e,t,i){i.d(t,{A:()=>l});var r=i(93687);class l{static{this.pool=new r.A(()=>new l(""),null,null,25,50)}static getId(e,t,i,r){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${i}/${r}`}constructor(e,t,i,r){this.set(e,t,i,r)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){let e=4095&this.row,t=4095&this.col,i=63&this.level;return(3&this.world)<<30|t<<22|e<<8|i}acquire(e,t,i,r){this.set(e,t,i,r)}contains(e){let t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){let t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new l(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,i,r){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){let[t,i,r,l]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(i),this.col=parseFloat(r),this.world=parseFloat(l)}else this.level=+e,this.row=+t,this.col=+i,this.world=+r||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new l(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,t,i){let r=this.clone();return r.col+=e,r.row+=t,i.normalizeKey(r),r}getChildKeys(){let e=this.level+1,t=this.row<<1,i=this.col<<1,r=this.world;return[new l(e,t,i,r),new l(e,t,i+1,r),new l(e,t+1,i,r),new l(e,t+1,i+1,r)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:+(this.col>e.col)}}},78553(e,t,i){i.d(t,{D:()=>s,p:()=>l});var r=i(78888);function l(e){let t=(0,r.Vr)(100*(1-e));return Math.max(0,Math.min(t,100))}function s(e){let t=1-e/100;return Math.max(0,Math.min(t,1))}},26121(e,t,i){i.d(t,{I6:()=>u,ci:()=>h,dL:()=>a,wN:()=>c});var r=i(49186),l=i(84952),s=i(77548),o=i(20655),n=i(59923);async function a(e){let t=[];for(let i of e.allLayers)if("beforeSave"in i&&"function"==typeof i.beforeSave){let e=i.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function h(e,t,i){let l=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:i})=>new r.A(e,t,i));if(e.blockedRelativeUrls&&(l=l.concat(e.blockedRelativeUrls.map(e=>(0,n.GL)("url",`Relative url '${e}' is not supported`)))),i){let{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:r}=i;e&&(l=l.filter(({name:e})=>!(n.MG.has(e)||t.includes(e)))),r&&(l=l.filter(e=>"web-document-write:property-required"!==e.name))}if(l.length>0)throw new r.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:l})}function u(e){return(0,s.qd)(e).some(e=>!!e.charts?.length)}function c(e,t){let i=t?.portal,r=e?.id&&(e.portal||o.A.getDefault());return!!i&&!!r&&!(0,l.ut)(r.restUrl,i.restUrl)}}}]);