@arcgis/core 4.33.0-next.20250204 → 4.33.0-next.20250206

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 (148) hide show
  1. package/assets/components/assets/icon/dualImageArea16.json +1 -0
  2. package/assets/components/assets/icon/dualImageArea24.json +1 -0
  3. package/assets/components/assets/icon/dualImageArea32.json +1 -0
  4. package/assets/components/assets/icon/dualImageDistance16.json +1 -0
  5. package/assets/components/assets/icon/dualImageDistance24.json +1 -0
  6. package/assets/components/assets/icon/dualImageDistance32.json +1 -0
  7. package/assets/components/assets/icon/dualImageLocation16.json +1 -0
  8. package/assets/components/assets/icon/dualImageLocation24.json +1 -0
  9. package/assets/components/assets/icon/dualImageLocation32.json +1 -0
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/06f693780f70e5a627c4.js +1 -0
  12. package/assets/esri/core/workers/chunks/{24a86c52c8bdd0b5eb4d.js → 09a99c556089c166d1f8.js} +1 -1
  13. package/assets/esri/core/workers/chunks/15f850c9a1154fc57e5a.js +1 -0
  14. package/assets/esri/core/workers/chunks/{9b4f471fcd8a3b5e089f.js → 192569dfa7c0ea8dd864.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1a2e1a414e651e988435.js.LICENSE.txt +1 -1
  16. package/assets/esri/core/workers/chunks/24e47f748f0e4f815c6e.js +1 -0
  17. package/assets/esri/core/workers/chunks/28374a64790342e1b5ae.js +1 -0
  18. package/assets/esri/core/workers/chunks/{c3f03ccabca691186aad.js → 287362f9af132fafe4de.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{ad215219e5eef8598745.js → 28dbbfc44cc2bdcd221d.js} +1 -1
  20. package/assets/esri/core/workers/chunks/2adc533dadcb018a9755.js +1 -0
  21. package/assets/esri/core/workers/chunks/308ec51ff4a66f7fcb0d.js.LICENSE.txt +1 -1
  22. package/assets/esri/core/workers/chunks/333091ab2e267652ed56.js +1 -0
  23. package/assets/esri/core/workers/chunks/354531dc2f0dea2ad96f.js.LICENSE.txt +1 -1
  24. package/assets/esri/core/workers/chunks/38cd7745b8ef1b8b6196.js +1 -0
  25. package/assets/esri/core/workers/chunks/{8a1e4f65fc81aba7a704.js → 4122d10bc910e888eee1.js} +1 -1
  26. package/assets/esri/core/workers/chunks/41cd1a5c99ab3bbd1fb4.js +1 -0
  27. package/assets/esri/core/workers/chunks/433576983754f690bcc7.js +1 -0
  28. package/assets/esri/core/workers/chunks/{b1269b51cef3e11c85e3.js → 48ecc5a74fecbb2b9c6f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{b8a519d5d24b2e728ff8.js → 5a25cef6355fd20e44e7.js} +2 -2
  30. package/assets/esri/core/workers/chunks/{b8a519d5d24b2e728ff8.js.LICENSE.txt → 5a25cef6355fd20e44e7.js.LICENSE.txt} +1 -1
  31. package/assets/esri/core/workers/chunks/{8edae4ca2b18a219a43e.js → 5e7f16b312077ca8c18d.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{7a0415db78c68d31733f.js → 6039da57a2adedd3b83f.js} +1 -1
  33. package/assets/esri/core/workers/chunks/72cf9192292e5c85c6df.js.LICENSE.txt +1 -1
  34. package/assets/esri/core/workers/chunks/73d03c208242778e67bf.js +1 -0
  35. package/assets/esri/core/workers/chunks/{e4f82b5b50996b1ae48e.js → 746c964cf07e4306f21f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/77764ca90bdd13ee2167.js.LICENSE.txt +1 -1
  37. package/assets/esri/core/workers/chunks/{723a9fba144e2fa6d017.js → 7cb09e58bcc537ec1f7a.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{07360fde6ea65664e6ca.js → 82d26884127ed772cc4b.js} +1 -1
  39. package/assets/esri/core/workers/chunks/842db06ce62758fab1e7.js +1 -0
  40. package/assets/esri/core/workers/chunks/{60cd8f4bba3e682ba57e.js → 91d2bdfa6e34c10b7f50.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{12dd892cf61a76fb40ad.js → 991e0f619f1f81f94d56.js} +1 -1
  42. package/assets/esri/core/workers/chunks/9a27824d94df702e6e28.js +1 -0
  43. package/assets/esri/core/workers/chunks/{610b33b7291cffcc4e5d.js → a42ae5d5e5f66d120b4d.js} +1 -1
  44. package/assets/esri/core/workers/chunks/a5e9ea13e844a62b2a7f.js +1 -0
  45. package/assets/esri/core/workers/chunks/b21b152fa15896577242.js.LICENSE.txt +1 -1
  46. package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +1 -0
  47. package/assets/esri/core/workers/chunks/{da77eefaad83c0644380.js → b8fae500c69ca2cff62a.js} +1 -1
  48. package/assets/esri/core/workers/chunks/b9d9a1dc3c5d799e2685.js +1 -0
  49. package/assets/esri/core/workers/chunks/{9c5c6ecaf5be24279fa5.js → ddc30044f61a2c2df3fe.js} +1 -1
  50. package/assets/esri/core/workers/chunks/e26dc0c1654316bb1558.js +1 -0
  51. package/assets/esri/core/workers/chunks/ef6279f5c63ab1e88c71.js +1 -0
  52. package/assets/esri/core/workers/chunks/{0711d3ad4d403bcfdcad.js → f117a89d1f4001a1f9f0.js} +1 -1
  53. package/assets/esri/core/workers/chunks/f4e48bbdbc9da10ec71a.js +1 -0
  54. package/assets/esri/core/workers/chunks/f9e48205178a5a804d38.js +1 -0
  55. package/assets/esri/themes/base/widgets/_Directions.scss +74 -17
  56. package/assets/esri/themes/dark/main.css +1 -1
  57. package/assets/esri/themes/light/main.css +1 -1
  58. package/assets/esri/themes/light/view.css +1 -1
  59. package/chunks/ColorMaterial.glsl.js +4 -5
  60. package/chunks/Pattern.glsl.js +1 -1
  61. package/chunks/WaterSurface.glsl.js +2 -2
  62. package/geometry/operators/projectOperator.js +1 -1
  63. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  64. package/geometry/support/meshUtils/elevation.js +1 -1
  65. package/interfaces.d.ts +76 -28
  66. package/layers/Layer.js +1 -1
  67. package/layers/graphics/data/FeatureStore.js +1 -1
  68. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  69. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  70. package/layers/ogc/wcsUtils.js +1 -1
  71. package/layers/support/RasterFunctionTemplate.js +1 -1
  72. package/layers/support/Sublayer.js +1 -1
  73. package/layers/support/capabilities.js +1 -1
  74. package/layers/support/featureLayerUtils.js +1 -1
  75. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  76. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  77. package/layers/support/rasterDatasets/wcsCapabilitiesParser.js +1 -1
  78. package/layers/support/rasterFunctionUtils.d.ts +2 -1
  79. package/layers/support/rasterFunctionUtils.js +1 -1
  80. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
  81. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  82. package/package.json +2 -2
  83. package/rest/query/operations/queryAttachments.js +1 -1
  84. package/rest/support/AttachmentQuery.js +1 -1
  85. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  86. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  87. package/support/revision.js +1 -1
  88. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  89. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  90. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  91. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  92. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  93. package/views/2d/layers/LayerView2D.js +1 -1
  94. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  95. package/views/2d/layers/TileLayerView2D.js +1 -1
  96. package/views/2d/layers/graphics/HighlightGraphicContainer.js +1 -1
  97. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  98. package/views/2d/layers/support/util.js +1 -1
  99. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  100. package/views/3d/layers/MediaLayerView3D.js +1 -1
  101. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  102. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  103. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  104. package/views/3d/terrain/OverlayManager.js +1 -1
  105. package/views/3d/terrain/OverlayRenderer.js +1 -1
  106. package/views/3d/terrain/TerrainSurface.js +1 -1
  107. package/views/3d/webgl-engine/Stage.js +1 -1
  108. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  109. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  110. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  111. package/views/LayerViewManager.js +1 -1
  112. package/views/SceneView.js +1 -1
  113. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  114. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileCache.js +1 -1
  115. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  116. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  117. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  118. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  119. package/widgets/Directions.js +1 -1
  120. package/widgets/Editor/UpdateWorkflow.js +1 -1
  121. package/widgets/Editor/support/EditorItem.js +1 -1
  122. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  123. package/widgets/Feature/FeatureViewModel.js +1 -1
  124. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  125. package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
  126. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  127. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  128. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  129. package/widgets/support/geolocationUtils.js +1 -1
  130. package/assets/esri/core/workers/chunks/04306c2760c1f5b19966.js +0 -1
  131. package/assets/esri/core/workers/chunks/1e3ab66d0e8a7f160f33.js +0 -1
  132. package/assets/esri/core/workers/chunks/380d37ceb8cf52bad190.js +0 -1
  133. package/assets/esri/core/workers/chunks/39e38aab86dcee3f79be.js +0 -1
  134. package/assets/esri/core/workers/chunks/3ce826ebf0692363309d.js +0 -1
  135. package/assets/esri/core/workers/chunks/402de76b5de05615e111.js +0 -1
  136. package/assets/esri/core/workers/chunks/69d307758262e5d7a32e.js +0 -1
  137. package/assets/esri/core/workers/chunks/6dee40b94f94ee7bc4e4.js +0 -1
  138. package/assets/esri/core/workers/chunks/7a3e4cb5f64dac2cfe0e.js +0 -1
  139. package/assets/esri/core/workers/chunks/7e4d72279cc599b7029c.js +0 -1
  140. package/assets/esri/core/workers/chunks/8438fba57e82e4cc7c11.js +0 -1
  141. package/assets/esri/core/workers/chunks/92155d112ebb6a4c6c6e.js +0 -1
  142. package/assets/esri/core/workers/chunks/ba37ab9e560644dc1f18.js +0 -1
  143. package/assets/esri/core/workers/chunks/bbbe5d6cb8b737811c84.js +0 -1
  144. package/assets/esri/core/workers/chunks/bf26f58210755875748c.js +0 -1
  145. package/assets/esri/core/workers/chunks/c7a94e569c905f97244a.js +0 -1
  146. package/assets/esri/core/workers/chunks/d8c762ca94e3a11b125d.js +0 -1
  147. package/assets/esri/core/workers/chunks/dbc447413ab40a79ba87.js +0 -1
  148. package/assets/esri/core/workers/chunks/f48ef415b90edc7ccadd.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2015],{87317:(e,t,s)=>{s.d(t,{a:()=>_,b:()=>c,c:()=>r,d:()=>f,e:()=>I,f:()=>y,g:()=>a,h:()=>x,j:()=>d,l:()=>p,n:()=>g,s:()=>i,t:()=>m});var n=s(34304);function r(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function i(e,t,s,n,r){return e[0]=t,e[1]=s,e[2]=n,e[3]=r,e}function a(e,t,s){return e[0]=t[0]+s[0],e[1]=t[1]+s[1],e[2]=t[2]+s[2],e[3]=t[3]+s[3],e}function o(e,t,s){return e[0]=t[0]-s[0],e[1]=t[1]-s[1],e[2]=t[2]-s[2],e[3]=t[3]-s[3],e}function l(e,t,s){return e[0]=t[0]*s[0],e[1]=t[1]*s[1],e[2]=t[2]*s[2],e[3]=t[3]*s[3],e}function h(e,t,s){return e[0]=t[0]/s[0],e[1]=t[1]/s[1],e[2]=t[2]/s[2],e[3]=t[3]/s[3],e}function c(e,t,s){return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e}function u(e,t){const s=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return Math.sqrt(s*s+n*n+r*r+i*i)}function f(e,t){const s=t[0]-e[0],n=t[1]-e[1],r=t[2]-e[2],i=t[3]-e[3];return s*s+n*n+r*r+i*i}function d(e){const t=e[0],s=e[1],n=e[2],r=e[3];return Math.sqrt(t*t+s*s+n*n+r*r)}function y(e){const t=e[0],s=e[1],n=e[2],r=e[3];return t*t+s*s+n*n+r*r}function g(e,t){const s=t[0],n=t[1],r=t[2],i=t[3];let a=s*s+n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a),e[0]=s*a,e[1]=n*a,e[2]=r*a,e[3]=i*a),e}function x(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function p(e,t,s,n){const r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r+n*(s[0]-r),e[1]=i+n*(s[1]-i),e[2]=a+n*(s[2]-a),e[3]=o+n*(s[3]-o),e}function m(e,t,s){const n=t[0],r=t[1],i=t[2],a=t[3];return e[0]=s[0]*n+s[4]*r+s[8]*i+s[12]*a,e[1]=s[1]*n+s[5]*r+s[9]*i+s[13]*a,e[2]=s[2]*n+s[6]*r+s[10]*i+s[14]*a,e[3]=s[3]*n+s[7]*r+s[11]*i+s[15]*a,e}function _(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function I(e,t){const s=e[0],r=e[1],i=e[2],a=e[3],o=t[0],l=t[1],h=t[2],c=t[3],u=(0,n.FD)();return Math.abs(s-o)<=u*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(r-l)<=u*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-h)<=u*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-c)<=u*Math.max(1,Math.abs(a),Math.abs(c))}const b=o,M=l,w=h,P=u,T=f,A=d,D=y;Object.freeze(Object.defineProperty({__proto__:null,add:a,ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},copy:r,copyVec3:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},dist:P,distance:u,div:w,divide:h,dot:x,equals:I,exactEquals:_,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},len:A,length:d,lerp:p,max:function(e,t,s){return e[0]=Math.max(t[0],s[0]),e[1]=Math.max(t[1],s[1]),e[2]=Math.max(t[2],s[2]),e[3]=Math.max(t[3],s[3]),e},min:function(e,t,s){return e[0]=Math.min(t[0],s[0]),e[1]=Math.min(t[1],s[1]),e[2]=Math.min(t[2],s[2]),e[3]=Math.min(t[3],s[3]),e},mul:M,multiply:l,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},normalize:g,random:function(e,t=1){const s=n.Ov;let r,i,a,o,l,h;do{r=2*s()-1,i=2*s()-1,l=r*r+i*i}while(l>=1);do{a=2*s()-1,o=2*s()-1,h=a*a+o*o}while(h>=1);const c=Math.sqrt((1-l)/h);return e[0]=t*r,e[1]=t*i,e[2]=t*a*c,e[3]=t*o*c,e},round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e},scale:c,scaleAndAdd:function(e,t,s,n){return e[0]=t[0]+s[0]*n,e[1]=t[1]+s[1]*n,e[2]=t[2]+s[2]*n,e[3]=t[3]+s[3]*n,e},set:i,sqrDist:T,sqrLen:D,squaredDistance:f,squaredLength:y,str:function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},sub:b,subtract:o,transformMat4:m,transformQuat:function(e,t,s){const n=t[0],r=t[1],i=t[2],a=s[0],o=s[1],l=s[2],h=s[3],c=h*n+o*i-l*r,u=h*r+l*n-a*i,f=h*i+a*r-o*n,d=-a*n-o*r-l*i;return e[0]=c*h+d*-a+u*-l-f*-o,e[1]=u*h+d*-o+f*-a-c*-l,e[2]=f*h+d*-l+c*-o-u*-a,e[3]=t[3],e}},Symbol.toStringTag,{value:"Module"}))},40876:(e,t,s)=>{s.d(t,{TS:()=>i,Tf:()=>c,V6:()=>r,c4:()=>a,qh:()=>h,z$:()=>l});const n={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function r(e){return!!n[e]||!!n[e.toLowerCase()]}function i(e){return n[e]??n[e.toLowerCase()]}function a(e){return[...i(e)]}function o(e,t,s){s<0&&++s,s>1&&--s;const n=6*s;return n<1?e+(t-e)*n:2*s<1?t:3*s<2?e+(t-e)*(2/3-s)*6:e}function l(e,t,s,n=1){const r=(e%360+360)%360/360,i=s<=.5?s*(t+1):s+t-s*t,a=2*s-i;return[Math.round(255*o(a,i,r+1/3)),Math.round(255*o(a,i,r)),Math.round(255*o(a,i,r-1/3)),n]}function h(e){const t=e.length>5,s=t?8:4,n=(1<<s)-1,r=t?1:17,i=t?9===e.length:5===e.length;let a=Number("0x"+e.slice(1));if(isNaN(a))return null;const o=[0,0,0,1];let l;return i&&(l=a&n,a>>=s,o[3]=r*l/255),l=a&n,a>>=s,o[2]=r*l,l=a&n,a>>=s,o[1]=r*l,l=a&n,a>>=s,o[0]=r*l,o}const c=2.2},91829:(e,t,s)=>{function n(){return[0,0,0,0]}function r(e,t,s,n){return[e,t,s,n]}function i(e,t,s,n){return[e,t,s,n]}function a(e,t=[0,0,0,0]){const s=Math.min(4,e.length);for(let n=0;n<s;++n)t[n]=e[n];return t}function o(){return r(1,1,1,1)}function l(){return r(1,0,0,0)}function h(){return r(0,1,0,0)}function c(){return r(0,0,1,0)}function u(){return r(0,0,0,1)}s.d(t,{CN:()=>i,Un:()=>d,ci:()=>a,fA:()=>r,uY:()=>f,vt:()=>n});const f=[0,0,0,0],d=o(),y=l(),g=h(),x=c(),p=u();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_W:p,UNIT_X:y,UNIT_Y:g,UNIT_Z:x,ZEROS:f,clone:function(e){return[e[0],e[1],e[2],e[3]]},create:n,createView:function(e,t){return new Float64Array(e,t,4)},freeze:i,fromArray:a,fromValues:r,ones:o,unitW:u,unitX:l,unitY:h,unitZ:c,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"}))},34304:(e,t,s)=>{s.d(t,{DF:()=>l,FD:()=>r,Ov:()=>i,ct:()=>h});let n=1e-6;function r(){return n}const i=Math.random,a=Math.PI/180,o=180/Math.PI;function l(e){return e*a}function h(e){return e*o}Object.freeze(Object.defineProperty({__proto__:null,RANDOM:i,equals:function(e,t){return Math.abs(e-t)<=n*Math.max(1,Math.abs(e),Math.abs(t))},getEpsilon:r,setEpsilon:function(e){n=e},toDegree:h,toRadian:l},Symbol.toStringTag,{value:"Module"}))},69397:(e,t,s)=>{s.d(t,{Qf:()=>l,Qh:()=>a,RS:()=>r,ez:()=>u,i5:()=>f,lM:()=>i,qK:()=>c});var n=s(34275);const r=16;function i(e){if(!e)return 0;let t=c;for(const s in e)e.hasOwnProperty(s)&&(t+=o(e[s],!1));return t}function a(e){if(!e)return 0;if("number"==typeof e[0])return l(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return h(e,8);let s=u;for(let n=0;n<t;n++)s+=o(e[n]);return s}(e);let t=c;for(const s in e)e.hasOwnProperty(s)&&(t+=o(e[s]));return t}function o(e,t=!0){switch(typeof e){case"object":return t?a(e):c;case"string":return function(e){return 32+e.length}(e);case"number":return r;case"boolean":return 4;default:return 8}}function l(...e){return e.reduce(((e,t)=>e+(t?(0,n.iu)(t)?t.byteLength+f:Array.isArray(t)?h(t,r):0:0)),0)}function h(e,t){return u+e.length*t}const c=32,u=16,f=145},11764:(e,t,s)=>{s.r(t),s.d(t,{default:()=>X});var n=s(74887),r=s(89640),i=s(6774),a=s(13195);function o(e){return 746===e||747===e||!(e<4352)&&(e>=12704&&e<=12735||e>=12544&&e<=12591||e>=65072&&e<=65103&&!(e>=65097&&e<=65103)||e>=63744&&e<=64255||e>=13056&&e<=13311||e>=11904&&e<=12031||e>=12736&&e<=12783||e>=12288&&e<=12351&&!(e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=12800&&e<=13055||e>=12592&&e<=12687||e>=43360&&e<=43391||e>=55216&&e<=55295||e>=4352&&e<=4607||e>=44032&&e<=55215||e>=12352&&e<=12447||e>=12272&&e<=12287||e>=12688&&e<=12703||e>=12032&&e<=12255||e>=12784&&e<=12799||e>=12448&&e<=12543&&12540!==e||e>=65280&&e<=65519&&!(65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||e>=65104&&e<=65135&&!(e>=65112&&e<=65118||e>=65123&&e<=65126)||e>=5120&&e<=5759||e>=6320&&e<=6399||e>=65040&&e<=65055||e>=19904&&e<=19967||e>=40960&&e<=42127||e>=42128&&e<=42191)}function l(e){return!(e<11904)&&(e>=12704&&e<=12735||e>=12544&&e<=12591||e>=65072&&e<=65103||e>=63744&&e<=64255||e>=13056&&e<=13311||e>=11904&&e<=12031||e>=12736&&e<=12783||e>=12288&&e<=12351||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=12800&&e<=13055||e>=65280&&e<=65519||e>=12352&&e<=12447||e>=12272&&e<=12287||e>=12032&&e<=12255||e>=12784&&e<=12799||e>=12448&&e<=12543||e>=65040&&e<=65055||e>=42128&&e<=42191||e>=40960&&e<=42127)}function h(e){switch(e){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function c(e){switch(e){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}var u=s(18989);const f=24;class d{constructor(e,t,s,n,r,i,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=s,this._letterSpacing=n,this._hAnchor=r,this._vAnchor=i,this._justify=a}getShaping(e,t,s){const n=this._letterSpacing,r=this._lineHeight,i=this._justify,a=this._maxWidth,u=[];let f=0,d=0;for(const t of e){const e=t.codePointAt(0);if(null==e)continue;const r=s&&o(e);let i;for(const t of this._glyphItems)if(i=t[e],i)break;u.push({codePoint:e,x:f,y:d,vertical:r,glyphMosaicItem:i}),i&&(f+=i.metrics.advance+n)}let y=f;a>0&&(y=f/Math.max(1,Math.ceil(f/a)));const g=e.includes("​"),x=[],p=u.length;for(let e=0;e<p-1;e++){const t=u[e].codePoint,s=l(t);if(h(t)||s){let n=0;if(10===t)n-=1e4;else if(s&&g)n+=150;else{40!==t&&65288!==t||(n+=50);const s=u[e+1].codePoint;41!==s&&65289!==s||(n+=50)}x.push(this._buildBreak(e+1,u[e].x,y,x,n,!1))}}const m=this._optimalBreaks(this._buildBreak(p,f,y,x,0,!0));let _=0;const I=t?-r:r;let b=0;for(let e=0;e<m.length;e++){const t=m[e];let s=b;for(;s<t&&c(u[s].codePoint);)u[s].glyphMosaicItem=null,++s;let n=t-1;for(;n>s&&c(u[n].codePoint);)u[n].glyphMosaicItem=null,--n;if(s<=n){const e=u[s].x;for(let t=s;t<=n;t++)u[t].x-=e,u[t].y=d;let t=u[n].x;u[n].glyphMosaicItem&&(t+=u[n].glyphMosaicItem.metrics.advance),_=Math.max(t,_),i&&this._applyJustification(u,s,n)}b=t,d+=I}if(u.length>0){const e=m.length-1,s=(i-this._hAnchor)*_;let n=(-this._vAnchor*(e+1)+.5)*r;t&&e&&(n+=e*r);for(const e of u)e.x+=s,e.y+=n}return u.filter((e=>e.glyphMosaicItem))}static getTextBox(e,t){if(!e.length)return null;let s=1/0,n=1/0,r=0,i=0;for(const a of e){const e=a.glyphMosaicItem.metrics.advance,o=a.x,l=a.y-17,h=o+e,c=l+t;s=Math.min(s,o),r=Math.max(r,h),n=Math.min(n,l),i=Math.max(i,c)}return{x:s,y:n,width:r-s,height:i-n}}static getBox(e){if(!e.length)return null;let t=1/0,s=1/0,n=0,r=0;for(const i of e){const{height:e,left:a,top:o,width:l}=i.glyphMosaicItem.metrics,h=i.x,c=i.y-(e-Math.abs(o)),u=h+l+a,f=c+e;t=Math.min(t,h),n=Math.max(n,u),s=Math.min(s,c),r=Math.max(r,f)}return{x:t,y:s,width:n-t,height:r-s}}static addDecoration(e,t){const s=e.length;if(0===s)return;let n=e[0].x+e[0].glyphMosaicItem.metrics.left,r=e[0].y;for(let i=1;i<s;i++){const s=e[i];if(s.y!==r){const a=e[i-1].x+e[i-1].glyphMosaicItem.metrics.left+e[i-1].glyphMosaicItem.metrics.width;e.push({codePoint:0,x:n,y:r+t-3,vertical:!1,glyphMosaicItem:{sdf:!0,rect:new u.A(4,0,4,8),metrics:{width:a-n,height:8,left:0,top:0,advance:0},page:0,code:0}}),r=s.y,n=s.x+s.glyphMosaicItem.metrics.left}}const i=e[s-1].x+e[s-1].glyphMosaicItem.metrics.left+e[s-1].glyphMosaicItem.metrics.width;e.push({codePoint:0,x:n,y:r+t-3,vertical:!1,glyphMosaicItem:{sdf:!0,rect:new u.A(4,0,4,8),metrics:{width:i-n,height:8,left:0,top:0,advance:0},page:0,code:0}})}_breakScore(e,t,s,n){const r=(e-t)*(e-t);return n?e<t?r/2:2*r:r+Math.abs(s)*s}_buildBreak(e,t,s,n,r,i){let a=null,o=this._breakScore(t,s,r,i);for(const e of n){const n=t-e.x,l=this._breakScore(n,s,r,i)+e.score;l<=o&&(a=e,o=l)}return{index:e,x:t,score:o,previousBreak:a}}_optimalBreaks(e){return e?this._optimalBreaks(e.previousBreak).concat(e.index):[]}_applyJustification(e,t,s){const n=e[s],r=n.vertical?f:n.glyphMosaicItem?n.glyphMosaicItem.metrics.advance:0,i=(n.x+r)*this._justify;for(let n=t;n<=s;n++)e[n].x-=i}}var y=s(4272);const g=.5;class x{constructor(e,t,s=0,n=-1,r=g){this.x=e,this.y=t,this.angle=s,this.segment=n,this.minzoom=r}}class p{constructor(e,t,s,n,r,i=g,o=a.MG){this.anchor=e,this.labelAngle=t,this.glyphAngle=s,this.page=n,this.alternateVerticalGlyph=r,this.minzoom=i,this.maxzoom=o}}class m{constructor(e,t,s,n,r,i,a,o,l,h,c,u){this.tl=e,this.tr=t,this.bl=s,this.br=n,this.mosaicRect=r,this.labelAngle=i,this.minAngle=a,this.maxAngle=o,this.anchor=l,this.minzoom=h,this.maxzoom=c,this.page=u}}class _{constructor(e){this.shapes=e}}class I{getIconPlacement(e,t,s){const n=new i.bR(e.x,e.y),r=s.rotationAlignment===y.I5.MAP,o=s.keepUpright;let l=s.rotate*a.os;r&&(l+=e.angle);const h=new _([]);return s.allowOverlap&&s.ignorePlacement||(h.iconColliders=[]),this._addIconPlacement(h,n,t,s,l),r&&o&&this._addIconPlacement(h,n,t,s,l+a.Jo),h}_addIconPlacement(e,t,s,n,r){const o=s.rasterizationScale,l=s.width/o,h=s.height/o,c=n.offset;let u=c[0],f=c[1];switch(n.anchor){case y.KI.CENTER:u-=l/2,f-=h/2;break;case y.KI.LEFT:f-=h/2;break;case y.KI.RIGHT:u-=l,f-=h/2;break;case y.KI.TOP:u-=l/2;break;case y.KI.BOTTOM:u-=l/2,f-=h;break;case y.KI.TOP_LEFT:break;case y.KI.BOTTOM_LEFT:f-=h;break;case y.KI.TOP_RIGHT:u-=l;break;case y.KI.BOTTOM_RIGHT:u-=l,f-=h}const d=s.rect,x=2/o,p=u-x,_=f-x,I=p+d.width/o,b=_+d.height/o,M=new i.bR(p,_),w=new i.bR(I,b),P=new i.bR(p,b),T=new i.bR(I,_);if(0!==r){const e=Math.cos(r),t=Math.sin(r);M.rotate(e,t),w.rotate(e,t),P.rotate(e,t),T.rotate(e,t)}const A=new m(M,T,P,w,d,r,0,256,t,g,a.MG,0);if(e.shapes.push(A),!n.allowOverlap||!n.ignorePlacement){const s=n.size,i=n.padding,o={xTile:t.x,yTile:t.y,dxPixels:u*s-i,dyPixels:f*s-i,hard:!n.optional,partIndex:0,width:l*s+2*i,height:h*s+2*i,angle:r,minLod:g,maxLod:a.MG};e.iconColliders.push(o)}}getTextPlacement(e,t,s,n){const r=new i.bR(e.x,e.y),o=n.rotate*a.os,l=n.rotationAlignment===y.I5.MAP,h=n.keepUpright,c=n.padding;let u=g;const x=l?e.angle:0,I=e.segment>=0&&l,b=n.allowOverlap&&n.ignorePlacement?null:[],M=[],w=!I;let P=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,A=P,D=T;const k=(I||l)&&h,L=n.size/f;let B=!1;for(const e of t)if(e.vertical){B=!0;break}let V,v=0,R=0;if(!I&&B){const e=d.getTextBox(t,n.lineHeight*f);switch(n.anchor){case y.KI.LEFT:v=e.height/2,R=-e.width/2;break;case y.KI.RIGHT:v=-e.height/2,R=e.width/2;break;case y.KI.TOP:v=e.height/2,R=e.width/2;break;case y.KI.BOTTOM:v=-e.height/2,R=-e.width/2;break;case y.KI.TOP_LEFT:v=e.height;break;case y.KI.BOTTOM_LEFT:R=-e.width;break;case y.KI.TOP_RIGHT:R=e.width;break;case y.KI.BOTTOM_RIGHT:v=-e.height}}v+=n.offset[0]*f,R+=n.offset[1]*f;for(const f of t){const t=f.glyphMosaicItem;if(!t||t.rect.isEmpty)continue;const d=t.rect,y=t.metrics,_=t.page;if(b&&w){if(void 0!==V&&V!==f.y){let t,s,r,i;B?(t=-D+v,s=P+R,r=D-A,i=T-P):(t=P+v,s=A+R,r=T-P,i=D-A);const l={xTile:e.x,yTile:e.y,dxPixels:t*L-c,dyPixels:s*L-c,hard:!n.optional,partIndex:1,width:r*L+2*c,height:i*L+2*c,angle:o,minLod:g,maxLod:a.MG};b.push(l),P=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,A=P,D=T}V=f.y}const S=[];if(I){const n=.5*t.metrics.width,r=(f.x+y.left-4+n)*L*8;if(u=this._placeGlyph(e,u,r,s,e.segment,1,f.vertical,_,S),h&&(u=this._placeGlyph(e,u,r,s,e.segment,-1,f.vertical,_,S)),u>=2)break}else S.push(new p(r,x,x,_,!1)),l&&h&&S.push(new p(r,x+a.Jo,x+a.Jo,_,!1));const C=f.x+y.left,O=f.y-17-y.top,E=C+y.width,F=O+y.height;let z,N,U,G,K,q,H,W;if(!I&&B)if(f.vertical){const e=(C+E)/2-y.height/2,t=(O+F)/2+y.width/2;z=new i.bR(-t-4+v,e-4+R),N=new i.bR(z.x+d.width,z.y+d.height),U=new i.bR(z.x,N.y),G=new i.bR(N.x,z.y)}else z=new i.bR(4-O+v,C-4+R),N=new i.bR(z.x-d.height,z.y+d.width),U=new i.bR(N.x,z.y),G=new i.bR(z.x,N.y);else z=new i.bR(C-4+v,O-4+R),N=new i.bR(z.x+d.width,z.y+d.height),U=new i.bR(z.x,N.y),G=new i.bR(N.x,z.y);for(const t of S){let s,r,a,l;if(t.alternateVerticalGlyph){if(!K){const e=(O+F)/2+R;K=new i.bR((C+E)/2+v-y.height/2-4,e+y.width/2+4),q=new i.bR(K.x+d.height,K.y-d.width),H=new i.bR(q.x,K.y),W=new i.bR(K.x,q.y)}s=K,r=H,a=W,l=q}else s=z,r=U,a=G,l=N;const h=O,u=F,g=t.glyphAngle+o;if(0!==g){const e=Math.cos(g),t=Math.sin(g);s=s.clone(),r=r?.clone(),a=a?.clone(),l=l?.clone(),s.rotate(e,t),l?.rotate(e,t),r?.rotate(e,t),a?.rotate(e,t)}let x=0,p=256;if(I&&B?f.vertical?t.alternateVerticalGlyph?(x=32,p=96):(x=224,p=32):(x=224,p=96):(x=192,p=64),M.push(new m(s,a,r,l,d,t.labelAngle,x,p,t.anchor,t.minzoom,t.maxzoom,t.page)),b&&(!k||this._legible(t.labelAngle)))if(w)C<P&&(P=C),h<A&&(A=h),E>T&&(T=E),u>D&&(D=u);else if(t.minzoom<2){const s={xTile:e.x,yTile:e.y,dxPixels:(C+v)*L-c,dyPixels:(h+v)*L-c,hard:!n.optional,partIndex:1,width:(E-C)*L+2*c,height:(u-h)*L+2*c,angle:g,minLod:t.minzoom,maxLod:t.maxzoom};b.push(s)}}}if(u>=2)return null;if(b&&w){let t,s,r,i;B?(t=-D+v,s=P+R,r=D-A,i=T-P):(t=P+v,s=A+R,r=T-P,i=D-A);const l={xTile:e.x,yTile:e.y,dxPixels:t*L-c,dyPixels:s*L-c,hard:!n.optional,partIndex:1,width:r*L+2*c,height:i*L+2*c,angle:o,minLod:g,maxLod:a.MG};b.push(l)}const S=new _(M);return b&&b.length>0&&(S.textColliders=b),S}_legible(e){const t=(0,a.z0)(e);return t<65||t>=193}_placeGlyph(e,t,s,n,r,o,l,h,c){let u=o;const f=u<0?(0,a.Wh)(e.angle+a.Jo,a.pJ):e.angle;let d=0;s<0&&(u*=-1,s*=-1,d=a.Jo),u>0&&++r;let y=new i.bR(e.x,e.y),g=n[r],x=a.MG;if(n.length<=r)return x;for(;;){const e=g.x-y.x,i=g.y-y.y,o=Math.sqrt(e*e+i*i),m=Math.max(s/o,t),_=e/o,I=i/o,b=(0,a.Wh)(Math.atan2(I,_)+d,a.pJ);if(c.push(new p(y,f,b,h,!1,m,x)),l&&c.push(new p(y,f,b,h,!0,m,x)),m<=t)return m;y=g.clone();do{if(r+=u,n.length<=r||r<0)return m;g=n[r]}while(y.isEqual(g));let M=g.x-y.x,w=g.y-y.y;const P=Math.sqrt(M*M+w*w);M*=o/P,w*=o/P,y.x-=M,y.y-=w,x=m}}}var b,M,w=s(51624),P=s(15585);(M=b||(b={}))[M.moveTo=1]="moveTo",M[M.lineTo=2]="lineTo",M[M.close=7]="close";class T{constructor(e,t,s=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=s;const n=t.keys,r=t.values,i=e.asUnsafe();for(;i.next();)switch(i.tag()){case 1:this.id=i.getUInt64();break;case 2:{const e=i.getMessage().asUnsafe(),t=this.values;for(;!e.empty();){const s=e.getUInt32(),i=e.getUInt32();t[n[s]]=r[i]}e.release();break}case 3:this.type=i.getUInt32();break;case 4:this._pbfGeometry=i.getMessage();break;default:i.skip()}}getGeometry(e){if(void 0!==this._geometry)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let s,n;this._pbfGeometry=null,e?e.reset(this.type):s=[];let r,a=b.moveTo,o=0,l=0,h=0;for(;!t.empty();){if(0===o){const e=t.getUInt32();a=7&e,o=e>>3}switch(o--,a){case b.moveTo:l+=t.getSInt32(),h+=t.getSInt32(),e?e.moveTo(l,h):s&&(n&&s.push(n),n=[],n.push(new i.bR(l,h)));break;case b.lineTo:l+=t.getSInt32(),h+=t.getSInt32(),e?e.lineTo(l,h):n&&n.push(new i.bR(l,h));break;case b.close:e?e.close():n&&!n[0].equals(l,h)&&n.push(n[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?r=e.result():s&&(n&&s.push(n),r=s),t.release(),this._geometry=r,r}}var A=s(80081);class D extends A.A{constructor(){super(12)}add(e,t,s){const n=this.array;n.push(e),n.push(t),n.push(s)}}A.A;class k{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(k._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}class L extends A.A{constructor(e){super(e)}add(e,t,s,n,r,i,a,o,l,h,c,u){const f=this.array;let d=A.A.i1616to32(e,t);f.push(d);const y=31;d=A.A.i8888to32(Math.round(y*s),Math.round(y*n),Math.round(y*r),Math.round(y*i)),f.push(d),d=A.A.i8888to32(Math.round(y*a),Math.round(y*o),Math.round(y*l),Math.round(y*h)),f.push(d),d=A.A.i1616to32(c,0),f.push(d),u&&f.push(...u)}}class B extends A.A{constructor(e){super(e)}add(e,t,s){const n=this.array;n.push(A.A.i1616to32(e,t)),s&&n.push(...s)}}class V extends A.A{constructor(e){super(e)}add(e,t,s,n,r,i,a){const o=this.array,l=this.index;let h=A.A.i1616to32(e,t);return o.push(h),h=A.A.i8888to32(Math.round(15*s),Math.round(15*n),r,i),o.push(h),a&&o.push(...a),l}}class v extends A.A{constructor(e){super(e)}add(e,t,s,n,r,i,o,l,h,c,u,f){const d=this.array;let y=A.A.i1616to32(e,t);d.push(y),y=A.A.i1616to32(Math.round(8*s),Math.round(8*n)),d.push(y),y=A.A.i8888to32(r/4,i/4,l,h),d.push(y),y=A.A.i8888to32(0,(0,a.z0)(o),10*c,Math.min(10*u,255)),d.push(y),f&&d.push(...f)}}class R extends A.A{constructor(e){super(e)}add(e,t,s,n,r){const i=this.array,a=A.A.i1616to32(2*e+s,2*t+n);i.push(a),r&&i.push(...r)}}class S{constructor(e,t,s){this.layerExtent=4096,this._features=[],this.layer=e,this.zoom=t,this._spriteInfo=s,this._filter=e.getFeatureFilter()}pushFeature(e){this._filter&&!this._filter.filter(e,this.zoom)||this._features.push(e)}hasFeatures(){return this._features.length>0}getResources(e,t,s){}}class C extends S{constructor(e,t,s,n,i){super(e,t,s),this.type=r.NP.CIRCLE,this._circleVertexBuffer=n,this._circleIndexBuffer=i}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const t=this._circleVertexBuffer,s=this._circleIndexBuffer;this._circleIndexStart=3*s.index,this._circleIndexCount=0;const n=this.layer,r=this.zoom;e&&e.setExtent(this.layerExtent);for(const i of this._features){const a=i.getGeometry(e);if(!a)continue;const o=n.circleMaterial.encodeAttributes(i,r,n);for(const e of a)if(e)for(const n of e){const e=t.index;t.add(n.x,n.y,0,0,o),t.add(n.x,n.y,0,1,o),t.add(n.x,n.y,1,0,o),t.add(n.x,n.y,1,1,o),s.add(e,e+1,e+2),s.add(e+1,e+2,e+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const t=new Uint32Array(e),s=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[n++]=this.layerUIDs[e];t[n++]=this._circleIndexStart,t[n++]=this._circleIndexCount,t[n++]=this._circleVertexBuffer.array.length;for(let e=0;e<this._circleVertexBuffer.array.length;e++)s[n++]=this._circleVertexBuffer.array[e];t[n++]=this._circleIndexBuffer.array.length;for(let e=0;e<this._circleIndexBuffer.array.length;e++)t[n++]=this._circleIndexBuffer.array[e];return t.buffer}}var O=s(98291),E=s(83349);class F extends S{constructor(e,t,s,n,i,a,o){super(e,t,s),this.type=r.NP.FILL,this._patternMap=new Map,this._fillVertexBuffer=n,this._fillIndexBuffer=i,this._outlineVertexBuffer=a,this._outlineIndexBuffer=o}get fillIndexStart(){return this._fillIndexStart}get fillIndexCount(){return this._fillIndexCount}get outlineIndexStart(){return this._outlineIndexStart}get outlineIndexCount(){return this._outlineIndexCount}getResources(e,t,s){const n=this.layer,r=this.zoom,i=n.getPaintProperty("fill-pattern");if(i)if(i.isDataDriven)for(const e of this._features)t(i.getValue(r,e),!0);else t(i.getValue(r),!0)}processFeatures(e){this._fillIndexStart=3*this._fillIndexBuffer.index,this._fillIndexCount=0,this._outlineIndexStart=3*this._outlineIndexBuffer.index,this._outlineIndexCount=0;const t=this.layer,s=this.zoom,{fillMaterial:n,outlineMaterial:r,hasDataDrivenFill:i,hasDataDrivenOutline:a}=t;e&&e.setExtent(this.layerExtent);const o=t.getPaintProperty("fill-pattern"),l=o?.isDataDriven;let h=!o&&t.getPaintValue("fill-antialias",s);if(t.outlineUsesFillColor){if(h&&!t.hasDataDrivenOpacity){const e=t.getPaintValue("fill-opacity",s),n=t.getPaintValue("fill-opacity",s+1);e<1&&n<1&&(h=!1)}if(h&&!t.hasDataDrivenColor){const e=t.getPaintValue("fill-color",s),n=t.getPaintValue("fill-color",s+1);e[3]<1&&n[3]<1&&(h=!1)}}const c=this._features,u=e?.validateTessellation;if(l){const i=[];for(const l of c){const c=o.getValue(s,l),f=this._spriteInfo[c];if(!f?.rect)continue;const d=n.encodeAttributes(l,s,t,f),y=h&&a?r.encodeAttributes(l,s,t):[],g=l.getGeometry(e);i.push({ddFillAttributes:d,ddOutlineAttributes:y,page:f.page,geometry:g}),i.sort(((e,t)=>e.page-t.page));for(const{ddFillAttributes:e,ddOutlineAttributes:s,page:n,geometry:r}of i)this._processFeature(r,h,t.outlineUsesFillColor,e,s,u,n)}}else for(const o of c){const l=i?n.encodeAttributes(o,s,t):null,c=h&&a?r.encodeAttributes(o,s,t):null,f=o.getGeometry(e);this._processFeature(f,h,t.outlineUsesFillColor,l,c,u)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),s=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[n++]=this.layerUIDs[e];t[n++]=this._fillIndexStart,t[n++]=this._fillIndexCount,t[n++]=this._outlineIndexStart,t[n++]=this._outlineIndexCount;const r=this._patternMap,i=r.size;if(t[n++]=i,i>0)for(const[e,[s,i]]of r)t[n++]=e,t[n++]=s,t[n++]=i;t[n++]=this._fillVertexBuffer.array.length;for(let e=0;e<this._fillVertexBuffer.array.length;e++)s[n++]=this._fillVertexBuffer.array[e];t[n++]=this._fillIndexBuffer.array.length;for(let e=0;e<this._fillIndexBuffer.array.length;e++)t[n++]=this._fillIndexBuffer.array[e];t[n++]=this._outlineVertexBuffer.array.length;for(let e=0;e<this._outlineVertexBuffer.array.length;e++)s[n++]=this._outlineVertexBuffer.array[e];t[n++]=this._outlineIndexBuffer.array.length;for(let e=0;e<this._outlineIndexBuffer.array.length;e++)t[n++]=this._outlineIndexBuffer.array[e];return t.buffer}_processFeature(e,t,s,n,r,i,a){if(!e)return;const o=e.length,l=!r||0===r.length;if(t&&(!s||l))for(let t=0;t<o;t++)this._processOutline(e[t],r);let h;for(let t=0;t<o;t++){const s=F._area(e[t]);s>32?(void 0!==h&&this._processFill(e,h,n,i,a),h=[t]):s<-32&&void 0!==h&&h.push(t)}void 0!==h&&this._processFill(e,h,n,i,a)}_processOutline(e,t){const s=this._outlineVertexBuffer,n=this._outlineIndexBuffer,r=n.index;let a,o,l;const h=new i.bR(0,0),c=new i.bR(0,0),u=new i.bR(0,0);let f=-1,d=-1,y=-1,g=-1,x=-1,p=!1,m=e.length;if(m<2)return;const _=e[0];let I=e[m-1];for(;m&&I.isEqual(_);)--m,I=e[m-1];if(!(m-0<2)){for(let r=0;r<m;++r){0===r?(a=e[m-1],o=e[0],l=e[1],h.assignSub(o,a),h.normalize(),h.rightPerpendicular()):(a=o,o=l,l=r!==m-1?e[r+1]:e[0],h.assign(c));const i=this._isClipEdge(a,o);-1===g&&(p=i),c.assignSub(l,o),c.normalize(),c.rightPerpendicular();const _=h.x*c.y-h.y*c.x;u.assignAdd(h,c),u.normalize();const I=-u.x*-h.x+-u.y*-h.y;let b=Math.abs(0!==I?1/I:1);b>8&&(b=8),_>=0?(y=s.add(o.x,o.y,h.x,h.y,0,1,t),-1===g&&(g=y),f>=0&&d>=0&&y>=0&&!i&&n.add(f,d,y),d=s.add(o.x,o.y,b*-u.x,b*-u.y,0,-1,t),-1===x&&(x=d),f>=0&&d>=0&&y>=0&&!i&&n.add(f,d,y),f=d,d=y,y=s.add(o.x,o.y,u.x,u.y,0,1,t),f>=0&&d>=0&&y>=0&&!i&&n.add(f,d,y),d=s.add(o.x,o.y,c.x,c.y,0,1,t),f>=0&&d>=0&&y>=0&&!i&&n.add(f,d,y)):(y=s.add(o.x,o.y,b*u.x,b*u.y,0,1,t),-1===g&&(g=y),f>=0&&d>=0&&y>=0&&!i&&n.add(f,d,y),d=s.add(o.x,o.y,-h.x,-h.y,0,-1,t),-1===x&&(x=d),f>=0&&d>=0&&y>=0&&!i&&n.add(f,d,y),f=d,d=y,y=s.add(o.x,o.y,-u.x,-u.y,0,-1,t),f>=0&&d>=0&&y>=0&&!i&&n.add(f,d,y),f=s.add(o.x,o.y,-c.x,-c.y,0,-1,t),f>=0&&d>=0&&y>=0&&!i&&n.add(f,d,y))}f>=0&&d>=0&&g>=0&&!p&&n.add(f,d,g),f>=0&&g>=0&&x>=0&&!p&&n.add(f,x,g),this._outlineIndexCount+=3*(n.index-r)}}_processFill(e,t,s,n,r){let i;t.length>1&&(i=[]);let a=0;for(const s of t)0!==a&&i.push(a),a+=e[s].length;const o=2*a,l=O.A.acquire();for(const s of t){const t=e[s],n=t.length;for(let e=0;e<n;++e)l.push(t[e].x,t[e].y)}const h=(0,E.e)(l,i,2);if(E.e.deviation(l,i,2,h)>0){const n=t.map((t=>e[t].length)),{buffer:i,vertexCount:a}=(0,P.l)(l,n);if(a>0){const e=this._fillVertexBuffer.index;for(let e=0;e<a;e++)this._fillVertexBuffer.add(i[2*e],i[2*e+1],s);for(let t=0;t<a;t+=3){const s=e+t;this._fillIndexBuffer.add(s,s+1,s+2)}if(void 0!==r){const e=this._patternMap,t=e.get(r);t?t[1]+=a:e.set(r,[this._fillIndexStart+this._fillIndexCount,a])}this._fillIndexCount+=a}}else{const e=h.length;if(e>0){const t=this._fillVertexBuffer.index;let n=0;for(;n<o;)this._fillVertexBuffer.add(l[n++],l[n++],s);let i=0;for(;i<e;)this._fillIndexBuffer.add(t+h[i++],t+h[i++],t+h[i++]);if(void 0!==r){const t=this._patternMap,s=t.get(r);s?s[1]+=e:t.set(r,[this._fillIndexStart+this._fillIndexCount,e])}this._fillIndexCount+=e}}O.A.release(l)}_isClipEdge(e,t){return e.x===t.x?e.x<=-64||e.x>=4160:e.y===t.y&&(e.y<=-64||e.y>=4160)}static _area(e){let t=0;const s=e.length-1;for(let n=0;n<s;n++)t+=(e[n].x-e[n+1].x)*(e[n].y+e[n+1].y);return t+=(e[s].x-e[0].x)*(e[s].y+e[0].y),.5*t}}var z=s(83773);class N extends S{constructor(e,t,s,n,i){super(e,t,s),this.type=r.NP.LINE,this._tessellationOptions={pixelCoordRatio:8,halfWidth:0,offset:0},this._patternMap=new Map,this.tessellationProperties={_lineVertexBuffer:null,_lineIndexBuffer:null,_ddValues:null},this.tessellationProperties._lineVertexBuffer=n,this.tessellationProperties._lineIndexBuffer=i,this._lineTessellator=new z.i(U(this.tessellationProperties),G(this.tessellationProperties),e.canUseThinTessellation)}get lineIndexStart(){return this._lineIndexStart}get lineIndexCount(){return this._lineIndexCount}getResources(e,t,s){const n=this.layer,r=this.zoom,i=n.getPaintProperty("line-pattern"),a=n.getPaintProperty("line-dasharray"),o=n.getLayoutProperty("line-cap");if(!i&&!a)return;const l=o?.getValue(r)||0,h=o?.isDataDriven,c=i?.isDataDriven,u=a?.isDataDriven;if(c||u)for(const e of this._features)t(c?i.getValue(r,e):this._getDashArrayKey(e,r,n,a,h,o,l));else if(i)t(i.getValue(r));else if(a){const e=a.getValue(r);t(n.getDashKey(e,l))}}processFeatures(e){this._lineIndexStart=3*this.tessellationProperties._lineIndexBuffer.index,this._lineIndexCount=0;const t=this.layer,s=this.zoom,n=this._features,r=this._tessellationOptions,{hasDataDrivenLine:i,lineMaterial:a}=t;e&&e.setExtent(this.layerExtent);const o=t.getPaintProperty("line-pattern"),l=t.getPaintProperty("line-dasharray"),h=o?.isDataDriven,c=l?.isDataDriven;let u;u=t.getLayoutProperty("line-cap");const f=u?.isDataDriven?u:null,d=f?null:t.getLayoutValue("line-cap",s),y=d||0,g=!!f;u=t.getLayoutProperty("line-join");const x=u?.isDataDriven?u:null,p=x?null:t.getLayoutValue("line-join",s);u=t.getLayoutProperty("line-miter-limit");const m=u?.isDataDriven?u:null,_=m?null:t.getLayoutValue("line-miter-limit",s);u=t.getLayoutProperty("line-round-limit");const I=u?.isDataDriven?u:null,b=I?null:t.getLayoutValue("line-round-limit",s);u=t.getPaintProperty("line-width");const M=u?.isDataDriven?u:null,w=M?null:t.getPaintValue("line-width",s);u=t.getPaintProperty("line-offset");const P=u?.isDataDriven?u:null,T=P?null:t.getPaintValue("line-offset",s);if(h||c){const i=[];for(const r of n){const n=h?o.getValue(s,r):this._getDashArrayKey(r,s,t,l,g,f,y),c=this._spriteInfo[n];if(!c?.rect)continue;const u=a.encodeAttributes(r,s,t,c),A=r.getGeometry(e);i.push({ddAttributes:u,page:c.page,cap:f?f.getValue(s,r):d,join:x?x.getValue(s,r):p,miterLimit:m?m.getValue(s,r):_,roundLimit:I?I.getValue(s,r):b,halfWidth:.5*(M?M.getValue(s,r):w),offset:P?P.getValue(s,r):T,geometry:A})}i.sort(((e,t)=>e.page-t.page)),r.textured=!0;for(const{ddAttributes:e,page:t,cap:s,join:n,miterLimit:a,roundLimit:o,halfWidth:l,offset:h,geometry:c}of i)r.capType=s,r.joinType=n,r.miterLimit=a,r.roundLimit=o,r.halfWidth=l,r.offset=h,this._processFeature(c,e,t)}else{if(o){const e=o.getValue(s),t=this._spriteInfo[e];if(!t?.rect)return}r.textured=!(!o&&!l),r.capType=d,r.joinType=p,r.miterLimit=_,r.roundLimit=b,r.halfWidth=.5*w,r.offset=T;for(const o of n){const n=i?a.encodeAttributes(o,s,t):null;f&&(r.capType=f.getValue(s,o)),x&&(r.joinType=x.getValue(s,o)),m&&(r.miterLimit=m.getValue(s,o)),I&&(r.roundLimit=I.getValue(s,o)),M&&(r.halfWidth=.5*M.getValue(s,o)),P&&(r.offset=P.getValue(s,o));const l=o.getGeometry(e);this._processFeature(l,n)}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this.tessellationProperties._lineVertexBuffer.array.length,e+=this.tessellationProperties._lineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),s=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[n++]=this.layerUIDs[e];t[n++]=this._lineIndexStart,t[n++]=this._lineIndexCount;const r=this._patternMap,i=r.size;if(t[n++]=i,i>0)for(const[e,[s,i]]of r)t[n++]=e,t[n++]=s,t[n++]=i;t[n++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let e=0;e<this.tessellationProperties._lineVertexBuffer.array.length;e++)s[n++]=this.tessellationProperties._lineVertexBuffer.array[e];t[n++]=this.tessellationProperties._lineIndexBuffer.array.length;for(let e=0;e<this.tessellationProperties._lineIndexBuffer.array.length;e++)t[n++]=this.tessellationProperties._lineIndexBuffer.array[e];return t.buffer}_processFeature(e,t,s){if(!e)return;const n=e.length;for(let r=0;r<n;r++)this._processGeometry(e[r],t,s)}_processGeometry(e,t,s){if(e.length<2)return;let n,r,i=e[0],a=1;for(;a<e.length;)n=e[a].x-i.x,r=e[a].y-i.y,n*n+r*r<1e-6?e.splice(a,1):(i=e[a],++a);if(e.length<2)return;const o=this.tessellationProperties._lineIndexBuffer,l=3*o.index;this._tessellationOptions.initialDistance=0,this._tessellationOptions.wrapDistance=65535,this.tessellationProperties._ddValues=t,this._lineTessellator.tessellate(e,this._tessellationOptions);const h=3*o.index-l;if(void 0!==s){const e=this._patternMap,t=e.get(s);t?t[1]+=h:e.set(s,[l+this._lineIndexCount,h])}this._lineIndexCount+=h}_getDashArrayKey(e,t,s,n,r,i,a){const o=r?i.getValue(t,e):a,l=n.getValue(t,e);return s.getDashKey(l,o)}}const U=e=>(t,s,n,r,i,a,o,l,h,c,u)=>(e._lineVertexBuffer.add(t,s,o,l,n,r,i,a,h,c,u,e._ddValues),e._lineVertexBuffer.index-1),G=e=>(t,s,n)=>{e._lineIndexBuffer.add(t,s,n)};var K,q=s(32488),H=s(97768),W=s(799),j=s(3057);function Y(e,t){return e.iconMosaicItem&&t.iconMosaicItem?e.iconMosaicItem.page===t.iconMosaicItem.page?0:e.iconMosaicItem.page-t.iconMosaicItem.page:e.iconMosaicItem&&!t.iconMosaicItem?1:!e.iconMosaicItem&&t.iconMosaicItem?-1:0}class J extends S{constructor(e,t,s,n,i,a,o,l,h){super(t,s,h.getSpriteItems()),this.type=r.NP.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=e,this._iconVertexBuffer=n,this._iconIndexBuffer=i,this._textVertexBuffer=a,this._textIndexBuffer=o,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(e,t,s){const n=this.layer,r=this.zoom;e&&e.setExtent(this.layerExtent);const i=n.getLayoutProperty("icon-image"),a=n.getLayoutProperty("text-field");let o=n.getLayoutProperty("text-transform"),l=n.getLayoutProperty("text-font");const h=[];let c,u,f,d;i&&!i.isDataDriven&&(c=i.getValue(r)),a&&!a.isDataDriven&&(u=a.getValue(r)),o&&o.isDataDriven||(f=n.getLayoutValue("text-transform",r),o=null),l&&l.isDataDriven||(d=n.getLayoutValue("text-font",r),l=null);for(const g of this._features){const x=g.getGeometry(e);if(!x||0===x.length)continue;let p,m;i&&(p=i.isDataDriven?i.getValue(r,g):this._replaceKeys(c,g.values),p&&t(p));let _=!1;if(a&&(m=a.isDataDriven?a.getValue(r,g):this._replaceKeys(u,g.values),m)){switch(m=m.replaceAll("\\n","\n"),o&&(f=o.getValue(r,g)),f){case y.Ms.LOWERCASE:m=m.toLowerCase();break;case y.Ms.UPPERCASE:m=m.toUpperCase()}if(J._bidiEngine.hasBidiChar(m)){let e;e="rtl"===J._bidiEngine.checkContextual(m)?"IDNNN":"ICNNN",m=J._bidiEngine.bidiTransform(m,e,"VLYSN"),_=!0}if(m.length>0){l&&(d=l.getValue(r,g));for(const e of d){let t=s[e];t||(t=s[e]=new Set);for(const e of m){const s=e.codePointAt(0);null!=s&&t.add(s)}}}}if(!p&&!m)continue;const I=n.getLayoutValue("symbol-sort-key",r,g),b={feature:g,sprite:p,label:m,rtl:_,geometry:x,hash:(m?(0,W.Wm)(m):0)^(p?(0,W.Wm)(p):0),priority:I,textFont:d};h.push(b)}this._symbolFeatures=h}processFeatures(e){e&&e.setExtent(this.layerExtent);const t=this.layer,s=this.zoom,n=t.getLayoutValue("symbol-placement",s),r=n!==y.kt.POINT,o=8*t.getLayoutValue("symbol-spacing",s),l=t.getLayoutProperty("icon-image"),h=t.getLayoutProperty("text-field"),c=l?new j.aR(t,s,r):null,u=h?new j.uU(t,s,r):null,g=this._workerTileHandler;let p;l&&(p=g.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const m=[];let _=1;u?.size&&(_=u.size/f);const I=u?u.maxAngle*a.os:0,b=u?8*u.size:0;for(const e of this._symbolFeatures){let t,a;c&&p&&e.sprite&&(t=p[e.sprite],t&&t.sdf&&(this._isIconSDF=!0)),t&&c.update(s,e.feature);let l=0;const h=e.label;if(h){(0,H.Lw)(u),u.update(s,e.feature);const t=r&&u.rotationAlignment===y.I5.MAP?u.keepUpright:u.writingMode&&u.writingMode.includes(y.v9.VERTICAL);let n=.5;switch(u.anchor){case y.KI.TOP_LEFT:case y.KI.LEFT:case y.KI.BOTTOM_LEFT:n=0;break;case y.KI.TOP_RIGHT:case y.KI.RIGHT:case y.KI.BOTTOM_RIGHT:n=1}let i=.5;switch(u.anchor){case y.KI.TOP_LEFT:case y.KI.TOP:case y.KI.TOP_RIGHT:i=0;break;case y.KI.BOTTOM_LEFT:case y.KI.BOTTOM:case y.KI.BOTTOM_RIGHT:i=1}let o=.5;switch(u.justify){case y.O6.AUTO:o=n;break;case y.O6.LEFT:o=0;break;case y.O6.RIGHT:o=1}const c=u.letterSpacing*f,x=r?0:u.maxWidth*f,p=u.lineHeight*f,m=e.textFont.map((e=>g.getGlyphItems(e)));if(a=new d(m,x,p,c,n,i,o).getShaping(h,e.rtl,t),a&&a.length>0){let e=1e30,t=-1e30;for(const s of a)e=Math.min(e,s.x),t=Math.max(t,s.x);l=(t-e+48)*_*8}}for(let s of e.geometry){const h=[];if(n===y.kt.LINE){if(a?.length&&u?.size){const e=8*u.size*(2+Math.min(2,4*Math.abs(u.offset[1])));s=J._smoothVertices(s,e)}J._pushAnchors(h,s,o,l)}else n===y.kt.LINE_CENTER?J._pushCenterAnchor(h,s):e.feature.type===i.dC.Polygon?J._pushCentroid(h,s):h.push(new x(s[0].x,s[0].y));for(const n of h){if(n.x<0||n.x>4096||n.y<0||n.y>4096)continue;if(r&&l>0&&u?.rotationAlignment===y.I5.MAP&&!J._honorsTextMaxAngle(s,n,l,I,b))continue;const i={shaping:a,line:s,iconMosaicItem:t,anchor:n,symbolFeature:e,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};m.push(i),this._processFeature(i,c,u)}}}m.sort(Y),this._addPlacedGlyphs(),this._symbolInstances=m}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=J._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),s=new Int32Array(t.buffer),n=new Float32Array(t.buffer),[r,i,a]=this._sourceTileKey.split("/");let o=0;t[o++]=this.type,t[o++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[o++]=this.layerUIDs[e];t[o++]=this._isIconSDF?1:0,t[o++]=parseFloat(r),t[o++]=parseFloat(i),t[o++]=parseFloat(a),t[o++]=this.markerPageMap.size;for(const[e,[s,n]]of this.markerPageMap)t[o++]=e,t[o++]=s,t[o++]=n;t[o++]=this.glyphsPageMap.size;for(const[e,[s,n]]of this.glyphsPageMap)t[o++]=e,t[o++]=s,t[o++]=n;t[o++]=this._iconVertexBuffer.index/4,t[o++]=this._textVertexBuffer.index/4,o=J.serializeSymbols(t,s,n,o,this._symbolInstances),t[o++]=this._iconVertexBuffer.array.length;for(let e=0;e<this._iconVertexBuffer.array.length;e++)s[o++]=this._iconVertexBuffer.array[e];t[o++]=this._iconIndexBuffer.array.length;for(let e=0;e<this._iconIndexBuffer.array.length;e++)t[o++]=this._iconIndexBuffer.array[e];t[o++]=this._textVertexBuffer.array.length;for(let e=0;e<this._textVertexBuffer.array.length;e++)s[o++]=this._textVertexBuffer.array[e];t[o++]=this._textIndexBuffer.array.length;for(let e=0;e<this._textIndexBuffer.array.length;e++)t[o++]=this._textIndexBuffer.array[e];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(const s of e||[]){t+=5,t+=1;for(const e of s.textColliders)t+=10;for(const e of s.iconColliders)t+=10;t+=1,t+=2*s.textVertexRanges.length,t+=1,t+=2*s.iconVertexRanges.length}return t}static serializeSymbols(e,t,s,n,r){r=r||[],t[n++]=r.length;for(const e of r){t[n++]=e.anchor.x,t[n++]=e.anchor.y,t[n++]=e.symbolFeature.hash,t[n++]=e.symbolFeature.priority,t[n++]=e.symbolFeature.feature.featureIndex,t[n++]=e.textColliders.length+e.iconColliders.length;for(const r of e.textColliders)t[n++]=r.xTile,t[n++]=r.yTile,t[n++]=r.dxPixels,t[n++]=r.dyPixels,t[n++]=r.hard?1:0,t[n++]=r.partIndex,s[n++]=r.minLod,s[n++]=r.maxLod,t[n++]=r.width,t[n++]=r.height;for(const r of e.iconColliders)t[n++]=r.xTile,t[n++]=r.yTile,t[n++]=r.dxPixels,t[n++]=r.dyPixels,t[n++]=r.hard?1:0,t[n++]=r.partIndex,s[n++]=r.minLod,s[n++]=r.maxLod,t[n++]=r.width,t[n++]=r.height;t[n++]=e.textVertexRanges.length;for(const[s,r]of e.textVertexRanges)t[n++]=s,t[n++]=r;t[n++]=e.iconVertexRanges.length;for(const[s,r]of e.iconVertexRanges)t[n++]=s,t[n++]=r}return n}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,((e,s)=>s in t?t[s]:""))}_processFeature(e,t,s){const{line:n,iconMosaicItem:r,shaping:i,anchor:o}=e,l=this.zoom,h=this.layer,c=!!r;let u=!0;c&&(u=t?.optional||!r);const f=i&&i.length>0,d=!f||s?.optional;let g,x;if(c&&(g=this._placementEngine.getIconPlacement(o,r,t)),(g||u)&&(f&&(x=this._placementEngine.getTextPlacement(o,i,n,s)),x||d)){if(g&&x||(d||u?d||x?u||g||(x=null):g=null:(g=null,x=null)),x){const t=h.hasDataDrivenText?h.textMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(e,x.shapes,l,s.rotationAlignment,t),x.textColliders){e.textColliders=x.textColliders;for(const e of x.textColliders){e.minLod=Math.max(l+(0,a.p6)(e.minLod),0),e.maxLod=Math.min(l+(0,a.p6)(e.maxLod),25);const t=e.angle;if(t){const s=Math.cos(t),n=Math.sin(t),r=e.dxPixels*s-e.dyPixels*n,i=e.dxPixels*n+e.dyPixels*s,a=(e.dxPixels+e.width)*s-e.dyPixels*n,o=(e.dxPixels+e.width)*n+e.dyPixels*s,l=e.dxPixels*s-(e.dyPixels+e.height)*n,h=e.dxPixels*n+(e.dyPixels+e.height)*s,c=(e.dxPixels+e.width)*s-(e.dyPixels+e.height)*n,u=(e.dxPixels+e.width)*n+(e.dyPixels+e.height)*s,f=Math.min(r,a,l,c),d=Math.max(r,a,l,c),y=Math.min(i,o,h,u),g=Math.max(i,o,h,u);e.dxPixels=f,e.dyPixels=y,e.width=d-f,e.height=g-y}}}}if(g){const s=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(e,g.shapes,l,r.page,t.rotationAlignment===y.I5.VIEWPORT,s),g.iconColliders){e.iconColliders=g.iconColliders;for(const e of g.iconColliders){e.minLod=Math.max(l+(0,a.p6)(e.minLod),0),e.maxLod=Math.min(l+(0,a.p6)(e.maxLod),25);const t=e.angle;if(t){const s=Math.cos(t),n=Math.sin(t),r=e.dxPixels*s-e.dyPixels*n,i=e.dxPixels*n+e.dyPixels*s,a=(e.dxPixels+e.width)*s-e.dyPixels*n,o=(e.dxPixels+e.width)*n+e.dyPixels*s,l=e.dxPixels*s-(e.dyPixels+e.height)*n,h=e.dxPixels*n+(e.dyPixels+e.height)*s,c=(e.dxPixels+e.width)*s-(e.dyPixels+e.height)*n,u=(e.dxPixels+e.width)*n+(e.dyPixels+e.height)*s,f=Math.min(r,a,l,c),d=Math.max(r,a,l,c),y=Math.min(i,o,h,u),g=Math.max(i,o,h,u);e.dxPixels=f,e.dyPixels=y,e.width=d-f,e.height=g-y}}}}}}_addPlacedIcons(e,t,s,n,r,i){const o=Math.max(s-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,c=this._markerMap;for(const u of t){const t=r?0:Math.max(s+(0,a.p6)(u.minzoom),o),f=r?25:Math.min(s+(0,a.p6)(u.maxzoom),25);if(f<=t)continue;const d=u.tl,y=u.tr,g=u.bl,x=u.br,p=u.mosaicRect,m=u.labelAngle,_=u.minAngle,I=u.maxAngle,b=u.anchor,M=l.index,w=p.x,P=p.y,T=w+p.width,A=P+p.height,D=l.index;l.add(b.x,b.y,d.x,d.y,w,P,m,_,I,t,f,i),l.add(b.x,b.y,y.x,y.y,T,P,m,_,I,t,f,i),l.add(b.x,b.y,g.x,g.y,w,A,m,_,I,t,f,i),l.add(b.x,b.y,x.x,x.y,T,A,m,_,I,t,f,i),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===D?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([D,4]),h.add(M,M+1,M+2),h.add(M+1,M+2,M+3),c.has(n)?c.get(n)[1]+=6:c.set(n,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,s=this._glyphMap;for(const[n,r]of this._glyphBufferDataStorage)for(const i of r){const r=e.index,a=i.symbolInstance,o=i.ddAttributes,l=e.index;e.add(i.glyphAnchor[0],i.glyphAnchor[1],i.tl[0],i.tl[1],i.xmin,i.ymin,i.labelAngle,i.minAngle,i.maxAngle,i.minLod,i.maxLod,o),e.add(i.glyphAnchor[0],i.glyphAnchor[1],i.tr[0],i.tr[1],i.xmax,i.ymin,i.labelAngle,i.minAngle,i.maxAngle,i.minLod,i.maxLod,o),e.add(i.glyphAnchor[0],i.glyphAnchor[1],i.bl[0],i.bl[1],i.xmin,i.ymax,i.labelAngle,i.minAngle,i.maxAngle,i.minLod,i.maxLod,o),e.add(i.glyphAnchor[0],i.glyphAnchor[1],i.br[0],i.br[1],i.xmax,i.ymax,i.labelAngle,i.minAngle,i.maxAngle,i.minLod,i.maxLod,o),a.textVertexRanges.length>0&&a.textVertexRanges[0][0]+a.textVertexRanges[0][1]===l?a.textVertexRanges[0][1]+=4:a.textVertexRanges.push([l,4]),t.add(r,r+1,r+2),t.add(r+1,r+2,r+3),s.has(n)?s.get(n)[1]+=6:s.set(n,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,s,n,r){const i=Math.max(s-1,0),o=n===y.I5.VIEWPORT;let l,h,c,u,f,d,g,x,p,m,_;for(const n of t)l=o?0:Math.max(s+(0,a.p6)(n.minzoom),i),h=o?25:Math.min(s+(0,a.p6)(n.maxzoom),25),h<=l||(c=n.tl,u=n.tr,f=n.bl,d=n.br,g=n.labelAngle,x=n.minAngle,p=n.maxAngle,m=n.anchor,_=n.mosaicRect,this._glyphBufferDataStorage.has(n.page)||this._glyphBufferDataStorage.set(n.page,[]),this._glyphBufferDataStorage.get(n.page).push({glyphAnchor:[m.x,m.y],tl:[c.x,c.y],tr:[u.x,u.y],bl:[f.x,f.y],br:[d.x,d.y],xmin:_.x,ymin:_.y,xmax:_.x+_.width,ymax:_.y+_.height,labelAngle:g,minAngle:x,maxAngle:p,minLod:l,maxLod:h,placementLod:i,symbolInstance:e,ddAttributes:r}))}static _pushAnchors(e,t,s,n){s+=n;let r=0;const o=t.length-1;for(let e=0;e<o;e++)r+=i.bR.distance(t[e],t[e+1]);let l=n||s;if(l*=.5,r<=l)return;const h=l/r;let c=0,u=-(s=r/Math.max(Math.round(r/s),1))/2;const f=t.length-1;for(let n=0;n<f;n++){const r=t[n],i=t[n+1],o=i.x-r.x,l=i.y-r.y,f=Math.sqrt(o*o+l*l);let d;for(;u+s<c+f;){u+=s;const t=(u-c)/f,y=(0,a.GW)(r.x,i.x,t),g=(0,a.GW)(r.y,i.y,t);void 0===d&&(d=Math.atan2(l,o)),e.push(new x(y,g,d,n,h))}c+=f}}static _pushCenterAnchor(e,t){let s=0;const n=t.length-1;for(let e=0;e<n;e++)s+=i.bR.distance(t[e],t[e+1]);const r=s/2;let o=0;const l=t.length-1;for(let s=0;s<l;s++){const n=t[s],i=t[s+1],l=i.x-n.x,h=i.y-n.y,c=Math.sqrt(l*l+h*h);if(r<o+c){const t=(r-o)/c,u=(0,a.GW)(n.x,i.x,t),f=(0,a.GW)(n.y,i.y,t),d=Math.atan2(h,l);return void e.push(new x(u,f,d,s,0))}o+=c}}static _deviation(e,t,s){const n=(t.x-e.x)*(s.x-t.x)+(t.y-e.y)*(s.y-t.y),r=(t.x-e.x)*(s.y-t.y)-(t.y-e.y)*(s.x-t.x);return Math.atan2(r,n)}static _honorsTextMaxAngle(e,t,s,n,r){let a=0;const o=s/2;let l=new i.bR(t.x,t.y),h=t.segment+1;for(;a>-o;){if(--h,h<0)return!1;a-=i.bR.distance(e[h],l),l=e[h]}a+=i.bR.distance(e[h],e[h+1]);const c=[];let u=0;const f=e.length;for(;a<o;){const t=e[h];let s,o=h;do{if(++o,o===f)return!1;s=e[o]}while(s.isEqual(t));let l,d=o;do{if(++d,d===f)return!1;l=e[d]}while(l.isEqual(s));const y=this._deviation(t,s,l);for(c.push({deviation:y,distToAnchor:a}),u+=y;a-c[0].distToAnchor>r;)u-=c.shift().deviation;if(Math.abs(u)>n)return!1;a+=i.bR.distance(s,l),h=o}return!0}static _smoothVertices(e,t){if(t<=0)return e;let s=e.length;if(s<3)return e;const n=[];let r=0,a=0;n.push(0);for(let t=1;t<s;t++){const s=i.bR.distance(e[t],e[t-1]);s>0&&(r+=s,n.push(r),a++,a!==t&&(e[a]=e[t]))}if(s=a+1,s<3)return e;t=Math.min(t,.2*r);const o=e[0].x,l=e[0].y,h=e[s-1].x,c=e[s-1].y,u=i.bR.sub(e[0],e[1]);u.normalize(),e[0].x+=t*u.x,e[0].y+=t*u.y,u.assignSub(e[s-1],e[s-2]),u.normalize(),e[s-1].x+=t*u.x,e[s-1].y+=t*u.y,n[0]-=t,n[s-1]+=t;const f=[];f.push(new i.bR(o,l));const d=1e-6,y=.5*t;for(let r=1;r<s-1;r++){let a=0,o=0,l=0;for(let s=r-1;s>=0;s--){const i=y+n[s+1]-n[r];if(i<0)break;const h=n[s+1]-n[s],c=n[r]-n[s]<y?1:i/h;if(c<d)break;const u=c*c,f=c*i-.5*u*h,g=c*h/t,x=e[s+1],p=e[s].x-x.x,m=e[s].y-x.y;a+=g/f*(x.x*c*i+.5*u*(i*p-h*x.x)-u*c*h*p/3),o+=g/f*(x.y*c*i+.5*u*(i*m-h*x.y)-u*c*h*m/3),l+=g}for(let i=r+1;i<s;i++){const s=y-n[i-1]+n[r];if(s<0)break;const h=n[i]-n[i-1],c=n[i]-n[r]<y?1:s/h;if(c<d)break;const u=c*c,f=c*s-.5*u*h,g=c*h/t,x=e[i-1],p=e[i].x-x.x,m=e[i].y-x.y;a+=g/f*(x.x*c*s+.5*u*(s*p-h*x.x)-u*c*h*p/3),o+=g/f*(x.y*c*s+.5*u*(s*m-h*x.y)-u*c*h*m/3),l+=g}f.push(new i.bR(a/l,o/l))}return f.push(new i.bR(h,c)),e[0].x=o,e[0].y=l,e[s-1].x=h,e[s-1].y=c,f}static _pushCentroid(e,t){const s=4096,n=4096,r=t.length-1;let i=0,a=0,o=0,l=t[0].x,h=t[0].y;l>s&&(l=s),l<0&&(l=0),h>n&&(h=n),h<0&&(h=0);for(let e=1;e<r;e++){let r=t[e].x,c=t[e].y,u=t[e+1].x,f=t[e+1].y;r>s&&(r=s),r<0&&(r=0),c>n&&(c=n),c<0&&(c=0),u>s&&(u=s),u<0&&(u=0),f>n&&(f=n),f<0&&(f=0);const d=(r-l)*(f-h)-(u-l)*(c-h);i+=d*(l+r+u),a+=d*(h+c+f),o+=d}i/=3*o,a/=3*o,isNaN(i)||isNaN(a)||e.push(new x(i,a))}}J._bidiEngine=new q.A,function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.NO_DATA=1]="NO_DATA",e[e.READY=2]="READY",e[e.MODIFIED=3]="MODIFIED",e[e.INVALID=4]="INVALID"}(K||(K={}));class Z{constructor(e,t,s,n,r,o){if(this._pbfTiles={},this._tileClippers={},this._client=s,this._tile=t,this._sourceDataMaxLOD=n,o){this._styleLayerUIDs=new Set;for(const e of o)this._styleLayerUIDs.add(e)}this._styleRepository=r,this._layers=this._styleRepository?.layers??[];const[l,h,c]=t.tileKey.split("/").map(parseFloat);this._level=l;const u=(0,a.IU)(this._level);for(const t of Object.keys(e)){const s=e[t];if(this._pbfTiles[t]=new w.A(new Uint8Array(s.protobuff),new DataView(s.protobuff)),s.refKey){const[e]=s.refKey.split("/").map(parseFloat),n=l-e;if(n>0){const e=(1<<n)-1,s=h&e,r=c&e;this._tileClippers[t]=new i.O3(n,s,r,8,u)}}this._tileClippers[t]||(this._tileClippers[t]=new i.Ox)}}_canParseStyleLayer(e){return!this._styleLayerUIDs||this._styleLayerUIDs.has(e)}async parse(e){const t=(0,P.F)(),s=this._initialize(e),{returnedBuckets:n}=s;this._processLayers(s),this._linkReferences(s),this._filterFeatures(s);const r=[],i=new Set,a=(e,t)=>{i.has(e)||(r.push({name:e,repeat:t}),i.add(e))},o={};for(const e of n)e.getResources(e.tileClipper,a,o);if(this._tile.status===K.INVALID)return[];const l=this._fetchResources(r,o,e);return Promise.all([...l,t]).then((()=>this._processFeatures(s.returnedBuckets)))}_initialize(e){const t=e?.signal;return{signal:t,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(e){const{sourceNameToTileData:t,zoom:s,layers:n,sourceNameToTileClipper:r,sourceNameToUniqueSourceLayerBuckets:i,sourceNameToUniqueSourceLayers:a,returnedBuckets:o,layerIdToBucket:l,referencerUIDToReferencedId:h}=e,c=this._sourceDataMaxLOD;for(let e=n.length-1;e>=0;e--){const u=n[e];if(s<c){if(u.minzoom&&s<Math.floor(u.minzoom)||u.maxzoom&&s>=u.maxzoom)continue}else if(u.maxzoom&&s>=u.maxzoom)continue;if(u.type===y.Dc.BACKGROUND||!this._canParseStyleLayer(u.uid)||!t[u.source]||!r[u.source])continue;const f=t[u.source],d=r[u.source],g=u.sourceLayer,x=f[g];if(x){let e=a[u.source];if(e||(e=a[u.source]=new Set),e.add(u.sourceLayer),u.refLayerId)h.set(u.uid,u.refLayerId);else{const e=this._createBucket(u);if(e){e.layerUIDs=[u.uid],e.layerExtent=x.extent,e.tileClipper=d;let t=i[u.source];t||(t=i[u.source]={});let s=t[g];s||(s=t[g]=[]),s.push(e),o.push(e),l[u.id]=e}}}}}_linkReferences(e){const{layerIdToBucket:t,referencerUIDToReferencedId:s}=e;s.forEach(((e,s)=>{t[e]&&t[e].layerUIDs.push(s)}))}_filterFeatures(e){const{signal:t,sourceNameToTileData:s,sourceNameToUniqueSourceLayerBuckets:r,sourceNameToUniqueSourceLayers:i}=e,a=10*this._level,o=10*(this._level+1),l=[],h=[];for(const e of Object.keys(i))i[e].forEach((t=>{l.push(t),h.push(e)}));for(let e=0;e<l.length;e++){const i=h[e],c=l[e];if(!s[i]||!r[i])continue;const u=s[i][c],f=r[i][c];if(!f||0===f.length)continue;if((0,n.G4)(t))return;let d=0;const y=u.getData();for(;y.nextTag(2);){const e=y.getMessage(),t=new T(e,u,d++);e.release();const s=t.values;if(s){const e=s._minzoom;if(e&&e>=o)continue;const t=s._maxzoom;if(t&&t<=a)continue}for(const e of f)e.pushFeature(t)}}}_fetchResources(e,t,s){const n=[],r=this._tile.getWorkerTileHandler();let i,a;e.length>0&&(i=r.fetchSprites(e,this._client,s),n.push(i));for(const e in t){const i=t[e];i.size>0&&(a=r.fetchGlyphs(this._tile.tileKey,e,i,this._client,s),n.push(a))}return n}_processFeatures(e){const t=e.filter((e=>e.hasFeatures()||this._canParseStyleLayer(e.layer.uid)));for(const e of t)e.processFeatures(e.tileClipper);return t}_parseTileData(e){const t={};for(const s of Object.keys(e)){const n=e[s],r={};for(;n.next();)switch(n.tag()){case 3:{const e=n.getMessage(),t=new k(e);e.release(),r[t.name]=t;break}default:n.skip()}t[s]=r}return t}_createBucket(e){switch(e.type){case y.Dc.BACKGROUND:return null;case y.Dc.FILL:return this._createFillBucket(e);case y.Dc.LINE:return this._createLineBucket(e);case y.Dc.CIRCLE:return this._createCircleBucket(e);case y.Dc.SYMBOL:return this._createSymbolBucket(e)}}_createFillBucket(e){return new F(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new B(e.fillMaterial.getStride()),new D,new V(e.outlineMaterial.getStride()),new D)}_createLineBucket(e){return new N(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new L(e.lineMaterial.getStride()),new D)}_createCircleBucket(e){return new C(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new R(e.circleMaterial.getStride()),new D)}_createSymbolBucket(e){const t=this._tile;return new J(t.tileKey,e,this._level,new v(e.iconMaterial.getStride()),new D,new v(e.textMaterial.getStride()),new D,t.placementEngine,t.getWorkerTileHandler())}}class ${constructor(e,t,s,n){this.status=K.INITIALIZED,this.placementEngine=new I,this.tileKey=e,this.refKeys=t,this._workerTileHandler=s,this._styleRepository=n}release(){this.tileKey="",this.refKeys=null,this.status=K.INITIALIZED,this._workerTileHandler=null}async parse(e,t){const s=t?.signal;if(null!=s){const e=()=>{s.removeEventListener("abort",e),this.status=K.INVALID};s.addEventListener("abort",e)}let r;const i={bucketsWithData:[],emptyBuckets:null};try{r=await this._parse(e,t)}catch(e){if((0,n.zf)(e))throw e;return{result:i,transferList:[]}}this.status=K.READY;const a=i.bucketsWithData,o=[];for(const e of r)if(e.hasFeatures()){const t=e.serialize();a.push(t)}else o.push(e.layer.uid);const l=[...a];let h=null;return o.length>0&&(h=Uint32Array.from(o),l.push(h.buffer)),i.emptyBuckets=h,{result:i,transferList:l}}setObsolete(){this.status=K.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(e,t){const s=e.sourceName2DataAndRefKey;return 0===Object.keys(s).length?[]:(this.status=K.MODIFIED,new Z(s,this,t.client,e.sourceDataMaxLOD,this._styleRepository,e.styleLayerUIDs).parse(t))}}var Q=s(45013);class X{constructor(){this._spriteInfo={},this._glyphInfo={},this._sourceDataMaxLOD=25}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){return this._styleRepository?.layers??[]}async createTileAndParse(e,t){const{key:s}=e,r={};for(const t of Object.keys(e.sourceName2DataAndRefKey)){const s=e.sourceName2DataAndRefKey[t];r[t]=s.refKey}const i=new $(s,r,this,this._styleRepository);try{return await i.parse({...e,sourceDataMaxLOD:this._sourceDataMaxLOD},t)}catch(e){if(i.setObsolete(),i.release(),!(0,n.zf)(e))throw e;return null}}updateStyle(e){if(!e||0===e.length||!this._styleRepository)return;const t=this._styleRepository;for(const s of e){const e=s.type,n=s.data;switch(e){case r.$q.PAINTER_CHANGED:t.setPaintProperties(n.layer,n.paint);break;case r.$q.LAYOUT_CHANGED:t.setLayoutProperties(n.layer,n.layout);break;case r.$q.LAYER_REMOVED:t.deleteStyleLayer(n.layer);break;case r.$q.LAYER_CHANGED:t.setStyleLayer(n.layer,n.index);break;case r.$q.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(e){const{style:t,sourceDataMaxLOD:s}=e;this._styleRepository=new Q.A(t),this._sourceDataMaxLOD=s,this._spriteInfo={},this._glyphInfo={}}fetchSprites(e,t,s){const n=[],r=this._spriteInfo;for(const t of e)void 0===r[t.name]&&n.push(t);return 0===n.length?Promise.resolve():t.invoke("getSprites",n,{signal:s?.signal}).then((e=>{for(const t in e){const s=e[t];r[t]=s}}))}getSpriteItems(){return this._spriteInfo}fetchGlyphs(e,t,s,n,r){const i=[];let a=this._glyphInfo[t];return a?s.forEach((e=>{a[e]||i.push(e)})):(a=this._glyphInfo[t]=[],s.forEach((e=>i.push(e)))),0===i.length?Promise.resolve():n.invoke("getGlyphs",{tileID:e,font:t,codePoints:i},r).then((e=>{for(let t=0;t<e.length;t++)e[t]&&(a[t]=e[t])}))}getGlyphItems(e){return this._glyphInfo[e]}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9547],{19547:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ae});var i=n(90237),s=n(13874),o=n(69540),a=n(49186),r=n(92071),l=n(74887),c=n(36708),u=n(10107),p=(n(44208),n(53966)),d=(n(87811),n(40608)),m=n(4146),f=n(63074),g=n(69208),h=n(89015),v=n(16131),y=n(8303),b=n(54310),w=n(25036),x=n(82935),C=n(10873),I=n(20437),S=n(74797),D=n(5443),A=n(38458),T=n(78888),L=n(50103);function V(e){return e.endsWith("?")?e.slice(0,-1):e}function M(e){return e.filter((({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e)))}function N(e){const t={};for(let n=0;n<e.childNodes.length;n++){const i=e.childNodes[n];if(1!==i.nodeType)continue;const s=(0,L.vv)(i).toLowerCase();switch(s){case"title":case"abstract":t[s]=(0,L.mX)(i);break;case"identifier":t.id=(0,L.mX)(i);break;case"wgs84boundingbox":{const e=(0,L.pN)(i,"LowerCorner"),n=(0,L.pN)(i,"UpperCorner");t.lonLatEnvelope=new D.A({xmin:e[0],ymin:e[1],xmax:n[0],ymax:n[1],spatialReference:{wkid:4326}})}break;case"coveragesummary":t.coverageSummaries=t.coverageSummaries||[],t.coverageSummaries.push(N(i))}}return t}function R(e,t){if(e.coverageSummaries)for(let n=0;n<e.coverageSummaries.length;n++)e.coverageSummaries[n].abstract=e.coverageSummaries[n].abstract||e.abstract,e.coverageSummaries[n].lonLatEnvelope=e.coverageSummaries[n].lonLatEnvelope||e.lonLatEnvelope,e.coverageSummaries[n].title=e.coverageSummaries[n].title||e.title,R(e.coverageSummaries[n],t);null!=e.id&&t.push(e)}function P(e){const t=(0,L.V6)(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",n=(0,L.V6)(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=(0,L.V6)(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:V(t),describeCoverage:V(n),getCoverage:V(i)}}function E(e,t=null){let n=null;n="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e;let i=n.documentElement.getAttribute("version");"1.0"===i?i="1.0.0":"1.1"===i&&(i="1.1.0");const s=i||t||"1.0.0",o=s.slice(0,3);let r;if("2.0"===o)r=function(e){const t=(0,L.V6)(e,"ServiceIdentification"),n=(0,L.mX)(t,"Title"),i=(0,L.Dy)(t,"ServiceTypeVersion"),s=(0,L.Dy)(t,"Profile"),o=P((0,L.V6)(e,"OperationsMetadata")),a=(0,L.IC)(e,"Contents/CoverageSummary"),r=[];for(let e=0;e<a.length;e++){const t=a[e],n=(0,L.mX)(t,"CoverageId"),i=(0,L.V6)(t,"WGS84BoundingBox");let s;if(i){const e=(0,L.pN)(i,"LowerCorner"),t=(0,L.pN)(i,"UpperCorner");s=new D.A({xmin:e[0],ymin:e[1],xmax:t[0],ymax:t[1],spatialReference:{wkid:4326}})}const o=(0,L.mX)(t,"CoverageSubtype")||"RectifiedGridCoverage";r.push({id:n,lonLatEnvelope:s,coverageSubType:o})}const l=(0,L.V6)(e,"ServiceMetadata");return{name:n,supportedVersions:i,supportedFormats:(0,L.Dy)(l,"formatSupported"),supportedInterpolations:(0,L.Dy)(l,"interpolationSupported").concat((0,L.Dy)(l,"InterpolationSupported")),onlineResources:o,profiles:s,coverages:r,gridCoverages:M(r),version:"2.0.1"}}(n);else if("1.1"===o)r=function(e){const t=(0,L.mX)(e,"ServiceIdentification/Title"),n=(0,L.Dy)(e,"ServiceIdentification/ServiceTypeVersion"),i=P((0,L.V6)(e,"OperationsMetadata")),s=[],o=(0,L.V6)(e,"Contents");for(let e=0;e<o.childNodes.length;e++){const t=o.childNodes[e];1===t.nodeType&&(0,L.g7)(t,"CoverageSummary")&&R(N(t),s)}const a=(0,L.Dy)(o,"SupportedFormat");return{name:t,onlineResources:i,coverages:s,gridCoverages:M(s),supportedVersions:n,supportedFormats:a,version:"1.1.0"}}(n);else{if("1.0"!==o)throw new a.A("wcsraster:parsecapabilities","the capabilities version is not supported");r=function(e){const t=(0,L.mX)(e,"Service/name"),n=(0,L.V6)(e,"Capability"),i=(0,L.V6)(n,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",s=(0,L.V6)(n,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",o=(0,L.V6)(n,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",a={getCapabilities:V(i),describeCoverage:V(s),getCoverage:V(o)},r=(0,L.IC)(e,"CoverageOfferingBrief"),l=[];for(let e=0;e<r.length;e++){const t=r[e],n=(0,L.mX)(t,"name"),i=(0,L.IC)(t,"pos"),s=(0,L.pN)(i[0]),o=(0,L.pN)(i[1]),a=new D.A({xmin:s[0],ymin:s[1],xmax:o[0],ymax:o[1],spatialReference:{wkid:4326}});l.push({id:n,lonLatEnvelope:a})}return{name:t,onlineResources:a,coverages:l,gridCoverages:M(l),supportedVersions:["1.0.0"],version:"1.0.0"}}(n)}return r.version=s,r}var X=n(39829),$=n(87186),O=n(77301);function _(e){e.variables.forEach((e=>e.dimensions.forEach((e=>e.values??=(0,O.Xg)(e)))))}function k(e){return{requestResponseCRSs:(0,L.Dy)(e,"requestResponseCRSs").map((e=>e.split(":")[1])),nativeCRSs:(0,L.Dy)(e,"nativeCRSs").map((e=>e.split(":")[1]))}}function F(e,t){const n=(0,L.Dy)(e,"1.0.0"===t?"interpolationMethod":"InterpolationMethod"),i="1.0.0"===t?e.getAttribute("default"):(0,L.mX)(e,"InterpolationMethods/Default");return null!=i?[i].concat(n.filter((e=>e.toLowerCase()!==i.toLowerCase()))):n}function G(e){return null==e?["nearest"]:e.map((e=>{const t=e.toLowerCase();return t.includes("nearest")?"nearest":t.includes("linear")?"bilinear":t.includes("cubic")?"cubic":null})).filter((e=>!!e))}function B(e){const t=(0,L.IC)(e,"pos"),n=(0,L.pN)(t[0]),i=(0,L.pN)(t[1]);return new D.A({xmin:n[0],ymin:n[1],xmax:i[0],ymax:i[1],spatialReference:{wkid:4326}})}function j(e,t){const n=(0,L.Dy)(e,t);return n?.length&&""!==n[0]&&!isNaN(Number(n[0]))?n.map((e=>Number(e))):null}function W(e){const t=(0,L.pN)(e,"MinimumValue"),n=(0,L.pN)(e,"MaximumValue");return t.length&&n.length?t.map(((e,t)=>({min:e,max:n[t],avg:-1,stddev:-1}))):null}function q(e){return null==e?null:e.every((t=>t===e[0]))?e[0]:e}function Z(e){const t=[],n=(0,L.IC)(e,"RangeSet");let i=[];for(let e=0;e<n.length;e++){const s=(0,L.mX)(n[e],"name"),o=(0,L.mX)(n[e],"label"),a=[],r=j(n[e],"nullValues/singleValue"),l=(0,L.IC)(n[e],"AxisDescription");for(let e=0;e<l.length;e++){const t=(0,L.mX)(l[e],"name"),n=(0,L.mX)(l[e],"label"),s=(0,L.Dy)(l[e],"singleValue");if(0===s.length){const t=(0,L.mX)(l[e],"min"),n=(0,L.mX)(l[e],"max"),i=Number((0,L.mX)(l[e],"res"))||1;if(null!==t&&null!==n)for(let e=parseInt(t,10);e<=parseInt(n,10);e+=i)s.push(e.toString())}"band"===t.toLowerCase()&&(i=s),a.push({name:t,label:n,values:s})}t.push({name:s,label:o,nullValues:r,axis:a})}return{rangeSet:t,bandNames:i}}function U(e=null){if(!e)return{resolution:null,units:null};let t=e.toUpperCase();const n=["Years","Months","Days","Hours","Minutes","Seconds"];let i,s,o;return t.includes("PT")?(t=t.slice(2),o=["H","M","S"].findIndex((e=>t.includes(e))),i=n[3+o],s=parseFloat(t.slice(0,-1))):(t=t.slice(1),o=["Y","M","D"].findIndex((e=>t.includes(e))),o>-1&&(i=n[o]),s=parseFloat(t.slice(0,-1))),{resolution:s,units:i}}function z(e){const t=(0,L.IC)(e,"timeposition");if(t.length>0){const e=[];for(let n=0;n<t.length;n++)e.push(new Date((0,L.mX)(t[n])));return{begin:e[0],end:e[e.length-1],values:e}}const n=(0,L.V6)(e,"timePeriod")||(0,L.V6)(e,"TimePeriod");return n?{begin:new Date((0,L.mX)(n,"beginPosition")||(0,L.mX)(n,"BeginPosition")),end:new Date((0,L.mX)(n,"endPosition")||(0,L.mX)(n,"EndPosition")),...U((0,L.mX)(n,"timeResolution")||(0,L.mX)(n,"TimeResolution"))}:null}function H(e){const t=(0,L.V6)(e,"spatialDomain"),n=(0,L.V6)(t,"Envelope")||(0,L.V6)(t,"EnvelopeWithTimePeriod"),i=n.getAttribute("srsName").split(":"),s=i[i.length-1],o=(0,L.IC)(n,"pos"),a=(0,L.pN)(o[0]),r=(0,L.pN)(o[1]),l=parseInt(s,10),c=isNaN(l)?null:{wkid:l},u=new D.A({xmin:a[0],ymin:a[1],xmax:r[0],ymax:r[1],spatialReference:c}),p=(0,L.V6)(t,"RectifiedGrid"),d=(0,L.mX)(p,"low").split(" "),m=(0,L.mX)(p,"high").split(" "),f=parseInt(m[0],10)-parseInt(d[0],10)+1,g=parseInt(m[1],10)-parseInt(d[1],10)+1,h=(0,L.pN)(t,"origin/pos"),v=(0,L.IC)(t,"offsetVector"),y={envelope:u,columns:f,rows:g,offset:{x:parseFloat((0,L.mX)(v[0]).split(" ")[0]),y:parseFloat((0,L.mX)(v[1]).split(" ")[1])},origin:{x:h[0],y:h[1]}},b=(0,L.V6)(e,"temporalDomain")||(0,L.V6)(e,"TemporalDomain");return{spatialDomain:y,temporalDomain:b?z(b):null}}function Y(e){if(!e.temporalDomain)return null;const{begin:t,end:n,values:i,units:s,resolution:o}=e.temporalDomain,a={variables:[{name:"default",description:"",dimensions:[{name:"StdTime",description:"",unit:"ISO8601",values:i?.map((e=>e.getTime())),hasRegularIntervals:!i,interval:o,intervalUnit:s,extent:[t.getTime(),n.getTime()]}]}]};return _(a),a}function Q(e,t){const n=[],i=(0,L.IC)(e,"Field");let s,o=[];for(let e=0;e<i.length;e++){const a=(0,L.mX)(i[e],"Identifier"),r=(0,L.mX)(i[e],"Description"),l=(0,L.mX)(i[e],"Definition"),c=(0,L.mX)(i[e],"Abstract"),u=(0,L.mX)(i[e],"Title"),p=j(i[e],"NullValue"),d=(0,L.V6)(i[e],"AllowedValues"),m=d?W(d):null,f=F(i[e],"1.1.0"),g=[],h=(0,L.IC)(i[e],"Axis");for(let e=0;e<h.length;e++){const n=h[e].getAttribute("identifier"),i=(0,L.mX)(h[e],"UOM"),a=(0,L.mX)(h[e],"DataType"),r=(0,L.Dy)(h[e],"Key");t&&!n.toLowerCase().includes("band")||(o=r,s=p),g.push({identifier:n,uom:i,dataType:a,values:r,bandNoDataValues:s})}n.push({identifier:a,description:r,definition:l,abstract:c,title:u,supportedInterpolations:f,axis:g,nullValues:p,statistics:m})}return{rangeSet:n,bandNames:o,bandNoDataValues:s,statistics:n[0].statistics}}function J(e,t){if(!t.temporalDomain)return null;const n=e.filter((e=>!e.identifier.toLowerCase().includes("field_1")&&!e.axis.some((e=>e.identifier.includes("band"))))),i=[];if(n.length&&n.forEach((e=>{const t=e.axis.map((e=>{const t=e.values.map((t=>"ISO8601"===e.uom?(t=t.trim()).toLowerCase().includes("z")?new Date(t).getTime():new Date(t+"Z").getTime():parseFloat(t.trim()))),n=[Math.min.apply(null,t),Math.max.apply(null,t)];return{name:e.identifier.trim(),description:"",field:e.identifier.trim(),unit:e.uom?e.uom.trim():"",hasRegularIntervals:!1,values:t,extent:n}}));i.push({name:e.identifier.trim(),description:e.description?.trim()??"",unit:"",dimensions:t,statistics:e.statistics})})),t.temporalDomain){const{begin:e,end:n,values:s,units:o,resolution:a}=t.temporalDomain;i.some((e=>e.dimensions.some((e=>"stdtime"===e.name.toLowerCase()))))||i.forEach((t=>{t.dimensions.push({name:"StdTime",description:"",unit:"ISO8601",values:s?.map((e=>e.getTime())),hasRegularIntervals:!s,interval:a,intervalUnit:o,extent:[e.getTime(),n.getTime()]})}))}if(i.length){const e={variables:i};return _(e),e}return null}function K(e){const t=(0,L.V6)(e,"SpatialDomain"),n=(0,L.V6)(t,"GridCRS"),i=(0,L.mX)(n,"GridBaseCRS"),s=(0,L.mX)(n,"GridOrigin"),o=s?.split(" ").map((e=>parseFloat(e)))??[0,0],a=(0,L.pN)(n,"GridOffsets"),r=(0,L.IC)(t,"BoundingBox");let l,c,u,p;for(let e=0;e<r.length;e++){const t=r[e].getAttribute("crs")?.toLowerCase();if(null!=t)if(t.includes("imagecrs")){const t=(0,L.pN)(r[e],"LowerCorner"),n=(0,L.pN)(r[e],"UpperCorner");l=n[0]-t[0]+1,c=n[1]-t[1]+1}else if(t.indexOf("epsg")>0){const n=t.split(":");u=parseInt(n[n.length-1],10);const i=(0,L.pN)(r[e],"LowerCorner"),s=(0,L.pN)(r[e],"UpperCorner");p=new D.A({xmin:i[0],ymin:i[1],xmax:s[0],ymax:s[1],spatialReference:{wkid:u}})}}const d=l>c,m=p.xmax-p.xmin>p.ymax-p.ymin;let f=!1;(0,A.m)(u)&&(d===m?f=!1:(f=!0,p=new D.A({xmin:p.ymin,ymin:p.xmin,xmax:p.ymax,ymax:p.xmax,spatialReference:{wkid:u}})));const g={columns:l,rows:c,origin:{x:o[0],y:o[1]},offset:{x:a[0],y:a[a.length-1]},gridBaseCRS:i,envelope:p,useEPSGAxis:f},h=(0,L.V6)(e,"temporalDomain")||(0,L.V6)(e,"TemporalDomain");return{spatialDomain:g,temporalDomain:h?z(h):null}}function ee(e){const t=(0,L.V6)(e,"Envelope")||(0,L.V6)(e,"EnvelopeWithTimePeriod"),n=t.getAttribute("srsName"),i=n.slice(n.lastIndexOf("/")+1),s=t.getAttribute("axisLabels").split(" ").map((e=>e.trim())).filter((e=>""!==e.trim())),o=(0,L.pN)(t,"lowerCorner"),a=(0,L.pN)(t,"upperCorner"),r=!["y","lat","latitude","north","nor","n","b"].includes(s[0].toLowerCase());let l;const c=parseInt(i,10),u=isNaN(c)?null:{wkid:c};l=new D.A(r?{xmin:o[0],ymin:o[1],xmax:a[0],ymax:a[1],spatialReference:u}:{xmin:o[1],ymin:o[0],xmax:a[1],ymax:a[0],spatialReference:u});const p={mins:o,maxs:a},d=t.getAttribute("uomLabels").trim().split(" ");let m,f;if((0,L.g7)(t,"EnvelopeWithTimePeriod")){m=new Date((0,L.mX)(e,"beginPosition")||(0,L.mX)(e,"BeginPosition")),f=new Date((0,L.mX)(e,"endPosition")||(0,L.mX)(e,"EndPosition"));const t=d?.findIndex((e=>"oledatetime"===e?.toLowerCase()));t>-1&&(d[t]="ISO8601")}return{envelope:l,axisLabels:s,uomLabels:d.length?d:null,envelopeAllDims:p,beginPosition:m,endPosition:f,isEastFirst:r}}function te(e,t){const n=[],i=(0,L.IC)(e,"DataRecord"),s=[];let o,a=[];for(let e=0;e<i.length;e++){const r=(0,L.IC)(i[e],"field"),l=[];for(let e=0;e<r.length;e++){const n=r[e].getAttribute("name"),i=(0,L.mX)(r[e],"description")||"",c=(0,L.V6)(r[e],"uom")?.getAttribute("code")||"",u=(0,L.pN)(r[e],"interval"),p=j(r[e],"nilValue")?.[0];t&&!n.toLowerCase().includes("band")||(s.push(n),u?.length&&(o=o||[],o.push({min:u[0],max:u[1],avg:-1,stddev:-1})),a.push(p)),l.push({name:n,description:i,uom:c,allowedValues:u,nilValue:p})}n.push(l)}return a.some((e=>null!=e))||(a=null),{rangeType:n,bandNames:s,bandStats:o,bandNoDataValues:a}}function ne(e){let t=1,n="";const i=.01;return Math.abs(e-1/24)<1/24*i?n="Hours":Math.abs(e-1)<1*i?n="Days":e<1?(t=Math.round(24*e),n="Hours"):e>28-i&&e<31+i||Math.round(e/30)<12?n="Months":e>365-i&&e<366+i&&(n="Years"),{interval:t,intervalUnit:n}}function ie(e,t,n){if(n.axisLabels.length<=2)return null;const i=[];for(let t=0;t<e.length;t++){const n=e[t];for(let e=0;e<n.length;e++)n[e].name.toLowerCase().includes("band")||i.push(n[e])}const s=[];if(i.length){const e=[];for(let i=2;i<n.axisLabels.length;i++){const s=t.uomLabels?.[i]?.trim()??"",o=n.axisLabels[i].toLowerCase().includes("time")||"iso8601"===s.toLowerCase()||"oledatetime"===s.toLowerCase();let a,r;if(o){const e=ne(n.offset[i]);a=e.interval,r=e.intervalUnit}else a=n.offset[i],r=s;const l=[];o?(l.push(ae(t.envelopeAllDims.mins[i])),l.push(ae(t.envelopeAllDims.maxs[i]))):(l.push(t.envelopeAllDims.mins[i]),l.push(t.envelopeAllDims.maxs[i])),e.push({name:n.axisLabels[i].trim(),description:n.axisLabels[i].trim(),unit:o?"ISO8601":s,hasRegularIntervals:!0,extent:l,interval:a,intervalUnit:r})}if(i.forEach((t=>{const{allowedValues:n}=t,i=2===n?.length?[{min:n[0],max:n[1],avg:-1,stddev:-1}]:null;s.push({name:t.name.trim(),description:t.description?.trim()??"",unit:t.uom.trim(),statistics:i,dimensions:[...e]})})),s.length){const e={variables:s};return _(e),e}}return null}function se(e,t){const n=(0,L.V6)(e,"RectifiedGrid"),i=(0,L.pN)(n,"low"),s=(0,L.pN)(n,"high"),o=[];for(let e=0;e<i.length;e++)o.push(s[e]-i[e]+1);const a=(0,L.mX)(n,"axisLabels").split(" "),r=(0,L.pN)(n,"origin/pos"),l=(0,L.IC)(n,"offsetVector"),c=[];for(let e=0;e<l.length;e++){const t=(0,L.pN)(l[e]),n=t.findIndex((e=>0!==e));c[n]=t[n]}let u,p,d,m=!1;return t?.length&&a?.length&&(m=[...t].sort(((e,t)=>e<t?-1:1)).join(",")===[...a].sort(((e,t)=>e<t?-1:1)).join(",")),["y","lat","latitude","north","nor","n","b"].includes((m?a:t)[0].toLowerCase())?(u=o[1],p=o[0],d={y:Math.abs(c[0]),x:Math.abs(c[1])}):(u=o[0],p=o[1],d={x:Math.abs(c[0]),y:Math.abs(c[1])}),{columns:u,rows:p,origin:r,offset:c,resolution:d,gridSamples:o,axisLabels:a,hasSameAxisLabelsAsBoundedBy:m}}function oe(e){const t=(0,L.V6)(e,"EarthObservation");if(!t)return null;const n=(0,L.V6)(t,"phenomenonTime"),i=n?z(n):null,s=(0,L.V6)(t,"phenomenonTime"),o=s?z(s):null,a=(0,L.mX)(t,"featureOfInterest/Footprint/multiExtentOf/MultiSurface/surfaceMembers/Polygon/exterior/LinearRing/posList");let r=null;if(a){const e=a.split(" ").map((e=>e.trim())).filter((e=>null!=e&&""!==e)).map(Number);if(e.length){const t=[];for(let n=0;n<e.length/2;n+=2)t.push(e[n],e[n+1]);r=new X.A({rings:[[t]]})}}return{observation:{phenomenonTime:i,resultTime:o,footprint:r,identifier:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/identifier"),acquisitionType:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/acquisitionType"),status:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/status")}}}function ae(e){return Math.round(24*(e-25569)*3600*1e3)}async function re(e,t){const{coverageIds:n,version:i,customParameters:s,signal:o}=t,r=i.slice(0,3),c="1.0"===r?"coverage":"1.1"===r?"identifiers":"coverageId",u={service:"WCS",request:"DescribeCoverage",version:i,[c]:n.join(","),...s};try{const{data:t}=await(0,T.A)(e,{query:u,responseType:"xml",signal:o});return function(e,t){let n=null;if(n="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e,"1.0.0"===t)return(0,L.IC)(n,"CoverageOffering").map((e=>function(e){const t={version:"1.0"};let n,i=[];for(let s=0;s<e.childNodes.length;s++){const o=e.childNodes[s];if(1===o.nodeType)if((0,L.g7)(o,"description"))t.description=(0,L.mX)(o);else if((0,L.g7)(o,"name"))t.name=(0,L.mX)(o);else if((0,L.g7)(o,"label"))t.label=(0,L.mX)(o);else if((0,L.g7)(o,"supportedFormats"))t.supportedFormats=(0,L.Dy)(o,"formats");else if((0,L.g7)(o,"supportedCRSs"))t.supportedCRSs=k(o);else if((0,L.g7)(o,"supportedInterpolations"))t.supportedInterpolations=F(o,"1.0.0");else if((0,L.g7)(o,"lonLatEnvelope"))t.lonLatEnvelope=B(o);else if((0,L.g7)(o,"rangeSet")){const e=Z(o);t.rangeSet=e.rangeSet,i=e.bandNames;const s=e.rangeSet[0].nullValues;s?.length&&(n=q(s))}else(0,L.g7)(o,"domainSet")&&(t.domainSet=H(o))}const s=G(t.supportedInterpolations),{name:o,description:a,label:r,lonLatEnvelope:l,supportedFormats:c}=t,{spatialDomain:u}=t.domainSet,p={x:Math.abs(u.offset.x),y:Math.abs(u.offset.y)},d=Y(t.domainSet),m=new $.A({width:u.columns,height:u.rows,pixelSize:p,pixelType:"unknown",extent:u.envelope,spatialReference:u.envelope.spatialReference,bandCount:i.length||1,noDataValue:n,multidimensionalInfo:d});return{id:o,title:t.name,description:a||r,lonLatEnvelope:l,rasterInfo:m,bandNames:i,supportedFormats:c,supportedInterpolations:s,coverageDescription:t,version:"1.0.0",useEPSGAxis:!1}}(e)));const i=(0,L.IC)(n,"CoverageDescription");return"1.1.0"===t||"1.1.1"===t||"1.1.2"===t?i.map((e=>function(e,t){const n=[],i=[],s={supportedFormats:n,supportedCRSs:i,version:"1.1"};let o,a,r=[];for(let t=0;t<e.childNodes.length;t++){const l=e.childNodes[t];if(1!==l.nodeType)continue;const c=(0,L.vv)(l).toLowerCase();switch(c){case"title":case"abstract":case"identifier":s[c]=(0,L.mX)(l);break;case"supportedformat":{const e=(0,L.mX)(l);n.includes(e)||n.push(e)}break;case"supportedcrs":{const e=(0,L.mX)(l);i.includes(e)||i.push(e)}break;case"range":{const e=Q(l,!!s.domain?.temporalDomain);s.range=e.rangeSet,r=e.bandNames;const{bandNoDataValues:t}=e;t?.length&&(o=q(t)),a=e.statistics}break;case"domain":s.domain=K(l)}}const l=G(s.range[0].supportedInterpolations),{identifier:c,abstract:u,title:p,domain:d,range:m}=s,f={x:Math.abs(d.spatialDomain.offset.x),y:Math.abs(d.spatialDomain.offset.y)},g=J(m,d);g&&(o=m[0].nullValues,1===o?.length&&(o=o[0]));const h=new $.A({width:d.spatialDomain.columns,height:d.spatialDomain.rows,pixelSize:f,pixelType:"unknown",extent:d.spatialDomain.envelope,spatialReference:d.spatialDomain.envelope.spatialReference,bandCount:r.length||1,noDataValue:o,statistics:a,multidimensionalInfo:g});return{id:c,title:s.title,description:u||p,bandNames:r,rasterInfo:h,supportedFormats:n,supportedInterpolations:l,coverageDescription:s,version:t,useEPSGAxis:d.spatialDomain.useEPSGAxis}}(e,t))):i.map((e=>function(e){const t={version:"2.0"};let n,i,s=[];for(let o=0;o<e.childNodes.length;o++){const a=e.childNodes[o];if(1===a.nodeType)if((0,L.g7)(a,"coverageId"))t.coverageId=(0,L.mX)(a);else if((0,L.g7)(a,"ServiceParameters"))t.serviceParameters={supportedFormats:(0,L.Dy)(a,"nativeFormat")};else if((0,L.g7)(a,"boundedBy"))t.boundedBy=ee(a);else if((0,L.g7)(a,"rangeType")){const e=te(a,t.boundedBy?.axisLabels.length>2||t.domainSet?.axisLabels.length>2);t.rangeType=e.rangeType,s=e.bandNames,n=e.bandStats;const{bandNoDataValues:o}=e;o?.length&&(i=q(o))}else if((0,L.g7)(a,"domainSet"))t.domainSet=se(a,t.boundedBy?.axisLabels);else if((0,L.g7)(a,"metadata")){const e=(0,L.V6)(a,"EOMetadata");t.eoMetadata=e?oe(e):null}}const{coverageId:o,boundedBy:a,domainSet:r,rangeType:l,serviceParameters:c}=t,u=ie(l,a,r);return!n&&u&&(n=u?.variables[0].statistics),null!=u&&(i=l[0][0].nilValue),{id:o,title:o,description:o,bandNames:s,rasterInfo:new $.A({width:r.columns,height:r.rows,pixelSize:r.resolution,pixelType:"unknown",extent:a.envelope,spatialReference:a.envelope.spatialReference,bandCount:s.length||1,statistics:n,noDataValue:i,multidimensionalInfo:u}),supportedFormats:c.supportedFormats,coverageDescription:t,version:"2.0.1",useEPSGAxis:!1}}(e)))}(t,i)}catch(e){if(!(0,l.zf)(e))throw new a.A("wcslayer:open","wcs coverage description is not valid or supported");throw e}}var le=n(45617),ce=n(4916);function ue(e){const t=function(e){const t=e.getHeader?.("Content-Type")?.split(";");if(!t)return null;if(!(t[0].trim()??"").startsWith("multipart/"))return null;const n={boundary:"",start:"",type:""};for(let e=1;e<t.length;e++){const i=t[e].indexOf("=");if(i>0){const s=t[e].slice(0,i).trim(),o=t[e].slice(i+1).trim();n[s]=o.startsWith('"')?o.slice(1,-1):o}}return n}(e);return t?{isMultipart:!0,data:t.boundary?pe(e.data,t,0):null}:{isMultipart:!1,data:null}}function pe(e,t,n=0){const i="--"+t.boundary,s=[];for(let e=0;e<i.length;e++)s.push(i.charCodeAt(e));const o=[],a="\n--"+t.boundary+"--";for(let e=0;e<a.length;e++)o.push(a.charCodeAt(e));const r=[10],l=[13,10],c=[],u=s.length,p=new Uint8Array(e,n),d=Math.min(5e4,p.length-u);let m=0,f=0;for(let e=0;e<d;e++){for(f=0;f<u&&p[e+f]===s[f];f++);f===u&&(m&&c.push(de(p.subarray(m,e),t)),e+=u-1,p[e+1]===r[0]?e+=1:p[e+1]===l[0]&&p[e+2]===l[1]&&(e+=2),m=e+1)}const g=o.length;for(let e=p.length-g-10;e<p.length-g;e++){for(f=0;f<g&&p[e+f]===o[f];f++);if(f===g){c.push(de(p.subarray(m,e),t));break}}return c}function de(e,t){const n=String.fromCharCode.apply(null,e.subarray(0,Math.min(300,e.length))).split("\n"),i=Math.min(n.length,7),s={contentDisposition:"inline"};let o=0;for(let a=0;a<i;a++)if(n[a].length<4)o=o+n[a].length+1;else if("content"===n[a].slice(0,7).toLowerCase()){o=o+n[a].length+1;const e=n[a].indexOf(":");if(-1===e)continue;const t=n[a].slice(0,e).trim(),i=n[a].slice(e+1).trim();switch(t.toLowerCase()){case"content-type":s.contentType=i;break;case"content-description":s.contentDescription=i;break;case"content-transfer-encoding":s.contentTransferEncoding=i;break;case"content-id":s.contentID=i;break;case"content-disposition":s.contentDisposition=i;break;case"content-location":s.contentLocation=i}}else{if(s.contentDisposition.toLowerCase().includes("inline")&&n[a].length>=4&&s.contentType?.toLowerCase().indexOf("image")>-1){let t=!0,n=e.subarray(o,e.length);if(s.contentType.toLowerCase().indexOf("tif")>0){if("base64"===s.contentTransferEncoding){let e="";const t=n;for(let n=0;n<t.length;n+=65535){const i=t.subarray(n,n+65535>t.length-1?t.length-1:n+65535);e+=String.fromCharCode.apply(null,i)}const i=atob(e);n=new Uint8Array(i.length);for(let e=0;e<n.length;e++)n[e]=i.charCodeAt(e)}t=73===n[0]&&73===n[1]||77===n[0]&&77===n[1]}if(t){let t=n.buffer;"base64"!==s.contentTransferEncoding&&(t=new ArrayBuffer(e.length-o),n=new Uint8Array(t),n.set(e.subarray(o,e.length))),s.contentData=t}break}if((""===t.start||s.contentID===t.start)&&s.contentType){if(s.contentType.includes("text")||s.contentType.includes("xml")){s.contentData=String.fromCharCode.apply(null,e.subarray(o,e.length));break}s.contentData=e.subarray(o,e.length)}}return s}var me=n(51244),fe=n(28435);const ge=["nearest neighbor","bilinear","bicubic"],he=["nearest","linear","cubic"],ve="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",ye=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let be=class extends ce.A{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}async fetchRawTile(e,t,n,i={}){if(this.isBlockOutside(e,t,n))return null;const{nativePixelSize:s,spatialReference:o}=this.rasterInfo,r=2**e,l=s.x*r,c=s.y*r,{blockWidth:u,blockHeight:p}=this.getBlockWidthHeight(e),{origin:d}=this.rasterInfo.storageInfo.tileInfo,m=this.getTileExtent({x:l,y:c},t,n,d,o,[u,p]),f=this.rasterInfo.extent,g=m.xmax>f.xmax,h=m.ymin<f.ymin,v=g||h;let y=m,b=u,w=p;if(v&&(y=m.clone().intersection(f),null!=y&&(g&&(b=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*b),h&&(w=Math.floor((y.ymax-y.ymin)/c),y.ymin=y.ymax-c*w))),null==y||b<=1||w<=1)return null;const x=await this._getCoverage(y,b,w,r,i);if(!x)return null;const{coverageDescription:C}=this.coverageInfo,{noDataValue:I,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:D}=i;let A;if(null!=S&&null!=D&&D.length){const e=D[0].variableName;if("2.0"===C.version){const t=C.rangeType[0].find((t=>t.name===e));A=t?.nilValue}else if("1.1"===C.version){const t=C.range.find((t=>t.identifier===e));A=t?.nullValues}}const T=A??I,L=await this.decodePixelBlock(x,{width:b,height:w,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(T)?T[0]:T});if(null==L)return null;if(L&&(L.width!==b||L.height!==w))throw new a.A("wcsraster-fetch",`the response has unexpected dimension width: ${L.width}, height: {pixelBlock.height}`);return v?(0,fe.$Q)(L,{x:0,y:0},{width:p,height:p}):L}async _open(e){const{customFetchParameters:t}=this.ioConfig,n=e?.signal,i=await async function(e,t){const{version:n,customParameters:i,signal:s}=t??{},o=n?.startsWith("1.0")?"version":"acceptVersions",r={service:"WCS",request:"GetCapabilities",[o]:n,...i};try{const{data:t}=await(0,T.A)(e,{query:r,responseType:"xml",signal:s});return E(t)}catch(e){if(!(0,l.zf)(e))throw new a.A("wcslayer:open","wcs capabilities is not valid or supported");throw e}}(this.url,{version:t?.version??this.version,customParameters:t,signal:n});if(this.capabilities=i,!this.version){let e=i.version.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=i.version:(e=i.supportedVersions.find((e=>"2.0.1"===e))||i.supportedVersions.find((e=>"2.0"===e.slice(0,3)))||i.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||i.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}const{version:s}=this;if(!ye.has(s))throw new a.A("wcsraster-open",`unsupported WCS version ${s}`);const{gridCoverages:o}=i;if(!o.length)throw new a.A("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=o[0].id;const{coverageId:r}=this,c=o.find((e=>e.id===r));if(null==c)throw new a.A("wcsraster-open",`the coverageId ${r} does not exist in capabilities`);const u=await re(this.url,{coverageIds:[r],version:s,customParameters:t,signal:n});if(this.coverageInfo=u[0],"2.0"===s.slice(0,3)){const{coverageInfo:e}=this;e.lonLatEnvelope=c.lonLatEnvelope,e.supportedInterpolations=G(i.supportedInterpolations),this._patchDimensionValues201(r,n)}this.datasetName=this.coverageInfo.title;const{rasterInfo:p}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(p,512,512),this._set("rasterInfo",p),null==p.spatialReference)throw new a.A("wcsraster-open",`coverage without spatial reference is not supported: ${r}`);const{pixelType:d,bandCount:m}=await this._getPixelTypeAndBandCount(n);p.pixelType=d,1===p.bandCount&&m>1&&(p.bandCount=m),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:n}=this,i=n.rasterInfo.multidimensionalInfo?.variables,s=ye.has("1.1.2")?"1.1.2":ye.has("1.1.1")?"1.1.1":ye.has("1.1.0")?"1.1.0":null,{customFetchParameters:o}=this.ioConfig;if(i&&s)try{const n=this.url.includes("/ImageServer/"),a=e.length>8&&e.startsWith("Coverage")&&n?e.slice(8):e,r=await re(this.url,{coverageIds:[a??e],version:s,customParameters:o,signal:t}).catch((()=>{if(a)return re(this.url,{coverageIds:[e],version:s,customParameters:o,signal:t})})),l=r?.[0].rasterInfo.multidimensionalInfo?.variables;if(l)for(const e of i){const t=l.find((({name:t})=>t===e.name));if(t?.dimensions?.length)for(let i=e.dimensions.length-1;i>=0;i--){const s=e.dimensions[i],o=t.dimensions.find((({name:e})=>e===s.name));o?o.values&&o.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[i]={...s,values:o.values}):n&&e.dimensions.splice(i,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:t,extent:n,multidimensionalInfo:i}=this.rasterInfo,s=n.center,o=new D.A({xmin:s.x-t.x,xmax:s.x+t.x,ymin:s.y-t.y,ymax:s.y+t.y,spatialReference:n.spatialReference});let r=[];if(null!=i){const e=i.variables[0];r=[],e.dimensions.forEach((t=>{r.push(new le.A({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))}))}const{coverageDescription:l}=this.coverageInfo,c={interpolation:"nearest",multidimensionalDefinition:r,signal:e},{version:u}=l,{ioConfig:d}=this,m="2.0"===u&&null==d.allowAnyMediaType||"1.1"===u&&null==d.use2GridOffsets;let f;try{f=await this._getCoverage(o,2,2,1,c,!0)}catch(e){if(!m)throw e;if("1.1"===u){if(!e.details?.isResolutionMismatch)throw e;d.use2GridOffsets=!0}}if(!f&&m&&("2.0"===u&&(d.allowAnyMediaType=!0),f=await this._getCoverage(o,2,2,1,c),f&&p.A.getLogger(this).warn("wcsraster:getcoverage",ve)),!f)throw new a.A("wcsraster-open","unable to determine pixel type");const g=await this.decodePixelBlock(f,{width:2,height:2,planes:null,pixelType:null});if(null==g)throw new a.A("wcsraster-open","unable to determine pixel type");return{pixelType:g.pixelType,bandCount:g.getPlaneCount()??0}}async _getCoverage(e,t,n,i,s,o=!1){const{coverageDescription:r}=this.coverageInfo,{version:l}=r,c="2.0"===l?this._getCoverage201Parameters(e,t,n,i,s,r):"1.1"===l?this._getCoverage110Parameters(e,t,n,s,r):this._getCoverage100Parameters(e,t,n,s),u="2.0"===l?await this.request(this._constructWCS201Url(c),{signal:s.signal,responseType:"array-buffer"}):await this.request(this.url,{query:c,signal:s.signal,responseType:"array-buffer"});if("1.0"===l)return u.data;if("2.0"===l&&!1!==this.ioConfig.allowAnyMediaType&&"tiff"===(0,me.g)(u.data))return o&&(this.ioConfig.allowAnyMediaType=!0,p.A.getLogger(this).warn("wcsraster:getcoverage",ve)),u.data;const d=ue(u);if(d.isMultipart&&d.data){const e=d.data.find((e=>e.contentType?.toLowerCase().includes("image")&&null!=e.contentData));return o&&"base64"===e?.contentTransferEncoding&&p.A.getLogger(this).warn("wcsraster:getcoverage","response is base64 encoded which may impact layer display performance"),e?.contentData}const m=new Uint8Array(u.data,0,Math.min(u.data.byteLength,2e3)),f=String.fromCharCode.apply(null,m).toLowerCase().includes("exception"),g=f&&String.fromCharCode.apply(null,m).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(f)throw new a.A("wcsraster:getcoverage","server returns an exception",{isResolutionMismatch:g});throw new a.A("wcsraster:getcoverage","response is not a supported multipart mediaType with inline tiff")}_getInterpolationIndex(e){return e&&this.coverageInfo.supportedInterpolations?.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,n,i){const s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,o=e.spatialReference.wkid,a=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:r,interpolation:l}=i,c=this._getInterpolationIndex(l),u=r?r.map((e=>this.coverageInfo.bandNames[e])):null,p=ge[c],{multidimensionalDefinition:d}=i;let m;if(null!=d&&null!=this.rasterInfo.multidimensionalInfo){const e=d.find((e=>"StdTime"===e.dimensionName));let t=e?.values;t&&t.length>0&&(Array.isArray(t[0])&&(t=t[0]),m=t.map((e=>we(e))).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:a,crs:`EPSG:${o}`,bbox:s,width:t,height:n,time:m,interpolation:p,band:u?.join(",")}}_getCoverage110Parameters(e,t,n,i,s){const{multidimensionalDefinition:o,bandIds:a,interpolation:r}=i,l=e.spatialReference.wkid,c=`urn:ogc:def:crs:EPSG::${l}`,u=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",p=this._getInterpolationIndex(r),d=he[p],m=null==r||0===this.coverageInfo.supportedInterpolations?.indexOf(r),f=s.domain.spatialDomain,g=f.origin.x<=f.envelope.xmin&&f.origin.y<=f.envelope.ymin,h=e.width/t,v=e.height/n*(g?1:-1),y=g?[e.xmin,e.ymin]:[e.xmin,e.ymax],b=f.useEPSGAxis&&(0,A.m)(l),w=b?`${y[1]},${y[0]}`:`${y[0]},${y[1]}`,x=this.ioConfig.use2GridOffsets,C=b?x?`${v},${h}`:`${v},0,0,${h}`:x?`${h},${v}`:`${h},0,0,${v}`,I=h/2,S=e.xmin+I,D=e.xmax-I,T=Math.abs(v)/2,L=e.ymin+T,V=e.ymax-T,M=b?`${L},${S},${V},${D},${c}`:`${S},${L},${D},${V},${c}`,N=s.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let R,P=N&&d&&a?m?`${N.identifier}[${N.axis[0].identifier}[${a.join(",")}]]`:`${N.identifier}:${d}[${N.axis[0].identifier}[${a.join(",")}]]`:null;if(null!=o&&o.length)for(let e=0;e<o.length;e++){let t=o[e].values;const n=o[e].dimensionName?.toLowerCase(),i=o[e].variableName?.toLowerCase(),a=s.range.find((e=>e.identifier.toLowerCase()===i));if(t.length>0)if(Array.isArray(t[0])&&(t=t[0]),"stdtime"===n)R=t.map((e=>we(e))).join(",");else if(a){const e=a.axis.find((e=>e.identifier.toLowerCase()===n));e&&(P=m?a.identifier+"["+e.identifier+"["+t.join(",")+"]]":a.identifier+":"+d+"["+e.identifier+"["+t.join(",")+"]]")}e===o.length-1&&a&&!P&&(P=m?a.identifier:a.identifier+":"+d)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:u,crs:`EPSG:${l}`,boundingbox:M,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:w,gridOffsets:C,gridBaseCRS:c,timeSequence:R,rangeSubset:P}}_getCoverage201Parameters(e,t,n,i,s,o){const{multidimensionalDefinition:a,interpolation:r}=s,l=this._getInterpolationIndex(r);let c=null;const{supportedInterpolations:u}=this.capabilities;if(u?.length)switch(l){case 0:c=u.find((e=>e.toLowerCase().includes("nearest")));break;case 1:c=u.find((e=>e.toLowerCase().includes("linear")));break;case 2:c=u.find((e=>e.toLowerCase().includes("cubic")||e.toLowerCase().includes("quadratic")))}const p=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",{bandNames:d}=this.coverageInfo,{boundedBy:m,domainSet:f,rangeType:g}=o,h=m.isEastFirst?0:1,v=1-h,{axisLabels:y}=m,b=y[h],w=y[v],x=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=x,I=[];I.push(`${b}(${e.xmin},${e.xmax})`),I.push(`${w}(${e.ymin},${e.ymax})`);const S=[];if(y.length>2)for(let e=2;e<y.length;e++){const t=f.origin[e];if(y[e].toLowerCase().includes("time")){let n=t.toString();m.uomLabels?.[e].toLowerCase().includes("ole")&&(S.push(y[e]),n=we(t,!0)),I.push(y[e]+",http://www.opengis.net("+n+")")}else I.push(y[e]+",http://www.opengis.net("+t+")")}let D=null;if(null!=a&&a.length){const e=[];g.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let n=0;n<a.length;n++){const i=y.find((e=>e===a[n].dimensionName)),s=e.find((e=>e===a[n].variableName));if(t.includes(s)||t.push(s),i){let e=a[n].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=i.toLowerCase().includes("time")?e.map((e=>we(e))).join(","):e.join(",");const n=I.findIndex((e=>0===e.indexOf(i+",http://www.opengis.net")));-1===n&&I.push(i+",http://www.opengis.net("+t+")"),-1===n||I[n].includes("("+t+")")||I.splice(n,1,i+",http://www.opengis.net("+t+")")}}}t.length&&(D=t.join(","))}else d?.length>=2&&(D=(s.bandIds?s.bandIds.map((e=>d[e])):d).join(","));const A=I.join("&subset="),T=!o.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,L=T?null:`${b}(${t}),${w}(${n})`,V=T?1/i:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:D,interpolation:c,scaleSize:L,scaleFactor:V,subset:A,format:p,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:x,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},n=[];return Object.keys(t).forEach((e=>{const i=t[e];null!=i&&("subset"===e?"string"==typeof i&&i.split("&subset=").forEach((e=>{e&&n.push(`subset=${encodeURIComponent(e)}`)})):n.push(`${e}=${encodeURIComponent(i)}`))})),`${encodeURI(this.url)}?${n.join("&")}`}};function we(e,t=!1){return(t?new Date(ae(e)):new Date(e)).toISOString()}(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],be.prototype,"tileType",void 0),(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"version",void 0),(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"coverageId",void 0),be=(0,i._)([(0,d.$)("esri.layers.support.rasterDatasets.WCSRaster")],be);const xe=be;var Ce=n(30291),Ie=n(92935);const Se=new Set(["milliseconds","seconds","minutes","hours","days","weeks","months","years","decades","centuries"]);let De=class extends((0,f.dM)((0,w.j)((0,v.q)((0,y.A)((0,g.d)((0,h.o)((0,x.e)((0,b.J)((0,r.P)(o.A.ClonableMixin(m.A))))))))))){constructor(...e){super(...e),this.coverageId=null,this.version=null,this.isReference=null,this.legendEnabled=!0,this.noData=0,this.operationalLayerType="WCS",this.type="wcs",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=(0,l.sg)((async(e,t,i)=>{const{save:s,saveAs:o}=await n.e(9838).then(n.bind(n,59838));switch(e){case Ie.X.SAVE:return s(this,t);case Ie.X.SAVE_AS:return o(this,i,t)}}))}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:["WCS"]},e).catch(l.QP).then((()=>this._openRaster(t)))),Promise.resolve(this)}get coverageInfo(){return this.raster.coverageInfo}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){return[(0,S.rZ)("Pixel Value")]}createPopupTemplate(e){return(0,Ce.tn)({fields:this.rasterFields,title:this.title},e)}async save(e){return this._debouncedSaveOperations(Ie.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Ie.X.SAVE_AS,t,e)}async _openRaster(e){const t=new xe({url:this.url,version:this.version,coverageId:this.coverageId,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters}});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new a.A("wcs-layer:load","cannot load resources on "+this.url);const{rasterInfo:n}=t;null==n.noDataValue&&(n.noDataValue=this.noData),this._set("serviceRasterInfo",n),this._set("spatialReference",n.spatialReference),null==this.title&&this.setAtOrigin("title",t.datasetName,"service"),null==this.coverageId&&this.setAtOrigin("coverageId",t.coverageInfo.id,"service"),null==this.version&&t.version&&this.setAtOrigin("version",t.version,"service"),this.setAtOrigin("tileInfo",t.rasterInfo.storageInfo.tileInfo,"service");const{multidimensionalInfo:i}=n;if(null!=i){const e=i.variables[0].dimensions.find((({name:e})=>"StdTime"===e));if(e){let t=e.extent?.[0]??e.values[0];Array.isArray(t)&&(t=t[0]);let n=e.extent?.[1]??e.values[e.values.length-1];Array.isArray(n)&&(n=n[1]);const i=Se.has(e.intervalUnit?.toLowerCase())?e.intervalUnit?.toLowerCase():null;this.set("timeInfo",{startField:"StdTime",fullTimeExtent:{start:t,end:n},timeZone:null,interval:i?{value:e.interval,unit:i}:null})}}this.raster=t,this._configDefaultSettings(),this.addHandles((0,c.wB)((()=>this.customParameters),(e=>this.raster.ioConfig.customFetchParameters=e)))}};(0,i._)([(0,u.MZ)({type:String,nonNullable:!0,json:{name:"wcsInfo.coverageId",write:{isRequired:!0}}})],De.prototype,"coverageId",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"coverageInfo",null),(0,i._)([(0,u.MZ)({type:["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"],nonNullable:!0,json:{name:"wcsInfo.version",write:{isRequired:!0}}})],De.prototype,"version",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],De.prototype,"isReference",void 0),(0,i._)([(0,u.MZ)({json:{read:!0,write:!0}})],De.prototype,"blendMode",void 0),(0,i._)([(0,u.MZ)(C.fV)],De.prototype,"legendEnabled",void 0),(0,i._)([(0,u.MZ)({type:["show","hide"]})],De.prototype,"listMode",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"noData",void 0),(0,i._)([(0,u.MZ)({type:["WCS"]})],De.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"raster",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],De.prototype,"type",void 0),(0,i._)([(0,u.MZ)(C.M6)],De.prototype,"popupEnabled",void 0),(0,i._)([(0,u.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],De.prototype,"popupTemplate",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],De.prototype,"defaultPopupTemplate",null),(0,i._)([(0,u.MZ)({readOnly:!0,type:[I.A]})],De.prototype,"fields",void 0),(0,i._)([(0,u.MZ)({readOnly:!0,type:[I.A]})],De.prototype,"rasterFields",null),De=(0,i._)([(0,d.$)("esri.layers.WCSLayer")],De);const Ae=De},38458:(e,t,n)=>{n.d(t,{m:()=>s});const i=[[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&&i.some((([t,n])=>e>=t&&e<=n))}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9547],{19547:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ae});var i=n(90237),s=n(13874),o=n(69540),a=n(49186),r=n(92071),l=n(74887),c=n(36708),u=n(10107),p=(n(44208),n(53966)),d=(n(87811),n(40608)),m=n(4146),f=n(63074),g=n(69208),h=n(89015),v=n(16131),y=n(8303),b=n(54310),w=n(25036),x=n(82935),C=n(10873),I=n(20437),S=n(74797),D=n(5443),A=n(38458),T=n(78888),L=n(50103);function V(e){return e.endsWith("?")?e.slice(0,-1):e}function M(e){return e.filter((({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e)))}function N(e){const t={};for(let n=0;n<e.childNodes.length;n++){const i=e.childNodes[n];if(1!==i.nodeType)continue;const s=(0,L.vv)(i).toLowerCase();switch(s){case"title":case"abstract":t[s]=(0,L.mX)(i);break;case"identifier":t.id=(0,L.mX)(i);break;case"wgs84boundingbox":{const e=(0,L.pN)(i,"LowerCorner"),n=(0,L.pN)(i,"UpperCorner");t.lonLatEnvelope=new D.A({xmin:e[0],ymin:e[1],xmax:n[0],ymax:n[1],spatialReference:{wkid:4326}})}break;case"coveragesummary":t.coverageSummaries=t.coverageSummaries||[],t.coverageSummaries.push(N(i))}}return t}function R(e,t){if(e.coverageSummaries)for(let n=0;n<e.coverageSummaries.length;n++)e.coverageSummaries[n].abstract=e.coverageSummaries[n].abstract||e.abstract,e.coverageSummaries[n].lonLatEnvelope=e.coverageSummaries[n].lonLatEnvelope||e.lonLatEnvelope,e.coverageSummaries[n].title=e.coverageSummaries[n].title||e.title,R(e.coverageSummaries[n],t);null!=e.id&&t.push(e)}function P(e){const t=(0,L.V6)(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",n=(0,L.V6)(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=(0,L.V6)(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:V(t),describeCoverage:V(n),getCoverage:V(i)}}function E(e,t=null){let n=null;n="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e;let i=n.documentElement.getAttribute("version");"1.0"===i?i="1.0.0":"1.1"===i&&(i="1.1.0");const s=i||t||"1.0.0",o=s.slice(0,3);let r;if("2.0"===o)r=function(e){const t=(0,L.V6)(e,"ServiceIdentification"),n=(0,L.mX)(t,"Title"),i=(0,L.Dy)(t,"ServiceTypeVersion"),s=(0,L.Dy)(t,"Profile"),o=P((0,L.V6)(e,"OperationsMetadata")),a=(0,L.IC)(e,"Contents/CoverageSummary"),r=[];for(let e=0;e<a.length;e++){const t=a[e],n=(0,L.mX)(t,"CoverageId"),i=(0,L.V6)(t,"WGS84BoundingBox");let s;if(i){const e=(0,L.pN)(i,"LowerCorner"),t=(0,L.pN)(i,"UpperCorner");s=new D.A({xmin:e[0],ymin:e[1],xmax:t[0],ymax:t[1],spatialReference:{wkid:4326}})}const o=(0,L.mX)(t,"CoverageSubtype")||"RectifiedGridCoverage";r.push({id:n,lonLatEnvelope:s,coverageSubType:o})}const l=(0,L.V6)(e,"ServiceMetadata");return{name:n,supportedVersions:i,supportedFormats:(0,L.Dy)(l,"formatSupported"),supportedInterpolations:(0,L.Dy)(l,"interpolationSupported").concat((0,L.Dy)(l,"InterpolationSupported")),onlineResources:o,profiles:s,coverages:r,gridCoverages:M(r),version:"2.0.1"}}(n);else if("1.1"===o)r=function(e){const t=(0,L.mX)(e,"ServiceIdentification/Title"),n=(0,L.Dy)(e,"ServiceIdentification/ServiceTypeVersion"),i=P((0,L.V6)(e,"OperationsMetadata")),s=[],o=(0,L.V6)(e,"Contents");for(let e=0;e<o.childNodes.length;e++){const t=o.childNodes[e];1===t.nodeType&&(0,L.g7)(t,"CoverageSummary")&&R(N(t),s)}const a=(0,L.Dy)(o,"SupportedFormat");return{name:t,onlineResources:i,coverages:s,gridCoverages:M(s),supportedVersions:n,supportedFormats:a,version:"1.1.0"}}(n);else{if("1.0"!==o)throw new a.A("wcsraster:parsecapabilities","the capabilities version is not supported");r=function(e){const t=(0,L.mX)(e,"Service/name"),n=(0,L.V6)(e,"Capability"),i=(0,L.V6)(n,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",s=(0,L.V6)(n,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",o=(0,L.V6)(n,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",a={getCapabilities:V(i),describeCoverage:V(s),getCoverage:V(o)},r=(0,L.IC)(e,"CoverageOfferingBrief"),l=[];for(let e=0;e<r.length;e++){const t=r[e],n=(0,L.mX)(t,"name"),i=(0,L.IC)(t,"pos"),s=(0,L.pN)(i[0]),o=(0,L.pN)(i[1]),a=new D.A({xmin:s[0],ymin:s[1],xmax:o[0],ymax:o[1],spatialReference:{wkid:4326}});l.push({id:n,lonLatEnvelope:a})}return{name:t,onlineResources:a,coverages:l,gridCoverages:M(l),supportedVersions:["1.0.0"],version:"1.0.0"}}(n)}return r.version=s,r}var X=n(39829),$=n(87186),O=n(77301);function _(e){e.variables.forEach((e=>e.dimensions.forEach((e=>e.values??=(0,O.Xg)(e)))))}function k(e){return{requestResponseCRSs:(0,L.Dy)(e,"requestResponseCRSs").map((e=>e.split(":")[1])),nativeCRSs:(0,L.Dy)(e,"nativeCRSs").map((e=>e.split(":")[1]))}}function F(e,t){const n=(0,L.Dy)(e,"1.0.0"===t?"interpolationMethod":"InterpolationMethod"),i="1.0.0"===t?e.getAttribute("default"):(0,L.mX)(e,"InterpolationMethods/Default");return null!=i?[i].concat(n.filter((e=>e.toLowerCase()!==i.toLowerCase()))):n}function G(e){return null==e?["nearest"]:e.map((e=>{const t=e.toLowerCase();return t.includes("nearest")?"nearest":t.includes("linear")?"bilinear":t.includes("cubic")?"cubic":null})).filter((e=>!!e))}function B(e){const t=(0,L.IC)(e,"pos"),n=(0,L.pN)(t[0]),i=(0,L.pN)(t[1]);return new D.A({xmin:n[0],ymin:n[1],xmax:i[0],ymax:i[1],spatialReference:{wkid:4326}})}function j(e,t){const n=(0,L.Dy)(e,t);return n?.length&&""!==n[0]&&!isNaN(Number(n[0]))?n.map((e=>Number(e))):null}function W(e){const t=(0,L.pN)(e,"MinimumValue"),n=(0,L.pN)(e,"MaximumValue");return t.length&&n.length?t.map(((e,t)=>({min:e,max:n[t],avg:-1,stddev:-1}))):null}function q(e){return null==e?null:e.every((t=>t===e[0]))?e[0]:e}function Z(e){const t=[],n=(0,L.IC)(e,"RangeSet");let i=[];for(let e=0;e<n.length;e++){const s=(0,L.mX)(n[e],"name"),o=(0,L.mX)(n[e],"label"),a=[],r=j(n[e],"nullValues/singleValue"),l=(0,L.IC)(n[e],"AxisDescription");for(let e=0;e<l.length;e++){const t=(0,L.mX)(l[e],"name"),n=(0,L.mX)(l[e],"label"),s=(0,L.Dy)(l[e],"singleValue");if(0===s.length){const t=(0,L.mX)(l[e],"min"),n=(0,L.mX)(l[e],"max"),i=Number((0,L.mX)(l[e],"res"))||1;if(null!==t&&null!==n)for(let e=parseInt(t,10);e<=parseInt(n,10);e+=i)s.push(e.toString())}"band"===t.toLowerCase()&&(i=s),a.push({name:t,label:n,values:s})}t.push({name:s,label:o,nullValues:r,axis:a})}return{rangeSet:t,bandNames:i}}function U(e=null){if(!e)return{resolution:null,units:null};let t=e.toUpperCase();const n=["Years","Months","Days","Hours","Minutes","Seconds"];let i,s,o;return t.includes("PT")?(t=t.slice(2),o=["H","M","S"].findIndex((e=>t.includes(e))),i=n[3+o],s=parseFloat(t.slice(0,-1))):(t=t.slice(1),o=["Y","M","D"].findIndex((e=>t.includes(e))),o>-1&&(i=n[o]),s=parseFloat(t.slice(0,-1))),{resolution:s,units:i}}function z(e){const t=(0,L.IC)(e,"timeposition");if(t.length>0){const e=[];for(let n=0;n<t.length;n++)e.push(new Date((0,L.mX)(t[n])));return{begin:e[0],end:e[e.length-1],values:e}}const n=(0,L.V6)(e,"timePeriod")||(0,L.V6)(e,"TimePeriod");return n?{begin:new Date((0,L.mX)(n,"beginPosition")||(0,L.mX)(n,"BeginPosition")),end:new Date((0,L.mX)(n,"endPosition")||(0,L.mX)(n,"EndPosition")),...U((0,L.mX)(n,"timeResolution")||(0,L.mX)(n,"TimeResolution"))}:null}function H(e){const t=(0,L.V6)(e,"spatialDomain"),n=(0,L.V6)(t,"Envelope")||(0,L.V6)(t,"EnvelopeWithTimePeriod"),i=n.getAttribute("srsName").split(":"),s=i[i.length-1],o=(0,L.IC)(n,"pos"),a=(0,L.pN)(o[0]),r=(0,L.pN)(o[1]),l=parseInt(s,10),c=isNaN(l)?null:{wkid:l},u=new D.A({xmin:a[0],ymin:a[1],xmax:r[0],ymax:r[1],spatialReference:c}),p=(0,L.V6)(t,"RectifiedGrid"),d=(0,L.mX)(p,"low").split(" "),m=(0,L.mX)(p,"high").split(" "),f=parseInt(m[0],10)-parseInt(d[0],10)+1,g=parseInt(m[1],10)-parseInt(d[1],10)+1,h=(0,L.pN)(t,"origin/pos"),v=(0,L.IC)(t,"offsetVector"),y={envelope:u,columns:f,rows:g,offset:{x:parseFloat((0,L.mX)(v[0]).split(" ")[0]),y:parseFloat((0,L.mX)(v[1]).split(" ")[1])},origin:{x:h[0],y:h[1]}},b=(0,L.V6)(e,"temporalDomain")||(0,L.V6)(e,"TemporalDomain");return{spatialDomain:y,temporalDomain:b?z(b):null}}function Y(e){if(!e.temporalDomain)return null;const{begin:t,end:n,values:i,units:s,resolution:o}=e.temporalDomain,a={variables:[{name:"default",description:"",dimensions:[{name:"StdTime",description:"",unit:"ISO8601",values:i?.map((e=>e.getTime())),hasRegularIntervals:!i,interval:o,intervalUnit:s,extent:[t.getTime(),n.getTime()]}]}]};return _(a),a}function Q(e,t){const n=[],i=(0,L.IC)(e,"Field");let s,o=[];for(let e=0;e<i.length;e++){const a=(0,L.mX)(i[e],"Identifier"),r=(0,L.mX)(i[e],"Description"),l=(0,L.mX)(i[e],"Definition"),c=(0,L.mX)(i[e],"Abstract"),u=(0,L.mX)(i[e],"Title"),p=j(i[e],"NullValue"),d=(0,L.V6)(i[e],"AllowedValues"),m=d?W(d):null,f=F(i[e],"1.1.0"),g=[],h=(0,L.IC)(i[e],"Axis");for(let e=0;e<h.length;e++){const n=h[e].getAttribute("identifier"),i=(0,L.mX)(h[e],"UOM"),a=(0,L.mX)(h[e],"DataType"),r=(0,L.Dy)(h[e],"Key");t&&!n.toLowerCase().includes("band")||(o=r,s=p),g.push({identifier:n,uom:i,dataType:a,values:r,bandNoDataValues:s})}n.push({identifier:a,description:r,definition:l,abstract:c,title:u,supportedInterpolations:f,axis:g,nullValues:p,statistics:m})}return{rangeSet:n,bandNames:o,bandNoDataValues:s,statistics:n[0].statistics}}function J(e,t){if(!t.temporalDomain)return null;const n=e.filter((e=>!e.identifier.toLowerCase().includes("field_1")&&!e.axis.some((e=>e.identifier.includes("band"))))),i=[];if(n.length&&n.forEach((e=>{const t=e.axis.map((e=>{const t=e.values.map((t=>"ISO8601"===e.uom?(t=t.trim()).toLowerCase().includes("z")?new Date(t).getTime():new Date(t+"Z").getTime():parseFloat(t.trim()))),n=[Math.min.apply(null,t),Math.max.apply(null,t)];return{name:e.identifier.trim(),description:"",field:e.identifier.trim(),unit:e.uom?e.uom.trim():"",hasRegularIntervals:!1,values:t,extent:n}}));i.push({name:e.identifier.trim(),description:e.description?.trim()??"",unit:"",dimensions:t,statistics:e.statistics})})),t.temporalDomain){const{begin:e,end:n,values:s,units:o,resolution:a}=t.temporalDomain;i.some((e=>e.dimensions.some((e=>"stdtime"===e.name.toLowerCase()))))||i.forEach((t=>{t.dimensions.push({name:"StdTime",description:"",unit:"ISO8601",values:s?.map((e=>e.getTime())),hasRegularIntervals:!s,interval:a,intervalUnit:o,extent:[e.getTime(),n.getTime()]})}))}if(i.length){const e={variables:i};return _(e),e}return null}function K(e){const t=(0,L.V6)(e,"SpatialDomain"),n=(0,L.V6)(t,"GridCRS"),i=(0,L.mX)(n,"GridBaseCRS"),s=(0,L.mX)(n,"GridOrigin"),o=s?.split(" ").map((e=>parseFloat(e)))??[0,0],a=(0,L.pN)(n,"GridOffsets"),r=(0,L.IC)(t,"BoundingBox");let l,c,u,p;for(let e=0;e<r.length;e++){const t=r[e].getAttribute("crs")?.toLowerCase();if(null!=t)if(t.includes("imagecrs")){const t=(0,L.pN)(r[e],"LowerCorner"),n=(0,L.pN)(r[e],"UpperCorner");l=n[0]-t[0]+1,c=n[1]-t[1]+1}else if(t.indexOf("epsg")>0){const n=t.split(":");u=parseInt(n[n.length-1],10);const i=(0,L.pN)(r[e],"LowerCorner"),s=(0,L.pN)(r[e],"UpperCorner");p=new D.A({xmin:i[0],ymin:i[1],xmax:s[0],ymax:s[1],spatialReference:{wkid:u}})}}const d=l>c,m=p.xmax-p.xmin>p.ymax-p.ymin;let f=!1;(0,A.m)(u)&&(d===m?f=!1:(f=!0,p=new D.A({xmin:p.ymin,ymin:p.xmin,xmax:p.ymax,ymax:p.xmax,spatialReference:{wkid:u}})));const g={columns:l,rows:c,origin:{x:o[0],y:o[1]},offset:{x:a[0],y:a[a.length-1]},gridBaseCRS:i,envelope:p,useEPSGAxis:f},h=(0,L.V6)(e,"temporalDomain")||(0,L.V6)(e,"TemporalDomain");return{spatialDomain:g,temporalDomain:h?z(h):null}}function ee(e){const t=(0,L.V6)(e,"Envelope")||(0,L.V6)(e,"EnvelopeWithTimePeriod"),n=t.getAttribute("srsName"),i=n.slice(n.lastIndexOf("/")+1),s=t.getAttribute("axisLabels").split(" ").map((e=>e.trim())).filter((e=>""!==e.trim())),o=(0,L.pN)(t,"lowerCorner"),a=(0,L.pN)(t,"upperCorner"),r=!["y","lat","latitude","north","nor","n","b"].includes(s[0].toLowerCase());let l;const c=parseInt(i,10),u=isNaN(c)?null:{wkid:c};l=new D.A(r?{xmin:o[0],ymin:o[1],xmax:a[0],ymax:a[1],spatialReference:u}:{xmin:o[1],ymin:o[0],xmax:a[1],ymax:a[0],spatialReference:u});const p={mins:o,maxs:a},d=t.getAttribute("uomLabels").trim().split(" ");let m,f;if((0,L.g7)(t,"EnvelopeWithTimePeriod")){m=new Date((0,L.mX)(e,"beginPosition")||(0,L.mX)(e,"BeginPosition")),f=new Date((0,L.mX)(e,"endPosition")||(0,L.mX)(e,"EndPosition"));const t=d?.findIndex((e=>"oledatetime"===e?.toLowerCase()));t>-1&&(d[t]="ISO8601")}return{envelope:l,axisLabels:s,uomLabels:d.length?d:null,envelopeAllDims:p,beginPosition:m,endPosition:f,isEastFirst:r}}function te(e,t){const n=[],i=(0,L.IC)(e,"DataRecord"),s=[];let o,a=[];for(let e=0;e<i.length;e++){const r=(0,L.IC)(i[e],"field"),l=[];for(let e=0;e<r.length;e++){const n=r[e].getAttribute("name"),i=(0,L.mX)(r[e],"description")||"",c=(0,L.V6)(r[e],"uom")?.getAttribute("code")||"",u=(0,L.pN)(r[e],"interval"),p=j(r[e],"nilValue")?.[0];t&&!n.toLowerCase().includes("band")||(s.push(n),u?.length&&(o=o||[],o.push({min:u[0],max:u[1],avg:-1,stddev:-1})),a.push(p)),l.push({name:n,description:i,uom:c,allowedValues:u,nilValue:p})}n.push(l)}return a.some((e=>null!=e))||(a=null),{rangeType:n,bandNames:s,bandStats:o,bandNoDataValues:a}}function ne(e){let t=1,n="";const i=.01;return Math.abs(e-1/24)<1/24*i?n="Hours":Math.abs(e-1)<1*i?n="Days":e<1?(t=Math.round(24*e),n="Hours"):e>28-i&&e<31+i||Math.round(e/30)<12?n="Months":e>365-i&&e<366+i&&(n="Years"),{interval:t,intervalUnit:n}}function ie(e,t,n){if(n.axisLabels.length<=2)return null;const i=[];for(let t=0;t<e.length;t++){const n=e[t];for(let e=0;e<n.length;e++)n[e].name.toLowerCase().includes("band")||i.push(n[e])}const s=[];if(i.length){const e=[];for(let i=2;i<n.axisLabels.length;i++){const s=t.uomLabels?.[i]?.trim()??"",o=n.axisLabels[i].toLowerCase().includes("time")||"iso8601"===s.toLowerCase()||"oledatetime"===s.toLowerCase();let a,r;if(o){const e=ne(n.offset[i]);a=e.interval,r=e.intervalUnit}else a=n.offset[i],r=s;const l=[];o?(l.push(ae(t.envelopeAllDims.mins[i])),l.push(ae(t.envelopeAllDims.maxs[i]))):(l.push(t.envelopeAllDims.mins[i]),l.push(t.envelopeAllDims.maxs[i])),e.push({name:n.axisLabels[i].trim(),description:n.axisLabels[i].trim(),unit:o?"ISO8601":s,hasRegularIntervals:!0,extent:l,interval:a,intervalUnit:r})}if(i.forEach((t=>{const{allowedValues:n}=t,i=2===n?.length?[{min:n[0],max:n[1],avg:-1,stddev:-1}]:null;s.push({name:t.name.trim(),description:t.description?.trim()??"",unit:t.uom.trim(),statistics:i,dimensions:[...e]})})),s.length){const e={variables:s};return _(e),e}}return null}function se(e,t){const n=(0,L.V6)(e,"RectifiedGrid"),i=(0,L.pN)(n,"low"),s=(0,L.pN)(n,"high"),o=[];for(let e=0;e<i.length;e++)o.push(s[e]-i[e]+1);const a=(0,L.mX)(n,"axisLabels").split(" "),r=(0,L.pN)(n,"origin/pos"),l=(0,L.IC)(n,"offsetVector"),c=[];for(let e=0;e<l.length;e++){const t=(0,L.pN)(l[e]),n=t.findIndex((e=>0!==e));c[n]=t[n]}let u,p,d,m=!1;return t?.length&&a?.length&&(m=[...t].sort(((e,t)=>e<t?-1:1)).join(",")===[...a].sort(((e,t)=>e<t?-1:1)).join(",")),["y","lat","latitude","north","nor","n","b"].includes((m?a:t)[0].toLowerCase())?(u=o[1],p=o[0],d={y:Math.abs(c[0]),x:Math.abs(c[1])}):(u=o[0],p=o[1],d={x:Math.abs(c[0]),y:Math.abs(c[1])}),{columns:u,rows:p,origin:r,offset:c,resolution:d,gridSamples:o,axisLabels:a,hasSameAxisLabelsAsBoundedBy:m}}function oe(e){const t=(0,L.V6)(e,"EarthObservation");if(!t)return null;const n=(0,L.V6)(t,"phenomenonTime"),i=n?z(n):null,s=(0,L.V6)(t,"phenomenonTime"),o=s?z(s):null,a=(0,L.mX)(t,"featureOfInterest/Footprint/multiExtentOf/MultiSurface/surfaceMembers/Polygon/exterior/LinearRing/posList");let r=null;if(a){const e=a.split(" ").map((e=>e.trim())).filter((e=>null!=e&&""!==e)).map(Number);if(e.length){const t=[];for(let n=0;n<e.length/2;n+=2)t.push(e[n],e[n+1]);r=new X.A({rings:[[t]]})}}return{observation:{phenomenonTime:i,resultTime:o,footprint:r,identifier:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/identifier"),acquisitionType:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/acquisitionType"),status:(0,L.mX)(e,"metaDataProperty/EarthObservationMetaData/status")}}}function ae(e){return Math.round(24*(e-25569)*3600*1e3)}async function re(e,t){const{coverageIds:n,version:i,customParameters:s,signal:o}=t,r=i.slice(0,3),c="1.0"===r?"coverage":"1.1"===r?"identifiers":"coverageId",u={service:"WCS",request:"DescribeCoverage",version:i,[c]:n.join(","),...s};try{const{data:t}=await(0,T.A)(e,{query:u,responseType:"xml",signal:o});return function(e,t){let n=null;if(n="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e,"1.0.0"===t)return(0,L.IC)(n,"CoverageOffering").map((e=>function(e){const t={version:"1.0"};let n,i=[];for(let s=0;s<e.childNodes.length;s++){const o=e.childNodes[s];if(1===o.nodeType)if((0,L.g7)(o,"description"))t.description=(0,L.mX)(o);else if((0,L.g7)(o,"name"))t.name=(0,L.mX)(o);else if((0,L.g7)(o,"label"))t.label=(0,L.mX)(o);else if((0,L.g7)(o,"supportedFormats"))t.supportedFormats=(0,L.Dy)(o,"formats");else if((0,L.g7)(o,"supportedCRSs"))t.supportedCRSs=k(o);else if((0,L.g7)(o,"supportedInterpolations"))t.supportedInterpolations=F(o,"1.0.0");else if((0,L.g7)(o,"lonLatEnvelope"))t.lonLatEnvelope=B(o);else if((0,L.g7)(o,"rangeSet")){const e=Z(o);t.rangeSet=e.rangeSet,i=e.bandNames;const s=e.rangeSet[0].nullValues;s?.length&&(n=q(s))}else(0,L.g7)(o,"domainSet")&&(t.domainSet=H(o))}const s=G(t.supportedInterpolations),{name:o,description:a,label:r,lonLatEnvelope:l,supportedFormats:c}=t,{spatialDomain:u}=t.domainSet,p={x:Math.abs(u.offset.x),y:Math.abs(u.offset.y)},d=Y(t.domainSet),m=new $.A({width:u.columns,height:u.rows,pixelSize:p,pixelType:"unknown",extent:u.envelope,spatialReference:u.envelope.spatialReference,bandCount:i.length||1,noDataValue:n,multidimensionalInfo:d});return{id:o,title:t.name,description:a||r,lonLatEnvelope:l,rasterInfo:m,bandNames:i,supportedFormats:c,supportedInterpolations:s,coverageDescription:t,version:"1.0.0",useEPSGAxis:!1}}(e)));const i=(0,L.IC)(n,"CoverageDescription");return"1.1.0"===t||"1.1.1"===t||"1.1.2"===t?i.map((e=>function(e,t){const n=[],i=[],s={supportedFormats:n,supportedCRSs:i,version:"1.1"};let o,a,r=[];for(let t=0;t<e.childNodes.length;t++){const l=e.childNodes[t];if(1!==l.nodeType)continue;const c=(0,L.vv)(l).toLowerCase();switch(c){case"title":case"abstract":case"identifier":s[c]=(0,L.mX)(l);break;case"supportedformat":{const e=(0,L.mX)(l);n.includes(e)||n.push(e)}break;case"supportedcrs":{const e=(0,L.mX)(l);i.includes(e)||i.push(e)}break;case"range":{const e=Q(l,!!s.domain?.temporalDomain);s.range=e.rangeSet,r=e.bandNames;const{bandNoDataValues:t}=e;t?.length&&(o=q(t)),a=e.statistics}break;case"domain":s.domain=K(l)}}const l=G(s.range[0].supportedInterpolations),{identifier:c,abstract:u,title:p,domain:d,range:m}=s,f={x:Math.abs(d.spatialDomain.offset.x),y:Math.abs(d.spatialDomain.offset.y)},g=J(m,d);g&&(o=m[0].nullValues,1===o?.length&&(o=o[0]));const h=new $.A({width:d.spatialDomain.columns,height:d.spatialDomain.rows,pixelSize:f,pixelType:"unknown",extent:d.spatialDomain.envelope,spatialReference:d.spatialDomain.envelope.spatialReference,bandCount:r.length||1,noDataValue:o,statistics:a,multidimensionalInfo:g});return{id:c,title:s.title,description:u||p,bandNames:r,rasterInfo:h,supportedFormats:n,supportedInterpolations:l,coverageDescription:s,version:t,useEPSGAxis:d.spatialDomain.useEPSGAxis}}(e,t))):i.map((e=>function(e){const t={version:"2.0"};let n,i,s=[];for(let o=0;o<e.childNodes.length;o++){const a=e.childNodes[o];if(1===a.nodeType)if((0,L.g7)(a,"coverageId"))t.coverageId=(0,L.mX)(a);else if((0,L.g7)(a,"ServiceParameters"))t.serviceParameters={supportedFormats:(0,L.Dy)(a,"nativeFormat")};else if((0,L.g7)(a,"boundedBy"))t.boundedBy=ee(a);else if((0,L.g7)(a,"rangeType")){const e=te(a,t.boundedBy?.axisLabels.length>2||t.domainSet?.axisLabels.length>2);t.rangeType=e.rangeType,s=e.bandNames,n=e.bandStats;const{bandNoDataValues:o}=e;o?.length&&(i=q(o))}else if((0,L.g7)(a,"domainSet"))t.domainSet=se(a,t.boundedBy?.axisLabels);else if((0,L.g7)(a,"metadata")){const e=(0,L.V6)(a,"EOMetadata");t.eoMetadata=e?oe(e):null}}const{coverageId:o,boundedBy:a,domainSet:r,rangeType:l,serviceParameters:c}=t,u=ie(l,a,r);return!n&&u&&(n=u?.variables[0].statistics),null!=u&&(i=l[0][0].nilValue),{id:o,title:o,description:o,bandNames:s,rasterInfo:new $.A({width:r.columns,height:r.rows,pixelSize:r.resolution,pixelType:"unknown",extent:a.envelope,spatialReference:a.envelope.spatialReference,bandCount:s.length||1,statistics:n,noDataValue:i,multidimensionalInfo:u}),supportedFormats:c.supportedFormats,coverageDescription:t,version:"2.0.1",useEPSGAxis:!1}}(e)))}(t,i)}catch(e){if(!(0,l.zf)(e))throw new a.A("wcslayer:open","wcs coverage description is not valid or supported");throw e}}var le=n(45617),ce=n(4916);function ue(e){const t=function(e){const t=e.getHeader?.("Content-Type")?.split(";");if(!t)return null;if(!(t[0].trim()??"").startsWith("multipart/"))return null;const n={boundary:"",start:"",type:""};for(let e=1;e<t.length;e++){const i=t[e].indexOf("=");if(i>0){const s=t[e].slice(0,i).trim(),o=t[e].slice(i+1).trim();n[s]=o.startsWith('"')?o.slice(1,-1):o}}return n}(e);return t?{isMultipart:!0,data:t.boundary?pe(e.data,t,0):null}:{isMultipart:!1,data:null}}function pe(e,t,n=0){const i="--"+t.boundary,s=[];for(let e=0;e<i.length;e++)s.push(i.charCodeAt(e));const o=[],a="\n--"+t.boundary+"--";for(let e=0;e<a.length;e++)o.push(a.charCodeAt(e));const r=[10],l=[13,10],c=[],u=s.length,p=new Uint8Array(e,n),d=p.length-u;let m=0,f=0;for(let e=0;e<d;e++){for(f=0;f<u&&p[e+f]===s[f];f++);if(f!==u)continue;let n=!1;if(m){const i=de(p.subarray(m,e),t);c.push(i),n=!!i.isValidImage}if(e+=u-1,p[e+1]===r[0]?e+=1:p[e+1]===l[0]&&p[e+2]===l[1]&&(e+=2),m=e+1,n)break}const g=o.length;for(let e=p.length-g-10;e<p.length-g;e++){for(f=0;f<g&&p[e+f]===o[f];f++);if(f===g){c.push(de(p.subarray(m,e),t));break}}return c}function de(e,t){const n=String.fromCharCode.apply(null,e.subarray(0,Math.min(300,e.length))).split("\n"),i=Math.min(n.length,7),s={contentDisposition:"inline"};let o=0;for(let a=0;a<i;a++)if(n[a].length<4)o=o+n[a].length+1;else if("content"===n[a].slice(0,7).toLowerCase()){o=o+n[a].length+1;const e=n[a].indexOf(":");if(-1===e)continue;const t=n[a].slice(0,e).trim(),i=n[a].slice(e+1).trim();switch(t.toLowerCase()){case"content-type":s.contentType=i;break;case"content-description":s.contentDescription=i;break;case"content-transfer-encoding":s.contentTransferEncoding=i;break;case"content-id":s.contentID=i;break;case"content-disposition":s.contentDisposition=i;break;case"content-location":s.contentLocation=i}}else{if(s.contentDisposition.toLowerCase().includes("inline")&&n[a].length>=4&&s.contentType?.toLowerCase().indexOf("image")>-1){let t=!0,n=e.subarray(o,e.length);if(s.contentType.toLowerCase().indexOf("tif")>0){if("base64"===s.contentTransferEncoding){let e="";const t=n;for(let n=0;n<t.length;n+=65535){const i=t.subarray(n,n+65535>t.length-1?t.length-1:n+65535);e+=String.fromCharCode.apply(null,i)}const i=atob(e);n=new Uint8Array(i.length);for(let e=0;e<n.length;e++)n[e]=i.charCodeAt(e)}t=73===n[0]&&73===n[1]||77===n[0]&&77===n[1]}if(t){let t=n.buffer;"base64"!==s.contentTransferEncoding&&(t=new ArrayBuffer(e.length-o),n=new Uint8Array(t),n.set(e.subarray(o,e.length))),s.contentData=t,s.isValidImage=!0}break}if((""===t.start||s.contentID===t.start)&&s.contentType){if(s.contentType.includes("text")||s.contentType.includes("xml")){s.contentData=String.fromCharCode.apply(null,e.subarray(o,e.length));break}s.contentData=e.subarray(o,e.length)}}return s}var me=n(51244),fe=n(28435);const ge=["nearest neighbor","bilinear","bicubic"],he=["nearest","linear","cubic"],ve="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",ye=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let be=class extends ce.A{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}async fetchRawTile(e,t,n,i={}){if(this.isBlockOutside(e,t,n))return null;const{nativePixelSize:s,spatialReference:o}=this.rasterInfo,r=2**e,l=s.x*r,c=s.y*r,{blockWidth:u,blockHeight:p}=this.getBlockWidthHeight(e),{origin:d}=this.rasterInfo.storageInfo.tileInfo,m=this.getTileExtent({x:l,y:c},t,n,d,o,[u,p]),f=this.rasterInfo.extent,g=m.xmax>f.xmax,h=m.ymin<f.ymin,v=g||h;let y=m,b=u,w=p;if(v&&(y=m.clone().intersection(f),null!=y&&(g&&(b=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*b),h&&(w=Math.floor((y.ymax-y.ymin)/c),y.ymin=y.ymax-c*w))),null==y||b<=1||w<=1)return null;const x=await this._getCoverage(y,b,w,r,i);if(!x)return null;const{coverageDescription:C}=this.coverageInfo,{noDataValue:I,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:D}=i;let A;if(null!=S&&null!=D&&D.length){const e=D[0].variableName;if("2.0"===C.version){const t=C.rangeType[0].find((t=>t.name===e));A=t?.nilValue}else if("1.1"===C.version){const t=C.range.find((t=>t.identifier===e));A=t?.nullValues}}const T=A??I,L=await this.decodePixelBlock(x,{width:b,height:w,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(T)?T[0]:T});if(null==L)return null;if(L&&(L.width!==b||L.height!==w))throw new a.A("wcsraster-fetch",`the response has unexpected dimension width: ${L.width}, height: {pixelBlock.height}`);return v?(0,fe.$Q)(L,{x:0,y:0},{width:p,height:p}):L}async _open(e){const{customFetchParameters:t}=this.ioConfig,n=e?.signal,i=await async function(e,t){const{version:n,customParameters:i,signal:s}=t??{},o=n?.startsWith("1.0")?"version":"acceptVersions",r={service:"WCS",request:"GetCapabilities",[o]:n,...i};try{let{data:n}=await(0,T.A)(e,{query:r,responseType:"xml",signal:s});return t?.version||function(e){let t=null;t="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e;const n=t.documentElement.getAttribute("version"),i=n?.slice(0,3);return null!=i&&i<"2.1"}(n)||(r[o]="2.0.1",({data:n}=await(0,T.A)(e,{query:r,responseType:"xml",signal:s}))),E(n)}catch(e){if(!(0,l.zf)(e))throw new a.A("wcslayer:open","wcs capabilities is not valid or supported");throw e}}(this.url,{version:t?.version??this.version,customParameters:t,signal:n});if(this.capabilities=i,!this.version){let e=i.version.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=i.version:(e=i.supportedVersions.find((e=>"2.0.1"===e))||i.supportedVersions.find((e=>"2.0"===e.slice(0,3)))||i.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||i.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}const{version:s}=this;if(!ye.has(s))throw new a.A("wcsraster-open",`unsupported WCS version ${s}`);const{gridCoverages:o}=i;if(!o.length)throw new a.A("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=o[0].id;const{coverageId:r}=this,c=o.find((e=>e.id===r));if(null==c)throw new a.A("wcsraster-open",`the coverageId ${r} does not exist in capabilities`);const u=await re(this.url,{coverageIds:[r],version:s,customParameters:t,signal:n});if(this.coverageInfo=u[0],"2.0"===s.slice(0,3)){const{coverageInfo:e}=this;e.lonLatEnvelope=c.lonLatEnvelope,e.supportedInterpolations=G(i.supportedInterpolations),this._patchDimensionValues201(r,n)}this.datasetName=this.coverageInfo.title;const{rasterInfo:p}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(p,512,512),this._set("rasterInfo",p),null==p.spatialReference)throw new a.A("wcsraster-open",`coverage without spatial reference is not supported: ${r}`);const{pixelType:d,bandCount:m}=await this._getPixelTypeAndBandCount(n);p.pixelType=d,1===p.bandCount&&m>1&&(p.bandCount=m),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:n}=this,i=n.rasterInfo.multidimensionalInfo?.variables,s=ye.has("1.1.2")?"1.1.2":ye.has("1.1.1")?"1.1.1":ye.has("1.1.0")?"1.1.0":null,{customFetchParameters:o}=this.ioConfig;if(i&&s)try{const n=this.url.includes("/ImageServer/"),a=e.length>8&&e.startsWith("Coverage")&&n?e.slice(8):e,r=await re(this.url,{coverageIds:[a??e],version:s,customParameters:o,signal:t}).catch((()=>{if(a)return re(this.url,{coverageIds:[e],version:s,customParameters:o,signal:t})})),l=r?.[0].rasterInfo.multidimensionalInfo?.variables;if(l)for(const e of i){const t=l.find((({name:t})=>t===e.name));if(t?.dimensions?.length)for(let i=e.dimensions.length-1;i>=0;i--){const s=e.dimensions[i],o=t.dimensions.find((({name:e})=>e===s.name));o?o.values&&o.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[i]={...s,values:o.values}):n&&e.dimensions.splice(i,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:t,extent:n,multidimensionalInfo:i}=this.rasterInfo,s=n.center,o=new D.A({xmin:s.x-t.x,xmax:s.x+t.x,ymin:s.y-t.y,ymax:s.y+t.y,spatialReference:n.spatialReference});let r=[];if(null!=i){const e=i.variables[0];r=[],e.dimensions.forEach((t=>{r.push(new le.A({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))}))}const{coverageDescription:l}=this.coverageInfo,c={interpolation:"nearest",multidimensionalDefinition:r,signal:e},{version:u}=l,{ioConfig:d}=this,m="2.0"===u&&null==d.allowAnyMediaType||"1.1"===u&&null==d.use2GridOffsets;let f;try{f=await this._getCoverage(o,2,2,1,c,!0)}catch(e){if(!m)throw e;if("1.1"===u){if(!e.details?.isResolutionMismatch)throw e;d.use2GridOffsets=!0}}if(!f&&m&&("2.0"===u&&(d.allowAnyMediaType=!0),f=await this._getCoverage(o,2,2,1,c),f&&p.A.getLogger(this).warn("wcsraster:getcoverage",ve)),!f)throw new a.A("wcsraster-open","unable to determine pixel type");const g=await this.decodePixelBlock(f,{width:2,height:2,planes:null,pixelType:null});if(null==g)throw new a.A("wcsraster-open","unable to determine pixel type");return{pixelType:g.pixelType,bandCount:g.getPlaneCount()??0}}async _getCoverage(e,t,n,i,s,o=!1){const{coverageDescription:r}=this.coverageInfo,{version:l}=r,c="2.0"===l?this._getCoverage201Parameters(e,t,n,i,s,r):"1.1"===l?this._getCoverage110Parameters(e,t,n,s,r):this._getCoverage100Parameters(e,t,n,s),u="2.0"===l?await this.request(this._constructWCS201Url(c),{signal:s.signal,responseType:"array-buffer"}):await this.request(this.url,{query:c,signal:s.signal,responseType:"array-buffer"});if("1.0"===l)return u.data;if("2.0"===l&&!1!==this.ioConfig.allowAnyMediaType&&"tiff"===(0,me.g)(u.data))return o&&(this.ioConfig.allowAnyMediaType=!0,p.A.getLogger(this).warn("wcsraster:getcoverage",ve)),u.data;const d=ue(u);if(d.isMultipart&&d.data){const e=d.data.find((e=>e.isValidImage));return o&&"base64"===e?.contentTransferEncoding&&p.A.getLogger(this).warn("wcsraster:getcoverage","response is base64 encoded which may impact layer display performance"),e?.contentData}const m=new Uint8Array(u.data,0,Math.min(u.data.byteLength,2e3)),f=String.fromCharCode.apply(null,m).toLowerCase().includes("exception"),g=f&&String.fromCharCode.apply(null,m).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(f)throw new a.A("wcsraster:getcoverage","server returns an exception",{isResolutionMismatch:g});throw new a.A("wcsraster:getcoverage","response is not a supported multipart mediaType with inline tiff")}_getInterpolationIndex(e){return e&&this.coverageInfo.supportedInterpolations?.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,n,i){const s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,o=e.spatialReference.wkid,a=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:r,interpolation:l}=i,c=this._getInterpolationIndex(l),u=r?r.map((e=>this.coverageInfo.bandNames[e])):null,p=ge[c],{multidimensionalDefinition:d}=i;let m;if(null!=d&&null!=this.rasterInfo.multidimensionalInfo){const e=d.find((e=>"StdTime"===e.dimensionName));let t=e?.values;t&&t.length>0&&(Array.isArray(t[0])&&(t=t[0]),m=t.map((e=>we(e))).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:a,crs:`EPSG:${o}`,bbox:s,width:t,height:n,time:m,interpolation:p,band:u?.join(",")}}_getCoverage110Parameters(e,t,n,i,s){const{multidimensionalDefinition:o,bandIds:a,interpolation:r}=i,l=e.spatialReference.wkid,c=`urn:ogc:def:crs:EPSG::${l}`,u=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",p=this._getInterpolationIndex(r),d=he[p],m=null==r||0===this.coverageInfo.supportedInterpolations?.indexOf(r),f=s.domain.spatialDomain,g=f.origin.x<=f.envelope.xmin&&f.origin.y<=f.envelope.ymin,h=e.width/t,v=e.height/n*(g?1:-1),y=g?[e.xmin,e.ymin]:[e.xmin,e.ymax],b=f.useEPSGAxis&&(0,A.m)(l),w=b?`${y[1]},${y[0]}`:`${y[0]},${y[1]}`,x=this.ioConfig.use2GridOffsets,C=b?x?`${v},${h}`:`${v},0,0,${h}`:x?`${h},${v}`:`${h},0,0,${v}`,I=h/2,S=e.xmin+I,D=e.xmax-I,T=Math.abs(v)/2,L=e.ymin+T,V=e.ymax-T,M=b?`${L},${S},${V},${D},${c}`:`${S},${L},${D},${V},${c}`,N=s.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let R,P=N&&d&&a?m?`${N.identifier}[${N.axis[0].identifier}[${a.join(",")}]]`:`${N.identifier}:${d}[${N.axis[0].identifier}[${a.join(",")}]]`:null;if(null!=o&&o.length)for(let e=0;e<o.length;e++){let t=o[e].values;const n=o[e].dimensionName?.toLowerCase(),i=o[e].variableName?.toLowerCase(),a=s.range.find((e=>e.identifier.toLowerCase()===i));if(t.length>0)if(Array.isArray(t[0])&&(t=t[0]),"stdtime"===n)R=t.map((e=>we(e))).join(",");else if(a){const e=a.axis.find((e=>e.identifier.toLowerCase()===n));e&&(P=m?a.identifier+"["+e.identifier+"["+t.join(",")+"]]":a.identifier+":"+d+"["+e.identifier+"["+t.join(",")+"]]")}e===o.length-1&&a&&!P&&(P=m?a.identifier:a.identifier+":"+d)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:u,crs:`EPSG:${l}`,boundingbox:M,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:w,gridOffsets:C,gridBaseCRS:c,timeSequence:R,rangeSubset:P}}_getCoverage201Parameters(e,t,n,i,s,o){const{multidimensionalDefinition:a,interpolation:r}=s,l=this._getInterpolationIndex(r);let c=null;const{supportedInterpolations:u}=this.capabilities;if(u?.length)switch(l){case 0:c=u.find((e=>e.toLowerCase().includes("nearest")));break;case 1:c=u.find((e=>e.toLowerCase().includes("linear")));break;case 2:c=u.find((e=>e.toLowerCase().includes("cubic")||e.toLowerCase().includes("quadratic")))}const p=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",{bandNames:d}=this.coverageInfo,{boundedBy:m,domainSet:f,rangeType:g}=o,h=m.isEastFirst?0:1,v=1-h,{axisLabels:y}=m,b=y[h],w=y[v],x=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=x,I=[];I.push(`${b}(${e.xmin},${e.xmax})`),I.push(`${w}(${e.ymin},${e.ymax})`);const S=[];if(y.length>2)for(let e=2;e<y.length;e++){const t=f.origin[e];if(y[e].toLowerCase().includes("time")){let n=t.toString();m.uomLabels?.[e].toLowerCase().includes("ole")&&(S.push(y[e]),n=we(t,!0)),I.push(y[e]+",http://www.opengis.net("+n+")")}else I.push(y[e]+",http://www.opengis.net("+t+")")}let D=null;if(null!=a&&a.length){const e=[];g.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let n=0;n<a.length;n++){const i=y.find((e=>e===a[n].dimensionName)),s=e.find((e=>e===a[n].variableName));if(t.includes(s)||t.push(s),i){let e=a[n].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=i.toLowerCase().includes("time")?e.map((e=>we(e))).join(","):e.join(",");const n=I.findIndex((e=>0===e.indexOf(i+",http://www.opengis.net")));-1===n&&I.push(i+",http://www.opengis.net("+t+")"),-1===n||I[n].includes("("+t+")")||I.splice(n,1,i+",http://www.opengis.net("+t+")")}}}t.length&&(D=t.join(","))}else d?.length>=2&&(D=(s.bandIds?s.bandIds.map((e=>d[e])):d).join(","));const A=I.join("&subset="),T=!o.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,L=T?null:`${b}(${t}),${w}(${n})`,V=T?1/i:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:D,interpolation:c,scaleSize:L,scaleFactor:V,subset:A,format:p,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:x,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},n=[];return Object.keys(t).forEach((e=>{const i=t[e];null!=i&&("subset"===e?"string"==typeof i&&i.split("&subset=").forEach((e=>{e&&n.push(`subset=${encodeURIComponent(e)}`)})):n.push(`${e}=${encodeURIComponent(i)}`))})),`${encodeURI(this.url)}?${n.join("&")}`}};function we(e,t=!1){return(t?new Date(ae(e)):new Date(e)).toISOString()}(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],be.prototype,"tileType",void 0),(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"version",void 0),(0,i._)([(0,u.MZ)({type:String,json:{write:!0}})],be.prototype,"coverageId",void 0),be=(0,i._)([(0,d.$)("esri.layers.support.rasterDatasets.WCSRaster")],be);const xe=be;var Ce=n(30291),Ie=n(92935);const Se=new Set(["milliseconds","seconds","minutes","hours","days","weeks","months","years","decades","centuries"]);let De=class extends((0,f.dM)((0,w.j)((0,v.q)((0,y.A)((0,g.d)((0,h.o)((0,x.e)((0,b.J)((0,r.P)(o.A.ClonableMixin(m.A))))))))))){constructor(...e){super(...e),this.coverageId=null,this.version=null,this.isReference=null,this.legendEnabled=!0,this.noData=0,this.operationalLayerType="WCS",this.type="wcs",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=(0,l.sg)((async(e,t,i)=>{const{save:s,saveAs:o}=await n.e(9838).then(n.bind(n,59838));switch(e){case Ie.X.SAVE:return s(this,t);case Ie.X.SAVE_AS:return o(this,i,t)}}))}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:["WCS"]},e).catch(l.QP).then((()=>this._openRaster(t)))),Promise.resolve(this)}get coverageInfo(){return this.raster.coverageInfo}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){return[(0,S.rZ)("Pixel Value")]}createPopupTemplate(e){return(0,Ce.tn)({fields:this.rasterFields,title:this.title},e)}async save(e){return this._debouncedSaveOperations(Ie.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Ie.X.SAVE_AS,t,e)}async _openRaster(e){const t=new xe({url:this.url,version:this.version,coverageId:this.coverageId,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters}});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new a.A("wcs-layer:load","cannot load resources on "+this.url);const{rasterInfo:n}=t;null==n.noDataValue&&(n.noDataValue=this.noData),this._set("serviceRasterInfo",n),this._set("spatialReference",n.spatialReference),null==this.title&&this.setAtOrigin("title",t.datasetName,"service"),null==this.coverageId&&this.setAtOrigin("coverageId",t.coverageInfo.id,"service"),null==this.version&&t.version&&this.setAtOrigin("version",t.version,"service"),this.setAtOrigin("tileInfo",t.rasterInfo.storageInfo.tileInfo,"service");const{multidimensionalInfo:i}=n;if(null!=i){const e=i.variables[0].dimensions.find((({name:e})=>"StdTime"===e));if(e){let t=e.extent?.[0]??e.values[0];Array.isArray(t)&&(t=t[0]);let n=e.extent?.[1]??e.values[e.values.length-1];Array.isArray(n)&&(n=n[1]);const i=Se.has(e.intervalUnit?.toLowerCase())?e.intervalUnit?.toLowerCase():null;this.set("timeInfo",{startField:"StdTime",fullTimeExtent:{start:t,end:n},timeZone:null,interval:i?{value:e.interval,unit:i}:null})}}this.raster=t,this._configDefaultSettings(),this.addHandles((0,c.wB)((()=>this.customParameters),(e=>this.raster.ioConfig.customFetchParameters=e)))}};(0,i._)([(0,u.MZ)({type:String,nonNullable:!0,json:{name:"wcsInfo.coverageId",write:{isRequired:!0}}})],De.prototype,"coverageId",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"coverageInfo",null),(0,i._)([(0,u.MZ)({type:["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"],nonNullable:!0,json:{name:"wcsInfo.version",write:{isRequired:!0}}})],De.prototype,"version",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],De.prototype,"isReference",void 0),(0,i._)([(0,u.MZ)({json:{read:!0,write:!0}})],De.prototype,"blendMode",void 0),(0,i._)([(0,u.MZ)(C.fV)],De.prototype,"legendEnabled",void 0),(0,i._)([(0,u.MZ)({type:["show","hide"]})],De.prototype,"listMode",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"noData",void 0),(0,i._)([(0,u.MZ)({type:["WCS"]})],De.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.MZ)()],De.prototype,"raster",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],De.prototype,"type",void 0),(0,i._)([(0,u.MZ)(C.M6)],De.prototype,"popupEnabled",void 0),(0,i._)([(0,u.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],De.prototype,"popupTemplate",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],De.prototype,"defaultPopupTemplate",null),(0,i._)([(0,u.MZ)({readOnly:!0,type:[I.A]})],De.prototype,"fields",void 0),(0,i._)([(0,u.MZ)({readOnly:!0,type:[I.A]})],De.prototype,"rasterFields",null),De=(0,i._)([(0,d.$)("esri.layers.WCSLayer")],De);const Ae=De},38458:(e,t,n)=>{n.d(t,{m:()=>s});const i=[[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&&i.some((([t,n])=>e>=t&&e<=n))}}}]);