@arcgis/core 5.1.0-next.81 → 5.1.0-next.82

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 (171) hide show
  1. package/analysis/ShadowCast/DiscreteOptions.d.ts +12 -0
  2. package/analysis/ShadowCast/TotalDurationOptions.d.ts +12 -0
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/040884cec4b84dd1bb17.js +1 -0
  5. package/assets/esri/core/workers/chunks/05c5f68e117fc58ae801.js +1 -0
  6. package/assets/esri/core/workers/chunks/074f5e6aaeafca13bf72.js +1 -0
  7. package/assets/esri/core/workers/chunks/{7bd1d624f4f4a11a31e8.js → 086d7cdfa92a649c9f7b.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{0eed2b1b06355ab89013.js → 0c074c46d106ca4d3bad.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{c758e16b57c96ce88294.js → 1768f1a7e3caa6074d91.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{85d3475667c503ec4fc6.js → 186bfde8c552e3b42302.js} +1 -1
  11. package/assets/esri/core/workers/chunks/1a35121a0c2595a41fdb.js +1 -0
  12. package/assets/esri/core/workers/chunks/1ab66600579fa4232d7b.js +1 -0
  13. package/assets/esri/core/workers/chunks/1e3fe89970c57a883fe5.js +1 -0
  14. package/assets/esri/core/workers/chunks/{824051af00e7a1f05ed0.js → 230e0e43f8e771950397.js} +1 -1
  15. package/assets/esri/core/workers/chunks/26f804c92077c11c626d.js +1 -0
  16. package/assets/esri/core/workers/chunks/28a45bd26eb5c9b3ec7c.js +1 -0
  17. package/assets/esri/core/workers/chunks/38f1a86b8dd9ee684ee5.js +596 -0
  18. package/assets/esri/core/workers/chunks/{71fe127734f33d020a44.js → 475394218caaa4cd3e86.js} +1 -1
  19. package/assets/esri/core/workers/chunks/475409026288f0981ce2.js +1 -0
  20. package/assets/esri/core/workers/chunks/4e206957b28253ddc1a3.js +1 -0
  21. package/assets/esri/core/workers/chunks/5cc38ac051d3d0557920.js +1 -0
  22. package/assets/esri/core/workers/chunks/{992cd87ba0ab6346f692.js → 64e268ebac0b62076f81.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{003fd7745966fe03510c.js → 65ac73de5bb133c6bf89.js} +1 -1
  24. package/assets/esri/core/workers/chunks/6675d56f49d07a97dc40.js +1 -0
  25. package/assets/esri/core/workers/chunks/{484d6c1b0fe1633515b7.js → 72f8f4cfa0842d325fb0.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{283d39dfb1625b5a74db.js → 747e258f57f0543c836e.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{dd4f431511edd975a53b.js → 7acf82763aeba44049d0.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{5d8e944b192aad4cf986.js → 7b505112c7e6d9b7a239.js} +1 -1
  29. package/assets/esri/core/workers/chunks/7b8466f892a38a53c600.js +1 -0
  30. package/assets/esri/core/workers/chunks/{77dd719516138afb1a2a.js → 8af9a78cf316581ea482.js} +1 -1
  31. package/assets/esri/core/workers/chunks/988e91cc6cf88c34c2de.js +1 -0
  32. package/assets/esri/core/workers/chunks/9c402657f63a4d5668d0.js +1 -0
  33. package/assets/esri/core/workers/chunks/9ea23cd4b2664c08b670.js +1 -0
  34. package/assets/esri/core/workers/chunks/9f51a69b8f1937a8794a.js +1 -0
  35. package/assets/esri/core/workers/chunks/a28124bba6b43efd74cc.js +1 -0
  36. package/assets/esri/core/workers/chunks/af762422a65c551dcd54.js +1 -0
  37. package/assets/esri/core/workers/chunks/{056fd7847caaff2c9514.js → af8bc56cf1404afc3028.js} +1 -1
  38. package/assets/esri/core/workers/chunks/b9e163f4a898e50cc854.js +1 -0
  39. package/assets/esri/core/workers/chunks/{444f0f51b3ee0b9845a5.js → bb2f6b0fcdfb8b158e26.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{4af39fa53bc0b79101ed.js → bc8a74da48b08309875f.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{026d3fa331caec1ea3d2.js → bf4dd8e50704e4040966.js} +1 -1
  42. package/assets/esri/core/workers/chunks/c19e3f6027b6526de359.js +1 -0
  43. package/assets/esri/core/workers/chunks/ce4dfc3a470230ddc9e4.js +1 -0
  44. package/assets/esri/core/workers/chunks/{8ea4584e07ccc85caabd.js → d11de13537b623739e14.js} +1 -1
  45. package/assets/esri/core/workers/chunks/d897412b99b9fba44bb4.js +1 -0
  46. package/assets/esri/core/workers/chunks/{035dbb0217f83108fa89.js → db86a1119e4e58ecfbda.js} +1 -1
  47. package/assets/esri/core/workers/chunks/dcb7a3ff59677b1cf0f1.js +1 -0
  48. package/assets/esri/core/workers/chunks/{5fe97253f80c797fad7f.js → df8a3d3cac454d42e14d.js} +1 -1
  49. package/assets/esri/core/workers/chunks/dfe1139124fda0d6c059.js +1 -0
  50. package/assets/esri/core/workers/chunks/{8b8f391f27774aec6db9.js → e0b27bceb397482bd0e8.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{84821dff3bcc51161802.js → e89dc473f46a5584d2ef.js} +32 -32
  52. package/assets/esri/core/workers/chunks/{01ee18782a50279f907e.js → f4220b6eab0865318033.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{42336e0d1ef88737b078.js → f468c6ea2818a1f97e19.js} +1 -1
  54. package/assets/esri/core/workers/chunks/fce2306a1b31c6680f90.js +1 -0
  55. package/assets/esri/core/workers/chunks/fcf51697c361e0075cc2.js +1 -0
  56. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  57. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  58. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +15 -0
  59. package/assets/esri/themes/dark/main.css +1 -1
  60. package/assets/esri/themes/light/main.css +1 -1
  61. package/assets/esri/themes/light/view.css +1 -1
  62. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  63. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  64. package/chunks/ShadowCastVisualize.glsl.js +33 -15
  65. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  66. package/chunks/arcgis-knowledge-client-core.js +1 -1
  67. package/config.js +1 -1
  68. package/core/workers/registry.js +1 -1
  69. package/form/elements/inputs/MultipleChoiceInput.d.ts +6 -6
  70. package/form/elements/inputs/MultipleChoiceInput.js +1 -1
  71. package/kernel.js +1 -1
  72. package/layers/BaseDynamicLayer.js +1 -1
  73. package/layers/BaseTileLayer.js +1 -1
  74. package/layers/ElevationLayer.js +1 -1
  75. package/layers/MapImageLayer.js +1 -1
  76. package/layers/TileLayer.js +1 -1
  77. package/layers/WMSLayer.js +1 -1
  78. package/layers/WMTSLayer.js +1 -1
  79. package/layers/WebTileLayer.js +1 -1
  80. package/layers/mixins/ArcGISImageService.js +1 -1
  81. package/layers/mixins/TiledImagery.js +1 -1
  82. package/layers/support/imageBitmapUtils.js +1 -1
  83. package/package.json +1 -1
  84. package/request/process.js +1 -1
  85. package/rest/knowledgeGraph/CreateReplicaResponse.d.ts +37 -0
  86. package/rest/knowledgeGraph/CreateReplicaResponse.js +2 -0
  87. package/rest/knowledgeGraph/ReplicaDefinition.d.ts +91 -0
  88. package/rest/knowledgeGraph/ReplicaDefinition.js +2 -0
  89. package/rest/knowledgeGraph/ReplicasInformationResponse.d.ts +24 -0
  90. package/rest/knowledgeGraph/ReplicasInformationResponse.js +2 -0
  91. package/rest/knowledgeGraph/UnregisterReplicaResponse.d.ts +44 -0
  92. package/rest/knowledgeGraph/UnregisterReplicaResponse.js +2 -0
  93. package/rest/knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js +2 -0
  94. package/rest/knowledgeGraph/wasmInterface/wasmToReplicaFactories.js +2 -0
  95. package/rest/knowledgeGraphService.d.ts +50 -1
  96. package/rest/knowledgeGraphService.js +1 -1
  97. package/support/revision.js +1 -1
  98. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  99. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  100. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  101. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  102. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  103. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  104. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  105. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  106. package/views/2d/layers/BaseDynamicLayerView2D.js +1 -1
  107. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  108. package/views/2d/layers/TileLayerView2D.js +1 -1
  109. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  110. package/views/2d/layers/WMSLayerView2D.js +1 -1
  111. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  112. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  113. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  114. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  115. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  116. package/views/3d/layers/IntegratedMesh3DTilesLayerWorker.js +2 -0
  117. package/views/3d/layers/IntegratedMesh3DTilesLayerWorkerHandle.js +2 -0
  118. package/views/3d/layers/TileLayerView3D.js +1 -1
  119. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  120. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  121. package/views/3d/layers/support/IntegratedMesh3DTilesVertexProcessing.js +2 -0
  122. package/views/3d/layers/support/makeScheduleFunction.js +1 -1
  123. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  124. package/views/3d/terrain/TerrainData.js +1 -1
  125. package/views/3d/terrain/TerrainSurface.js +1 -1
  126. package/views/3d/terrain/Tile.js +1 -1
  127. package/views/3d/terrain/TileRenderer.js +1 -1
  128. package/views/3d/terrain/terrainUtils.js +1 -1
  129. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  130. package/views/3d/webgl-engine/materials/VisualVariablePassParameters.js +1 -1
  131. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
  132. package/views/3d/webgl-engine/shaders/colorRampParameters.js +2 -0
  133. package/views/support/TextureCompressionWorker.js +1 -1
  134. package/views/support/TextureCompressionWorkerHandle.js +1 -1
  135. package/views/webgl/Texture.js +1 -1
  136. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  137. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  138. package/widgets/OrientedImageryViewer/css.js +1 -1
  139. package/widgets/OrientedImageryViewer.js +1 -1
  140. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  141. package/assets/esri/core/workers/chunks/05c3146d87d917606193.js +0 -1
  142. package/assets/esri/core/workers/chunks/0b77c124b743067e4155.js +0 -1
  143. package/assets/esri/core/workers/chunks/11241781baaed346af52.js +0 -1
  144. package/assets/esri/core/workers/chunks/1d9560eb8b21b9e76616.js +0 -1
  145. package/assets/esri/core/workers/chunks/2bd69a7734d170e190ed.js +0 -1
  146. package/assets/esri/core/workers/chunks/2c87c3112a43db8624f6.js +0 -1
  147. package/assets/esri/core/workers/chunks/3a58708217a9c11836ab.js +0 -1
  148. package/assets/esri/core/workers/chunks/3bbf684ee2484eb44c9f.js +0 -1
  149. package/assets/esri/core/workers/chunks/49fb9c47070641bce9a9.js +0 -1
  150. package/assets/esri/core/workers/chunks/5417308eba30e668b1ee.js +0 -1
  151. package/assets/esri/core/workers/chunks/62b3e933f548ce354b99.js +0 -1
  152. package/assets/esri/core/workers/chunks/6e70e922331704b92a08.js +0 -1
  153. package/assets/esri/core/workers/chunks/7c7c11c0fde8b63e330b.js +0 -1
  154. package/assets/esri/core/workers/chunks/7cee7ffaf941a4fe23b0.js +0 -596
  155. package/assets/esri/core/workers/chunks/7f55eef696e9ed717bfc.js +0 -1
  156. package/assets/esri/core/workers/chunks/89dbea6f436d45a3b185.js +0 -1
  157. package/assets/esri/core/workers/chunks/9d216e30d04ea21fc8a2.js +0 -1
  158. package/assets/esri/core/workers/chunks/a5d8d6f3c0c8de474efd.js +0 -1
  159. package/assets/esri/core/workers/chunks/a809b811121099a87a98.js +0 -1
  160. package/assets/esri/core/workers/chunks/c02ba921c0a32d2021e3.js +0 -1
  161. package/assets/esri/core/workers/chunks/c3c19b62d948d53118a8.js +0 -1
  162. package/assets/esri/core/workers/chunks/c46a4adea39636a96d03.js +0 -1
  163. package/assets/esri/core/workers/chunks/c5507480344176fad241.js +0 -1
  164. package/assets/esri/core/workers/chunks/c6030271bd6d39b6e1db.js +0 -1
  165. package/assets/esri/core/workers/chunks/d1a7d13e1d48abcd7bf1.js +0 -1
  166. package/assets/esri/core/workers/chunks/dcbc4072c18278c2b67d.js +0 -1
  167. package/assets/esri/core/workers/chunks/e610d24539a675fb054b.js +0 -1
  168. package/assets/esri/core/workers/chunks/ecb7ede6a8e6c05e4c6c.js +0 -1
  169. package/assets/esri/core/workers/chunks/f227b34cce6843df0fb6.js +0 -1
  170. package/request/ImageWithType.js +0 -2
  171. package/views/3d/layers/support/fetchTile.js +0 -2
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[233],{44794(e,t,i){i.d(t,{v:()=>o});var n=i(4718),r=i(62788),s=i(95488);class a{constructor(e,t){this._observable=new s.I,this._value=e,this._equalityFunction=t}get value(){return(0,r.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function o(e,t=n.gh){return new a(e,t)}},82806(e,t,i){i.d(t,{b:()=>z});var n=i(5482),r=i(11254),s=i(49186),a=i(53966),o=i(91429),l=i(56507),c=i(86738),u=i(16930),h=i(21325),d=i(7548),m=i(23636),p=i(4366),f=i(34930),y=i(99235),g=i(37373),b=i(51927),R=i(60694),x=i(10873),w=i(45617),I=i(33446),v=i(43577),_=i(13868),F=i(22796),S=i(69409),C=i(87045),J=i(12711),A=i(85676),P=i(94359),D=i(22048),M=i(49410),k=i(34606),T=i(29127),H=i(93223),N=i(36005);const z=e=>{const t=e;let z=class extends t{constructor(...e){super(...e),this._draRasterConfig=null,this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,d.qg)(e[0]?.raster)}destroy(){this._draRasterConfig?.rasterJobHandler?.destroy(),this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.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.Jf)(e,a.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const n=t?.layerDefinition?.drawingInfo?.renderer;return(0,P.LF)(n,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,l.PZ)(D.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new s.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:n}=e;if(null==n)throw new s.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let r=n;const{spatialReference:a}=i;if(!n.spatialReference.equals(a)){await(0,g.Hh)();const e="extent"===n.type?(0,g._l)(n,a):(0,g.uk)(n,a);if(null==e)throw new s.A("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");r=e}const o=e.pixelSize??new c.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:a}),{extent:u,width:h,height:d}=(0,f.b7)(i,r,o),m=await this.fetchPixels(u,h,d,{...t,interpolation:"nearest"});if(null==m.pixelBlock)throw new s.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const p=await(0,f.$Q)(m.pixelBlock,u,r),y=this._rasterJobHandler;return y?y.computeStatisticsHistograms({pixelBlock:p},t):(0,b.eH)(p)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,p.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:n}=this.raster,r=(0,p.ct)(n,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=r?.name,a=(0,J.m7)(n,s);return this._updateSymbolizer(t,i,s,a)}async applyRenderer(e,t,i){const n=e?.pixelBlock;if(!(null!=n&&n.pixels&&n.pixels.length>0))return null;await this.updateRenderer();const r=this.bandIds??[],{pixelBlock:s}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:r,symbolizer:this.symbolizer},i);return s}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&(0,d.qg)(t)){const i=t.rasterFunction.rawInputBandIds;e=e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):i}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}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 n=(0,h.Vp)(e);return C.A.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,n={}){if(B(this),n.requestAsImageElement){const s=this.getTileUrl(e,t,i),{data:a}=await(0,r.A)(s,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal});return a}const{serviceRasterInfo:s}=this;if(null!=s.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition){const r=n.tileInfo||s.storageInfo.tileInfo,a=this.raster.getTileExtentFromTileInfo(e,t,i,r);if(a)return{extent:a,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(n={...n,buffer:{cols:1,rows:1}}),n={...n,refreshParameters:this.refreshParameters},this.raster.fetchTile(e,t,i,n)}async fetchImageBitmapTile(e,t,i,n={}){B(this);const s=this.getTileUrl(e,t,i),{data:a}=await(0,r.A)(s,{responseType:"blob",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n?.signal});return(0,I.Cp)(a,e,t,i,n)}async fetchPixels(e,t,i,n={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i);const r=await this.raster.fetchPixels(e,t,i,n);return n.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(r.pixelBlock=r.pixelBlock?.extractBands(n.bandIds)),r}async getSamples(e,t){await this.load();const i=(0,l.PZ)(k.A,e).clone();if(i.interpolation&&"nearest"!==i.interpolation)throw new s.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const n=i.mosaicRule?.multidimensionalDefinition,r={...t,multidimensionalDefinition:n},a=(await this._getSampleLocations(i)).map(e=>this.identify(e,r).then(t=>(t.location=e,t))),o=(await Promise.all(a)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new T.A({samples:o})}async identify(e,t={}){await this.load();const i=(0,l.PZ)(c.A,e).clone().normalize(),{raster:n,serviceRasterInfo:r}=this;if(null!=r?.multidimensionalInfo&&(!r.hasMultidimensionalTranspose||!(0,p.DY)(t.multidimensionalDefinition)&&!t.transposedVariableName)&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:i,value:null};const a=this.multidimensionalSubset?.areaOfInterest;if(a&&!a.contains(i))throw new s.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=(0,d.qg)(n)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return n.identify(i,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.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((0,p.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,p.z2)(this.multidimensionalSubset,t)}async getDynamicRangeInputRaster(){if(!this.rasterFunction||!(0,d.qg)(this.raster)||!this._cachedRasterFunctionJson)return null;const e=JSON.stringify(this._cachedRasterFunctionJson);if(this._draRasterConfig?.functionJson===e)return this._draRasterConfig;const t=this.raster.rasterFunction.queryRasterFunction(e=>"Stretch"===e.functionName&&e.functionArguments.dynamicRangeAdjustment);if(!t)return null;const i=t.toJSON(),n=this.raster.primaryRasters.rasters,r=t.functionArguments.raster,s=i.rasterFunctionArguments;if(!r||"object"!=typeof r||!("functionName"in r))return this._draRasterConfig={functionJson:e,raster:n[0],functionArguments:s,rasterJobHandler:this._draRasterConfig?.rasterJobHandler},this._draRasterConfig;const a={raster:n[0]};n.length>1&&n.forEach(e=>a[e.url]=e);const o=(0,y.vt)(r.toJSON(),a),l=new m.A({rasterFunction:o});await l.open();let c=this._draRasterConfig?.rasterJobHandler;try{c||(c=new S.A,await c.initialize()),l.rasterJobHandler=c,await l.syncJobHandler()}catch{}return this._draRasterConfig={functionJson:e,raster:l,functionArguments:s,rasterJobHandler:c},this._draRasterConfig}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,p.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,d.qg)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;B(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,d.qg)(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:n,type:r}=t;if("multipoint"===r)return t.points.map(e=>new c.A({x:e[0],y:e[1],spatialReference:n}));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const n=await Promise.all([i.e(6042),i.e(1878),i.e(8885),i.e(5756),i.e(3299),i.e(2261)]).then(i.bind(i,88411)),s=(await Promise.all([i.e(6042),i.e(1878),i.e(8885),i.e(5756),i.e(3299),i.e(2174)]).then(i.bind(i,965))).execute(t,{unit:"meters"}),a=Math.min(e.sampleCount||100,1e3);let o=e.sampleDistance;o||(o=s/(a+(2===r.paths[0].length?1:0))),r=n.execute(t,o,{unit:"meters"})}return r.paths.flatMap(e=>e.map(e=>new c.A({x:e[0],y:e[1],spatialReference:n})))}const s=Math.min(e.sampleCount||100,1e3),a="extent"===t.type,o=a?t:t.extent,l=Math.sqrt(o.width*o.height/s),u=o.height/l,h=o.width/l,{xmin:d,ymax:m}=o,p=[];for(let e=0;e<u;e++)for(let i=0;i<h;i++){const r=new c.A({x:d+(i+.5)*l,y:m-(e+.5)*l,spatialReference:n});(a||t.contains(r))&&p.push(r)}return p}_configDefaultInterpolation(){if(null==this.interpolation){B(this);const{raster:e}=this,t=(0,J.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){B(this);const{rasterInfo:t}=this.raster,i=(0,p.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=i?.name,r=(0,J.I8)({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=r?.bandIds??(0,J.ci)(t)),!this.renderer||"override"===e){const e=(0,J.Mm)(this.raster),i=r?.renderer??(0,J.PD)(t,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:e}),s=t.statistics,a=s&&s.length>0?s[0]:null,o=a?.max??0,l=a?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(o>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const s=(0,J.$P)({...this.renderer.toJSON(),variableName:n}),o=(0,J.m7)(t,n);this.symbolizer?(this.symbolizer.rendererJSON=s,this.symbolizer.rasterInfo=o):this.symbolizer=new A.A({rendererJSON:s,rasterInfo:o});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,J.PD)(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.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else a.A.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,d.qg)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",F.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,d.qg)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:n}=this;if(n){const i={raster:t};e.length>1&&e.forEach(e=>i[e.url]=e);const r=(0,y.vt)(n.functionDefinition?.toJSON()??n.toJSON(),i),s=new m.A({rasterFunction:r});s.rasterJobHandler=this._rasterJobHandler,await s.open(),this.raster=s}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!n)return;const{bandIds:r}=this,{bandCount:s}=this.raster.rasterInfo,a=r?.length?r.some(e=>e>=s):s>=3;r&&(a||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,n=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),r=(i.pixelSize.x+i.pixelSize.y)/2*n;if(!e.dataSeries?.length)return[new M.A({location:e.location,pixelValue:e.value,locationId:t,resolution:r})];const s=[];return e.dataSeries.forEach(({value:i,multidimensionalDefinition:n},a)=>{const o={Variables:n[0].variableName,Dimensions:n.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of n){o[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];o[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const l=new M.A({location:e.location,pixelValue:i,rasterId:a,locationId:t,resolution:r,attributes:o});s.push(l)}),s}};function B(e){if(!e.raster||!e.serviceRasterInfo)throw new s.A("imagery-tile","no raster")}return(0,n.Cg)([(0,o.MZ)({clonable:!1})],z.prototype,"_cachedRasterFunctionJson",void 0),(0,n.Cg)([(0,o.MZ)({clonable:!1})],z.prototype,"_compatibleFullExtent",void 0),(0,n.Cg)([(0,o.MZ)({clonable:!1})],z.prototype,"_draRasterConfig",void 0),(0,n.Cg)([(0,o.MZ)({clonable:!1})],z.prototype,"_isConstructedFromFunctionRaster",void 0),(0,n.Cg)([(0,o.MZ)({clonable:!1})],z.prototype,"_rasterFunctionUpdatePromise",void 0),(0,n.Cg)([(0,o.MZ)({type:[l.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],z.prototype,"bandIds",void 0),(0,n.Cg)([(0,o.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],z.prototype,"copyright",void 0),(0,n.Cg)([(0,o.MZ)({json:{read:!1}})],z.prototype,"fullExtent",null),(0,n.Cg)([(0,o.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,H.e)(_.SZ)],z.prototype,"interpolation",void 0),(0,n.Cg)([(0,o.MZ)()],z.prototype,"ioConfig",void 0),(0,n.Cg)([(0,o.MZ)({type:[w.A],json:{write:!0}})],z.prototype,"multidimensionalDefinition",null),(0,n.Cg)([(0,o.MZ)({type:v.A,json:{write:!0}})],z.prototype,"multidimensionalSubset",void 0),(0,n.Cg)([(0,o.MZ)()],z.prototype,"raster",void 0),(0,n.Cg)([(0,o.MZ)({type:F.A})],z.prototype,"rasterFunction",null),(0,n.Cg)([(0,o.MZ)()],z.prototype,"serviceRasterInfo",void 0),(0,n.Cg)([(0,o.MZ)()],z.prototype,"sourceJSON",void 0),(0,n.Cg)([(0,o.MZ)({readOnly:!0,type:u.A,json:{read:!1}})],z.prototype,"spatialReference",void 0),(0,n.Cg)([(0,o.MZ)({type:C.A})],z.prototype,"tileInfo",void 0),(0,n.Cg)([(0,o.MZ)(x.OZ)],z.prototype,"url",null),(0,n.Cg)([(0,o.MZ)({types:P.uy})],z.prototype,"renderer",null),(0,n.Cg)([(0,o.MZ)({types:P.uy,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:P.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],z.prototype,"internalRenderer",null),(0,n.Cg)([(0,N.w)("internalRenderer")],z.prototype,"readRenderer",null),(0,n.Cg)([(0,o.MZ)({clonable:!1})],z.prototype,"symbolizer",void 0),z=(0,n.Cg)([(0,o.$K)("esri.layers.mixins.TiledImagery")],z),z}},23636(e,t,i){i.d(t,{A:()=>p});var n=i(5482),r=i(49186),s=i(91429),a=i(5443),o=i(86738),l=i(39829),c=i(49859),u=i(34930),h=i(47520),d=i(37373),m=i(22671);let p=class extends c.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,n={}){const{rasters:r}=this.primaryRasters;let s=!1;const{interpolation:a}=n,o=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!n.requestRawData&&o&&(s=1===r.length&&!n.skipRasterFunction,n={...n,interpolation:"bilinear",requestRawData:s}),n.requestRawData&&r.length>1&&!this.hasUniqueSourceStorageInfo&&(s=!1,n={...n,requestRawData:!1});const l=r.map(r=>r.fetchPixels(e,t,i,n)),c=await Promise.all(l),d=c.map(e=>e.pixelBlock),m=s||n.requestRawData?c.map(e=>e.srcTilePixelSize):void 0;if(n.skipRasterFunction||d.every(e=>null==e))return c[0];const p=c.find(e=>null!=e.pixelBlock)?.extent??e;let f=await this._processPixelBlock(d,p,m);const{transformGrid:y}=c[0];if(!s||null==f||null==y){const e=n.noClip?null:this.getClippingGeometry(p.spatialReference);return!n.noClip&&null!=f&&e&&(f=await(0,u.$Q)(f,p,e)),{...c[0],pixelBlock:f}}const g={rows:y.spacing[0],cols:y.spacing[1]};let b;b=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[f],srcMosaicSize:{width:f.width,height:f.height},destDimension:{width:t,height:i},coefs:y.coefficients,sampleSpacing:g,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:a,alignmentInfo:void 0,blockWidths:null},n)).pixelBlock:(0,h.$i)(f,{width:t,height:i},y.coefficients,g,a);const R=n.noClip?null:this.getClippingGeometry(e.spatialReference);return n.noClip||null==b||null==R||(b=await(0,u.$Q)(b,e,R)),{extent:e,srcExtent:c[0].srcExtent,pixelBlock:b,srcTilePixelSize:c[0].srcTilePixelSize}}async processOnePixel(e,t){const{extent:i,pixelBlock:n}=t;if(!n)return null;const{row:r,col:s}=e,{width:o,height:l}=n;if(r<0||r>=l||s<0||s>=o)return null;const{neighborhoodSize:c}=this.rasterFunction,u=Math.max(2,c.rows),d=Math.max(2,c.cols),m=d>>>1,p=u>>>1,f={x:Math.max(0,s-m),y:Math.max(0,r-p)},y=i.width/o,g=i.height/l,b=i.xmin+y*f.x,R=b+y*d,x=i.ymax-g*f.y,w=new a.A({xmin:b,ymin:x-g*u,xmax:R,ymax:x,spatialReference:i.spatialReference}),I=(0,h.$Q)(n,f,{width:d,height:u});if(null==I)return null;const v=await this.processPixelData({extent:w,pixelBlock:I}),_=(r-f.y)*d+(s-f.x);return v&&0!==v.mask?.[_]?v.pixels.map(e=>e[_]):null}async processPixelData(e){const{extent:t,pixelBlock:i}=e;if(!i)return null;const n=new o.A({x:t.width/i.width,y:t.height/i.height,spatialReference:t.spatialReference});return await this._processPixelBlock([i],t,[n])}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let n=this._clippingGeometry.get(i);return null!=n||(n=e.equals(t.spatialReference)?t:(0,d.uk)(t,e),this._clippingGeometry.set(i,n)),n}async _open(e){const{rasterFunction:t}=this;t.isRoot=!0,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:n}=this.primaryRasters,s=i.map(t=>t.rasterInfo?void 0:t.open(e));await Promise.all(s);const a=i.map(({rasterInfo:e})=>e),o=t.bind({rasterInfos:a,rasterIds:n});if(t.rawSourceRasterInfos=a,!o.success||0===a.length)throw new r.A("raster-function:open",`cannot bind the function: ${o.error??""}`);const l="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===l?.functionName&&(t.rasterInfo.attributeTable=m.A.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=a[0];this.hasUniqueSourceStorageInfo=1===a.length||a.slice(1).every(e=>function(e,t){const{storageInfo:i,pixelSize:n,spatialReference:r,extent:s}=e,{storageInfo:a,pixelSize:o,spatialReference:l,extent:c}=t;return n.x===o.x&&n.y===o.y&&r.equals(l)&&s.equals(c)&&i.blockHeight===a.blockHeight&&i.blockWidth===a.blockWidth&&i.maximumPyramidLevel===a.maximumPyramidLevel&&i.firstPyramidLevel===a.firstPyramidLevel&&i.pyramidBlockWidth===a.pyramidBlockWidth&&i.pyramidBlockHeight===a.pyramidBlockHeight&&i.pyramidScalingFactor===a.pyramidScalingFactor}(e,c)),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _processPixelBlock(e,t,i){const{processParameters:n,primaryRasters:{rasterIds:r}}=this;return this.rasterJobHandler?await this.rasterJobHandler.process({extent:t,primaryPixelBlocks:e,primaryPixelSizes:i,primaryRasterIds:r,parameters:n}):this.rasterFunction.process({extent:t,primaryPixelBlocks:e,primaryPixelSizes:i,primaryRasterIds:r},n)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,n=await Promise.all([i.e(6042),i.e(1878),i.e(8885),i.e(5756),i.e(3299),i.e(2261)]).then(i.bind(i,88411)),r=await Promise.all([i.e(6042),i.e(1878),i.e(8885),i.e(5756),i.e(3299),i.e(9598)]).then(i.bind(i,93054));let s=n.execute(l.A.fromExtent(e),2*(e.width+e.height)/40);s=(0,d.uk)(s,t.spatialReference),t=r.execute(s,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,n.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],p.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,s.MZ)()],p.prototype,"tileType",void 0),(0,n.Cg)([(0,s.MZ)()],p.prototype,"rasterFunction",void 0),(0,n.Cg)([(0,s.MZ)()],p.prototype,"processParameters",void 0),(0,n.Cg)([(0,s.MZ)()],p.prototype,"primaryRasters",void 0),p=(0,n.Cg)([(0,s.$K)("esri.layers.raster.datasets.FunctionRaster")],p)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[309],{20309(e,t,i){i.r(t),i.d(t,{default:()=>de});var r,s=i(5482),l=i(11254),o=i(4576),n=i(7762),a=i(49186),c=i(4718),u=i(25728),p=i(17676),d=i(36708),m=i(84952),h=i(91429),y=i(5443),f=i(4146),g=i(47314),w=i(63074),v=i(34287),M=i(8303),x=i(54310),C=i(25036),I=i(33446),S=i(87045),T=i(65509),L=i(83703),A=i(25482);let b=r=class extends A.o{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new r;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()??null),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo?.clone()??null),e}};(0,s.Cg)([(0,h.MZ)({type:y.A,json:{read:{source:"fullExtent"}}})],b.prototype,"fullExtent",void 0),(0,s.Cg)([(0,h.MZ)({type:String,json:{read:{source:"id"}}})],b.prototype,"id",void 0),(0,s.Cg)([(0,h.MZ)({type:S.A,json:{read:{source:"tileInfo"}}})],b.prototype,"tileInfo",void 0),b=r=(0,s.Cg)([(0,h.$K)("esri.layers.support.TileMatrixSet")],b);const P=b;var E;let O=E=class extends A.o{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new E;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,s.Cg)([(0,h.MZ)({json:{read:{source:"id"}}})],O.prototype,"id",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"title"}}})],O.prototype,"title",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"abstract"}}})],O.prototype,"description",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"legendUrl"}}})],O.prototype,"legendUrl",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"isDefault"}}})],O.prototype,"isDefault",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"keywords"}}})],O.prototype,"keywords",void 0),O=E=(0,s.Cg)([(0,h.$K)("esri.layers.support.WMTSStyle")],O);const R=O;var F,Z=i(36005);let V=F=class extends A.o{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?y.A.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map(e=>y.A.fromJSON(e)):t.tileMatrixSets?.map(e=>y.A.fromJSON(e.fullExtent)).filter(e=>e)??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats?.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){let e=this._get("styleId");return e||(e=this.styles?.at(0)?.id??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?.find(({id:e})=>e===this.tileMatrixSetId)??null}clone(){const e=new F;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats?.slice()??null),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles?.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,s.Cg)([(0,h.MZ)()],V.prototype,"description",void 0),(0,s.Cg)([(0,h.MZ)({type:y.A})],V.prototype,"fullExtent",void 0),(0,s.Cg)([(0,Z.w)("fullExtent",["fullExtent"])],V.prototype,"readFullExtent",null),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],V.prototype,"fullExtents",void 0),(0,s.Cg)([(0,Z.w)("fullExtents",["fullExtents","tileMatrixSets"])],V.prototype,"readFullExtents",null),(0,s.Cg)([(0,h.MZ)()],V.prototype,"id",void 0),(0,s.Cg)([(0,h.MZ)()],V.prototype,"imageFormat",null),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"formats"}}})],V.prototype,"imageFormats",void 0),(0,s.Cg)([(0,h.MZ)()],V.prototype,"layer",void 0),(0,s.Cg)([(0,h.MZ)()],V.prototype,"parent",void 0),(0,s.Cg)([(0,h.MZ)()],V.prototype,"styleId",null),(0,s.Cg)([(0,h.MZ)({type:n.A.ofType(R),json:{read:{source:"styles"}}})],V.prototype,"styles",void 0),(0,s.Cg)([(0,h.MZ)({json:{write:{ignoreOrigin:!0}}})],V.prototype,"title",void 0),(0,s.Cg)([(0,h.MZ)()],V.prototype,"tileMatrixSetId",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],V.prototype,"tileMatrixSet",null),(0,s.Cg)([(0,h.MZ)({type:n.A.ofType(P),json:{read:{source:"tileMatrixSets"}}})],V.prototype,"tileMatrixSets",void 0),V=F=(0,s.Cg)([(0,h.$K)("esri.layers.support.WMTSSublayer")],V);var U=i(73941),j=i(86738),_=i(22530),N=i(38458),k=i(13043),D=i(91806);const W=90.71428571428571;function K(e){const t=e.replaceAll(/ows:/gi,"");return(new DOMParser).parseFromString(t,"text/xml")}function B(e){if(!H("Contents",e.documentElement))throw new a.A("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant")}function $(e){return e.nodeType===Node.ELEMENT_NODE}function H(e,t){for(let i=0;i<t.childNodes.length;i++){const r=t.childNodes[i];if($(r)&&r.nodeName===e)return r}return null}function J(e,t){const i=[];for(let r=0;r<t.childNodes.length;r++){const s=t.childNodes[r];$(s)&&s.nodeName===e&&i.push(s)}return i}function q(e,t){const i=[];for(let r=0;r<t.childNodes.length;r++){const s=t.childNodes[r];$(s)&&s.nodeName===e&&i.push(s)}return i.map(e=>e.textContent).filter(o.Ru)}function G(e,t){return e.split(">").forEach(e=>{t&&(t=H(e,t))}),t&&t.textContent}function z(e,t,i,r){let s;return Array.prototype.slice.call(r.childNodes).some(r=>{if(r.nodeName.includes(e)){const e=H(t,r),l=e?.textContent;if(l===i||i.split(":")&&i.split(":")[1]===l)return s=r,!0}return!1}),s}function Q(e,t,i,r,s){const l=G("Abstract",t),o=q("Format",t);return{id:e,fullExtent:Y(t),fullExtents:ee(t),description:l,formats:o,styles:te(t,r),title:G("Title",t),tileMatrixSets:ie(s,t,i)}}function X(e,t){const i=[],r=e.layerMap?.get(t);if(!r)return null;const s=J("ResourceURL",r),l=J("Dimension",r);let o,n,a,c;return l.length&&(o=G("Identifier",l[0]),n=q("Default",l[0])||q("Value",l[0])),l.length>1&&(a=G("Identifier",l[1]),c=q("Default",l[1])||q("Value",l[1])),e.dimensionMap.set(t,{dimensions:n,dimensions2:c}),s.forEach(e=>{let t=e.getAttribute("template");if("tile"===e.getAttribute("resourceType")){if(o&&n.length)if(t.includes("{"+o+"}"))t=t.replace("{"+o+"}","{dimensionValue}");else{const e=t.toLowerCase().indexOf("{"+o.toLowerCase()+"}");e>-1&&(t=t.slice(0,e)+"{dimensionValue}"+t.slice(e+o.length+2))}if(a&&c.length)if(t.includes("{"+a+"}"))t=t.replace("{"+a+"}","{dimensionValue2}");else{const e=t.toLowerCase().indexOf("{"+a.toLowerCase()+"}");e>-1&&(t=t.slice(0,e)+"{dimensionValue2}"+t.slice(e+a.length+2))}i.push({template:t,format:e.getAttribute("format"),resourceType:"tile"})}}),i}function Y(e){const t=H("WGS84BoundingBox",e),i=t?G("LowerCorner",t).split(" "):["-180","-90"],r=t?G("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(i[0]),ymin:parseFloat(i[1]),xmax:parseFloat(r[0]),ymax:parseFloat(r[1]),spatialReference:{wkid:4326}}}function ee(e){const t=[];return(0,k.p)(e,{BoundingBox:e=>{if(!e.getAttribute("crs"))return;const i=e.getAttribute("crs").toLowerCase(),r=re(i),s=i.includes("epsg")&&(0,N.m)(r.wkid);let l,o,n,a;(0,k.p)(e,{LowerCorner:e=>{[l,o]=e.textContent.split(" ").map(e=>Number.parseFloat(e)),s&&([l,o]=[o,l])},UpperCorner:e=>{[n,a]=e.textContent.split(" ").map(e=>Number.parseFloat(e)),s&&([n,a]=[a,n])}}),t.push({xmin:l,ymin:o,xmax:n,ymax:a,spatialReference:r})}}),t}function te(e,t){return J("Style",e).map(e=>{const i=H("LegendURL",e),r=H("Keywords",e),s=r?q("Keyword",r):[];let l=i?.getAttribute("xlink:href");return t&&(l=l?.replace(/^http:/i,"https:")),{abstract:G("Abstract",e),id:G("Identifier",e),isDefault:"true"===e.getAttribute("isDefault"),keywords:s,legendUrl:l,title:G("Title",e)}})}function ie(e,t,i){return J("TileMatrixSetLink",t).map(t=>function(e,t,i){const r=H("TileMatrixSet",t).textContent,s=q("TileMatrix",t),l=i.find(e=>{const t=H("Identifier",e),i=t?.textContent;return!!(i===r||r.split(":")&&r.split(":")[1]===i)}),o=H("TileMatrixSetLimits",t),n=o&&J("TileMatrixLimits",o),a=new Map;if(n?.length)for(const e of n){const t=H("TileMatrix",e).textContent,i=+H("MinTileRow",e).textContent,r=+H("MaxTileRow",e).textContent,s=+H("MinTileCol",e).textContent,l=+H("MaxTileCol",e).textContent;a.set(t,{minCol:s,maxCol:l,minRow:i,maxRow:r})}const c=G("SupportedCRS",l).toLowerCase(),u=function(e,t){return se(H("TileMatrix",e),t)}(l,c),p=u.spatialReference,d=H("TileMatrix",l),m=[parseInt(G("TileWidth",d),10),parseInt(G("TileHeight",d),10)],h=[];s.length?s.forEach((e,t)=>{const i=z("TileMatrix","Identifier",e,l);h.push(le(i,c,t,r,a))}):J("TileMatrix",l).forEach((e,t)=>{h.push(le(e,c,t,r,a))});const f=function(e,t,i,r,s){const l=H("BoundingBox",t);let o,n,a,c,u,p;if(l&&(o=G("LowerCorner",l).split(" "),n=G("UpperCorner",l).split(" ")),o&&o.length>1&&n&&n.length>1)a=parseFloat(o[0]),u=parseFloat(o[1]),c=parseFloat(n[0]),p=parseFloat(n[1]);else{const e=H("TileMatrix",t),l=parseInt(G("MatrixWidth",e),10),o=parseInt(G("MatrixHeight",e),10);a=i.x,p=i.y,c=a+l*r[0]*s.resolution,u=p-o*r[1]*s.resolution}return function(e,t,i){return"1.0.0"===e&&(0,N.m)(t.wkid)&&!(i.spatialReference.isGeographic&&i.x<-90&&i.y>=-90)}(e,i.spatialReference,i)?new y.A(u,a,p,c,i.spatialReference):new y.A(a,u,c,p,i.spatialReference)}(e,l,u,m,h[0]).toJSON(),g=new S.A({dpi:96,spatialReference:p,size:m,origin:u,lods:h}).toJSON();return{id:r,fullExtent:f,tileInfo:g}}(e,t,i))}function re(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);900913!==t&&3857!==t||(t=102100);const i=function(e){return e.includes("crs84")||e.includes("crs:84")?4326:e.includes("crs83")||e.includes("crs:83")?4269:e.includes("crs27")||e.includes("crs:27")?4267:null}(e);return null!=i&&(t=i),{wkid:t}}function se(e,t){const i=re(t),[r,s]=G("TopLeftCorner",e).split(" ").map(e=>parseFloat(e)),l=t.includes("epsg")&&(0,N.m)(i.wkid);return new j.A(l?{x:s,y:r,spatialReference:i}:{x:r,y:s,spatialReference:i})}function le(e,t,i,r,s){const l=re(t),o=G("Identifier",e);let n=parseFloat(G("ScaleDenominator",e));const a=oe(l.wkid,n,r);n*=96/W;const c=+G("MatrixWidth",e),u=+G("MatrixHeight",e),{maxCol:p=c-1,maxRow:d=u-1,minCol:m=0,minRow:h=0}=s.get(o)??{},{x:y,y:f}=se(e,t);return new D.A({cols:[m,p],level:i,levelValue:o,origin:[y,f],scale:n,resolution:a,rows:[h,d]})}function oe(e,t,i){let r;return r=_.A.hasOwnProperty(""+e)?_.A.values[_.A[e]]:"default028mm"===i?6370997*Math.PI/180:(0,U.y7)(e).metersPerDegree,7*t/25e3/r}var ne,ae=i(43937);const ce={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},ue=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let pe=ne=class extends((0,w.dM)((0,x.J)((0,C.j)((0,v.q)((0,M.A)((0,u.M)(f.A))))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([(0,d.wB)(()=>this.activeLayer,(e,t)=>{t&&!this.sublayers?.includes(t)&&(t.layer=null,t.parent=null),e&&(e.layer=this,e.parent=this)},d.OH),(0,d.on)(()=>this.sublayers,"after-add",({item:e})=>{e.layer=this,e.parent=this},d.OH),(0,d.on)(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=null,e.parent=null},d.OH),(0,d.wB)(()=>this.sublayers,(e,t)=>{if(t)for(const e of t)e.layer=null,e.parent=null;if(e)for(const t of e)t.layer=this,t.parent=this},d.OH)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(p.QP).then(()=>this._fetchService(e)).catch(e=>{throw(0,p.QP)(e),new a.A("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:e})})),Promise.resolve(this)}readActiveLayerFromService(e,t,i){this.activeLayer||(this.activeLayer=new V);let r=t.layers.find(e=>e.id===this.activeLayer.id);return r||(r=t.layers[0]),this.activeLayer.read(r,i),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:i,wmtsInfo:r}=t,s=i?this._getLowerCasedUrlParams(i):null,l=r?.layerIdentifier;let o=null;const n=r?.tileMatrixSet;n&&(Array.isArray(n)?n.length&&(o=n[0]):o=n);const a=s?.format,c=s?.style;return new V({id:l,imageFormat:a,styleId:c,tileMatrixSetId:o})}writeActiveLayer(e,t,i,r){const{activeLayer:s,loaded:l}=this,{id:o,tileMatrixSet:n,tileMatrixSetId:a,imageFormat:c,styleId:u}=s;t.templateUrl=l?this.getUrlTemplate(o,a,c,u):void 0,t.tileInfo=l?n?.tileInfo?.toJSON(r)??null:void 0,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:o,tileMatrixSet:a}}readCustomParameters(e,t){const i=t.wmtsInfo;return i?this._mergeParams(i.customParameters,i.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,i){return function(e,t){return e.map(e=>{const i=new V;return i.read(e,t),i})}(t.layers,i)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(o.Ru)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new T.A(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),i=this._getTileMatrixSetById(e.tileMatrixSetId),r=i?.tileInfo,s=e.fullExtent,l=new L.x({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(l.customLayerParameters=this.customLayerParameters),this.customParameters&&(l.customParameters=this.customParameters),new g.default({fullExtent:s,urlTemplate:t,tileInfo:r,wmtsInfo:l})}async fetchTile(e,t,i,r={}){const{signal:s}=r,o=this.getTileUrl(e,t,i),{data:n}=await(0,l.A)(o,{responseType:"image",signal:s});return n}async fetchImageBitmapTile(e,t,i,r={}){const{signal:s}=r;if(this.fetchTile!==ne.prototype.fetchTile){const l=await this.fetchTile(e,t,i,r);return(0,I.C)(l,e,t,i,s)}const o=this.getTileUrl(e,t,i),{data:n}=await(0,l.A)(o,{responseType:"blob",signal:s});return(0,I.C)(n,e,t,i,s)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,i){const r=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=r?.tileInfo?.lods[e],l=s?s.levelValue||`${s.level}`:`${e}`;let o=this.resourceInfo?"":function(e,t,i,r,s,l,o,n){const a=function(e,t,i){const r=X(e,t),s=r?.filter(e=>e.format===i);return(s?.length?s:r)??[]}(e,t,r);if(!(a?.length>0))return"";const{dimensionMap:c}=e,u=c.get(t).dimensions?.[0],p=c.get(t).dimensions2?.[0];return a[o%a.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,i??"").replaceAll(/\{TileMatrix\}/gi,l).replaceAll(/\{TileRow\}/gi,""+o).replaceAll(/\{TileCol\}/gi,""+n).replaceAll(/\{dimensionValue\}/gi,u).replaceAll(/\{dimensionValue2\}/gi,p)}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,l,t,i);return o||(o=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,l).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${i}`)),o=this._appendCustomLayerParameters(o),o}getUrlTemplate(e,t,i,r){if(!this.resourceInfo){const i=function(e,t,i,r){const{dimensionMap:s}=e,l=X(e,t);let o="";if(l&&l.length>0){const e=s.get(t).dimensions?.[0],n=s.get(t).dimensions2?.[0];o=l[0].template,o.endsWith(".xxx")&&(o=o.slice(0,-4)),o=o.replaceAll(/\{Style\}/gi,r),o=o.replaceAll(/\{TileMatrixSet\}/gi,i),o=o.replaceAll(/\{TileMatrix\}/gi,"{level}"),o=o.replaceAll(/\{TileRow\}/gi,"{row}"),o=o.replaceAll(/\{TileCol\}/gi,"{col}"),o=o.replaceAll(/\{dimensionValue\}/gi,e),o=o.replaceAll(/\{dimensionValue2\}/gi,n)}return o}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,r);if(i)return i}if("KVP"===this.serviceMode)return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+r+"&FORMAT="+i+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if("RESTful"===this.serviceMode){let s="";const l=i.toLowerCase();return ce[l]&&(s=ce[l]),this.url+e+"/"+r+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){if(this.resourceInfo)return"KVP"!==this.resourceInfo.serviceMode||this.url.includes("?")||(this.url+="?"),function(e){for(const t of e.layers)for(const e of t.tileMatrixSets??[]){const{tileInfo:t}=e;if(t&&96!==t.dpi){for(const i of t.lods??[])i.scale=96*i.scale/t.dpi,i.resolution=oe(t.spatialReference?.wkid,i.scale*W/96,e.id);t.dpi=96}}}(this.resourceInfo),void this.read(this.resourceInfo,{origin:"service"});let t=null;try{const{data:i}=await this._getCapabilities(this.serviceMode,e);t=K(i),B(t)}catch{const i="KVP"===this.serviceMode?"RESTful":"KVP";try{const{data:r}=await this._getCapabilities(i,e);t=K(r),B(t),this.serviceMode=i}catch(e){throw new a.A("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:e})}}const{serviceMode:i,url:r}=this,s=function(e,t){const i=e.documentElement,r=new Map,s=new Map,l=H("Contents",i);if(!l)throw new a.A("wmtslayer:wmts-capabilities-xml-is-not-valid","Can't retrieve xml capabilities element");const o=H("OperationsMetadata",i),n=o?.querySelector("[name='GetTile']"),c=n?.getElementsByTagName("Get"),u=c&&Array.prototype.slice.call(c),p=t.url?.indexOf("https"),d=void 0!==p&&p>-1;let m,h,y=t.serviceMode,f=t?.url;if(u?.length&&u.some(e=>{const t=H("Constraint",e);return!t||z("AllowedValues","Value",y,t)?(f=e.attributes[0].nodeValue,!0):(!t||z("AllowedValues","Value","RESTful",t)||z("AllowedValues","Value","REST",t)?h=e.attributes[0].nodeValue:t&&!z("AllowedValues","Value","KVP",t)||(m=e.attributes[0].nodeValue),!1)}),!f)if(h)f=h,y="RESTful";else if(m)f=m,y="KVP";else{const e=H("ServiceMetadataURL",i);f=e?.getAttribute("xlink:href")}const g=f.indexOf("1.0.0/");-1===g&&"RESTful"===y?f+="/":g>-1&&(f=f.slice(0,g)),"KVP"===y&&(f+=g>-1?"":"?"),d&&(f=f.replace(/^http:/i,"https:"));const w=G("ServiceIdentification>ServiceTypeVersion",i),v=G("ServiceIdentification>AccessConstraints",i),M=v&&/^none$/i.test(v)?null:v,x=J("Layer",l),C=J("TileMatrixSet",l),I=x.map(e=>{const t=G("Identifier",e);return r.set(t,e),Q(t,e,C,d,w)});return{copyright:M,dimensionMap:s,layerMap:r,layers:I,serviceMode:y,tileUrl:f}}(t,{serviceMode:i,url:r});this.read(s,{origin:"service"})}async _getCapabilities(e,t){const i=this._getCapabilitiesUrl(e);return await(0,l.A)(i,{...t,responseType:"text"})}_getTileMatrixSetById(e){const t=this.findSublayerById(this.activeLayer.id);return t?.tileMatrixSets?.find(({id:t})=>t===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...(0,c.o8)(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const i=(0,m.An)(e),r={...i.query,...t},s=(0,m.x0)(r);return""===s?i.path:`${i.path}?${s}`}_getCapabilitiesUrl(e){this.url=(0,m.An)(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const e=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(e,"i");t=t.replace(i,""),t+=e;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=(0,m.An)(e).query;if(!t)return null;const i={};return Object.keys(t).forEach(e=>{i[e.toLowerCase()]=t[e]}),i}_mergeParams(e,t){const i=this._getLowerCasedUrlParams(t);if(i){const t=Object.keys(i);t.length&&(e=e?(0,c.o8)(e):{},t.forEach(t=>{e.hasOwnProperty(t)||ue.has(t)||(e[t]=i[t])}))}return e}};(0,s.Cg)([(0,h.MZ)()],pe.prototype,"dimensionMap",void 0),(0,s.Cg)([(0,h.MZ)()],pe.prototype,"layerMap",void 0),(0,s.Cg)([(0,h.MZ)({type:V,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],pe.prototype,"activeLayer",void 0),(0,s.Cg)([(0,Z.w)("service","activeLayer",["layers"])],pe.prototype,"readActiveLayerFromService",null),(0,s.Cg)([(0,Z.w)(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],pe.prototype,"readActiveLayerFromItemOrWebDoc",null),(0,s.Cg)([(0,ae.K)(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:S.A},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],pe.prototype,"writeActiveLayer",null),(0,s.Cg)([(0,h.MZ)({type:String,value:"",json:{write:!0}})],pe.prototype,"copyright",void 0),(0,s.Cg)([(0,h.MZ)({type:["show","hide"]})],pe.prototype,"listMode",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:!0,write:!0}})],pe.prototype,"blendMode",void 0),(0,s.Cg)([(0,h.MZ)({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],pe.prototype,"customParameters",void 0),(0,s.Cg)([(0,Z.w)(["portal-item","web-document"],"customParameters")],pe.prototype,"readCustomParameters",null),(0,s.Cg)([(0,h.MZ)({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],pe.prototype,"customLayerParameters",void 0),(0,s.Cg)([(0,h.MZ)({type:y.A,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],pe.prototype,"fullExtent",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],pe.prototype,"fullExtents",null),(0,s.Cg)([(0,h.MZ)({type:["WebTiledLayer"]})],pe.prototype,"operationalLayerType",void 0),(0,s.Cg)([(0,h.MZ)()],pe.prototype,"resourceInfo",void 0),(0,s.Cg)([(0,h.MZ)()],pe.prototype,"serviceMode",void 0),(0,s.Cg)([(0,Z.w)(["portal-item","web-document"],"serviceMode",["templateUrl"])],pe.prototype,"readServiceMode",null),(0,s.Cg)([(0,h.MZ)({type:n.A.ofType(V)})],pe.prototype,"sublayers",void 0),(0,s.Cg)([(0,Z.w)("service","sublayers",["layers"])],pe.prototype,"readSublayersFromService",null),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],pe.prototype,"supportedSpatialReferences",null),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],pe.prototype,"tilemapCache",null),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"title"}}})],pe.prototype,"title",null),(0,s.Cg)([(0,h.MZ)({json:{read:!1},readOnly:!0,value:"wmts"})],pe.prototype,"type",void 0),(0,s.Cg)([(0,h.MZ)({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],pe.prototype,"url",null),(0,s.Cg)([(0,h.MZ)()],pe.prototype,"version",void 0),pe=ne=(0,s.Cg)([(0,h.$K)("esri.layers.WMTSLayer")],pe);const de=pe},38458(e,t,i){i.d(t,{m:()=>s});const r=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function s(e){return null!=e&&r.some(([t,i])=>e>=t&&e<=i)}},13043(e,t,i){function r(e,t){if(e&&t)for(const i of e.children)if(i.localName in t){const e=t[i.localName];if("function"==typeof e){const t=e(i);t&&r(i,t)}else r(i,e)}}function*s(e,t){for(const i of e.children)if(i.localName in t){const e=t[i.localName];"function"==typeof e?yield e(i):yield*s(i,e)}}i.d(t,{i:()=>s,p:()=>r})},65509(e,t,i){i.d(t,{A:()=>l});var r=i(49186),s=i(17676);class l{constructor(e,t=0,i=e.lods[e.lods.length-1].level){this.tileInfo=e,this.minLOD=t,this.maxLOD=i,e.lodAt(t)||(this.minLOD=e.lods[0].level),e.lodAt(i)||(this.maxLOD=e.lods[e.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(e,t,i){const r=this.tileInfo?.lodAt(e);return!r||e<this.minLOD||e>this.maxLOD?"unavailable":r.cols&&r.rows?i>=r.cols[0]&&i<=r.cols[1]&&t>=r.rows[0]&&t<=r.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(e,t,i,l){await(0,s.NO)(l);const o=this.getAvailability(e,t,i);if("unavailable"===o)throw new r.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return o}async fetchAvailabilityUpsample(e,t,i,r,l){await(0,s.NO)(l),r.level=e,r.row=t,r.col=i;const o=this.tileInfo;return o.updateTileInfo(r),this.fetchAvailability(e,t,i,l).catch(e=>{if((0,s.zf)(e))throw e;if(o.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,l);throw e})}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[309],{20309(e,t,i){i.r(t),i.d(t,{default:()=>de});var r,s=i(5482),l=i(11254),o=i(4576),n=i(7762),a=i(49186),c=i(4718),u=i(25728),p=i(17676),d=i(36708),m=i(84952),h=i(91429),y=i(5443),f=i(4146),g=i(47314),w=i(63074),v=i(34287),M=i(8303),x=i(54310),C=i(25036),I=i(33446),S=i(87045),T=i(65509),L=i(83703),A=i(25482);let b=r=class extends A.o{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new r;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()??null),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo?.clone()??null),e}};(0,s.Cg)([(0,h.MZ)({type:y.A,json:{read:{source:"fullExtent"}}})],b.prototype,"fullExtent",void 0),(0,s.Cg)([(0,h.MZ)({type:String,json:{read:{source:"id"}}})],b.prototype,"id",void 0),(0,s.Cg)([(0,h.MZ)({type:S.A,json:{read:{source:"tileInfo"}}})],b.prototype,"tileInfo",void 0),b=r=(0,s.Cg)([(0,h.$K)("esri.layers.support.TileMatrixSet")],b);const P=b;var E;let O=E=class extends A.o{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new E;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,s.Cg)([(0,h.MZ)({json:{read:{source:"id"}}})],O.prototype,"id",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"title"}}})],O.prototype,"title",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"abstract"}}})],O.prototype,"description",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"legendUrl"}}})],O.prototype,"legendUrl",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"isDefault"}}})],O.prototype,"isDefault",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"keywords"}}})],O.prototype,"keywords",void 0),O=E=(0,s.Cg)([(0,h.$K)("esri.layers.support.WMTSStyle")],O);const R=O;var F,Z=i(36005);let V=F=class extends A.o{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?y.A.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map(e=>y.A.fromJSON(e)):t.tileMatrixSets?.map(e=>y.A.fromJSON(e.fullExtent)).filter(e=>e)??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats?.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){let e=this._get("styleId");return e||(e=this.styles?.at(0)?.id??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?.find(({id:e})=>e===this.tileMatrixSetId)??null}clone(){const e=new F;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats?.slice()??null),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent?.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles?.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,s.Cg)([(0,h.MZ)()],V.prototype,"description",void 0),(0,s.Cg)([(0,h.MZ)({type:y.A})],V.prototype,"fullExtent",void 0),(0,s.Cg)([(0,Z.w)("fullExtent",["fullExtent"])],V.prototype,"readFullExtent",null),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],V.prototype,"fullExtents",void 0),(0,s.Cg)([(0,Z.w)("fullExtents",["fullExtents","tileMatrixSets"])],V.prototype,"readFullExtents",null),(0,s.Cg)([(0,h.MZ)()],V.prototype,"id",void 0),(0,s.Cg)([(0,h.MZ)()],V.prototype,"imageFormat",null),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"formats"}}})],V.prototype,"imageFormats",void 0),(0,s.Cg)([(0,h.MZ)()],V.prototype,"layer",void 0),(0,s.Cg)([(0,h.MZ)()],V.prototype,"parent",void 0),(0,s.Cg)([(0,h.MZ)()],V.prototype,"styleId",null),(0,s.Cg)([(0,h.MZ)({type:n.A.ofType(R),json:{read:{source:"styles"}}})],V.prototype,"styles",void 0),(0,s.Cg)([(0,h.MZ)({json:{write:{ignoreOrigin:!0}}})],V.prototype,"title",void 0),(0,s.Cg)([(0,h.MZ)()],V.prototype,"tileMatrixSetId",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],V.prototype,"tileMatrixSet",null),(0,s.Cg)([(0,h.MZ)({type:n.A.ofType(P),json:{read:{source:"tileMatrixSets"}}})],V.prototype,"tileMatrixSets",void 0),V=F=(0,s.Cg)([(0,h.$K)("esri.layers.support.WMTSSublayer")],V);var U=i(73941),j=i(86738),_=i(22530),N=i(38458),k=i(13043),D=i(91806);const W=90.71428571428571;function K(e){const t=e.replaceAll(/ows:/gi,"");return(new DOMParser).parseFromString(t,"text/xml")}function B(e){if(!H("Contents",e.documentElement))throw new a.A("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant")}function $(e){return e.nodeType===Node.ELEMENT_NODE}function H(e,t){for(let i=0;i<t.childNodes.length;i++){const r=t.childNodes[i];if($(r)&&r.nodeName===e)return r}return null}function J(e,t){const i=[];for(let r=0;r<t.childNodes.length;r++){const s=t.childNodes[r];$(s)&&s.nodeName===e&&i.push(s)}return i}function q(e,t){const i=[];for(let r=0;r<t.childNodes.length;r++){const s=t.childNodes[r];$(s)&&s.nodeName===e&&i.push(s)}return i.map(e=>e.textContent).filter(o.Ru)}function G(e,t){return e.split(">").forEach(e=>{t&&(t=H(e,t))}),t&&t.textContent}function z(e,t,i,r){let s;return Array.prototype.slice.call(r.childNodes).some(r=>{if(r.nodeName.includes(e)){const e=H(t,r),l=e?.textContent;if(l===i||i.split(":")&&i.split(":")[1]===l)return s=r,!0}return!1}),s}function Q(e,t,i,r,s){const l=G("Abstract",t),o=q("Format",t);return{id:e,fullExtent:Y(t),fullExtents:ee(t),description:l,formats:o,styles:te(t,r),title:G("Title",t),tileMatrixSets:ie(s,t,i)}}function X(e,t){const i=[],r=e.layerMap?.get(t);if(!r)return null;const s=J("ResourceURL",r),l=J("Dimension",r);let o,n,a,c;return l.length&&(o=G("Identifier",l[0]),n=q("Default",l[0])||q("Value",l[0])),l.length>1&&(a=G("Identifier",l[1]),c=q("Default",l[1])||q("Value",l[1])),e.dimensionMap.set(t,{dimensions:n,dimensions2:c}),s.forEach(e=>{let t=e.getAttribute("template");if("tile"===e.getAttribute("resourceType")){if(o&&n.length)if(t.includes("{"+o+"}"))t=t.replace("{"+o+"}","{dimensionValue}");else{const e=t.toLowerCase().indexOf("{"+o.toLowerCase()+"}");e>-1&&(t=t.slice(0,e)+"{dimensionValue}"+t.slice(e+o.length+2))}if(a&&c.length)if(t.includes("{"+a+"}"))t=t.replace("{"+a+"}","{dimensionValue2}");else{const e=t.toLowerCase().indexOf("{"+a.toLowerCase()+"}");e>-1&&(t=t.slice(0,e)+"{dimensionValue2}"+t.slice(e+a.length+2))}i.push({template:t,format:e.getAttribute("format"),resourceType:"tile"})}}),i}function Y(e){const t=H("WGS84BoundingBox",e),i=t?G("LowerCorner",t).split(" "):["-180","-90"],r=t?G("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(i[0]),ymin:parseFloat(i[1]),xmax:parseFloat(r[0]),ymax:parseFloat(r[1]),spatialReference:{wkid:4326}}}function ee(e){const t=[];return(0,k.p)(e,{BoundingBox:e=>{if(!e.getAttribute("crs"))return;const i=e.getAttribute("crs").toLowerCase(),r=re(i),s=i.includes("epsg")&&(0,N.m)(r.wkid);let l,o,n,a;(0,k.p)(e,{LowerCorner:e=>{[l,o]=e.textContent.split(" ").map(e=>Number.parseFloat(e)),s&&([l,o]=[o,l])},UpperCorner:e=>{[n,a]=e.textContent.split(" ").map(e=>Number.parseFloat(e)),s&&([n,a]=[a,n])}}),t.push({xmin:l,ymin:o,xmax:n,ymax:a,spatialReference:r})}}),t}function te(e,t){return J("Style",e).map(e=>{const i=H("LegendURL",e),r=H("Keywords",e),s=r?q("Keyword",r):[];let l=i?.getAttribute("xlink:href");return t&&(l=l?.replace(/^http:/i,"https:")),{abstract:G("Abstract",e),id:G("Identifier",e),isDefault:"true"===e.getAttribute("isDefault"),keywords:s,legendUrl:l,title:G("Title",e)}})}function ie(e,t,i){return J("TileMatrixSetLink",t).map(t=>function(e,t,i){const r=H("TileMatrixSet",t).textContent,s=q("TileMatrix",t),l=i.find(e=>{const t=H("Identifier",e),i=t?.textContent;return!!(i===r||r.split(":")&&r.split(":")[1]===i)}),o=H("TileMatrixSetLimits",t),n=o&&J("TileMatrixLimits",o),a=new Map;if(n?.length)for(const e of n){const t=H("TileMatrix",e).textContent,i=+H("MinTileRow",e).textContent,r=+H("MaxTileRow",e).textContent,s=+H("MinTileCol",e).textContent,l=+H("MaxTileCol",e).textContent;a.set(t,{minCol:s,maxCol:l,minRow:i,maxRow:r})}const c=G("SupportedCRS",l).toLowerCase(),u=function(e,t){return se(H("TileMatrix",e),t)}(l,c),p=u.spatialReference,d=H("TileMatrix",l),m=[parseInt(G("TileWidth",d),10),parseInt(G("TileHeight",d),10)],h=[];s.length?s.forEach((e,t)=>{const i=z("TileMatrix","Identifier",e,l);h.push(le(i,c,t,r,a))}):J("TileMatrix",l).forEach((e,t)=>{h.push(le(e,c,t,r,a))});const f=function(e,t,i,r,s){const l=H("BoundingBox",t);let o,n,a,c,u,p;if(l&&(o=G("LowerCorner",l).split(" "),n=G("UpperCorner",l).split(" ")),o&&o.length>1&&n&&n.length>1)a=parseFloat(o[0]),u=parseFloat(o[1]),c=parseFloat(n[0]),p=parseFloat(n[1]);else{const e=H("TileMatrix",t),l=parseInt(G("MatrixWidth",e),10),o=parseInt(G("MatrixHeight",e),10);a=i.x,p=i.y,c=a+l*r[0]*s.resolution,u=p-o*r[1]*s.resolution}return function(e,t,i){return"1.0.0"===e&&(0,N.m)(t.wkid)&&!(i.spatialReference.isGeographic&&i.x<-90&&i.y>=-90)}(e,i.spatialReference,i)?new y.A(u,a,p,c,i.spatialReference):new y.A(a,u,c,p,i.spatialReference)}(e,l,u,m,h[0]).toJSON(),g=new S.A({dpi:96,spatialReference:p,size:m,origin:u,lods:h}).toJSON();return{id:r,fullExtent:f,tileInfo:g}}(e,t,i))}function re(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);900913!==t&&3857!==t||(t=102100);const i=function(e){return e.includes("crs84")||e.includes("crs:84")?4326:e.includes("crs83")||e.includes("crs:83")?4269:e.includes("crs27")||e.includes("crs:27")?4267:null}(e);return null!=i&&(t=i),{wkid:t}}function se(e,t){const i=re(t),[r,s]=G("TopLeftCorner",e).split(" ").map(e=>parseFloat(e)),l=t.includes("epsg")&&(0,N.m)(i.wkid);return new j.A(l?{x:s,y:r,spatialReference:i}:{x:r,y:s,spatialReference:i})}function le(e,t,i,r,s){const l=re(t),o=G("Identifier",e);let n=parseFloat(G("ScaleDenominator",e));const a=oe(l.wkid,n,r);n*=96/W;const c=+G("MatrixWidth",e),u=+G("MatrixHeight",e),{maxCol:p=c-1,maxRow:d=u-1,minCol:m=0,minRow:h=0}=s.get(o)??{},{x:y,y:f}=se(e,t);return new D.A({cols:[m,p],level:i,levelValue:o,origin:[y,f],scale:n,resolution:a,rows:[h,d]})}function oe(e,t,i){let r;return r=_.A.hasOwnProperty(""+e)?_.A.values[_.A[e]]:"default028mm"===i?6370997*Math.PI/180:(0,U.y7)(e).metersPerDegree,7*t/25e3/r}var ne,ae=i(43937);const ce={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},ue=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let pe=ne=class extends((0,w.dM)((0,x.J)((0,C.j)((0,v.q)((0,M.A)((0,u.M)(f.A))))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([(0,d.wB)(()=>this.activeLayer,(e,t)=>{t&&!this.sublayers?.includes(t)&&(t.layer=null,t.parent=null),e&&(e.layer=this,e.parent=this)},d.OH),(0,d.on)(()=>this.sublayers,"after-add",({item:e})=>{e.layer=this,e.parent=this},d.OH),(0,d.on)(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=null,e.parent=null},d.OH),(0,d.wB)(()=>this.sublayers,(e,t)=>{if(t)for(const e of t)e.layer=null,e.parent=null;if(e)for(const t of e)t.layer=this,t.parent=this},d.OH)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(p.QP).then(()=>this._fetchService(e)).catch(e=>{throw(0,p.QP)(e),new a.A("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:e})})),Promise.resolve(this)}readActiveLayerFromService(e,t,i){this.activeLayer||(this.activeLayer=new V);let r=t.layers.find(e=>e.id===this.activeLayer.id);return r||(r=t.layers[0]),this.activeLayer.read(r,i),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:i,wmtsInfo:r}=t,s=i?this._getLowerCasedUrlParams(i):null,l=r?.layerIdentifier;let o=null;const n=r?.tileMatrixSet;n&&(Array.isArray(n)?n.length&&(o=n[0]):o=n);const a=s?.format,c=s?.style;return new V({id:l,imageFormat:a,styleId:c,tileMatrixSetId:o})}writeActiveLayer(e,t,i,r){const{activeLayer:s,loaded:l}=this,{id:o,tileMatrixSet:n,tileMatrixSetId:a,imageFormat:c,styleId:u}=s;t.templateUrl=l?this.getUrlTemplate(o,a,c,u):void 0,t.tileInfo=l?n?.tileInfo?.toJSON(r)??null:void 0,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:o,tileMatrixSet:a}}readCustomParameters(e,t){const i=t.wmtsInfo;return i?this._mergeParams(i.customParameters,i.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,i){return function(e,t){return e.map(e=>{const i=new V;return i.read(e,t),i})}(t.layers,i)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(o.Ru)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new T.A(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),i=this._getTileMatrixSetById(e.tileMatrixSetId),r=i?.tileInfo,s=e.fullExtent,l=new L.x({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(l.customLayerParameters=this.customLayerParameters),this.customParameters&&(l.customParameters=this.customParameters),new g.default({fullExtent:s,urlTemplate:t,tileInfo:r,wmtsInfo:l})}async fetchTile(e,t,i,r={}){const{signal:s}=r,o=this.getTileUrl(e,t,i),{data:n}=await(0,l.A)(o,{responseType:"image",signal:s});return n}async fetchImageBitmapTile(e,t,i,r={}){const{signal:s}=r;if(this.fetchTile!==ne.prototype.fetchTile){const s=await this.fetchTile(e,t,i,r);return(0,I.Cp)(s,e,t,i,r)}const o=this.getTileUrl(e,t,i),{data:n}=await(0,l.A)(o,{responseType:"blob",signal:s});return(0,I.Cp)(n,e,t,i,r)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,i){const r=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=r?.tileInfo?.lods[e],l=s?s.levelValue||`${s.level}`:`${e}`;let o=this.resourceInfo?"":function(e,t,i,r,s,l,o,n){const a=function(e,t,i){const r=X(e,t),s=r?.filter(e=>e.format===i);return(s?.length?s:r)??[]}(e,t,r);if(!(a?.length>0))return"";const{dimensionMap:c}=e,u=c.get(t).dimensions?.[0],p=c.get(t).dimensions2?.[0];return a[o%a.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,i??"").replaceAll(/\{TileMatrix\}/gi,l).replaceAll(/\{TileRow\}/gi,""+o).replaceAll(/\{TileCol\}/gi,""+n).replaceAll(/\{dimensionValue\}/gi,u).replaceAll(/\{dimensionValue2\}/gi,p)}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,l,t,i);return o||(o=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,l).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${i}`)),o=this._appendCustomLayerParameters(o),o}getUrlTemplate(e,t,i,r){if(!this.resourceInfo){const i=function(e,t,i,r){const{dimensionMap:s}=e,l=X(e,t);let o="";if(l&&l.length>0){const e=s.get(t).dimensions?.[0],n=s.get(t).dimensions2?.[0];o=l[0].template,o.endsWith(".xxx")&&(o=o.slice(0,-4)),o=o.replaceAll(/\{Style\}/gi,r),o=o.replaceAll(/\{TileMatrixSet\}/gi,i),o=o.replaceAll(/\{TileMatrix\}/gi,"{level}"),o=o.replaceAll(/\{TileRow\}/gi,"{row}"),o=o.replaceAll(/\{TileCol\}/gi,"{col}"),o=o.replaceAll(/\{dimensionValue\}/gi,e),o=o.replaceAll(/\{dimensionValue2\}/gi,n)}return o}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,r);if(i)return i}if("KVP"===this.serviceMode)return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+r+"&FORMAT="+i+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if("RESTful"===this.serviceMode){let s="";const l=i.toLowerCase();return ce[l]&&(s=ce[l]),this.url+e+"/"+r+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){if(this.resourceInfo)return"KVP"!==this.resourceInfo.serviceMode||this.url.includes("?")||(this.url+="?"),function(e){for(const t of e.layers)for(const e of t.tileMatrixSets??[]){const{tileInfo:t}=e;if(t&&96!==t.dpi){for(const i of t.lods??[])i.scale=96*i.scale/t.dpi,i.resolution=oe(t.spatialReference?.wkid,i.scale*W/96,e.id);t.dpi=96}}}(this.resourceInfo),void this.read(this.resourceInfo,{origin:"service"});let t=null;try{const{data:i}=await this._getCapabilities(this.serviceMode,e);t=K(i),B(t)}catch{const i="KVP"===this.serviceMode?"RESTful":"KVP";try{const{data:r}=await this._getCapabilities(i,e);t=K(r),B(t),this.serviceMode=i}catch(e){throw new a.A("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:e})}}const{serviceMode:i,url:r}=this,s=function(e,t){const i=e.documentElement,r=new Map,s=new Map,l=H("Contents",i);if(!l)throw new a.A("wmtslayer:wmts-capabilities-xml-is-not-valid","Can't retrieve xml capabilities element");const o=H("OperationsMetadata",i),n=o?.querySelector("[name='GetTile']"),c=n?.getElementsByTagName("Get"),u=c&&Array.prototype.slice.call(c),p=t.url?.indexOf("https"),d=void 0!==p&&p>-1;let m,h,y=t.serviceMode,f=t?.url;if(u?.length&&u.some(e=>{const t=H("Constraint",e);return!t||z("AllowedValues","Value",y,t)?(f=e.attributes[0].nodeValue,!0):(!t||z("AllowedValues","Value","RESTful",t)||z("AllowedValues","Value","REST",t)?h=e.attributes[0].nodeValue:t&&!z("AllowedValues","Value","KVP",t)||(m=e.attributes[0].nodeValue),!1)}),!f)if(h)f=h,y="RESTful";else if(m)f=m,y="KVP";else{const e=H("ServiceMetadataURL",i);f=e?.getAttribute("xlink:href")}const g=f.indexOf("1.0.0/");-1===g&&"RESTful"===y?f+="/":g>-1&&(f=f.slice(0,g)),"KVP"===y&&(f+=g>-1?"":"?"),d&&(f=f.replace(/^http:/i,"https:"));const w=G("ServiceIdentification>ServiceTypeVersion",i),v=G("ServiceIdentification>AccessConstraints",i),M=v&&/^none$/i.test(v)?null:v,x=J("Layer",l),C=J("TileMatrixSet",l),I=x.map(e=>{const t=G("Identifier",e);return r.set(t,e),Q(t,e,C,d,w)});return{copyright:M,dimensionMap:s,layerMap:r,layers:I,serviceMode:y,tileUrl:f}}(t,{serviceMode:i,url:r});this.read(s,{origin:"service"})}async _getCapabilities(e,t){const i=this._getCapabilitiesUrl(e);return await(0,l.A)(i,{...t,responseType:"text"})}_getTileMatrixSetById(e){const t=this.findSublayerById(this.activeLayer.id);return t?.tileMatrixSets?.find(({id:t})=>t===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...(0,c.o8)(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const i=(0,m.An)(e),r={...i.query,...t},s=(0,m.x0)(r);return""===s?i.path:`${i.path}?${s}`}_getCapabilitiesUrl(e){this.url=(0,m.An)(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const e=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(e,"i");t=t.replace(i,""),t+=e;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=(0,m.An)(e).query;if(!t)return null;const i={};return Object.keys(t).forEach(e=>{i[e.toLowerCase()]=t[e]}),i}_mergeParams(e,t){const i=this._getLowerCasedUrlParams(t);if(i){const t=Object.keys(i);t.length&&(e=e?(0,c.o8)(e):{},t.forEach(t=>{e.hasOwnProperty(t)||ue.has(t)||(e[t]=i[t])}))}return e}};(0,s.Cg)([(0,h.MZ)()],pe.prototype,"dimensionMap",void 0),(0,s.Cg)([(0,h.MZ)()],pe.prototype,"layerMap",void 0),(0,s.Cg)([(0,h.MZ)({type:V,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],pe.prototype,"activeLayer",void 0),(0,s.Cg)([(0,Z.w)("service","activeLayer",["layers"])],pe.prototype,"readActiveLayerFromService",null),(0,s.Cg)([(0,Z.w)(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],pe.prototype,"readActiveLayerFromItemOrWebDoc",null),(0,s.Cg)([(0,ae.K)(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:S.A},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],pe.prototype,"writeActiveLayer",null),(0,s.Cg)([(0,h.MZ)({type:String,value:"",json:{write:!0}})],pe.prototype,"copyright",void 0),(0,s.Cg)([(0,h.MZ)({type:["show","hide"]})],pe.prototype,"listMode",void 0),(0,s.Cg)([(0,h.MZ)({json:{read:!0,write:!0}})],pe.prototype,"blendMode",void 0),(0,s.Cg)([(0,h.MZ)({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],pe.prototype,"customParameters",void 0),(0,s.Cg)([(0,Z.w)(["portal-item","web-document"],"customParameters")],pe.prototype,"readCustomParameters",null),(0,s.Cg)([(0,h.MZ)({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],pe.prototype,"customLayerParameters",void 0),(0,s.Cg)([(0,h.MZ)({type:y.A,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],pe.prototype,"fullExtent",void 0),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],pe.prototype,"fullExtents",null),(0,s.Cg)([(0,h.MZ)({type:["WebTiledLayer"]})],pe.prototype,"operationalLayerType",void 0),(0,s.Cg)([(0,h.MZ)()],pe.prototype,"resourceInfo",void 0),(0,s.Cg)([(0,h.MZ)()],pe.prototype,"serviceMode",void 0),(0,s.Cg)([(0,Z.w)(["portal-item","web-document"],"serviceMode",["templateUrl"])],pe.prototype,"readServiceMode",null),(0,s.Cg)([(0,h.MZ)({type:n.A.ofType(V)})],pe.prototype,"sublayers",void 0),(0,s.Cg)([(0,Z.w)("service","sublayers",["layers"])],pe.prototype,"readSublayersFromService",null),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],pe.prototype,"supportedSpatialReferences",null),(0,s.Cg)([(0,h.MZ)({readOnly:!0})],pe.prototype,"tilemapCache",null),(0,s.Cg)([(0,h.MZ)({json:{read:{source:"title"}}})],pe.prototype,"title",null),(0,s.Cg)([(0,h.MZ)({json:{read:!1},readOnly:!0,value:"wmts"})],pe.prototype,"type",void 0),(0,s.Cg)([(0,h.MZ)({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],pe.prototype,"url",null),(0,s.Cg)([(0,h.MZ)()],pe.prototype,"version",void 0),pe=ne=(0,s.Cg)([(0,h.$K)("esri.layers.WMTSLayer")],pe);const de=pe},38458(e,t,i){i.d(t,{m:()=>s});const r=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function s(e){return null!=e&&r.some(([t,i])=>e>=t&&e<=i)}},13043(e,t,i){function r(e,t){if(e&&t)for(const i of e.children)if(i.localName in t){const e=t[i.localName];if("function"==typeof e){const t=e(i);t&&r(i,t)}else r(i,e)}}function*s(e,t){for(const i of e.children)if(i.localName in t){const e=t[i.localName];"function"==typeof e?yield e(i):yield*s(i,e)}}i.d(t,{i:()=>s,p:()=>r})},65509(e,t,i){i.d(t,{A:()=>l});var r=i(49186),s=i(17676);class l{constructor(e,t=0,i=e.lods[e.lods.length-1].level){this.tileInfo=e,this.minLOD=t,this.maxLOD=i,e.lodAt(t)||(this.minLOD=e.lods[0].level),e.lodAt(i)||(this.maxLOD=e.lods[e.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(e,t,i){const r=this.tileInfo?.lodAt(e);return!r||e<this.minLOD||e>this.maxLOD?"unavailable":r.cols&&r.rows?i>=r.cols[0]&&i<=r.cols[1]&&t>=r.rows[0]&&t<=r.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(e,t,i,l){await(0,s.NO)(l);const o=this.getAvailability(e,t,i);if("unavailable"===o)throw new r.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return o}async fetchAvailabilityUpsample(e,t,i,r,l){await(0,s.NO)(l),r.level=e,r.row=t,r.col=i;const o=this.tileInfo;return o.updateTileInfo(r),this.fetchAvailability(e,t,i,l).catch(e=>{if((0,s.zf)(e))throw e;if(o.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,l);throw e})}}}}]);