@arcgis/core 4.33.0-next.20250513 → 4.33.0-next.20250514

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 (185) hide show
  1. package/arcade/functions/centroid.js +1 -1
  2. package/arcade/functions/geomasync.js +1 -1
  3. package/arcade/functions/geometry.js +1 -1
  4. package/arcade/functions/geomsync.js +1 -1
  5. package/arcade/geometry/operators.js +1 -1
  6. package/arcade/geometry/operatorsWorker.js +1 -1
  7. package/arcade/treeAnalysis.js +1 -1
  8. package/assets/components/assets/combobox/t9n/messages.en.json +1 -1
  9. package/assets/components/assets/combobox/t9n/messages.json +1 -1
  10. package/assets/components/assets/icon/calendarHeatChart16.json +1 -0
  11. package/assets/components/assets/icon/calendarHeatChart24.json +1 -0
  12. package/assets/components/assets/icon/calendarHeatChart32.json +1 -0
  13. package/assets/components/assets/icon/matrixHeatChart16.json +1 -0
  14. package/assets/components/assets/icon/matrixHeatChart24.json +1 -0
  15. package/assets/components/assets/icon/matrixHeatChart32.json +1 -0
  16. package/assets/components/assets/icon/progressBarChart16.json +1 -0
  17. package/assets/components/assets/icon/progressBarChart24.json +1 -0
  18. package/assets/components/assets/icon/progressBarChart32.json +1 -0
  19. package/assets/components/assets/icon/spikeDataVisualization16.json +1 -0
  20. package/assets/components/assets/icon/spikeDataVisualization24.json +1 -0
  21. package/assets/components/assets/icon/spikeDataVisualization32.json +1 -0
  22. package/assets/components/assets/icon/spikeDataVisualizationOpen16.json +1 -0
  23. package/assets/components/assets/icon/spikeDataVisualizationOpen24.json +1 -0
  24. package/assets/components/assets/icon/spikeDataVisualizationOpen32.json +1 -0
  25. package/assets/components/assets/icon/spikeDataVisualizationOutlined16F.json +1 -0
  26. package/assets/components/assets/icon/spikeDataVisualizationOutlined24F.json +1 -0
  27. package/assets/components/assets/icon/spikeDataVisualizationOutlined32F.json +1 -0
  28. package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked16.json +1 -0
  29. package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked24.json +1 -0
  30. package/assets/components/assets/icon/spikeDataVisualizationOutlinedColorLocked32.json +1 -0
  31. package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen16.json +1 -0
  32. package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen24.json +1 -0
  33. package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpen32.json +1 -0
  34. package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked16.json +1 -0
  35. package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked24.json +1 -0
  36. package/assets/components/assets/icon/spikeDataVisualizationOutlinedOpenColorLocked32.json +1 -0
  37. package/assets/esri/core/workers/RemoteClient.js +1 -1
  38. package/assets/esri/core/workers/chunks/0766ecb677d667e5fb83.js.LICENSE.txt +1 -1
  39. package/assets/esri/core/workers/chunks/{4deeeceb784e4390441d.js → 0a4cece5e96fb7e8a57b.js} +1 -1
  40. package/assets/esri/core/workers/chunks/12e99071f6582f6caeaf.js +1 -0
  41. package/assets/esri/core/workers/chunks/191a45a594ecaf7f1abb.js +1 -0
  42. package/assets/esri/core/workers/chunks/1991f0d0f0a12175f849.js +1 -0
  43. package/assets/esri/core/workers/chunks/218a66d53f7cf4f285aa.js.LICENSE.txt +1 -1
  44. package/assets/esri/core/workers/chunks/{07695960aa0344dbfbf3.js → 28d9e2ffc3059a55311e.js} +1 -1
  45. package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js.LICENSE.txt +1 -1
  46. package/assets/esri/core/workers/chunks/4899cdc8bb5085c356f9.js +1 -0
  47. package/assets/esri/core/workers/chunks/498886c321a2501658bc.js +1 -0
  48. package/assets/esri/core/workers/chunks/56569d0c2cf5c5167651.js +1 -0
  49. package/assets/esri/core/workers/chunks/{ba3193ea145960a50e87.js → 5c8d52b72a3bea4202ac.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{aa82925ffb00babb0543.js → 6394ab6f629aa90292e6.js} +2 -2
  51. package/assets/esri/core/workers/chunks/{aa82925ffb00babb0543.js.LICENSE.txt → 6394ab6f629aa90292e6.js.LICENSE.txt} +1 -1
  52. package/assets/esri/core/workers/chunks/{8b74b609de4f70e1a75c.js → 64af433e88d4dd21a2ff.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{2b01e3bce78541620a86.js → 6cbe8205a4e0f62da519.js} +1 -1
  54. package/assets/esri/core/workers/chunks/6e64ce0958c3432004b6.js +346 -0
  55. package/assets/esri/core/workers/chunks/6e8c6c9112ecb867b7be.js +1 -0
  56. package/assets/esri/core/workers/chunks/{a8430e1e2142f1ce9b92.js → 82c395d8649096609a8a.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{a73c6b4bc5baf440f85a.js → 88b7265270feede80e1d.js} +1 -1
  58. package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
  59. package/assets/esri/core/workers/chunks/8c21cc9af4ce9652cc5c.js +1 -0
  60. package/assets/esri/core/workers/chunks/{243dc74ec62891ba1ef7.js → 8e82acd1f730571680f4.js} +1 -1
  61. package/assets/esri/core/workers/chunks/90ae15ce22a49bd84876.js.LICENSE.txt +1 -1
  62. package/assets/esri/core/workers/chunks/a09b5700c92bb76c3234.js +1 -0
  63. package/assets/esri/core/workers/chunks/b06cb23048c32940f5de.js +1 -0
  64. package/assets/esri/core/workers/chunks/{079434fe765c53d304f2.js → b1e275607d9754079f60.js} +1 -1
  65. package/assets/esri/core/workers/chunks/b4f38fe9cc948a39ad87.js.LICENSE.txt +1 -1
  66. package/assets/esri/core/workers/chunks/{3c45603af279ad7fed8c.js → b8b5dfd2d73a8410fba2.js} +1 -1
  67. package/assets/esri/core/workers/chunks/c604fefedccfd4db9953.js +1 -0
  68. package/assets/esri/core/workers/chunks/{b816b608f31954128246.js → d21d9e8b8c8a2e0485d5.js} +1 -1
  69. package/assets/esri/core/workers/chunks/da3c62a851a4332f6dda.js +1 -0
  70. package/assets/esri/core/workers/chunks/{fef1a5f8a6fd3502b33b.js → e0247252c6a0f3340e33.js} +28 -28
  71. package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js.LICENSE.txt +1 -1
  72. package/assets/esri/core/workers/chunks/e5608e5232e983531f72.js +1 -0
  73. package/assets/esri/core/workers/chunks/f8fb0c7eaf73709bd855.js +1 -0
  74. package/assets/esri/core/workers/chunks/fd24dd602a3fed88d90e.js +1 -0
  75. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  76. package/assets/esri/themes/base/widgets/_BuildingPhasePicker.scss +17 -10
  77. package/assets/esri/themes/base/widgets/_SelectionList.scss +7 -3
  78. package/assets/esri/themes/dark/main.css +1 -1
  79. package/assets/esri/themes/light/main.css +1 -1
  80. package/assets/esri/themes/light/view.css +1 -1
  81. package/chunks/OperatorCut.js +1 -1
  82. package/chunks/OperatorDefinitions.js +5 -0
  83. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  84. package/chunks/OperatorSimplifyOGC.js +1 -1
  85. package/chunks/ProjectionTransformation.js +1 -1
  86. package/chunks/arcade.js +1 -1
  87. package/chunks/lyr3DMain.js +1 -1
  88. package/core/Accessor.js +1 -1
  89. package/core/accessorSupport/Lifecycle.js +5 -0
  90. package/core/accessorSupport/Properties.js +1 -1
  91. package/core/accessorSupport/decorators/subclass.js +1 -1
  92. package/core/accessorSupport/tracking/Flags.js +1 -1
  93. package/core/accessorSupport/watch.js +1 -1
  94. package/core/mapCollectionUtils.js +1 -1
  95. package/core/urlUtils.js +1 -1
  96. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  97. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  98. package/geometry/operators/gx/operatorSimplifyOGC.js +1 -1
  99. package/geometry/operators/simplifyOGCOperator.js +1 -1
  100. package/interfaces.d.ts +263 -2448
  101. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  102. package/layers/KnowledgeGraphLayer.js +1 -1
  103. package/layers/LinkChartLayer.js +1 -1
  104. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  105. package/layers/VideoLayer.js +1 -1
  106. package/layers/graphics/data/QueryEngineResult.js +1 -1
  107. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  108. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  109. package/package.json +1 -1
  110. package/smartMapping/statistics/uniqueValues.js +1 -1
  111. package/smartMapping/support/adapters/support/layerUtils.js +1 -1
  112. package/statistics/utils.js +1 -1
  113. package/support/revision.js +1 -1
  114. package/symbols/cim/effects/EffectRadial.js +1 -1
  115. package/versionManagement/versionAdapters/FeatureLayerVersionAdapter.js +1 -1
  116. package/versionManagement/versionAdapters/NetworkVersionAdapter.js +1 -1
  117. package/versionManagement/versionAdapters/SubTypeGroupLayerVersionAdapter.js +1 -1
  118. package/views/2d/layers/MediaLayerView2D.js +1 -1
  119. package/views/2d/layers/TileLayerView2D.js +1 -1
  120. package/views/2d/layers/VideoLayerView2D.js +1 -1
  121. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  122. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  123. package/views/3d/FocusAreasView.js +5 -0
  124. package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
  125. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  126. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  127. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  128. package/views/3d/layers/GraphicsView3D.js +1 -1
  129. package/views/3d/layers/I3SMeshView3D.js +1 -1
  130. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  131. package/views/3d/layers/Lyr3DWasm.js +1 -1
  132. package/views/3d/layers/RouteLayerView3D.js +1 -1
  133. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  134. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  135. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  136. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  137. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  138. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  139. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  140. package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
  141. package/views/3d/layers/i3s/I3SQueryResultGeometry.js +1 -1
  142. package/views/3d/layers/i3s/meshUtils.js +5 -0
  143. package/views/3d/support/hitTest.js +1 -1
  144. package/views/3d/terrain/TileTexture.js +1 -1
  145. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  146. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  147. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  148. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  149. package/views/SceneView.js +1 -1
  150. package/views/VideoView.js +1 -1
  151. package/views/layers/BuildingComponentSublayerView.js +1 -1
  152. package/views/layers/BuildingSceneLayerView.js +1 -1
  153. package/views/support/TextureCompressionWorker.js +1 -1
  154. package/views/support/TextureCompressionWorkerHandle.js +1 -1
  155. package/views/webgl/Texture.js +1 -1
  156. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  157. package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
  158. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  159. package/widgets/FeatureTable/Grid/Column.js +1 -1
  160. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  161. package/widgets/FeatureTable.js +1 -1
  162. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  163. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  164. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  165. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  166. package/widgets/OrientedImageryViewer.js +1 -1
  167. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  168. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  169. package/widgets/support/SelectionList.js +1 -1
  170. package/assets/esri/core/workers/chunks/009dbddfc6499e2cee4f.js +0 -1
  171. package/assets/esri/core/workers/chunks/0f57b6a3a85a47ebd9d0.js +0 -346
  172. package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +0 -1
  173. package/assets/esri/core/workers/chunks/26ebb7816dd8c8cd4f3b.js +0 -1
  174. package/assets/esri/core/workers/chunks/2abce00d812c7f6b542d.js +0 -1
  175. package/assets/esri/core/workers/chunks/47cd99ab3ed11a931084.js +0 -1
  176. package/assets/esri/core/workers/chunks/51d9eaeeb781fd1d1162.js +0 -1
  177. package/assets/esri/core/workers/chunks/5228fc7fcdf57f44781e.js +0 -1
  178. package/assets/esri/core/workers/chunks/83e13baab4b90a88d967.js +0 -1
  179. package/assets/esri/core/workers/chunks/93cc26e5636040fdc0b8.js +0 -1
  180. package/assets/esri/core/workers/chunks/c17c269cc30e7e1d0bfb.js +0 -1
  181. package/assets/esri/core/workers/chunks/c3f144ca69995dca34a9.js +0 -1
  182. package/assets/esri/core/workers/chunks/d551f70560a2b1ef5696.js +0 -1
  183. package/assets/esri/core/workers/chunks/e9b1349a2b3a3f300808.js +0 -1
  184. package/core/accessorSupport/interfaces.js +0 -5
  185. package/views/FocusAreasView.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{numberMaxFloat32 as t}from"../../../core/mathUtils.js";import e from"../PixelBlock.js";import{getPixelValueRange as n}from"../rasterFormats/pixelRangeUtils.js";var l,i;!function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"}(l||(l={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(i||(i={}));const o=9;function r(t){return null!=t&&t.pixels?.length>0}function s(t,e){return e?.length&&r(t)?t.extractBands(e):t}function a(t){if(!t?.length||t.some((t=>!r(t))))return null;if(1===t.length)return t[0]?.clone()??null;const n=t,{width:l,height:i,pixelType:o}=n[0];if(n.some((t=>t.width!==l||t.height!==i)))return null;const s=n.map((({mask:t})=>t)).filter((t=>null!=t));let a=null;s.length&&(a=new Uint8Array(l*i),a.set(s[0]),s.length>1&&y(s.slice(1),a));const h=[];n.forEach((({pixels:t})=>h.push(...t)));const f=n.map((({statistics:t})=>t)).filter((t=>t?.length)),c=[];return f.forEach((t=>c.push(...t))),new e({pixelType:o,width:l,height:i,mask:a,pixels:h,statistics:c.length?c:null})}function h(t){if(!t)return;const e=t.colormap;if(!e||0===e.length)return;const n=e.sort(((t,e)=>t[0]-e[0])),l=n[0][0]<0?n[0][0]:0,i=Math.max(256,n[n.length-1][0]-l+1),o=new Uint8Array(4*i),r=[],s=5===n[0].length;if(i>65536)return n.forEach((t=>{r[t[0]-l]=s?t.slice(1):t.slice(1).concat([255])})),{indexed2DColormap:r,offset:l,alphaSpecified:s};if(t.fillUnspecified){let t=n[0];for(let e=t[0]-l,r=0;e<i;e++)o[4*e]=t[1],o[4*e+1]=t[2],o[4*e+2]=t[3],o[4*e+3]=s?t[4]:255,e===t[0]-l&&(t=r===n.length-1?t:n[++r])}else for(let a=0;a<n.length;a++){const t=n[a],e=4*(t[0]-l);o[e]=t[1],o[e+1]=t[2],o[e+2]=t[3],o[e+3]=s?t[4]:255}return{indexedColormap:o,offset:l,alphaSpecified:s}}function f(t,e){if(!r(t))return t;if(!e||!e.indexedColormap&&!e.indexed2DColormap)return t;const n=t.clone(),l=n.pixels;let i=n.mask;const o=n.width*n.height;if(1!==l.length)return t;const{indexedColormap:s,indexed2DColormap:a,offset:h,alphaSpecified:f}=e,c=l[0],u=new Uint8Array(c.length),p=new Uint8Array(c.length),x=new Uint8Array(c.length);let m,d=0;if(s){const t=s.length-1;if(null!=i)for(let e=0;e<o;e++)i[e]&&(d=4*(c[e]-h),d<h||d>t?i[e]=0:(u[e]=s[d],p[e]=s[d+1],x[e]=s[d+2],i[e]=s[d+3]));else{i=new Uint8Array(o);for(let e=0;e<o;e++)d=4*(c[e]-h),d<h||d>t?i[e]=0:(u[e]=s[d],p[e]=s[d+1],x[e]=s[d+2],i[e]=s[d+3]);n.mask=i}}else if(a)if(null!=i)for(let r=0;r<o;r++)i[r]&&(m=a[c[r]],u[r]=m[0],p[r]=m[1],x[r]=m[2],i[r]=m[3]);else{i=new Uint8Array(o);for(let t=0;t<o;t++)m=a[c[t]],u[t]=m[0],p[t]=m[1],x[t]=m[2],i[t]=m[3];n.mask=i}return n.pixels=[u,p,x],n.statistics=null,n.pixelType="u8",n.maskIsAlpha=f,n}function c(t,n){if(!r(t))return null;const{pixels:l,mask:i}=t,o=l.length;let s=n.lut;const{offset:a}=n;s&&1===s[0].length&&(s=l.map((()=>s)));const h=[],f=n.outputPixelType||"u8";for(let e=0;e<o;e++){const t=u(l[e],i,s[e],a||0,f);h.push(t)}const c=new e({width:t.width,height:t.height,pixels:h,mask:i,pixelType:f});return c.updateStatistics(),c}function u(t,n,l,i,o){const r=t.length,s=e.createEmptyBand(o,r);if(n)for(let e=0;e<r;e++)n[e]&&(s[e]=l[t[e]-i]);else for(let e=0;e<r;e++)s[e]=l[t[e]-i];return s}function p(t,e){if(!r(t))return null;const n=t.clone(),{pixels:l}=n,i=n.width*n.height,o=e.length,s=Math.floor(o/2),a=e[Math.floor(s)],h=l[0],f=new Uint8Array(i),c=new Uint8Array(i),u=new Uint8Array(i);let p=n.mask;const x=4===e[0].mappedColor.length;p||(p=new Uint8Array(i),p.fill(x?255:1),n.mask=p);for(let r=0;r<i;r++)if(p[r]){const t=h[r];let n=!1,l=s,i=a,x=0,m=o-1;for(;m-x>1;){if(t===i.value){n=!0;break}t>i.value?x=l:m=l,l=Math.floor((x+m)/2),i=e[Math.floor(l)]}n||(t===e[x].value?(i=e[x],n=!0):t===e[m].value?(i=e[m],n=!0):t<e[x].value?n=!1:t>e[x].value&&(t<e[m].value?(i=e[x],n=!0):m===o-1?n=!1:(i=e[m],n=!0))),n?(f[r]=i.mappedColor[0],c[r]=i.mappedColor[1],u[r]=i.mappedColor[2],p[r]=i.mappedColor[3]):f[r]=c[r]=u[r]=p[r]=0}return n.pixels=[f,c,u],n.mask=p,n.pixelType="u8",n.maskIsAlpha=x,n}function x(e,n,l=!1){const i=1e-5,r=new Float32Array(3*o),s=n.length;for(let a=0;a<o;a++)r[3*a]=e[2*a]??t-1,r[3*a+1]=e[2*a+1]??t,r[3*a+2]=n[a]??0,a<s&&(a>0&&(r[3*a]-=i),(a<s-1||!l)&&(r[3*a+1]-=i));return r}function m(t,l){if(!r(t))return null;const{width:i,height:o}=t,{inputRanges:s,outputValues:a,outputPixelType:h,noDataRanges:f,allowUnmatched:c,replacementValue:u,isLastInputRangeInclusive:p}=l,x=t.pixels[0],m=e.createEmptyBand(h,x.length),d=t.mask,g=new Uint8Array(i*o);d?g.set(d):g.fill(255);const y=t.pixelType.startsWith("f")?1e-6:0,w=s.map((t=>t-y));w[0]=s[0],w[w.length-1]=s[s.length-1]+(p?1e-6:0);const k=s.length/2,[M,A]=n(h);for(let e=0;e<o;e++)for(let t=0;t<i;t++){const n=e*i+t;if(g[n]){const t=x[n];let e=!1;for(let l=k-1;l>=0;l--)if(t===w[2*l]||t>w[2*l]&&t<w[2*l+1]){m[n]=a[l],e=!0;break}e||(c?m[n]=t>A?A:t<M?M:u??t:g[n]=0)}}const U=f?.length;if(U)for(let e=0;e<o;e++)for(let t=0;t<i;t++){const n=e*i+t;if(!d||d[n]){const t=x[n];for(let e=0;e<U;e+=2)if(t>=f[e]&&t<=f[e+1]){m[n]=0,g[n]=0;break}}}return new e({width:i,height:o,pixelType:h,pixels:[m],mask:g})}function d(t,e,n,l){const i=null!=n&&n.length>=2?new Set(n):null,o=1===n?.length?n[0]:null,r=!!e?.length;for(let s=0;s<t.length;s++)if(l[s]){const n=t[s];if(r){let t=!1;for(let l=0;l<e.length;l+=2)if(n>=e[l]&&n<=e[l+1]){t=!0;break}t||(l[s]=0)}l[s]&&(n===o||i?.has(n))&&(l[s]=0)}}function g(t,e){const n=t[0].length;for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(t[e][l]){n=!0;break}n||(e[l]=0)}}function y(t,e){const n=t[0].length;for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(0===t[e][l]){n=!0;break}n&&(e[l]=0)}}function w(t,n){if(!r(t))return null;const{width:l,height:i,pixels:o}=t,s=l*i,a=new Uint8Array(s);t.mask?a.set(t.mask):a.fill(255);const h=o.length,{includedRanges:f,noDataValues:c,outputPixelType:p,matchAll:x,lookups:m}=n;if(m){const t=[];for(let e=0;e<h;e++){const n=m[e],l=u(o[e],a,n.lut,n.offset||0,"u8");t.push(l)}1===t.length?a.set(t[0]):x?g(t,a):y(t,a)}else if(x){const t=[];for(let e=0;e<h;e++){const n=new Uint8Array(s);n.set(a),d(o[e],f?.slice(2*e,2*e+2),c?.[e],n),t.push(n)}1===t.length?a.set(t[0]):g(t,a)}else for(let e=0;e<h;e++)d(o[e],f?.slice(2*e,2*e+2),c?.[e],a);return new e({width:l,height:i,pixelType:p,pixels:o,mask:a})}function k(t){const{srcPixelType:l,inputRanges:i,outputValues:o,allowUnmatched:r,noDataRanges:s,isLastInputRangeInclusive:a,outputPixelType:h}=t;if("u8"!==l&&"s8"!==l&&"u16"!==l&&"s16"!==l)return null;const f=l.includes("16")?65536:256,c=l.includes("s")?-f/2:0,u=e.createEmptyBand(h,f),p=new Uint8Array(f);r&&p.fill(255);const[x,m]=n(h);if(i?.length&&o?.length){const t=1e-6,e=i.map((e=>e-t));e[0]=i[0],a&&(e[e.length-1]=i[i.length-1]);for(let n=0;n<e.length;n++){const t=o[n]>m?m:o[n]<x?x:o[n],l=Math.ceil(e[2*n]-c),i=Math.floor(e[2*n+1]-c);for(let e=l;e<=i;e++)u[e]=t,p[e]=255}}if(s?.length)for(let e=0;e<s.length;e++){const t=Math.ceil(s[2*e]-c),n=Math.floor(s[2*e+1]-c);for(let e=t;e<=n;e++)p[e]=0}return{lut:u,offset:c,mask:p}}function M(t,e,n){if("u8"!==t&&"s8"!==t&&"u16"!==t&&"s16"!==t)return null;const l=t.includes("16")?65536:256,i=t.includes("s")?-l/2:0,o=new Uint8Array(l);if(e)for(let r=0;r<e.length;r++){const t=Math.ceil(e[2*r]-i),n=Math.floor(e[2*r+1]-i);for(let e=t;e<=n;e++)o[e]=255}else o.fill(255);if(n)for(let r=0;r<n.length;r++)o[n[r]-i]=0;return{lut:o,offset:i}}function A(t,e,n,l,i,o,r,s){return{xmin:i<=n*t?0:i<n*t+t?i-n*t:t,ymin:o<=l*e?0:o<l*e+e?o-l*e:e,xmax:i+r<=n*t?0:i+r<n*t+t?i+r-n*t:t,ymax:o+s<=l*e?0:o+s<l*e+e?o+s-l*e:e}}function U(t,e){if(!t||0===t.length)return null;const n=t.find((t=>t.pixelBlock));if(null==n?.pixelBlock)return null;const l=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,i=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,o=.01*Math.min(l,i),r=t.sort(((t,e)=>Math.abs(t.extent.ymax-e.extent.ymax)>o?e.extent.ymax-t.extent.ymax:Math.abs(t.extent.xmin-e.extent.xmin)>o?t.extent.xmin-e.extent.xmin:0)),s=Math.min.apply(null,r.map((t=>t.extent.xmin))),a=Math.min.apply(null,r.map((t=>t.extent.ymin))),h=Math.max.apply(null,r.map((t=>t.extent.xmax))),f=Math.max.apply(null,r.map((t=>t.extent.ymax))),c={x:Math.round((e.xmin-s)/l),y:Math.round((f-e.ymax)/i)},u={width:Math.round((h-s)/l),height:Math.round((f-a)/i)},p={width:Math.round((e.xmax-e.xmin)/l),height:Math.round((e.ymax-e.ymin)/i)};if(Math.round(u.width/n.pixelBlock.width)*Math.round(u.height/n.pixelBlock.height)!==r.length||c.x<0||c.y<0||u.width<p.width||u.height<p.height)return null;return{extent:e,pixelBlock:T(r.map((t=>t.pixelBlock)),u,{clipOffset:c,clipSize:p})}}function b(t,e,n,l,i,o){const{width:r,height:s}=n.block,{x:a,y:h}=n.offset,{width:f,height:c}=n.mosaic,u=A(r,s,l,i,a,h,f,c);let p=0,x=0;if(o){const t=o.hasGCSSShiftTransform?360:o.halfWorldWidth??0,e=r*o.resolutionX,n=o.startX+l*e;n<t&&n+e>t?x=o.rightPadding:n>=t&&(p=o.leftMargin-o.rightPadding,x=0)}if(u.xmax-=x,"number"!=typeof e)for(let m=u.ymin;m<u.ymax;m++){const n=(i*s+m-h)*f+(l*r-a)+p,o=m*r;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e[o+l]}else for(let m=u.ymin;m<u.ymax;m++){const n=(i*s+m-h)*f+(l*r-a)+p;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e}}function T(t,n,l={}){const{clipOffset:i,clipSize:o,alignmentInfo:s,blockWidths:a}=l;if(a)return v(t,n,{blockWidths:a});const h=t.find((t=>r(t)));if(null==h)return null;const f=o?o.width:n.width,c=o?o.height:n.height,u=h.width,p=h.height,x=n.width/u,m=n.height/p,d={offset:i||{x:0,y:0},mosaic:o||n,block:{width:u,height:p}},g=h.pixelType,y=e.getPixelArrayConstructor(g),w=h.pixels.length,k=[];let M,A;for(let e=0;e<w;e++){A=new y(f*c);for(let n=0;n<m;n++)for(let l=0;l<x;l++){const i=t[n*x+l];r(i)&&(M=i.pixels[e],b(A,M,d,l,n,s))}k.push(A)}const U=t.some((t=>null==t||null!=t.mask&&t.mask.length>0)),T=t.some((t=>t?.bandMasks&&t.bandMasks.length>1)),B=U?new Uint8Array(f*c):void 0,S=T?[]:void 0;if(B){for(let e=0;e<m;e++)for(let n=0;n<x;n++){const l=t[e*x+n],i=null!=l?l.mask:null;b(B,null!=i?i:l?255:0,d,n,e,s)}if(S)for(let e=0;e<w;e++){const n=new Uint8Array(f*c);for(let l=0;l<m;l++)for(let i=0;i<x;i++){const o=t[l*x+i],r=o?.bandMasks?.[e]??o?.mask;b(n,null!=r?r:o?255:0,d,i,l,s)}S.push(n)}}const C=new e({width:f,height:c,pixels:k,pixelType:g,bandMasks:S,mask:B});return C.updateStatistics(),C}function v(t,n,l){const i=t.find((t=>null!=t));if(null==i)return null;const o=t.some((t=>null==t||!!t.mask)),{width:s,height:a}=n,h=o?new Uint8Array(s*a):null,{blockWidths:f}=l,c=[],u=i.getPlaneCount(),p=e.getPixelArrayConstructor(i.pixelType);if(o)for(let e=0,y=0;e<t.length;y+=f[e],e++){const n=t[e];if(!r(n))continue;const l=n.mask;for(let t=0;t<a;t++)for(let i=0;i<f[e];i++)h[t*s+i+y]=null==l?255:l[t*n.width+i]}const x=t.some((t=>t?.bandMasks&&t.bandMasks.length>1)),m=x?[]:void 0,d=s*a;for(let e=0;e<u;e++){const n=new p(d),l=x?new Uint8Array(d):void 0;for(let i=0,o=0;i<t.length;o+=f[i],i++){const h=t[i];if(!r(h))continue;const c=h.pixels[e];if(null!=c){for(let t=0;t<a;t++)for(let e=0;e<f[i];e++)n[t*s+e+o]=c[t*h.width+e];if(l){const t=h.bandMasks?.[e]??h.mask;for(let e=0;e<a;e++)for(let n=0;n<f[i];n++)l[e*s+n+o]=t?t[e*h.width+n]:255}}}c.push(n),m&&l&&m.push(l)}const g=new e({width:s,height:a,mask:h,bandMasks:m,pixels:c,pixelType:i.pixelType});return g.updateStatistics(),g}function B(t,e,n){if(!r(t))return null;const{width:l,height:i}=t,o=e.x,s=e.y,a=n.width+o,h=n.height+s;if(o<0||s<0||a>l||h>i)return t;if(0===o&&0===s&&a===l&&h===i)return t;t.mask||(t.mask=new Uint8Array(l*i));const f=t.mask;for(let r=0;r<i;r++){const t=r*l;for(let e=0;e<l;e++)f[t+e]=r<s||r>=h||e<o||e>=a?0:1}return t.updateStatistics(),t}function S(t){if(!r(t))return null;const e=t.clone(),{width:n,height:l,pixels:i}=t,o=i[0],s=e.pixels[0],a=t.mask;for(let r=2;r<l-1;r++){const t=new Map;for(let l=r-2;l<r+2;l++)for(let e=0;e<4;e++){const i=l*n+e;_(t,o[i],a?a[i]:1)}s[r*n]=C(t),s[r*n+1]=s[r*n+2]=s[r*n];let e=3;for(;e<n-1;e++){let l=(r-2)*n+e+1;_(t,o[l],a?a[l]:1),l=(r-1)*n+e+1,_(t,o[l],a?a[l]:1),l=r*n+e+1,_(t,o[l],a?a[l]:1),l=(r+1)*n+e+1,_(t,o[l],a?a[l]:1),l=(r-2)*n+e-3,P(t,o[l],a?a[l]:1),l=(r-1)*n+e-3,P(t,o[l],a?a[l]:1),l=r*n+e-3,P(t,o[l],a?a[l]:1),l=(r+1)*n+e-3,P(t,o[l],a?a[l]:1),s[r*n+e]=C(t)}s[r*n+e+1]=s[r*n+e]}for(let r=0;r<n;r++)s[r]=s[n+r]=s[2*n+r],s[(l-1)*n+r]=s[(l-2)*n+r];return e.updateStatistics(),e}function C(t){if(0===t.size)return 0;let e=0,n=-1,l=0;const i=t.keys();let o=i.next();for(;!o.done;)l=t.get(o.value),l>e&&(n=o.value,e=l),o=i.next();return n}function P(t,e,n){if(0===n)return;const l=t.get(e);1===l?t.delete(e):t.set(e,l-1)}function _(t,e,n){0!==n&&t.set(e,t.has(e)?t.get(e)+1:1)}function W(t,n,l){let{x:i,y:o}=n;const{width:s,height:a}=l;if(0===i&&0===o&&a===t.height&&s===t.width)return t;const{width:h,height:f}=t,c=Math.max(0,o),u=Math.max(0,i),p=Math.min(i+s,h),x=Math.min(o+a,f);if(p<0||x<0||!r(t))return null;i=Math.max(0,-i),o=Math.max(0,-o);const{pixels:m}=t,d=s*a,g=m.length,y=[];for(let r=0;r<g;r++){const n=m[r],l=e.createEmptyBand(t.pixelType,d);for(let t=c;t<x;t++){const e=t*h;let r=(t+o-c)*s+i;for(let t=u;t<p;t++)l[r++]=n[e+t]}y.push(l)}const w=new Uint8Array(d),k=t.mask;for(let e=c;e<x;e++){const t=e*h;let n=(e+o-c)*s+i;for(let e=u;e<p;e++)w[n++]=k?k[t+e]:1}const M=new e({width:l.width,height:l.height,pixelType:t.pixelType,pixels:y,mask:w});return M.updateStatistics(),M}function E(t,n=!0){if(!r(t))return null;const{pixels:l,width:i,height:o,mask:s,pixelType:a}=t,h=[],f=Math.round(i/2),c=Math.round(o/2),u=o-1,p=i-1;for(let r=0;r<l.length;r++){const t=l[r],s=e.createEmptyBand(a,f*c);let x=0;for(let e=0;e<o;e+=2)for(let l=0;l<i;l+=2){const o=t[e*i+l];if(n){const n=l===p?o:t[e*i+l+1],r=e===u?o:t[e*i+l+i],a=l===p?r:e===u?n:t[e*i+l+i+1];s[x++]=(o+n+r+a)/4}else s[x++]=o}h.push(s)}let x=null;if(null!=s){x=new Uint8Array(f*c);let t=0;for(let e=0;e<o;e+=2)for(let l=0;l<i;l+=2){const o=s[e*i+l];if(n){const n=l===p?o:s[e*i+l+1],r=e===u?o:s[e*i+l+i],a=l===p?r:e===u?n:s[e*i+l+i+1];x[t++]=o*n*r*a?1:0}else x[t++]=o}}return new e({width:f,height:c,pixelType:a,pixels:h,mask:x})}function I(t,e,n=0,l=!0){if(!r(t))return null;const{width:i,height:o}=e;let{width:s,height:a}=t;const h=new Map,f={x:0,y:0},c=1+n;let u=t;for(let r=0;r<c;r++){const t=Math.ceil(s/i),n=Math.ceil(a/o);for(let l=0;l<n;l++){f.y=l*o;for(let n=0;n<t;n++){f.x=n*i;const t=W(u,f,e);h.set(`${r}/${l}/${n}`,t)}}r<c-1&&(u=E(u,l)),s=Math.round(s/2),a=Math.round(a/2)}return h}function R(t){const{pixelBlock:e,tileSize:n,level:l,row:i,col:o,useBilinear:s}=t;if(!r(e))return null;const{width:a,height:h}=n,f=2**l,c=f*a,u=f*h;let p=W(e,{y:i*u,x:o*c},{width:c,height:u});if(!p)return null;for(let r=l;r>0;r--)p=E(p,s);return p}function F(t,e,n,l,i=0){const{width:o,height:r}=t,{width:s,height:a}=e,h=l.cols,f=l.rows,c=Math.ceil(s/h-.1/h),u=Math.ceil(a/f-.1/f);let p,x,m,d,g,y,w;const k=c*h,M=k*u*f,A=new Float32Array(M),U=new Float32Array(M),b=new Uint32Array(M),T=new Uint32Array(M);let v,B,S=0;for(let C=0;C<u;C++)for(let t=0;t<c;t++){p=12*(C*c+t),x=n[p],m=n[p+1],d=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){S=(C*f+e)*k+t*h,B=(e+.5)/f;for(let t=0;t<e;t++)v=(t+.5)/h,A[S+t]=(x*v+m*B+d)*o+i,U[S+t]=(g*v+y*B+w)*r+i,b[S+t]=Math.floor(A[S+t]),T[S+t]=Math.floor(U[S+t])}p+=6,x=n[p],m=n[p+1],d=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){S=(C*f+e)*k+t*h,B=(e+.5)/f;for(let t=e;t<h;t++)v=(t+.5)/h,A[S+t]=(x*v+m*B+d)*o+i,U[S+t]=(g*v+y*B+w)*r+i,b[S+t]=Math.floor(A[S+t]),T[S+t]=Math.floor(U[S+t])}}return{offsets_x:A,offsets_y:U,offsets_xi:b,offsets_yi:T,gridWidth:k}}function j(t,e){const{coefficients:n,spacing:l}=e,{offsets_x:i,offsets_y:o,gridWidth:r}=F(t,t,n,{rows:l[0],cols:l[1]}),{width:s,height:a}=t,h=new Float32Array(s*a),f=180/Math.PI;for(let c=0;c<a;c++)for(let t=0;t<s;t++){const e=c*r+t,n=0===c?e:e-r,l=c===a-1?e:e+r,u=i[n]-i[l],p=o[l]-o[n];if(isNaN(u)||isNaN(p))h[c*s+t]=90;else{let e=Math.atan2(p,u)*f;e=(360+e)%360,h[c*s+t]=e}}return h}function D(t,n,l,i,o="nearest"){if(!r(t))return null;"majority"===o&&(t=S(t));const{pixels:s,mask:a,bandMasks:h,pixelType:f}=t,c=t.width,u=t.height,p=e.getPixelArrayConstructor(f),x=s.length,{width:m,height:d}=n;let g=!1;for(let e=0;e<l.length;e+=3)-1===l[e]&&-1===l[e+1]&&-1===l[e+2]&&(g=!0);const{offsets_x:y,offsets_y:w,offsets_xi:k,offsets_yi:M,gridWidth:A}=F({width:c,height:u},n,l,i,"majority"===o?.5:0);let U;const b=(t,e,n,l)=>{const i=t instanceof Float32Array||t instanceof Float64Array?0:.5;for(let o=0;o<d;o++){U=o*A;for(let r=0;r<m;r++){if(y[U]<0||w[U]<0)t[o*m+r]=0;else if(l)t[o*m+r]=e[k[U]+M[U]*c];else{const l=Math.floor(y[U]),s=Math.floor(w[U]),a=Math.ceil(y[U]),h=Math.ceil(w[U]),f=y[U]-l,u=w[U]-s;if(!n||n[l+s*c]&&n[a+s*c]&&n[l+h*c]&&n[a+h*c]){const n=(1-f)*e[l+s*c]+f*e[a+s*c],p=(1-f)*e[l+h*c]+f*e[a+h*c];t[o*m+r]=(1-u)*n+u*p+i}else t[o*m+r]=e[k[U]+M[U]*c]}U++}}},T=[];let v;const B=h?.length===x,C=[];for(let e=0;e<x;e++){if(B){const t=new Uint8Array(m*d);b(t,h[e],h[e],!0),C.push(t)}v=new p(m*d),b(v,s[e],B?h[e]:a,"nearest"===o||"majority"===o),T.push(v)}const P=new e({width:m,height:d,pixelType:f,pixels:T,bandMasks:B?C:void 0});if(null!=a)P.mask=new Uint8Array(m*d),b(P.mask,a,a,!0);else if(g){P.mask=new Uint8Array(m*d);for(let t=0;t<m*d;t++)P.mask[t]=y[t]<0||w[t]<0?0:1}return P.updateStatistics(),P}export{i as MissingBandAction,l as NoDataInterpretation,D as approximateTransform,W as clip,R as clipTile,f as colorize,a as compositeBands,h as createColormapLUT,M as createMaskLUT,x as createRangeMaps,k as createRemapLUT,s as extractBands,A as getClipBounds,j as getLocalArithmeticNorthRotations,F as interpolateOffsets,r as isValidPixelBlock,u as lookupBandValues,c as lookupPixels,w as mask,o as maxMapSizeGpu,T as mosaic,U as mosaicPixelData,m as remap,p as remapColor,S as resampleByMajority,B as setValidBoundary,I as split};
5
+ import{numberMaxFloat32 as t}from"../../../core/mathUtils.js";import e from"../PixelBlock.js";import{getPixelValueRange as n}from"../rasterFormats/pixelRangeUtils.js";var l,i;!function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"}(l||(l={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(i||(i={}));const o=9;function r(t){return null!=t&&t.pixels?.length>0}function s(t,e){return e?.length&&r(t)?t.extractBands(e):t}function a(t){if(!t?.length||t.some((t=>!r(t))))return null;if(1===t.length)return t[0]?.clone()??null;const n=t,{width:l,height:i,pixelType:o}=n[0];if(n.some((t=>t.width!==l||t.height!==i)))return null;const s=n.map((({mask:t})=>t)).filter((t=>null!=t));let a=null;s.length&&(a=new Uint8Array(l*i),a.set(s[0]),s.length>1&&y(s.slice(1),a));const h=[];n.forEach((({pixels:t})=>h.push(...t)));const f=n.map((({statistics:t})=>t)).filter((t=>t?.length)),c=[];return f.forEach((t=>c.push(...t))),new e({pixelType:o,width:l,height:i,mask:a,pixels:h,statistics:c.length?c:null})}function h(t){if(!t)return;const e=t.colormap;if(!e||0===e.length)return;const n=e.sort(((t,e)=>t[0]-e[0])),l=n[0][0]<0?n[0][0]:0,i=Math.max(256,n[n.length-1][0]-l+1),o=new Uint8Array(4*i),r=[],s=5===n[0].length;if(i>65536)return n.forEach((t=>{r[t[0]-l]=s?t.slice(1):t.slice(1).concat([255])})),{indexed2DColormap:r,offset:l,alphaSpecified:s};if(t.fillUnspecified){let t=n[0];for(let e=t[0]-l,r=0;e<i;e++)o[4*e]=t[1],o[4*e+1]=t[2],o[4*e+2]=t[3],o[4*e+3]=s?t[4]:255,e===t[0]-l&&(t=r===n.length-1?t:n[++r])}else for(let a=0;a<n.length;a++){const t=n[a],e=4*(t[0]-l);o[e]=t[1],o[e+1]=t[2],o[e+2]=t[3],o[e+3]=s?t[4]:255}return{indexedColormap:o,offset:l,alphaSpecified:s}}function f(t,e){if(!r(t))return t;if(!e||!e.indexedColormap&&!e.indexed2DColormap)return t;const n=t.clone(),l=n.pixels;let i=n.mask;const o=n.width*n.height;if(1!==l.length)return t;const{indexedColormap:s,indexed2DColormap:a,offset:h,alphaSpecified:f}=e,c=l[0],u=new Uint8Array(c.length),p=new Uint8Array(c.length),x=new Uint8Array(c.length);let m,d=0;if(s){const t=s.length-1;if(null!=i)for(let e=0;e<o;e++)i[e]&&(d=4*(c[e]-h),d<h||d>t?i[e]=0:(u[e]=s[d],p[e]=s[d+1],x[e]=s[d+2],i[e]=s[d+3]));else{i=new Uint8Array(o);for(let e=0;e<o;e++)d=4*(c[e]-h),d<h||d>t?i[e]=0:(u[e]=s[d],p[e]=s[d+1],x[e]=s[d+2],i[e]=s[d+3]);n.mask=i}}else if(a)if(null!=i)for(let r=0;r<o;r++)i[r]&&(m=a[c[r]],u[r]=m[0],p[r]=m[1],x[r]=m[2],i[r]=m[3]);else{i=new Uint8Array(o);for(let t=0;t<o;t++)m=a[c[t]],u[t]=m[0],p[t]=m[1],x[t]=m[2],i[t]=m[3];n.mask=i}return n.pixels=[u,p,x],n.statistics=null,n.pixelType="u8",n.maskIsAlpha=f,n}function c(t,n){if(!r(t))return null;const{pixels:l,mask:i}=t,o=l.length;let s=n.lut;const{offset:a}=n;s&&1===s[0].length&&(s=l.map((()=>s)));const h=[],f=n.outputPixelType||"u8";for(let e=0;e<o;e++){const t=u(l[e],i,s[e],a||0,f);h.push(t)}const c=new e({width:t.width,height:t.height,pixels:h,mask:i,pixelType:f});return c.updateStatistics(),c}function u(t,n,l,i,o){const r=t.length,s=e.createEmptyBand(o,r);if(n)for(let e=0;e<r;e++)n[e]&&(s[e]=l[t[e]-i]);else for(let e=0;e<r;e++)s[e]=l[t[e]-i];return s}function p(t,e){if(!r(t))return null;const n=t.clone(),{pixels:l}=n,i=n.width*n.height,o=e.length,s=Math.floor(o/2),a=e[Math.floor(s)],h=l[0],f=new Uint8Array(i),c=new Uint8Array(i),u=new Uint8Array(i);let p=n.mask;const x=4===e[0].mappedColor.length;p||(p=new Uint8Array(i),p.fill(x?255:1),n.mask=p);for(let r=0;r<i;r++)if(p[r]){const t=h[r];let n=!1,l=s,i=a,x=0,m=o-1;for(;m-x>1;){if(t===i.value){n=!0;break}t>i.value?x=l:m=l,l=Math.floor((x+m)/2),i=e[Math.floor(l)]}n||(t===e[x].value?(i=e[x],n=!0):t===e[m].value?(i=e[m],n=!0):t<e[x].value?n=!1:t>e[x].value&&(t<e[m].value?(i=e[x],n=!0):m===o-1?n=!1:(i=e[m],n=!0))),n?(f[r]=i.mappedColor[0],c[r]=i.mappedColor[1],u[r]=i.mappedColor[2],p[r]=i.mappedColor[3]):f[r]=c[r]=u[r]=p[r]=0}return n.pixels=[f,c,u],n.mask=p,n.pixelType="u8",n.maskIsAlpha=x,n}function x(e,n,l=!1){const i=1e-5,r=new Float32Array(3*o),s=n.length;for(let a=0;a<o;a++)r[3*a]=e[2*a]??t-1,r[3*a+1]=e[2*a+1]??t,r[3*a+2]=n[a]??0,a<s&&(a>0&&(r[3*a]-=i),e[2*a+1]!==e[2*a]&&(a<s-1||!l)&&(r[3*a+1]-=i));return r}function m(t,l){if(!r(t))return null;const{width:i,height:o}=t,{inputRanges:s,outputValues:a,outputPixelType:h,noDataRanges:f,allowUnmatched:c,replacementValue:u,isLastInputRangeInclusive:p}=l,x=t.pixels[0],m=e.createEmptyBand(h,x.length),d=t.mask,g=new Uint8Array(i*o);d?g.set(d):g.fill(255);const y=t.pixelType.startsWith("f")?1e-6:0,w=s.map((t=>t-y));w[0]=s[0],w[w.length-1]=s[s.length-1]+(p?1e-6:0);const k=s.length/2,[M,A]=n(h);for(let e=0;e<o;e++)for(let t=0;t<i;t++){const n=e*i+t;if(g[n]){const t=x[n];let e=!1;for(let l=k-1;l>=0;l--)if(t===s[2*l]||t>w[2*l]&&t<w[2*l+1]){m[n]=a[l],e=!0;break}e||(c?m[n]=t>A?A:t<M?M:u??t:g[n]=0)}}const U=f?.length;if(U)for(let e=0;e<o;e++)for(let t=0;t<i;t++){const n=e*i+t;if(!d||d[n]){const t=x[n];for(let e=0;e<U;e+=2)if(t>=f[e]&&t<=f[e+1]){m[n]=0,g[n]=0;break}}}return new e({width:i,height:o,pixelType:h,pixels:[m],mask:g})}function d(t,e,n,l){const i=null!=n&&n.length>=2?new Set(n):null,o=1===n?.length?n[0]:null,r=!!e?.length;for(let s=0;s<t.length;s++)if(l[s]){const n=t[s];if(r){let t=!1;for(let l=0;l<e.length;l+=2)if(n>=e[l]&&n<=e[l+1]){t=!0;break}t||(l[s]=0)}l[s]&&(n===o||i?.has(n))&&(l[s]=0)}}function g(t,e){const n=t[0].length;for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(t[e][l]){n=!0;break}n||(e[l]=0)}}function y(t,e){const n=t[0].length;for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(0===t[e][l]){n=!0;break}n&&(e[l]=0)}}function w(t,n){if(!r(t))return null;const{width:l,height:i,pixels:o}=t,s=l*i,a=new Uint8Array(s);t.mask?a.set(t.mask):a.fill(255);const h=o.length,{includedRanges:f,noDataValues:c,outputPixelType:p,matchAll:x,lookups:m}=n;if(m){const t=[];for(let e=0;e<h;e++){const n=m[e],l=u(o[e],a,n.lut,n.offset||0,"u8");t.push(l)}1===t.length?a.set(t[0]):x?g(t,a):y(t,a)}else if(x){const t=[];for(let e=0;e<h;e++){const n=new Uint8Array(s);n.set(a),d(o[e],f?.slice(2*e,2*e+2),c?.[e],n),t.push(n)}1===t.length?a.set(t[0]):g(t,a)}else for(let e=0;e<h;e++)d(o[e],f?.slice(2*e,2*e+2),c?.[e],a);return new e({width:l,height:i,pixelType:p,pixels:o,mask:a})}function k(t){const{srcPixelType:l,inputRanges:i,outputValues:o,allowUnmatched:r,noDataRanges:s,isLastInputRangeInclusive:a,outputPixelType:h}=t;if("u8"!==l&&"s8"!==l&&"u16"!==l&&"s16"!==l)return null;const f=l.includes("16")?65536:256,c=l.includes("s")?-f/2:0,u=e.createEmptyBand(h,f),p=new Uint8Array(f);r&&p.fill(255);const[x,m]=n(h);if(i?.length&&o?.length){const t=1e-6,e=i.map((e=>e-t));e[0]=i[0],a&&(e[e.length-1]=i[i.length-1]);for(let n=0;n<e.length;n++){const t=o[n]>m?m:o[n]<x?x:o[n],l=Math.ceil(e[2*n]-c),r=i[2*n+1]===i[2*n]?l:Math.floor(e[2*n+1]-c);for(let e=l;e<=r;e++)u[e]=t,p[e]=255}}if(s?.length)for(let e=0;e<s.length;e++){const t=Math.ceil(s[2*e]-c),n=Math.floor(s[2*e+1]-c);for(let e=t;e<=n;e++)p[e]=0}return{lut:u,offset:c,mask:p}}function M(t,e,n){if("u8"!==t&&"s8"!==t&&"u16"!==t&&"s16"!==t)return null;const l=t.includes("16")?65536:256,i=t.includes("s")?-l/2:0,o=new Uint8Array(l);if(e)for(let r=0;r<e.length;r++){const t=Math.ceil(e[2*r]-i),n=Math.floor(e[2*r+1]-i);for(let e=t;e<=n;e++)o[e]=255}else o.fill(255);if(n)for(let r=0;r<n.length;r++)o[n[r]-i]=0;return{lut:o,offset:i}}function A(t,e,n,l,i,o,r,s){return{xmin:i<=n*t?0:i<n*t+t?i-n*t:t,ymin:o<=l*e?0:o<l*e+e?o-l*e:e,xmax:i+r<=n*t?0:i+r<n*t+t?i+r-n*t:t,ymax:o+s<=l*e?0:o+s<l*e+e?o+s-l*e:e}}function U(t,e){if(!t||0===t.length)return null;const n=t.find((t=>t.pixelBlock));if(null==n?.pixelBlock)return null;const l=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,i=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,o=.01*Math.min(l,i),r=t.sort(((t,e)=>Math.abs(t.extent.ymax-e.extent.ymax)>o?e.extent.ymax-t.extent.ymax:Math.abs(t.extent.xmin-e.extent.xmin)>o?t.extent.xmin-e.extent.xmin:0)),s=Math.min.apply(null,r.map((t=>t.extent.xmin))),a=Math.min.apply(null,r.map((t=>t.extent.ymin))),h=Math.max.apply(null,r.map((t=>t.extent.xmax))),f=Math.max.apply(null,r.map((t=>t.extent.ymax))),c={x:Math.round((e.xmin-s)/l),y:Math.round((f-e.ymax)/i)},u={width:Math.round((h-s)/l),height:Math.round((f-a)/i)},p={width:Math.round((e.xmax-e.xmin)/l),height:Math.round((e.ymax-e.ymin)/i)};if(Math.round(u.width/n.pixelBlock.width)*Math.round(u.height/n.pixelBlock.height)!==r.length||c.x<0||c.y<0||u.width<p.width||u.height<p.height)return null;return{extent:e,pixelBlock:T(r.map((t=>t.pixelBlock)),u,{clipOffset:c,clipSize:p})}}function b(t,e,n,l,i,o){const{width:r,height:s}=n.block,{x:a,y:h}=n.offset,{width:f,height:c}=n.mosaic,u=A(r,s,l,i,a,h,f,c);let p=0,x=0;if(o){const t=o.hasGCSSShiftTransform?360:o.halfWorldWidth??0,e=r*o.resolutionX,n=o.startX+l*e;n<t&&n+e>t?x=o.rightPadding:n>=t&&(p=o.leftMargin-o.rightPadding,x=0)}if(u.xmax-=x,"number"!=typeof e)for(let m=u.ymin;m<u.ymax;m++){const n=(i*s+m-h)*f+(l*r-a)+p,o=m*r;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e[o+l]}else for(let m=u.ymin;m<u.ymax;m++){const n=(i*s+m-h)*f+(l*r-a)+p;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e}}function T(t,n,l={}){const{clipOffset:i,clipSize:o,alignmentInfo:s,blockWidths:a}=l;if(a)return v(t,n,{blockWidths:a});const h=t.find((t=>r(t)));if(null==h)return null;const f=o?o.width:n.width,c=o?o.height:n.height,u=h.width,p=h.height,x=n.width/u,m=n.height/p,d={offset:i||{x:0,y:0},mosaic:o||n,block:{width:u,height:p}},g=h.pixelType,y=e.getPixelArrayConstructor(g),w=h.pixels.length,k=[];let M,A;for(let e=0;e<w;e++){A=new y(f*c);for(let n=0;n<m;n++)for(let l=0;l<x;l++){const i=t[n*x+l];r(i)&&(M=i.pixels[e],b(A,M,d,l,n,s))}k.push(A)}const U=t.some((t=>null==t||null!=t.mask&&t.mask.length>0)),T=t.some((t=>t?.bandMasks&&t.bandMasks.length>1)),B=U?new Uint8Array(f*c):void 0,S=T?[]:void 0;if(B){for(let e=0;e<m;e++)for(let n=0;n<x;n++){const l=t[e*x+n],i=null!=l?l.mask:null;b(B,null!=i?i:l?255:0,d,n,e,s)}if(S)for(let e=0;e<w;e++){const n=new Uint8Array(f*c);for(let l=0;l<m;l++)for(let i=0;i<x;i++){const o=t[l*x+i],r=o?.bandMasks?.[e]??o?.mask;b(n,null!=r?r:o?255:0,d,i,l,s)}S.push(n)}}const C=new e({width:f,height:c,pixels:k,pixelType:g,bandMasks:S,mask:B});return C.updateStatistics(),C}function v(t,n,l){const i=t.find((t=>null!=t));if(null==i)return null;const o=t.some((t=>null==t||!!t.mask)),{width:s,height:a}=n,h=o?new Uint8Array(s*a):null,{blockWidths:f}=l,c=[],u=i.getPlaneCount(),p=e.getPixelArrayConstructor(i.pixelType);if(o)for(let e=0,y=0;e<t.length;y+=f[e],e++){const n=t[e];if(!r(n))continue;const l=n.mask;for(let t=0;t<a;t++)for(let i=0;i<f[e];i++)h[t*s+i+y]=null==l?255:l[t*n.width+i]}const x=t.some((t=>t?.bandMasks&&t.bandMasks.length>1)),m=x?[]:void 0,d=s*a;for(let e=0;e<u;e++){const n=new p(d),l=x?new Uint8Array(d):void 0;for(let i=0,o=0;i<t.length;o+=f[i],i++){const h=t[i];if(!r(h))continue;const c=h.pixels[e];if(null!=c){for(let t=0;t<a;t++)for(let e=0;e<f[i];e++)n[t*s+e+o]=c[t*h.width+e];if(l){const t=h.bandMasks?.[e]??h.mask;for(let e=0;e<a;e++)for(let n=0;n<f[i];n++)l[e*s+n+o]=t?t[e*h.width+n]:255}}}c.push(n),m&&l&&m.push(l)}const g=new e({width:s,height:a,mask:h,bandMasks:m,pixels:c,pixelType:i.pixelType});return g.updateStatistics(),g}function B(t,e,n){if(!r(t))return null;const{width:l,height:i}=t,o=e.x,s=e.y,a=n.width+o,h=n.height+s;if(o<0||s<0||a>l||h>i)return t;if(0===o&&0===s&&a===l&&h===i)return t;t.mask||(t.mask=new Uint8Array(l*i));const f=t.mask;for(let r=0;r<i;r++){const t=r*l;for(let e=0;e<l;e++)f[t+e]=r<s||r>=h||e<o||e>=a?0:1}return t.updateStatistics(),t}function S(t){if(!r(t))return null;const e=t.clone(),{width:n,height:l,pixels:i}=t,o=i[0],s=e.pixels[0],a=t.mask;for(let r=2;r<l-1;r++){const t=new Map;for(let l=r-2;l<r+2;l++)for(let e=0;e<4;e++){const i=l*n+e;_(t,o[i],a?a[i]:1)}s[r*n]=C(t),s[r*n+1]=s[r*n+2]=s[r*n];let e=3;for(;e<n-1;e++){let l=(r-2)*n+e+1;_(t,o[l],a?a[l]:1),l=(r-1)*n+e+1,_(t,o[l],a?a[l]:1),l=r*n+e+1,_(t,o[l],a?a[l]:1),l=(r+1)*n+e+1,_(t,o[l],a?a[l]:1),l=(r-2)*n+e-3,P(t,o[l],a?a[l]:1),l=(r-1)*n+e-3,P(t,o[l],a?a[l]:1),l=r*n+e-3,P(t,o[l],a?a[l]:1),l=(r+1)*n+e-3,P(t,o[l],a?a[l]:1),s[r*n+e]=C(t)}s[r*n+e+1]=s[r*n+e]}for(let r=0;r<n;r++)s[r]=s[n+r]=s[2*n+r],s[(l-1)*n+r]=s[(l-2)*n+r];return e.updateStatistics(),e}function C(t){if(0===t.size)return 0;let e=0,n=-1,l=0;const i=t.keys();let o=i.next();for(;!o.done;)l=t.get(o.value),l>e&&(n=o.value,e=l),o=i.next();return n}function P(t,e,n){if(0===n)return;const l=t.get(e);1===l?t.delete(e):t.set(e,l-1)}function _(t,e,n){0!==n&&t.set(e,t.has(e)?t.get(e)+1:1)}function W(t,n,l){let{x:i,y:o}=n;const{width:s,height:a}=l;if(0===i&&0===o&&a===t.height&&s===t.width)return t;const{width:h,height:f}=t,c=Math.max(0,o),u=Math.max(0,i),p=Math.min(i+s,h),x=Math.min(o+a,f);if(p<0||x<0||!r(t))return null;i=Math.max(0,-i),o=Math.max(0,-o);const{pixels:m}=t,d=s*a,g=m.length,y=[];for(let r=0;r<g;r++){const n=m[r],l=e.createEmptyBand(t.pixelType,d);for(let t=c;t<x;t++){const e=t*h;let r=(t+o-c)*s+i;for(let t=u;t<p;t++)l[r++]=n[e+t]}y.push(l)}const w=new Uint8Array(d),k=t.mask;for(let e=c;e<x;e++){const t=e*h;let n=(e+o-c)*s+i;for(let e=u;e<p;e++)w[n++]=k?k[t+e]:1}const M=new e({width:l.width,height:l.height,pixelType:t.pixelType,pixels:y,mask:w});return M.updateStatistics(),M}function E(t,n=!0){if(!r(t))return null;const{pixels:l,width:i,height:o,mask:s,pixelType:a}=t,h=[],f=Math.round(i/2),c=Math.round(o/2),u=o-1,p=i-1;for(let r=0;r<l.length;r++){const t=l[r],s=e.createEmptyBand(a,f*c);let x=0;for(let e=0;e<o;e+=2)for(let l=0;l<i;l+=2){const o=t[e*i+l];if(n){const n=l===p?o:t[e*i+l+1],r=e===u?o:t[e*i+l+i],a=l===p?r:e===u?n:t[e*i+l+i+1];s[x++]=(o+n+r+a)/4}else s[x++]=o}h.push(s)}let x=null;if(null!=s){x=new Uint8Array(f*c);let t=0;for(let e=0;e<o;e+=2)for(let l=0;l<i;l+=2){const o=s[e*i+l];if(n){const n=l===p?o:s[e*i+l+1],r=e===u?o:s[e*i+l+i],a=l===p?r:e===u?n:s[e*i+l+i+1];x[t++]=o*n*r*a?1:0}else x[t++]=o}}return new e({width:f,height:c,pixelType:a,pixels:h,mask:x})}function I(t,e,n=0,l=!0){if(!r(t))return null;const{width:i,height:o}=e;let{width:s,height:a}=t;const h=new Map,f={x:0,y:0},c=1+n;let u=t;for(let r=0;r<c;r++){const t=Math.ceil(s/i),n=Math.ceil(a/o);for(let l=0;l<n;l++){f.y=l*o;for(let n=0;n<t;n++){f.x=n*i;const t=W(u,f,e);h.set(`${r}/${l}/${n}`,t)}}r<c-1&&(u=E(u,l)),s=Math.round(s/2),a=Math.round(a/2)}return h}function R(t){const{pixelBlock:e,tileSize:n,level:l,row:i,col:o,useBilinear:s}=t;if(!r(e))return null;const{width:a,height:h}=n,f=2**l,c=f*a,u=f*h;let p=W(e,{y:i*u,x:o*c},{width:c,height:u});if(!p)return null;for(let r=l;r>0;r--)p=E(p,s);return p}function F(t,e,n,l,i=0){const{width:o,height:r}=t,{width:s,height:a}=e,h=l.cols,f=l.rows,c=Math.ceil(s/h-.1/h),u=Math.ceil(a/f-.1/f);let p,x,m,d,g,y,w;const k=c*h,M=k*u*f,A=new Float32Array(M),U=new Float32Array(M),b=new Uint32Array(M),T=new Uint32Array(M);let v,B,S=0;for(let C=0;C<u;C++)for(let t=0;t<c;t++){p=12*(C*c+t),x=n[p],m=n[p+1],d=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){S=(C*f+e)*k+t*h,B=(e+.5)/f;for(let t=0;t<e;t++)v=(t+.5)/h,A[S+t]=(x*v+m*B+d)*o+i,U[S+t]=(g*v+y*B+w)*r+i,b[S+t]=Math.floor(A[S+t]),T[S+t]=Math.floor(U[S+t])}p+=6,x=n[p],m=n[p+1],d=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){S=(C*f+e)*k+t*h,B=(e+.5)/f;for(let t=e;t<h;t++)v=(t+.5)/h,A[S+t]=(x*v+m*B+d)*o+i,U[S+t]=(g*v+y*B+w)*r+i,b[S+t]=Math.floor(A[S+t]),T[S+t]=Math.floor(U[S+t])}}return{offsets_x:A,offsets_y:U,offsets_xi:b,offsets_yi:T,gridWidth:k}}function j(t,e){const{coefficients:n,spacing:l}=e,{offsets_x:i,offsets_y:o,gridWidth:r}=F(t,t,n,{rows:l[0],cols:l[1]}),{width:s,height:a}=t,h=new Float32Array(s*a),f=180/Math.PI;for(let c=0;c<a;c++)for(let t=0;t<s;t++){const e=c*r+t,n=0===c?e:e-r,l=c===a-1?e:e+r,u=i[n]-i[l],p=o[l]-o[n];if(isNaN(u)||isNaN(p))h[c*s+t]=90;else{let e=Math.atan2(p,u)*f;e=(360+e)%360,h[c*s+t]=e}}return h}function D(t,n,l,i,o="nearest"){if(!r(t))return null;"majority"===o&&(t=S(t));const{pixels:s,mask:a,bandMasks:h,pixelType:f}=t,c=t.width,u=t.height,p=e.getPixelArrayConstructor(f),x=s.length,{width:m,height:d}=n;let g=!1;for(let e=0;e<l.length;e+=3)-1===l[e]&&-1===l[e+1]&&-1===l[e+2]&&(g=!0);const{offsets_x:y,offsets_y:w,offsets_xi:k,offsets_yi:M,gridWidth:A}=F({width:c,height:u},n,l,i,"majority"===o?.5:0);let U;const b=(t,e,n,l)=>{const i=t instanceof Float32Array||t instanceof Float64Array?0:.5;for(let o=0;o<d;o++){U=o*A;for(let r=0;r<m;r++){if(y[U]<0||w[U]<0)t[o*m+r]=0;else if(l)t[o*m+r]=e[k[U]+M[U]*c];else{const l=Math.floor(y[U]),s=Math.floor(w[U]),a=Math.ceil(y[U]),h=Math.ceil(w[U]),f=y[U]-l,u=w[U]-s;if(!n||n[l+s*c]&&n[a+s*c]&&n[l+h*c]&&n[a+h*c]){const n=(1-f)*e[l+s*c]+f*e[a+s*c],p=(1-f)*e[l+h*c]+f*e[a+h*c];t[o*m+r]=(1-u)*n+u*p+i}else t[o*m+r]=e[k[U]+M[U]*c]}U++}}},T=[];let v;const B=h?.length===x,C=[];for(let e=0;e<x;e++){if(B){const t=new Uint8Array(m*d);b(t,h[e],h[e],!0),C.push(t)}v=new p(m*d),b(v,s[e],B?h[e]:a,"nearest"===o||"majority"===o),T.push(v)}const P=new e({width:m,height:d,pixelType:f,pixels:T,bandMasks:B?C:void 0});if(null!=a)P.mask=new Uint8Array(m*d),b(P.mask,a,a,!0);else if(g){P.mask=new Uint8Array(m*d);for(let t=0;t<m*d;t++)P.mask[t]=y[t]<0||w[t]<0?0:1}return P.updateStatistics(),P}export{i as MissingBandAction,l as NoDataInterpretation,D as approximateTransform,W as clip,R as clipTile,f as colorize,a as compositeBands,h as createColormapLUT,M as createMaskLUT,x as createRangeMaps,k as createRemapLUT,s as extractBands,A as getClipBounds,j as getLocalArithmeticNorthRotations,F as interpolateOffsets,r as isValidPixelBlock,u as lookupBandValues,c as lookupPixels,w as mask,o as maxMapSizeGpu,T as mosaic,U as mosaicPixelData,m as remap,p as remapColor,S as resampleByMajority,B as setValidBoundary,I as split};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../core/has.js";import{isHostedAgolService as t,parse as s}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as e}from"./infoFor3D.js";import{readNumber as r,readBoolean as p}from"../../rest/support/jsonUtils.js";const o={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function u(t){const s=t?.supportedSpatialAggregationStatistics?.map((t=>t.toLowerCase()));return{envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function n(t,s){const e=t?.supportedOperationsWithCacheHint?.map((t=>t.toLowerCase()));return!!e?.includes(s.toLowerCase())}function i(t){const s=t?.supportedStatisticTypes?.map((t=>t.toLowerCase()));return{count:!!s?.includes("count"),sum:!!s?.includes("sum"),min:!!s?.includes("min"),max:!!s?.includes("max"),avg:!!s?.includes("avg"),var:!!s?.includes("var"),stddev:!!s?.includes("stddev"),percentileContinuous:!!s?.includes("percentile_cont"),percentileDiscrete:!!s?.includes("percentile_disc"),envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function a(t){const s=t?.supportedNormalizationTypes?.map((t=>t.toLowerCase()));return{field:!!s?.includes("field"),log:!!s?.includes("log"),naturalLog:!!s?.includes("naturallog"),percentOfTotal:!!s?.includes("percentoftotal"),squareRoot:!!s?.includes("squareroot")}}function c(t,s){return{analytics:l(t),attachment:d(t),data:y(t),metadata:m(t),operations:C(t.capabilities,t,s),query:g(t,s),queryAttributeBins:S(t),queryRelated:v(t),queryTopFeatures:h(t),editing:f(t)}}function l(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryAnalytics")}}function d(t){const s=t.attachmentProperties,e={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:n(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:p(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:p(t,"supportsAttachmentsResizing",!1)};return s&&Array.isArray(s)&&s.forEach((t=>{const s=o[t.name];s&&(e[s]=!!t.isEnabled)})),e}function y(t){return{isVersioned:p(t,"isDataVersioned",!1),isBranchVersioned:p(t,"isDataBranchVersioned",!1),supportsAttachment:p(t,"hasAttachments",!1),supportsM:p(t,"hasM",!1),supportsZ:p(t,"hasZ",!1)}}function m(t){return{supportsAdvancedFieldProperties:p(t,"supportsFieldDescriptionProperty",!1)}}function C(t,e,r){const o=t?.toLowerCase().split(",").map((t=>t.trim()))??[],u=r?s(r):null,n=o.includes("MapServer"===u?.serverType?"data":"query"),i=o.includes("editing")&&!e.datesInUnknownTimezone&&!(!0===e.uniqueIdInfo?.OIDFieldContainsHashValue);let a=i&&o.includes("create"),c=i&&o.includes("delete"),l=i&&o.includes("update");const d=o.includes("changetracking"),y=e.advancedQueryCapabilities;return i&&!(a||c||l)&&(a=c=l=!0),{supportsCalculate:p(e,"supportsCalculate",!1),supportsTruncate:p(e,"supportsTruncate",!1),supportsValidateSql:p(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:c,supportsEditing:i,supportsChangeTracking:d,supportsQuery:n,supportsQueryAnalytics:p(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:p(y,"supportsQueryAttachments",!1),supportsQueryBins:p(y,"supportsQueryBins",!1),supportsQueryTopFeatures:p(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:p(e,"supportsAttachmentsResizing",!1),supportsSync:o.includes("sync"),supportsUpdate:l,supportsExceedsLimitStatistics:p(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:p(e,"supportsAsyncConvert3D",!1)}}function g(s,o){const i=s.advancedQueryCapabilities,a=s.ownershipBasedAccessControlForFeatures,c=s.archivingInfo,l=s.currentVersion,d=o?.includes("MapServer"),y=!d||l>=has("mapserver-pbf-version-support"),m=t(o),C=new Set((s.supportedQueryFormats??"").split(",").map((t=>t.toLowerCase().trim())));return{maxRecordCount:r(s,"maxRecordCount",void 0),maxRecordCountFactor:r(s,"maxRecordCountFactor",void 0),maxUniqueIDCount:r(s,"maxUniqueIDCount",void 0),standardMaxRecordCount:r(s,"standardMaxRecordCount",void 0),supportedSpatialAggregationStatistics:u(i),supportsCacheHint:p(i,"supportsQueryWithCacheHint",!1)||n(i,"query"),supportsCentroid:p(i,"supportsReturningGeometryCentroid",!1),supportsCompactGeometry:m,supportsCurrentUser:p(i,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:p(i,"supportsDefaultSR",!1),supportsDisjointSpatialRelationship:p(i,"supportsDisjointSpatialRel",!1),supportsDistance:p(i,"supportsQueryWithDistance",!1),supportsDistinct:p(i,"supportsDistinct",s.supportsAdvancedQueries),supportsExtent:p(i,"supportsReturningQueryExtent",!1),supportsFormatPBF:y&&C.has("pbf"),supportsFullTextSearch:p(i,"supportsFullTextSearch",!1),supportsGeometryProperties:p(i,"supportsReturningGeometryProperties",!1),supportsHavingClause:p(i,"supportsHavingClause",!1),supportsHistoricMoment:p(c,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:p(i,"supportsMaxRecordCountFactor",!1),supportsOrderBy:p(i,"supportsOrderBy",s.supportsAdvancedQueries),supportsPagination:p(i,"supportsPagination",!1),supportsPercentileStatistics:p(i,"supportsPercentileStatistics",!1),supportsQuantization:p(s,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:p(s,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:p(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:p(a,"allowOthersToQuery",!0),supportsQueryGeometry:p(s,"supportsReturningQueryGeometry",!1),supportsResultType:p(i,"supportsQueryWithResultType",!1),supportsReturnMesh:!!e(s.infoFor3D),supportsSpatialAggregationStatistics:p(i,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:p(i,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:p(s,"useStandardizedQueries",!1),supportsStatistics:p(i,"supportsStatistics",s.supportsStatistics),supportsTopFeaturesQuery:p(i,"supportsTopFeaturesQuery",!1),supportsTrueCurve:p(i,"supportsTrueCurve",!1),tileMaxRecordCount:r(s,"tileMaxRecordCount",void 0)}}function v(t){const s=t.advancedQueryCapabilities,e=p(s,"supportsAdvancedQueryRelated",!1);return{supportsPagination:p(s,"supportsQueryRelatedPagination",!1),supportsCount:e,supportsOrderBy:e,supportsCacheHint:n(s,"queryRelated")}}function h(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryTopFilter")}}function S(t){const s=t?t.queryBinsCapabilities:void 0;return{supportsDate:p(s,"supportsDateBin",!1),supportsFixedInterval:p(s,"supportsFixedIntervalBin",!1),supportsAutoInterval:p(s,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:p(s,"supportsFixedBoundariesBin",!1),supportsStackBy:p(s,"supportsStackBy",!1),supportsSplitBy:p(s,"supportsSplitBy",!1),supportsSnapToData:p(s,"supportsSnapToData",!1),supportsReturnFullIntervalBin:p(s,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:p(s,"supportsFirstDayOfWeek",!1),supportsNormalization:p(s,"supportsNormalization",!1),supportedStatistics:i(s),supportedNormalizationTypes:a(s)}}function f(t){const s=t.ownershipBasedAccessControlForFeatures,e=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:p(t,"allowGeometryUpdates",!0),supportsGlobalId:p(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:p(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:p(t,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:p(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:p(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:p(s,"allowAnonymousToDelete",!0),supportsDeleteByOthers:p(s,"allowOthersToDelete",!0),supportsUpdateByAnonymous:p(s,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:p(s,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:p(e,"supportsAsyncApplyEdits",!1),zDefault:r(t,"zDefault",void 0)}}function A(t){return{operations:{supportsAppend:p(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:p(t,"supportsExportClip",!1),supportsExportFrameset:p(t,"supportsExportFrameset",!1),supportsMensuration:p(t,"supportsMensuration",!1),supportsPreviews:p(t,"supportsPreviews",!1),supportsUpdate:p(t,"supportsUpdate",!1)}}}export{c as getFeatureLayerCapabilities,A as getVideoLayerCapabilities};
5
+ import has from"../../core/has.js";import{isHostedAgolService as t,parse as s}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as e}from"./infoFor3D.js";import{readNumber as r,readBoolean as p}from"../../rest/support/jsonUtils.js";const o={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function u(t){const s=t?.supportedSpatialAggregationStatistics?.map((t=>t.toLowerCase()));return{envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function n(t,s){const e=t?.supportedOperationsWithCacheHint?.map((t=>t.toLowerCase()));return!!e?.includes(s.toLowerCase())}function i(t){const s=t?.supportedStatisticTypes?.map((t=>t.toLowerCase()));return{count:!!s?.includes("count"),sum:!!s?.includes("sum"),min:!!s?.includes("min"),max:!!s?.includes("max"),avg:!!s?.includes("avg"),var:!!s?.includes("var"),stddev:!!s?.includes("stddev"),percentileContinuous:!!s?.includes("percentile_cont"),percentileDiscrete:!!s?.includes("percentile_disc"),envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function a(t){const s=t?.supportedNormalizationTypes?.map((t=>t.toLowerCase()));return{field:!!s?.includes("field"),log:!!s?.includes("log"),naturalLog:!!s?.includes("naturallog"),percentOfTotal:!!s?.includes("percentoftotal"),squareRoot:!!s?.includes("squareroot")}}function c(t,s){return{analytics:l(t),attachment:d(t),data:y(t),metadata:m(t),operations:C(t.capabilities,t,s),query:g(t,s),queryAttributeBins:S(t),queryRelated:v(t),queryTopFeatures:h(t),editing:f(t)}}function l(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryAnalytics")}}function d(t){const s=t.attachmentProperties,e={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:n(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:p(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:p(t,"supportsAttachmentsResizing",!1)};return s&&Array.isArray(s)&&s.forEach((t=>{const s=o[t.name];s&&(e[s]=!!t.isEnabled)})),e}function y(t){return{isVersioned:p(t,"isDataVersioned",!1),isBranchVersioned:p(t,"isDataBranchVersioned",!1),supportsAttachment:p(t,"hasAttachments",!1),supportsM:p(t,"hasM",!1),supportsZ:p(t,"hasZ",!1)}}function m(t){return{supportsAdvancedFieldProperties:p(t,"supportsFieldDescriptionProperty",!1)}}function C(t,e,r){const o=t?.toLowerCase().split(",").map((t=>t.trim()))??[],u=r?s(r):null,n=o.includes("MapServer"===u?.serverType?"data":"query"),i=o.includes("editing")&&!e.datesInUnknownTimezone&&!(!0===e.uniqueIdInfo?.OIDFieldContainsHashValue);let a=i&&o.includes("create"),c=i&&o.includes("delete"),l=i&&o.includes("update");const d=o.includes("changetracking"),y=e.advancedQueryCapabilities;return i&&!(a||c||l)&&(a=c=l=!0),{supportsCalculate:p(e,"supportsCalculate",!1),supportsTruncate:p(e,"supportsTruncate",!1),supportsValidateSql:p(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:c,supportsEditing:i,supportsChangeTracking:d,supportsQuery:n,supportsQueryAnalytics:p(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:p(y,"supportsQueryAttachments",!1),supportsQueryBins:p(y,"supportsQueryBins",!1)||!!e.queryBinsCapabilities,supportsQueryTopFeatures:p(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:p(e,"supportsAttachmentsResizing",!1),supportsSync:o.includes("sync"),supportsUpdate:l,supportsExceedsLimitStatistics:p(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:p(e,"supportsAsyncConvert3D",!1)}}function g(s,o){const i=s.advancedQueryCapabilities,a=s.ownershipBasedAccessControlForFeatures,c=s.archivingInfo,l=s.currentVersion,d=o?.includes("MapServer"),y=!d||l>=has("mapserver-pbf-version-support"),m=t(o),C=new Set((s.supportedQueryFormats??"").split(",").map((t=>t.toLowerCase().trim())));return{maxRecordCount:r(s,"maxRecordCount",void 0),maxRecordCountFactor:r(s,"maxRecordCountFactor",void 0),maxUniqueIDCount:r(s,"maxUniqueIDCount",void 0),standardMaxRecordCount:r(s,"standardMaxRecordCount",void 0),supportedSpatialAggregationStatistics:u(i),supportsCacheHint:p(i,"supportsQueryWithCacheHint",!1)||n(i,"query"),supportsCentroid:p(i,"supportsReturningGeometryCentroid",!1),supportsCompactGeometry:m,supportsCurrentUser:p(i,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:p(i,"supportsDefaultSR",!1),supportsDisjointSpatialRelationship:p(i,"supportsDisjointSpatialRel",!1),supportsDistance:p(i,"supportsQueryWithDistance",!1),supportsDistinct:p(i,"supportsDistinct",s.supportsAdvancedQueries),supportsExtent:p(i,"supportsReturningQueryExtent",!1),supportsFormatPBF:y&&C.has("pbf"),supportsFullTextSearch:p(i,"supportsFullTextSearch",!1),supportsGeometryProperties:p(i,"supportsReturningGeometryProperties",!1),supportsHavingClause:p(i,"supportsHavingClause",!1),supportsHistoricMoment:p(c,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:p(i,"supportsMaxRecordCountFactor",!1),supportsOrderBy:p(i,"supportsOrderBy",s.supportsAdvancedQueries),supportsPagination:p(i,"supportsPagination",!1),supportsPercentileStatistics:p(i,"supportsPercentileStatistics",!1),supportsQuantization:p(s,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:p(s,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:p(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:p(a,"allowOthersToQuery",!0),supportsQueryGeometry:p(s,"supportsReturningQueryGeometry",!1),supportsResultType:p(i,"supportsQueryWithResultType",!1),supportsReturnMesh:!!e(s.infoFor3D),supportsSpatialAggregationStatistics:p(i,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:p(i,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:p(s,"useStandardizedQueries",!1),supportsStatistics:p(i,"supportsStatistics",s.supportsStatistics),supportsTopFeaturesQuery:p(i,"supportsTopFeaturesQuery",!1),supportsTrueCurve:p(i,"supportsTrueCurve",!1),tileMaxRecordCount:r(s,"tileMaxRecordCount",void 0)}}function v(t){const s=t.advancedQueryCapabilities,e=p(s,"supportsAdvancedQueryRelated",!1);return{supportsPagination:p(s,"supportsQueryRelatedPagination",!1),supportsCount:e,supportsOrderBy:e,supportsCacheHint:n(s,"queryRelated")}}function h(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryTopFilter")}}function S(t){const s=t?t.queryBinsCapabilities:void 0;return{supportsDate:p(s,"supportsDateBin",!1),supportsFixedInterval:p(s,"supportsFixedIntervalBin",!1),supportsAutoInterval:p(s,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:p(s,"supportsFixedBoundariesBin",!1),supportsStackBy:p(s,"supportsStackBy",!1),supportsSplitBy:p(s,"supportsSplitBy",!1),supportsSnapToData:p(s,"supportsSnapToData",!1),supportsReturnFullIntervalBin:p(s,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:p(s,"supportsFirstDayOfWeek",!1),supportsNormalization:p(s,"supportsNormalization",!1),supportedStatistics:i(s),supportedNormalizationTypes:a(s)}}function f(t){const s=t.ownershipBasedAccessControlForFeatures,e=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:p(t,"allowGeometryUpdates",!0),supportsGlobalId:p(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:p(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:p(t,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:p(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:p(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:p(s,"allowAnonymousToDelete",!0),supportsDeleteByOthers:p(s,"allowOthersToDelete",!0),supportsUpdateByAnonymous:p(s,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:p(s,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:p(e,"supportsAsyncApplyEdits",!1),zDefault:r(t,"zDefault",void 0)}}function A(t){return{operations:{supportsAppend:p(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:p(t,"supportsExportClip",!1),supportsExportFrameset:p(t,"supportsExportFrameset",!1),supportsMensuration:p(t,"supportsMensuration",!1),supportsPreviews:p(t,"supportsPreviews",!1),supportsUpdate:p(t,"supportsUpdate",!1)}}}export{c as getFeatureLayerCapabilities,A as getVideoLayerCapabilities};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250513",
3
+ "version": "4.33.0-next.20250514",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{verifyBasicFieldValidity as i,verifyFilterValidity as s}from"./support/utils.js";import{verifyBinningParams as r}from"../support/binningUtils.js";import{getFieldsList as a}from"../support/utils.js";import{binningCapableLayerTypes as n,defaultSupportedLayerTypes as t,createLayerAdapter as l,getLayerTypeLabels as o}from"../support/adapters/support/layerUtils.js";async function u(u){if(!u?.layer||!u.field&&!u.valueExpression)throw new e("unique-values:missing-parameters","'layer' and 'field' or 'valueExpression' parameters are required");const p=u.valueExpression||u.sqlExpression,f=p&&!u.sqlExpression;if(p)if(f){if(!u.view)throw new e("unique-values:missing-parameters","View is required when 'valueExpression' is specified")}else if(!u.valueExpression)throw new e("unique-values:missing-parameters","'valueExpression' parameters are required");u.forBinning&&r(u,"unique-values");const{layer:m,...d}=u,v=u.forBinning?n:t,w=l(m,v,u.forBinning);if(!w)throw new e("unique-values:invalid-parameters","'layer' must be one of these types: "+o(v).join(", "));const c={layerAdapter:w,...d},q=null!=c.signal?{signal:c.signal}:null;await w.load(q);const x=await a({field:c.field,field2:c.field2,field3:c.field3,valueExpression:c.valueExpression}),y=i(w,x,"unique-values:invalid-parameters");if(y)throw y;c.filter&&!c.filter.spatialRelationship&&(c.filter.spatialRelationship="intersects");const E=s(c.filter,"summary-statistics:invalid-parameters");if(E)throw E;return c}async function p(e){const{layerAdapter:i,...s}=await u(e);return i.uniqueValues(s)}export{p as default};
5
+ import e from"../../core/Error.js";import{verifyBasicFieldValidity as i,verifyFilterValidity as s}from"./support/utils.js";import{verifyBinningParams as r}from"../support/binningUtils.js";import{getFieldsList as a}from"../support/utils.js";import{defaultSupportedLayerTypes as n,LayerType as t,binningCapableLayerTypes as l,createLayerAdapter as o,getLayerTypeLabels as u}from"../support/adapters/support/layerUtils.js";async function p(p){if(!p?.layer||!p.field&&!p.valueExpression)throw new e("unique-values:missing-parameters","'layer' and 'field' or 'valueExpression' parameters are required");const f=p.valueExpression||p.sqlExpression,m=f&&!p.sqlExpression;if(f)if(m){if(!p.view)throw new e("unique-values:missing-parameters","View is required when 'valueExpression' is specified")}else if(!p.valueExpression)throw new e("unique-values:missing-parameters","'valueExpression' parameters are required");p.forBinning&&r(p,"unique-values");const{layer:d,...v}=p,w=[...n,t.ImageryLayer],c=p.forBinning?l:w,y=o(d,c,p.forBinning);if(!y)throw new e("unique-values:invalid-parameters","'layer' must be one of these types: "+u(c).join(", "));const q={layerAdapter:y,...v},g=null!=q.signal?{signal:q.signal}:null;await y.load(g);const x=await a({field:q.field,field2:q.field2,field3:q.field3,valueExpression:q.valueExpression}),E=i(y,x,"unique-values:invalid-parameters");if(E)throw E;q.filter&&!q.filter.spatialRelationship&&(q.filter.spatialRelationship="intersects");const h=s(q.filter,"summary-statistics:invalid-parameters");if(h)throw h;return q}async function f(e){const{layerAdapter:i,...s}=await p(e);return i.uniqueValues(s)}export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../CSVLayerAdapter.js";import a from"../FeatureLayerAdapter.js";import r from"../FeatureLayerBinningAdapter.js";import t from"../InMemoryLayerAdapter.js";import y from"../LayerAdapter.js";import o from"../PointCloudLayerAdapter.js";import L from"../SceneLayerAdapter.js";import p from"../StreamLayerAdapter.js";var l;!function(e){e[e.CatalogLayer=0]="CatalogLayer",e[e.CatalogFootprintLayer=1]="CatalogFootprintLayer",e[e.CSVLayer=2]="CSVLayer",e[e.FeatureLayer=3]="FeatureLayer",e[e.GeoJSONLayer=4]="GeoJSONLayer",e[e.KnowledgeGraphSublayer=5]="KnowledgeGraphSublayer",e[e.OGCFeatureLayer=6]="OGCFeatureLayer",e[e.OrientedImageryLayer=7]="OrientedImageryLayer",e[e.ParquetLayer=8]="ParquetLayer",e[e.PointCloudLayer=9]="PointCloudLayer",e[e.SceneLayer=10]="SceneLayer",e[e.StreamLayer=11]="StreamLayer",e[e.SubtypeGroupLayer=12]="SubtypeGroupLayer",e[e.SubtypeSublayer=13]="SubtypeSublayer",e[e.WFSLayer=14]="WFSLayer"}(l||(l={}));const u={[l.CatalogLayer]:{adapter:a,type:"catalog",label:"CatalogLayer"},[l.CatalogFootprintLayer]:{adapter:a,type:"catalog-footprint",label:"CatalogFootprintLayer"},[l.CSVLayer]:{adapter:e,type:"csv",label:"CSVLayer"},[l.FeatureLayer]:{adapter:a,type:"feature",label:"FeatureLayer"},[l.GeoJSONLayer]:{adapter:a,type:"geojson",label:"GeoJSONLayer"},[l.KnowledgeGraphSublayer]:{adapter:a,type:"knowledge-graph-sublayer",label:"KnowledgeGraphSublayer"},[l.OGCFeatureLayer]:{adapter:t,type:"ogc-feature",label:"OGCFeatureLayer"},[l.OrientedImageryLayer]:{adapter:a,type:"oriented-imagery",label:"OrientedImageryLayer"},[l.ParquetLayer]:{adapter:a,type:"parquet",label:"ParquetLayer"},[l.PointCloudLayer]:{adapter:o,type:"point-cloud",label:"PointCloudLayer"},[l.SceneLayer]:{adapter:L,type:"scene",label:"SceneLayer"},[l.StreamLayer]:{adapter:p,type:"stream",label:"StreamLayer"},[l.SubtypeGroupLayer]:{adapter:a,type:"subtype-group",label:"SubtypeGroupLayer"},[l.SubtypeSublayer]:{adapter:a,type:"subtype-sublayer",label:"SubtypeSublayer"},[l.WFSLayer]:{adapter:a,type:"wfs",label:"WFSLayer"}},n=[l.CatalogLayer,l.CatalogFootprintLayer,l.CSVLayer,l.FeatureLayer,l.GeoJSONLayer,l.KnowledgeGraphSublayer,l.OGCFeatureLayer,l.OrientedImageryLayer,l.ParquetLayer,l.PointCloudLayer,l.SceneLayer,l.StreamLayer,l.SubtypeGroupLayer,l.SubtypeSublayer,l.WFSLayer],S=[l.CatalogFootprintLayer,l.CSVLayer,l.FeatureLayer,l.GeoJSONLayer,l.KnowledgeGraphSublayer,l.OGCFeatureLayer,l.OrientedImageryLayer,l.ParquetLayer,l.SceneLayer,l.StreamLayer,l.SubtypeGroupLayer,l.SubtypeSublayer,l.WFSLayer],d=[l.CSVLayer,l.FeatureLayer,l.GeoJSONLayer,l.OGCFeatureLayer,l.KnowledgeGraphSublayer,l.OrientedImageryLayer,l.ParquetLayer,l.StreamLayer,l.WFSLayer];function b(e){return e.map((e=>u[e].label))}function i(e){return e.map((e=>u[e].type))}function m(e,a=n,t){if(e instanceof y)return e;const o=g(e,a);return o?t?new r({layer:e}):new o({layer:e}):null}function g(e,a=n){let r=null;return a.some((a=>{const t=e.type===u[a].type;return t&&(r=u[a].adapter),t})),r}export{l as LayerType,d as binningCapableLayerTypes,m as createLayerAdapter,n as defaultSupportedLayerTypes,S as featureCapableLayerTypes,b as getLayerTypeLabels,i as getLayerTypes};
5
+ import e from"../CSVLayerAdapter.js";import a from"../FeatureLayerAdapter.js";import r from"../FeatureLayerBinningAdapter.js";import t from"../InMemoryLayerAdapter.js";import y from"../LayerAdapter.js";import L from"../PointCloudLayerAdapter.js";import o from"../SceneLayerAdapter.js";import p from"../StreamLayerAdapter.js";var l;!function(e){e[e.CatalogLayer=0]="CatalogLayer",e[e.CatalogFootprintLayer=1]="CatalogFootprintLayer",e[e.CSVLayer=2]="CSVLayer",e[e.FeatureLayer=3]="FeatureLayer",e[e.GeoJSONLayer=4]="GeoJSONLayer",e[e.ImageryLayer=5]="ImageryLayer",e[e.KnowledgeGraphSublayer=6]="KnowledgeGraphSublayer",e[e.OGCFeatureLayer=7]="OGCFeatureLayer",e[e.OrientedImageryLayer=8]="OrientedImageryLayer",e[e.ParquetLayer=9]="ParquetLayer",e[e.PointCloudLayer=10]="PointCloudLayer",e[e.SceneLayer=11]="SceneLayer",e[e.StreamLayer=12]="StreamLayer",e[e.SubtypeGroupLayer=13]="SubtypeGroupLayer",e[e.SubtypeSublayer=14]="SubtypeSublayer",e[e.WFSLayer=15]="WFSLayer"}(l||(l={}));const u={[l.CatalogLayer]:{adapter:a,type:"catalog",label:"CatalogLayer"},[l.CatalogFootprintLayer]:{adapter:a,type:"catalog-footprint",label:"CatalogFootprintLayer"},[l.CSVLayer]:{adapter:e,type:"csv",label:"CSVLayer"},[l.FeatureLayer]:{adapter:a,type:"feature",label:"FeatureLayer"},[l.ImageryLayer]:{adapter:a,type:"imagery",label:"ImageryLayer"},[l.GeoJSONLayer]:{adapter:a,type:"geojson",label:"GeoJSONLayer"},[l.KnowledgeGraphSublayer]:{adapter:a,type:"knowledge-graph-sublayer",label:"KnowledgeGraphSublayer"},[l.OGCFeatureLayer]:{adapter:t,type:"ogc-feature",label:"OGCFeatureLayer"},[l.OrientedImageryLayer]:{adapter:a,type:"oriented-imagery",label:"OrientedImageryLayer"},[l.ParquetLayer]:{adapter:a,type:"parquet",label:"ParquetLayer"},[l.PointCloudLayer]:{adapter:L,type:"point-cloud",label:"PointCloudLayer"},[l.SceneLayer]:{adapter:o,type:"scene",label:"SceneLayer"},[l.StreamLayer]:{adapter:p,type:"stream",label:"StreamLayer"},[l.SubtypeGroupLayer]:{adapter:a,type:"subtype-group",label:"SubtypeGroupLayer"},[l.SubtypeSublayer]:{adapter:a,type:"subtype-sublayer",label:"SubtypeSublayer"},[l.WFSLayer]:{adapter:a,type:"wfs",label:"WFSLayer"}},n=[l.CatalogLayer,l.CatalogFootprintLayer,l.CSVLayer,l.FeatureLayer,l.GeoJSONLayer,l.KnowledgeGraphSublayer,l.OGCFeatureLayer,l.OrientedImageryLayer,l.ParquetLayer,l.PointCloudLayer,l.SceneLayer,l.StreamLayer,l.SubtypeGroupLayer,l.SubtypeSublayer,l.WFSLayer],S=[l.CatalogFootprintLayer,l.CSVLayer,l.FeatureLayer,l.GeoJSONLayer,l.KnowledgeGraphSublayer,l.OGCFeatureLayer,l.OrientedImageryLayer,l.ParquetLayer,l.SceneLayer,l.StreamLayer,l.SubtypeGroupLayer,l.SubtypeSublayer,l.WFSLayer],d=[l.CSVLayer,l.FeatureLayer,l.GeoJSONLayer,l.OGCFeatureLayer,l.KnowledgeGraphSublayer,l.OrientedImageryLayer,l.ParquetLayer,l.StreamLayer,l.WFSLayer];function b(e){return e.map((e=>u[e].label))}function m(e){return e.map((e=>u[e].type))}function i(e,a=n,t){if(e instanceof y)return e;const L=g(e,a);return L?t?new r({layer:e}):new L({layer:e}):null}function g(e,a=n){let r=null;return a.some((a=>{const t=e.type===u[a].type;return t&&(r=u[a].adapter),t})),r}export{l as LayerType,d as binningCapableLayerTypes,i as createLayerAdapter,n as defaultSupportedLayerTypes,S as featureCapableLayerTypes,b as getLayerTypeLabels,m as getLayerTypes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../rest/support/ClassBreaksDefinition.js";import{createGenerateRendererClassBreaks as n}from"../rest/support/generateRendererUtils.js";const t="<Null>",l="equal-interval",i=1,a=5,o=10,u=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,r=new Set(["esriFieldTypeDate","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeOID","esriFieldTypeBigInteger"]),s=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),c=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function m(e){return null==e||"string"==typeof e&&!e?t:e}function d(e){const n=null!=e.normalizationField||null!=e.normalizationType,t=null!=e.minValue||null!=e.maxValue,l=!!e.sqlExpression&&e.supportsSQLExpression;return!n&&!t&&!l}function f(e){const{outStatisticTypes:n}=e,t=e.returnDistinct?[...new Set(e.values)]:e.values,l=t.filter((e=>null!=e)).sort(),i=l.length,a={count:i,min:l[0],max:l[i-1]};return e.supportsNullCount&&(a.nullcount=t.length-i),!e.percentileParams||n?.include?.length&&!n.include.includes("median")||n?.exclude?.length&&n.exclude.includes("median")||(a.median=v(t,e.percentileParams)),a}function p(e){const{values:n,useSampleStdDev:t,supportsNullCount:l,outStatisticTypes:i}=e;let a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,u=null,r=null,s=null,c=null,m=0;const d=null==e.minValue?-1/0:e.minValue,f=null==e.maxValue?1/0:e.maxValue;for(const v of n)Number.isFinite(v)?v>=d&&v<=f&&(u=null===u?v:u+v,a=Math.min(a,v),o=Math.max(o,v),m++):"string"==typeof v&&m++;if(m&&null!=u){r=u/m;let e=0;for(const t of n)Number.isFinite(t)&&t>=d&&t<=f&&(e+=(t-r)**2);c=t?m>1?e/(m-1):0:m>0?e/m:0,s=Math.sqrt(c)}else a=null,o=null;const p={avg:r,count:m,max:o,min:a,stddev:s,sum:u,variance:c};return l&&(p.nullcount=n.length-m),!e.percentileParams||i?.include?.length&&!i.include.includes("median")||i?.exclude?.length&&i.exclude.includes("median")||(p.median=v(n,e.percentileParams)),p}function v(e,n){const{fieldType:t,value:l,orderBy:i,isDiscrete:a}=n,o=g(t,"desc"===i);if(0===(e=[...e].filter((e=>null!=e)).sort(((e,n)=>o(e,n)))).length)return null;if(l<=0)return e[0];if(l>=1)return e[e.length-1];const u=(e.length-1)*l,r=Math.floor(u),s=r+1,c=u%1,m=e[r],d=e[s];return s>=e.length||a||"string"==typeof m||"string"==typeof d?m:m*(1-c)+d*c}function g(e,n){if(e){if(r.has(e))return N(n);if(s.has(e))return D(n,!1);if("esriFieldTypeTimestampOffset"===e)return F(n);const t=D(n,!0);if("esriFieldTypeString"===e)return t;if("esriFieldTypeGUID"===e||"esriFieldTypeGlobalID"===e)return(e,n)=>t(M(e),M(n))}const t=n?1:-1,l=N(n),i=D(n,!0),a=x(n);return(e,n)=>"number"==typeof e&&"number"==typeof n?l(e,n):"string"==typeof e&&"string"==typeof n?i(e,n):a(e,n)??t}const h=(e,n)=>null==e?null==n?0:1:null==n?-1:null,T=(e,n)=>null==e?null==n?0:-1:null==n?1:null;function x(e){return e?h:T}const y=(e,n)=>T(e,n)??(e===n?0:new Date(e).getTime()-new Date(n).getTime()),V=(e,n)=>h(e,n)??(e===n?0:new Date(n).getTime()-new Date(e).getTime());function F(e){return e?V:y}const I=(e,n)=>T(e,n)??(e===n?0:e<n?-1:1),b=(e,n)=>h(e,n)??(e===n?0:e<n?1:-1);function D(e,n){if(!n)return e?b:I;const t=x(e);return e?(e,n)=>{const l=t(e,n);return null!=l?l:(e=e.toUpperCase())>(n=n.toUpperCase())?-1:e<n?1:0}:(e,n)=>{const l=t(e,n);return null!=l?l:(e=e.toUpperCase())<(n=n.toUpperCase())?-1:e>n?1:0}}const z=(e,n)=>h(e,n)??n-e,S=(e,n)=>T(e,n)??e-n;function N(e){return e?z:S}function M(e){return e.slice(24,36)+e.slice(19,23)+e.slice(16,18)+e.slice(14,16)+e.slice(11,13)+e.slice(9,11)+e.slice(6,8)+e.slice(4,6)+e.slice(2,4)+e.slice(0,2)}function C(e,n,t){let l;for(l in e)n?.include?.length&&!n.include.includes(l)||n?.exclude?.length&&n.exclude.includes(l)?delete e[l]:c.includes(l)&&(Number.isFinite(e[l])||(e[l]=null));return t?(["avg","stddev","variance"].forEach((n=>{null!=e[n]&&(e[n]=Math.ceil(e[n]??0))})),e):e}function k(e){const n={};for(let t of e)(null==t||"string"==typeof t&&""===t.trim())&&(t=null),null==n[t]?n[t]={count:1,data:t}:n[t].count++;return{count:n}}function w(e){return"coded-value"!==e?.type?[]:e.codedValues.map((e=>e.code))}function $(e,n,t,l){const i=e.count,a=[];if(t&&n){const e=[],t=w(n[0]);for(const i of t)if(n[1]){const t=w(n[1]);for(const a of t)if(n[2]){const t=w(n[2]);for(const n of t)e.push(`${m(i)}${l}${m(a)}${l}${m(n)}`)}else e.push(`${m(i)}${l}${m(a)}`)}else e.push(i);for(const n of e)i.hasOwnProperty(n)||(i[n]={data:n,count:0})}for(const o in i){const e=i[o];a.push({value:e.data,count:e.count,label:e.label})}return{uniqueValueInfos:a}}function B(e,n,t,l){let i=null;switch(n){case"log":0!==e&&(i=Math.log(e)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(l)&&0!==l&&(i=e/l*100);break;case"field":Number.isFinite(t)&&0!==t&&(i=e/t);break;case"natural-log":e>0&&(i=Math.log(e));break;case"square-root":e>0&&(i=e**.5)}return i}function E(e,t,l){const i=q({field:t.field,normalizationType:t.normalizationType,normalizationField:t.normalizationField,classificationMethod:t.classificationMethod,standardDeviationInterval:t.standardDeviationInterval,definedInterval:t.definedInterval,breakCount:t.numClasses||a});return e=O(e,t.minValue,t.maxValue),n({definition:i,values:e,normalizationTotal:t.normalizationTotal},l)}function O(e,n,t){const l=n??-1/0,i=t??1/0;return e.filter((e=>Number.isFinite(e)&&e>=l&&e<=i))}function q(n){const{breakCount:t,field:a,normalizationField:o,normalizationType:u}=n,r=n.classificationMethod||l,s="standard-deviation"===r?n.standardDeviationInterval||i:void 0,c="defined-interval"===r?n.definedInterval:void 0;return new e({breakCount:t,classificationField:a,classificationMethod:r,normalizationField:"field"===u?o:void 0,normalizationType:u,standardDeviationInterval:s,definedInterval:c})}function P(e,n){let t=e.classBreaks;const l=t.length,i=t[0]?.minValue,a=t[l-1]?.maxValue,o="standard-deviation"===n,r=u;return t=t.map((e=>{const n=e.label,t={minValue:e.minValue,maxValue:e.maxValue,label:n};if(o&&n){const e=n.match(r),l=e?.map((e=>+e.trim()))??[];2===l.length?(t.minStdDev=l[0],t.maxStdDev=l[1],l[0]<0&&l[1]>0&&(t.hasAvg=!0)):1===l.length&&(n.includes("<")?(t.minStdDev=null,t.maxStdDev=l[0]):n.includes(">")&&(t.minStdDev=l[0],t.maxStdDev=null))}return t})),{minValue:i,maxValue:a,classBreakInfos:t,normalizationTotal:e.normalizationTotal}}function U(e,n){const t=G(e,n);if(null==t.min&&null==t.max)return{bins:[],minValue:t.min,maxValue:t.max,normalizationTotal:n.normalizationTotal};const l=t.intervals,i=t.min??0,a=t.max??0,o=l.map(((e,n)=>({minValue:l[n][0],maxValue:l[n][1],count:0})));for(const u of e)if(null!=u&&u>=i&&u<=a){const e=L(l,u);e>-1&&o[e].count++}return{bins:o,minValue:i,maxValue:a,normalizationTotal:n.normalizationTotal}}function G(e,n,t=!1){const{field:l,classificationMethod:i,standardDeviationInterval:a,definedInterval:u,normalizationType:r,normalizationField:s,normalizationTotal:c,minValue:m,maxValue:f}=n,v=n.numBins||o;let g=null,h=null,T=null;if((!i||"equal-interval"===i)&&!r){if(null!=m&&null!=f)g=m,h=f;else{const n=p({values:e,minValue:m,maxValue:f,useSampleStdDev:!r,supportsNullCount:d({normalizationType:r,normalizationField:s,minValue:m,maxValue:f})});g=n.min??null,h=n.max??null}T=j(g??0,h??0,v)}else{const{classBreaks:n}=E(e,{field:l,normalizationType:r,normalizationField:s,normalizationTotal:c,classificationMethod:i,standardDeviationInterval:a,definedInterval:u,minValue:m,maxValue:f,numClasses:v},null!=m&&null!=f?[m,f]:void 0);g=n[0]?.minValue,h=n[n.length-1]?.maxValue,T=n.map((e=>[e.minValue,e.maxValue]))}if(t){const e=T.at(-1)[1];T.push([e,e])}return{min:g,max:h,intervals:T}}function L(e,n){let t=-1;for(let l=e.length-1;l>=0;l--){if(n>=e[l][0]){t=l;break}}return t}function j(e,n,t){const l=(n-e)/t,i=[];let a,o=e;for(let u=1;u<=t;u++)a=o+l,a=Number(a.toFixed(16)),i.push([o,u===t?n:a]),o=a;return i}export{L as binIndex,E as calculateClassBreaks,U as calculateHistogram,v as calculatePercentile,p as calculateStatistics,f as calculateStringStatistics,k as calculateUniqueValuesCount,q as createClassBreaksDefinition,$ as createUVResult,g as getAttributeComparator,G as getBinParams,j as getEqualIntervalBins,B as getNormalizedValue,d as isNullCountSupported,m as processNullValue,C as processSummaryStatisticsResult,P as resolveCBResult,c as statisticTypes};
5
+ import e from"../rest/support/ClassBreaksDefinition.js";import{createGenerateRendererClassBreaks as n}from"../rest/support/generateRendererUtils.js";const t="<Null>",l="equal-interval",i=1,a=5,o=10,u=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,r=new Set(["esriFieldTypeDate","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeOID","esriFieldTypeBigInteger"]),s=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),c=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function m(e){return null==e||"string"==typeof e&&!e?t:e}function d(e){const n=null!=e.normalizationField||null!=e.normalizationType,t=null!=e.minValue||null!=e.maxValue,l=!!e.sqlExpression&&e.supportsSQLExpression;return!n&&!t&&!l}function f(e){const{outStatisticTypes:n}=e,t=e.returnDistinct?[...new Set(e.values)]:e.values,l=t.filter((e=>null!=e)).sort(),i=l.length,a={count:i,min:l[0],max:l[i-1]};return e.supportsNullCount&&(a.nullcount=t.length-i),!e.percentileParams||n?.include?.length&&!n.include.includes("median")||n?.exclude?.length&&n.exclude.includes("median")||(a.median=v(t,e.percentileParams)),a}function p(e){const{values:n,useSampleStdDev:t,supportsNullCount:l,outStatisticTypes:i}=e;let a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,u=null,r=null,s=null,c=null,m=0;const d=null==e.minValue?-1/0:e.minValue,f=null==e.maxValue?1/0:e.maxValue;for(const v of n)Number.isFinite(v)?v>=d&&v<=f&&(u=null===u?v:u+v,a=Math.min(a,v),o=Math.max(o,v),m++):"string"==typeof v&&m++;if(m&&null!=u){r=u/m;let e=0;for(const t of n)Number.isFinite(t)&&t>=d&&t<=f&&(e+=(t-r)**2);c=t?m>1?e/(m-1):0:m>0?e/m:0,s=Math.sqrt(c)}else a=null,o=null;const p={avg:r,count:m,max:o,min:a,stddev:s,sum:u,variance:c};return l&&(p.nullcount=n.length-m),!e.percentileParams||i?.include?.length&&!i.include.includes("median")||i?.exclude?.length&&i.exclude.includes("median")||(p.median=v(n,e.percentileParams)),p}function v(e,n){const{fieldType:t,value:l,orderBy:i,isDiscrete:a}=n,o=g(t,"desc"===i);if(0===(e=[...e].filter((e=>null!=e)).sort(((e,n)=>o(e,n)))).length)return null;if(l<=0)return e[0];if(l>=1)return e[e.length-1];const u=(e.length-1)*l,r=Math.floor(u),s=r+1,c=u%1,m=e[r],d=e[s];return s>=e.length||a||"string"==typeof m||"string"==typeof d?m:m*(1-c)+d*c}function g(e,n){if(e){if(r.has(e))return N(n);if(s.has(e))return D(n,!1);if("esriFieldTypeTimestampOffset"===e)return F(n);const t=D(n,!0);if("esriFieldTypeString"===e)return t;if("esriFieldTypeGUID"===e||"esriFieldTypeGlobalID"===e)return(e,n)=>t(M(e),M(n))}const t=n?1:-1,l=N(n),i=D(n,!0),a=x(n);return(e,n)=>"number"==typeof e&&"number"==typeof n?l(e,n):"string"==typeof e&&"string"==typeof n?i(e,n):a(e,n)??t}const h=(e,n)=>null==e?null==n?0:1:null==n?-1:null,T=(e,n)=>null==e?null==n?0:-1:null==n?1:null;function x(e){return e?h:T}const y=(e,n)=>T(e,n)??(e===n?0:new Date(e).getTime()-new Date(n).getTime()),V=(e,n)=>h(e,n)??(e===n?0:new Date(n).getTime()-new Date(e).getTime());function F(e){return e?V:y}const I=(e,n)=>T(e,n)??(e===n?0:e<n?-1:1),b=(e,n)=>h(e,n)??(e===n?0:e<n?1:-1);function D(e,n){if(!n)return e?b:I;const t=x(e);return e?(e,n)=>{const l=t(e,n);return null!=l?l:(e=e.toUpperCase())>(n=n.toUpperCase())?-1:e<n?1:0}:(e,n)=>{const l=t(e,n);return null!=l?l:(e=e.toUpperCase())<(n=n.toUpperCase())?-1:e>n?1:0}}const z=(e,n)=>h(e,n)??n-e,S=(e,n)=>T(e,n)??e-n;function N(e){return e?z:S}function M(e){return e.slice(24,36)+e.slice(19,23)+e.slice(16,18)+e.slice(14,16)+e.slice(11,13)+e.slice(9,11)+e.slice(6,8)+e.slice(4,6)+e.slice(2,4)+e.slice(0,2)}function C(e,n,t){let l;for(l in e)n?.include?.length&&!n.include.includes(l)||n?.exclude?.length&&n.exclude.includes(l)?delete e[l]:c.includes(l)&&(Number.isFinite(e[l])||(e[l]=null));return t?(["avg","stddev","variance"].forEach((n=>{null!=e[n]&&(e[n]=Math.ceil(e[n]??0))})),e):e}function k(e){const n={};for(let t of e)(null==t||"string"==typeof t&&""===t.trim())&&(t=null),null==n[t]?n[t]={count:1,data:t}:n[t].count++;return{count:n}}function w(e){return"coded-value"!==e?.type?[]:e.codedValues.map((e=>e.code))}function $(e,n,t,l){const i=e.count,a=[];if(t&&n){const e=[],t=w(n[0]);for(const i of t)if(n[1]){const t=w(n[1]);for(const a of t)if(n[2]){const t=w(n[2]);for(const n of t)e.push(`${m(i)}${l}${m(a)}${l}${m(n)}`)}else e.push(`${m(i)}${l}${m(a)}`)}else e.push(i);for(const n of e)i.hasOwnProperty(n)||(i[n]={data:n,count:0})}for(const o in i){const e=i[o];a.push({value:e.data,count:e.count,label:e.label})}return{uniqueValueInfos:a}}function B(e,n,t,l){let i=null;switch(n){case"log":0!==e&&(i=Math.log(e)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(l)&&0!==l&&(i=e/l*100);break;case"field":Number.isFinite(t)&&0!==t&&(i=e/t);break;case"natural-log":e>0&&(i=Math.log(e));break;case"square-root":e>0&&(i=e**.5)}return i}function E(e,t,l){const i=q({field:t.field,normalizationType:t.normalizationType,normalizationField:t.normalizationField,classificationMethod:t.classificationMethod,standardDeviationInterval:t.standardDeviationInterval,definedInterval:t.definedInterval,breakCount:t.numClasses||a});return e=O(e,t.minValue,t.maxValue),n({definition:i,values:e,normalizationTotal:t.normalizationTotal},l)}function O(e,n,t){const l=n??-1/0,i=t??1/0;return e.filter((e=>Number.isFinite(e)&&e>=l&&e<=i))}function q(n){const{breakCount:t,field:a,normalizationField:o,normalizationType:u}=n,r=n.classificationMethod||l,s="standard-deviation"===r?n.standardDeviationInterval||i:void 0,c="defined-interval"===r?n.definedInterval:void 0;return new e({breakCount:t,classificationField:a,classificationMethod:r,normalizationField:"field"===u?o:void 0,normalizationType:u,standardDeviationInterval:s,definedInterval:c})}function P(e,n){let t=e.classBreaks;const l=t.length,i=t[0]?.minValue,a=t[l-1]?.maxValue,o="standard-deviation"===n,r=u;return t=t.map((e=>{const n=e.label,t={minValue:e.minValue,maxValue:e.maxValue,label:n};if(o&&n){const e=n.match(r),l=e?.map((e=>+e.trim()))??[];2===l.length?(t.minStdDev=l[0],t.maxStdDev=l[1],l[0]<0&&l[1]>0&&(t.hasAvg=!0)):1===l.length&&(n.includes("<")?(t.minStdDev=null,t.maxStdDev=l[0]):n.includes(">")&&(t.minStdDev=l[0],t.maxStdDev=null))}return t})),{minValue:i,maxValue:a,classBreakInfos:t,normalizationTotal:e.normalizationTotal}}function U(e,n){const t=G(e,n);if(null==t.min&&null==t.max)return{bins:[],minValue:t.min,maxValue:t.max,normalizationTotal:n.normalizationTotal};const l=t.intervals,i=t.min??0,a=t.max??0,o=l.map(((e,n)=>({minValue:l[n][0],maxValue:l[n][1],count:0})));for(const u of e)if(null!=u&&u>=i&&u<=a){const e=L(l,u);e>-1&&o[e].count++}return{bins:o,minValue:i,maxValue:a,normalizationTotal:n.normalizationTotal}}function G(e,n,t=!1){const{field:l,classificationMethod:i,standardDeviationInterval:a,definedInterval:u,normalizationType:r,normalizationField:s,normalizationTotal:c,minValue:m,maxValue:f}=n,v=n.numBins||o;let g=null,h=null,T=null;if((!i||"equal-interval"===i)&&!r){if(null!=m&&null!=f)g=m,h=f;else{const n=p({values:e,minValue:m,maxValue:f,useSampleStdDev:!r,supportsNullCount:d({normalizationType:r,normalizationField:s,minValue:m,maxValue:f})});g=n.min??null,h=n.max??null}T=j(g??0,h??0,v)}else{const{classBreaks:n}=E(e,{field:l,normalizationType:r,normalizationField:s,normalizationTotal:c,classificationMethod:i,standardDeviationInterval:a,definedInterval:u,minValue:m,maxValue:f,numClasses:v},null!=m&&null!=f?[m,f]:void 0);g=n[0]?.minValue,h=n[n.length-1]?.maxValue,T=n.map((e=>[e.minValue,e.maxValue]))}if(t&&T.length){const e=T.at(-1)[1];T.push([e,e])}return{min:g,max:h,intervals:T}}function L(e,n){let t=-1;for(let l=e.length-1;l>=0;l--){if(n>=e[l][0]){t=l;break}}return t}function j(e,n,t){const l=(n-e)/t,i=[];let a,o=e;for(let u=1;u<=t;u++)a=o+l,a=Number(a.toFixed(16)),i.push([o,u===t?n:a]),o=a;return i}export{L as binIndex,E as calculateClassBreaks,U as calculateHistogram,v as calculatePercentile,p as calculateStatistics,f as calculateStringStatistics,k as calculateUniqueValuesCount,q as createClassBreaksDefinition,$ as createUVResult,g as getAttributeComparator,G as getBinParams,j as getEqualIntervalBins,B as getNormalizedValue,d as isNullCountSupported,m as processNullValue,C as processSummaryStatisticsResult,P as resolveCBResult,c as statisticTypes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const d="20250513",e="df6d6990d5716d44fb964e1638a5c63b4058a92e";export{d as buildDate,e as commitHash};
5
+ const e="20250514",c="61e9e7e1b36a140caac2fb8c4ddece5c32e5e4eb";export{e as buildDate,c as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{defaultCIMValues as e}from"../defaultCIMValues.js";class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,i,s,l){return new n(t,e,i)}}class n{constructor(t,i,n){this._inputGeometries=t,this._length=(void 0!==i.length?i.length:e.CIMGeometricEffectRadial.length)*n,this._angle=void 0!==i.angle?i.angle*Math.PI/180:e.CIMGeometricEffectRadial.angle,this._lx=Math.cos(this._angle)*this._length,this._ly=Math.sin(this._angle)*this._length}next(){let e=this._inputGeometries.next();for(;e;){if("esriGeometryPoint"===e.geometryType){const i=t.createEmptyOptimizedCIM("esriGeometryPolyline");return e.nextPath()&&e.nextPoint()&&i.pushPath([[e.x,e.y],[e.x+this._lx,e.y+this._ly]]),i}e=this._inputGeometries.next()}return null}}export{i as EffectRadial};
5
+ import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{ringsCentroidCursor as e}from"../../../geometry/support/centroid.js";import{defaultCIMValues as i}from"../defaultCIMValues.js";class n{static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,i,n,r){return new s(t,e,i)}}class s{constructor(t,e,n){this._inputGeometries=t,this._length=(void 0!==e.length?e.length:i.CIMGeometricEffectRadial.length)*n,this._angle=void 0!==e.angle?e.angle*Math.PI/180:i.CIMGeometricEffectRadial.angle,this._lx=Math.cos(this._angle)*this._length,this._ly=Math.sin(this._angle)*this._length}next(){let i=this._inputGeometries.next();for(;i;){if("esriGeometryPoint"===i.geometryType){const e=t.createEmptyOptimizedCIM("esriGeometryPolyline");return i.nextPath()&&i.nextPoint()&&e.pushPath([[i.x,i.y],[i.x+this._lx,i.y+this._ly]]),e}if("esriGeometryPolygon"===i.geometryType){const n=e(i);if(!n)return null;const s=t.createEmptyOptimizedCIM("esriGeometryPolyline");return s.pushPath([[n[0],n[1]],[n[0]+this._lx,n[1]+this._ly]]),s}i=this._inputGeometries.next()}return null}}export{n as EffectRadial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import"../../core/accessorSupport/interfaces.js";import"../../core/accessorSupport/tracking/Flags.js";import"../../core/Warning.js";import"../../core/Error.js";class t{constructor(e){this.versionableItem=e,this.type="feature-layer"}get gdbVersion(){return this.versionableItem.gdbVersion}set gdbVersion(e){this.versionableItem.gdbVersion=e}get historicMoment(){return this.versionableItem.historicMoment}set historicMoment(e){this.versionableItem.historicMoment=e}get featureServiceUrl(){const e=/^(.*\/FeatureServer)\/\d+$/;return this.versionableItem.url.replace(e,"$1")}}e([r({readOnly:!0})],t.prototype,"type",void 0),e([r()],t.prototype,"gdbVersion",null),e([r({type:Date})],t.prototype,"historicMoment",null),e([r({readOnly:!0})],t.prototype,"featureServiceUrl",null);export{t as FeatureLayerVersionAdapter};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import"../../core/Warning.js";import"../../core/Error.js";class t{constructor(e){this.versionableItem=e,this.type="feature-layer"}get gdbVersion(){return this.versionableItem.gdbVersion}set gdbVersion(e){this.versionableItem.gdbVersion=e}get historicMoment(){return this.versionableItem.historicMoment}set historicMoment(e){this.versionableItem.historicMoment=e}get featureServiceUrl(){const e=/^(.*\/FeatureServer)\/\d+$/;return this.versionableItem.url.replace(e,"$1")}}e([r({readOnly:!0})],t.prototype,"type",void 0),e([r()],t.prototype,"gdbVersion",null),e([r({type:Date})],t.prototype,"historicMoment",null),e([r({readOnly:!0})],t.prototype,"featureServiceUrl",null);export{t as FeatureLayerVersionAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import"../../core/accessorSupport/interfaces.js";import"../../core/accessorSupport/tracking/Flags.js";import"../../core/Warning.js";import"../../core/Error.js";class t{constructor(e){this.versionableItem=e,this.type="network"}get gdbVersion(){return this.versionableItem.gdbVersion}set gdbVersion(e){this.versionableItem.gdbVersion=e}get historicMoment(){return this.versionableItem.historicMoment}set historicMoment(e){this.versionableItem.historicMoment=e}get featureServiceUrl(){return this.versionableItem.featureServiceUrl}}e([r({readOnly:!0})],t.prototype,"type",void 0),e([r()],t.prototype,"gdbVersion",null),e([r({type:Date})],t.prototype,"historicMoment",null),e([r({readOnly:!0})],t.prototype,"featureServiceUrl",null);export{t as NetworkVersionAdapter};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import"../../core/Warning.js";import"../../core/Error.js";class t{constructor(e){this.versionableItem=e,this.type="network"}get gdbVersion(){return this.versionableItem.gdbVersion}set gdbVersion(e){this.versionableItem.gdbVersion=e}get historicMoment(){return this.versionableItem.historicMoment}set historicMoment(e){this.versionableItem.historicMoment=e}get featureServiceUrl(){return this.versionableItem.featureServiceUrl}}e([r({readOnly:!0})],t.prototype,"type",void 0),e([r()],t.prototype,"gdbVersion",null),e([r({type:Date})],t.prototype,"historicMoment",null),e([r({readOnly:!0})],t.prototype,"featureServiceUrl",null);export{t as NetworkVersionAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import"../../core/accessorSupport/interfaces.js";import"../../core/accessorSupport/tracking/Flags.js";import"../../core/Warning.js";import"../../core/Error.js";class t{constructor(e){this.versionableItem=e,this.type="subtype-group-layer"}get gdbVersion(){return this.versionableItem.gdbVersion}set gdbVersion(e){this.versionableItem.gdbVersion=e}get historicMoment(){return this.versionableItem.historicMoment}set historicMoment(e){this.versionableItem.historicMoment=e}get featureServiceUrl(){const e=/^(.*\/FeatureServer)\/\d+$/;return this.versionableItem.url.replace(e,"$1")}}e([r({readOnly:!0})],t.prototype,"type",void 0),e([r()],t.prototype,"gdbVersion",null),e([r({type:Date})],t.prototype,"historicMoment",null),e([r({readOnly:!0})],t.prototype,"featureServiceUrl",null);export{t as SubTypeGroupLayerVersionAdapter};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import"../../core/Warning.js";import"../../core/Error.js";class t{constructor(e){this.versionableItem=e,this.type="subtype-group-layer"}get gdbVersion(){return this.versionableItem.gdbVersion}set gdbVersion(e){this.versionableItem.gdbVersion=e}get historicMoment(){return this.versionableItem.historicMoment}set historicMoment(e){this.versionableItem.historicMoment=e}get featureServiceUrl(){const e=/^(.*\/FeatureServer)\/\d+$/;return this.versionableItem.url.replace(e,"$1")}}e([r({readOnly:!0})],t.prototype,"type",void 0),e([r()],t.prototype,"gdbVersion",null),e([r({type:Date})],t.prototype,"historicMoment",null),e([r({readOnly:!0})],t.prototype,"featureServiceUrl",null);export{t as SubTypeGroupLayerVersionAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l,on as m}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as h}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as d}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as f}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as g}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../../../core/scheduling.js";import"../../../core/accessorSupport/tracking/Flags.js";import"../../../core/colorUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../symbols/cim/enums.js";import"../../../core/floatRGBA.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../engine/webgl/definitions.js";import"../engine/webgl/animations/instructions.js";import"../../../symbols/Font.js";import"../../../core/mathUtils.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/Axis.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../geometry/support/TileClipper.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/alignmentUtils.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Evented.js";import"../engine/transitions/FadeTransition.js";import"../engine/webgl/enums.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/checkWebGLError.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../../webgl/FBOAttachmentType.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../engine/vectorTiles/enums.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/TechniqueType.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../Color.js";import"../engine/webgl/shaderGraph/techniques/shaders/constants.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../arcade/ArcadeDate.js";import"../../../intl/locale.js";import"luxon";import"../../../core/sql/UnknownTimeZone.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../chunks/pe.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import y from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import _ from"../../layers/LayerView.js";import v from"../../layers/MediaLayerView.js";import{TaskPriority as E}from"../../support/Scheduler.js";let G=class extends(w(v(_))){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new t}initialize(){this.addHandles([n((()=>[this.interactive,this.suspended]),(async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await import("./support/MediaLayerInteraction.js");this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)}),l),n((()=>this.interactionOptions),(e=>{this._interaction&&(this._interaction.options=e)}),l),n((()=>this.selectedElement),(e=>{this._interaction&&(this._interaction.selectedElement=e)}),l)])}attach(){this.addAttachHandles([m((()=>this.layer.effectiveSource),"refresh",(()=>{this._tileStrategy.refresh((e=>this._updateTile(e))),this.requestUpdate()})),m((()=>this.layer.effectiveSource),"change",(({element:e})=>this._elementUpdateHandler(e)))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new u({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:E.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new j({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],s=e.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:o,element:n}}of this._elementReferences.values())null!=o&&d(o.rings,r)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh((e=>this._updateTile(e)))}_acquireTile(e){const t=new M(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then((t=>{const[i,s]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,s),this.requestUpdate()}),(e=>{o(e)||s.getLogger(this).error(e)})))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(S,e,!0);const s=new c({xmin:S[0],ymin:S[1],xmax:S[2],ymax:S[3],spatialReference:this.view.spatialReference});return i.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){r(this._elementReferences,t.uid,(()=>{const e=new g({element:t,spatialReference:this.view.spatialReference}),r=new y(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch((e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))}))),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}})).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],r=[];for(const e of this._tileStrategy.tiles){const o=T(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||r.push(e):o&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of r)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new g({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const s of this._tileStrategy.tiles){T(this.view.featuresTilingScheme,s,i)&&this._referenceElement(s,e)}}};e([a()],G.prototype,"layer",void 0),e([a({readOnly:!0})],G.prototype,"elements",void 0),G=e([p("esri.views.2d.layers.MediaLayerView2D")],G);const S=h(),q={xmin:0,ymin:0,xmax:0,ymax:0};function T(e,t,i){return e.getTileBounds(S,t.key,!0),q.xmin=S[0],q.ymin=S[1],q.xmax=S[2],q.ymax=S[3],f(q,i)}class M{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const s of e)i.has(s)?i.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const C=G;export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l,on as m}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as h}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as d}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as f}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as g}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../../../core/scheduling.js";import"../../../core/colorUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../symbols/cim/enums.js";import"../../../core/floatRGBA.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../engine/webgl/definitions.js";import"../engine/webgl/animations/instructions.js";import"../../../symbols/Font.js";import"../../../core/mathUtils.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/Axis.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../geometry/support/TileClipper.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/alignmentUtils.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Evented.js";import"../engine/transitions/FadeTransition.js";import"../engine/webgl/enums.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/checkWebGLError.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../../webgl/FBOAttachmentType.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../engine/vectorTiles/enums.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/TechniqueType.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../Color.js";import"../engine/webgl/shaderGraph/techniques/shaders/constants.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../arcade/ArcadeDate.js";import"../../../intl/locale.js";import"luxon";import"../../../core/sql/UnknownTimeZone.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../chunks/pe.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import j from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import _ from"../../layers/LayerView.js";import v from"../../layers/MediaLayerView.js";import{TaskPriority as E}from"../../support/Scheduler.js";let G=class extends(w(v(_))){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new t}initialize(){this.addHandles([n((()=>[this.interactive,this.suspended]),(async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await import("./support/MediaLayerInteraction.js");this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)}),l),n((()=>this.interactionOptions),(e=>{this._interaction&&(this._interaction.options=e)}),l),n((()=>this.selectedElement),(e=>{this._interaction&&(this._interaction.selectedElement=e)}),l)])}attach(){this.addAttachHandles([m((()=>this.layer.effectiveSource),"refresh",(()=>{this._tileStrategy.refresh((e=>this._updateTile(e))),this.requestUpdate()})),m((()=>this.layer.effectiveSource),"change",(({element:e})=>this._elementUpdateHandler(e)))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new u({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:E.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],s=e.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:o,element:n}}of this._elementReferences.values())null!=o&&d(o.rings,r)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh((e=>this._updateTile(e)))}_acquireTile(e){const t=new M(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then((t=>{const[i,s]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,s),this.requestUpdate()}),(e=>{o(e)||s.getLogger(this).error(e)})))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(S,e,!0);const s=new c({xmin:S[0],ymin:S[1],xmax:S[2],ymax:S[3],spatialReference:this.view.spatialReference});return i.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){r(this._elementReferences,t.uid,(()=>{const e=new g({element:t,spatialReference:this.view.spatialReference}),r=new j(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch((e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))}))),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}})).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],r=[];for(const e of this._tileStrategy.tiles){const o=T(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||r.push(e):o&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of r)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new g({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const s of this._tileStrategy.tiles){T(this.view.featuresTilingScheme,s,i)&&this._referenceElement(s,e)}}};e([a()],G.prototype,"layer",void 0),e([a({readOnly:!0})],G.prototype,"elements",void 0),G=e([p("esri.views.2d.layers.MediaLayerView2D")],G);const S=h(),q={xmin:0,ymin:0,xmax:0,ymax:0};function T(e,t,i){return e.getTileBounds(S,t.key,!0),q.xmin=S[0],q.ymin=S[1],q.xmax=S[2],q.ymax=S[3],f(q,i)}class M{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const s of e)i.has(s)?i.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const C=G;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../core/accessorSupport/tracking/Flags.js";import"../../../core/colorUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../symbols/cim/enums.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../engine/webgl/definitions.js";import"../engine/webgl/animations/instructions.js";import"../../../core/mathUtils.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/Axis.js";import"../../../geometry/support/TileClipper.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/alignmentUtils.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Evented.js";import"../engine/transitions/FadeTransition.js";import"../engine/webgl/enums.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/checkWebGLError.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../../webgl/FBOAttachmentType.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../engine/vectorTiles/enums.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/TechniqueType.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../Color.js";import"../engine/webgl/shaderGraph/techniques/shaders/constants.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../arcade/ArcadeDate.js";import"../../../intl/locale.js";import"luxon";import"../../../core/sql/UnknownTimeZone.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../chunks/pe.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import b from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as T,MapServiceLayerViewHelper as G}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as q}from"../../support/drapedUtils.js";import{defaultHighlightName as V}from"../../support/HighlightDefaults.js";import{TaskPriority as v}from"../../support/Scheduler.js";const I=[0,0];let P=class extends(b(n(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:v.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),T(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new G({createFetchPopupFeaturesQueryGeometry:(e,i)=>q(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add((()=>this.resampling),(()=>{this.doRefresh()}))),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=t?.name??V;return this._addHighlightGraphics(s,r),i((()=>!this.destroyed&&this._removeHighlightGraphics(s,r)))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map((e=>e.uid)),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map((e=>e.uid)),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh((e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e))))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.tileInfo.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.tileInfo.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.tileInfo.size);a=await this._fetchImage(h,o)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.tileInfo.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],P.prototype,"resampling",null),e([o()],P.prototype,"tilemapCache",null),P=e([l("esri.views.2d.layers.TileLayerView2D")],P);const C=P;export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../core/colorUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../symbols/cim/enums.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../engine/webgl/definitions.js";import"../engine/webgl/animations/instructions.js";import"../../../core/mathUtils.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/Axis.js";import"../../../geometry/support/TileClipper.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/alignmentUtils.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Evented.js";import"../engine/transitions/FadeTransition.js";import"../engine/webgl/enums.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/checkWebGLError.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../../webgl/FBOAttachmentType.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../engine/vectorTiles/enums.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/TechniqueType.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../Color.js";import"../engine/webgl/shaderGraph/techniques/shaders/constants.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../arcade/ArcadeDate.js";import"../../../intl/locale.js";import"luxon";import"../../../core/sql/UnknownTimeZone.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../chunks/pe.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import b from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as T,MapServiceLayerViewHelper as G}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as q}from"../../support/drapedUtils.js";import{defaultHighlightName as V}from"../../support/HighlightDefaults.js";import{TaskPriority as v}from"../../support/Scheduler.js";const I=[0,0];let P=class extends(b(n(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:v.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),T(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new G({createFetchPopupFeaturesQueryGeometry:(e,i)=>q(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add((()=>this.resampling),(()=>{this.doRefresh()}))),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=t?.name??V;return this._addHighlightGraphics(s,r),i((()=>!this.destroyed&&this._removeHighlightGraphics(s,r)))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map((e=>e.uid)),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map((e=>e.uid)),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh((e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e))))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.tileInfo.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.tileInfo.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.tileInfo.size);a=await this._fetchImage(h,o)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.tileInfo.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],P.prototype,"resampling",null),e([o()],P.prototype,"tilemapCache",null),P=e([l("esri.views.2d.layers.TileLayerView2D")],P);const C=P;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{watch as s,initial as o}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/GraphicsLayer.js";import m from"../../../layers/support/TelemetryDisplay.js";import h from"../../../symbols/SimpleFillSymbol.js";import y from"../../../symbols/SimpleLineSymbol.js";import p from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolRotation as c,applyCIMSymbolColor as b}from"../../../symbols/support/cimSymbolUtils.js";import{symbolTypes as f}from"../../../symbols/support/typeUtils.js";import u from"../engine/webgl/OverlayContainer.js";import d from"../engine/webgl/OverlayMultipoint.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import _ from"./graphics/GraphicContainer.js";import C from"./graphics/GraphicsView2D.js";import v from"../../layers/LayerView.js";const L=new t([255,127,0]),S=10005;let w=class extends(g(v)){constructor(){super(...arguments),this._graphicsLayer=new n,this._frameOutlineGraphic=new i({symbol:new h({outline:{type:"simple-line",color:L}})}),this._sensorTrailGraphic=new i({symbol:new y({color:L})}),this._lineOfSightGraphic=new i({symbol:new y({color:L})}),this._sensorLocationGraphic=new i({symbol:new p({color:L})}),this._frameCenterGraphic=new i({symbol:new p({color:L,style:"cross"})}),this._overlayContainer=null,this._sensorLocationSymbolType=null,this.layer=null,this.sensorLocationSymbol=null,this.symbolAngle=0,this.symbolColor=null,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=r(this._graphicsLayer)}initialize(){this.symbolColor=this.layer?.telemetryColor??L,this._sensorLocationSymbolType=this.layer?.sensorSymbol.type,this._setSensorLocationSymbol(),this.addHandles(s((()=>this.symbolColor),(()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor,this._updateSensorLocationSymbolColor()}),o)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new m({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new u,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new C({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new _(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([s((()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight]),(()=>this._updateVisibleTelemetryElements()),o),s((()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight]),(()=>this._updateGraphicGeometries()),o),s((()=>this.layer.metadata),(()=>this._updateSensorLocationSymbolAngle()),o)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=r(this.graphicsView)}supportsSpatialReference(e){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:t}=this;e&&t&&(t.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&e.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,t.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}_updateSensorLocationSymbolAngle(){if(!this.layer?.metadata?.size||!this._sensorLocationGraphic.symbol)return;const e=this.layer?.metadata?.get(S);if(!e?.value||"number"!=typeof e?.value)return;this.symbolAngle=Math.round(e?.value);const t=this._sensorLocationGraphic.symbol.clone();"simple-marker"===t.type||"picture-marker"===t.type?t.angle=this.symbolAngle:"cim"===t.type&&c(t,this.symbolAngle,!0),this._sensorLocationGraphic.symbol=t}_setSensorLocationSymbol(){switch(this._sensorLocationSymbolType){case"simple-marker":case"picture-marker":case"cim":this.sensorLocationSymbol=this.layer.sensorSymbol,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol}}_updateSensorLocationSymbolColor(){if(!this._sensorLocationGraphic?.symbol)return;const e=this._sensorLocationGraphic.symbol.clone();"simple-marker"===e.type?(e.color=this.symbolColor,e.outline.color=this.symbolColor):"picture-marker"===e.type?e.color=this.symbolColor:"cim"===e.type&&(e.color=this.symbolColor,b(e,this.symbolColor)),this._sensorLocationGraphic.symbol=e}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const e=new d(this.layer.videoElement);this.addAttachHandles([s((()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints]),(()=>{const{visibleTelemetryElements:t}=this;t?.frame?(e.frameHorizonPoints=this.layer.frameHorizonPoints,e.groundControlPoints=this.layer.groundControlPoints,e.opacity=1):e.opacity=0}),o)]),this._overlayContainer.addChild(e),this.view.stage.requestRender()}};e([l()],w.prototype,"graphicsView",void 0),e([l()],w.prototype,"layer",void 0),e([l({types:f})],w.prototype,"sensorLocationSymbol",void 0),e([l()],w.prototype,"symbolAngle",void 0),e([l()],w.prototype,"symbolColor",void 0),e([l({type:m})],w.prototype,"visibleTelemetryElements",void 0),w=e([a("esri.views.2d.layers.VideoLayerView2D")],w);const G=w;export{G as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import r from"../../../Graphic.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as s,initial as l}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/GraphicsLayer.js";import m from"../../../layers/support/TelemetryDisplay.js";import y from"../../../symbols/SimpleFillSymbol.js";import h from"../../../symbols/SimpleLineSymbol.js";import p from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolRotation as c,applyCIMSymbolColor as b}from"../../../symbols/support/cimSymbolUtils.js";import{symbolTypes as u}from"../../../symbols/support/typeUtils.js";import f from"../engine/webgl/OverlayContainer.js";import d from"../engine/webgl/OverlayMultipoint.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import S from"./graphics/GraphicContainer.js";import _ from"./graphics/GraphicsView2D.js";import C from"../../layers/LayerView.js";const L=new t([255,127,0]),v=10005;let T=class extends(g(C)){constructor(){super(...arguments),this._graphicsLayer=new n,this._frameOutlineGraphic=new r({symbol:new y({outline:{type:"simple-line",color:L}})}),this._frameCenterGraphic=new r({symbol:new p({color:L,style:"cross"})}),this._sensorTrailGraphic=new r({symbol:new h({color:L})}),this._sensorSightlineGraphic=new r({symbol:new h({color:L})}),this._sensorLocationGraphic=new r({symbol:new p({color:L})}),this._overlayContainer=null,this._sensorLocationSymbolType=null,this.layer=null,this.sensorLocationSymbol=null,this.symbolAngle=0,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=i(this._graphicsLayer)}initialize(){this._sensorLocationSymbolType=this.layer?.sensorSymbol.type,this._graphicsLayer.graphics.addMany([this._frameCenterGraphic,this._frameOutlineGraphic,this._sensorLocationGraphic,this._sensorSightlineGraphic,this._sensorTrailGraphic]),this.visibleTelemetryElements=new m({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new f,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new _({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new S(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([s((()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight]),(()=>this._updateVisibleTelemetryElements()),l),s((()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight]),(()=>this._updateGraphicGeometries()),l),s((()=>this.layer.metadata),(()=>this._updateSensorLocationSymbolAngle()),l),s((()=>this.layer?.frameCenterSymbol),(()=>this._updateFrameCenterSymbol()),l),s((()=>this.layer?.frameOutlineSymbol),(()=>this._updateFrameOutlineSymbol()),l),s((()=>this.layer?.sensorSightLineSymbol),(()=>this._updateSensorSightlineSymbol()),l),s((()=>this.layer?.sensorSymbol),(()=>this._updateSensorLocationSymbol()),l),s((()=>this.layer?.sensorTrailSymbol),(()=>this._updateSensorTrailSymbol()),l),s((()=>this.layer?.telemetryColor),(()=>this._updateTelemetryColor()),l)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=i(this.graphicsView)}supportsSpatialReference(e){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:t}=this;e&&t&&(t.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&e.lineOfSight?this._sensorSightlineGraphic.geometry=this.layer.telemetry.lineOfSight:this._sensorSightlineGraphic.geometry=null,t.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}_updateSensorLocationSymbolAngle(){if(!this.layer?.metadata?.size||!this._sensorLocationGraphic.symbol)return;const e=this.layer?.metadata?.get(v);if(!e?.value||"number"!=typeof e?.value)return;this.symbolAngle=Math.round(e?.value);const t=this._sensorLocationGraphic.symbol.clone();"simple-marker"===t.type||"picture-marker"===t.type?t.angle=this.symbolAngle:"cim"===t.type&&c(t,this.symbolAngle,!0),this._sensorLocationGraphic.symbol=t}_updateSensorLocationSymbolColor(){if(!this._sensorLocationGraphic?.symbol)return;const e=this._sensorLocationGraphic.symbol.clone();"simple-marker"===e.type?(e.color=this.layer?.telemetryColor||L,e.outline.color=this.layer.telemetryColor):"picture-marker"===e.type?e.color=this.layer?.telemetryColor||L:"cim"===e.type&&(e.color=this.layer?.telemetryColor||L,e?.color&&b(e,e.color||L)),this._sensorLocationGraphic.symbol=e.clone()}_updateTelemetryColor(){this._frameOutlineGraphic.symbol.outline.color=this.layer?.telemetryColor||L,this._sensorTrailGraphic.symbol.color=this.layer?.telemetryColor||L,this._sensorSightlineGraphic.symbol.color=this.layer?.telemetryColor||L,this._frameCenterGraphic.symbol.color=this.layer?.telemetryColor||L,this._updateSensorLocationSymbolColor()}_updateSensorLocationSymbol(){switch(this._sensorLocationSymbolType){case"simple-marker":case"picture-marker":case"cim":this.sensorLocationSymbol=this.layer.sensorSymbol,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol}}_updateFrameCenterSymbol(){this.layer?.frameCenterSymbol&&(this._frameCenterGraphic.symbol=this.layer.frameCenterSymbol.clone())}_updateFrameOutlineSymbol(){this.layer?.frameOutlineSymbol&&(this._frameOutlineGraphic.symbol=this.layer.frameOutlineSymbol.clone())}_updateSensorSightlineSymbol(){this.layer?.sensorSightLineSymbol&&(this._sensorSightlineGraphic.symbol=this.layer.sensorSightLineSymbol.clone())}_updateSensorTrailSymbol(){this.layer?.sensorTrailSymbol&&(this._sensorTrailGraphic.symbol=this.layer.sensorTrailSymbol.clone())}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const e=new d(this.layer.videoElement);this.addAttachHandles([s((()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints]),(()=>{const{visibleTelemetryElements:t}=this;t?.frame?(e.frameHorizonPoints=this.layer.frameHorizonPoints,e.groundControlPoints=this.layer.groundControlPoints,e.opacity=1):e.opacity=0}),l)]),this._overlayContainer.addChild(e),this.view.stage.requestRender()}};e([o()],T.prototype,"graphicsView",void 0),e([o()],T.prototype,"layer",void 0),e([o({types:u})],T.prototype,"sensorLocationSymbol",void 0),e([o()],T.prototype,"symbolAngle",void 0),e([o({type:m})],T.prototype,"visibleTelemetryElements",void 0),T=e([a("esri.views.2d.layers.VideoLayerView2D")],T);const G=T;export{G as default};