@arcgis/core 4.33.0-next.20250521 → 4.33.0-next.20250522

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 (237) hide show
  1. package/applications/Components/analysisUtils.d.ts +2 -0
  2. package/applications/Components/analysisUtils.js +1 -1
  3. package/arcade/featureset/actions/GroupBy.js +1 -1
  4. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/0a770f283eb77c8dc97a.js +1 -0
  7. package/assets/esri/core/workers/chunks/0dcab04dd1feeb5521cf.js +1 -0
  8. package/assets/esri/core/workers/chunks/{8a2cee726b7843c7408a.js → 0fb5de3f8a4d69b2d514.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{7c819b3e6d69c526f4b2.js → 1c86aa3802d9ae0230ae.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{b53a7040a71b0f1f3854.js → 23f6e98ef22f099f846c.js} +1 -1
  11. package/assets/esri/core/workers/chunks/28b1819bf744ce957dfd.js +2 -0
  12. package/assets/esri/core/workers/chunks/28b1819bf744ce957dfd.js.LICENSE.txt +33 -0
  13. package/assets/esri/core/workers/chunks/{234117cc5cb7c6863313.js → 2d90806faa4269828948.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{e2cada6644c49b1b6e79.js → 36b0d6b4089a96475201.js} +1 -1
  15. package/assets/esri/core/workers/chunks/40f54c4f8ae63c6f3df9.js +1 -0
  16. package/assets/esri/core/workers/chunks/4193c52799aa3b6337c9.js +2 -0
  17. package/assets/esri/core/workers/chunks/{9588328d4ed6b0f04166.js.LICENSE.txt → 4193c52799aa3b6337c9.js.LICENSE.txt} +0 -34
  18. package/assets/esri/core/workers/chunks/42d9989b2aad3ac28d4d.js +1 -0
  19. package/assets/esri/core/workers/chunks/{8a6aac37b3133de74cce.js → 51c31e6d014005107d42.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{5c8d52b72a3bea4202ac.js → 634a418310e44e2436e0.js} +1 -1
  21. package/assets/esri/core/workers/chunks/6ee41e9c92ed8ba4c763.js +1 -0
  22. package/assets/esri/core/workers/chunks/{83fcc6f770ad084b8ab9.js → 86023cc5ccbc7ac43479.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{cc4a6f4000cb6680be48.js → ac2607f1e8cd2e99907c.js} +2 -2
  24. package/assets/esri/core/workers/chunks/bf3555f91492a1a3b613.js +1 -0
  25. package/assets/esri/core/workers/chunks/d2ebb72a43d995ed368a.js +1 -0
  26. package/assets/esri/core/workers/chunks/dbe10c20df7e0e563a0b.js +1 -0
  27. package/assets/esri/core/workers/chunks/df933eac03dc63064723.js +1 -0
  28. package/assets/esri/core/workers/chunks/e77371ddbaf4b2d9be8d.js +1 -0
  29. package/assets/esri/core/workers/chunks/{19a58adc75a34f84b0ef.js → ee6240636d04d7d37b7b.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{f74f8ed3f17713a208c3.js → fa63b0f7fa799cb2f81d.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{6c29a768f02dc7ce0ed6.js → fb9e9b9e567e32f37042.js} +1 -1
  32. package/assets/esri/core/workers/chunks/fc61d02286b6ff5447cc.js +1 -0
  33. package/assets/esri/themes/base/widgets/_Editor.scss +40 -2
  34. package/assets/esri/themes/base/widgets/_FeatureForm.scss +4 -0
  35. package/assets/esri/themes/base/widgets/_SelectionList.scss +21 -15
  36. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +1 -0
  37. package/assets/esri/themes/dark/main.css +1 -1
  38. package/assets/esri/themes/light/main.css +1 -1
  39. package/assets/esri/themes/light/view.css +1 -1
  40. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  41. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  42. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  43. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  44. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  45. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  46. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  47. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  48. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  49. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  50. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  51. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  52. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  53. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  54. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  55. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  56. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  57. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  58. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  59. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  60. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  61. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  62. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  63. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  64. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  65. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  66. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  67. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  68. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  69. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  70. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  71. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  72. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  73. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  74. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  75. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  76. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  77. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  78. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  81. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm.json +1 -1
  82. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_en.json +1 -1
  83. package/assets/esri/widgets/Home/t9n/Home_pt-BR.json +1 -1
  84. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  85. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  86. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  87. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  88. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  89. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  90. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  91. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  92. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  93. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  94. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  95. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  96. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  97. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  98. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  99. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  100. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  101. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  102. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  103. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  104. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  105. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  106. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  107. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  108. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  109. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  110. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  111. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  112. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  113. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  114. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  115. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  116. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  117. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  118. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  119. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  120. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  121. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  122. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  123. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  124. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  125. package/chunks/ComponentShader.glsl.js +24 -15
  126. package/core/sanitizerUtils.js +5 -0
  127. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  128. package/editing/sharedTemplates/templateDefinitions/FeatureTemplateDefinition.js +1 -1
  129. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  130. package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
  131. package/editing/sharedTemplates/templateDefinitions/parts/FeatureTemplateRelationshipPart.js +1 -1
  132. package/editing/sharedTemplates/templateDefinitions/parts/GroupTemplatePart.js +1 -1
  133. package/editing/sharedTemplates/templateDefinitions/parts/PresetTemplatePart.js +1 -1
  134. package/interfaces.d.ts +193 -11
  135. package/layers/IntegratedMeshLayer.js +1 -1
  136. package/layers/WMSLayer.js +1 -1
  137. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  138. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  139. package/layers/mixins/ArcGISImageService.js +1 -1
  140. package/layers/support/VideoElement.js +1 -1
  141. package/layers/support/capabilities.js +1 -1
  142. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  143. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  144. package/libs/maquette/projection.js +1 -1
  145. package/networks/UnitIdentifierManager.js +5 -0
  146. package/networks/support/UNTraceConfiguration.js +1 -1
  147. package/package.json +1 -1
  148. package/rest/featureService/FeatureService.js +1 -1
  149. package/rest/knowledgeGraph/GraphAddNamedTypesResult.d.ts +4 -0
  150. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.d.ts +4 -0
  151. package/rest/knowledgeGraphService.d.ts +2 -0
  152. package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
  153. package/rest/query/executeQuery.js +1 -1
  154. package/rest/query/executeQueryJSON.js +1 -1
  155. package/rest/query/executeQueryPBF.js +1 -1
  156. package/rest/query.js +1 -1
  157. package/smartMapping/renderers/support/spikeUtils.js +1 -1
  158. package/support/revision.js +1 -1
  159. package/views/2d/LabelManager.js +1 -1
  160. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  161. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  162. package/views/2d/engine/vectorTiles/decluttering/core.js +1 -1
  163. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  164. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  165. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  166. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  167. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  168. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  169. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
  170. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  171. package/views/2d/layers/features/FeatureContainer.js +1 -1
  172. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  173. package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
  174. package/views/3d/FocusAreasView.js +1 -1
  175. package/views/3d/layers/I3SMeshView3D.js +1 -1
  176. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  177. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  178. package/views/3d/layers/i3s/enums.js +1 -1
  179. package/views/3d/terrain/TerrainRenderer.js +1 -1
  180. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  181. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  182. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  183. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  184. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  185. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  186. package/views/3d/webgl-engine/lib/RenderSlot.js +1 -1
  187. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  188. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  189. package/views/ui/UI.js +1 -1
  190. package/views/webgl/Texture.js +1 -1
  191. package/views/webgl/rasterUtils.js +1 -1
  192. package/webscene/Slide.js +1 -1
  193. package/widgets/DirectionalPad.js +1 -1
  194. package/widgets/Editor/EditorViewModel.js +1 -1
  195. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  196. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  197. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  198. package/widgets/Editor/UpdateWorkflow.js +1 -1
  199. package/widgets/Editor/VisibleElements.js +1 -1
  200. package/widgets/Editor/components/FooterActions.js +1 -1
  201. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  202. package/widgets/Editor/css.js +1 -1
  203. package/widgets/Editor.js +1 -1
  204. package/widgets/FeatureForm/TextElementInput.js +1 -1
  205. package/widgets/FeatureForm/css.js +1 -1
  206. package/widgets/FeatureForm.js +1 -1
  207. package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
  208. package/widgets/FeatureTable/FieldColumn.js +1 -1
  209. package/widgets/FeatureTable/Grid/Column.js +1 -1
  210. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  211. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  212. package/widgets/FeatureTable/support/exportUtils.js +1 -1
  213. package/widgets/FeatureTable.js +1 -1
  214. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  215. package/widgets/Sketch.js +1 -1
  216. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  217. package/widgets/support/SelectionList/VisibleElements.js +1 -1
  218. package/widgets/support/SelectionList.js +1 -1
  219. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  220. package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
  221. package/widgets/support/SelectionToolbar.js +1 -1
  222. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  223. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  224. package/widgets/support/widget.js +1 -1
  225. package/widgets/support/widgetUtils.js +1 -1
  226. package/assets/esri/core/workers/chunks/0c50ee1f3cdd30d96479.js +0 -1
  227. package/assets/esri/core/workers/chunks/133e4bde346828d4510b.js +0 -1
  228. package/assets/esri/core/workers/chunks/5228d39c05d660a135b6.js +0 -1
  229. package/assets/esri/core/workers/chunks/5f4ca51b82daf0e51010.js +0 -1
  230. package/assets/esri/core/workers/chunks/8fda0a5b247385e68dc0.js +0 -1
  231. package/assets/esri/core/workers/chunks/938f1eebc48871be64e9.js +0 -1
  232. package/assets/esri/core/workers/chunks/9588328d4ed6b0f04166.js +0 -2
  233. package/assets/esri/core/workers/chunks/9839309d0cd804fe52c2.js +0 -1
  234. package/assets/esri/core/workers/chunks/9b610fbfcd47c3dde34d.js +0 -1
  235. package/assets/esri/core/workers/chunks/be2c8c0a8b2bce7979b6.js +0 -1
  236. package/assets/esri/core/workers/chunks/f218a190015de1444018.js +0 -1
  237. package/assets/esri/core/workers/chunks/f9567108862629f25c8b.js +0 -1
@@ -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{Technique as e}from"../Technique.js";import{RasterTechniqueType as t}from"../TechniqueType.js";import{RasterColorizerLUTShader as o}from"../shaders/raster/RasterColorizerLUTShader.js";import{RasterColorizerShadedReliefShader as r}from"../shaders/raster/RasterColorizerShadedReliefShader.js";import{RasterColorizerStretchShader as i}from"../shaders/raster/RasterColorizerStretchShader.js";import{StencilOperation as n,CompareFunction as s}from"../../../../../../webgl/enums.js";class a extends e{constructor(){super(...arguments),this.name="BrushRasterColorizer",this.type=t.RasterColorizer,this.shaders={lut:new o,stretch:new i,shadedRelief:new r}}render(e,t){for(const o of t.bitmaps){if(!o.source||o.suspended)continue;e.timeline.begin(this.name);const{painter:t}=e;t.setPipelineState({depth:!1,stencil:{test:{mask:255,ref:o.stencilRef,compare:s.EQUAL,op:{fail:n.KEEP,zFail:n.KEEP,zPass:n.KEEP}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),o.updateTexture(e),o.processedTexture||o.updateProcessedTexture();const{type:r}=o.symbolizerParameters,i="stretch"===r?this._getStretchOptions(o):"lut"===r?this._getLutOptions(o):this._getShadedReliefOptions(o);"bilinear"!==o.interpolation||e.context.capabilities.textureFloatLinear||(i.defines.bilinear=!0),t.submitDrawMesh(e.context,i,t.quadMesh),e.timeline.end(this.name)}}_getLutOptions(e){const{config:t,projectionConfig:o,colormapConfig:r,projectionDefines:i}=this._getCommonConfig(e),n=this._getInterpolationDefines("nearest",!1);return{shader:this.shaders.lut,uniforms:{projectionConfig:o,config:t,colormapConfig:r},defines:{...i,...n},optionalAttributes:null,useComputeBuffer:!1}}_getStretchOptions(e){const t=e.symbolizerParameters,{config:o,projectionConfig:r,colormapConfig:i,projectionDefines:n}=this._getCommonConfig(e),s=this._getInterpolationDefines(e.interpolation,1===t.bandCount);return{shader:this.shaders.stretch,uniforms:{projectionConfig:r,config:o,stretchConfig:t,colormapConfig:i},defines:{...n,...s,isMultiband:t.bandCount>1,applyColormap:!!i,useGamma:t.useGamma,noOp:e.isRendereredSource&&!e.processed},optionalAttributes:null,useComputeBuffer:!1}}_getShadedReliefOptions(e){const t=e.symbolizerParameters,{config:o,projectionConfig:r,colormapConfig:i,projectionDefines:n}=this._getCommonConfig(e),s=this._getInterpolationDefines(e.interpolation,!0);return{shader:this.shaders.shadedRelief,uniforms:{projectionConfig:r,config:o,hillshadeConfig:t,colormapConfig:i},defines:{...n,...s,isMultidirectional:t.hillshadeType>0,applyColormap:!!i},optionalAttributes:null,useComputeBuffer:!1}}_getCommonConfig(e){const{coordScale:t,computedOpacity:o,transforms:r}=e,{names:i,textures:n}=e.getTextures({useProcessedTexture:e.processed}),s=n[i.indexOf("u_image")],a=e.getRasterTextureSize(),c={texture:{texture:s,unit:0},dvsMat3:r.displayViewScreenMat3,coordScale:t,srcImageSize:a,opacity:o},p=n[i.indexOf("u_transformGrid")],{transformGrid:l}=e,f=!(!p||!l),m=f?{transformTexture:{texture:p,unit:2},targetImageSize:[e.width,e.height],transformSpacing:l.spacing,transformGridSize:l.size}:void 0,u=n[i.indexOf("u_colormap")],{colormap:d,colormapOffset:h}=e.symbolizerParameters;return{config:c,projectionConfig:m,colormapConfig:u&&d?{colormapTexture:{texture:u,unit:1},colormapOffset:h??0,colormapMaxIndex:d.length/4-1}:void 0,projectionDefines:{applyProjection:f,lookupProjection:f&&1===l.spacing[0]}}}_getInterpolationDefines(e,t){const o="bilinear"===e&&t;return{bilinear:o,bicubic:"cubic"===e,nearestOnEdge:o}}}export{a as RasterColorizerTechnique};
5
+ import{Technique as e}from"../Technique.js";import{RasterTechniqueType as t}from"../TechniqueType.js";import{RasterColorizerLUTShader as o}from"../shaders/raster/RasterColorizerLUTShader.js";import{RasterColorizerShadedReliefShader as i}from"../shaders/raster/RasterColorizerShadedReliefShader.js";import{RasterColorizerStretchShader as r}from"../shaders/raster/RasterColorizerStretchShader.js";import{StencilOperation as s,CompareFunction as n}from"../../../../../../webgl/enums.js";class a extends e{constructor(){super(...arguments),this.name="BrushRasterColorizer",this.type=t.RasterColorizer,this.shaders={lut:new o,stretch:new r,shadedRelief:new i}}render(e,t){for(const o of t.bitmaps){if(!o.source||o.suspended)continue;e.timeline.begin(this.name);const{painter:t}=e;t.setPipelineState({depth:!1,stencil:{test:{mask:255,ref:o.stencilRef,compare:n.EQUAL,op:{fail:s.KEEP,zFail:s.KEEP,zPass:s.KEEP}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),o.updateTexture(e),o.processedTexture||o.updateProcessedTexture();const{type:i}=o.symbolizerParameters,r="stretch"===i?this._getStretchOptions(o):"lut"===i?this._getLutOptions(o):this._getShadedReliefOptions(o);"bilinear"!==o.interpolation||e.context.capabilities.textureFloatLinear||(r.defines.bilinear=!0),t.submitDrawMesh(e.context,r,t.quadMesh),e.timeline.end(this.name)}}_getLutOptions(e){const{config:t,projectionConfig:o,colormapConfig:i,pixelMaskConfig:r,projectionDefines:s}=this._getCommonConfig(e),n=this._getInterpolationDefines("nearest",!1);return{shader:this.shaders.lut,uniforms:{projectionConfig:o,config:t,colormapConfig:i,pixelMaskConfig:r},defines:{...s,...n,applyPixelMask:!!r},optionalAttributes:null,useComputeBuffer:!1}}_getStretchOptions(e){const t=e.symbolizerParameters,{config:o,projectionConfig:i,colormapConfig:r,pixelMaskConfig:s,projectionDefines:n}=this._getCommonConfig(e),a=this._getInterpolationDefines(e.interpolation,1===t.bandCount);return{shader:this.shaders.stretch,uniforms:{projectionConfig:i,config:o,stretchConfig:t,colormapConfig:r,pixelMaskConfig:s},defines:{...n,...a,isMultiband:t.bandCount>1,applyColormap:!!r,useGamma:t.useGamma,noOp:e.isRendereredSource&&!e.processed,applyPixelMask:!!s},optionalAttributes:null,useComputeBuffer:!1}}_getShadedReliefOptions(e){const t=e.symbolizerParameters,{config:o,projectionConfig:i,colormapConfig:r,pixelMaskConfig:s,projectionDefines:n}=this._getCommonConfig(e),a=this._getInterpolationDefines(e.interpolation,!0);return{shader:this.shaders.shadedRelief,uniforms:{projectionConfig:i,config:o,hillshadeConfig:t,colormapConfig:r,pixelMaskConfig:s},defines:{...n,...a,isMultidirectional:t.hillshadeType>0,applyColormap:!!r,applyPixelMask:!!s},optionalAttributes:null,useComputeBuffer:!1}}_getCommonConfig(e){const{coordScale:t,computedOpacity:o,transforms:i}=e,{names:r,textures:s}=e.getTextures({useProcessedTexture:e.processed}),n=s[r.indexOf("u_image")],a=e.getRasterTextureSize(),p={texture:{texture:n,unit:0},dvsMat3:i.displayViewScreenMat3,coordScale:t,srcImageSize:a,opacity:o},l=s[r.indexOf("u_transformGrid")],{transformGrid:c}=e,f=!(!l||!c),m=f?{transformTexture:{texture:l,unit:2},targetImageSize:[e.width,e.height],transformSpacing:c.spacing,transformGridSize:c.size}:void 0,u=s[r.indexOf("u_colormap")],{colormap:d,colormapOffset:g}=e.symbolizerParameters,h=u&&d?{colormapTexture:{texture:u,unit:1},colormapOffset:g??0,colormapMaxIndex:d.length/4-1}:void 0,C=s[r.indexOf("u_mask")];return{config:p,projectionConfig:m,colormapConfig:h,pixelMaskConfig:C?{maskTexture:{texture:C,unit:3}}:void 0,projectionDefines:{applyProjection:f,lookupProjection:f&&1===c.spacing[0]}}}_getInterpolationDefines(e,t){const o="bilinear"===e&&t;return{bilinear:o,bicubic:"cubic"===e,nearestOnEdge:o}}}export{a as RasterColorizerTechnique};
@@ -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{RasterTechniqueType as e}from"../../TechniqueType.js";import{BaseRasterProcessorTechnique as r}from"./BaseRasterProcessorTechnique.js";import{ReprojectShader as t}from"../../shaders/raster/processor/ReprojectShader.js";class o extends r{constructor(){super(...arguments),this.name="RasterReprojectProcessor",this.type=e.Reproject,this.shaders={reproject:new t}}_process(e,r){const t=e.rasterFunction.parameters,o=this._getInterpolationDefines(r.interpolation,!!t.requireNNEdge),{config:i,projectionConfig:n,projectionDefines:s}=this._getReprojectConfig(r),a={shader:this.shaders.reproject,uniforms:{config:i,projectionConfig:n},defines:{...s,...o},optionalAttributes:null,useComputeBuffer:!1},{interpolation:c}=r;r.interpolation="nearest";const{painter:p,context:u}=e;p.submitDrawMesh(u,a,p.quadMesh),r.interpolation=c,r.projected=!0}_getReprojectConfig(e){const{source:r}=e,{names:t,textures:o}=e.getTextures({forProcessing:!0}),i={texture:{texture:o[t.indexOf("u_image")],unit:0},dvsMat3:new Float32Array([2,0,0,0,2,0,-1,-1,0]),coordScale:[1,1],srcImageSize:[r.width,r.height],opacity:1},n=o[t.indexOf("u_transformGrid")],{transformGrid:s}=e,a=!(!n||!s);return{config:i,projectionConfig:a?{transformTexture:{texture:n,unit:1},targetImageSize:[e.width,e.height],transformSpacing:s.spacing,transformGridSize:s.size}:void 0,projectionDefines:{applyProjection:a,lookupProjection:a&&1===s.spacing[0]}}}_getInterpolationDefines(e,r){const t="bilinear"===e&&r;return{bilinear:t,bicubic:"cubic"===e,nearestOnEdge:t}}}export{o as ReprojectTechnique};
5
+ import{RasterTechniqueType as e}from"../../TechniqueType.js";import{BaseRasterProcessorTechnique as r}from"./BaseRasterProcessorTechnique.js";import{ReprojectShader as t}from"../../shaders/raster/processor/ReprojectShader.js";class o extends r{constructor(){super(...arguments),this.name="RasterReprojectProcessor",this.type=e.Reproject,this.shaders={reproject:new t}}_process(e,r){const t=e.rasterFunction.parameters,o=this._getInterpolationDefines(r.interpolation,!!t.requireNNEdge),{config:i,projectionConfig:n,projectionDefines:s}=this._getReprojectConfig(r),a={shader:this.shaders.reproject,uniforms:{config:i,projectionConfig:n},defines:{...s,...o,applyPixelMask:!1},optionalAttributes:null,useComputeBuffer:!1},{interpolation:c}=r;r.interpolation="nearest";const{painter:p,context:u}=e;p.submitDrawMesh(u,a,p.quadMesh),r.interpolation=c,r.projected=!0}_getReprojectConfig(e){const{source:r}=e,{names:t,textures:o}=e.getTextures({forProcessing:!0}),i={texture:{texture:o[t.indexOf("u_image")],unit:0},dvsMat3:new Float32Array([2,0,0,0,2,0,-1,-1,0]),coordScale:[1,1],srcImageSize:[r.width,r.height],opacity:1},n=o[t.indexOf("u_transformGrid")],{transformGrid:s}=e,a=!(!n||!s);return{config:i,projectionConfig:a?{transformTexture:{texture:n,unit:1},targetImageSize:[e.width,e.height],transformSpacing:s.spacing,transformGridSize:s.size}:void 0,projectionDefines:{applyProjection:a,lookupProjection:a&&1===s.spacing[0]}}}_getInterpolationDefines(e,r){const t="bilinear"===e&&r;return{bilinear:t,bicubic:"cubic"===e,nearestOnEdge:t}}}export{o as ReprojectTechnique};
@@ -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 o,a as t}from"../../../../../../../../chunks/tslib.es6.js";import{GraphShaderModule as i,FragmentOutput as e,location as r,uniform as p,define as n,option as s,input as c,VertexInput as l,UniformGroup as a,FragmentInput as d}from"../../../GraphShaderModule.js";import{Vec3 as y,Vec4 as u,ifElse as v,Vec2 as g,Sampler2D as h,Mat3 as m,Float as b}from"../../../graph/glsl.js";import{getPixelLocation as f,isOutside as j,getPixel as x,ProjectionConfig as P}from"./projection.js";class w extends l{}o([r(0,g)],w.prototype,"position",void 0);class k extends d{}class E extends a{}o([p(h)],E.prototype,"texture",void 0),o([p(m)],E.prototype,"dvsMat3",void 0),o([p(g)],E.prototype,"coordScale",void 0),o([p(g)],E.prototype,"srcImageSize",void 0),o([p(b)],E.prototype,"opacity",void 0);class O extends i{constructor(){super(...arguments),this.applyProjection=!0,this.lookupProjection=!1,this.bilinear=!1,this.bicubic=!1,this.nearestOnEdge=!1}vertex(o){const t=o.position,{dvsMat3:i,coordScale:e}=this.config,r=i.multiply(new y(t.multiply(e),1));return{uv:t,glPosition:new u(r,1)}}fragment(o){const t=new e,i=f(o.uv,this.applyProjection?this.projectionConfig:void 0,this.lookupProjection),r=v(j(i),new u(0,0,0,0),this._colorize(i)),p=r.a.multiply(this.config.opacity);return t.fragColor=new u(r.rgb,1).multiply(p),t}_getPixel(o){const{config:t,bicubic:i,bilinear:e,nearestOnEdge:r}=this;return x(o,t,{bicubic:i,bilinear:e,nearestOnEdge:r})}}o([n],O.prototype,"applyProjection",void 0),o([n],O.prototype,"lookupProjection",void 0),o([n],O.prototype,"bilinear",void 0),o([n],O.prototype,"bicubic",void 0),o([n],O.prototype,"nearestOnEdge",void 0),o([p(E)],O.prototype,"config",void 0),o([s(P)],O.prototype,"projectionConfig",void 0),o([t(0,c(w))],O.prototype,"vertex",null),o([t(0,c(k))],O.prototype,"fragment",null);export{O as BaseRasterColorizerShader,k as RasterColorizerFragmentInput,E as RasterConfig};
5
+ import{_ as o,a as t}from"../../../../../../../../chunks/tslib.es6.js";import{GraphShaderModule as e,FragmentOutput as i,location as p,uniform as r,define as s,option as n,input as l,VertexInput as a,UniformGroup as c,FragmentInput as d}from"../../../GraphShaderModule.js";import{Vec3 as y,Vec4 as u,ifElse as v,texture2D as g,sign as h,Vec2 as x,Sampler2D as m,Mat3 as f,Float as b}from"../../../graph/glsl.js";import{getPixelLocation as j,isOutside as k,getPixel as P,ProjectionConfig as M}from"./projection.js";class w extends a{}o([p(0,x)],w.prototype,"position",void 0);class C extends d{}class _ extends c{}o([r(m)],_.prototype,"texture",void 0),o([r(f)],_.prototype,"dvsMat3",void 0),o([r(x)],_.prototype,"coordScale",void 0),o([r(x)],_.prototype,"srcImageSize",void 0),o([r(b)],_.prototype,"opacity",void 0);class E extends c{}o([r(m)],E.prototype,"maskTexture",void 0);class O extends e{constructor(){super(...arguments),this.applyProjection=!0,this.lookupProjection=!1,this.bilinear=!1,this.bicubic=!1,this.nearestOnEdge=!1,this.applyPixelMask=!1}vertex(o){const t=o.position,{dvsMat3:e,coordScale:i}=this.config,p=e.multiply(new y(t.multiply(i),1));return{uv:t,glPosition:new u(p,1)}}fragment(o){const t=new i,e=j(o.uv,this.applyProjection?this.projectionConfig:void 0,this.lookupProjection),p=v(k(e),new u(0,0,0,0),this._colorize(e));let r=p.a.multiply(this.config.opacity);if(this.applyPixelMask){const t=this._getPixelMask(o.uv);r=r.multiply(t)}return t.fragColor=new u(p.rgb,1).multiply(r),t}_getPixel(o){const{config:t,bicubic:e,bilinear:i,nearestOnEdge:p}=this;return P(o,t,{bicubic:e,bilinear:i,nearestOnEdge:p})}_getPixelMask(o){const{maskTexture:t}=this.pixelMaskConfig,e=g(t,o);return h(e.a)}}o([s],O.prototype,"applyProjection",void 0),o([s],O.prototype,"lookupProjection",void 0),o([s],O.prototype,"bilinear",void 0),o([s],O.prototype,"bicubic",void 0),o([s],O.prototype,"nearestOnEdge",void 0),o([s],O.prototype,"applyPixelMask",void 0),o([r(_)],O.prototype,"config",void 0),o([n(M)],O.prototype,"projectionConfig",void 0),o([n(E)],O.prototype,"pixelMaskConfig",void 0),o([t(0,l(w))],O.prototype,"vertex",null),o([t(0,l(C))],O.prototype,"fragment",null);export{O as BaseRasterColorizerShader,E as PixelMaskConfig,C as RasterColorizerFragmentInput,_ as RasterConfig};
@@ -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{clone as t}from"../../../core/lang.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{diff as n,hasDiff as o}from"../../../core/accessorSupport/diffUtils.js";import h from"../../../geometry/Point.js";import{create as u}from"../../../geometry/support/aaBoundingRect.js";import{equals as y}from"../../../geometry/support/spatialReferenceUtils.js";import{StyleUpdateType as c}from"../engine/vectorTiles/enums.js";import{TileHandler as d}from"../engine/vectorTiles/TileHandler.js";import{TileManager as _}from"../engine/vectorTiles/TileManager.js";import{VectorTile as p}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as f}from"../engine/vectorTiles/VectorTileContainer.js";import g from"../engine/vectorTiles/VectorTileFeatureIndex.js";import{StyleLayerType as m}from"../engine/vectorTiles/style/StyleDefinition.js";import T from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2DMixin as C}from"./LayerView2D.js";import R from"../tiling/TileInfoViewPOT.js";import v from"../tiling/TileQueue.js";import H from"../../layers/LayerView.js";import w from"../../layers/RefreshableLayerView.js";import{TaskPriority as I}from"../../support/Scheduler.js";const S=2,D=8,P=512;let Q=class extends(w(C(H))){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._styeChanged=!1,this._spriteSourceChanged=!1}get fading(){return this._vectorTileContainer?.fading??!1}get hasVisibleFeatures(){const e=this._vectorTileContainer.children;for(const t of e)if(t.hasFeatures())return!0;return!1}get spriteSourceChanged(){return this._spriteSourceChanged}get styleChanged(){return this._styeChanged}async hitTest(e,t){const i=this._tileHandlerPromise,s=this._vectorTileContainer?.symbolFader;if(!i||!this._isTileHandlerReady||!s)return;await i;let r=null;const a=this._vectorTileContainer?.symbolRepository;a&&(r=a.querySymbols(t,S,s.decluttererOffset,{}));const l=this.view.state,n=this._tileManager.getIntersectingTiles(t.x,t.y,S,l,r);if((!n||0===n.length)&&0===r?.length)return null;e=e.clone().normalize();const o=[],h=[];for(const u of n)o.push(this._queryTile(h,e,S,this.view.state.rotation,u,r?.filter((e=>e.tileKey.id===u.id))));return await Promise.all(o),h}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=e.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new T(e),this._tileInfoView=new R(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new f(this._tileInfoView),this._tileHandler=new d(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",(e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:c.PAINTER_CHANGED,data:e}),this.requestUpdate();else{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=i.type===m.SYMBOL;t.setPaintProperties(e.layer,e.paint),s&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}})),this.layer.on("layout-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;this._styeChanged=!0;const s=n(i.layout,e.layout);if(null!=s){if(o(s,"visibility")&&1===E(s))return t.setLayoutProperties(e.layer,e.layout),i.type===m.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:c.LAYOUT_CHANGED,data:e}),this.requestUpdate()}})),this.layer.on("style-layer-visibility-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);i&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),i.type===m.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())})),this.layer.on("style-layer-change",(e=>{this._styleChanges.push({type:c.LAYER_CHANGED,data:e}),this._styeChanged=!0,this.requestUpdate()})),this.layer.on("delete-style-layer",(e=>{this._styleChanges.push({type:c.LAYER_REMOVED,data:e}),this._styeChanged=!0,this.requestUpdate()})),this.layer.on("load-style",(()=>this._loadStyle())),this.layer.on("spriteSource-change",(e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:c.SPRITES_CHANGED,data:e});const t=this._styleRepository.layers;for(const i of t)switch(i.type){case m.SYMBOL:i.getLayoutProperty("icon-image")&&this._styleChanges.push({type:c.LAYOUT_CHANGED,data:{layer:i.id,layout:i.layout}});break;case m.LINE:i.getPaintProperty("line-pattern")&&this._styleChanges.push({type:c.PAINTER_CHANGED,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}});break;case m.FILL:i.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:c.PAINTER_CHANGED,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}})}this.requestUpdate()}))])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=s(this._vectorTileContainer),this._tileHandler=s(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return y(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){const i=this.view.scale,{minScale:s,maxScale:r}=t.layerDefinition;t?.layerDefinition&&(s&&s<i&&(e=!1),r&&r>i&&(e=!1))}return e}isUpdating(){return this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then((e=>this._parseQueue.push({key:t.key,data:e}))).then((e=>{t.once("attach",(()=>this.requestUpdate())),t.setData(e),this.requestUpdate()})).catch((e=>{r(e)||i.getLogger(this).error(e)}))),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const e=this._vectorTileContainer.children,t=[];try{for(const i of e){const e=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then((e=>this._parseQueue.push({key:i.key,data:e}))).then((e=>i.setData(e))).finally((()=>i.featureIndex=null)));t.push(e)}await Promise.all(t)}catch(s){i.getLogger(this).error("error refreshing vector-tiles layer-view",s),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new _({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then((()=>{this._fetchQueue=new v({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15,scheduler:this.scheduler,priority:I.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new v({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:I.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0}));this._tileHandler.spriteMosaic.then((e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()})),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=s(this._fetchQueue),this._parseQueue=s(this._parseQueue),this._tileManager=s(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(l){i.getLogger(this).error("error applying vector-tiles style update",l.message),this._resumeQueues(),this._isTileHandlerReady=!0}const t=this._styleRepository,s=new Set;e.forEach((e=>{if(e.type!==c.LAYER_REMOVED)return;const i=e.data,r=t.getLayerById(i.layer);r&&s.add(r.uid)}));const r=new Set;e.forEach((e=>{let i;switch(e.type){case c.PAINTER_CHANGED:t.setPaintProperties(e.data.layer,e.data.paint),i=e.data.layer;break;case c.LAYOUT_CHANGED:t.setLayoutProperties(e.data.layer,e.data.layout),i=e.data.layer;break;case c.LAYER_REMOVED:return void t.deleteStyleLayer(e.data.layer);case c.LAYER_CHANGED:t.setStyleLayer(e.data.layer,e.data.index),i=e.data.layer.id;break;case c.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(e.data.spriteSource))}if(i){const e=t.getLayerById(i);e&&r.add(e.uid)}}));const a=this._vectorTileContainer.children;if(s.size>0){const e=Array.from(s);this._vectorTileContainer.deleteStyleLayers(e);for(const t of a)t.deleteLayerData(e)}if(this._resumeQueues(),r.size>0){const e=Array.from(r),t=[];for(const i of a){const s=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then((t=>this._parseQueue.push({key:i.key,data:t,styleLayerUIDs:e}))).then((e=>i.setData(e))).finally((()=>i.featureIndex=null)));t.push(s)}await Promise.all(t)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,i=t(e);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new T(i),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,i,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(n){if(!r(n))throw n}if(s.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const a=await this._tileHandler.spriteMosaic,l=this._vectorTileContainer;this._tileInfoView=new R(this.layer.tileInfo,this.layer.fullExtent),l.setStyleResources(a,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new _({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(u(),e),i=this._tileInfoView.getTileResolution(e.level);return new p(e,i,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,t,i,s,r,a){if(0===r.layerData.size)return;const l=this._ensureTileIndex(r),n=this._tileInfoView.getTileBounds(u(),r.key,!0),o=D*P*((t.x-n[0])/(n[2]-n[0])),h=D*P*(1-(t.y-n[1])/(n[3]-n[1])),y=await l.queryAttributes(o,h,i,s,a);for(const u of y)u.graphic.geometry=this._tileToMapPoint(u.tilePoint,r.transforms.tileUnitsToPixels),e.push({type:"graphic",layer:this.layer,graphic:u.graphic,mapPoint:t.clone()});e.sort(((e,t)=>t.graphic.origin.layerIndex-e.graphic.origin.layerIndex))}_tileToMapPoint(e,t){if(!e)return null;const i=e[0]*t[0]+e[1]*t[3]+t[6],s=e[0]*t[1]+e[1]*t[4]+t[7],r=this.view.state,a=[0,0];return r.toMap(a,[i,s]),new h({x:a[0],y:a[1],spatialReference:r.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=g.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function E(e){if(null==e)return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}e([a()],Q.prototype,"_isTileHandlerReady",void 0),Q=e([l("esri.views.2d.layers.VectorTileLayerView2D")],Q);const A=Q;export{A as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{clone as t}from"../../../core/lang.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{diff as n,hasDiff as o}from"../../../core/accessorSupport/diffUtils.js";import h from"../../../geometry/Point.js";import{create as u}from"../../../geometry/support/aaBoundingRect.js";import{equals as y}from"../../../geometry/support/spatialReferenceUtils.js";import{StyleUpdateType as c}from"../engine/vectorTiles/enums.js";import{TileHandler as d}from"../engine/vectorTiles/TileHandler.js";import{TileManager as _}from"../engine/vectorTiles/TileManager.js";import{VectorTile as p}from"../engine/vectorTiles/VectorTile.js";import{VectorTileContainer as f}from"../engine/vectorTiles/VectorTileContainer.js";import g from"../engine/vectorTiles/VectorTileFeatureIndex.js";import{StyleLayerType as m}from"../engine/vectorTiles/style/StyleDefinition.js";import T from"../engine/vectorTiles/style/StyleRepository.js";import{LayerView2DMixin as C}from"./LayerView2D.js";import R from"../tiling/TileInfoViewPOT.js";import v from"../tiling/TileQueue.js";import H from"../../layers/LayerView.js";import w from"../../layers/RefreshableLayerView.js";import{TaskPriority as I}from"../../support/Scheduler.js";const S=2,D=8,P=512;let Q=class extends(w(C(H))){constructor(){super(...arguments),this._styleChanges=[],this._fetchQueue=null,this._parseQueue=null,this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._styeChanged=!1,this._spriteSourceChanged=!1}get fading(){return this._vectorTileContainer?.fading??!1}get hasVisibleFeatures(){const e=this._vectorTileContainer.children;for(const t of e)if(t.hasFeatures())return!0;return!1}get spriteSourceChanged(){return this._spriteSourceChanged}get styleChanged(){return this._styeChanged}async hitTest(e,t){const i=this._tileHandlerPromise,s=this._vectorTileContainer?.symbolFader;if(!i||!this._isTileHandlerReady||!s)return;await i;let r=null;const a=this._vectorTileContainer?.symbolRepository;a&&(r=a.querySymbols(t,S,s.decluttererOffset,{}));const l=this.view.state,n=this._tileManager.getIntersectingTiles(t.x,t.y,S,l,r);if((!n||0===n.length)&&0===r?.length)return null;e=e.clone().normalize();const o=[],h=[];for(const u of n)o.push(this._queryTile(h,e,S,this.view.state.rotation,u,r?.filter((e=>e.tileKey.id===u.id))));return await Promise.all(o),h}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._tileHandler.devicePixelRatio=e.pixelRatio,void this._loadStyle()):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new T(e),this._tileInfoView=new R(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new f(this._tileInfoView),this._tileHandler=new d(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",(e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:c.PAINTER_CHANGED,data:e}),this.requestUpdate();else{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;const s=i.type===m.SYMBOL;t.setPaintProperties(e.layer,e.paint),s&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}})),this.layer.on("layout-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);if(!i)return;this._styeChanged=!0;const s=n(i.layout,e.layout);if(null!=s){if(o(s,"visibility")&&1===E(s))return t.setLayoutProperties(e.layer,e.layout),i.type===m.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:c.LAYOUT_CHANGED,data:e}),this.requestUpdate()}})),this.layer.on("style-layer-visibility-change",(e=>{const t=this._styleRepository,i=t.getLayerById(e.layer);i&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),i.type===m.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())})),this.layer.on("style-layer-change",(e=>{this._styleChanges.push({type:c.LAYER_CHANGED,data:e}),this._styeChanged=!0,this.requestUpdate()})),this.layer.on("delete-style-layer",(e=>{this._styleChanges.push({type:c.LAYER_REMOVED,data:e}),this._styeChanged=!0,this.requestUpdate()})),this.layer.on("load-style",(()=>this._loadStyle())),this.layer.on("spriteSource-change",(e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:c.SPRITES_CHANGED,data:e});const t=this._styleRepository.layers;for(const i of t)switch(i.type){case m.SYMBOL:i.getLayoutProperty("icon-image")&&this._styleChanges.push({type:c.LAYOUT_CHANGED,data:{layer:i.id,layout:i.layout}});break;case m.LINE:i.getPaintProperty("line-pattern")&&this._styleChanges.push({type:c.PAINTER_CHANGED,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}});break;case m.FILL:i.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:c.PAINTER_CHANGED,data:{layer:i.id,paint:i.paint,isDataDriven:i.isPainterDataDriven()}})}this.requestUpdate()}))])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=s(this._vectorTileContainer),this._tileHandler=s(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return y(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){const i=this.view.scale,{minScale:s,maxScale:r}=t.layerDefinition;t?.layerDefinition&&(s&&s<i&&(e=!1),r&&r>i&&(e=!1))}return e}isUpdating(){return this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then((e=>this._parseQueue.push({key:t.key,data:e}))).then((e=>{t.once("attach",(()=>this.requestUpdate())),t.setData(e),this.requestUpdate()})).catch((e=>{r(e)||i.getLogger(this).error(e)}))),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const e=this._vectorTileContainer.children,t=[];try{for(const i of e){const e=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then((e=>this._parseQueue.push({key:i.key,data:e}))).then((e=>i.setData(e))).finally((()=>i.featureIndex=null)));t.push(e)}await Promise.all(t)}catch(s){i.getLogger(this).error("error refreshing vector-tiles layer-view",s),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new _({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then((()=>{this._fetchQueue=new v({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15,scheduler:this.scheduler,priority:I.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new v({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8,scheduler:this.scheduler,priority:I.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0}));this._tileHandler.spriteMosaic.then((e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()})),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=s(this._fetchQueue),this._parseQueue=s(this._parseQueue),this._tileManager=s(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(l){i.getLogger(this).error("error applying vector-tiles style update",l.message),this._resumeQueues(),this._isTileHandlerReady=!0}const t=this._styleRepository,s=new Set;e.forEach((e=>{if(e.type!==c.LAYER_REMOVED)return;const i=e.data,r=t.getLayerById(i.layer);r&&s.add(r.uid)}));const r=new Set;e.forEach((e=>{let i;switch(e.type){case c.PAINTER_CHANGED:t.setPaintProperties(e.data.layer,e.data.paint),i=e.data.layer;break;case c.LAYOUT_CHANGED:t.setLayoutProperties(e.data.layer,e.data.layout),i=e.data.layer;break;case c.LAYER_REMOVED:return void t.deleteStyleLayer(e.data.layer);case c.LAYER_CHANGED:t.setStyleLayer(e.data.layer,e.data.index),i=e.data.layer.id;break;case c.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(e.data.spriteSource))}if(i){const e=t.getLayerById(i);e&&r.add(e.uid)}}));const a=this._vectorTileContainer.children;if(s.size>0){const e=Array.from(s);this._vectorTileContainer.deleteStyleLayers(e);for(const t of a)t.deleteLayerData(e)}if(this._resumeQueues(),r.size>0){const e=Array.from(r),t=[];for(const i of a){const s=this._updatingHandles.addPromise(this._fetchQueue.push(i.key).then((t=>this._parseQueue.push({key:i.key,data:t,styleLayerUIDs:e}))).then((e=>i.setData(e))).finally((()=>i.featureIndex=null)));t.push(s)}await Promise.all(t)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,i=t(e);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new T(i),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,i,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(n){if(!r(n))throw n}if(s.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const a=await this._tileHandler.spriteMosaic,l=this._vectorTileContainer;this._tileInfoView=new R(this.layer.tileInfo,this.layer.fullExtent),l.setStyleResources(a,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new _({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(u(),e),i=this._tileInfoView.getTileResolution(e.level);return new p(e,i,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,t,i,s,r,a){if(0===r.layerData.size)return;const l=this._ensureTileIndex(r),n=this._tileInfoView.getTileBounds(u(),r.key,!0),o=D*P*((t.x-n[0])/(n[2]-n[0])),h=D*P*(1-(t.y-n[1])/(n[3]-n[1])),y=await l.queryAttributes(o,h,i,s,a);for(const u of y)u.graphic.geometry=this._tileToMapPoint(u.tilePoint,r.transforms.tileUnitsToPixels),e.push({type:"graphic",layer:this.layer,graphic:u.graphic,mapPoint:t.clone()});e.sort(((e,t)=>t.graphic.origin.layerIndex-e.graphic.origin.layerIndex))}_tileToMapPoint(e,t){if(!e)return null;const i=e[0]*t[0]+e[1]*t[3]+t[6],s=e[0]*t[1]+e[1]*t[4]+t[7],r=this.view.state,a=[0,0];return r.toMap(a,[i,s]),new h({x:a[0],y:a[1],spatialReference:r.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=g.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function E(e){if(null==e)return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}e([a()],Q.prototype,"_isTileHandlerReady",void 0),Q=e([l("esri.views.2d.layers.VectorTileLayerView2D")],Q);const A=Q;export{A 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 has from"../../../../core/has.js";import{throwIfAborted as e,createResolver as t}from"../../../../core/promiseUtils.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as r}from"../../engine/AFeatureContainer.js";import{WGLDrawPhase as i,FeatureSelection as n,FeatureBatchingStrategy as a}from"../../engine/webgl/enums.js";import o from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as h}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{TechniqueType as d}from"../../engine/webgl/shaderGraph/techniques/TechniqueType.js";import{RenderState as l}from"./RenderState.js";import{renderHighlight as u}from"../support/util.js";class c{constructor(e,s){this.id=e,this.version=s,this._resolver=t(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class _ extends r{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new s,this._hitTestsRequests=[],this._store=new o,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._layerView.requestUpdate(),this._renderState){const e=Array.from(this._renderState.tiles()).filter((e=>e.needsUpload));if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter(),this.requestRender())}const t=this._layerView.subscriptionManager.updateVisibility();this.setVisibleTiles(t);for(const s of this.children)s.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case i.MAP:return this._renderMapPhase(e);case i.HIGHLIGHT:return this._renderHighlightPhase(e);case i.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&h.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(p(t))return t;return null}get tiles(){return this._renderState?.tiles()}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter((e=>this._visibleTiles.has(e.key.id))):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&(this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter())}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=s;else{const e=new c(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise)}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new l((()=>this._stage),(e=>this._subscriptions.get(e)?.version),e,this.layerView.view.labelManager.symbolFader,this,this.tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const r of t)s.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}lockForOverrides(){this._renderState?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState?.unlockUploads(),this._shouldUnlockAttributeView&&(this.attributeView.unlockTextureUploads(),this._shouldUnlockAttributeView=!1),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState?.flush(),this.requestRender()}trySwapRenderState(){this._renderStateNext&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderState.flush(),this._renderStateNext=null),this.requestRender()}setVisibleTiles(e){this._visibleTiles=e;for(const t of this.tiles??[])t.rendering=e.has(t.key.id)}async onMessage(t,s){e(s);const r=t.inner;if(!this._subscriptions.has(r.id))return;const i=this._subscriptions.get(r.id);if(i.version!==r.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${r.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${r.id}] FeatureContainer - Dropping message, outdated version]`,r)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==r.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${r.version}]`),n.enqueueUpdate(t),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let s=this._hitTestsRequests.find((({x:t,y:s})=>t===e.x&&s===e.y));const r=t();return s?s.resolvers.push(r):(s={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(s)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach(((e,t)=>s.set(t,e))),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=h.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,n.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&u(e,!1,(e=>{this._renderFeatures(e,n.Highlight)}))}_renderLabelPhase(e){this._renderFeatures(e,n.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,n.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,n.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),a=t.getViewport(),o=e.passOptions,h=e.drawPhase;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),e.drawPhase=i.HITTEST;const{distance:d,smallSymbolDistance:l}=e.passOptions,u=Math.max(d,l);for(const i of this.children)i.visible&&i.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(i,e,n.All);s.draw(e),s.unbind(),t.bindFramebuffer(r),t.restoreViewport(a),e.passOptions=o,e.drawPhase=h}_renderFeatures(e,t){const s=this._getHeatmapInstance(e);null!=s?this._renderHeatmapFeatures(e,t,s):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const s of this.children)s.visible&&this._renderTile(s,e,t)}_renderHeatmapFeatures(e,t,s){for(const r of this.children)r.visible&&this._renderTile(r,e,t,d.Heatmap);s.techniqueRef.renderResolvePass(e,s)}_renderTile(e,t,s,r){const i=has("featurelayer-strict-draw-order")?a.STRICT_ORDER:has("featurelayer-force-marker-text-draw-order")?a.STRICT_MARKERS_AND_TEXT:a.BATCHING,n=e.getDisplayList(this._instanceStore,i);t.selection=s,n?.render(t,r)}}function p(e){return e.techniqueRef.type===d.Heatmap}export{_ as FeatureContainer};
5
+ import has from"../../../../core/has.js";import{throwIfAborted as e,createResolver as t}from"../../../../core/promiseUtils.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import{WGLDrawPhase as r,FeatureSelection as n,FeatureBatchingStrategy as a}from"../../engine/webgl/enums.js";import o from"../../engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js";import{Techniques as h}from"../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{TechniqueType as d}from"../../engine/webgl/shaderGraph/techniques/TechniqueType.js";import{RenderState as l}from"./RenderState.js";import{renderHighlight as u}from"../support/util.js";class c{constructor(e,s){this.id=e,this.version=s,this._resolver=t(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class _ extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new s,this._hitTestsRequests=[],this._store=new o,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._shouldUnlockAttributeView=!1,this._layerView=e,this.addTransitionable(this._layerView.featureEffectView)}renderChildren(e){if(this._updateAttributeView(),this._renderState?.update(this.attributeView.currentEpoch),this._layerView.requestUpdate(),this._renderState){const e=Array.from(this._renderState.tiles()).filter((e=>e.needsUpload));if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(t.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter(),this.requestRender())}const t=this._layerView.subscriptionManager.updateVisibility();this.setVisibleTiles(t);for(const s of this.children)s.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case r.MAP:return this._renderMapPhase(e);case r.HIGHLIGHT:return this._renderHighlightPhase(e);case r.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(null==this._instanceStore||!(e.drawPhase&h.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(p(t))return t;return null}get tiles(){return this._renderState?.tiles()}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter((e=>this._visibleTiles.has(e.key.id))):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&(this._layerView.view.labelManager.requestUpdate(),this._layerView.view.labelManager.symbolFader.restartDeclutter())}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=s;else{const e=new c(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise)}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new l((()=>this._stage),(e=>this._subscriptions.get(e)?.version),e,this.layerView.view.labelManager.symbolFader,this,this.tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const i of t)s.set(i.fieldName,{minValue:i.minValue,maxValue:i.maxValue})}lockForOverrides(){this._renderState?.lockUploads(),this._lockStatisticUpdates=!0,this.attributeView.locked||(this.attributeView.lockTextureUploads(),this._shouldUnlockAttributeView=!0)}unlockForOverrides(){this._renderState?.unlockUploads(),this._shouldUnlockAttributeView&&(this.attributeView.unlockTextureUploads(),this._shouldUnlockAttributeView=!1),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this._renderState?.flush(),this.requestRender()}trySwapRenderState(){if(this._renderStateNext){has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`);const e=new Map;for(const t of this._renderState?.tiles()||[])e.set(t.id,t.metricsVisibility);this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderState.flush();for(const t of this._renderState.tiles())t.copyMetricsVisibility(e.get(t.id)||new Set);this._renderStateNext=null}this.requestRender()}setVisibleTiles(e){this._visibleTiles=e;for(const t of this.tiles??[])t.rendering=e.has(t.key.id)}async onMessage(t,s){e(s);const i=t.inner;if(!this._subscriptions.has(i.id))return;const r=this._subscriptions.get(i.id);if(r.version!==i.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${i.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${e}] Tile[${i.id}] FeatureContainer - Dropping message, outdated version]`,i)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==i.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${i.version}]`),n.enqueueUpdate(t),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let s=this._hitTestsRequests.find((({x:t,y:s})=>t===e.x&&s===e.y));const i=t();return s?s.resolvers.push(i):(s={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(s)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const i of this.children)if(i.getSortKeys(t).forEach(((e,t)=>s.set(t,e))),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,i=e.state.scale;i<=(t||1/0)&&i>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(null==this._getHeatmapInstance(e))super.setStencilReference(e);else for(const t of this.children)t.stencilRef=h.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,n.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&u(e,!1,(e=>{this._renderFeatures(e,n.Highlight)}))}_renderLabelPhase(e){this._renderFeatures(e,n.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,n.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,n.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,i=t.getBoundFramebufferObject(),a=t.getViewport(),o=e.passOptions,h=e.drawPhase;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),e.drawPhase=r.HITTEST;const{distance:d,smallSymbolDistance:l}=e.passOptions,u=Math.max(d,l);for(const r of this.children)r.visible&&r.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(r,e,n.All);s.draw(e),s.unbind(),t.bindFramebuffer(i),t.restoreViewport(a),e.passOptions=o,e.drawPhase=h}_renderFeatures(e,t){const s=this._getHeatmapInstance(e);null!=s?this._renderHeatmapFeatures(e,t,s):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const s of this.children)s.visible&&this._renderTile(s,e,t)}_renderHeatmapFeatures(e,t,s){for(const i of this.children)i.visible&&this._renderTile(i,e,t,d.Heatmap);s.techniqueRef.renderResolvePass(e,s)}_renderTile(e,t,s,i){const r=has("featurelayer-strict-draw-order")?a.STRICT_ORDER:has("featurelayer-force-marker-text-draw-order")?a.STRICT_MARKERS_AND_TEXT:a.BATCHING,n=e.getDisplayList(this._instanceStore,r);t.selection=s,n?.render(t,i)}}function p(e){return e.techniqueRef.type===d.Heatmap}export{_ as FeatureContainer};
@@ -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 has from"../../../../core/has.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{isFunctionRaster as s}from"../../../../layers/support/rasterDatasets/datasetUtils.js";import{getBytesPerPixel as i}from"../../../../layers/support/rasterFormats/pixelRangeUtils.js";import{RasterTileContainer as o}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as n}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as a}from"../support/util.js";import l from"../../../layers/support/Geometry.js";let c=class extends n{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t)return!1;const r=t.lookup.colormapLut?.indexedColormap,s=r&&r.length>this._maxIndexedColormapSize,o=i(this.layer.serviceRasterInfo);return!(has("ios")&&o>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!s&&!("majority"===this.layer.interpolation&&a(this.layer))}attach(){super.attach(),this.container=new o(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{clips:e,view:t}=this.layerView;null!=this._geometry&&e.remove(this._geometry);const{raster:r,type:i}=this.layer;if(s(r)){const s=r.getClippingGeometry(t.spatialReference);if(s){const t=new l({geometry:s});e.add(t),this._geometry=t}}const{container:o}=this;if("Function"!==r.datasetFormat||"wcs"===i)return o.rasterFunctionChain=null,o.children.forEach((e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))})),void(this._rasterFunctionState="na");const n=this._rasterFunctionState,{rasterFunction:a,primaryRasters:c}=r,p=a.supportsGPU&&(!c||c.rasters.length<=1),u=p?a.flatWebGLFunctionChain:null,{renderer:d}=this.layer,h=!p||!u?.functions.length||"raster-stretch"===d?.type&&d.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;o.rasterFunctionChain=h?null:this._addProjection(u);const m=null==a?"na":o.rasterFunctionChain?"gpu":"cpu",y=n===m||"na"===n&&"cpu"===m&&0===u?.functions?.length;o.children.forEach((e=>{const{bitmap:t}=e;t&&(t.suspended=!y,t.processed=!1,t.processedTexture=null)})),this._rasterFunctionState=m}async updateTileSource(e,t){const r=this._getBandIds(),s=this._getLayerInterpolation(),{canUseWebGLForProcessing:i}=this,{source:o,globalSymbolizerParams:n,suspended:a,coords:l,resolution:c}=t,p=this.layerView.hasTilingEffects?n:t.symbolizerParams,{bitmap:u}=e;if([u.x,u.y]=l,u.resolution=c,null!=o?.pixelBlock){const e={extent:o.extent,pixelBlock:o.pixelBlock,srcPixelSize:o.srcTilePixelSize};if(u.rawPixelData=e,i)u.source=o.pixelBlock,u.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===n?.type?n:void 0);u.source=t,u.isRendereredSource=!0}u.symbolizerParameters=i?p:null,u.transformGrid=i?o.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();u.source=e,u.symbolizerParameters=i?p:null,u.transformGrid=null}u.bandIds=i?r:null,u.width=this._tileInfoView.tileInfo.size[0],u.height=this._tileInfoView.tileInfo.size[1],u.interpolation=s,u.suspended=a,u.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:r,global:s}=t,i=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{bitmap:a}=e,{rawPixelData:l}=a;n||null==l?(a.isRendereredSource&&null!=l&&(a.source=l.pixelBlock),a.isRendereredSource=!1):(a.source=await this.layer.applyRenderer(l,"stretch"===s?.type?s:void 0),a.isRendereredSource=!0),a.symbolizerParameters=n?this.layerView.hasTilingEffects?s:r:null,a.bandIds=n?i:null,a.interpolation=o,a.suspended=!1}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.tileInfo.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}};e([t()],c.prototype,"canUseWebGLForProcessing",null),e([t()],c.prototype,"container",void 0),e([t()],c.prototype,"layer",void 0),e([t()],c.prototype,"type",void 0),c=e([r("esri.views.2d.layers.imagery.ImageryTileView2D")],c);export{c as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import has from"../../../../core/has.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{isFunctionRaster as s}from"../../../../layers/support/rasterDatasets/datasetUtils.js";import{getBytesPerPixel as i}from"../../../../layers/support/rasterFormats/pixelRangeUtils.js";import{convertGeometryToMask as o}from"../../../../layers/support/rasterFunctions/clipUtils.js";import{RasterTileContainer as n}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as a}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as l}from"../support/util.js";let c=class extends a{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t)return!1;const r=t.lookup.colormapLut?.indexedColormap,s=r&&r.length>this._maxIndexedColormapSize,o=i(this.layer.serviceRasterInfo);return!(has("ios")&&o>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!s&&!("majority"===this.layer.interpolation&&l(this.layer))}attach(){super.attach(),this.container=new n(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach((e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))})),void(this._rasterFunctionState="na");const s=this._rasterFunctionState,{rasterFunction:i,primaryRasters:o}=e,n=i.supportsGPU&&(!o||o.rasters.length<=1),a=n?i.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!n||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const p=null==i?"na":r.rasterFunctionChain?"gpu":"cpu",u=s===p||"na"===s&&"cpu"===p&&0===a?.functions?.length;r.children.forEach((e=>{const{bitmap:t}=e;t&&(t.suspended=!u,t.processed=!1,t.processedTexture=null)})),this._rasterFunctionState=p}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{source:a,globalSymbolizerParams:l,suspended:c,coords:p,resolution:u}=t,d=this.layerView.hasTilingEffects?l:t.symbolizerParams,{bitmap:h}=e;if([h.x,h.y]=p,h.resolution=u,null!=a?.pixelBlock){const e={extent:a.extent,pixelBlock:a.pixelBlock,srcPixelSize:a.srcTilePixelSize};if(h.rawPixelData=e,n)h.source=a.pixelBlock,h.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===l?.type?l:void 0);h.source=t,h.isRendereredSource=!0}h.symbolizerParameters=n?d:null,h.transformGrid=n?a.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();h.source=e,h.symbolizerParameters=n?d:null,h.transformGrid=null}h.bandIds=n?r:null,h.width=this._tileInfoView.tileInfo.size[0],h.height=this._tileInfoView.tileInfo.size[1],h.interpolation=i,h.suspended=c;const{raster:m}=this.layer;if(s(m)){const t=m.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=m.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);h.mask=o({srcExtent:r,geometry:t,size:[h.width,h.height]})}}h.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:r,global:s}=t,i=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{bitmap:a}=e,{rawPixelData:l}=a;n||null==l?(a.isRendereredSource&&null!=l&&(a.source=l.pixelBlock),a.isRendereredSource=!1):(a.source=await this.layer.applyRenderer(l,"stretch"===s?.type?s:void 0),a.isRendereredSource=!0),a.symbolizerParameters=n?this.layerView.hasTilingEffects?s:r:null,a.bandIds=n?i:null,a.interpolation=o,a.suspended=!1}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.tileInfo.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}};e([t()],c.prototype,"canUseWebGLForProcessing",null),e([t()],c.prototype,"container",void 0),e([t()],c.prototype,"layer",void 0),e([t()],c.prototype,"type",void 0),c=e([r("esri.views.2d.layers.imagery.ImageryTileView2D")],c);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 e from"./DebugOverlay.js";function t(t,a){t.container.addChild(new e({getMesh:e=>"feature"===t.layer.type?n(t,e,a):o(t,e,a),getColors:s,getOpacities:i}))}const a=(t,a,r)=>{let n=0;const o=[],s=[];for(const i of t.children)if(i.symbols)for(const u of i.symbols.values())for(const i of u)for(const u of i.colliders(t)){const t=(u.xScreen+u.dxScreen)*a,x=(u.yScreen+u.dyScreen)*a,c=u.width*a,l=u.height*a,p=i.unique?.parts[u.partIndex].targetOpacity>.5;if(!p&&"all"!==r)continue;const d=3,f=1,h=3,v=0,D=p?2:0,y=p?3:0,g=e.makeFlags(D,y);o.push(t,x,g,t+c,x,g,t,x+l,g,t+c,x+l,g),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4;const C=p?d:f,m=p?h:v,w=e.makeFlags(C,m);o.push(t,x,w,t+c,x,w,t,x+1,w,t+c,x+1,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t,x+l-1,w,t+c,x+l-1,w,t,x+l,w,t+c,x+l,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t,x,w,t+1,x,w,t,x+l,w,t+1,x+l,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t+c-1,x,w,t+c,x,w,t+c-1,x+l,w,t+c,x+l,w),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4}return{vertexData:o,indexData:s,vertexCount:n}},r=(t,a)=>{let{vertexData:r,indexData:n,vertexCount:o}=a;const[s,i]=t.decluttererOffset,u=e.makeFlags(2,3),x=256,c=256,l=x+s,p=c+i;for(const e of[-3,3])for(const t of[-3,3])r.push(x,c,u,x+e,c+t,u,l,p,u,l+e,p+t,u),n.push(o,o+1,o+2,o+1,o+3,o+2),o+=4},n=(e,t,n)=>{const{pixelRatio:o}=t.state,{vertexData:s,indexData:i,vertexCount:u}=a(e.featureContainer,o,n),x=e.view.labelManager.symbolFader;return x&&r(x,{vertexData:s,indexData:i,vertexCount:u}),{vertexData:new Int16Array(s),indexData:new Uint32Array(i)}},o=(e,t,n)=>{const{pixelRatio:o}=t.state,s=e._vectorTileContainer,{vertexData:i,indexData:u,vertexCount:x}=a(s,o,n),{symbolFader:c}=s;return c&&r(c,{vertexData:i,indexData:u,vertexCount:x}),{vertexData:new Int16Array(i),indexData:new Uint32Array(u)}},s=()=>[1,.5,0,1,1,0,0,1,0,1,.5,1,0,.5,0,1],i=()=>[.05,.01,.15,.2];export{t as showCollisionBoxes};
5
+ import e from"./DebugOverlay.js";function t(t,a){t.container.addChild(new e({getMesh:e=>"vector-tile"===t.layer.type?o(t,e,a):n(t,e,a),getColors:s,getOpacities:i}))}const a=(t,a,r)=>{let n=0;const o=[],s=[];for(const i of t.children)if(i.symbols)for(const u of i.symbols.values())for(const i of u)for(const u of i.colliders(t)){const t=(u.xScreen+u.dxScreen)*a,c=(u.yScreen+u.dyScreen)*a,x=u.width*a,l=u.height*a,p=i.uniqueSymbol?.parts[u.partIndex].targetOpacity>.5;if(!p&&"all"!==r)continue;const d=3,f=1,v=3,h=0,D=p?2:0,y=p?3:0,g=e.makeFlags(D,y);o.push(t,c,g,t+x,c,g,t,c+l,g,t+x,c+l,g),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4;const m=p?d:f,C=p?v:h,b=e.makeFlags(m,C);o.push(t,c,b,t+x,c,b,t,c+1,b,t+x,c+1,b),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t,c+l-1,b,t+x,c+l-1,b,t,c+l,b,t+x,c+l,b),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t,c,b,t+1,c,b,t,c+l,b,t+1,c+l,b),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4,o.push(t+x-1,c,b,t+x,c,b,t+x-1,c+l,b,t+x,c+l,b),s.push(n,n+1,n+2,n+1,n+3,n+2),n+=4}return{vertexData:o,indexData:s,vertexCount:n}},r=(t,a)=>{let{vertexData:r,indexData:n,vertexCount:o}=a;const[s,i]=t.decluttererOffset,u=e.makeFlags(2,3),c=256,x=256,l=c+s,p=x+i;for(const e of[-3,3])for(const t of[-3,3])r.push(c,x,u,c+e,x+t,u,l,p,u,l+e,p+t,u),n.push(o,o+1,o+2,o+1,o+3,o+2),o+=4},n=(e,t,n)=>{const{pixelRatio:o}=t.state,{vertexData:s,indexData:i,vertexCount:u}=a(e.featureContainer,o,n),c=e.view.labelManager.symbolFader;return c&&r(c,{vertexData:s,indexData:i,vertexCount:u}),{vertexData:new Int16Array(s),indexData:new Uint32Array(i)}},o=(e,t,n)=>{const{pixelRatio:o}=t.state,s=e._vectorTileContainer,{vertexData:i,indexData:u,vertexCount:c}=a(s,o,n),{symbolFader:x}=s;return x&&r(x,{vertexData:i,indexData:u,vertexCount:c}),{vertexData:new Int16Array(i),indexData:new Uint32Array(u)}},s=()=>[1,.5,0,1,1,0,0,1,0,1,.5,1,0,.5,0,1],i=()=>[.05,.01,.15,.2];export{t as showCollisionBoxes};
@@ -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 o from"../../core/Accessor.js";import{equals as s}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import{mapCollection as t}from"../../core/mapCollectionUtils.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as n,syncAndInitial as a}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{e as c}from"../../chunks/earcut.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as d}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../geometry/ellipsoidUtils.js";import h from"../../geometry/Point.js";import{e as f}from"../../chunks/densifyOperator.js";import{computeTranslationToOriginAndRotation as y}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as g}from"../../geometry/support/DoubleArray.js";import{earth as v}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as w}from"../../geometry/support/Indices.js";import{t as j}from"../../chunks/vec3.js";import{FocusAreaOutlineItem as _}from"../FocusAreaOutlineItem.js";import{ViewingMode as A}from"../ViewingMode.js";import{ElevationContext as R}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as b}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as C}from"./layers/graphics/graphicUtils.js";import{geometryToRenderInfo as N}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as x}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaGeometry as k,FocusAreaMaskNode as H}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";const M=-2e4,U=65e5;let P=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new R,this._outlineMap=new r}initialize(){this.addHandles([n((()=>this.areas?.style??"none"),(e=>this._ensureRenderNodes(e)),a)]),this.addHandles([n((()=>this.polygons),(e=>this._updateVolumes(e)),a)]),this._outlineMap=t((()=>this.areas?.areas),(e=>new _({area:e,view:this.view})),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter((({enabled:e})=>e))??[]}get style(){return this.areas?.style??"none"}get polygons(){return this.enabledAreas.reduce(((e,o)=>e.concat(o.geometries.toArray())),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new h(e);return this.polygons.some((e=>e.contains(o)))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes(this.style)}_extrude(e){if(!this.view.renderCoordsHelper||s(Array.from(this._volumes.keys()),e))return;const o=U-M,r=d(),t=this.view.renderCoordsHelper.viewingMode===A.Global,i=p(),n=p();t||this.view.renderCoordsHelper.worldUpAtPosition([0,0,0],r);const a=new Map;for(const s of e){const e=this._volumes.get(s);if(e){a.set(s,e);continue}const l=C(s);if(null==l)continue;const m=f(s,u(this.view.spatialReference).radius/v.radius*5e5,{unit:"meters"});y(m.spatialReference,[l.x,l.y,0],i,this.view.renderCoordsHelper.spatialReference);const p=this.view.renderCoordsHelper.worldUpAtPosition([i[12],i[13],i[14]],V);n[12]=-i[12],n[13]=-i[13],n[14]=-i[14];const d=N(m,this.view.elevationProvider,this.view.renderCoordsHelper,this._elevationContext),{polygons:h,mapPositions:_,position:A}=d,R=new Array;for(const s of h){const e=s.count,a=c(s.mapPositions,s.holeIndices,3);if(0===a.length)continue;const l=a.length,m=6*e,d=w(m+l),u=w(l),h=g(3*m);b(A,_,a,s,h,null,null,null,d,u,o,r,t),j(h,h,n);const f=new k(h,u,d,o,[i[12]+M*p[0],i[13]+M*p[1],i[14]+M*p[2]]);R.push(f)}a.set(s,R)}this._volumes=a,this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(e){this.view.stage&&("none"===e||0===this.volumes.size?(this._maskRenderNode=i(this._maskRenderNode),this._colorRenderNode=i(this._colorRenderNode)):(this._maskRenderNode??=new H({focusAreasView:this}),this._colorRenderNode??=new x({focusAreasView:this})))}get volumes(){return this._volumes}};e([l()],P.prototype,"_volumes",void 0),e([l({constructOnly:!0})],P.prototype,"view",void 0),P=e([m("esri.views.3d.FocusAreasView")],P);const V=d();export{P as FocusAreasView};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{equals as s}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import{mapCollection as t}from"../../core/mapCollectionUtils.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as n,syncAndInitial as a}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{e as c}from"../../chunks/earcut.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as d}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../geometry/ellipsoidUtils.js";import h from"../../geometry/Point.js";import{e as f}from"../../chunks/densifyOperator.js";import{computeTranslationToOriginAndRotation as y}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as g}from"../../geometry/support/DoubleArray.js";import{earth as w}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as v}from"../../geometry/support/Indices.js";import{t as j}from"../../chunks/vec3.js";import{FocusAreaOutlineItem as _}from"../FocusAreaOutlineItem.js";import{ViewingMode as A}from"../ViewingMode.js";import{ElevationContext as R}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as b}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as C}from"./layers/graphics/graphicUtils.js";import{geometryToRenderInfo as N}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as x}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaGeometry as k,FocusAreaMaskNode as H}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";const M=-2e4,U=65e5;let V=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new R,this._outlineMap=new r}initialize(){this.addHandles([n((()=>this.areas?.style??"none"),(e=>this._ensureRenderNodes(e)),a)]),this.addHandles([n((()=>this.polygons),(e=>this._updateVolumes(e)),a)]),this._outlineMap=t((()=>this.areas?.areas),(e=>new _({area:e,view:this.view})),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter((({enabled:e})=>e))??[]}get style(){return this.areas?.style??"none"}get polygons(){return this.enabledAreas.reduce(((e,o)=>e.concat(o.geometries.toArray())),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new h(e);return this.polygons.some((e=>e.contains(o)))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes(this.style)}_extrude(e){if(!this.view.renderCoordsHelper||s(Array.from(this._volumes.keys()),e))return;const o=U-M,r=d(),t=this.view.renderCoordsHelper.viewingMode===A.Global,i=p(),n=p();t||this.view.renderCoordsHelper.worldUpAtPosition([0,0,0],r);const a=new Map;for(const s of e){const e=this._volumes.get(s);if(e){a.set(s,e);continue}const l=C(s);if(null==l)continue;const m=f(s,u(this.view.spatialReference).radius/w.radius*5e5,{unit:"meters"});y(m.spatialReference,[l.x,l.y,0],i,this.view.renderCoordsHelper.spatialReference);const p=this.view.renderCoordsHelper.worldUpAtPosition([i[12],i[13],i[14]],P);n[12]=-i[12],n[13]=-i[13],n[14]=-i[14];const d=N(m,this.view.elevationProvider,this.view.renderCoordsHelper,this._elevationContext),{polygons:h,mapPositions:_,position:A}=d,R=new Array;for(const s of h){const e=s.count,a=c(s.mapPositions,s.holeIndices,3);if(0===a.length)continue;const l=a.length,m=6*e,d=m+l,u=g(3*m),h=v(d),f=v(l);b(A,_,a,s,u,null,null,null,h,f,o,r,t),j(u,u,n);const y=new k(u,f,h,o,[i[12]+M*p[0],i[13]+M*p[1],i[14]+M*p[2]]);R.push(y)}a.set(s,R)}this._volumes=a,this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(e){this.view.stage&&("none"===e||0===this.volumes.size?(this._maskRenderNode=i(this._maskRenderNode),this._colorRenderNode=i(this._colorRenderNode)):(this._maskRenderNode??=new H({focusAreasView:this}),this._colorRenderNode??=new x({focusAreasView:this}),this.view.stage.renderView.requestRender()))}get volumes(){return this._volumes}};e([l()],V.prototype,"_volumes",void 0),e([l({constructOnly:!0})],V.prototype,"view",void 0),V=e([m("esri.views.3d.FocusAreasView")],V);const P=d();export{V as FocusAreasView};