@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([[8855],{57435:(e,t,r)=>{r.d(t,{Z:()=>u});var i=r(43697),s=r(46791),o=(r(66643),r(20102),r(92604),r(26258),r(87538)),n=r(5600),a=r(52011);let l=class extends s.Z{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,o.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 r of e)null!=r&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new s.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(e=>!!e);for(const i of t)if(i){if(r(i)){const t=this.indexOf(i,e);t>=0?t!==e&&this.reorder(i,e):this.add(i,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(i);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,i._)([(0,n.Cb)()],l.prototype,"getCollections",void 0),(0,i._)([(0,n.Cb)()],l.prototype,"getChildrenFunction",void 0),(0,i._)([(0,n.Cb)()],l.prototype,"itemFilterFunction",void 0),l=(0,i._)([(0,a.j)("esri.core.CollectionFlattener")],l);const u=l},22862:(e,t,r)=>{r.d(t,{Hg:()=>h,V7:()=>y,uD:()=>d});var i=r(92036),s=r(46791),o=r(1153);const n=["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"];function a(e){return e instanceof i.Z}function l(e){return e instanceof s.Z?Object.keys(e.items):a(e)?(0,o.vw)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof s.Z?e.items[t]:e[t]}function p(e){return e?e.declaredClass:null}function c(e,t){const r=e.diff;if(r&&"function"==typeof r)return r(e,t);const i=l(e),s=l(t);if(0===i.length&&0===s.length)return;if(!i.length||!s.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 o=s.filter((e=>!i.includes(e))),d=i.filter((e=>!s.includes(e))),y=i.filter((r=>s.includes(r)&&u(e,r)!==u(t,r))).concat(o,d).sort(),h=p(e);if(h&&n.includes(h)&&y.length)return{type:"complete",oldValue:e,newValue:t};let f;const m=a(e)&&a(t);for(const i of y){const s=u(e,i),o=u(t,i);let n;if((m||"function"!=typeof s&&"function"!=typeof o)&&s!==o&&(null!=s||null!=o)){if(r&&r[i]&&"function"==typeof r[i])n=r[i]?.(s,o);else if(s instanceof Date&&o instanceof Date){if(s.getTime()===o.getTime())continue;n={type:"complete",oldValue:s,newValue:o}}else n="object"==typeof s&&"object"==typeof o&&p(s)===p(o)?c(s,o):{type:"complete",oldValue:s,newValue:o};null!=n&&(null!=f?f.diff[i]=n:f={type:"partial",diff:{[i]:n}})}}return f}function d(e,t){if(null==e)return!1;const r=t.split(".");let i=e;for(const e of r){if("complete"===i.type)return!0;if("partial"!==i.type)return!1;{const t=i.diff[e];if(!t)return!1;i=t}}return!0}function y(e,t){for(const r of t)if(d(e,r))return!0;return!1}function h(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&p(e)!==p(t)?{type:"complete",oldValue:e,newValue:t}:c(e,t)}},68668:(e,t,r)=>{r.d(t,{G:()=>n,w:()=>a});var i=r(66643),s=r(46791),o=r(83379);async function n(e,t){return await e.load(),a(e,t)}async function a(e,t){const r=[],n=(...e)=>{for(const t of e)null!=t&&(Array.isArray(t)?n(...t):s.Z.isCollection(t)?t.forEach((e=>n(e))):o.Z.isLoadable(t)&&r.push(t))};t(n);let a=null;if(await(0,i.UI)(r,(async e=>{const t=await(0,i.q6)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||a||(a=t)})),a)throw a.error;return e}},49735:(e,t,r)=>{r.d(t,{Z:()=>C});var i=r(43697),s=r(92036),o=r(20102),n=r(80442),a=r(95330),l=r(17452),u=r(5600),p=(r(75215),r(67676),r(52011)),c=r(2981),d=r(10158),y=r(11282),h=r(41818),f=(r(66577),r(34599)),m=r(14165),b=r(6570),g=r(5396),S=r(4967),v=r(53261),w=r(74889);let _=class extends s.Z{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return(0,l.mN)(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),i=null!=e.outStatistics?.[0],s=(0,n.Z)("featurelayer-pbf-statistics"),o=!i||s;let a;if(this.pbfSupported&&o)try{a=await(0,v.t)(this.url,r,t)}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return this.pbfSupported&&o||(a=await(0,S.F)(this.url,r,t)),this._normalizeFields(a.fields),a}async featureSetFromJSON(e,t,i){if(!this._queryIs3DObjectFormat(e)||null==this.infoFor3D||!t.features)return w.Z.fromJSON(t);const{meshFeatureSetFromJSON:s}=await(0,a.Hl)(Promise.all([r.e(6481),r.e(6459),r.e(774)]).then(r.bind(r,47378)),i);return s(e,this.infoFor3D,t)}executeForCount(e,t){return(0,h.P)(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return async function(e,t,r){const i=(0,y.en)(e);return(0,f.Vr)(i,m.Z.from(t),{...r}).then((e=>({count:e.data.count,extent:b.Z.fromJSON(e.data.extent)})))}(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,g.G)(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:i},{executeRelationshipQuery:s}]=await(0,a.Hl)(Promise.all([r.e(5935).then(r.bind(r,75935)),r.e(1073).then(r.bind(r,81073))]),t);return e=i.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:i},{executeRelationshipQueryForCount:s}]=await(0,a.Hl)(Promise.all([r.e(5935).then(r.bind(r,75935)),r.e(1073).then(r.bind(r,81073))]),t);return e=i.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:i,fetchAttachments:s,processAttachmentQueryResult:o}=await(0,a.Hl)(r.e(540).then(r.bind(r,30540)),t),n=(0,y.en)(this.url);return o(n,await(this.queryAttachmentsSupported?i(n,e,t):s(n,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:i}=await(0,a.Hl)(r.e(1158).then(r.bind(r,71158)),t);return i(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:i}=await(0,a.Hl)(r.e(3992).then(r.bind(r,33992)),t);return i(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:i}=await(0,a.Hl)(r.e(1790).then(r.bind(r,21790)),t);return i(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:i}=await(0,a.Hl)(r.e(4371).then(r.bind(r,14371)),t);return i(this.parsedUrl,e,t)}_normalizeQuery(e){let t=m.Z.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?d.n.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(null!=r&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:i,queryFormats:s}=r,n=(0,c.S0)("model/gltf-binary",i)??(0,c.Ow)("glb",i),a=(0,c.S0)("model/gltf+json",i)??(0,c.Ow)("gtlf",i);for(const e of s){if(e===n){t.formatOf3DObjects=e;break}e!==a||t.formatOf3DObjects||(t.formatOf3DObjects=e)}if(!t.formatOf3DObjects)throw new o.Z("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(null==t.outFields||!t.outFields.includes("*")){t=t===e?t.clone():t,null==t.outFields&&(t.outFields=[]);const{originX:i,originY:s,originZ:o,translationX:n,translationY:a,translationZ:l,scaleX:u,scaleY:p,scaleZ:c,rotationX:d,rotationY:y,rotationZ:h,rotationDeg:f}=r.transformFieldRoles;t.outFields.push(i,s,o,n,a,l,u,p,c,d,y,h,f)}}return t}_normalizeFields(e){if(null!=this.fieldsIndex&&null!=e)for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return null!=this.infoFor3D&&!0===e.returnGeometry&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};(0,i._)([(0,u.Cb)({type:d.n})],_.prototype,"dynamicDataSource",void 0),(0,i._)([(0,u.Cb)()],_.prototype,"fieldsIndex",void 0),(0,i._)([(0,u.Cb)()],_.prototype,"gdbVersion",void 0),(0,i._)([(0,u.Cb)()],_.prototype,"infoFor3D",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,i._)([(0,u.Cb)()],_.prototype,"pbfSupported",void 0),(0,i._)([(0,u.Cb)()],_.prototype,"queryAttachmentsSupported",void 0),(0,i._)([(0,u.Cb)()],_.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,u.Cb)({type:String})],_.prototype,"url",void 0),_=(0,i._)([(0,p.j)("esri.tasks.QueryTask")],_);const C=_},54295:(e,t,r)=>{r.d(t,{V:()=>n});var i=r(43697),s=r(5600),o=(r(75215),r(67676),r(80442),r(52011));const n=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,o.j)("esri.layers.mixins.APIKeyMixin")],t),t}},7944:(e,t,r)=>{r.d(t,{O:()=>g});var i=r(43697),s=r(3172),o=r(30175),n=r(95330),a=r(17452),l=r(23670),u=r(5600),p=(r(75215),r(67676),r(80442),r(71715)),c=r(52011),d=r(31263),y=r(6570),h=r(82971),f=r(66677),m=r(21506),b=r(14661);const g=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(e,t){const r=t.capabilities&&t.capabilities.split(",").map((e=>e.toLowerCase().trim()));if(!r)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const i=this.type,s="tile"!==i&&!!t.supportsDynamicLayers,o=r.includes("query"),n=r.includes("map"),a=!!t.exportTilesAllowed,u=r.includes("tilemap"),p=r.includes("data"),c="tile"!==i&&(!t.tileInfo||s),d="tile"!==i&&(!t.tileInfo||s),y="tile"!==i,h=t.cimVersion&&l.G.parse(t.cimVersion),f=h?.since(1,4)??!1,m=h?.since(2,0)??!1;return{operations:{supportsExportMap:n,supportsExportTiles:a,supportsIdentify:o,supportsQuery:p,supportsTileMap:u},exportMap:n?{supportsArcadeExpressionForLabeling:f,supportsSublayersChanges:y,supportsDynamicLayers:s,supportsSublayerVisibility:c,supportsSublayerDefinitionExpression:d,supportsCIMSymbols:m}:null,exportTiles:a?{maxExportTilesCount:+t.maxExportTilesCount}:null}}readVersion(e,t){let r=t.currentVersion;return r||(r=t.hasOwnProperty("capabilities")||t.hasOwnProperty("tables")?10:t.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),r}async fetchRelatedService(e){const t=this.portalItem;if(!t||!(0,b.Fj)(t))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=t.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},e).then((e=>e.find((e=>"Feature Service"===e.type))??null),(()=>null)));const r=await this._relatedFeatureServicePromise;return(0,n.k_)(e),r?{itemId:r.id,url:r.url}:null}async fetchSublayerInfo(e,t){const{source:r}=e;if(this?.portalItem&&"tile"===this.type&&"map-layer"===r?.type&&(0,b.Fj)(this.portalItem)&&e.originIdOf("url")<d.s3.SERVICE){const i=await this.fetchRelatedService(t);i&&(e.url=(0,a.v_)(i.url,r.mapLayerId.toString()),e.layerItemId=i.itemId)}const{url:i}=e;let o;if("data-layer"===r.type)o=(await(0,s.Z)(i,{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey},...t})).data;else if(i&&e.originIdOf("url")>d.s3.SERVICE)try{o=(await this._fetchAllLayersAndTablesFromService(i)).get(r.mapLayerId)}catch{}else{let i=e.id;"map-layer"===r?.type&&(i=r.mapLayerId);try{o=(await this.fetchAllLayersAndTables(t)).get(i)}catch{}}return o}async fetchAllLayersAndTables(e){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,e)}async _fetchAllLayersAndTablesFromService(e,t){await this.load(t),this._allLayersAndTablesMap||=new Map;const r=(0,f.Qc)(e),i=(0,o.s1)(this._allLayersAndTablesMap,r?.url.path,(()=>(0,s.Z)((0,a.v_)(r?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then((e=>{const t=new Map;for(const r of e.data.layers)t.set(r.id,r);return{result:t}}),(e=>({error:e}))))),l=await i;if((0,n.k_)(t),"result"in l)return l.result;throw l.error}};return(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"capabilities",void 0),(0,i._)([(0,p.r)("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),(0,i._)([(0,u.Cb)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,i._)([(0,u.Cb)({type:y.Z})],t.prototype,"fullExtent",void 0),(0,i._)([(0,u.Cb)(m.id)],t.prototype,"id",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),(0,i._)([(0,u.Cb)(m.C_)],t.prototype,"popupEnabled",void 0),(0,i._)([(0,u.Cb)({type:h.Z})],t.prototype,"spatialReference",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,i._)([(0,p.r)("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=(0,i._)([(0,c.j)("esri.layers.mixins.ArcGISMapService")],t),t}},17017:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(43697),s=r(5600),o=(r(75215),r(67676),r(80442),r(52011));const n=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,i._)([(0,s.Cb)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,i._)([(0,o.j)("esri.layers.mixins.CustomParametersMixin")],t),t}},10343:(e,t,r)=>{r.d(t,{x:()=>g});var i=r(43697),s=r(46791),o=r(57435),n=r(20102),a=r(92604),l=r(17445),u=r(5600),p=(r(75215),r(67676),r(80442),r(1153)),c=r(52011),d=r(31263),y=r(49867),h=r(32073);const f=a.Z.getLogger("esri.layers.TileLayer"),m=s.Z.ofType(y.Z);function b(e,t){e&&e.forEach((e=>{t(e),e.sublayers&&e.sublayers.length&&b(e.sublayers,t)}))}const g=e=>{let t=class extends e{constructor(...e){super(...e),this.allSublayers=new o.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.sublayersSourceJSON={[d.s3.SERVICE]:{},[d.s3.PORTAL_ITEM]:{},[d.s3.WEB_SCENE]:{},[d.s3.WEB_MAP]:{}},this.addHandles((0,l.YP)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),l.Z_))}destroy(){this.allSublayers.destroy()}readSublayers(e,t){if(!t||!e)return;const{sublayersSourceJSON:r}=this,i=(0,d.M9)(t.origin);if(i<d.s3.SERVICE)return;if(r[i]={context:t,visibleLayers:e.visibleLayers||r[i].visibleLayers,layers:e.layers||r[i].layers},i>d.s3.SERVICE)return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:s,origin:o}=this.createSublayersForOrigin("web-document"),n=(0,p.vw)(this);n.setDefaultOrigin(o),this._set("sublayers",new m(s)),n.setDefaultOrigin("user")}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(e){const t=(0,d.M9)("web-document"===e?"web-map":e);let r=d.s3.SERVICE,i=this.sublayersSourceJSON[d.s3.SERVICE].layers,s=this.sublayersSourceJSON[d.s3.SERVICE].context,o=null;const n=[d.s3.PORTAL_ITEM,d.s3.WEB_SCENE,d.s3.WEB_MAP].filter((e=>e<=t));for(const e of n){const t=this.sublayersSourceJSON[e];(0,h.ac)(t.layers)&&(r=e,i=t.layers,s=t.context,t.visibleLayers&&(o={visibleLayers:t.visibleLayers,context:t.context}))}const a=[d.s3.PORTAL_ITEM,d.s3.WEB_SCENE,d.s3.WEB_MAP].filter((e=>e>r&&e<=t));let l=null;for(const e of a){const{layers:t,visibleLayers:r,context:i}=this.sublayersSourceJSON[e];t&&(l={layers:t,context:i}),r&&(o={visibleLayers:r,context:i})}const u=function(e,t){const r=[],i={};return e?(e.forEach((e=>{const s=new y.Z;if(s.read(e,t),i[s.id]=s,null!=e.parentLayerId&&-1!==e.parentLayerId){const t=i[e.parentLayerId];t.sublayers||(t.sublayers=[]),t.sublayers.unshift(s)}else r.unshift(s)})),r):r}(i,s),p=new Map,c=new Set;if(l)for(const e of l.layers)p.set(e.id,e);if(o?.visibleLayers)for(const e of o.visibleLayers)c.add(e);return b(u,(e=>{l&&e.read(p.get(e.id),l.context),o&&e.read({defaultVisibility:c.has(e.id)},o.context)})),{origin:(0,d.x3)(r),sublayers:new m({items:u})}}read(e,t){super.read(e,t),this.readSublayers(e,t)}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this,e.layer=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"sublayers-owner"),"tile"===this.type&&this.addHandles(e.on("before-changes",(e=>{f.error(new n.Z("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),e.preventDefault()})),"sublayers-owner"))}};return(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"allSublayers",void 0),(0,i._)([(0,u.Cb)({readOnly:!0,type:s.Z.ofType(y.Z)})],t.prototype,"serviceSublayers",void 0),(0,i._)([(0,u.Cb)({value:null,type:m,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),t=(0,i._)([(0,c.j)("esri.layers.mixins.SublayersOwner")],t),t}},70082:(e,t,r)=>{r.d(t,{Z:()=>c});var i=r(43697),s=r(2368),o=r(35454),n=r(96674),a=r(5600),l=(r(75215),r(67676),r(80442),r(52011));const u=new o.X({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let p=class extends((0,s.J)(n.wq)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"name",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"description",void 0),(0,i._)([(0,a.Cb)({json:{read:u.read,write:u.write}})],p.prototype,"drawingTool",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"prototype",void 0),(0,i._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"thumbnail",void 0),p=(0,i._)([(0,l.j)("esri.layers.support.FeatureTemplate")],p);const c=p},16451:(e,t,r)=>{r.d(t,{Z:()=>y});var i=r(43697),s=r(2368),o=r(96674),n=r(5600),a=(r(75215),r(67676),r(80442),r(71715)),l=r(52011),u=r(30556),p=r(72729),c=r(70082);let d=class extends((0,s.J)(o.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.im)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i._)([(0,n.Cb)({json:{write:!0}})],d.prototype,"id",void 0),(0,i._)([(0,n.Cb)({json:{write:!0}})],d.prototype,"name",void 0),(0,i._)([(0,n.Cb)({json:{write:!0}})],d.prototype,"domains",void 0),(0,i._)([(0,a.r)("domains")],d.prototype,"readDomains",null),(0,i._)([(0,u.c)("domains")],d.prototype,"writeDomains",null),(0,i._)([(0,n.Cb)({type:[c.Z],json:{write:!0}})],d.prototype,"templates",void 0),d=(0,i._)([(0,l.j)("esri.layers.support.FeatureType")],d);const y=d},56765:(e,t,r)=>{r.d(t,{Z:()=>p});var i,s=r(43697),o=r(46791),n=r(96674),a=r(5600),l=(r(75215),r(67676),r(80442),r(52011));let u=i=class extends n.wq{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new o.Z}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,s._)([(0,a.Cb)({type:String,json:{write:!0}})],u.prototype,"floorField",void 0),(0,s._)([(0,a.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,s._)([(0,a.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=i=(0,s._)([(0,l.j)("esri.layers.support.LayerFloorInfo")],u);const p=u},49867:(e,t,r)=>{r.d(t,{Z:()=>W});var i,s=r(43697),o=(r(66577),r(51773)),n=(r(16050),r(12501),r(28756),r(92271),r(72529),r(5499),r(84382),r(81571),r(91423),r(32400)),a=r(3172),l=r(9790),u=r(46791),p=r(20102),c=r(80442),d=r(10699),y=r(22974),h=r(83379),f=r(92604),m=r(16453),b=r(42033),g=r(17452),S=r(5600),v=r(90578),w=r(71715),_=r(52011),C=r(30556),I=r(75215),x=r(31263),F=r(1153),E=r(49735),T=r(16451),A=r(1231),O=r(99514),P=r(54306),D=r(30707),L=r(56765),R=r(72064),M=r(10158),j=r(42843),Z=r(56545),V=r(14165),q=r(32163),Q=r(6570),N=r(86973);function G(e){return null!=e&&"esriSMS"===e.type}function k(e,t,r){const i=this.originIdOf(t)>=(0,x.M9)(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&"map-image"===r.layer?.type&&(r.writeSublayerStructure||i)}}function z(e,t,r){return{enabled:!!r&&"tile"===r.layer?.type&&(r.origin&&this.originIdOf(t)>=(0,x.M9)(r.origin)||this._isOverridden(t))}}function U(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function B(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=(0,x.M9)(r.origin))}}let J=0;const H=new Set;H.add("layer"),H.add("parent"),H.add("loaded"),H.add("loadStatus"),H.add("loadError"),H.add("loadWarnings");let $=i=class extends((0,m.R)((0,d.IG)(h.Z))){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,url:r}=this;if(!t&&!r)throw new p.Z("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=t?await t.fetchSublayerInfo(this,e):(await(0,a.Z)(r,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service"}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:s},data:{supportsAttachment:o}}=(0,R.h)(t,this.url);return{exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:o},query:{supportsFormatPBF:s}}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readMaxScaleRange(e,t){return{minScale:t.minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new O.Z(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields)for(const e of t.fields)if("esriFieldTypeGlobalID"===e.type)return e.name}get id(){return this._get("id")??J++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((t=>t.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition&&t.layerDefinition.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition&&t.layerDefinition.maxScale||0}readObjectIdFieldFromService(e,t){if((t=t.layerDefinition||t).objectIdField)return t.objectIdField;if(t.fields)for(const e of t.fields)if("esriFieldTypeOID"===e.type)return e.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const r=t.layerDefinition;return 1-.01*((null!=r?.transparency?r.transparency:r?.drawingInfo?.transparency)??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=(0,I.vU)(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{spatialReference:e}=this.layer,t="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:r,fieldsIndex:i}=this,s=(0,c.Z)("featurelayer-pbf")&&r?.query.supportsFormatPBF,o=r?.operations?.supportsQueryAttachments??!1;return new E.Z({url:this.url,pbfSupported:s,fieldsIndex:i,gdbVersion:t,sourceSpatialReference:e,queryAttachmentsSupported:o})}set renderer(e){if(e)for(const t of e.getSymbols())if((0,l.dU)(t)){f.Z.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new j.R({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return(0,I.se)(u.Z.ofType(i),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===t?.type)return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${(0,g.B7)(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=(0,F.vw)(this),t=new i;return(0,F.vw)(t).store=e.clone(H),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return(0,q.eZ)(this,e)}createQuery(){return new V.Z({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const{layer:e}=this,t=e?.parsedUrl,i=new(0,(await Promise.all([r.e(6569),r.e(6404),r.e(3712),r.e(9238)]).then(r.bind(r,19238))).default)({url:t?.path});return t&&this.source&&("map-layer"===this.source.type?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source),null!=e?.refreshInterval&&(i.refreshInterval=e.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=(0,y.d9)(this.floorInfo)),this.originIdOf("labelingInfo")>x.s3.SERVICE&&(i.labelingInfo=(0,y.d9)(this.labelingInfo)),this.originIdOf("labelsVisible")>x.s3.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>x.s3.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>x.s3.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>x.s3.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>x.s3.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>x.s3.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>x.s3.DEFAULTS&&(i.popupTemplate=(0,y.d9)(this.popupTemplate)),this.originIdOf("renderer")>x.s3.SERVICE&&(i.renderer=(0,y.d9)(this.renderer)),"data-layer"===this.source?.type&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>x.s3.DEFAULTS&&(i.title=this.title),"map-image"===e?.type&&e.originIdOf("customParameters")>x.s3.DEFAULTS&&(i.customParameters=e.customParameters),"tile"===e?.type&&e.originIdOf("customParameters")>x.s3.DEFAULTS&&(i.customParameters=e.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const i=e.attributes?e.attributes[t]:void 0;if(null==i)return null;let s=null;return r?.some((e=>{const{id:t}=e;return null!=t&&(t.toString()===i.toString()&&(s=e),!!s)})),s}getFieldDomain(e,t){const r=t&&t.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=Z.Z.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new p.Z("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:o,num:n,size:a,start:l,where:u}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||o?.length>0||a?.length>0||n||l||u))throw new p.Z("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||o?.length||u))throw new p.Z("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,t)}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new p.Z("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new p.Z("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const e of r.features)e.sourceLayer=this;return r}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=(0,b._)(e,this.definitionExpression);null!=r&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,t)=>(e[t]=this.originIdOf(t),e)),{}),s=Object.keys(i).some((e=>i[e]>x.s3.SERVICE));if(s){const e=t.drawingInfo={};if(i.renderer>x.s3.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>x.s3.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>x.s3.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some((e=>!e.labelPlacement))&&f.Z.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let t=this.labelingInfo;null!=this.geometryType&&(t=(0,D.a)(this.labelingInfo,N.M.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=t.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer})))}else e.showLabels=!1;i.opacity>x.s3.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline&&e.outline.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of r)G(e.symbol)&&t(e.symbol);"symbol"in e&&G(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&G(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,o;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",o="supportsModification"}const n=(0,F.vw)(this).getDefaultOrigin();if("service"!==n){if(s&&!1===this.layer?.capabilities?.exportMap?.[s])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(o&&!1===this.capabilities?.exportMap[o])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${o}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,t),"service"!==n&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this.removeAllHandles()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{const t=this.layer?.capabilities?.exportMap?.supportsSublayersChanges;null==t||t||(f.Z.getLogger(this).error(new p.Z("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,t){const{layer:r,declaredClass:i}=this;f.Z.getLogger(i).error(new p.Z("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};$.test={isMapImageLayerOverridePolicy:e=>e===U||e===k,isTileImageLayerOverridePolicy:e=>e===z},(0,s._)([(0,S.Cb)({readOnly:!0})],$.prototype,"capabilities",void 0),(0,s._)([(0,w.r)("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],$.prototype,"readCapabilities",null),(0,s._)([(0,S.Cb)()],$.prototype,"defaultPopupTemplate",null),(0,s._)([(0,S.Cb)({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:k}}})],$.prototype,"definitionExpression",null),(0,s._)([(0,S.Cb)({readOnly:!0})],$.prototype,"effectiveScaleRange",null),(0,s._)([(0,w.r)("service","maxScaleRange",["minScale","maxScale"])],$.prototype,"readMaxScaleRange",null),(0,s._)([(0,S.Cb)({type:[A.Z],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],$.prototype,"fields",void 0),(0,s._)([(0,S.Cb)({readOnly:!0})],$.prototype,"fieldsIndex",null),(0,s._)([(0,S.Cb)({type:L.Z,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:k},origins:{"web-scene":{read:!1,write:!1}}}})],$.prototype,"floorInfo",null),(0,s._)([(0,S.Cb)({type:Q.Z,json:{read:{source:"layerDefinition.extent"}}})],$.prototype,"fullExtent",void 0),(0,s._)([(0,S.Cb)({type:N.M.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:N.M.read}}}}})],$.prototype,"geometryType",void 0),(0,s._)([(0,S.Cb)({type:String})],$.prototype,"globalIdField",void 0),(0,s._)([(0,w.r)("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],$.prototype,"readGlobalIdFieldFromService",null),(0,s._)([(0,S.Cb)({type:I.z8,json:{write:{ignoreOrigin:!0}}})],$.prototype,"id",null),(0,s._)([(0,S.Cb)({value:null,type:[P.Z],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:U}}})],$.prototype,"labelingInfo",null),(0,s._)([(0,C.c)("labelingInfo")],$.prototype,"writeLabelingInfo",null),(0,s._)([(0,S.Cb)({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:U}}})],$.prototype,"labelsVisible",null),(0,s._)([(0,S.Cb)({value:null})],$.prototype,"layer",null),(0,s._)([(0,S.Cb)({type:String,json:{write:{overridePolicy:z}}})],$.prototype,"layerItemId",void 0),(0,s._)([(0,S.Cb)({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:B}}})],$.prototype,"legendEnabled",void 0),(0,s._)([(0,S.Cb)({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],$.prototype,"listMode",null),(0,s._)([(0,S.Cb)({type:Number,value:0,json:{write:{overridePolicy:U}}})],$.prototype,"minScale",null),(0,s._)([(0,w.r)("minScale",["minScale","layerDefinition.minScale"])],$.prototype,"readMinScale",null),(0,s._)([(0,S.Cb)({type:Number,value:0,json:{write:{overridePolicy:U}}})],$.prototype,"maxScale",null),(0,s._)([(0,w.r)("maxScale",["maxScale","layerDefinition.maxScale"])],$.prototype,"readMaxScale",null),(0,s._)([(0,S.Cb)({type:String})],$.prototype,"objectIdField",void 0),(0,s._)([(0,w.r)("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],$.prototype,"readObjectIdFieldFromService",null),(0,s._)([(0,S.Cb)({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:U}}})],$.prototype,"opacity",null),(0,s._)([(0,w.r)("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],$.prototype,"readOpacity",null),(0,s._)([(0,C.c)("opacity")],$.prototype,"writeOpacity",null),(0,s._)([(0,S.Cb)({json:{type:I.z8,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:U}}})],$.prototype,"parent",void 0),(0,s._)([(0,C.c)("parent")],$.prototype,"writeParent",null),(0,s._)([(0,S.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:B,writer(e,t,r){t[r]=!e}}}})],$.prototype,"popupEnabled",void 0),(0,s._)([(0,S.Cb)({type:o.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:B}}})],$.prototype,"popupTemplate",void 0),(0,s._)([(0,S.Cb)({readOnly:!0})],$.prototype,"queryTask",null),(0,s._)([(0,S.Cb)({types:n.A,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:U},origins:{"web-scene":{types:n.o,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:U}}}}})],$.prototype,"renderer",null),(0,s._)([(0,S.Cb)({types:{key:"type",base:null,typeMap:{"data-layer":M.n,"map-layer":j.R}},cast(e){if(e){if("mapLayerId"in e)return(0,I.TJ)(j.R,e);if("dataSource"in e)return(0,I.TJ)(M.n,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:U}}})],$.prototype,"source",null),(0,s._)([(0,S.Cb)()],$.prototype,"sourceJSON",void 0),(0,s._)([(0,S.Cb)({value:null,json:{type:[I.z8],write:{target:"subLayerIds",allowNull:!0,overridePolicy:U}}})],$.prototype,"sublayers",null),(0,s._)([(0,v.p)("sublayers")],$.prototype,"castSublayers",null),(0,s._)([(0,C.c)("sublayers")],$.prototype,"writeSublayers",null),(0,s._)([(0,S.Cb)({type:String,json:{name:"name",write:{overridePolicy:B}}})],$.prototype,"title",void 0),(0,s._)([(0,S.Cb)({type:String})],$.prototype,"typeIdField",void 0),(0,s._)([(0,S.Cb)({json:{read:!1},readOnly:!0,value:"sublayer"})],$.prototype,"type",void 0),(0,s._)([(0,w.r)("typeIdField",["layerDefinition.typeIdField"])],$.prototype,"readTypeIdField",null),(0,s._)([(0,S.Cb)({type:[T.Z],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],$.prototype,"types",void 0),(0,s._)([(0,S.Cb)({type:String,json:{name:"layerUrl",write:{overridePolicy:z}}})],$.prototype,"url",null),(0,s._)([(0,S.Cb)({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:U}}})],$.prototype,"visible",null),(0,s._)([(0,C.c)("visible")],$.prototype,"writeVisible",null),$=i=(0,s._)([(0,_.j)("esri.layers.support.Sublayer")],$);const W=$},90082:(e,t,r)=>{r.d(t,{V:()=>n,g:()=>o});var i=r(20102),s=r(95330);async function o(e,t,r){let o;try{o=await createImageBitmap(e)}catch(e){throw new i.Z("request:server",`Unable to load ${t}`,{url:t,error:e})}return(0,s.k_)(r),o}async function n(e,t,r,o,n){let a;try{a=await createImageBitmap(e)}catch(e){throw new i.Z("request:server",`Unable to load tile ${t}/${r}/${o}`,{error:e,level:t,row:r,col:o})}return(0,s.k_)(n),a}},2981:(e,t,r)=>{r.d(t,{$6:()=>p,Ow:()=>o,S0:()=>s,d1:()=>n});const i=[["binary","application/octet-stream","bin",""]];function s(e,t){return l(function(e,t){return a(t).find((t=>u(t)===e))}(e,t))}function o(e,t){return l(function(e,t){const r=e.toLowerCase();return a(t).find((e=>function(e){return e?.[2].split(",")??[]}(e).some((e=>r.endsWith(e)))))}(e,t))}function n(e,t){return u(function(e,t){return a(t).find((t=>l(t)===e))}(e,t))}function a(e){return[...i,...e]}function l(e){return e?.[0]}function u(e){return e?.[1]}function p(e){return e.tables?.find((e=>"assetMaps"===e.role))}},30707:(e,t,r)=>{r.d(t,{a:()=>c,r:()=>u});var i=r(20102),s=r(22974),o=r(92604),n=r(54306);const a=o.Z.getLogger("esri.layers.support.labelingInfo"),l=/\[([^\[\]]+)\]/gi;function u(e,t,r){return e?e.map((e=>{const i=new n.Z;if(i.read(e,r),i.labelExpression){const e=t.fields||t.layerDefinition&&t.layerDefinition.fields||this.fields;i.labelExpression=i.labelExpression.replaceAll(l,((t,r)=>`[${function(e,t){if(!t)return e;const r=e.toLowerCase();for(let e=0;e<t.length;e++){const i=t[e].name;if(i.toLowerCase()===r)return i}return e}(r,e)}]`))}return i})):null}const p={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null};function c(e,t){const r=(0,s.d9)(e);return r.some((e=>function(e,t){const r=e.labelPlacement,s=p[t];if(!e.symbol)return a.warn("No ILabelClass symbol specified."),!0;if(!s)return a.error(new i.Z("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${t}' is not supported`)),!0;if(!s.includes(r)){const i=s[0];r&&a.warn(`Found invalid label placement type ${r} for ${t}. Defaulting to ${i}`),e.labelPlacement=i}return!1}(e,t)))?[]:r}},72064:(e,t,r)=>{r.d(t,{h:()=>c});var i=r(80442),s=r(66677);const o={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function n(e,t,r){return!!l(e,t,r)}function a(e,t,r){return l(e,t,r)}function l(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}function u(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function p(e,t){const r=e?.supportedOperationsWithCacheHint?.map((e=>e.toLowerCase()));return!!r?.includes(t.toLowerCase())}function c(e,t){return{analytics:d(e),attachment:y(e),data:h(e),metadata:f(e),operations:m(e.capabilities,e,t),query:b(e,t),queryRelated:g(e),queryTopFeatures:S(e),editing:v(e)}}function d(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryAnalytics")}}function y(e){const t=e.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:p(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:n(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach((e=>{const t=o[e.name];t&&(r[t]=!!e.isEnabled)})),r}function h(e){return{isVersioned:n(e,"isDataVersioned",!1),supportsAttachment:n(e,"hasAttachments",!1),supportsM:n(e,"hasM",!1),supportsZ:n(e,"hasZ",!1)}}function f(e){return{supportsAdvancedFieldProperties:n(e,"supportsFieldDescriptionProperty",!1)}}function m(e,t,r){const i=e?e.toLowerCase().split(",").map((e=>e.trim())):[],o=r?(0,s.Qc)(r):null,a=i.includes(null!=o&&"MapServer"===o.serverType?"data":"query"),l=i.includes("editing")&&!t.datesInUnknownTimezone;let u=l&&i.includes("create"),p=l&&i.includes("delete"),c=l&&i.includes("update");const d=i.includes("changetracking"),y=t.advancedQueryCapabilities;return l&&!(u||p||c)&&(u=p=c=!0),{supportsCalculate:n(t,"supportsCalculate",!1),supportsTruncate:n(t,"supportsTruncate",!1),supportsValidateSql:n(t,"supportsValidateSql",!1),supportsAdd:u,supportsDelete:p,supportsEditing:l,supportsChangeTracking:d,supportsQuery:a,supportsQueryAnalytics:n(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:n(y,"supportsQueryAttachments",!1),supportsQueryTopFeatures:n(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:n(t,"supportsAttachmentsResizing",!1),supportsSync:i.includes("sync"),supportsUpdate:c,supportsExceedsLimitStatistics:n(t,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:n(t,"supportsAsyncConvert3D",!1)}}function b(e,t){const r=e.advancedQueryCapabilities,o=e.ownershipBasedAccessControlForFeatures,l=e.archivingInfo,c=e.currentVersion,d=t?.includes("MapServer"),y=!d||c>=(0,i.Z)("mapserver-pbf-version-support"),h=(0,s.M8)(t),f=new Set((e.supportedQueryFormats??"").split(",").map((e=>e.toLowerCase().trim())));return{supportsStatistics:n(r,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:n(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:n(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:u(r),supportsCentroid:n(r,"supportsReturningGeometryCentroid",!1),supportsDistance:n(r,"supportsQueryWithDistance",!1),supportsDistinct:n(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:n(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:n(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:n(r,"supportsHavingClause",!1),supportsOrderBy:n(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:n(r,"supportsPagination",!1),supportsQuantization:n(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:n(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:n(e,"supportsReturningQueryGeometry",!1),supportsResultType:n(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:n(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:n(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:n(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:n(r,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:n(o,"allowAnonymousToQuery",!0),supportsQueryByOthers:n(o,"allowOthersToQuery",!0),supportsHistoricMoment:n(l,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:y&&f.has("pbf"),supportsDisjointSpatialRelationship:n(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:n(r,"supportsQueryWithCacheHint",!1)||p(r,"query"),supportsDefaultSpatialReference:n(r,"supportsDefaultSR",!1),supportsCompactGeometry:h,supportsFullTextSearch:n(r,"supportsFullTextSearch",!1),maxRecordCountFactor:a(e,"maxRecordCountFactor",void 0),maxRecordCount:a(e,"maxRecordCount",void 0),standardMaxRecordCount:a(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:a(e,"tileMaxRecordCount",void 0)}}function g(e){const t=e.advancedQueryCapabilities,r=n(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:n(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:p(t,"queryRelated")}}function S(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryTopFilter")}}function v(e){const t=e.ownershipBasedAccessControlForFeatures,r=e?e.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:n(e,"allowGeometryUpdates",!0),supportsGlobalId:n(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:n(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:n(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:n(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:n(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:n(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:n(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:n(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:n(t,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:n(r,"supportsAsyncApplyEdits",!1)}}},32073:(e,t,r)=>{r.d(t,{FN:()=>o,QV:()=>s,ac:()=>a});var i=r(31263);function s(e,t,r){const i=t.flatten((({sublayers:e})=>e)).length;return i!==e.length||!!e.some((e=>e.originIdOf("minScale")>r||e.originIdOf("maxScale")>r||e.originIdOf("renderer")>r||e.originIdOf("labelingInfo")>r||e.originIdOf("opacity")>r||e.originIdOf("labelsVisible")>r||e.originIdOf("source")>r))||!n(e,t)}function o(e,t,r){return!!e.some((e=>{const t=e.source;return!(!t||"map-layer"===t.type&&t.mapLayerId===e.id&&(null==t.gdbVersion||t.gdbVersion===r))||e.originIdOf("renderer")>i.s3.SERVICE||e.originIdOf("labelingInfo")>i.s3.SERVICE||e.originIdOf("opacity")>i.s3.SERVICE||e.originIdOf("labelsVisible")>i.s3.SERVICE}))||!n(e,t)}function n(e,t){if(!e||!e.length||null==t)return!0;const r=t.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).map((e=>e.id)).toArray();if(e.length>r.length)return!1;let i=0;const s=r.length;for(const{id:t}of e){for(;i<s&&r[i]!==t;)i++;if(i>=s)return!1}return!0}function a(e){return!!e&&e.some((e=>null!=e.minScale||e.layerDefinition&&null!=e.layerDefinition.minScale))}},41818:(e,t,r)=>{r.d(t,{P:()=>n});var i=r(11282),s=r(34599),o=r(14165);async function n(e,t,r){const n=(0,i.en)(e);return(0,s.hH)(n,o.Z.from(t),{...r}).then((e=>e.data.count))}},5396:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(11282),s=r(34599),o=r(14165);async function n(e,t,r){const n=(0,i.en)(e);return(0,s.Ev)(n,o.Z.from(t),{...r}).then((e=>e.data.objectIds))}},4967:(e,t,r)=>{r.d(t,{F:()=>l,e:()=>a});var i=r(11282),s=r(34599),o=r(74889),n=r(14165);async function a(e,t,r){const i=await l(e,t,r);return o.Z.fromJSON(i)}async function l(e,t,r){const o=(0,i.en)(e),a={...r},l=n.Z.from(t),{data:u}=await(0,s.JT)(o,l,l.sourceSpatialReference,a);return u}},53261:(e,t,r)=>{r.d(t,{t:()=>m});var i=r(11282),s=r(70586),o=r(69285),n=r(98732);function a(e,t){return t}function l(e,t,r,i){switch(r){case 0:return d(e,t+i,0);case 1:return"lowerLeft"===e.originPosition?d(e,t+i,1):function({translate:e,scale:t},r,i){return e[i]-r*t[i]}(e,t+i,1)}}function u(e,t,r,i){return 2===r?d(e,t,2):l(e,t,r,i)}function p(e,t,r,i){return 2===r?d(e,t,3):l(e,t,r,i)}function c(e,t,r,i){return 3===r?d(e,t,3):u(e,t,r,i)}function d({translate:e,scale:t},r,i){return e[i]+r*t[i]}class y{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=a,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=(0,o.k)(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(null!=t)for(const r of e.features)t(r.geometry)}createSpatialReference(){return{}}addField(e,t){const r=e.fields;(0,s.O3)(r),r.push(t);const i=r.map((e=>e.name));this._attributesConstructor=function(){for(const e of i)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,r)=>this.addCoordinatePoint(e,t,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,r)=>this._addCoordinatePolygon(e,t,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,r)=>this._addCoordinatePolyline(e,t,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,r)=>this._addCoordinateMultipoint(e,t,r),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,r){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:i}=t,s=(0,n.$g)(r.clone(),r,!1,!1,this._transform),o=(0,n.di)(s,i,!1,!1);e.queryGeometryType=i,e.queryGeometry={...o}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const i=this._transform;switch(t=this._applyTransform(i,t,r,0),r){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let r=0;t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const i=this._transform;return this._applyTransform(i,e,t,r)}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){0===r&&e.points.push([]);const i=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(i)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){0===r&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const i=this._transformPathLikeValue(t,r),s=e[e.length-1];0===r&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),s.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=i}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?c:t?u:r?p:l}}var h=r(34599),f=(r(74889),r(14165));async function m(e,t,r){const s=(0,i.en)(e),o={...r},n=f.Z.from(t),a=!n.quantizationParameters,{data:l}=await(0,h.qp)(s,n,new y({sourceSpatialReference:n.sourceSpatialReference,applyTransform:a}),o);return l}},28694:(e,t,r)=>{r.d(t,{p:()=>s});var i=r(69285);function s(e,t,r){if(!r||!r.features||!r.hasZ)return;const s=(0,i.k)(r.geometryType,t,e.outSpatialReference);if(null!=s)for(const e of r.features)s(e.geometry)}},74889:(e,t,r)=>{r.d(t,{Z:()=>S});var i,s=r(43697),o=r(66577),n=r(38171),a=r(35454),l=r(96674),u=r(22974),p=r(5600),c=(r(75215),r(71715)),d=r(52011),y=r(30556),h=r(82971),f=r(33955),m=r(1231);const b=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let g=i=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=h.Z.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const s=e[t],o=n.Z.fromJSON(s),a=s.geometry&&s.geometry.spatialReference;null==o.geometry||a||(o.geometry.spatialReference=r);const l=s.aggregateGeometries,u=o.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],i=l[e],s=i?.spatialReference;null==t||s||(t.spatialReference=r)}i.push(o)}return i}writeGeometryType(e,t,r,i){if(e)return void b.write(e,t,r,i);const{features:s}=this;if(s)for(const e of s)if(e&&null!=e.geometry)return void b.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,f.im)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=h.Z.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e&&e[r];i.geometry=t&&t.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,s]}=e,o=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-i)/t)),(e=>Math.round((s-e)/r)));for(let e=0,t=o.length;e<t;e++)n?.(o[e].geometry)||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,s],scale:[o,n]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,(e=>e*o+i),(e=>s-e*n),a,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,r){let i,s;const o=[];for(let n=0,a=e.length;n<a;n++){const a=e[n];if(n>0){const e=t(a[0]),n=r(a[1]);e===i&&n===s||(o.push([e-i,n-s]),i=e,s=n)}else i=t(a[0]),s=r(a[1]),o.push([i,s])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,f.oU)(e)?e.rings:e.paths,s=[];for(let e=0,o=i.length;e<o;e++){const o=i[e],n=this._quantizePoints(o,t,r);n&&s.push(n)}return s.length>0?((0,f.oU)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,i,s){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),i&&(e.z=i(e.z))}:"polyline"===e||"polygon"===e?e=>{const o=(0,f.oU)(e)?e.rings:e.paths;let n,a;for(let e=0,i=o.length;e<i;e++){const i=o[e];for(let e=0,s=i.length;e<s;e++){const s=i[e];e>0?(n+=s[0],a+=s[1]):(n=s[0],a=s[1]),s[0]=t(n),s[1]=r(a)}}if(i&&s)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2]),r[3]=s(r[3])}}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}else if(s)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),i&&null!=e.zmax&&null!=e.zmin&&(e.zmax=i(e.zmax),e.zmin=i(e.zmin)),s&&null!=e.mmax&&null!=e.mmin&&(e.mmax=s(e.mmax),e.mmin=s(e.mmin))}:"multipoint"===e?e=>{const o=e.points;let n,a;for(let e=0,i=o.length;e<i;e++){const i=o[e];e>0?(n+=i[0],a+=i[1]):(n=i[0],a=i[1]),i[0]=t(n),i[1]=r(a)}if(i&&s)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=i(t[2]),t[3]=s(t[3])}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=i(t[2])}else if(s)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=s(t[2])}}:null}};(0,s._)([(0,p.Cb)({type:String,json:{write:!0}})],g.prototype,"displayFieldName",void 0),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"exceededTransferLimit",void 0),(0,s._)([(0,p.Cb)({type:[n.Z],json:{write:!0}})],g.prototype,"features",void 0),(0,s._)([(0,c.r)("features")],g.prototype,"readFeatures",null),(0,s._)([(0,p.Cb)({type:[m.Z],json:{write:!0}})],g.prototype,"fields",void 0),(0,s._)([(0,p.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:b.read}}})],g.prototype,"geometryType",void 0),(0,s._)([(0,y.c)("geometryType")],g.prototype,"writeGeometryType",null),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasM",void 0),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasZ",void 0),(0,s._)([(0,p.Cb)({types:o.qM,json:{write:!0}})],g.prototype,"queryGeometry",void 0),(0,s._)([(0,c.r)("queryGeometry")],g.prototype,"readQueryGeometry",null),(0,s._)([(0,p.Cb)({type:h.Z,json:{write:!0}})],g.prototype,"spatialReference",void 0),(0,s._)([(0,y.c)("spatialReference")],g.prototype,"writeSpatialReference",null),(0,s._)([(0,p.Cb)({json:{write:!0}})],g.prototype,"transform",void 0),g=i=(0,s._)([(0,d.j)("esri.rest.support.FeatureSet")],g),g.prototype.toJSON.isDefaultToJSON=!0;const S=g},58333:(e,t,r)=>{r.d(t,{ET:()=>o,I4:()=>s,eG:()=>l,lF:()=>n,lj:()=>p,qP:()=>a,wW:()=>u});const i=[252,146,31,255],s={type:"esriSMS",style:"esriSMSCircle",size:6,color:i,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:i},n={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},p={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4578],{92835:(e,t,i)=>{i.d(t,{Z:()=>m});var s,n=i(43697),r=i(96674),a=i(35463),o=i(5600),l=(i(75215),i(67676),i(80442),i(71715)),c=i(52011),u=i(30556);let h=s=class extends r.wq{static get allTime(){return f}static get empty(){return d}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(s.allTime)}get isEmpty(){return this.equals(s.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 s({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=null!=this.start?this.start.getTime():this.start,i=null!=this.end?this.end.getTime():this.end,s=null!=e.start?e.start.getTime():e.start,n=null!=e.end?e.end.getTime():e.end;return t===s&&i===n}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();let t=this.start;t&&(t=(0,a.JE)(t,e));let i=this.end;if(i){const t=(0,a.JE)(i,e);i=i.getTime()===t.getTime()?t:(0,a.Nm)(t,1,e)}return new s({start:t,end:i})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return s.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,i=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let a,o;if(n>=t&&n<=i?a=n:t>=n&&t<=r&&(a=t),i>=n&&i<=r?o=i:r>=t&&r<=i&&(o=r),null!=a&&null!=o&&!isNaN(a)&&!isNaN(o)){const e=new s;return e.start=a===-1/0?null:new Date(a),e.end=o===1/0?null:new Date(o),e}return s.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const i=new s,{start:n,end:r}=this;return null!=n&&(i.start=(0,a.Nm)(n,e,t)),null!=r&&(i.end=(0,a.Nm)(r,e,t)),i}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new s({start:t,end:i})}};(0,n._)([(0,o.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,n._)([(0,l.r)("end")],h.prototype,"readEnd",null),(0,n._)([(0,u.c)("end")],h.prototype,"writeEnd",null),(0,n._)([(0,o.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,n._)([(0,o.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,n._)([(0,o.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,n._)([(0,l.r)("start")],h.prototype,"readStart",null),(0,n._)([(0,u.c)("start")],h.prototype,"writeStart",null),h=s=(0,n._)([(0,c.j)("esri.TimeExtent")],h);const f=new h,d=new h({start:void 0,end:void 0}),m=h},13867:(e,t,i)=>{i.d(t,{z:()=>n});var s=i(69801);class n{constructor(e,t){this._storage=new s.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,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(){}}},69801:(e,t,i)=>{i.d(t,{WJ:()=>o,Xq:()=>a});var s,n,r=i(44553);(n=s||(s={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class a{constructor(e,t,i){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),i&&(this._storage.registerRemoveFunc(this.id,i),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,i,s=0){this._storage.put(this,e,t,i,s)}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,i){this._storage.updateSize(this,e,t,i)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class o{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 r.Z,this._users=new r.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,i,n,r){t=e.id+t;const a=this._db.get(t);if(a&&(this._size-=a.size,e.size-=a.size,this._db.delete(t),a.entry!==i&&this._notifyRemove(t,a.entry,s.ALL)),n>this._maxSize)return void this._notifyRemove(t,i,s.ALL);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return void console.warn("Refusing to cache entry with invalid size "+n);const o=1+Math.max(r,-3)- -3;this._db.set(t,{entry:i,size:n,lifetime:o,lives:o}),this._size+=n,e.size+=n,this._checkSizeLimits()}updateSize(e,t,i,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===i){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,i,s.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSizeLimits()}}pop(e,t){t=e.id+t;const 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;const 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){const i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.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={},i=new Array;this._db.forEach(((e,s)=>{const n=e.lifetime;i[n]=(i[n]||0)+e.size,this._users.forAll((i=>{const{id:n,name:r}=i;if(s.startsWith(n)){const i=t[r]||0;t[r]=i+e.size}}))}));const s={};this._users.forAll((e=>{const i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[i]||0;t[i]=n,s[i]=Math.round(100*e.hitRate)+"%"}else s[i]="0%"}));const n=Object.keys(t);n.sort(((e,i)=>t[i]-t[e])),n.forEach((i=>e[i]=Math.round(t[i]/2**20)+"MB / "+s[i]));for(let t=i.length-1;t>=0;--t){const s=i[t];s&&(e["Priority "+(t+-3-1)]=Math.round(s/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,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,s.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,s.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,i){let s;return this._removeFuncs.some((n=>{if(e.startsWith(n[0])){const e=n[1](t,i);return"number"==typeof e&&(s=e),!0}return!1})),s}_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,i]of this._db)if(t.startsWith(e.id)&&(this._purgeItem(t,i,e),e.size<=.9*e.maxSize))return}))}_purgeItem(e,t,i=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);const n=this._notifyRemove(e,t.entry,s.SOME);null!=n&&n>0&&(this._size+=n,i&&(i.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0},17445:(e,t,i)=>{i.d(t,{N1:()=>f,YP:()=>l,Z_:()=>p,gx:()=>c,nn:()=>g,on:()=>h,tX:()=>y}),i(66643),i(46791);var s=i(91460),n=i(50758),r=i(70586),a=i(95330),o=i(26258);function l(e,t,i={}){return u(e,t,i,d)}function c(e,t,i={}){return u(e,t,i,m)}function u(e,t,i={},s){let n=null;const a=i.once?(e,i)=>{s(e)&&((0,r.hw)(n),t(e,i))}:(e,i)=>{s(e)&&t(e,i)};if(n=(0,o.aQ)(e,a,i.sync,i.equals),i.initial){const t=e();a(t,t)}return n}function h(e,t,i,a={}){let o=null,c=null,u=null;function h(){o&&c&&(c.remove(),a.onListenerRemove?.(o),o=null,c=null)}function f(e){a.once&&a.once&&(0,r.hw)(u),i(e)}const d=l(e,((e,i)=>{h(),(0,s.vT)(e)&&(o=e,c=(0,s.on)(e,t,f),a.onListenerAdd?.(e))}),{sync:a.sync,initial:!0});return u=(0,n.kB)((()=>{d.remove(),h()})),u}function f(e,t){return function(e,t,i){if((0,a.Hc)(i))return Promise.reject((0,a.zE)());const s=e();if(t?.(s))return Promise.resolve(s);let o=null;function l(){o=(0,r.hw)(o)}return new Promise(((s,r)=>{o=(0,n.AL)([(0,a.fu)(i,(()=>{l(),r((0,a.zE)())})),u(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??d)])}))}(e,m,t)}function d(e){return!0}function m(e){return!!e}i(87538);const p={sync:!0},g={initial:!0},y={sync:!0,initial:!0}},35463:(e,t,i)=>{i.d(t,{JE:()=>a,Nm:()=>r,rJ:()=>o}),i(80442);const s={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},n={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 r(e,t,i){const s=new Date(e.getTime());if(t&&i){const e=n[i],{getter:r,setter:a,multiplier:o}=e;if("months"===i){const e=function(e,t){const i=new Date(e,t+1,1);return i.setDate(0),i.getDate()}(s.getFullYear(),s.getMonth()+t);s.getDate()>e&&s.setDate(e)}s[a](s[r]()+t*o)}return s}function a(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 o(e,t,i){return 0===e?0:e*s[t]/s[i]}},16306:(e,t,i)=>{i.d(t,{aX:()=>I});var s=i(68773),n=i(20102),r=i(92604),a=i(38913),o=i(58901),l=i(73913),c=i(8744),u=i(40488),h=(i(66577),i(3172)),f=i(33955),d=i(11282),m=i(17452);async function p(e,t,i){const s="string"==typeof e?(0,m.mN)(e):e,n=t[0].spatialReference,r=(0,f.Ji)(t[0]),a={...i,query:{...s.query,f:"json",sr:n.wkid??JSON.stringify(n),geometries:JSON.stringify((l=t,{geometryType:(0,f.Ji)(l[0]),geometries:l.map((e=>e.toJSON()))}))}},{data:o}=await(0,h.Z)(s.path+"/simplify",a);var l;return function(e,t,i){const s=(0,f.q9)(t);return e.map((e=>{const t=s.fromJSON(e);return t.spatialReference=i,t}))}(o.geometries,r,n)}const g=r.Z.getLogger("esri.geometry.support.normalizeUtils");function y(e){return"polygon"===e[0].type}function x(e){return"polyline"===e[0].type}function w(e,t,i){if(t){const t=function(e,t){if(!(e instanceof o.Z||e instanceof a.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g.error(e),new n.Z(e)}const i=(0,l.x3)(e),s=[];for(const e of i){const i=[];s.push(i),i.push([e[0][0],e[0][1]]);for(let s=0;s<e.length-1;s++){const n=e[s][0],r=e[s][1],a=e[s+1][0],o=e[s+1][1],l=Math.sqrt((a-n)*(a-n)+(o-r)*(o-r)),c=(o-r)/l,u=(a-n)/l,h=l/t;if(h>1){for(let e=1;e<=h-1;e++){const s=e*t,a=u*s+n,o=c*s+r;i.push([a,o])}const e=(l+Math.floor(h-1)*t)/2,s=u*e+n,a=c*e+r;i.push([s,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new a.Z({rings:s,spatialReference:e.spatialReference}):new o.Z({paths:s,spatialReference:e.spatialReference})}(e,1e6);e=(0,u.Sx)(t,!0)}return i&&(e=(0,l.Sy)(e,i)),e}function _(e,t,i){if(Array.isArray(e)){const s=e[0];if(s>t){const i=(0,l.XZ)(s,t);e[0]=s+i*(-2*t)}else if(s<i){const t=(0,l.XZ)(s,i);e[0]=s+t*(-2*i)}}else{const s=e.x;if(s>t){const i=(0,l.XZ)(s,t);e=e.clone().offset(i*(-2*t),0)}else if(s<i){const t=(0,l.XZ)(s,i);e=e.clone().offset(t*(-2*i),0)}}return e}function b(e,t){let i=-1;for(let s=0;s<t.cutIndexes.length;s++){const n=t.cutIndexes[s],r=t.geometries[s],a=(0,l.x3)(r);for(let e=0;e<a.length;e++){const t=a[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const s=t[e][0];i=s>i?s:i}i=Number(i.toFixed(9));const s=-360*(0,l.XZ)(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(s,0))}return!0}}))}if(n===i){if(y(e))for(const t of(0,l.x3)(r))e[n]=e[n].addRing(t);else if(x(e))for(const t of(0,l.x3)(r))e[n]=e[n].addPath(t)}else i=n,e[n]=r}return e}async function I(e,t,i){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&g.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??s.default.geometryServiceUrl;let r,m,y,x,S,R,v,T,C=0;const k=[],F=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,m=(0,c.C5)(r),y=r.isWebMercator,R=y?102100:4326,x=l.UZ[R].maxX,S=l.UZ[R].minX,v=l.UZ[R].plus180Line,T=l.UZ[R].minus180Line),m)if("mesh"===t.type)F.push(t);else if("point"===t.type)F.push(_(t.clone(),x,S));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>_(e,x,S))),F.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,m);F.push(e.rings?new a.Z(e):e)}else if(t.extent){const e=t.extent,i=(0,l.XZ)(e.xmin,S)*(2*x);let s=0===i?t.clone():(0,l.Sy)(t.clone(),i);e.offset(i,0),e.intersects(v)&&e.xmax!==x?(C=e.xmax>C?e.xmax:C,s=w(s,y),k.push(s),F.push("cut")):e.intersects(T)&&e.xmin!==S?(C=e.xmax*(2*x)>C?e.xmax*(2*x):C,s=w(s,y,360),k.push(s),F.push("cut")):F.push(s)}else F.push(t.clone());else F.push(t);else F.push(t);let M=(0,l.XZ)(C,x),z=-90;const P=M,D=new o.Z;for(;M>0;){const e=360*M-180;D.addPath([[e,z],[e,-1*z]]),z*=-1,M--}if(k.length>0&&P>0){const t=b(k,await async function(e,t,i,s){const n=(0,d.en)(e),r=t[0].spatialReference,a={...s,query:{...n.query,f:"json",sr:JSON.stringify(r),target:JSON.stringify({geometryType:(0,f.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,h.Z)(n.path+"/cut",a),{cutIndexes:l,geometries:c=[]}=o.data;return{cutIndexes:l,geometries:c.map((e=>{const t=(0,f.im)(e);return t.spatialReference=r,t}))}}(n,k,D,i)),s=[],r=[];for(let i=0;i<F.length;i++){const n=F[i];if("cut"!==n)r.push(n);else{const n=t.shift(),a=e[i];null!=a&&"polygon"===a.type&&a.rings&&a.rings.length>1&&n.rings.length>=a.rings.length?(s.push(n),r.push("simplify")):r.push(y?(0,u.$)(n):n)}}if(!s.length)return r;const a=await p(n,s,i),o=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?o.push(t):o.push(y?(0,u.$)(a.shift()):a.shift())}return o}const O=[];for(let e=0;e<F.length;e++){const t=F[e];if("cut"!==t)O.push(t);else{const e=k.shift();O.push(!0===y?(0,u.$)(e):e)}}return O}},73913:(e,t,i)=>{i.d(t,{Sy:()=>l,UZ:()=>a,XZ:()=>o,x3:()=>c});var s=i(58901),n=i(82971),r=i(33955);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.Z.WebMercator}),minus180Line:new s.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.Z({paths:[[[180,-180],[180,180]]],spatialReference:n.Z.WGS84}),minus180Line:new s.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:n.Z.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=c(e);for(const e of i)for(const i of e)i[0]+=t;return e}function c(e){return(0,r.oU)(e)?e.rings:e.paths}},74878:(e,t,i)=>{i.r(t),i.d(t,{default:()=>ut});var s=i(43697),n=i(51773),r=i(20102),a=i(92604),o=i(16453),l=i(95330),c=i(17445),u=i(5600),h=i(75215),f=i(67676),d=i(80442),m=i(36030),p=i(52011),g=i(87085),y=i(17287),x=i(71612),w=i(17017),_=(i(66577),i(30030)),b=i(3172),I=i(71715),S=i(8744),R=i(66677),v=i(21506),T=i(35956),C=i(29876),k=i(45663),F=i(88281),M=i(11145),z=i(96674),P=i(609),D=i(39450),O=i(36679),Z=i(99815),N=i(73506),J=i(94139);const A=new Map,E=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const n=this._cachedBlocks,r=e+"/"+t;if(n.has(r)){const e=n.get(r);e.ts=Date.now(),e.refCount++}else n.set(r,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function B(e,t){return null==t?e:`${e}?sliceId=${t}`}function H(e,t,i){const s=A.get(e);if(!s)return null==t?E.decreaseRefCount(e,i):0;if(null==t||null==s[t])return E.decreaseRefCount(e,i);const n=s[t]?.cache,r=n?.get(i);if(n&&r){if(r.refCount--,0===r.refCount){n.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function L(e,t,i){const s=A.get(e);if(!s)return null==t?E.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return E.getBlock(e,i)}const n=s[t]?.cache.get(i);if(n)return n.refCount++,n.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const n=s[e]?.cache,r=n?.get(i);if(n&&r)return r.refCount++,n.set(i,r),r.block}return null}function W(e,t,i,s,n=null){const r=A.get(e);if(!r)return void(null==t&&E.putBlock(e,i,s,n));if(null==t||null==r[t])return void E.putBlock(e,i,s,n);const a={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:n};s.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),r[t]?.cache.set(i,a)}function q(e,t,i){const s=A.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):E.deleteBlock(e,i):null==t&&E.deleteBlock(e,i)}var j=i(81578),G=i(75993),U=i(55914),V=i(80676),$=i(6570);let Y=class extends((0,P.v)(z.wq)){constructor(){super(...arguments),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,N.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:M.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,N.ut)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),"Function"===this.datasetFormat&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}set url(e){this._set("url",(0,R.Nm)(e,a.Z.getLogger(this)))}async open(e){throw new r.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,i,s={}){const n=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,r=this.getTileExtentFromTileInfo(e,t,i,n);return this.fetchPixels(r,n.size[0],n.size[1],s)}async identify(e,t={}){e=(0,h.TJ)(J.Z,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:n}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:a}=n;let{transposedVariableName:o}=t;const l=null!=a&&r&&(null!=s||(0,Z.WU)(i));l&&!o&&(o=null!=i&&i.length>0?i[0].variableName??void 0:a.variables[0].name,t={...t,transposedVariableName:o}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=n,{datumTransformation:f}=t;let d=(0,N.nF)(e,c,f);if(!u.intersects(d))return{location:d,value:null};if(null!=n.transform){const e=n.transform.inverseTransform(d);if(!n.nativeExtent.intersects(e))return{location:e,value:null};d=e}let m=0;const p=null!=o&&null!=a&&n.hasMultidimensionalTranspose;if("Function"===this.datasetFormat){const e=this.primaryRasters.rasters[0];if(p)return e.identify(d,t);const{pixelSize:i}=n,s=3,r=i.x*s/2,a=i.y*s/2,o=new $.Z({xmin:d.x-r,xmax:d.x+r,ymin:d.y-a,ymax:d.y+a,spatialReference:c}),l={interpolation:"nearest"},{pixelBlock:u}=await e.fetchPixels(o,s,s,l),{pixelBlock:h}=await this.fetchPixels(o,s,s,l);if(null==u)return{location:d,value:null};const f=Math.floor(s*s*.5),m=!u.mask||u.mask[f]?u.pixels.map((e=>e[f])):null;let g;return null!=h&&(g=!h.mask||h.mask[f]?h.pixels.map((e=>e[f])):void 0),{location:d,value:m,processedValue:g,pyramidLevel:0}}if(!p)if(t.srcResolution)m=(0,N.kr)(t.srcResolution,n,this.ioConfig.sampling).pyramidLevel;else if(m=await this.computeBestPyramidLevelForLocation(e,t),null==m)return{location:d,value:null};const g=this.identifyPixelLocation(d,m,null,p);if(null===g)return{location:d,value:null};const{row:y,col:x,rowOffset:w,colOffset:_,blockWidth:b}=g,I=o??t.sliceId,S=B(this.url,I),R=`${m}/${y}/${x}`;let v=L(S,null,R);null==v&&(v=this.fetchRawTile(m,y,x,t),W(S,null,R,v));const T=await v;if(null==T||!T.pixels?.length)return{location:d,value:null};const C=w*b+_;return this._processIdentifyResult(T,{srcLocation:d,position:C,pyramidLevel:m,useTransposedTile:!!p,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,N.kZ)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:n}=this;if(s.requestRawData&&n)return this._fetchPixels(e,t,i,s);const r=(0,N.ut)(e.spatialReference),a=(0,N.Hq)(e);if(null==r||0===a||1===a&&this._isGlobalWrappableSource&&n)return this._fetchPixels(e,t,i,s);if(a>=3)return{extent:e,pixelBlock:null};const o=[],{xmin:l,xmax:c}=e,u=Math.round(r/(c-l)*t),h=u-Math.round((r/2-l)/(c-l)*t);let f=0;const d=[];for(let n=0;n<=a;n++){const m=new $.Z({xmin:0===n?l:-r/2,xmax:n===a?c-r*n:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),p=0===n?u-h:n===a?t-f:u;f+=p,d.push(p);const g=s.disableWrapAround&&n>0?null:this._fetchPixels(m,p,i,s);o.push(g)}const m=(await Promise.all(o)).map((e=>e?.pixelBlock));let p=null;const g={width:t,height:i};return p=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:g,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},s)).pixelBlock:(0,U.us)(m,g,{blockWidths:d}),{extent:e,srcExtent:(0,N.tB)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:p}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,i,s),{nativeExtent:r,nativePixelSize:a,storageInfo:o}=this.rasterInfo,l=2**e,c=a.x*l,u=a.y*l,h=new $.Z({xmin:r.xmin+c*t.x,xmax:r.xmin+c*(t.x+i.width-1),ymin:r.ymax-u*(t.y+i.height-1),ymax:r.ymax-u*t.y,spatialReference:r.spatialReference});if(!n)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:f,mosaicSize:d}=n;if(1===f.length&&null!=f[0]&&f[0].width===i.width&&f[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:n.pixelBlocks[0]};const m=e>0?o.pyramidBlockWidth:o.blockWidth,p=e>0?o.pyramidBlockHeight:o.blockHeight,g={x:t.x%m,y:t.y%p};let y;return y=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:f,srcMosaicSize:d,destDimension:i,clipOffset:g,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,U.us)(f,d,{clipOffset:g,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:y}}fetchRawTile(e,t,i,s){throw new r.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,N.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,G.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:n,query:r,headers:a}=t;i=i??t.retryCount??this.ioConfig.retryCount;const o=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await(0,b.Z)(e,{...t,query:{...r,...s},headers:{...a,...o}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,Z.gk)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const n=s.lodAt(e);return this.getTileExtent({x:n.resolution,y:n.resolution},t,i,s.origin,s.spatialReference,s.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo;if(!e.tileInfo){const n=[],r=e.maximumPyramidLevel||0;let a=Math.max(s.x,s.y),o=1/.0254*96*a;for(let e=0;e<=r;e++)n.push(new D.Z({level:r-e,resolution:a,scale:o})),a*=2,o*=2;const l=new J.Z({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new M.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:n,height:r,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new J.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(n,r))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],s);e.storageInfo=new O.Z({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,n,r=0,a=2){if(1===n.length&&r>0){n=[...n];let{x:e,y:t}=n[0];for(let i=0;i<r;i++)e*=a,t*=a,n.push({x:e,y:t})}const o=[],{x:l,y:c}=s;for(let s=0;s<n.length;s++){const{x:r,y:a}=n[s];o.push({minCol:Math.floor((e.xmin-l+.1*r)/t/r),maxCol:Math.floor((e.xmax-l-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*a)/i/a),maxRow:Math.floor((c-e.ymin-.1*a)/i/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const n=s**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,i,s){const{spatialReference:n,nativeExtent:r,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:o,origin:l,transposeInfo:c}=a,u=s&&null!=c?c.tileSize[0]:a.blockWidth,h=s&&null!=c?c.tileSize[1]:a.blockHeight,f=(0,N.nF)(e,n,i);if(!r.intersects(f))return null;if(t<0||t>o)return null;const d=this.getPyramidPixelSize(t),{x:m,y:p}=d,g=(l.y-f.y)/p/h,y=(f.x-l.x)/m/u,x=Math.min(h-1,Math.floor((g-Math.floor(g))*h)),w=Math.min(u-1,Math.floor((y-Math.floor(y))*u));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(y),rowOffset:x,colOffset:w,blockWidth:u,srcLocation:f}}getTileExtent(e,t,i,s,n,r){const[a,o]=r,l=s.x+i*a*e.x,c=l+a*e.x,u=s.y-t*o*e.y,h=u-o*e.y;return new $.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:n})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}async _fetchPixels(e,t,i,s={}){let n=(0,N.Hq)(e);if(n>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:a,srcResolution:o,srcExtent:l,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:l,pixelBlock:null};const{rasterInfo:f}=this,d=f.transform,m="gcs-shift"===d?.type,p=null!=(0,N.ut)(e.spatialReference);!m&&p||(n=(0,N.Hq)(r.srcExtent,m));const g=await this._fetchRawTiles(a,h,{width:c,height:u,wrapCount:n},s);if(!g)return{extent:e,srcExtent:l,pixelBlock:null};const y=f.storageInfo,x=a>0?y.pyramidBlockWidth:y.blockWidth,w=a>0?y.pyramidBlockHeight:y.blockHeight;let{x:_,y:b}=f.pixelSize;if(a>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=y;if(null!=e&&e[a-1])({x:_,y:b}=e[a-1]);else{const e=t**a;_*=e,b*=e}}const I=f.spatialReference,S=new J.Z({x:_,y:b,spatialReference:I}),R=x===c&&w===u&&h.x%x==0&&h.y%w==0,v=new J.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),T=!e.spatialReference.equals(I),C=I.isGeographic?1e-9:1e-4,{datumTransformation:k}=s;if(!T&&R&&1===g.pixelBlocks.length&&x===t&&w===i&&this._isSameResolution(o,v,C))return{extent:e,srcExtent:l,srcTilePixelSize:S,pixelBlock:g.pixelBlocks[0]};const F=p&&null!=(0,N.ut)(l.spatialReference)&&this._hasNoneOrGCSShiftTransform,M=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");M&&!this.rasterJobHandler&&await(0,N.zD)();const z=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:v.toJSON(),datumTransformation:k,rasterTransform:d,hasWrapAround:n>0||F,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:M},s):(0,N.Qp)({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:v,datumTransformation:k,rasterTransform:d,hasWrapAround:n>0||F,isAdaptive:!1,includeGCSGrid:M});let P;const D=!s.requestRawData,O={rows:z.spacing[0],cols:z.spacing[1]},Z=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(a,g.extent.xmin):void 0,{pixelBlocks:A,mosaicSize:E,isPartiallyFilled:B}=g;let H=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:A,srcMosaicSize:E,destDimension:D?{width:t,height:i}:null,coefs:D?z.coefficients:null,sampleSpacing:D?O:null,projectDirections:M,gcsGrid:M?z.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:Z,blockWidths:null},s);({pixelBlock:P,localNorthDirections:H}=e)}else{const e=(0,U.us)(A,E,{alignmentInfo:Z});P=D?(0,U.Uk)(e,{width:t,height:i},z.coefficients,O,s.interpolation):e,M&&z.gcsGrid&&(H=(0,U.Qh)({width:t,height:i},z.gcsGrid),P=(0,V.xQ)(P,this.rasterInfo.dataType,H))}return s.requestRawData||M?{extent:e,srcExtent:l,srcTilePixelSize:S,pixelBlock:P,transformGrid:z,localNorthDirections:H,isPartiallyFilled:B}:{extent:e,srcExtent:l,srcTilePixelSize:S,pixelBlock:P}}async _fetchRawTiles(e,t,i,s){const{origin:n,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:o}=this.getBlockWidthHeight(e);let{x:l,y:c}=t,{width:u,height:h,wrapCount:f}=i;const d=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(l-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,p=0,g=0;f&&null!=d&&(({worldColumnCountFromOrigin:p,originColumnOffset:g,rightPadding:m}=d),p*d.blockWidth-m>=l+u&&(m=0));const y=Math.floor(l/a),x=Math.floor(c/o),w=Math.floor((l+u+m-1)/a),_=Math.floor((c+h+m-1)/o),b=r[e];if(!b)return null;const{minRow:I,minCol:S,maxCol:R,maxRow:v}=b;if(0===f&&(_<I||w<S||x>v||y>R))return null;const T=new Array;let C=!1;const k=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=x;t<=_;t++)for(let i=y;i<=w;i++){let n=i;if(!s.disableWrapAround&&f&&null!=d&&p<=i&&(n=i-p-g),t>=I&&n>=S&&v>=t&&R>=n){const i=this._fetchRawTile(e,t,n,s);k?T.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{C=!0,e(null)}))}))):T.push(i)}else T.push(Promise.resolve(null))}if(0===T.length)return null;const F=await Promise.all(T),M={height:(_-x+1)*o,width:(w-y+1)*a},{spatialReference:z}=this.rasterInfo,P=this.getPyramidPixelSize(e),{x:D,y:O}=P;return{extent:new $.Z({xmin:n.x+y*a*D,xmax:n.x+(w+1)*a*D,ymin:n.y-(_+1)*o*O,ymax:n.y-x*o*O,spatialReference:z}),pixelBlocks:F,mosaicSize:M,isPartiallyFilled:C}}_isSameResolution(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}_fetchRawTile(e,t,i,s){const n=this.rasterInfo.storageInfo.blockBoundary[e];if(!n)return Promise.resolve(null);const{minRow:r,minCol:a,maxCol:o,maxRow:c}=n;if(t<r||i<a||t>c||i>o)return Promise.resolve(null);const u=B(this.url,s.sliceId),h=`${e}/${t}/${i}`;let f=L(u,s.registryId,h);if(null==f){const n=new AbortController;f=this.fetchRawTile(e,t,i,{...s,signal:n.signal}),W(u,s.registryId,h,f,n),f.catch((()=>q(u,s.registryId,h)))}return s.signal&&(0,l.fu)(s,(()=>{H(u,s.registryId,h)})),f}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const s=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[n,r]=e,a=[],o=[];for(let e=0;e<s;e++){const[t,i]=(0,V.Tg)([n[e],r[e]]);a.push(t),o.push(i)}return[a,o]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,N.P_)(this.rasterInfo)),null==this._rasterTileAlighmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const n={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(n.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,n));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=n,c=a/t,u=o/i,h=l<r&&c*u>=16,f=l===r&&this._requireTooManySrcTiles(a,o,t,i);if(h||f||0===a||0===o){const a=new J.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let o=(0,N.VO)(a,this.rasterInfo.spatialReference,e,n.datumTransformation);const f=!o||s.srcResolution&&o.x+o.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-l+3>=e){const t=2**e;o={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}o&&(n.srcResolution=o,this._updateSourceDataInfo(e,n))}return this._requireTooManySrcTiles(n.srcWidth,n.srcHeight,t,i)&&(n.srcWidth=0,n.srcHeight=0),n}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:n}=this.rasterInfo.storageInfo;return Math.ceil(e/n.size[0])*Math.ceil(t/n.size[1])>=256||e/i>8||t/s>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:n,datumTransformation:r}=t,{pyramidLevel:a,pyramidResolution:o,excessiveReading:l}=(0,N.kr)(n,i,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,N.tB)(e,s,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{x:h,y:f}=i.storageInfo.origin,d=Math.floor((c.xmin-h)/o.x+.1),m=Math.floor((f-c.ymax)/o.y+.1),p=Math.floor((c.xmax-h)/o.x-.1),g=Math.floor((f-c.ymin)/o.y-.1),y=c.width<.1*o.x?0:p-d+1,x=c.height<.1*o.y?0:g-m+1;t.pyramidLevel=a,t.pyramidResolution=o,t.srcWidth=y,t.srcHeight=x,t.ul={x:d,y:m}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:n,useTransposedTile:r}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:o}=this.rasterInfo;if(null==o||!r){const t=e.pixels.map((e=>e[s])),r={location:i,value:t,pyramidLevel:n},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(r.magdirValue=a.map((e=>e[0]))),r}let l=e.pixels.map((e=>e.slice(s*a,s*a+a))),c=this._computeMagDirValues(l);const{requestSomeSlices:u,identifyOptions:h}=t;let f=(0,Z.MO)(o,h.transposedVariableName);if(u){const e=(0,Z.Ur)(f,h.multidimensionalDefinition,h.timeExtent);l=l.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),f=e.map((e=>f[e]))}const d=e.noDataValues||this.rasterInfo.noDataValue,m={pixels:l,pixelType:e.pixelType};let p;return null!=d&&((0,j.A)(m,d),p=m.mask),{location:i,value:null,dataSeries:f.map(((e,t)=>{const i={value:0===p?.[t]?null:l.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new T.Z({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:n}}};(0,s._)([(0,u.Cb)()],Y.prototype,"_rasterTileAlighmentInfo",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],Y.prototype,"_isGlobalWrappableSource",null),(0,s._)([(0,u.Cb)({readOnly:!0})],Y.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s._)([(0,u.Cb)()],Y.prototype,"rasterJobHandler",null),(0,s._)([(0,u.Cb)(v.HQ)],Y.prototype,"url",null),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],Y.prototype,"datasetName",void 0),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],Y.prototype,"datasetFormat",void 0),(0,s._)([(0,u.Cb)()],Y.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s._)([(0,u.Cb)()],Y.prototype,"rasterInfo",void 0),(0,s._)([(0,u.Cb)()],Y.prototype,"ioConfig",void 0),(0,s._)([(0,u.Cb)()],Y.prototype,"sourceJSON",void 0),Y=(0,s._)([(0,p.j)("esri.layers.support.rasterDatasets.BaseRaster")],Y);const X=Y;var K=i(74889);let Q=class extends X{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null}async open(e){await this.init();const{rasterFunction:t}=this;this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((e=>e.rasterJobHandler=this.rasterJobHandler)));const{rasters:i,rasterIds:s}=this.primaryRasters,n=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(n);const a=i.map((({rasterInfo:e})=>e)),o=t.bind({rasterInfos:a,rasterIds:s});if(!o.success||0===a.length)throw new r.Z("raster-function:open",`cannot bind the function: ${o.error??""}`);const l="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===l?.functionName&&(t.rasterInfo.attributeTable=K.Z.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=a[0];this.hasUniqueSourceStorageInfo=1===a.length||a.slice(1).every((e=>this._hasSameStorageInfo(e,c))),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo)}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async fetchPixels(e,t,i,s={}){const{rasters:n,rasterIds:r}=this.primaryRasters;let a=!1;const{interpolation:o}=s,l=this.rasterFunction.flatWebGLFunctionChain?.hasSurfaceFunction;!s.requestRawData&&"bilinear"!==o&&l&&(a=1===n.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:a});const c=n.map((n=>n.fetchPixels(e,t,i,s))),u=await Promise.all(c),h=u.map((e=>e.pixelBlock)),f=a||s.requestRawData?u.map((e=>e.srcTilePixelSize)):null;if(s.skipRasterFunction||h.every((e=>null==e)))return u[0];const d=u.find((e=>null!=e.pixelBlock))?.extent??e,m=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:r}),{transformGrid:p}=u[0];if(!a||null==m||null==p)return{...u[0],pixelBlock:m};const g={rows:p.spacing[0],cols:p.spacing[1]};let y;return y=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[m],srcMosaicSize:{width:m.width,height:m.height},destDimension:{width:t,height:i},coefs:p.coefficients,sampleSpacing:g,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:o,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,U.Uk)(m,{width:t,height:i},p.coefficients,g,o),{extent:e,srcExtent:u[0].srcExtent,pixelBlock:y}}_hasSameStorageInfo(e,t){const{storageInfo:i,pixelSize:s,spatialReference:n,extent:r}=e,{storageInfo:a,pixelSize:o,spatialReference:l,extent:c}=t;return s.x===o.x&&s.y===o.y&&n.equals(l)&&r.equals(c)&&i.blockHeight===a.blockHeight&&i.blockWidth===a.blockWidth&&i.maximumPyramidLevel===a.maximumPyramidLevel}};(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],Q.prototype,"datasetFormat",void 0),(0,s._)([(0,u.Cb)()],Q.prototype,"tileType",void 0),(0,s._)([(0,u.Cb)()],Q.prototype,"rasterFunction",void 0),(0,s._)([(0,u.Cb)()],Q.prototype,"primaryRasters",void 0),Q=(0,s._)([(0,p.j)("esri.layers.support.rasterDatasets.FunctionRaster")],Q);const ee=Q;var te=i(67900),ie=i(5847);var se=i(5154),ne=i(15612),re=i(67058),ae=i(72758),oe=i(79681),le=i(23808),ce=i(82971);const ue=a.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),he=e=>{let t=class extends e{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalSubset=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster="Function"===e[0]?.raster?.datasetFormat}get fullExtent(){return this.rasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,R.Nm)(e,ue))}set renderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("renderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,_.ij)(s,i)||void 0}async convertVectorFieldData(e,t){if(null==e||!this.rasterInfo)return null;const i=this._rasterJobHandler.instance,s=this.rasterInfo.dataType;return i?i.convertVectorFieldData({pixelBlock:e,dataType:s},t):(0,V.KC)(e,s)}async computeStatisticsHistograms(e,t){e=(0,h.TJ)(oe.Z,e).clone();const{rasterInfo:s}=this,{geometry:n}=e;if(null==n)throw new r.Z("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let a=n;const{spatialReference:o}=s;n.spatialReference.equals(o)||(await(0,N.zD)(),a="extent"===n.type?(0,N.tB)(n,o):(0,N.Wt)(n,o));const l=e.pixelSize??new J.Z({x:s.pixelSize.x,y:s.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:f}=function(e,t,i,s=!0){const{spatialReference:n}=e,{x:r,y:a}=function(e,t){if(e.spatialReference.equals(t))return e;const i=(0,te.c9)(e.spatialReference),s=(0,te.c9)(t);if(i===s)return e;const n=i/s;return{x:e.x*n,y:e.y*n}}(i,n);let o,l,c;const u="extent"===t.type?t:t.extent;let{xmin:h,xmax:f,ymax:d,ymin:m}=u;const{xmin:p,ymax:g}=e.extent;return s?(h=p+(h>p?r*Math.round((h-p)/r):0),d=g-(d<g?a*Math.round((g-d)/a):0),f=p+(f>p?r*Math.round((f-p)/r):0),m=g-(m<g?a*Math.round((g-m)/a):0),o=new $.Z({xmin:h,ymax:d,xmax:f,ymin:m,spatialReference:n}),l=Math.round(o.width/r),c=Math.round(o.height/a)):(l=Math.floor((f-h)/r+.8),c=Math.floor((d-m)/a+.8),h=p+(h>p?r*Math.floor((h-p)/r+.1):0),d=g-(d<g?a*Math.floor((g-d)/a+.1):0),f=h+l*r,m=d-c*a,o=new $.Z({xmin:h,ymax:d,xmax:f,ymin:m,spatialReference:n})),{extent:o,width:l,height:c}}(s,a,l),d=await this.fetchPixels(c,u,f,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new r.Z("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const m=await async function(e,t,s){if("extent"===s.type)return function(e,t,i){const{width:s,height:n}=e,r=new Uint8Array(s*n),a=t.width/s,o=t.height/n;if(i.width/a<.5||i.height/o<.5)return new ie.Z({pixelType:e.pixelType,width:s,height:n,mask:r,pixels:[...e.pixels]});const{xmin:l,xmax:c,ymin:u,ymax:h}=t,{xmin:f,xmax:d,ymin:m,ymax:p}=i,g=Math.max(l,f),y=Math.min(c,d),x=Math.max(u,m),w=Math.min(h,p),_=.5*a,b=.5*o;if(y-g<_||w-x<b||y<l+_||g>c-_||x>h-b||w<u+b)return new ie.Z({pixelType:e.pixelType,width:s,height:n,mask:r,pixels:[...e.pixels]});const I=Math.max(0,(g-l)/a),S=Math.min(s,Math.max(0,(y-l)/a)),R=Math.max(0,(h-w)/o),v=Math.min(n,Math.max(0,(h-x)/o)),T=Math.round(I),C=Math.round(S)-1,k=Math.round(R),F=Math.round(v)-1;if(T===C&&I%1>.5&&S%1<.5||k===F&&R%1>.5&&v%1<.5)return new ie.Z({pixelType:e.pixelType,width:s,height:n,mask:r,pixels:[...e.pixels]});if(0===T&&0===k&&C===s&&F===n)return e;const M=e.mask;for(let e=k;e<=F;e++)for(let t=T;t<=C;t++){const i=e*s+t;r[i]=M?M[i]:255}return new ie.Z({pixelType:e.pixelType,width:s,height:n,mask:r,pixels:[...e.pixels]})}(e,t,s);const{width:n,height:r}=e,a=new Uint8Array(n*r),{contains:o,intersects:l}=await Promise.all([i.e(5837),i.e(1433)]).then(i.bind(i,61433));return l(t,s)?"polyline"===s.type?function(e,t,i){const{width:s,height:n}=e,r=new Uint8Array(s*n),a=t.width/s,o=t.height/n,{xmin:l,ymax:c}=t,{paths:u}=i,h=e.mask;for(let e=0;e<u.length;e++){const t=u[e];for(let e=0;e<t.length-1;e++){const[i,u]=t[e],[f,d]=t[e+1];let m=Math.floor((c-u)/o),p=Math.floor((c-d)/o);if(p<m){const e=m;m=p,p=e}m=Math.max(0,m),p=Math.min(n-1,p);const g=(f-i)/(d-u);for(let e=m;e<=p;e++){const t=e===m?Math.max(u,d):(n+1-e)*o,c=e===p?Math.min(u,d):t-o;let y=d===u?Math.floor((i-l)/a):Math.floor((g*(t-u)+i-l)/a),x=d===u?Math.floor((f-l)/a):Math.floor((g*(c-u)+i-l)/a);if(x<y){const e=y;y=x,x=e}const w=e*s;y=Math.max(0,y),x=Math.min(s-1,x);for(let e=w+y;e<=w+x;e++)r[e]=h?h[e]:255}}}return new ie.Z({pixelType:e.pixelType,width:s,height:n,mask:r,pixels:[...e.pixels]})}(e,t,s):o(s,t)?e:function(e,t,i){if(!e)return e;const{width:s,height:n}=e,r=t.width/s,a=t.height/n,{xmin:o,ymax:l}=t;let c;if("extent"===i.type){const e=(i.xmin-o)/r,t=(i.xmax-o)/r,s=(l-i.ymax)/a,n=(l-i.ymin)/a;c=[[[e,s],[e,n],[t,n],[t,s],[e,s]]]}else c=i.rings.map((e=>e.map((([e,t])=>[(e-o)/r,(l-t)/a]))));const u=document.createElement("canvas");u.width=s,u.height=n;const h=u.getContext("2d");h.fillStyle="#f00",c.forEach((e=>{h.beginPath(),h.moveTo(e[0][0],e[0][1]);for(let t=0;t<e.length;t++)h.lineTo(e[t][0],e[t][1]);h.closePath(),h.fill()}));const f=h.getImageData(0,0,s,n).data,d=e.mask,m=s*n,p=new Uint8Array(m);for(let e=0;e<m;e++)d&&!d[e]||(p[e]=f[4*e+3]>127?255:0);return new ie.Z({pixelType:e.pixelType,width:s,height:n,mask:p,maskIsAlpha:!1,pixels:[...e.pixels]})}(e,t,s):new ie.Z({pixelType:e.pixelType,width:n,height:r,mask:a,maskIsAlpha:!1,pixels:[...e.pixels]})}(d.pixelBlock,c,a),p=this._rasterJobHandler.instance;return p?p.computeStatisticsHistograms({pixelBlock:m},t):(0,ne.js)(m)}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,le.GE)(e.meshType,e.simulationSettings,e.flowData,null!=t.signal?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo??{};if(null==t)return e;let i=e.multidimensionalDefinition||this.multidimensionalDefinition;null!=i&&i.length||(i=(0,Z.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const s=e.timeExtent||this.timeExtent;if(null!=i&&null!=s&&(null!=s.start||null!=s.end)){i=i.map((e=>e.clone()));const n=t.variables.find((({name:e})=>e===i[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),r=i.find((({dimensionName:e})=>"StdTime"===e));if(!n||!r)return{...e,multidimensionalDefinition:null};const{start:a,end:o}=s,l=null==a?null:a.getTime(),c=null==o?null:o.getTime(),u=l??c,h=c??l;if(null!=n.values){const e=n.values.filter((e=>{if(Array.isArray(e)){if(u===h)return e[0]<=u&&e[1]>=u;const t=e[0]<=u&&e[1]>u||e[0]<h&&e[1]>=h,i=e[0]>=u&&e[1]<=h||e[0]<u&&e[1]>h;return t||i}return u===h?e===u:e>=u&&e<=h}));if(e.length){const t=e.sort(((e,t)=>{const i=Array.isArray(e)?e[0]:e,s=Array.isArray(e)?e[1]:e,n=Array.isArray(t)?t[0]:t,r=Array.isArray(t)?t[1]:t;return u===h?i-n:Math.abs(s-h)-Math.abs(r-h)}))[0];r.values=[t]}else i=null}else if(n.hasRegularIntervals&&n.extent){const[e,t]=n.extent;u>t||h<e?i=null:r.values=u===h?[u]:[Math.max(e,u),Math.min(t,h)]}}return null!=i&&(0,Z.nb)(i,this.multidimensionalSubset)?{...e,multidimensionalDefinition:null}:{...e,multidimensionalDefinition:i}}async updateRasterFunction(){if(!this.loaded||"imagery-tile"!==this.type||!this.rasterFunction&&!this._cachedRasterFunctionJson||JSON.stringify(this.rasterFunction)===JSON.stringify(this._cachedRasterFunctionJson))return;if(this._isConstructedFromFunctionRaster&&"Function"===this.raster.datasetFormat){const e=this.raster.rasterFunction.toJSON();return!this.rasterFunction&&e&&this._set("rasterFunction",k.Z.fromJSON(e)),void(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON())}let e,t=this.raster,i=!1;"Function"===t.datasetFormat?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const n=(0,se.Ue)(s.functionDefinition?.toJSON()??s.toJSON(),i),r=new ee({rasterFunction:n});r.rasterJobHandler=this._rasterJobHandler.instance,await r.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=r}else this.raster=t,this._cachedRasterFunctionJson=null,await t.when();if(this._cachedRendererJson=null,!i&&!s)return;const{bandIds:n}=this,{bandCount:r}=this.raster.rasterInfo,a=n?.length?n.some((e=>e>=r)):r>=3;n&&(a||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:e,symbolizer:t}=this;if(!e||!t||!this.renderer)return;const{rasterInfo:i}=this.raster,s=(0,Z.WY)(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,r=(0,re.ol)({...this.renderer.toJSON(),variableName:n});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(r))return;const a=this._rasterJobHandler.instance;a&&(t.rasterInfo=(0,re.FI)(i,n),t.rendererJSON=r,t.bind(),await a.updateSymbolizer(t),this._cachedRendererJson=r)}async applyRenderer(e,t){const i=e&&e.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;let s;await this.updateRenderer();const n=this._rasterJobHandler.instance,r=this.bandIds??[];return s=n?await n.symbolize({...e,simpleStretchParams:t,bandIds:r}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:r}),s}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,S.C5)(e);return M.Z.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(n(this),s.requestAsImageElement){const n=this.getTileUrl(e,t,i);return(0,b.Z)(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{rasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const n=s.tileInfo||r.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,i,n),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){return null!=this.rasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,s))}async identify(e,t={}){const{raster:i,rasterInfo:s}=this;if(null!=s.multidimensionalInfo&&!(s.hasMultidimensionalTranspose&&((0,Z.WU)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||null!=(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition))return{location:e,value:null};const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new r.Z("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return i.identify(e,t)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.rasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(e){const t=e??this.rasterInfo?.multidimensionalInfo;return(0,Z.jj)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,Z.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&"Function"===this.raster.datasetFormat&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new F.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((async()=>{n(this),this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,"Function"===this.raster.datasetFormat&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{})),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(null==this.interpolation){n(this);const{raster:e}=this,t=(0,re.In)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){n(this);const{rasterInfo:t}=this.raster;!this.bandIds&&t.bandCount>1&&(this.bandIds=(0,re.YD)(t));const i=(0,Z.WY)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name;if(!this.renderer||"override"===e){const e=(0,re.Ob)(t,{bandIds:this.bandIds,variableName:s}),i=t.statistics,n=i&&i.length>0?i[0]:null,r=n?.max??0,a=n?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===e.type&&(r>1e24||a<-1e24)&&(e.dynamicRangeAdjustment=!0,e.statistics=null,"none"===e.stretchType&&(e.stretchType="min-max")),this.renderer=e}const r=(0,re.ol)({...this.renderer.toJSON(),variableName:s}),a=(0,re.FI)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=a):this.symbolizer=new ae.Z({rendererJSON:r,rasterInfo:a});const o=this.symbolizer.bind();if(o.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,re.Ob)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.statistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else ue.warn("imagery-tile-mixin",o.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}};function n(e){if(!e.raster||!e.rasterInfo)throw new r.Z("imagery-tile","no raster")}return(0,s._)([(0,u.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"_cachedRasterFunctionJson",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"_compatibleFullExtent",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"bandIds",void 0),(0,s._)([(0,u.Cb)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,s._)([(0,u.Cb)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,s._)([(0,u.Cb)()],t.prototype,"interpolation",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"ioConfig",void 0),(0,s._)([(0,u.Cb)({type:[T.Z],json:{write:!0}})],t.prototype,"multidimensionalDefinition",null),(0,s._)([(0,u.Cb)({type:C.Z,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"raster",void 0),(0,s._)([(0,u.Cb)({type:k.Z,json:{name:"renderingRule",write:!0}})],t.prototype,"rasterFunction",null),(0,s._)([(0,u.Cb)()],t.prototype,"rasterInfo",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"sourceJSON",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,type:ce.Z,json:{read:!1}})],t.prototype,"spatialReference",void 0),(0,s._)([(0,u.Cb)({type:M.Z})],t.prototype,"tileInfo",void 0),(0,s._)([(0,u.Cb)(v.HQ)],t.prototype,"url",null),(0,s._)([(0,u.Cb)({types:_.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:_.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"renderer",null),(0,s._)([(0,I.r)("renderer")],t.prototype,"readRenderer",null),(0,s._)([(0,u.Cb)()],t.prototype,"symbolizer",void 0),t=(0,s._)([(0,p.j)("esri.layers.ImageryTileMixin")],t),t};var fe=i(38009),de=i(16859),me=i(34760),pe=i(72965),ge=i(28294),ye=i(1231),xe=i(69608),we=i(25972),_e=i(20095);function be(e){const t=e.fields,i=e.records,s=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",n=[{name:s,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),r=n.map((e=>e.name)),a=[];let o=0,l=0;return i.forEach((e=>{const t={};for(t[s]=o++,l=1;l<r.length;l++)t[r[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:n,features:a}}class Ie{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const s=t.getUint32(4,!0),n=t.getUint16(8,!0),r=t.getUint16(10,!0),a={version:i,recordCount:s,headerByteCount:n,recordByteCount:r};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,_e.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<s&&e.byteLength-o>r;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)i.push((0,_e.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const s=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(s.substring(0,4),10),parseInt(s.substring(4,6),10)-1,parseInt(s.substring(6,8),10)))}o+=t.length})),c.push(i)):o+=r}}return{header:a,fields:l,records:c,recordSet:be({fields:l,records:c})}}}var Se=i(87521);const Re=new Map;Re.set("int16","esriFieldTypeSmallInteger"),Re.set("int32","esriFieldTypeInteger"),Re.set("int64","esriFieldTypeInteger"),Re.set("float32","esriFieldTypeSingle"),Re.set("float64","esriFieldTypeDouble"),Re.set("text","esriFieldTypeString");let ve=class extends X{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e?.signal});if(!this._validateHeader(t))throw new r.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:i,rasterInfo:s}=this._parseHeader(t);if("thematic"===s.dataType){const e=await this._fetchAuxiliaryInformation();s.attributeTable=e}this._set("storageInfo",i),this._set("rasterInfo",s),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,i,s={}){const{transposeInfo:n}=this.rasterInfo.storageInfo,{transposedVariableName:r}=s,a=!(!n||!r),o=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const l=this._buildCacheFilePath(o,t,i,s.multidimensionalDefinition,r),c=this._getIndexRecordFromBundle(t,i,a),u=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:s.signal});if(!u)return null;const h=new Uint8Array(u.data),f=this._getTileEndAndContentType(h,c);if(0===f.recordSize)return null;const d=await this.request(l,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:s.signal});if(!d)return null;const[m,p]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:m,height:p,planes:null,pixelType:null,returnInterleaved:a})}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:i,colormap:s,blockWidth:n,blockHeight:r,firstPyramidLevel:a,maximumPyramidLevel:o}=e,l=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),c=e.histograms?.[0]?.counts?.length?e.histograms:null,u=e.extent.spatialReference,h=e.geodataXform?.spatialReference,f=new ce.Z(u?.wkid||u?.wkt?u:h);let d=new $.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const m=new J.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),p=Math.round((d.xmax-d.xmin)/m.x),g=Math.round((d.ymax-d.ymin)/m.y),y=this._parseTransform(e.geodataXform),x=y?d:null;y&&(d=y.forwardTransform(d),m.x=(d.xmax-d.xmin)/p,m.y=(d.ymax-d.ymin)/g);const w=e.properties??{},_=e.format.toLowerCase().replace("cache/",""),b=new J.Z(e.origin.x,e.origin.y,f);let I,S,R,v;if(s&&s.colors)for(I=[],S=0;S<s.colors.length;S++)R=s.colors[S],v=s.values?s.values[S]:S,I.push([v,255&R,R<<16>>>24,R<<8>>>24,R>>>24]);const T=e.LODInfos,C=[];for(S=0;S<T.levels.length;S++)C.push(new D.Z({level:T.levels[S],resolution:T.resolutions[S],scale:96/.0254*T.resolutions[S]}));const k=new M.Z({dpi:96,lods:C,format:_,origin:b,size:[n,r],spatialReference:f}),F={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},z=[{maxCol:Math.ceil(p/n)-1,maxRow:Math.ceil(g/r)-1,minCol:0,minRow:0}];let P=2;if(o>0)for(S=0;S<o;S++)z.push({maxCol:Math.ceil(p/P/n)-1,maxRow:Math.ceil(g/P/r)-1,minCol:0,minRow:0}),P*=2;const Z=e.mdInfo;let N=null;if(Z&&w._yxs){const e=w._yxs;N={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:F,rasterInfo:new we.Z({width:p,height:g,pixelType:t,bandCount:i,extent:d,nativeExtent:x,transform:y,spatialReference:f,pixelSize:m,keyProperties:w,statistics:l,histograms:c,multidimensionalInfo:Z,colormap:I,storageInfo:new O.Z({blockWidth:n,blockHeight:r,pyramidBlockWidth:n,pyramidBlockHeight:r,origin:b,tileInfo:k,transposeInfo:N,firstPyramidLevel:a,maximumPyramidLevel:o,blockBoundary:z})})}}_parseTransform(e){if(!(0,Se.j)(e))throw new r.Z("cloudraster:open","the data contains unsupported geodata transform types");const t=(0,Se.c)(e);if("identity"===t.type)return null;if("polynomial"!==t.type||!t.forwardCoefficients?.length||!t.inverseCoefficients?.length)throw new r.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return t}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),i=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),s=await Promise.all([t,i]);let n;if(s[0]){let e=s[0].fields;const t=s[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":Re.get(e.type),name:e.name,alias:e.alias||e.name})));const i=t.map((e=>({attributes:e})));e&&t&&(n={fields:e,features:i})}}return!n&&s[1]&&(n=Ie.parse(s[1]).recordSet),K.Z.fromJSON(n)}_buildCacheFilePath(e,t,i,s,n){const r=this._getPackageSize(!!n),a=Math.floor(t/r)*r,o=Math.floor(i/r)*r,l="R"+this._toHexString4(a)+"C"+this._toHexString4(o);let c="L";c+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,h=s?.[0];if(null==u||!h)return`${this.url}/_alllayers/${c}/${l}.bundle`;let f="_yxs";if(!n){f=u.variables.find((e=>e.name===h.variableName)).dimensions[0].values.indexOf(h.values[0]).toString(16);const e=4-f.length;for(let t=0;t<e;t++)f="0"+f;f="S"+f}const d=this._getVariableFolderName(n||h.variableName);return`${this.url}/_alllayers/${d}/${f}/${c}/${l}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&null!=t?t.packetSize??0:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:i}=t;return e&&null!=i?i.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replaceAll(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,i=!1){const s=this._getPackageSize(i),n=s*(e%s)+t%s;if(n<0)throw new Error("Invalid level / row / col");return 20+n*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const i=e.subarray(t,t+8);let s,n=0;for(s=0;s<5;s++)n|=(255&i[s])<<8*s;const r=0xffffffffff&n;for(n=0,s=5;s<8;s++)n|=(255&i[s])<<8*(s-5);return{position:r,recordSize:0xffffffffff&n}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,s._)([(0,u.Cb)({readOnly:!0})],ve.prototype,"storageInfo",void 0),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],ve.prototype,"datasetFormat",void 0),ve=(0,s._)([(0,p.j)("esri.layers.support.rasterDatasets.CloudRaster")],ve);const Te=ve;let Ce=class extends X{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){await this.init();const t=this.data,{pixelBlock:i,statistics:s,histograms:n,name:r,keyProperties:a,nativeExtent:o,transform:l}=this.data,{width:c,height:u,pixelType:h}=i,f=t.extent??new $.Z({xmin:-.5,ymin:.5,xmax:c-.5,ymax:u-.5,spatialReference:new ce.Z({wkid:3857})}),d=t.isPseudoSpatialReference??!t.extent,m={x:f.width/c,y:f.height/u},p=new we.Z({width:c,height:u,pixelType:h,extent:f,nativeExtent:o,transform:l,pixelSize:m,spatialReference:f.spatialReference,bandCount:i.pixels.length,keyProperties:a||{},statistics:s,isPseudoSpatialReference:d,histograms:n});this.createRemoteDatasetStorageInfo(p,512,512),this._set("rasterInfo",p),this.updateTileInfo(),await this._buildInMemoryRaster(i,{width:512,height:512},e),this.datasetName=r,this.url="/InMemory/"+r}fetchRawTile(e,t,i,s={}){const n=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(n)}async _buildInMemoryRaster(e,t,i){const s=this.rasterInfo.storageInfo.maximumPyramidLevel,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:s},i):Promise.resolve((0,U.Vl)(e,t,s)),a=null!=this.rasterInfo.statistics,o=null!=this.rasterInfo.histograms,c=a?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,ne.Hv)(e)),u=await(0,l.as)([n,c]);if(!u[0].value&&u[1].value)throw new r.Z("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,a||(this.rasterInfo.statistics=u[1].value?.statistics),o||(this.rasterInfo.histograms=u[1].value?.histograms)}};(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],Ce.prototype,"datasetFormat",void 0),(0,s._)([(0,u.Cb)()],Ce.prototype,"data",void 0),Ce=(0,s._)([(0,p.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],Ce);const ke=Ce;function Fe(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const s=[];if(t){const n=Fe(e,i);for(let e=0;e<n.length;e++)Fe(n[e],t).forEach((e=>s.push(e)));return s}const n=e.getElementsByTagNameNS("*",i);if(!n||0===n.length)return[];for(let e=0;e<n.length;e++)s.push(n[e]||n.item(e));return s}function Me(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const s=Fe(e,i);return s.length>0?t?Me(s[0],t):s[0]:null}function ze(e,t=null){const i=t?Me(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function Pe(e,t){return function(e,t){const i=Fe(e,t),s=[];let n;for(let e=0;e<i.length;e++)n=i[e].textContent||i[e].nodeValue,n&&(n=n.trim(),""!==n&&s.push(n));return s}(e,t).map((e=>Number(e)))}function De(e,t){const i=ze(e,t);return Number(i)}function Oe(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}var Ze=i(87390);function Ne(e,t){if(!e||!t)return null;const i=[];for(let s=0;s<e.length;s++)i.push(e[s]),i.push(t[s]);return i}function Je(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new ce.Z({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const i=e.indexOf("VERTCS"),s=e.indexOf("PROJCS"),n=s>-1?s:e.indexOf("GEOGCS");if(-1===n)return null;const r=e.slice(n,e.lastIndexOf("]",i)+1).trim(),a=e.slice(i,e.lastIndexOf("]")).trim();t=Ae(r);const o=new ce.Z(t?{wkid:t}:{wkt:r}),l=Ae(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=Ae(e),new ce.Z(0!==t?{wkid:t}:{wkt:e})):null}function Ae(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map((e=>e.trim())).filter((e=>""!==e)),i=t[t.length-1].split(","),s=i[0]?.toLowerCase();if(("epsg"===s||"esri"===s)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Ee(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(Oe(e,"SRS")){if(!t.spatialReference){const i=ze(e);t.spatialReference=Je(i)}}else if(Oe(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:s}=function(e){const t=Me(e,"GeodataXform"),i=Je(De(t,"SpatialReference/WKID")||ze(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const s=De(t,"PolynomialOrder")??1,n=Pe(t,"CoeffX/Double"),r=Pe(t,"CoeffY/Double"),a=Pe(t,"InverseCoeffX/Double"),o=Pe(t,"InverseCoeffY/Double"),l=Ne(n,r),c=Ne(a,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new Ze.Z({spatialReference:i,polynomialOrder:s,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=s,t.spatialReference||(t.spatialReference=i)}else Fe(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=ze(e)));else if(Oe(e,"PAMRasterBand")){const i=function(e){const t=De(e,"NoDataValue"),i=Me(e,"Histograms/HistItem"),s=De(i,"HistMin"),n=De(i,"HistMax"),r=De(i,"BucketCount"),a=ze(i,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;Fe(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}}));const h=De(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=s&&null!=n?{min:s,max:n,size:r||a.length,counts:a}:null,sourceBandIndex:h,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}}));const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map((e=>e.statistics)).filter(f.pC):null;const s=!!i[0].histogram;t.histograms=s?i.map((e=>e.histogram)).filter(f.pC):null}return t}let Be=class extends X{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:i,statistics:s,histograms:n,transform:r}=await this._fetchAuxiliaryData(e);const a=!i;a&&(i=new ce.Z({wkid:3857})),n?.length&&null==s&&(s=(0,ne.Oh)(n));const{width:o,height:l}=t;let c=new $.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=r?r.forwardTransform(c):c;let h=!0;if(r){const e=r.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(r=null,c=u)}const f=new ke({data:{extent:u,nativeExtent:c,transform:r,pixelBlock:t,statistics:s,histograms:n,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),f.data=null,this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,G.y)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new r.Z("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const s=i.toLowerCase(),n="gif"===s||"bmp"===s||!(0,d.Z)("ios"),a=await this.decodePixelBlock(t,{format:s,useCanvas:n,hasNoZlibMask:!0});if(null==a)throw new r.Z("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(e){const t=e?.signal,i=this.ioConfig.skipExtensions??[],s=i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),n=this.datasetFormat,r="JPG"===n?"jgw":"PNG"===n?"pgw":"BMP"===n?"bpw":null,a=r&&i.includes(r)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+r,{responseType:"text",signal:t}),o=await(0,l.as)([s,a]);if(t?.aborted)throw(0,l.zE)();const c=Ee(o[0].value?.data);if(!c.transform){const e=o[1].value?o[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;c.transform=6===e?.length?new Ze.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return c}};(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],Be.prototype,"datasetFormat",void 0),Be=(0,s._)([(0,p.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],Be);const He=Be;var Le=i(70586),We=i(17452),qe=i(28589),je=i(29680),Ge=i(26059);let Ue=class extends X{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(e){await this.init();const t=e&&e.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const s=i.data;if(this.sourceJSON=s,!s)throw new r.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!s.tileInfo)throw new r.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=s.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(s.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===s.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=s.name?.slice(s.name.indexOf("/")+1)??"";const n=await this._fetchRasterInfo({signal:t});if(null==n)throw new r.Z("image-server-raster:open","cannot initialize image service");const a="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:i,maxScale:s,minLOD:n,maxLOD:r}=t;if(null!=n&&null!=r)return M.Z.fromJSON({...e,lods:e.lods.filter((({level:e})=>null!=e&&e>=n&&e<=r))});if(0!==i&&0!==s){const t=e=>Math.round(1e4*e)/1e4,n=i?t(i):1/0,r=s?t(s):-1/0;return M.Z.fromJSON({...e,lods:e.lods.filter((e=>{const i=t(e.scale);return i<=n&&i>=r}))})}return M.Z.fromJSON(e)}(s.tileInfo,s):M.Z.fromJSON(s.tileInfo);(0,Le.O3)(a);const[o,l]=this._computeMinMaxLOD(n,a),{extent:c,pixelSize:u}=n,h=.5/n.width*u.x,f=Math.max(u.x,u.y),{lods:d}=a;("Map"!==this.tileType&&0!==s.maxScale||Math.abs(u.x-u.y)>h||!d.some((e=>Math.abs(e.resolution-f)<h)))&&(u.x=u.y=o.resolution,n.width=Math.ceil((c.xmax-c.xmin)/u.x-.1),n.height=Math.ceil((c.ymax-c.ymin)/u.y-.1));const m=o.level-l.level,[p,g]=a.size,y=[],x=[];d.forEach(((e,t)=>{e.level>=l.level&&e.level<=o.level&&y.push({x:e.resolution,y:e.resolution}),t<d.length-1&&x.push(Math.round(10*e.resolution/d[t+1].resolution)/10)})),y.sort(((e,t)=>e.x-t.x));const w=this.computeBlockBoundary(c,p,g,a.origin,y,m),_=y.length>1?y.slice(1):null;let b;s.transposeInfo&&(b={tileSize:[s.transposeInfo.rows,s.transposeInfo.cols],packetSize:n.keyProperties?._yxs.PacketSize??0});const I=x.length<=1||x.length>=3&&x.slice(0,-1).every((e=>e===x[0]))?x[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/m))/10;if(n.storageInfo=new O.Z({blockWidth:a.size[0],blockHeight:a.size[1],pyramidBlockWidth:a.size[0],pyramidBlockHeight:a.size[1],pyramidResolutions:_,pyramidScalingFactor:I,compression:a.format,origin:a.origin,firstPyramidLevel:1,maximumPyramidLevel:m,tileInfo:a,transposeInfo:b,blockBoundary:w}),this._fixGCSShift(n),this._set("rasterInfo",n),s.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:n.storageInfo.tileInfo,parsedUrl:(0,We.mN)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new qe.y({layer:e})}}async fetchRawTile(e,t,i,s={}){const{storageInfo:n,extent:r}=this.rasterInfo,{transposeInfo:a}=n,o=null!=a&&!!s.transposedVariableName;if(this._slices&&!o&&null==s.sliceId)return null;const l=o?0:n.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${i}`,u=this._slices?o?{variable:s.transposedVariableName}:{sliceId:s.sliceId||0}:null,{data:h}=await this.request(c,{query:u,responseType:"array-buffer",signal:s.signal});if(!h)return null;const f=o?a.tileSize:n.tileInfo.size,d=await this.decodePixelBlock(h,{width:f[0],height:f[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const m=n.blockBoundary[e];if("jpg"!==n.compression||i>m.minCol&&i<m.maxCol&&t>m.minRow&&t<m.maxRow)return d;const{origin:p,blockWidth:g,blockHeight:y}=n,{x,y:w}=this.getPyramidPixelSize(e),_=Math.round((r.xmin-p.x)/x)%g,b=Math.round((r.xmax-p.x)/x)%g||g,I=Math.round((p.y-r.ymax)/w)%y,S=Math.round((p.y-r.ymin)/w)%y||y,R=i===m.minCol?_:0,v=t===m.minRow?I:0,T=i===m.maxCol?b:g,C=t===m.maxRow?S:y;return(0,U.pW)(d,{x:R,y:v},{width:T-R,height:C-v}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some((e=>{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),n=await Promise.all([i,s]);return n[0]&&n[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),n[1]?.[0]?.counts?.length||(n[1]=null),{statistics:n[0]||null,histograms:n[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let s=0;const{maximumPyramidLevel:n}=this.rasterInfo.storageInfo;let r=n-s+this._levelOffset;const a=i.srcLocation;for(;r>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(r,i.row,i.col,t))break}catch{}if(r--,s++,i=this.identifyPixelLocation(a,s,t.datumTransformation),null===i)return null}return-1===r||null==i?null:s}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),s=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),n=ce.Z.fromJSON(t.spatialReference||e.spatialReference),r=new J.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:n});return new we.Z({width:i,height:s,bandCount:3,extent:$.Z.fromJSON(e),spatialReference:n,pixelSize:r,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,s=(0,Ge.g)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),n=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,r=await Promise.all([s,n]);return this._slices=r[1],r[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new je.Z,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,s=.5/e.width*i.x,{lods:n}=t,r=t.lodAt(Math.max.apply(null,n.map((e=>e.level)))),a=t.lodAt(Math.min.apply(null,n.map((e=>e.level)))),{tileType:o}=this;if("Map"===o)return this._levelOffset=n[0].level,[r,a];if("Raster"===o)return[n.find((e=>e.resolution===i.x))??r,a];const{minScale:l,maxScale:c}=this.sourceJSON;let u=r;c>0&&(u=n.find((e=>Math.abs(e.scale-c)<s)),u||(u=n.filter((e=>e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??r));let h=a;return l>0&&(h=n.find((e=>Math.abs(e.scale-l)<s))??a,this._levelOffset=h.level-a.level),[u,h]}};(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],Ue.prototype,"datasetFormat",void 0),(0,s._)([(0,u.Cb)()],Ue.prototype,"tileType",void 0),Ue=(0,s._)([(0,p.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],Ue);const Ve=Ue;var $e=i(48279);const Ye=new Map;Ye.set("Int8","s8"),Ye.set("UInt8","u8"),Ye.set("Int16","s16"),Ye.set("UInt16","u16"),Ye.set("Int32","s32"),Ye.set("UInt32","u32"),Ye.set("Float32","f32"),Ye.set("Float64","f32"),Ye.set("Double64","f32");const Xe=new Map;Xe.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Xe.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Xe.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Xe.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let Ke=class extends X{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:s,files:n}=this._parseHeader(i.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const t=await this._fetchAuxiliaryData(e);null!=t&&(s.statistics=t.statistics??s.statistics,s.histograms=t.histograms,t.histograms&&null==s.statistics&&(s.statistics=(0,ne.Oh)(t.histograms)))}this._set("rasterInfo",s),this._files=n;const r=await this.request(n.index,{responseType:"array-buffer",signal:t});this._storageIndex=this._parseIndex(r.data);const{blockWidth:a,blockHeight:o}=this.rasterInfo.storageInfo,l=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:c,height:u}=this.rasterInfo,h=[],f=this._getBandSegmentCount();let d=0,m=-1;for(;d<this._storageIndex.length;){m++;const e=Math.ceil(c/a/l**m)-1,t=Math.ceil(u/o/l**m)-1;d+=(e+1)*(t+1)*f*4,h.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=h,m>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=m),this.updateTileInfo()}async fetchRawTile(e,t,i,s={}){const{blockWidth:n,blockHeight:r,blockBoundary:a}=this.rasterInfo.storageInfo,o=a[e];if(!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:h,actualTileHeight:f}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(0===u[0].from&&0===u[0].to){const e=new Uint8Array(n*r);return new ie.Z({width:n,height:r,pixels:null,mask:e,validPixelCount:0})}const{bandIds:d}=this.ioConfig,m=this._getBandSegmentCount(),p=[];let g=0;for(g=0;g<m;g++)d&&!d.includes(g)||p.push(this.request(this._files.data,{range:{from:u[g].from,to:u[g].to},responseType:"array-buffer",signal:s.signal}));const y=await Promise.all(p),x=y.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),w=new Uint8Array(x);let _=0;for(g=0;g<m;g++)w.set(new Uint8Array(y[g].data),_),_+=y[g].data.byteLength;const b=Xe.get(this.rasterInfo.storageInfo.compression).decoderFormat,I=await this.decodePixelBlock(w.buffer,{width:n,height:r,format:b,planes:d?.length||l,pixelType:c});if(null==I)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==b&&!I.mask&&(S=S[0],null!=S)){const e=I.width*I.height,t=new Uint8Array(e);if(Math.abs(S)>1e24)for(g=0;g<e;g++)Math.abs((I.pixels[0][g]-S)/S)>1e-6&&(t[g]=1);else for(g=0;g<e;g++)I.pixels[0][g]!==S&&(t[g]=1);I.mask=t}let R=0,v=0;if(h!==n||f!==r){let e=I.mask;if(e)for(g=0;g<r;g++)if(v=g*n,g<f)for(R=h;R<n;R++)e[v+R]=0;else for(R=0;R<n;R++)e[v+R]=0;else for(e=new Uint8Array(n*r),I.mask=e,g=0;g<f;g++)for(v=g*n,R=0;R<h;R++)e[v+R]=1}return I}_parseIndex(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,i,s,n,r,a;if($e.f){for(i=new Uint8Array(e),n=new ArrayBuffer(e.byteLength),s=new Uint8Array(n),r=0;r<e.byteLength/4;r++)for(a=0;a<4;a++)s[4*r+a]=i[4*r+3-a];t=new Uint32Array(n)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Xe.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:s,blockHeight:n,pyramidScalingFactor:r}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,f=0,d=0;for(h=0;h<e;h++)d=r**h,c=Math.ceil(a/s/d),u=Math.ceil(o/n/d),f+=c*u;d=r**e,c=Math.ceil(a/s/d),u=Math.ceil(o/n/d),f+=t*c+i,f*=4*l;const m=this._storageIndex.subarray(f,f+4*l);let p=0,g=0;const y=[];for(let e=0;e<l;e++)p=m[4*e]*2**32+m[4*e+1],g=p+m[4*e+2]*2**32+m[4*e+3],y.push({from:p,to:g});return{ranges:y,actualTileWidth:i<c-1?s:Math.ceil(a/d)-s*(c-1),actualTileHeight:t<u-1?n:Math.ceil(o/d)-n*(u-1)}}_parseHeader(e){const t=Me(e,"MRF_META/Raster");if(!t)throw new r.Z("mrf:open","not a valid MRF format");const i=Me(t,"Size"),s=parseInt(i.getAttribute("x"),10),n=parseInt(i.getAttribute("y"),10),a=parseInt(i.getAttribute("c"),10),o=(ze(t,"Compression")||"none").toLowerCase();if(!Xe.has(o))throw new r.Z("mrf:open","currently does not support compression "+o);const l=ze(t,"DataType")||"UInt8",c=Ye.get(l);if(null==c)throw new r.Z("mrf:open","currently does not support pixel type "+l);const u=Me(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),f=parseInt(u.getAttribute("y"),10),d=Me(t,"DataValues");let m,p;if(d&&(p=d.getAttribute("NoData"),null!=p&&(m=p.trim().split(" ").map((e=>parseFloat(e))))),Me(e,"MRF_META/CachedSource"))throw new r.Z("mrf:open","currently does not support MRF referencing other data files");const g=Me(e,"MRF_META/GeoTags"),y=Me(g,"BoundingBox");let x,w=!1;if(null!=y){const e=parseFloat(y.getAttribute("minx")),t=parseFloat(y.getAttribute("miny")),i=parseFloat(y.getAttribute("maxx")),s=parseFloat(y.getAttribute("maxy")),n=ze(g,"Projection")||"";let r=ce.Z.WGS84;if("LOCAL_CS[]"!==n)if(n.toLowerCase().startsWith("epsg:")){const e=Number(n.slice(5));isNaN(e)||0===e||(r=new ce.Z({wkid:e}))}else r=Je(n)??ce.Z.WGS84;else w=!0,r=new ce.Z({wkid:3857});x=new $.Z(e,t,i,s),x.spatialReference=r}else w=!0,x=new $.Z({xmin:-.5,ymin:.5-n,xmax:s-.5,ymax:.5,spatialReference:new ce.Z({wkid:3857})});const _=Me(e,"MRF_META/Rsets"),b=parseInt(_&&_.getAttribute("scale")||"2",10),I=x.spatialReference,S=new O.Z({origin:new J.Z({x:x.xmin,y:x.ymax,spatialReference:I}),blockWidth:h,blockHeight:f,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:o,pyramidScalingFactor:b}),R=new J.Z({x:x.width/s,y:x.height/n,spatialReference:I}),v=new we.Z({width:s,height:n,extent:x,isPseudoSpatialReference:w,spatialReference:I,bandCount:a,pixelType:c,pixelSize:R,noDataValue:m,storageInfo:S}),T=ze(e,"datafile"),C=ze(e,"IndexFile");return{rasterInfo:v,files:{mrf:this.url,index:C||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",Xe.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Ee(t)}catch{return null}}};(0,s._)([(0,u.Cb)()],Ke.prototype,"_files",void 0),(0,s._)([(0,u.Cb)()],Ke.prototype,"_storageIndex",void 0),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],Ke.prototype,"datasetFormat",void 0),Ke=(0,s._)([(0,p.j)("esri.layers.support.rasterIO.MRFRaster")],Ke);const Qe=Ke;var et=i(94793),tt=i(9832);const it=(e,t)=>e.get(t)?.values,st=(e,t)=>e.get(t)?.values?.[0];let nt=class extends X{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new r.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:s,firstIFDPos:n,isBigTiff:o}=(0,et.cK)(i),l=[];await this._readIFDs(l,i,s,n,0,o?8:4,t);const{imageInfo:c,rasterInfo:u}=this._parseIFDs(l),h=(0,et.ee)(l),f=(0,et.I7)(l);if(this._headerInfo={littleEndian:s,isBigTiff:o,ifds:l,pyramidIFDs:h,maskIFDs:f,...c},this._set("rasterInfo",u),!c.isSupported)throw new r.Z("tiffraster:open","this tiff is not supported: "+c.message);if(!c.tileWidth)throw new r.Z("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");u.isPseudoSpatialReference&&a.Z.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const d=l[0].get("PREDICTOR")?.values?.[0],m=l[0].get("SAMPLEFORMAT")?.values?.[0];if(3===m&&2===d)throw new r.Z("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floatting point data");const{skipExtensions:p=[]}=this.ioConfig;if(!p.includes("aux.xml")){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&this._processPAMInfo(t,u)}p.includes("vat.dbf")||1!==u.bandCount||"u8"!==u.pixelType||(u.attributeTable=await this._fetchAuxiliaryTable(e),null!=u.attributeTable&&(u.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(e,t,i,s={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const n=await this._fetchRawTiffTile(e,t,i,!1,s);if(null!=n&&this._headerInfo.hasMaskBand){const r=await this._fetchRawTiffTile(e,t,i,!0,s);null!=r&&r.pixels[0]instanceof Uint8Array&&(n.mask=r.pixels[0])}return n}_parseIFDs(e){const t=(0,et.FI)(e),{width:i,height:s,tileWidth:n,tileHeight:r,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:h,pyramidBlockHeight:f,tileBoundary:d,affine:m,metadata:p}=t;let g=Je(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),y=!!t.isPseudoGeographic;null==g&&(y=!0,g=new ce.Z({wkid:3857}));const x=new $.Z({...t.extent,spatialReference:g}),w=new J.Z(x?{x:x.xmin,y:x.ymax,spatialReference:g}:{x:0,y:0}),_=new O.Z({blockWidth:n,blockHeight:r,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:l,origin:w,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:d}),b=new J.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/s,spatialReference:g}),I=p?{BandProperties:p.bandProperties,DataType:p.dataType}:{};let S=null;const R=st(e[0],"PHOTOMETRICINTERPRETATION"),v=it(e[0],"COLORMAP");if(R<=3&&v?.length>3&&v.length%3==0){S=[];const e=v.length/3;for(let t=0;t<e;t++)S.push([t,v[t]>>>8,v[t+e]>>>8,v[t+2*e]>>>8])}const T=new we.Z({width:i,height:s,bandCount:a,pixelType:o,pixelSize:b,storageInfo:_,spatialReference:g,isPseudoSpatialReference:y,keyProperties:I,extent:x,colormap:S,statistics:p?p.statistics:null});return m?.length&&(T.nativeExtent=new $.Z({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:g}),T.transform=new Ze.Z({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),T.extent=T.transform.forwardTransform(T.nativeExtent),T.pixelSize=new J.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/s,spatialReference:g}),_.origin.x=-.5,_.origin.y=.5),{imageInfo:t,rasterInfo:T}}_processPAMInfo(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,ne.Oh)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new J.Z({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}async _readIFDs(e,t,i,s,n,r=4,a){if(!s)return null;(s>=t.byteLength||s<0)&&(t=(await this.request(this.url,{range:{from:s+n,to:s+n+this._bufferSize},responseType:"array-buffer",signal:a})).data,n=s+n,s=0);const o=await this._readIFD(t,i,s,n,tt.Z.TIFF_TAGS,r,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,i,o.nextIFD-n,n,r,a)}async _readIFD(e,t,i,s,n=tt.Z.TIFF_TAGS,r=4,a){if(!e)return null;const o=(0,et.vr)(e,t,i,s,n,r);if(o.success){const i=[];if(o.ifd?.forEach((e=>{e.values||i.push(e)})),i.length>0){const n=i.map((e=>e.offlineOffsetSize)).filter(f.pC),r=Math.min.apply(null,n.map((e=>e[0])));if(Math.min.apply(null,n.map((e=>e[0]+e[1])))-r<=this._bufferSize){const{data:n}=await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:"array-buffer",signal:a});e=n,s=r,i.forEach((i=>(0,et.Dq)(e,t,i,s)))}}if(o.ifd?.has("GEOKEYDIRECTORY")){const i=o.ifd.get("GEOKEYDIRECTORY"),n=i?.values;if(n&&n.length>4){const r=n[0]+"."+n[1]+"."+n[2],o=await this._readIFD(e,t,i.valueOffset+6-s,s,tt.Z.GEO_KEYS,2,a);i.data=o.ifd,i.data&&i.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const i=await this.request(this.url,{range:{from:s,to:s+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=i.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,s,tt.Z.TIFF_TAGS,4,a)}}async _fetchRawTiffTile(e,t,i,s,n={}){const r=this._getTileLocation(e,t,i,s);if(!r)return null;const{ranges:a,actualTileWidth:o,actualTileHeight:l,ifd:c}=r,u=a.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:n.signal}))),h=await Promise.all(u),f=h.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),d=1===h.length?h[0].data:new ArrayBuffer(f),m=[0],p=[0];if(h.length>1){const e=new Uint8Array(d);for(let t=0,i=0;t<h.length;t++){const s=h[t].data;e.set(new Uint8Array(s),i),m[t]=i,i+=s.byteLength,p[t]=s.byteLength}}const{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(d,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:m,sizes:p},width:g,height:y,planes:null,pixelType:null});if(null==x)return null;let w,_,b;if(o!==g||l!==y){let e=x.mask;if(e)for(w=0;w<y;w++)if(b=w*g,w<l)for(_=o;_<g;_++)e[b+_]=0;else for(_=0;_<g;_++)e[b+_]=0;else for(e=new Uint8Array(g*y),x.mask=e,w=0;w<l;w++)for(b=w*g,_=0;_<o;_++)e[b+_]=1}return x}_getTileLocation(e,t,i,s=!1){const{firstPyramidLevel:n,blockBoundary:r}=this.rasterInfo.storageInfo,a=0===e?0:e-(n-1),{_headerInfo:o}=this;if(!o)return null;const l=s?o.maskIFDs[a]:0===a?o?.ifds[0]:o?.pyramidIFDs[a-1];if(!l)return null;const c=(0,et.If)(l,o),u=it(l,"TILEOFFSETS");if(void 0===u)return null;const h=it(l,"TILEBYTECOUNTS"),{minRow:f,minCol:d,maxRow:m,maxCol:p}=r[a];if(t>m||i>p||t<f||i<d)return null;const g=st(l,"IMAGEWIDTH"),y=st(l,"IMAGELENGTH"),x=st(l,"TILEWIDTH"),w=st(l,"TILELENGTH"),_=[];if(c){const{bandCount:e}=this.rasterInfo;for(let s=0;s<e;s++){const e=s*(m+1)*(p+1)+t*(p+1)+i;_[s]={from:u[e],to:u[e]+h[e]-1}}}else{const e=t*(p+1)+i;_.push({from:u[e],to:u[e]+h[e]-1})}for(let e=0;e<_.length;e++)if(null==_[e].from||!_[e].to||_[e].to<0)return null;return{ranges:_,ifd:l,actualTileWidth:i===p&&g%x||x,actualTileHeight:t===m&&y%w||w}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Ee(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=Ie.parse(t);return i?.recordSet?K.Z.fromJSON(i.recordSet):null}catch{return null}}};(0,s._)([(0,u.Cb)()],nt.prototype,"_files",void 0),(0,s._)([(0,u.Cb)()],nt.prototype,"_headerInfo",void 0),(0,s._)([(0,u.Cb)()],nt.prototype,"_bufferSize",void 0),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],nt.prototype,"datasetFormat",void 0),nt=(0,s._)([(0,p.j)("esri.layers.support.rasterDatasets.TIFFRaster")],nt);const rt=nt,at=new Map;at.set("CRF",{desc:"Cloud Raster Format",constructor:Te}),at.set("MRF",{desc:"Meta Raster Format",constructor:Qe}),at.set("TIFF",{desc:"GeoTIFF",constructor:rt}),at.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Ve}),at.set("JPG",{desc:"JPG Raster Format",constructor:He}),at.set("PNG",{desc:"PNG Raster Format",constructor:He}),at.set("GIF",{desc:"GIF Raster Format",constructor:He}),at.set("BMP",{desc:"BMP Raster Format",constructor:He});class ot{static get supportedFormats(){const e=new Set;return at.forEach(((t,i)=>e.add(i))),e}static async open(e){const{url:t,ioConfig:i,sourceJSON:s}=e;let n=e.datasetFormat;null==n&&t.lastIndexOf(".")&&(n=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===n||"TIF"===n?n="TIFF":"JPG"!==n&&"JPEG"!==n&&"JFIF"!==n||(n="JPG"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const a={url:t,sourceJSON:s,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};let o,l;if(n&&this.supportedFormats.has(n)){if("CRF"===n&&!i?.enableCRF)throw new r.Z("rasterfactory:open",`cannot open raster: ${t}`);return o=at.get(n).constructor,l=new o(a),await l.open({signal:e.signal}),l}if(n)throw new r.Z("rasterfactory:open","not a supported format "+n);const c=Array.from(at.keys());let u=0;const h=()=>(n=c[u++],n&&("CRF"!==n||i?.enableCRF)?(o=at.get(n).constructor,l=new o(a),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null);return h()}static register(e,t,i){at.has(e.toUpperCase())||at.set(e.toUpperCase(),{desc:t,constructor:i})}}var lt=i(32163);let ct=class extends((0,x.h)((0,pe.M)((0,fe.q)((0,de.I)((0,w.N)(he((0,ge.n)((0,y.Y)((0,me.Q)((0,o.R)(g.Z))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(l.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[new ye.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new ye.Z({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],{rasterInfo:t}=this,i=t?.attributeTable,s=null!=i?i.fields:null;if(s){const t=s.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e.push(...t)}const n=t?.dataType,r=t?.multidimensionalInfo;if(("vector-magdir"===n||"vector-uv"===n)&&null!=r){const t=r.variables[0].unit?.trim(),i="Magnitude"+(t?` (${t})`:"");e.push(new ye.Z({name:"Raster.Magnitude",alias:i,domain:null,editable:!1,type:"double"})),e.push(new ye.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}createPopupTemplate(e){const{rasterFields:t}=this,i=new Set(t.map((({name:e})=>e)).filter((e=>"raster.servicepixelvalue.raw"!==e.toLowerCase())));return(0,lt.eZ)({fields:t,title:this.title},{...e,visibleFieldNames:i})}async generateRasterInfo(e,t){if(!(e=(0,h.TJ)(k.Z,e)))return this.rasterInfo;try{const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((e=>i[e.url]=e));const s=(0,se.Ue)(e.functionDefinition?.toJSON()??e.toJSON(),i),n=new ee({rasterFunction:s});return await n.open(t),n.rasterInfo}catch(e){if(e instanceof r.Z)throw e;throw new r.Z("imagery-tile-layer","the given raster function is not supported")}}write(e,t){const i=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===i.datasetFormat&&("Raster"===i.tileType||"Map"===i.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new r.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)this.raster.rasterInfo||await this.raster.open(),"Function"===this.raster.datasetFormat?(t=!0,this._primaryRasters=this.raster.primaryRasters.rasters):this._primaryRasters=[this.raster],this.url=this.raster.url;else{const{rasterFunction:t}=this,i=[this.url];t&&(0,se.G8)(t.toJSON(),i);const s=await Promise.all(i.map((t=>ot.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e})))),n=s.findIndex((e=>null==e));if(n>-1)throw new r.Z("imagery-tile-layer:open",`cannot open raster: ${i[n]}`);if(this._primaryRasters=s,t){const e={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((t=>e[t.url]=t));const i=(0,se.Ue)(t.functionDefinition?.toJSON()??t.toJSON(),e),n=new ee({rasterFunction:i});try{await n.open(),this.raster=n}catch(e){const t=a.Z.getLogger(this);e instanceof r.Z&&t.error("imagery-tile-layer:open",e.message),t.warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=s[0]}}else this.raster=s[0]}const i=this.raster.rasterInfo;if(!i)throw new r.Z("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("rasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.rasterInfo.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,c.YP)((()=>this.customParameters),(e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)})))}};(0,s._)([(0,u.Cb)()],ct.prototype,"_primaryRasters",void 0),(0,s._)([(0,u.Cb)({type:[h.z8],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],ct.prototype,"bandIds",void 0),(0,s._)([(0,u.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,m.J)(xe.cl)],ct.prototype,"interpolation",void 0),(0,s._)([(0,u.Cb)(v.rn)],ct.prototype,"legendEnabled",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ct.prototype,"isReference",void 0),(0,s._)([(0,u.Cb)({type:["show","hide"]})],ct.prototype,"listMode",void 0),(0,s._)([(0,u.Cb)({json:{read:!0,write:!0}})],ct.prototype,"blendMode",void 0),(0,s._)([(0,u.Cb)()],ct.prototype,"sourceJSON",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],ct.prototype,"version",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],ct.prototype,"type",void 0),(0,s._)([(0,u.Cb)({type:["ArcGISTiledImageServiceLayer"]})],ct.prototype,"operationalLayerType",void 0),(0,s._)([(0,u.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],ct.prototype,"popupEnabled",void 0),(0,s._)([(0,u.Cb)({type:n.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],ct.prototype,"popupTemplate",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],ct.prototype,"defaultPopupTemplate",null),(0,s._)([(0,u.Cb)({readOnly:!0,type:[ye.Z]})],ct.prototype,"fields",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,type:[ye.Z]})],ct.prototype,"rasterFields",null),ct=(0,s._)([(0,p.j)("esri.layers.ImageryTileLayer")],ct);const ut=ct},11282:(e,t,i)=>{i.d(t,{cv:()=>o,en:()=>a,lA:()=>r}),i(68773),i(40330);var s=i(22974),n=i(17452);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function a(e){return"string"==typeof e?(0,n.mN)(e):(0,s.d9)(e)}function o(e,t,i){const s={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r)){s[n]=[];for(let e=0;e<r.length;e++)s[n][e]=o(r[e])}else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i&&i[n]);s[n]=t?e:JSON.stringify(e)}else s[n]=t?r:JSON.stringify(r);else s[n]=r}return s}i(71058)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3310],{83310:(e,t,r)=>{r.d(t,{isAnimatedGIF:()=>C,parseGif:()=>k});var n=r(76882),i={},a={},o={};Object.defineProperty(o,"__esModule",{value:!0}),o.loop=o.conditional=o.parse=void 0,o.parse=function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(r))r.forEach((function(r){return e(t,r,n,i)}));else if("function"==typeof r)r(t,n,i,e);else{var a=Object.keys(r)[0];Array.isArray(r[a])?(i[a]={},e(t,r[a],n,i[a])):i[a]=r[a](t,n,i,e)}return n},o.conditional=function(e,t){return function(r,n,i,a){t(r,n,i)&&a(r,e,n,i)}},o.loop=function(e,t){return function(r,n,i,a){for(var o=[],d=r.pos;t(r,n,i);){var s={};if(a(r,e,n,s),r.pos===d)break;d=r.pos,o.push(s)}return o}};var d={};Object.defineProperty(d,"__esModule",{value:!0}),d.readBits=d.readArray=d.readUnsigned=d.readString=d.peekBytes=d.readBytes=d.peekByte=d.readByte=d.buildStream=void 0,d.buildStream=function(e){return{data:e,pos:0}};d.readByte=function(){return function(e){return e.data[e.pos++]}},d.peekByte=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(t){return t.data[t.pos+e]}};var s=function(e){return function(t){return t.data.subarray(t.pos,t.pos+=e)}};d.readBytes=s,d.peekBytes=function(e){return function(t){return t.data.subarray(t.pos,t.pos+e)}},d.readString=function(e){return function(t){return Array.from(s(e)(t)).map((function(e){return String.fromCharCode(e)})).join("")}},d.readUnsigned=function(e){return function(t){var r=s(2)(t);return e?(r[1]<<8)+r[0]:(r[0]<<8)+r[1]}},d.readArray=function(e,t){return function(r,n,i){for(var a="function"==typeof t?t(r,n,i):t,o=s(e),d=new Array(a),c=0;c<a;c++)d[c]=o(r);return d}},d.readBits=function(e){return function(t){for(var r=function(e){return e.data[e.pos++]}(t),n=new Array(8),i=0;i<8;i++)n[7-i]=!!(r&1<<i);return Object.keys(e).reduce((function(t,r){var i=e[r];return i.length?t[r]=function(e,t,r){for(var n=0,i=0;i<r;i++)n+=e[t+i]&&Math.pow(2,r-i-1);return n}(n,i.index,i.length):t[r]=n[i.index],t}),{})}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o,r=d,n={blocks:function(e){for(var t=[],n=e.data.length,i=0,a=(0,r.readByte)()(e);0!==a&&a;a=(0,r.readByte)()(e)){if(e.pos+a>=n){var o=n-e.pos;t.push((0,r.readBytes)(o)(e)),i+=o;break}t.push((0,r.readBytes)(a)(e)),i+=a}for(var d=new Uint8Array(i),s=0,c=0;c<t.length;c++)d.set(t[c],s),s+=t[c].length;return d}},i=(0,t.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},(function(e){var t=(0,r.peekBytes)(2)(e);return 33===t[0]&&249===t[1]})),a=(0,t.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,t.conditional)({lct:(0,r.readArray)(3,(function(e,t,r){return Math.pow(2,r.descriptor.lct.size+1)}))},(function(e,t,r){return r.descriptor.lct.exists})),{data:[{minCodeSize:(0,r.readByte)()},n]}]},(function(e){return 44===(0,r.peekByte)()(e)})),s=(0,t.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(e,t,n){return(0,r.readBytes)(n.text.blockSize)(e)}},n]},(function(e){var t=(0,r.peekBytes)(2)(e);return 33===t[0]&&1===t[1]})),c=(0,t.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(e,t,n){return(0,r.readString)(n.blockSize)(e)}},n]},(function(e){var t=(0,r.peekBytes)(2)(e);return 33===t[0]&&255===t[1]})),u=(0,t.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},(function(e){var t=(0,r.peekBytes)(2)(e);return 33===t[0]&&254===t[1]})),l=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,t.conditional)({gct:(0,r.readArray)(3,(function(e,t){return Math.pow(2,t.lsd.gct.size+1)}))},(function(e,t){return t.lsd.gct.exists})),{frames:(0,t.loop)([i,c,u,a,s],(function(e){var t=(0,r.peekByte)()(e);return 33===t||44===t}))}];e.default=l}(a);var c={};Object.defineProperty(c,"__esModule",{value:!0}),c.deinterlace=void 0,c.deinterlace=function(e,t){for(var r=new Array(e.length),n=e.length/t,i=function(n,i){var a=e.slice(i*t,(i+1)*t);r.splice.apply(r,[n*t,t].concat(a))},a=[0,4,2,1],o=[8,8,4,2],d=0,s=0;s<4;s++)for(var c=a[s];c<n;c+=o[s])i(c,d),d++;return r};var u={};Object.defineProperty(u,"__esModule",{value:!0}),u.lzw=void 0,u.lzw=function(e,t,r){var n,i,a,o,d,s,c,u,l,f,p,g,y,h,m,v,w=4096,B=r,b=new Array(r),x=new Array(w),k=new Array(w),A=new Array(w+1);for(d=1+(i=1<<(f=e)),n=i+2,c=-1,a=(1<<(o=f+1))-1,u=0;u<i;u++)x[u]=0,k[u]=u;for(p=g=y=h=m=v=0,l=0;l<B;){if(0===h){if(g<o){p+=t[v]<<g,g+=8,v++;continue}if(u=p&a,p>>=o,g-=o,u>n||u==d)break;if(u==i){a=(1<<(o=f+1))-1,n=i+2,c=-1;continue}if(-1==c){A[h++]=k[u],c=u,y=u;continue}for(s=u,u==n&&(A[h++]=y,u=c);u>i;)A[h++]=k[u],u=x[u];y=255&k[u],A[h++]=y,n<w&&(x[n]=c,k[n]=y,0==(++n&a)&&n<w&&(o++,a+=n)),c=s}h--,b[m++]=A[h],l++}for(l=m;l<B;l++)b[l]=0;return b},Object.defineProperty(i,"__esModule",{value:!0});var l,f=i.decompressFrames=i.decompressFrame=v=i.parseGIF=void 0,p=(l=a)&&l.__esModule?l:{default:l},g=o,y=d,h=c,m=u,v=i.parseGIF=function(e){var t=new Uint8Array(e);return(0,g.parse)((0,y.buildStream)(t),p.default)},w=function(e,t,r){if(e.image){var n=e.image,i=n.descriptor.width*n.descriptor.height,a=(0,m.lzw)(n.data.minCodeSize,n.data.blocks,i);n.descriptor.lct.interlaced&&(a=(0,h.deinterlace)(a,n.descriptor.width));var o={pixels:a,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?o.colorTable=n.lct:o.colorTable=t,e.gce&&(o.delay=10*(e.gce.delay||10),o.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(o.transparentIndex=e.gce.transparentColorIndex)),r&&(o.patch=function(e){for(var t=e.pixels.length,r=new Uint8ClampedArray(4*t),n=0;n<t;n++){var i=4*n,a=e.pixels[n],o=e.colorTable[a]||[0,0,0];r[i]=o[0],r[i+1]=o[1],r[i+2]=o[2],r[i+3]=a!==e.transparentIndex?255:0}return r}(o)),o}console.warn("gif frame does not have associated image.")};let B,b,x;async function k(e,t){const r=v(e),i=f(r,!0),{width:a,height:o}=r.lsd,d=function(e,t){return B??=document.createElement("canvas"),B.width=e,B.height=t,B.getContext("2d",{willReadFrequently:!0})}(a,o),s=[],c=[];let u=0;for(const e of i){const t=(0,n.HA)(e.delay||100);c.push(t),u+=t;const r=A(new ImageData(e.patch,e.dims.width,e.dims.height)),i=3===e.disposalType?d.getImageData(e.dims.left,e.dims.top,e.dims.width,e.dims.height):void 0;d.drawImage(r,e.dims.left,e.dims.top);const l=d.getImageData(0,0,a,o);s.push(l),1===e.disposalType||(2===e.disposalType?d.clearRect(e.dims.left,e.dims.top,e.dims.width,e.dims.height):3===e.disposalType&&d.putImageData(i,e.dims.left,e.dims.top))}return{frameCount:i.length,duration:u,frameDurations:c,getFrame:e=>s[e],width:a,height:o}}function A(e){return b??=document.createElement("canvas"),x??=b.getContext("2d",{willReadFrequently:!0}),b.width=e.width,b.height=e.height,x.putImageData(e,0,0),b}i.decompressFrame=w,f=i.decompressFrames=function(e,t){return e.frames.filter((function(e){return e.image})).map((function(r){return w(r,e.gct,t)}))};const U=[71,73,70];function C(e){if(!function(e){const t=new Uint8Array(e);return!U.some(((e,r)=>e!==t[r]))}(e))return!1;const t=new DataView(e),r=t.getUint8(10);let n=13+(128&r?3*2**(1+(7&r)):0),i=0,a=!1;for(;!a;){switch(t.getUint8(n++)){case 33:if(!o())return!1;break;case 44:d();break;case 59:a=!0;break;default:return!1}if(i>1)return!0}function o(){switch(t.getUint8(n++)){case 249:n++,n+=4,s();break;case 1:i++,n++,n+=12,s();break;case 254:s();break;case 255:n++,n+=8,n+=3,s();break;default:return!1}return!0}function d(){i++,n+=8;const e=t.getUint8(n++);n+=128&e?3*2**(1+(7&e)):0,n++,s()}function s(){let e;for(;e=t.getUint8(n++);)n+=e}return!1}}}]);