@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{renderingSanitizer as e}from"../../widgets/support/widgetUtils.js";const t="http://www.w3.org/",r=`${t}2000/svg`,o=`${t}1999/xlink`;let i=[],n=(e,t)=>{let r={};return Object.keys(e).forEach((t=>{r[t]=e[t]})),t&&Object.keys(t).forEach((e=>{r[e]=t[e]})),r},s=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),l=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},p=(e,t,r)=>{if(""!==t.vnodeSelector)for(let o=r;o<e.length;o++)if(s(e[o],t))return o;return-1},d=(e,t,r,o)=>{let i=e[t];if(""===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let l=0;l<e.length;l++)if(l!==t){let t=e[l];if(s(t,i))throw new Error(`${r.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===o?o:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},a=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},f=[],c=!1,u=e=>{(e.children||[]).forEach(u),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},m=()=>{c=!1,f.forEach(u),f.length=0},h=e=>{f.push(e),c||(c=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(m,{timeout:16}):setTimeout(m,16))},v=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents="none";let o=()=>{t.parentNode&&(t.parentNode.removeChild(t),h(e))};return void r(t,o,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),h(e))},y=(t,i,n)=>{if(!i)return;let s=n.eventHandlerInterceptor,p=Object.keys(i),d=p.length;for(let a=0;a<d;a++){let d=p[a],f=i[d];if("className"===d)throw new Error('Property "className" is not supported, use "class".');if("class"===d)k(t,f,!0);else if("classes"===d){let e=Object.keys(f),r=e.length;for(let o=0;o<r;o++){let r=e[o];f[r]&&t.classList.add(r)}}else if("styles"===d){let e=Object.keys(f),r=e.length;for(let o=0;o<r;o++){let r=e[o],i=f[r];i&&(l(i),n.styleApplyer(t,r,i))}}else if("key"!==d&&null!=f){let l=typeof f;"function"===l?(0===d.lastIndexOf("on",0)&&(s&&(f=s(d,f,t,i)),"oninput"===d&&function(){let e=f;f=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),t[d]=f):n.namespace===r?"href"===d?t.setAttributeNS(o,d,f):t.setAttribute(d,f):"string"===l&&"value"!==d?"innerHTML"===d?t[d]=e.sanitize(f):g(t)&&d in t?t[d]=f:t.setAttribute(d,f):t[d]=f}}};function g(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let N,b=(e,t,r)=>{if(t)for(let o of t)x(o,e,void 0,r)},w=(e,t,r)=>{b(e,t.children,r),t.text&&(e.textContent=t.text),y(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},x=(e,t,o,i)=>{let s,l=0,p=e.vnodeSelector,d=t.ownerDocument;if(""===p)s=e.domNode=d.createTextNode(e.text),void 0!==o?t.insertBefore(s,o):t.appendChild(s);else{for(let a=0;a<=p.length;++a){let f=p.charAt(a);if(a===p.length||"."===f||"#"===f){let f=p.charAt(l-1),c=p.slice(l,a);"."===f?s.classList.add(c):"#"===f?s.id=c:("svg"===c&&(i=n(i,{namespace:r})),void 0!==i.namespace?s=e.domNode=d.createElementNS(i.namespace,c):(s=e.domNode=e.domNode||d.createElement(c),"input"===c&&e.properties&&void 0!==e.properties.type&&s.setAttribute("type",e.properties.type)),void 0!==o?t.insertBefore(s,o):s.parentNode!==t&&t.appendChild(s)),l=a+1}}w(s,e,i)}},k=(e,t,r)=>{t&&t.split(" ").forEach((t=>{t&&e.classList.toggle(t,r)}))},A=(t,i,n,s)=>{if(!n)return;let p=!1,d=Object.keys(n),a=d.length;for(let f=0;f<a;f++){let a=d[f],c=n[a],u=i[a];if("class"===a)u!==c&&(k(t,u,!1),k(t,c,!0));else if("classes"===a){let e=t.classList,r=Object.keys(c),o=r.length;for(let t=0;t<o;t++){let o=r[t],i=!!c[o];i!==!!u[o]&&(p=!0,i?e.add(o):e.remove(o))}}else if("styles"===a){let e=Object.keys(c),r=e.length;for(let o=0;o<r;o++){let r=e[o],i=c[r];i!==u[r]&&(p=!0,i?(l(i),s.styleApplyer(t,r,i)):s.styleApplyer(t,r,""))}}else if(c||"string"!=typeof u||(c=""),"value"!==a||g(t)){if(c!==u){let i=typeof c;"function"===i&&s.eventHandlerInterceptor||(s.namespace===r?"href"===a?t.setAttributeNS(o,a,c):t.setAttribute(a,c):"string"===i?"innerHTML"===a?t[a]=e.sanitize(c):"role"===a&&""===c?t.removeAttribute(a):g(t)&&a in t?t[a]=c:t.setAttribute(a,c):t[a]!==c&&(t[a]=c),p=!0)}}else{let e=t[a];e!==c&&(t["oninput-value"]?e===t["oninput-value"]:c!==u)&&(t[a]=c,t["oninput-value"]=void 0),c!==u&&(p=!0)}}return p},S=(e,t,r,o,n)=>{if(r===o)return!1;o=o||i;let l,f=(r=r||i).length,c=o.length,u=0,m=0,h=!1;for(;m<c;){let i=u<f?r[u]:void 0,c=o[m];if(void 0!==i&&s(i,c))h=N(i,c,n)||h,u++;else{let i=p(r,c,u+1);if(i>=0){for(l=u;l<i;l++)v(r[l]),d(r,l,e,"removed");h=N(r[i],c,n)||h,u=i+1}else x(c,t,u<f?r[u].domNode:void 0,n),a(c),d(o,m,e,"added")}m++}if(f>u)for(l=u;l<f;l++)v(r[l]),d(r,l,e,"removed");return h};N=(e,t,o)=>{let i=e.domNode,s=!1;if(e===t)return!1;let l=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=i.ownerDocument.createTextNode(t.text);return i.parentNode.replaceChild(e,i),t.domNode=e,s=!0,s}t.domNode=i}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(o=n(o,{namespace:r})),e.text!==t.text&&(l=!0,void 0===t.text?i.removeChild(i.firstChild):i.textContent=t.text),t.domNode=i,l=S(t,i,e.children,t.children,o)||l,l=A(i,e.properties,t.properties,o)||l,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[i,o,t.vnodeSelector,t.properties,t.children]);return l&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(i,t.properties,e.properties),s};let C=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let o=e;e=r,N(o,r,t)},domNode:e.domNode});export{x as createDom,C as createProjection,n as extend,w as initPropertiesAndChildren};
5
+ import{renderingSanitizer as e}from"../../core/sanitizerUtils.js";const t="http://www.w3.org/",r=`${t}2000/svg`,o=`${t}1999/xlink`;let i=[],n=(e,t)=>{let r={};return Object.keys(e).forEach((t=>{r[t]=e[t]})),t&&Object.keys(t).forEach((e=>{r[e]=t[e]})),r},l=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),s=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},p=(e,t,r)=>{if(""!==t.vnodeSelector)for(let o=r;o<e.length;o++)if(l(e[o],t))return o;return-1},d=(e,t,r,o)=>{let i=e[t];if(""===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let s=0;s<e.length;s++)if(s!==t){let t=e[s];if(l(t,i))throw new Error(`${r.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===o?o:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},a=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},f=[],c=!1,u=e=>{(e.children||[]).forEach(u),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},m=()=>{c=!1,f.forEach(u),f.length=0},h=e=>{f.push(e),c||(c=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(m,{timeout:16}):setTimeout(m,16))},v=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents="none";let o=()=>{t.parentNode&&(t.parentNode.removeChild(t),h(e))};return void r(t,o,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),h(e))},y=(t,i,n)=>{if(!i)return;let l=n.eventHandlerInterceptor,p=Object.keys(i),d=p.length;for(let a=0;a<d;a++){let d=p[a],f=i[d];if("className"===d)throw new Error('Property "className" is not supported, use "class".');if("class"===d)k(t,f,!0);else if("classes"===d){let e=Object.keys(f),r=e.length;for(let o=0;o<r;o++){let r=e[o];f[r]&&t.classList.add(r)}}else if("styles"===d){let e=Object.keys(f),r=e.length;for(let o=0;o<r;o++){let r=e[o],i=f[r];i&&(s(i),n.styleApplyer(t,r,i))}}else if("key"!==d&&null!=f){let s=typeof f;"function"===s?(0===d.lastIndexOf("on",0)&&(l&&(f=l(d,f,t,i)),"oninput"===d&&function(){let e=f;f=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),t[d]=f):n.namespace===r?"href"===d?t.setAttributeNS(o,d,f):t.setAttribute(d,f):"string"===s&&"value"!==d?"innerHTML"===d?t[d]=e.sanitize(f):g(t)&&d in t?t[d]=f:t.setAttribute(d,f):t[d]=f}}};function g(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let N,b=(e,t,r)=>{if(t)for(let o of t)x(o,e,void 0,r)},w=(e,t,r)=>{b(e,t.children,r),t.text&&(e.textContent=t.text),y(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},x=(e,t,o,i)=>{let l,s=0,p=e.vnodeSelector,d=t.ownerDocument;if(""===p)l=e.domNode=d.createTextNode(e.text),void 0!==o?t.insertBefore(l,o):t.appendChild(l);else{for(let a=0;a<=p.length;++a){let f=p.charAt(a);if(a===p.length||"."===f||"#"===f){let f=p.charAt(s-1),c=p.slice(s,a);"."===f?l.classList.add(c):"#"===f?l.id=c:("svg"===c&&(i=n(i,{namespace:r})),void 0!==i.namespace?l=e.domNode=d.createElementNS(i.namespace,c):(l=e.domNode=e.domNode||d.createElement(c),"input"===c&&e.properties&&void 0!==e.properties.type&&l.setAttribute("type",e.properties.type)),void 0!==o?t.insertBefore(l,o):l.parentNode!==t&&t.appendChild(l)),s=a+1}}w(l,e,i)}},k=(e,t,r)=>{t&&t.split(" ").forEach((t=>{t&&e.classList.toggle(t,r)}))},A=(t,i,n,l)=>{if(!n)return;let p=!1,d=Object.keys(n),a=d.length;for(let f=0;f<a;f++){let a=d[f],c=n[a],u=i[a];if("class"===a)u!==c&&(k(t,u,!1),k(t,c,!0));else if("classes"===a){let e=t.classList,r=Object.keys(c),o=r.length;for(let t=0;t<o;t++){let o=r[t],i=!!c[o];i!==!!u[o]&&(p=!0,i?e.add(o):e.remove(o))}}else if("styles"===a){let e=Object.keys(c),r=e.length;for(let o=0;o<r;o++){let r=e[o],i=c[r];i!==u[r]&&(p=!0,i?(s(i),l.styleApplyer(t,r,i)):l.styleApplyer(t,r,""))}}else if(c||"string"!=typeof u||(c=""),"value"!==a||g(t)){if(c!==u){let i=typeof c;"function"===i&&l.eventHandlerInterceptor||(l.namespace===r?"href"===a?t.setAttributeNS(o,a,c):t.setAttribute(a,c):"string"===i?"innerHTML"===a?t[a]=e.sanitize(c):"role"===a&&""===c?t.removeAttribute(a):g(t)&&a in t?t[a]=c:t.setAttribute(a,c):t[a]!==c&&(t[a]=c),p=!0)}}else{let e=t[a];e!==c&&(t["oninput-value"]?e===t["oninput-value"]:c!==u)&&(t[a]=c,t["oninput-value"]=void 0),c!==u&&(p=!0)}}return p},S=(e,t,r,o,n)=>{if(r===o)return!1;o=o||i;let s,f=(r=r||i).length,c=o.length,u=0,m=0,h=!1;for(;m<c;){let i=u<f?r[u]:void 0,c=o[m];if(void 0!==i&&l(i,c))h=N(i,c,n)||h,u++;else{let i=p(r,c,u+1);if(i>=0){for(s=u;s<i;s++)v(r[s]),d(r,s,e,"removed");h=N(r[i],c,n)||h,u=i+1}else x(c,t,u<f?r[u].domNode:void 0,n),a(c),d(o,m,e,"added")}m++}if(f>u)for(s=u;s<f;s++)v(r[s]),d(r,s,e,"removed");return h};N=(e,t,o)=>{let i=e.domNode,l=!1;if(e===t)return!1;let s=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=i.ownerDocument.createTextNode(t.text);return i.parentNode.replaceChild(e,i),t.domNode=e,l=!0,l}t.domNode=i}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(o=n(o,{namespace:r})),e.text!==t.text&&(s=!0,void 0===t.text?i.removeChild(i.firstChild):i.textContent=t.text),t.domNode=i,s=S(t,i,e.children,t.children,o)||s,s=A(i,e.properties,t.properties,o)||s,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[i,o,t.vnodeSelector,t.properties,t.children]);return s&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(i,t.properties,e.properties),l};let C=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let o=e;e=r,N(o,r,t)},domNode:e.domNode});export{x as createDom,C as createProjection,n as extend,w as initPropertiesAndChildren};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/JSONSupport.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{emitApplyEditsEvent as i}from"../layers/mixins/EditBusLayer.js";import n from"./UtilityNetwork.js";import{isVersionInEditSession as o,currentSessionId as a,isSafeToEditVersion as d}from"../versionManagement/support/versionManagementUtils.js";let l=class extends t{constructor(e){super(e),this.utilityNetwork=null}get networkServiceUrl(){return this.utilityNetwork?.networkServiceUrl??null}get featureServiceUrl(){return this.utilityNetwork?.featureServiceUrl??null}get gdbVersion(){return this.utilityNetwork?.gdbVersion??null}get historicMoment(){return this.utilityNetwork?.historicMoment??null}async insertGap(e,t,r){const[{insertGap:s},{default:n}]=await Promise.all([import("../rest/networks/unitIdentifiers/insertGap.js"),import("../rest/networks/unitIdentifiers/support/InsertGapParameters.js")]),l=new n({object:e,firstUnit:t,numUnits:r});o(this.featureServiceUrl,this.gdbVersion||null)?(l.sessionId=a,await d(this.featureServiceUrl,this.gdbVersion,!0)):l.sessionId=null,l.gdbVersion=this.gdbVersion;const u=i(this.featureServiceUrl,null,this.gdbVersion,!1),c=await s(this.networkServiceUrl,l);u.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:!1,historicMoment:c})}async reset(e){const[{reset:t},{default:r}]=await Promise.all([import("../rest/networks/unitIdentifiers/reset.js"),import("../rest/networks/unitIdentifiers/support/ResetParameters.js")]),s=new r({objects:e});o(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=a,await d(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const n=i(this.featureServiceUrl,null,this.gdbVersion,!1),l=await t(this.networkServiceUrl,s);n.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:!1,historicMoment:l})}async resize(e,t){const[{resize:r},{default:s}]=await Promise.all([import("../rest/networks/unitIdentifiers/resize.js"),import("../rest/networks/unitIdentifiers/support/ResizeParameters.js")]),n=new s({object:e,numUnits:t});o(this.featureServiceUrl,this.gdbVersion||null)?(n.sessionId=a,await d(this.featureServiceUrl,this.gdbVersion,!0)):n.sessionId=null,n.gdbVersion=this.gdbVersion;const l=i(this.featureServiceUrl,null,this.gdbVersion,!1),u=await r(this.networkServiceUrl,n);l.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:!1,historicMoment:u})}async query(e){const[{queryUnitIdentifiers:t},{default:r}]=await Promise.all([import("../rest/networks/unitIdentifiers/queryUnitIdentifiers.js"),import("../rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParamters.js")]),s=new r({objects:e});o(this.featureServiceUrl,this.gdbVersion||null)?s.sessionId=a:s.sessionId=null,s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;return await t(this.networkServiceUrl,s)}};e([r({type:n,constructOnly:!0})],l.prototype,"utilityNetwork",void 0),e([r()],l.prototype,"networkServiceUrl",null),e([r()],l.prototype,"featureServiceUrl",null),e([r()],l.prototype,"gdbVersion",null),e([r()],l.prototype,"historicMoment",null),l=e([s("esri.networks.UnitIdentifierManager")],l);const u=l;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import r from"./TraceConfiguration.js";let i=class extends r{constructor(t){super(t),this.filterBarriers=[],this.arcadeExpressionBarrier=null,this.domainNetworkName=null,this.filterBitsetNetworkAttributeName=null,this.filterFunctionBarriers=[],this.filterScope=null,this.includeContainers=null,this.includeContent=null,this.includeIsolated=null,this.includeStructures=null,this.allowIndeterminateFlow=null,this.includeUpToFirstSpatialContainer=null,this.nearestNeighbor=null,this.outputFilterCategories=[],this.outputFilters=[],this.propagators=[],this.subnetworkName=null,this.targetTierName=null,this.diagramTemplateName=null,this.tierName=null,this.validateLocatability=null}};t([e({type:[Object],json:{write:!0}})],i.prototype,"filterBarriers",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"arcadeExpressionBarrier",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"domainNetworkName",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"filterBitsetNetworkAttributeName",void 0),t([e({type:[Object],json:{write:!0}})],i.prototype,"filterFunctionBarriers",void 0),t([e({type:["junctions","edges","junctionsAndEdges"],json:{write:!0}})],i.prototype,"filterScope",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"includeContainers",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"includeContent",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"includeIsolated",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"includeStructures",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"allowIndeterminateFlow",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"includeUpToFirstSpatialContainer",void 0),t([e({type:Object,json:{write:!0}})],i.prototype,"nearestNeighbor",void 0),t([e({type:[Object],json:{write:!0}})],i.prototype,"outputFilterCategories",void 0),t([e({type:[Object],json:{write:!0}})],i.prototype,"outputFilters",void 0),t([e({type:[Object],json:{write:!0}})],i.prototype,"propagators",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"subnetworkName",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"targetTierName",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"diagramTemplateName",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"tierName",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"validateLocatability",void 0),i=t([o("esri.networks.support.UNTraceConfiguration")],i);const s=i;export{s as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import r from"./TraceConfiguration.js";let i=class extends r{constructor(t){super(t),this.filterBarriers=[],this.arcadeExpressionBarrier=null,this.domainNetworkName=null,this.filterBitsetNetworkAttributeName=null,this.filterFunctionBarriers=[],this.filterScope=null,this.includeContainers=null,this.includeContent=null,this.includeIsolated=null,this.includeStructures=null,this.allowIndeterminateFlow=null,this.includeUpToFirstSpatialContainer=null,this.inferConnectivity=null,this.nearestNeighbor=null,this.outputFilterCategories=[],this.outputFilters=[],this.propagators=[],this.subnetworkName=null,this.targetTierName=null,this.diagramTemplateName=null,this.tierName=null,this.validateLocatability=null}};t([e({type:[Object],json:{write:!0}})],i.prototype,"filterBarriers",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"arcadeExpressionBarrier",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"domainNetworkName",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"filterBitsetNetworkAttributeName",void 0),t([e({type:[Object],json:{write:!0}})],i.prototype,"filterFunctionBarriers",void 0),t([e({type:["junctions","edges","junctionsAndEdges"],json:{write:!0}})],i.prototype,"filterScope",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"includeContainers",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"includeContent",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"includeIsolated",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"includeStructures",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"allowIndeterminateFlow",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"includeUpToFirstSpatialContainer",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"inferConnectivity",void 0),t([e({type:Object,json:{write:!0}})],i.prototype,"nearestNeighbor",void 0),t([e({type:[Object],json:{write:!0}})],i.prototype,"outputFilterCategories",void 0),t([e({type:[Object],json:{write:!0}})],i.prototype,"outputFilters",void 0),t([e({type:[Object],json:{write:!0}})],i.prototype,"propagators",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"subnetworkName",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"targetTierName",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"diagramTemplateName",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"tierName",void 0),t([e({type:Boolean,json:{write:!0}})],i.prototype,"validateLocatability",void 0),i=t([o("esri.networks.support.UNTraceConfiguration")],i);const n=i;export{n as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250521",
3
+ "version": "4.33.0-next.20250522",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../config.js";import{id as s}from"../../kernel.js";import r from"../../request.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Error.js";import o from"../../core/Identifiable.js";import n from"../../core/JSONSupport.js";import{clone as l}from"../../core/lang.js";import u from"../../core/Loadable.js";import{throwIfAborted as p,throwIfAbortError as d}from"../../core/promiseUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{reader as m}from"../../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import h from"../../editing/sharedTemplates/SharedTemplateMetadata.js";import f from"../../geometry/SpatialReference.js";import{getFeatureJSON as g,getFeatureIds as v,getAttachmentEditsJSON as b,isProtectedOrPrivateVersionError as S,unpackEditResultData as E,createEditedFeatures as j}from"../../layers/graphics/applyEditsUtils.js";import{checkEditingCapabilities as w,normalizeEdits as I,normalizeGeometries as F}from"../../layers/graphics/editingSupport.js";import{emitApplyEditsEvent as R}from"../../layers/mixins/EditBusLayer.js";import{ensureCredentialIfSignedIn as A}from"../../layers/support/featureLayerUtils.js";import{getOwningPortalUrl as T}from"../../layers/support/layerUtils.js";import{getFeatureLayerCapabilities as U}from"../../layers/support/serviceCapabilitiesUtils.js";import C from"../../portal/PortalItem.js";import{getUserPrivileges as O}from"../../portal/support/portalItemUtils.js";import{isSecureProxyService as D}from"../../portal/support/urlUtils.js";import{parseUrl as P,asValidOptions as V,encode as k}from"../utils.js";import{unapplyEditsZUnitScaling as M}from"../query/operations/editsZScale.js";import{querySharedTemplates as N}from"../sharedTemplates/querySharedTemplates.js";import{readBoolean as q,readNumber as L}from"../support/jsonUtils.js";import{isSafeToEditVersion as _,isVersionInEditSession as x,currentSessionId as J}from"../../versionManagement/support/versionManagementUtils.js";function Q(e,t){const s=t.id;return{id:s,name:t.name,url:`${e}/${s}`,type:t.type||"Table"}}function W(e){return{data:H(e),sync:z(e),operations:B(e.capabilities,e),query:$(e),editing:G(e)}}function H(e){return{isDataVersioned:q(e,"hasVersionedData",!1),isDataBranchVersioned:q(e,"hasBranchVersionedData",!1)}}function B(e,t){const s=e?e.toLowerCase().split(",").map((e=>e.trim())):[],r=s.includes("query"),i=s.includes("editing")&&!t.datesInUnknownTimezone;let a=i&&s.includes("create"),o=i&&s.includes("delete"),n=i&&s.includes("update");return i&&!(a||o||n)&&(a=o=n=!0),{supportsAdd:a,supportsDelete:o,supportsEditing:i,supportsChangeTracking:s.includes("changetracking"),supportsQuery:r,supportsQueryDataElements:q(t,"supportsQueryDataElements",!1),supportsQueryDomains:q(t,"supportsQueryDomains",!1),supportsQueryContingentValues:q(t,"supportsQueryContingentValues",!1),supportsSync:s.includes("sync"),supportsUpdate:n}}function $(e){return{maxRecordCountFactor:L(e,"maxRecordCountFactor",void 0),maxRecordCount:L(e,"maxRecordCount",void 0)}}function G(e){const t=e?.advancedEditingCapabilities;return{supportsAsyncApplyEdits:q(t,"supportsAsyncApplyEdits",!1),supportsGlobalId:q(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:q(t,"supportsReturnServiceEditsInSourceSR",!1),supportsSharedTemplates:q(e,"supportsSharedTemplates",!1)||q(e,"hasSharedTemplates",!1),supportsSplit:q(t,"supportsSplit",!1)}}function z(e){const t=e?.syncCapabilities,s=t?.supportedSyncDataOptions;return{supportsAsync:q(t,"supportsAsync",!1),supportedSyncDataOptions:{annotations:!(1&~s),dimensions:!(2&~s),contingentValues:!(4&~s),attributeRules:!(8&~s),utilityNetworkSystem:!(16&~s),annotationFullModel:!(32&~s),include3DObjects:!(64&~s),utilityNetworkMissingLayers:!(128&~s),preserveTrueCurves:!(256&~s)}}}let Z=class extends(n.JSONSupportMixin(o.IdentifiableMixin(u))){constructor(e){super(e),this.url=null,this.sourceJSON=null,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.userTypeExtensions=[],this.layerInfos=null,this.tableInfos=null,this.capabilities=null}read(e,t){this.sourceJSON=e,super.read(e,t)}get utilityNetworkUrl(){if(this.sourceJSON)for(const e of this.sourceJSON.layers)if("Utility Network Layer"===e.type)return`${this.url}/${e.id}`;return null}get versionManagementServiceUrl(){return this.sourceJSON?.hasBranchVersionedData&&!D(this.url)?this.url.replace(/\/FeatureServer/i,"/VersionManagementServer"):null}readLayerInfos(e,t){return(t.layers||[]).map((e=>{const{type:t,geometryType:s}=e;return{...Q(this.url,e),type:t||"Feature Layer",geometryType:s}}))}readTableInfos(e,t){return(t.tables||[]).map((e=>Q(this.url,e)))}readCapabilities(e,t){return W(t)}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=l(e),{operations:s}=t;return this.userHasUpdateItemPrivileges?(s.supportsAdd=s.supportsDelete=s.supportsEditing=s.supportsQuery=s.supportsUpdate=!0,t):(this.userHasFullEditingPrivileges&&s.supportsEditing&&(s.supportsAdd=s.supportsDelete=s.supportsUpdate=!0),t)}load(e){return this.addResolvingPromise(this._fetchService(this.url,e).then((()=>this._setUserPrivileges(e)))),Promise.resolve(this)}async fetchAllLayersAndTables(e){return await this.load(e),this._fetchLayersAndTablesPromise||=this._fetchLayersAndTables(this.url),p(e),this._fetchLayersAndTablesPromise}async applyEdits(e,t){let s=null;try{const{results:r,edits:i,editedFeatures:a}=await this._internalApplyEdits(e,t),o=e=>e.filter((e=>!e.error)).map(l);let n=0;return r.map((e=>{s=R(this.url,e.id,t?.gdbVersion,!0);const r={edits:i[n],addedFeatures:o(e.addFeatureResults),updatedFeatures:o(e.updateFeatureResults),deletedFeatures:o(e.deleteFeatureResults),addedAttachments:o(e.addAttachmentResults),updatedAttachments:o(e.updateAttachmentResults),deletedAttachments:o(e.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:e.editMoment?new Date(e.editMoment):null};n+=1,a.length>0&&(r.editedFeatures=a),s.resolve(r),s=null})),r}catch(r){throw s&&s.reject(r),r}}async querySharedTemplates(e){const t={...e?.query};null==t.layers&&null==t.templateIds&&(t.layers=this.layerInfos.map((e=>e.id)));return(await N({serviceUrl:this.url,query:t,requestOptions:e?.requestOptions})).map((e=>{const t=h.fromJSON(e);return t.featureService=this,t}))}async _setUserPrivileges(e){if(t.userPrivilegesApplied)try{const{features:{fullEdit:t},content:{updateItem:s}}=await this._fetchUserPrivileges(this.sourceJSON.serviceItemId,e);this._set("userHasFullEditingPrivileges",t),this._set("userHasUpdateItemPrivileges",s)}catch(s){d(s)}}async _fetchUserPrivileges(e,t){const r=!0,i=!1,a=!1;if(!e)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};let o,n,l;try{o=await T(this.url,t)}catch(u){d(u)}try{const e=null!=t?t.signal:null;n=await(s?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(u){d(u)}if(!n)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};try{if(l=new C({id:e,portal:{url:o}}),await l.load(t),l.portal.user)return O(l)}catch(u){d(u)}return{features:{edit:r,fullEdit:i},content:{updateItem:a}}}async _internalApplyEdits(e,t){await A(this.url);const s=t?.globalIdUsed??!1,a=f.fromJSON(this.sourceJSON.spatialReference),{edits:o,options:n}=await this._processApplyEditsParams(e,t),l=await Promise.all(o.map((async e=>{const t=e.addFeatures?.map((e=>g({spatialReference:a},e,null)))??[],r=(await Promise.all(t)).filter(i),o=r.length>0?r:null,n=e.updateFeatures?.map((e=>g({spatialReference:a},e,null)))??[],l=(await Promise.all(n)).filter(i),u=l.length>0?l:null,p=v(e.identifierFields,e.deleteFeatures,s),d=p.length>0?p:null;M(o,u,a);const c=await b(e.identifierFields,e);let m=null;if(c){m={adds:c.adds.length>0?c.adds:void 0,updates:c.updates.length>0?c.updates:void 0,deletes:c.deletes.length>0?c.deletes:void 0}}return{id:e.id,adds:o,updates:u,deletes:d,attachments:m}}))),u={gdbVersion:n?.gdbVersion,rollbackOnFailure:!0,useGlobalIds:s,returnEditMoment:!0,honorSequenceOfEdits:n?.honorSequenceOfEdits,usePreviousEditMoment:n?.usePreviousEditMoment,returnServiceEditsInSourceSR:!1,returnServiceEditsOption:"originalAndCurrentFeatures",async:!1};await _(this.url,t?.gdbVersion,!0);const p=x(this.url,t?.gdbVersion||null);u.edits=JSON.stringify(l);const d=P(this.url),c=V(d.query,{query:k({...u,f:"json"}),method:"post"});let m;p&&(c.authMode="immediate",c.query.sessionId=J);try{m=await r(this.url+"/applyEdits",c)}catch(y){if(!S(y))throw y;c.authMode="immediate",m=await r(this.url+"/applyEdits",c)}return{...K(m),edits:o}}async _processApplyEditsParams(e,t){const s={...t,usingFeatureServiceEndpoint:!0};return{edits:await Promise.all(e.map((async e=>{const t=this.effectiveCapabilities,r=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),i=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments);if(w(e,t,s,!!r,!!i,"feature-service"),!t.data.isDataVersioned&&s?.gdbVersion)throw new a("feature-service:invalid-parameter","'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isDataVersioned'");const o=I(e,t,"feature-service");return{...await F(o),id:e.id,identifierFields:e.identifierFields}}))),options:s}}async _fetchService(e,t){if(this.sourceJSON)return void this.read(this.sourceJSON,{url:P(e)});const s=await r(e,{responseType:"json",query:{f:"json"},...t});this.read(s.data,{url:P(e)})}async _fetchLayersAndTables(e){const t=`${e}/layers`,s=await r(t,{responseType:"json",query:{f:"json"}});return{layers:s.data.layers.map((e=>{const{type:t,geometryType:s}=e,r=Q(this.url,e),i=U(e,r.url);return{...r,type:t||"Feature Layer",geometryType:s,capabilities:i}})),tables:s.data.tables.map((e=>{const t=Q(this.url,e),s=U(e,t.url);return{...t,capabilities:s}}))}}};function K(e){const t=e.data,s=[];return{results:t.map((e=>{const t={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment},r=E(t),i=e.editedFeatures,a=i?.spatialReference?new f({wkid:i?.spatialReference.wkid,wkt:i?.spatialReference.wkt,latestWkid:i?.spatialReference.latestWkid,latestVcsWkid:i?.spatialReference.latestVcsWkid,vcsWkid:i?.spatialReference.vcsWkid}):null,o=i?j(i,a):null;return o&&s.push({layerId:e.id,editedFeatures:o}),{id:e.id,editedFeatures:o,...r}})),editedFeatures:s}}e([c()],Z.prototype,"url",void 0),e([c()],Z.prototype,"sourceJSON",void 0),e([c()],Z.prototype,"userHasFullEditingPrivileges",void 0),e([c()],Z.prototype,"userHasUpdateItemPrivileges",void 0),e([c({readOnly:!0})],Z.prototype,"utilityNetworkUrl",null),e([c({readOnly:!0})],Z.prototype,"versionManagementServiceUrl",null),e([c()],Z.prototype,"userTypeExtensions",void 0),e([c({json:{read:{source:["layers"]}}})],Z.prototype,"layerInfos",void 0),e([m("layerInfos",["layers"])],Z.prototype,"readLayerInfos",null),e([c({json:{read:{source:["tables"]}}})],Z.prototype,"tableInfos",void 0),e([m("tableInfos",["tables"])],Z.prototype,"readTableInfos",null),e([c({readOnly:!0,json:{read:{source:["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"]}}})],Z.prototype,"capabilities",void 0),e([m("capabilities",["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"])],Z.prototype,"readCapabilities",null),e([c({readOnly:!0})],Z.prototype,"effectiveCapabilities",null),Z=e([y("esri.rest.featureService.FeatureService")],Z);const X=Z;export{X as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../config.js";import{id as s}from"../../kernel.js";import r from"../../request.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Error.js";import o from"../../core/Identifiable.js";import n from"../../core/JSONSupport.js";import{clone as l}from"../../core/lang.js";import u from"../../core/Loadable.js";import{throwIfAborted as p,throwIfAbortError as d}from"../../core/promiseUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{reader as m}from"../../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import h from"../../editing/sharedTemplates/SharedTemplateMetadata.js";import f from"../../geometry/SpatialReference.js";import{getFeatureJSON as b,getFeatureIds as g,getAttachmentEditsJSON as v,isProtectedOrPrivateVersionError as j,unpackEditResultData as S,createEditedFeatures as O}from"../../layers/graphics/applyEditsUtils.js";import{checkEditingCapabilities as E,normalizeEdits as R,normalizeGeometries as w}from"../../layers/graphics/editingSupport.js";import{emitApplyEditsEvent as I}from"../../layers/mixins/EditBusLayer.js";import{ensureCredentialIfSignedIn as A}from"../../layers/support/featureLayerUtils.js";import{getOwningPortalUrl as F}from"../../layers/support/layerUtils.js";import{getFeatureLayerCapabilities as T}from"../../layers/support/serviceCapabilitiesUtils.js";import U from"../../portal/PortalItem.js";import{getUserPrivileges as C}from"../../portal/support/portalItemUtils.js";import{isSecureProxyService as D}from"../../portal/support/urlUtils.js";import{parseUrl as P,asValidOptions as V,encode as k}from"../utils.js";import{unapplyEditsZUnitScaling as G}from"../query/operations/editsZScale.js";import{querySharedTemplates as M}from"../sharedTemplates/querySharedTemplates.js";import{readBoolean as N,readNumber as q}from"../support/jsonUtils.js";import{isSafeToEditVersion as L,isVersionInEditSession as _,currentSessionId as x}from"../../versionManagement/support/versionManagementUtils.js";function J(e,t){const s=t.id;return{id:s,name:t.name,url:`${e}/${s}`,type:t.type||"Table"}}function Q(e){return{data:W(e),sync:z(e),operations:H(e.capabilities,e),query:B(e),editing:$(e)}}function W(e){return{isDataVersioned:N(e,"hasVersionedData",!1),isDataBranchVersioned:N(e,"hasBranchVersionedData",!1)}}function H(e,t){const s=e?e.toLowerCase().split(",").map((e=>e.trim())):[],r=s.includes("query"),i=s.includes("editing")&&!t.datesInUnknownTimezone;let a=i&&s.includes("create"),o=i&&s.includes("delete"),n=i&&s.includes("update");return i&&!(a||o||n)&&(a=o=n=!0),{supportsAdd:a,supportsDelete:o,supportsEditing:i,supportsChangeTracking:s.includes("changetracking"),supportsQuery:r,supportsQueryDataElements:N(t,"supportsQueryDataElements",!1),supportsQueryDomains:N(t,"supportsQueryDomains",!1),supportsQueryContingentValues:N(t,"supportsQueryContingentValues",!1),supportsSync:s.includes("sync"),supportsUpdate:n}}function B(e){return{maxRecordCountFactor:q(e,"maxRecordCountFactor",void 0),maxRecordCount:q(e,"maxRecordCount",void 0)}}function $(e){const t=e?.advancedEditingCapabilities;return{supportsAsyncApplyEdits:N(t,"supportsAsyncApplyEdits",!1),supportsGlobalId:N(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:N(t,"supportsReturnServiceEditsInSourceSR",!1),supportsSharedTemplates:N(e,"supportsSharedTemplates",!1)||N(e,"hasSharedTemplates",!1),supportsSplit:N(t,"supportsSplit",!1)}}function z(e){const t=e?.syncCapabilities,s=t?.supportedSyncDataOptions;return{supportsAsync:N(t,"supportsAsync",!1),supportedSyncDataOptions:{annotations:!(1&~s),dimensions:!(2&~s),contingentValues:!(4&~s),attributeRules:!(8&~s),utilityNetworkSystem:!(16&~s),annotationFullModel:!(32&~s),include3DObjects:!(64&~s),utilityNetworkMissingLayers:!(128&~s),preserveTrueCurves:!(256&~s)}}}let Z=class extends(n.JSONSupportMixin(o.IdentifiableMixin(u))){constructor(e){super(e),this.url=null,this.sourceJSON=null,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.userTypeExtensions=[],this.layerInfos=null,this.tableInfos=null,this.capabilities=null}read(e,t){this.sourceJSON=e,super.read(e,t)}get utilityNetworkUrl(){if(this.sourceJSON)for(const e of this.sourceJSON.layers)if("Utility Network Layer"===e.type)return`${this.url}/${e.id}`;return null}get versionManagementServiceUrl(){return this.sourceJSON?.hasBranchVersionedData&&!D(this.url)?this.url.replace(/\/FeatureServer/i,"/VersionManagementServer"):null}readLayerInfos(e,t){return(t.layers||[]).map((e=>{const{type:t,geometryType:s}=e;return{...J(this.url,e),type:t||"Feature Layer",geometryType:s}}))}readTableInfos(e,t){return(t.tables||[]).map((e=>J(this.url,e)))}readCapabilities(e,t){return Q(t)}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=l(e),{operations:s}=t;return this.userHasUpdateItemPrivileges?(s.supportsAdd=s.supportsDelete=s.supportsEditing=s.supportsQuery=s.supportsUpdate=!0,t):(this.userHasFullEditingPrivileges&&s.supportsEditing&&(s.supportsAdd=s.supportsDelete=s.supportsUpdate=!0),t)}load(e){return this.addResolvingPromise(this._fetchService(this.url,e).then((()=>this._setUserPrivileges(e)))),Promise.resolve(this)}async fetchAllLayersAndTables(e){return await this.load(e),this._fetchLayersAndTablesPromise||=this._fetchLayersAndTables(this.url),p(e),this._fetchLayersAndTablesPromise}async applyEdits(e,t){let s=null;try{const{results:r,edits:i,editedFeatures:a}=await this._internalApplyEdits(e,t),o=e=>e.filter((e=>!e.error)).map(l);let n=0;return r.map((e=>{s=I(this.url,e.id,t?.gdbVersion,!0);const r={edits:i[n],addedFeatures:o(e.addFeatureResults),updatedFeatures:o(e.updateFeatureResults),deletedFeatures:o(e.deleteFeatureResults),addedAttachments:o(e.addAttachmentResults),updatedAttachments:o(e.updateAttachmentResults),deletedAttachments:o(e.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:e.editMoment?new Date(e.editMoment):null};n+=1,a.length>0&&(r.editedFeatures=a),s.resolve(r),s=null})),r}catch(r){throw s&&s.reject(r),r}}async querySharedTemplates(e){const t={...e?.query};null==t.layers&&null==t.templateIds&&(t.layers=this.layerInfos.map((e=>e.id)));return(await M({serviceUrl:this.url,query:t,requestOptions:e?.requestOptions})).map((e=>{const t=h.fromJSON(e);return t.featureService=this,t}))}async _setUserPrivileges(e){if(t.userPrivilegesApplied)try{const{features:{fullEdit:t},content:{updateItem:s}}=await this._fetchUserPrivileges(this.sourceJSON.serviceItemId,e);this._set("userHasFullEditingPrivileges",t),this._set("userHasUpdateItemPrivileges",s)}catch(s){d(s)}}async _fetchUserPrivileges(e,t){const r=!0,i=!1,a=!1;if(!e)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};let o,n,l;try{o=await F(this.url,t)}catch(u){d(u)}try{const e=null!=t?t.signal:null;n=await(s?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(u){d(u)}if(!n)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};try{if(l=new U({id:e,portal:{url:o}}),await l.load(t),l.portal.user)return C(l)}catch(u){d(u)}return{features:{edit:r,fullEdit:i},content:{updateItem:a}}}async _internalApplyEdits(e,t){await A(this.url);const s=t?.globalIdUsed??!1,a=f.fromJSON(this.sourceJSON.spatialReference),{edits:o,options:n}=await this._processApplyEditsParams(e,t),l=await Promise.all(o.map((async e=>{const t=e.addFeatures?.map((e=>b({spatialReference:a},e,null)))??[],r=(await Promise.all(t)).filter(i),o=r.length>0?r:null,n=e.updateFeatures?.map((e=>b({spatialReference:a},e,null)))??[],l=(await Promise.all(n)).filter(i),u=l.length>0?l:null,p=g(e.identifierFields,e.deleteFeatures,s),d=p.length>0?p:null;G(o,u,a);const c=await v(e.identifierFields,e);let m=null;if(c){m={adds:c.adds.length>0?c.adds:void 0,updates:c.updates.length>0?c.updates:void 0,deletes:c.deletes.length>0?c.deletes:void 0}}const y={};return e.deleteAssociations&&(y.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(y.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(y.divideGroupedObjects=e.divideGroupedObjects),{id:e.id,adds:o,updates:u,deletes:d,attachments:m,...y}}))),u={gdbVersion:n?.gdbVersion,rollbackOnFailure:!0,useGlobalIds:s,returnEditMoment:!0,honorSequenceOfEdits:n?.honorSequenceOfEdits,usePreviousEditMoment:n?.usePreviousEditMoment,returnServiceEditsInSourceSR:!1,returnServiceEditsOption:"originalAndCurrentFeatures",async:!1};await L(this.url,t?.gdbVersion,!0);const p=_(this.url,t?.gdbVersion||null);u.edits=JSON.stringify(l);const d=P(this.url),c=V(d.query,{query:k({...u,f:"json"}),method:"post"});let m;p&&(c.authMode="immediate",c.query.sessionId=x);try{m=await r(this.url+"/applyEdits",c)}catch(y){if(!j(y))throw y;c.authMode="immediate",m=await r(this.url+"/applyEdits",c)}return{...K(m),edits:o}}async _processApplyEditsParams(e,t){const s={...t,usingFeatureServiceEndpoint:!0};return{edits:await Promise.all(e.map((async e=>{const t=this.effectiveCapabilities,r=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),i=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments);if(E(e,t,s,!!r,!!i,"feature-service"),!t.data.isDataVersioned&&s?.gdbVersion)throw new a("feature-service:invalid-parameter","'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isDataVersioned'");const o=R(e,t,"feature-service"),n={};e.deleteAssociations&&(n.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(n.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(n.divideGroupedObjects=e.divideGroupedObjects);const l=await w(o);return{id:e.id,...l,...n,identifierFields:e.identifierFields}}))),options:s}}async _fetchService(e,t){if(this.sourceJSON)return void this.read(this.sourceJSON,{url:P(e)});const s=await r(e,{responseType:"json",query:{f:"json"},...t});this.read(s.data,{url:P(e)})}async _fetchLayersAndTables(e){const t=`${e}/layers`,s=await r(t,{responseType:"json",query:{f:"json"}});return{layers:s.data.layers.map((e=>{const{type:t,geometryType:s}=e,r=J(this.url,e),i=T(e,r.url);return{...r,type:t||"Feature Layer",geometryType:s,capabilities:i}})),tables:s.data.tables.map((e=>{const t=J(this.url,e),s=T(e,t.url);return{...t,capabilities:s}}))}}};function K(e){const t=e.data,s=[];return{results:t.map((e=>{const t={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment},r=S(t),i=e.editedFeatures,a=i?.spatialReference?new f({wkid:i?.spatialReference.wkid,wkt:i?.spatialReference.wkt,latestWkid:i?.spatialReference.latestWkid,latestVcsWkid:i?.spatialReference.latestVcsWkid,vcsWkid:i?.spatialReference.vcsWkid}):null,o=i?O(i,a):null;o&&s.push({layerId:e.id,editedFeatures:o});const n={};return e.divideGroupedObjectResults&&(n.divideGroupedObjectResults=e.divideGroupedObjectResults),e.combineGroupedObjectResults&&(n.combineGroupedObjectResults=e.combineGroupedObjectResults),{id:e.id,editedFeatures:o,...r,...n}})),editedFeatures:s}}e([c()],Z.prototype,"url",void 0),e([c()],Z.prototype,"sourceJSON",void 0),e([c()],Z.prototype,"userHasFullEditingPrivileges",void 0),e([c()],Z.prototype,"userHasUpdateItemPrivileges",void 0),e([c({readOnly:!0})],Z.prototype,"utilityNetworkUrl",null),e([c({readOnly:!0})],Z.prototype,"versionManagementServiceUrl",null),e([c()],Z.prototype,"userTypeExtensions",void 0),e([c({json:{read:{source:["layers"]}}})],Z.prototype,"layerInfos",void 0),e([m("layerInfos",["layers"])],Z.prototype,"readLayerInfos",null),e([c({json:{read:{source:["tables"]}}})],Z.prototype,"tableInfos",void 0),e([m("tableInfos",["tables"])],Z.prototype,"readTableInfos",null),e([c({readOnly:!0,json:{read:{source:["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"]}}})],Z.prototype,"capabilities",void 0),e([m("capabilities",["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"])],Z.prototype,"readCapabilities",null),e([c({readOnly:!0})],Z.prototype,"effectiveCapabilities",null),Z=e([y("esri.rest.featureService.FeatureService")],Z);const X=Z;export{X as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import GraphAddNamedTypesResult = __esri.GraphAddNamedTypesResult;
4
+ export default GraphAddNamedTypesResult;
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import GraphDeleteNamedTypeResult = __esri.GraphDeleteNamedTypeResult;
4
+ export default GraphDeleteNamedTypeResult;
@@ -1,6 +1,8 @@
1
1
  import "../interfaces";
2
2
 
3
+ export const executeAddNamedTypes: __esri.knowledgeGraphService["executeAddNamedTypes"];
3
4
  export const executeApplyEdits: __esri.knowledgeGraphService["executeApplyEdits"];
5
+ export const executeDeleteNamedType: __esri.knowledgeGraphService["executeDeleteNamedType"];
4
6
  export const executeFindPaths: __esri.knowledgeGraphService["executeFindPaths"];
5
7
  export const executeFindPathsAsynchronous: __esri.knowledgeGraphService["executeFindPathsAsynchronous"];
6
8
  export const executeQuery: __esri.knowledgeGraphService["executeQuery"];
@@ -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 r}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/JSONSupport.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{reader as e}from"../../../../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";let n=class extends t{constructor(r){super(r),this.container=null,this.ranges=null}readContainer(r,t){return{sourceId:t.sourceId,globalId:t.globalId}}readRanges(r,t){return[...t.gaps.map((r=>({firstUnit:r.start,numUnits:r.end-r.start+1,isGap:!0}))),...t.unitIdentifiers.map((r=>({firstUnit:r.firstUnit,numUnits:r.numUnits,isGap:!1,content:{sourceId:r.sourceId,globalId:r.globalId}})))]}};r([o({type:Object})],n.prototype,"container",void 0),r([e("container",["sourceId","globalId"])],n.prototype,"readContainer",null),r([o({type:[Object]})],n.prototype,"ranges",void 0),r([e("ranges",["gaps","unitIdentifiers"])],n.prototype,"readRanges",null),n=r([s("esri.rest.networks.unitIdentifiers.support.UnitQueryResult")],n);const a=n;export{a as default};
5
+ import{_ as r}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/JSONSupport.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{reader as e}from"../../../../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";let n=class extends t{constructor(r){super(r),this.container=null,this.ranges=null}readContainer(r,t){return{sourceId:t.sourceId,globalId:t.globalId}}readRanges(r,t){return[...t.gaps.map((r=>({firstUnit:r.start,numUnits:r.end-r.start+1,isGap:!0}))),...t.unitIdentifiers.map((r=>({firstUnit:r.firstUnit,numUnits:r.numUnits,isGap:!1,content:{sourceId:r.sourceId,globalId:r.globalId}})))]}};r([o({type:Object})],n.prototype,"container",void 0),r([e("container",["sourceId","globalId"])],n.prototype,"readContainer",null),r([o({type:[Object]})],n.prototype,"ranges",void 0),r([e("ranges",["gaps","unitIdentifiers"])],n.prototype,"readRanges",null),n=r([s("esri.rest.networks.unitIdentifiers.support.UnitQueryResult")],n);export{n 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 t from"../../core/Error.js";import has from"../../core/has.js";import{whenOrAbort as o}from"../../core/promiseUtils.js";import{getGlbFormatId as r,getGltfFormatId as e}from"../../layers/support/infoFor3D.js";import{DataLayerSource as n}from"../../layers/support/source/DataLayerSource.js";import{executeRawQueryJSON as s}from"./executeQueryJSON.js";import{executeRawQueryPBF as a}from"./executeQueryPBF.js";import i from"../support/FeatureSet.js";import u from"../support/Query.js";async function f(t,o,r,e){return m(o,await c(t,o,r,e),r,e)}async function c(t,o,r,e){const n={...e},i=p(o,r),u=null!=o.outStatistics?.[0],f=has("featurelayer-pbf-statistics"),c=!u||f;let m;if("pbf"===r?.format&&c)try{m=await a(t,i,n)}catch(d){if("query:parsing-pbf"!==d.name)throw d;r.format="json"}return"json"!==r?.format&&c||(m=await s(t,i,n)),l(r?.fieldsIndex,m.fields),m}function l(t,o){if(null!=t&&null!=o)for(const r of o){const o=t.get(r.name);o&&Object.assign(r,o.toJSON())}}async function m(t,r,e,n){const s=e?.infoFor3D;if(!d(t,s)||null==s||!r.assetMaps||!r.features?.length)return i.fromJSON(r);const{meshFeatureSetFromJSON:a}=await o(import("../support/meshFeatureSet.js"),n);return a(t,s,r)}function p(o,s){let a=u.from(o);a.sourceSpatialReference=a.sourceSpatialReference??s?.sourceSpatialReference??null,(s?.gdbVersion||s?.dynamicDataSource)&&(a=a===o?a.clone():a,a.gdbVersion=o.gdbVersion||s.gdbVersion,a.dynamicDataSource=o.dynamicDataSource?n.from(o.dynamicDataSource):s.dynamicDataSource);const i=s?.infoFor3D;if(null!=i&&d(o,i)){a=a===o?a.clone():a,a.formatOf3DObjects=null;const n=r(i),s=e(i);for(const t of i.queryFormats){if(t===n){a.formatOf3DObjects=t;break}t!==s||a.formatOf3DObjects||(a.formatOf3DObjects=t)}if(!a.formatOf3DObjects)throw new t("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(null==a.outFields||!a.outFields.includes("*")){a=a===o?a.clone():a,null==a.outFields&&(a.outFields=[]);const{originX:t,originY:r,originZ:e,translationX:n,translationY:s,translationZ:u,scaleX:f,scaleY:c,scaleZ:l,rotationX:m,rotationY:p,rotationZ:d,rotationDeg:y}=i.transformFieldRoles;a.outFields.push(t,r,e,n,s,u,f,c,l,m,p,d,y)}}return a}function d(t,o){return null!=o&&!0===t.returnGeometry&&"xyFootprint"!==t.multipatchOption&&!t.outStatistics}export{f as executeQuery,c as executeRawQuery,l as normalizeFields};
5
+ import t from"../../core/Error.js";import has from"../../core/has.js";import{whenOrAbort as o}from"../../core/promiseUtils.js";import{getGlbFormatId as r,getGltfFormatId as e}from"../../layers/support/infoFor3D.js";import{DataLayerSource as n}from"../../layers/support/source/DataLayerSource.js";import{executeRawQueryJSON as s}from"./executeQueryJSON.js";import{executeRawQueryPBF as a}from"./executeQueryPBF.js";import i from"../support/FeatureSet.js";import u from"../support/Query.js";async function f(t,o,r,e,n){return m(o,await c(t,o,r,e,n),r,e)}async function c(t,o,r,e,n){const i={...e},u=p(o,r),f=null!=o.outStatistics?.[0],c=has("featurelayer-pbf-statistics"),m=!f||c;let d;if("pbf"===r?.format&&m)try{d=await a(t,u,i,n)}catch(y){if("query:parsing-pbf"!==y.name)throw y;r.format="json"}return"json"!==r?.format&&m||(d=await s(t,u,i,n)),l(r?.fieldsIndex,d.fields),d}function l(t,o){if(null!=t&&null!=o)for(const r of o){const o=t.get(r.name);o&&Object.assign(r,o.toJSON())}}async function m(t,r,e,n){const s=e?.infoFor3D;if(!d(t,s)||null==s||!r.assetMaps||!r.features?.length)return i.fromJSON(r);const{meshFeatureSetFromJSON:a}=await o(import("../support/meshFeatureSet.js"),n);return a(t,s,r)}function p(o,s){let a=u.from(o);a.sourceSpatialReference=a.sourceSpatialReference??s?.sourceSpatialReference??null,(s?.gdbVersion||s?.dynamicDataSource)&&(a=a===o?a.clone():a,a.gdbVersion=o.gdbVersion||s.gdbVersion,a.dynamicDataSource=o.dynamicDataSource?n.from(o.dynamicDataSource):s.dynamicDataSource);const i=s?.infoFor3D;if(null!=i&&d(o,i)){a=a===o?a.clone():a,a.formatOf3DObjects=null;const n=r(i),s=e(i);for(const t of i.queryFormats){if(t===n){a.formatOf3DObjects=t;break}t!==s||a.formatOf3DObjects||(a.formatOf3DObjects=t)}if(!a.formatOf3DObjects)throw new t("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(null==a.outFields||!a.outFields.includes("*")){a=a===o?a.clone():a,null==a.outFields&&(a.outFields=[]);const{originX:t,originY:r,originZ:e,translationX:n,translationY:s,translationZ:u,scaleX:f,scaleY:c,scaleZ:l,rotationX:m,rotationY:p,rotationZ:d,rotationDeg:y}=i.transformFieldRoles;a.outFields.push(t,r,e,n,s,u,f,c,l,m,p,d,y)}}return a}function d(t,o){return null!=o&&!0===t.returnGeometry&&"xyFootprint"!==t.multipatchOption&&!t.outStatistics}export{f as executeQuery};
@@ -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{parseUrl as r}from"../utils.js";import{executeQuery as t}from"./operations/query.js";import o from"../support/FeatureSet.js";import e from"../support/Query.js";async function s(r,t,e){const s=await a(r,t,e);return o.fromJSON(s)}async function a(o,s,a,n){const i=r(o),p={...a},u=e.from(s),{data:m}=await t(i,u,u.sourceSpatialReference,p,n);return m}export{s as executeQueryJSON,a as executeRawQueryJSON};
5
+ import{parseUrl as r}from"../utils.js";import{executeQuery as t}from"./operations/query.js";import o from"../support/FeatureSet.js";import e from"../support/Query.js";async function s(r,t,e,s){const n=await a(r,t,e,s);return o.fromJSON(n)}async function a(o,s,a,n){const i=r(o),p={...a},u=e.from(s),{data:m}=await t(i,u,u.sourceSpatialReference,p,n);return m}export{s as executeQueryJSON,a as executeRawQueryJSON};
@@ -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{parseUrl as r}from"../utils.js";import{JSONFeatureSetParserContext as e}from"./operations/pbfJSONFeatureSet.js";import{executeQueryPBF as t}from"./operations/query.js";import o from"../support/FeatureSet.js";import a from"../support/Query.js";async function s(r,e,t){const s=await n(r,a.from(e),t);return o.fromJSON(s)}async function n(o,s,n,p){const i=r(o),u={...n},m=a.from(s),f=!m.quantizationParameters,{data:c}=await t(i,m,new e({sourceSpatialReference:m.sourceSpatialReference,applyTransform:f}),u,p);return c}export{s as executeQueryPBF,n as executeRawQueryPBF};
5
+ import{parseUrl as r}from"../utils.js";import{JSONFeatureSetParserContext as e}from"./operations/pbfJSONFeatureSet.js";import{executeQueryPBF as t}from"./operations/query.js";import o from"../support/FeatureSet.js";import a from"../support/Query.js";async function s(r,e,t,s){const p=await n(r,a.from(e),t,s);return o.fromJSON(p)}async function n(o,s,n,p){const i=r(o),u={...n},m=a.from(s),f=!m.quantizationParameters,{data:c}=await t(i,m,new e({sourceSpatialReference:m.sourceSpatialReference,applyTransform:f}),u,p);return c}export{s as executeQueryPBF,n as executeRawQueryPBF};
package/rest/query.js CHANGED
@@ -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
- export{executeQuery,executeRawQuery,normalizeFields}from"./query/executeQuery.js";export{executeAttachmentQuery}from"./query/executeAttachmentQuery.js";export{executeAttributeBinsQuery}from"./query/executeAttributeBinsQuery.js";export{executeForCount}from"./query/executeForCount.js";export{executeForExtent}from"./query/executeForExtent.js";export{executeForIds}from"./query/executeForIds.js";export{executeQueryJSON,executeRawQueryJSON}from"./query/executeQueryJSON.js";export{executeQueryPBF,executeRawQueryPBF}from"./query/executeQueryPBF.js";export{executeRelationshipQuery,executeRelationshipQueryForCount}from"./query/executeRelationshipQuery.js";export{executeTopFeaturesQuery}from"./query/executeTopFeaturesQuery.js";export{executeForTopIds}from"./query/executeForTopIds.js";export{executeForTopExtents}from"./query/executeForTopExtents.js";export{executeForTopCount}from"./query/executeForTopCount.js";
5
+ export{executeAttachmentQuery}from"./query/executeAttachmentQuery.js";export{executeAttributeBinsQuery}from"./query/executeAttributeBinsQuery.js";export{executeForCount}from"./query/executeForCount.js";export{executeForExtent}from"./query/executeForExtent.js";export{executeForIds}from"./query/executeForIds.js";export{executeForTopCount}from"./query/executeForTopCount.js";export{executeForTopExtents}from"./query/executeForTopExtents.js";export{executeForTopIds}from"./query/executeForTopIds.js";export{executeQueryJSON,executeRawQueryJSON}from"./query/executeQueryJSON.js";export{executeQueryPBF,executeRawQueryPBF}from"./query/executeQueryPBF.js";export{executeRelationshipQuery,executeRelationshipQueryForCount}from"./query/executeRelationshipQuery.js";export{executeTopFeaturesQuery}from"./query/executeTopFeaturesQuery.js";
@@ -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"../../../Color.js";import{clone as t}from"../../../core/lang.js";import{px2pt as o}from"../../../core/screenUtils.js";import i from"../../../symbols/CIMSymbol.js";import{Simple3DLineStyle as r,LineJoinStyle as n,LineCapStyle as l}from"../../../symbols/cim/enums.js";const a="spike-height-override",s=o(8),m=o(20);function u(e){const{field:t,normalizationField:o,sizeStops:i}=e,{value:r,size:n}=i[0],{value:l,size:s}=i[1];let m,u=0;t&&(u=`$feature["${t}"]`,m=`\n if(!HasValue($feature, "${t}")){\n return 0;\n }\n $feature["${t}"];\n `),o&&(u=`$feature["${t}"] / $feature["${o}"]`,m=`if(!HasValue($feature, "${t}") || !HasValue($feature, "${o}") || $feature["${o}"] <= 0){\n return 0;\n }\n $feature["${t}"];\n $feature["${o}"];`);return[{type:"CIMPrimitiveOverride",primitiveName:a,propertyName:"Length",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:`\n ${m}\n var value = ${u};\n\n var maxSize = ${s};\n var minSize = ${n};\n\n var minDataValue = ${r};\n var maxDataValue = ${l};\n\n var ratio = Constrain(( value - minDataValue ) / ( maxDataValue - minDataValue ), 0, 1);\n\n var size = Constrain(maxSize * ratio, minSize, maxSize);\n return size;\n `,returnType:"Default"}}]}function f(e){const{primitiveOverrides:t,baseWidth:o,defaultHeight:r}=e,n=c(e);return new i({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",effects:[{type:"CIMGeometricEffectRadial",primitiveName:a,angle:90,length:r??m},{type:"CIMGeometricEffectTaperedPolygon",fromWidth:o??s,toWidth:1,length:5}],symbolLayers:n,haloSize:1,scaleX:1,angleAlignment:"Display"},primitiveOverrides:t}})}function c(e){const t=[p(e)],o=y(e);return o&&t.push(o),t}function p(e){const{strokeColor:t,strokeWidth:i,symbolStyle:a}=e;let s=t?.toArray(),m=!1;return"triangle-open-fill-outline"===a||"triangle-enclosed-fill-outline"===a?m=!0:"triangle-open-outline"!==a&&"triangle-enclosed-outline"!==a&&"triangle-open-fill"!==a&&"triangle-enclosed-fill"!==a||(s=e.color?.toArray()),{type:"CIMSolidStroke",effects:d(a),enable:!0,colorLocked:m,capStyle:l.Round,joinStyle:n.Round,lineStyle3D:r.Strip,miterLimit:4,width:i??o(1),color:s}}function d(e){if("triangle-enclosed-fill"!==e&&"triangle-enclosed-fill-outline"!==e&&"triangle-enclosed-outline"!==e)return[{type:"CIMGeometricEffectAddControlPoints",angleTolerance:90,primitiveName:"spike-control-points"},{type:"CIMGeometricEffectSuppress",suppress:!0,invert:!0,primitiveName:"spike-stroke-suppress"}]}function y(e){const{color:t,symbolStyle:o}=e;if("triangle-open-outline"!==o&&"triangle-enclosed-outline"!==o)return{type:"CIMSolidFill",enable:!0,colorLocked:!1,color:t?.toArray()}}function v(o,i){const{defaultHeight:r,baseWidth:n,color:l,strokeColor:s,primitiveOverrides:m,symbolStyle:u,strokeWidth:f}=i,p="CIMPointSymbol"===o.data.symbol?.type?o.data.symbol:null;if(!p)return o;const d=p.effects,y=d?.find((e=>"CIMGeometricEffectTaperedPolygon"===e.type)),v=d?.find((e=>"CIMGeometricEffectRadial"===e.type&&e.primitiveName===a));null!=n&&y&&(y.fromWidth=n),null!=r&&v&&(v.length=r);const S=p.symbolLayers,$=S?.find((e=>"CIMSolidStroke"===e.type)),g=S?.find((e=>"CIMSolidFill"===e.type));return u?p.symbolLayers=c({color:l??(g?.color?new e(g.color):void 0),strokeColor:s??($?.color?new e($.color):void 0),strokeWidth:f??$?.width,symbolStyle:u}):$&&null!=s?$.color=s.toArray():g&&null!=l&&(g.color=l.toArray()),void 0!==m&&(o.data.primitiveOverrides=t(m)),o}export{u as createPrimitiveOverrides,f as createSpikeSymbol,v as updateSpikeSymbol};
5
+ import e from"../../../Color.js";import{clone as o}from"../../../core/lang.js";import{px2pt as t}from"../../../core/screenUtils.js";import r from"../../../symbols/CIMSymbol.js";import{Simple3DLineStyle as i,LineJoinStyle as l,LineCapStyle as n}from"../../../symbols/cim/enums.js";const a="spike-height-override",s=t(8),m=t(20);function u(e){const{field:o,normalizationField:t,sizeStops:r}=e,{value:i,size:l}=r[0],{value:n,size:s}=r[1];let m,u=0;o&&(u=`$feature["${o}"]`,m=`\n if(!HasValue($feature, "${o}")){\n return 0;\n }\n $feature["${o}"];\n `),t&&(u=`$feature["${o}"] / $feature["${t}"]`,m=`if(!HasValue($feature, "${o}") || !HasValue($feature, "${t}") || $feature["${t}"] <= 0){\n return 0;\n }\n $feature["${o}"];\n $feature["${t}"];`);return[{type:"CIMPrimitiveOverride",primitiveName:a,propertyName:"Length",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:`\n ${m}\n var value = ${u};\n\n var maxSize = ${s};\n var minSize = ${l};\n\n var minDataValue = ${i};\n var maxDataValue = ${n};\n\n var ratio = Constrain(( value - minDataValue ) / ( maxDataValue - minDataValue ), 0, 1);\n\n var size = Constrain(maxSize * ratio, minSize, maxSize);\n return size;\n `,returnType:"Default"}}]}function c(e){const{primitiveOverrides:o,baseWidth:t,defaultHeight:i}=e,l=p(e);return new r({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",effects:[{type:"CIMGeometricEffectRadial",primitiveName:a,angle:90,length:i??m},{type:"CIMGeometricEffectTaperedPolygon",fromWidth:t??s,toWidth:1,length:5}],symbolLayers:l,haloSize:1,scaleX:1,angleAlignment:"Display"},primitiveOverrides:o}})}function p(e){const o=[f(e)],t=y(e);return t&&o.push(t),o}function f(e){const{strokeColor:o,strokeWidth:r,symbolStyle:a}=e,s=a?.includes("solid-fill")||a?.includes("gradient-fill");let m=o?.toArray(),u=!1;return a?.includes("outline")&&s?u=!0:m=e.color?.toArray(),{type:"CIMSolidStroke",effects:d(a),enable:!0,colorLocked:u,capStyle:n.Round,joinStyle:l.Round,lineStyle3D:i.Strip,miterLimit:4,width:r??t(1),color:m}}function d(e){if(!e?.includes("closed"))return[{type:"CIMGeometricEffectAddControlPoints",angleTolerance:90,primitiveName:"spike-control-points"},{type:"CIMGeometricEffectSuppress",suppress:!0,invert:!0,primitiveName:"spike-stroke-suppress"}]}function y(e){const{color:o,symbolStyle:t}=e,r=t?.includes("solid-fill"),i=t?.includes("gradient-fill");if(!r&&!i||!o)return;if(r)return{type:"CIMSolidFill",enable:!0,colorLocked:!1,color:o?.toArray()};const l=o.clone();return l.a=0,{type:"CIMGradientFill",enable:!0,angle:90,colorRamp:{type:"CIMMultipartColorRamp",colorRamps:[{type:"CIMLinearContinuousColorRamp",fromColor:o.toArray(),toColor:l.toArray()}],weights:[1]},gradientMethod:"Linear",gradientSize:70,gradientSizeUnits:"Relative",gradientType:"Continuous"}}function C(t,r){const{defaultHeight:i,baseWidth:l,color:n,strokeColor:s,primitiveOverrides:m,symbolStyle:u,strokeWidth:c}=r,f="CIMPointSymbol"===t.data.symbol?.type?t.data.symbol:null;if(!f)return t;const d=f.effects,y=d?.find((e=>"CIMGeometricEffectTaperedPolygon"===e.type)),C=d?.find((e=>"CIMGeometricEffectRadial"===e.type&&e.primitiveName===a));null!=l&&y&&(y.fromWidth=l),null!=i&&C&&(C.length=i);const v=f.symbolLayers,S=v?.find((e=>"CIMSolidStroke"===e.type)),$=v?.find((e=>"CIMSolidFill"===e.type)),M=v?.find((e=>"CIMGradientFill"===e.type)),I="CIMMultipartColorRamp"===M?.colorRamp?.type&&"CIMLinearContinuousColorRamp"===M.colorRamp.colorRamps[0]?.type?M.colorRamp.colorRamps[0]:null;if(u){const o=$?.color??I?.fromColor;f.symbolLayers=p({color:n??(o?new e(o):void 0),strokeColor:s??(S?.color?new e(S.color):void 0),strokeWidth:c??S?.width,symbolStyle:u})}else if(S&&null!=s)S.color=s.toArray();else if($&&null!=n)$.color=n.toArray();else if(I&&null!=n){const e=n.clone();e.a=0,I.fromColor=n.toArray(),I.toColor=e.toArray()}return void 0!==m&&(t.data.primitiveOverrides=o(m)),t}export{u as createPrimitiveOverrides,c as createSpikeSymbol,C as updateSpikeSymbol};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const a="20250521",b="e816a3d979e596a30a15bfdb4eb8fa66a68b330b";export{a as buildDate,b as commitHash};
5
+ const c="20250522",a="50b9c30820586b4c42ca126a007a5d2568620d55";export{c as buildDate,a as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import has from"../../core/has.js";import{property as s}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{SymbolFader as o}from"./engine/vectorTiles/decluttering/SymbolFader.js";import{RotationAlignment as a,TranslateAnchor as i}from"./engine/vectorTiles/style/StyleDefinition.js";import{tileSize as l}from"./engine/webgl/definitions.js";const n=7e6;class c{constructor(){this.styles=new Map,this.layerContexts=new Map}get cachedStyles(){return this.styles}setLabelClassStyle(e,t,s){this.layerContexts.set(e,t),this.styles.set(e,s)}}let p=class extends t{constructor(e){super(e),this._faderWorkingSet=[],this._styleRepository=new c,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null;const t=(e,t)=>{e.writeLabelVisibility(),e.requestRender(),e.isReady&&(e.decluttered=!0)};this.symbolFader=new o("feature-tile",this._styleRepository,t,this._faderWorkingSet,l,n)}get updating(){return has("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}:\n-> updateRequested: ${this.updateRequested}`),this.updateRequested}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(e){this.doUpdate(e)?this.updateRequested=!1:(this.updateRequested=!0,this.view?.requestUpdate())}setLabelSchemaStyles(e,t){let s;switch(e.type){case"label":s=e.classes;break;case"subtype":s=Array.from(Object.values(e.renderers).flatMap((e=>e.classes)));break;case"cluster":s=[...e.cluster.classes,...e.feature.classes];break;case"track":s=[...e.latestObservation.classes,...e.previousObservation.classes,...e.trackLine.classes]}for(const r of s){const e=d(r);this._styleRepository.setLabelClassStyle(r.labelClassId,t,e)}}doUpdate(e){const t=this.view;if(!t)return!1;const s=t.allLayerViews.map((e=>e.featureContainer)).filter((e=>!!e&&e?.hasLabels));if(s.length>0){this._faderWorkingSet.length=0;for(const t of s)for(const s of t.tiles||[])s.setTransform(e.state),this._faderWorkingSet.push(s);const r=e.state.scale,o=t.featuresTilingScheme.scaleToZoom(r);return this.symbolFader.update(o,e.state)}return!0}};function d(e){const t="esriGeometryPolyline"===e.geometryType?a.MAP:a.VIEWPORT,s="esriGeometryPolyline"===e.geometryType?i.MAP:i.VIEWPORT;return{geometryType:e.geometryType,iconAllowOverlap:!e.deconflictionEnabled,iconIgnorePlacement:!1,textAllowOverlap:!e.deconflictionEnabled,textIgnorePlacement:!1,iconRotationAlignment:t,textRotationAlignment:t,iconTranslateAnchor:s,iconTranslate:[0,0],textTranslateAnchor:s,textTranslate:[0,0]}}e([s()],p.prototype,"updateRequested",void 0),e([s()],p.prototype,"updating",null),e([s()],p.prototype,"view",void 0),p=e([r("esri.views.2d.LabelManager")],p);export{c as LabelClassStyleRepository,p as LabelManager};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import has from"../../core/has.js";import{property as s}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{SymbolFader as o}from"./engine/vectorTiles/decluttering/SymbolFader.js";import{RotationAlignment as a,TranslateAnchor as i}from"./engine/vectorTiles/style/StyleDefinition.js";import{tileSize as l}from"./engine/webgl/definitions.js";const n=7e6;class c{constructor(){this.styles=new Map,this.layerContexts=new Map}get cachedStyles(){return this.styles}setLabelClassStyle(e,t,s){this.layerContexts.set(e,t),this.styles.set(e,s)}}let p=class extends t{constructor(e){super(e),this._faderWorkingSet=[],this._styleRepository=new c,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null;const t=(e,t)=>{e.updateLabelVisibility(),e.requestRender(),e.isReady&&(e.decluttered=!0)};this.symbolFader=new o("feature-tile",this._styleRepository,t,this._faderWorkingSet,l,n)}get updating(){return has("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}:\n-> updateRequested: ${this.updateRequested}`),this.updateRequested}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(e){this.doUpdate(e)?this.updateRequested=!1:(this.updateRequested=!0,this.view?.requestUpdate())}setLabelSchemaStyles(e,t){let s;switch(e.type){case"label":s=e.classes;break;case"subtype":s=Array.from(Object.values(e.renderers).flatMap((e=>e.classes)));break;case"cluster":s=[...e.cluster.classes,...e.feature.classes];break;case"track":s=[...e.latestObservation.classes,...e.previousObservation.classes,...e.trackLine.classes]}for(const r of s){const e=d(r);this._styleRepository.setLabelClassStyle(r.labelClassId,t,e)}}doUpdate(e){const t=this.view;if(!t)return!1;const s=t.allLayerViews.map((e=>e.featureContainer)).filter((e=>!!e&&e?.hasLabels));if(s.length>0){this._faderWorkingSet.length=0;for(const t of s)for(const s of t.tiles||[])s.setTransform(e.state),this._faderWorkingSet.push(s);const r=e.state.scale,o=t.featuresTilingScheme.scaleToZoom(r);return this.symbolFader.update(o,e.state)}return!0}};function d(e){const t="esriGeometryPolyline"===e.geometryType?a.MAP:a.VIEWPORT,s="esriGeometryPolyline"===e.geometryType?i.MAP:i.VIEWPORT;return{geometryType:e.geometryType,iconAllowOverlap:!e.deconflictionEnabled,iconIgnorePlacement:!1,textAllowOverlap:!e.deconflictionEnabled,textIgnorePlacement:!1,iconRotationAlignment:t,textRotationAlignment:t,iconTranslateAnchor:s,iconTranslate:[0,0],textTranslateAnchor:s,textTranslate:[0,0]}}e([s()],p.prototype,"updateRequested",void 0),e([s()],p.prototype,"updating",null),e([s()],p.prototype,"view",void 0),p=e([r("esri.views.2d.LabelManager")],p);export{c as LabelClassStyleRepository,p as LabelManager};
@@ -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{disposeMaybe as t}from"../../../../core/maybe.js";import{identity as e,translate as s,rotate as r,scaleByVec2 as i,multiply as a}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{DisplayObject as u}from"../DisplayObject.js";import{TextureSamplingMode as n}from"../../../webgl/enums.js";import{createTransformTexture as d,createRasterTexture as l,createColormapTexture as c}from"../../../webgl/rasterUtils.js";const x={bandCount:3,minOutput:0,maxOutput:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class _ extends u{constructor(t=null,e=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=t,this.transformGrid=e,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(t){this._processedTexture!==t&&(this._disposeTextures(!0),this._processedTexture=t)}get rasterTexture(){return this._rasterTexture}set rasterTexture(t){this._rasterTexture!==t&&(this._rasterTexture?.dispose(),this._rasterTexture=t),null==t&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(this.processedTexture=t(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||x}set symbolizerParameters(t){this._symbolizerParameters!==t&&(this._symbolizerParameters=t,this._colormapTextureInvalidated=!0)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null),this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(t){this._suspended&&!t&&this.stage&&(this.ready(),this.requestRender()),this._suspended=t}get bandIds(){return this._bandIds}set bandIds(t){this._bandIds=t,this._isBandIdsChanged(t)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(t){this._interpolation=t,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(t||"nearest")?n.LINEAR:n.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=t(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(t=!1){const e=t||this.projected;return[e?this.width:this.source?.width||this.width,e?this.height:this.source?.height||this.height]}getRasterCellSize(){const t=this.rawPixelData?.srcPixelSize,{projected:e,resolution:s}=this;return t&&!e?[t.x,t.y]:[s,s]}_createTransforms(){return{displayViewScreenMat3:o()}}setTransform(t){const o=e(this.transforms.displayViewScreenMat3),[u,n]=t.toScreenNoRotation([0,0],[this.x,this.y]),d=this.resolution/this.pixelRatio/t.resolution,l=d*this.width,c=d*this.height,x=Math.PI*this.rotation/180;s(o,o,h(u,n)),s(o,o,h(l/2,c/2)),r(o,o,-x),s(o,o,h(-l/2,-c/2)),i(o,o,h(l,c)),a(this.transforms.displayViewScreenMat3,t.displayViewMat3,o)}getTextures({forProcessing:t=!1,useProcessedTexture:e=!1}={}){const s=e?this._processedTexture??this._rasterTexture:this._rasterTexture,r=[],i=[];return s?(this._transformGridTexture&&!this.projected&&(i.push(this._transformGridTexture),r.push("u_transformGrid")),i.push(s),r.push("u_image"),!this._colormapTexture||!e&&t||(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i}):{names:r,textures:i}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:t}){if(!this.stage)return void this._disposeTextures();const e=this._isValidSource(this.source);e&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(t)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(t),this._rasterTexture&&(e?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=d(t,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:t}=this;0!==t.length&&(this.processedTexture=t.shift(),t.forEach((t=>t?.dispose())),t.length=0,this.processed=!!this.processedTexture)}_createOrDestroyRasterTexture(e){const s=this.source?.extractBands(this.bandIds);if(!this._isValidSource(s))return void(this._rasterTexture&&(this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null));const r=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(r)return;this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null}this._supportsBilinearTexture=!!e.capabilities.textureFloatLinear;const i=this._getTextureSamplingMethod(this.interpolation),a=this.isRendereredSource;this._rasterTexture=l(e,s,i,a),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(t){const e=this._rasterTextureBandIds;return!(null==e&&null==t||e&&t&&e.join("")===t.join(""))}_isValidSource(t){return null!=t&&t.pixels?.length>0}_getTextureSamplingMethod(t){const{type:e}=this.symbolizerParameters,s="lut"===e&&!this.symbolizerParameters.isClassBreaks||"hillshade"===e||"stretch"===e&&1===this.symbolizerParameters.bandCount;return!this._supportsBilinearTexture||s||"bilinear"!==t&&"cubic"!==t?"nearest":"bilinear"}_updateColormapTexture(e){const s=this._colormap,r=this.symbolizerParameters.colormap;return r?s?r.length!==s.length||r.some(((t,e)=>t!==s[e]))?(this._colormapTexture&&(this._colormapTexture=t(this._colormapTexture)),this._colormapTexture=c(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=c(e,r),void(this._colormap=r)):(this._colormapTexture&&(this._colormapTexture=t(this._colormapTexture)),void(this._colormap=null))}_disposeTextures(e=!1){e?this.projected&&(this._transformGridTexture=t(this._transformGridTexture)):(this._rasterTexture=t(this._rasterTexture),this._colormapTexture=t(this._colormapTexture),this._transformGridTexture=t(this._transformGridTexture),this._rasterTextureBandIds=null,this._colormap=null,this._colormapTextureInvalidated=!0),this._processedTexture=t(this._processedTexture)}}class p extends _{get source(){return this._source}}function m(t){return null!=t.source}export{_ as RasterBitmap,p as RasterBitmapWithSource,m as hasSource};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{identity as e,translate as s,rotate as r,scaleByVec2 as i,multiply as a}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{DisplayObject as u}from"../DisplayObject.js";import{TextureSamplingMode as n}from"../../../webgl/enums.js";import{createTransformTexture as l,createPixelMaskTexture as d,createRasterTexture as _,createColormapTexture as x}from"../../../webgl/rasterUtils.js";const m={bandCount:3,minOutput:0,maxOutput:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class c extends u{constructor(t=null,e=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._maskTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._mask=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=t,this.transformGrid=e,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(t){this._processedTexture!==t&&(this._disposeTextures(!0),this._processedTexture=t)}get rasterTexture(){return this._rasterTexture}set rasterTexture(t){this._rasterTexture!==t&&(this._rasterTexture?.dispose(),this._rasterTexture=t),null==t&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(this.processedTexture=t(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||m}set symbolizerParameters(t){this._symbolizerParameters!==t&&(this._symbolizerParameters=t,this._colormapTextureInvalidated=!0)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null),this.projected=!1,this.invalidateTexture())}get mask(){return this._mask}set mask(e){this._mask!==e&&(this._mask=e,this._maskTexture=t(this._maskTexture))}get suspended(){return this._suspended}set suspended(t){this._suspended&&!t&&this.stage&&(this.ready(),this.requestRender()),this._suspended=t}get bandIds(){return this._bandIds}set bandIds(t){this._bandIds=t,this._isBandIdsChanged(t)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(t){this._interpolation=t,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(t||"nearest")?n.LINEAR:n.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=t(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(t=!1){const e=t||this.projected;return[e?this.width:this.source?.width||this.width,e?this.height:this.source?.height||this.height]}getRasterCellSize(){const t=this.rawPixelData?.srcPixelSize,{projected:e,resolution:s}=this;return t&&!e?[t.x,t.y]:[s,s]}_createTransforms(){return{displayViewScreenMat3:h()}}setTransform(t){const h=e(this.transforms.displayViewScreenMat3),[u,n]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,d=l*this.width,_=l*this.height,x=Math.PI*this.rotation/180;s(h,h,o(u,n)),s(h,h,o(d/2,_/2)),r(h,h,-x),s(h,h,o(-d/2,-_/2)),i(h,h,o(d,_)),a(this.transforms.displayViewScreenMat3,t.displayViewMat3,h)}getTextures({forProcessing:t=!1,useProcessedTexture:e=!1}={}){const s=e?this._processedTexture??this._rasterTexture:this._rasterTexture,r=[],i=[];return s?(this._transformGridTexture&&!this.projected&&(i.push(this._transformGridTexture),r.push("u_transformGrid")),i.push(s),r.push("u_image"),!this._colormapTexture||!e&&t||(i.push(this._colormapTexture),r.push("u_colormap")),this._maskTexture&&(i.push(this._maskTexture),r.push("u_mask")),{names:r,textures:i}):{names:r,textures:i}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:t}){if(!this.stage)return void this._disposeTextures();const e=this._isValidSource(this.source);e&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(t)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(t),this._rasterTexture&&(e?(this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=l(t,this.transformGrid)),this._mask&&!this._maskTexture&&(this._maskTexture=d(t,this._mask,[this.width,this.height]))):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:t}=this;0!==t.length&&(this.processedTexture=t.shift(),t.forEach((t=>t?.dispose())),t.length=0,this.processed=!!this.processedTexture)}_createOrDestroyRasterTexture(e){const s=this.source?.extractBands(this.bandIds);if(!this._isValidSource(s))return void(this._rasterTexture&&(this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null));const r=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(r)return;this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null}this._supportsBilinearTexture=!!e.capabilities.textureFloatLinear;const i=this._getTextureSamplingMethod(this.interpolation),a=this.isRendereredSource;this._rasterTexture=_(e,s,i,a),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(t){const e=this._rasterTextureBandIds;return!(null==e&&null==t||e&&t&&e.join("")===t.join(""))}_isValidSource(t){return null!=t&&t.pixels?.length>0}_getTextureSamplingMethod(t){const{type:e}=this.symbolizerParameters,s="lut"===e&&!this.symbolizerParameters.isClassBreaks||"hillshade"===e||"stretch"===e&&1===this.symbolizerParameters.bandCount;return!this._supportsBilinearTexture||s||"bilinear"!==t&&"cubic"!==t?"nearest":"bilinear"}_updateColormapTexture(e){const s=this._colormap,r=this.symbolizerParameters.colormap;return r?s?r.length!==s.length||r.some(((t,e)=>t!==s[e]))?(this._colormapTexture&&(this._colormapTexture=t(this._colormapTexture)),this._colormapTexture=x(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=x(e,r),void(this._colormap=r)):(this._colormapTexture&&(this._colormapTexture=t(this._colormapTexture)),void(this._colormap=null))}_disposeTextures(e=!1){e?this.projected&&(this._transformGridTexture=t(this._transformGridTexture)):(this._rasterTexture=t(this._rasterTexture),this._colormapTexture=t(this._colormapTexture),this._transformGridTexture=t(this._transformGridTexture),this._maskTexture=t(this._maskTexture),this._rasterTextureBandIds=null,this._colormap=null,this._colormapTextureInvalidated=!0),this._processedTexture=t(this._processedTexture)}}class p extends c{get source(){return this._source}}function T(t){return null!=t.source}export{c as RasterBitmap,p as RasterBitmapWithSource,T as hasSource};
@@ -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{VectorTile as e}from"../VectorTile.js";import{fadeDuration as t}from"./config.js";import{effectFlag0 as o,filterFlag0 as i}from"../../webgl/definitions.js";function s(e){return(e.uniqueSymbol?.show&&e.uniqueSymbol?.lastShow)??!1}function r(e,t){if(e.priority-t.priority)return e.priority-t.priority;if(s(e)&&!s(t))return-1;if(s(t)&&!s(e))return 1;const o=e.tile.key,i=t.tile.key;return o.world-i.world?o.world-i.world:o.level-i.level?o.level-i.level:o.row-i.row?o.row-i.row:o.col-i.col?o.col-i.col:e.xTile-t.xTile?e.xTile-t.xTile:e.yTile-t.yTile}class n{get running(){return this._running}constructor(e,t,o,i,s,r,n,l){this.selectionMode=e,this._visibleTiles=t,this._symbolRepository=o,this._styleRepository=i,this._createCollisionJob=s,this._assignTileSymbolsOpacity=r,this._symbolLayerSorter=n,this._isLayerVisible=l,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(e,t){this._screenWidth===e&&this._screenHeight===t||this.restart(),this._screenWidth=e,this._screenHeight=t}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const t=performance.now();if(!this._selectionJob.work(e))return!1;if(this._selectionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const t=performance.now();if(!this._collisionJob.work(e))return!1;if(this._collisionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const t=performance.now();if(!this._opacityJob.work(e))return!1;if(this._opacityJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}return this._running=!1,!0}_isFeatureFiltered(e,t,s){const r=t.getFilterFlags(e),n=r&i,l=null==s.featureEffect||s.featureEffect.excludedLabelsVisible||r&o;return!(n&&l)}_getFiltered(){let e;if(this._styleRepository?.layerContexts)for(const t of this._symbolRepository.uniqueSymbols){const o=this._styleRepository.layerContexts?.get(t.styleLayerUID);if(o?.attributeView)for(const i of t.uniqueSymbols){e??=new Set;const t=o.attributeView,s=o.layerView;this._isFeatureFiltered(i.featureID,t,s)&&e.add(i.featureID)}}return e}_resetSelection(){for(let e=0;e<this._symbolRepository.uniqueSymbols.length;e++){const t=this._symbolRepository.uniqueSymbols[e];for(let e=0;e<t.uniqueSymbols.length;e++){const o=t.uniqueSymbols[e];for(const e of o.tileSymbols)e.selectedForRendering=!1}}}_createSelectionJob(){const e="feature-tile"===this.selectionMode?c:a,t=this._symbolRepository.uniqueSymbols;this._resetSelection();const o=[];let i=0,s=0;const n=this._isLayerVisible,l=this._getFiltered(),h=this._styleRepository?.layerContexts;function y(c){let a;const y=performance.now();for(;s<t.length;s++,i=0){const r=t[s],u=r.styleLayerUID;let f=0;if(h){const e=h.get(u).layerView;f=e.view.allLayerViews.items.indexOf(e)}if(!n(u)){o[s]||(o[s]={styleLayerUID:u,layerOrder:f,symbols:[]});continue}o[s]||={styleLayerUID:u,symbols:[],layerOrder:f};const b=o[s];for(;i<r.uniqueSymbols.length;i++){if(a=r.uniqueSymbols[i],i%100==99&&performance.now()-y>c)return!1;if(a.lastShow=a.show,a.featureID&&l?.has(a.featureID)){a.show=!1,a.parts[0].show=!1,a.parts[1].show=!1;continue}const t=e(a);if(t){t.selectedForRendering=!0,b.symbols.push(t),a.show=!0;for(const e of a.parts)e.show=!0}else a.show=!1}}for(const e of o)e.symbols.sort(r);return o.sort(((e,t)=>t.layerOrder-e.layerOrder)),!0}const u=this._symbolLayerSorter;return{work:y,get sortedSymbols(){return o.sort(u)}}}_createOpacityJob(){const t=this._assignTileSymbolsOpacity,o=this._visibleTiles;let i=0;function s(e,o){for(const t of e.symbols.values())l(t,o);t(e,o);for(const t of e.childrenTiles)s(t,o)}return{work(r){const n=performance.now();for(;i<o.length;i++){if(performance.now()-n>r)return!1;const l=o[i];if(null!=l.parentTile)continue;const c=performance.now();l instanceof e?s(l,c):t(l,c)}return!0}}}}function l(e,o){for(const i of e){const e=i.uniqueSymbol;for(const i of e.parts){const s=i.targetOpacity>.5?1:-1;i.startOpacity+=s*((o-i.startTime)/t),i.startOpacity=Math.min(Math.max(i.startOpacity,0),1),i.startTime=o,i.targetOpacity=e.show&&i.show?1:0}}}function c(e){let t=null,o=null,i=null;for(const s of e.tileSymbols){const e=s.tile;e.isReady&&e.isCoverage?t=s:e.isReady?o=s:e.rendering&&(i=s)}return t??o??i}function a(e){let t=null,o=!1,i=!1;for(const s of e.tileSymbols)if(!i||!o){const e=s.tile;(!t||e.isCoverage||e.neededForCoverage&&!o)&&(t=s,(e.neededForCoverage||e.isCoverage)&&(i=!0),e.isCoverage&&(o=!0))}return i?t:null}export{n as SymbolDeclutterer};
5
+ import{VectorTile as e}from"../VectorTile.js";import{fadeDuration as t}from"./config.js";import{effectFlag0 as o,filterFlag0 as i}from"../../webgl/definitions.js";function s(e){return(e.uniqueSymbol?.show&&e.uniqueSymbol?.lastShow)??!1}function r(e,t){if(e.priority-t.priority)return e.priority-t.priority;if(s(e)&&!s(t))return-1;if(s(t)&&!s(e))return 1;const o=e.tile.key,i=t.tile.key;return o.world-i.world?o.world-i.world:o.level-i.level?o.level-i.level:o.row-i.row?o.row-i.row:o.col-i.col?o.col-i.col:e.xTile-t.xTile?e.xTile-t.xTile:e.yTile-t.yTile}class n{get running(){return this._running}constructor(e,t,o,i,s,r,n,l){this.selectionMode=e,this._visibleTiles=t,this._symbolRepository=o,this._styleRepository=i,this._createCollisionJob=s,this._assignTileSymbolsOpacity=r,this._symbolLayerSorter=n,this._isLayerVisible=l,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(e,t){this._screenWidth===e&&this._screenHeight===t||this.restart(),this._screenWidth=e,this._screenHeight=t}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const t=performance.now();if(!this._selectionJob.work(e))return!1;if(this._selectionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const t=performance.now();if(!this._collisionJob.work(e))return!1;if(this._collisionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const t=performance.now();if(!this._opacityJob.work(e))return!1;if(this._opacityJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}return this._running=!1,!0}_isFeatureFiltered(e,t,s){const r=t.getFilterFlags(e),n=r&i,l=null==s.featureEffect||s.featureEffect.excludedLabelsVisible||r&o;return!(n&&l)}_getFiltered(){let e;if(this._styleRepository?.layerContexts)for(const t of this._symbolRepository.uniqueSymbols){const o=this._styleRepository.layerContexts?.get(t.styleLayerUID);if(o?.attributeView)for(const i of t.uniqueSymbols){e??=new Set;const t=o.attributeView,s=o.layerView;this._isFeatureFiltered(i.id,t,s)&&e.add(i.id)}}return e}_resetSelection(){for(let e=0;e<this._symbolRepository.uniqueSymbols.length;e++){const t=this._symbolRepository.uniqueSymbols[e];for(let e=0;e<t.uniqueSymbols.length;e++){const o=t.uniqueSymbols[e];for(const e of o.tileSymbols)e.selectedForRendering=!1}}}_createSelectionJob(){const e="feature-tile"===this.selectionMode?c:a,t=this._symbolRepository.uniqueSymbols;this._resetSelection();const o=[];let i=0,s=0;const n=this._isLayerVisible,l=this._getFiltered(),h=this._styleRepository?.layerContexts;function y(c){let a;const y=performance.now();for(;s<t.length;s++,i=0){const r=t[s],u=r.styleLayerUID;let f=0;if(h){const e=h.get(u).layerView;f=e.view.allLayerViews.items.indexOf(e)}if(!n(u)){o[s]||(o[s]={styleLayerUID:u,layerOrder:f,symbols:[]});continue}o[s]||={styleLayerUID:u,symbols:[],layerOrder:f};const b=o[s];for(;i<r.uniqueSymbols.length;i++){if(a=r.uniqueSymbols[i],i%100==99&&performance.now()-y>c)return!1;if(a.lastShow=a.show,a.id&&l?.has(a.id)){a.show=!1,a.parts[0].show=!1,a.parts[1].show=!1;continue}const t=e(a);if(t){t.selectedForRendering=!0,b.symbols.push(t),a.show=!0;for(const e of a.parts)e.show=!0}else a.show=!1}}for(const e of o)e.symbols.sort(r);return o.sort(((e,t)=>t.layerOrder-e.layerOrder)),!0}const u=this._symbolLayerSorter;return{work:y,get sortedSymbols(){return o.sort(u)}}}_createOpacityJob(){const t=this._assignTileSymbolsOpacity,o=this._visibleTiles;let i=0;function s(e,o){for(const t of e.symbols.values())l(t,o);t(e,o);for(const t of e.childrenTiles)s(t,o)}return{work(r){const n=performance.now();for(;i<o.length;i++){if(performance.now()-n>r)return!1;const l=o[i];if(null!=l.parentTile)continue;const c=performance.now();l instanceof e?s(l,c):t(l,c)}return!0}}}}function l(e,o){for(const i of e){const e=i.uniqueSymbol;for(const i of e.parts){const s=i.targetOpacity>.5?1:-1;i.startOpacity+=s*((o-i.startTime)/t),i.startOpacity=Math.min(Math.max(i.startOpacity,0),1),i.startTime=o,i.targetOpacity=e.show&&i.show?1:0}}}function c(e){let t=null,o=null,i=null;for(const s of e.tileSymbols){const e=s.tile;e.isReady&&e.isCoverage?t=s:e.isReady?o=s:e.rendering&&(i=s)}return t??o??i}function a(e){let t=null,o=!1,i=!1;for(const s of e.tileSymbols)if(!i||!o){const e=s.tile;(!t||e.isCoverage||e.neededForCoverage&&!o)&&(t=s,(e.neededForCoverage||e.isCoverage)&&(i=!0),e.isCoverage&&(o=!0))}return i?t:null}export{n as SymbolDeclutterer};
@@ -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
- class t{constructor(t,s){this.sourceTile=s,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.uniqueSymbol=null,this._colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=t}colliders(){return this._colliders}}class s{constructor(t){this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1,this.lastShow=!1,this.tileSymbols=[t],this.featureID=t.featureID}}export{s as UniqueSymbol,t as VTLSymbol};
5
+ class t{constructor(t,s){this.sourceTile=s,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.uniqueSymbol=null,this._colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=t}colliders(){return this._colliders}}class s{constructor(t){this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1,this.lastShow=!1,this.tileSymbols=[t],this.id=t.id}}export{s as UniqueSymbol,t as VTLSymbol};
@@ -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 e from"../../../../core/Logger.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{AFeatureTile as i}from"./AFeatureTile.js";import{RESHUFFLING_EXEMPT_MEMORY_BYTES as r,RESHUFFLING_TARGET_MEMORY_EFFICIENCY as n,RESHUFFLING_EXEMPT_DRAW_CALLS as o,RESHUFFLING_TARGET_DRAW_EFFICIENCY as d,tileSize as h}from"./definitions.js";import a from"./DisplayEntity.js";import{FeatureBatchingStrategy as l}from"./enums.js";import{DisplayList as c}from"./FeatureDisplayList.js";import{ReshufflePlan as f}from"./ReshufflePlan.js";import{LabelMetric as u}from"./collisions/LabelMetric.js";import{MappedMesh as _}from"./cpuMapped/MappedMesh.js";import{debugMeshDataInfo as m}from"./mesh/meshDebugUtils.js";import p from"./util/Reader.js";import{deserializeList as y}from"./util/serializationUtils.js";const g=()=>e.getLogger("esri.views.2d.engine.webgl.FeatureTile");let b=0;class I extends i{constructor(e,i,r,n,o,d,h=!1){super(e,i,r,n),this._fader=o,this._labelInstanceId=d,this._meshes=new Map,this._entities=[],this._entityIndex=new Map,this._invalidated=!1,this._nextUploadAllowed=!1,this.tileAge=b++,this._metrics=[],this._clearedMetrics=[],this._entityIds=new Set,this._entityIdsFromBuffer=new Set,this._attributeEpoch=0,this._encounteredEnd=!1,this.neededForCoverage=!1,this.isCoverage=!1,this.rendering=!1,this._decluttered=!1,this._objectIdMap=null,this.visible=!0,this.transforms.labelMat2d=t(),this.transforms.tileUnitsToPixels=s(),this.enableDeferredUploads=h}destroy(){super.destroy(),this.clear(),this._finalizeMetricClear()}clear(){for(const e of this._meshes.values())e.destroy();this._meshes.clear(),this._entities=[],this._clearedMetrics=this._metrics,this._metrics=[],this._displayList=null,this._invalidated=!0,this._entityIds.clear(),this._nextUploadAllowed=!0}beforeRender(e){super.beforeRender(e),this._needsReshuffle&&e.reshuffleManager.schedule(this)}tryReady(e){const t=this._invalidated&&!this._uploadAllowed;return!(this.isReady||t||!this._encounteredEnd||!(e>=this._attributeEpoch))&&(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${e}]`),this.ready(),this.requestRender(),this.decluttered=!1,!0)}get decluttered(){return this._decluttered}set decluttered(e){this._decluttered=e,this.requestRender()}get id(){return this.key.id}get hasData(){return!!this._meshes.size}get hasAnimations(){return!!this._objectIdMap}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}get _hasMetrics(){return this._metrics.length>0}upload(){this._nextUploadAllowed=!0}getDisplayList(e,t){if(this._uploadAllowed&&this._invalidated){this._entities.sort(((e,t)=>{const s=t.sortKey,i=e.sortKey;return i===s?e.id-t.id:i-s})),t===l.BATCHING&&this.reshuffle(!0),this._displayList=c.fromDisplayEntities(this._entities,this,e,t);for(const e of this._meshes.values())e.upload();this.debugInfo.display.length=this._displayList.length,this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength,this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength,this.requestRender(),this._invalidated=!1,this._nextUploadAllowed=!1}return this._displayList}getMesh(e){if(!this._meshes.has(e))throw new Error(`InternalError: Unable to find VAO for instance: ${e}`);return this._meshes.get(e)}getSortKeys(e){const t=new Map;for(const{id:s,sortKey:i}of this._entities)if(e.has(s)&&t.set(s,i),t.size===e.size)break;return t}onMessage(e){if(e.objectIdMap)for(const t in e.objectIdMap)this._objectIdMap||(this._objectIdMap={}),this._objectIdMap[t]=e.objectIdMap[t];switch(e.type){case"append":this._onAppendMessage(e);break;case"update":this._onUpdateMessage(e)}if(this._aggregateMemoryStats(),this.requestRender(),e.end){if(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${e.attributeEpoch}]`),!e.attributeEpoch)throw new Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=e.attributeEpoch,this._encounteredEnd=!0}this.writeLabelVisibility()}_onAppendMessage(e){if(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:m(e?.append)}),e.clear&&this.clear(),!e.append)return;const t=y(new p(e.append.entities),a);this._insert(t,e.append.data,!1)}_onUpdateMessage(e){has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:e.isPixelBuffer,modify:m(e.modify),remove:e.remove});const t=y(new p(e.modify.entities),a),s=t.map((e=>e.id)),i=e.isPixelBuffer??!1,r=[...e.remove,...s];i?this._removeByIdsFromBuffer(r):this._removeByIds(r),this._insert(t,e.modify.data,i)}reshuffle(e=!1){if(this.destroyed)return;const t=new Map;for(const s of this._entities)for(const i of s.records){const s=this._meshes.get(i.instanceId);let r=t.get(s);r||(r=new f(e),t.set(s,r)),r.copyRecord(i)}for(const[s,i]of t)s.reshuffle(i);this._invalidated=!0,this._aggregateMemoryStats(),has("esri-2d-update-debug")&&g().info(`Tile ${this.key.id} was reshuffled.`)}copyPixelBufferedEntitesFrom(e,t,s,i){const r=s*h,n=i*h;for(const o of e._entities){let s=null;for(const i of o.records)if(i.overlaps&t){const t=e.getMesh(i.instanceId),d=this._ensureMesh(i.instanceId,t.layout,t.useVisibility).copyRecordFrom(t,i,r,n);s||(s=new a(o.id,o.sortKey),this._entityIdsFromBuffer.add(o.id),this._entityIndex.set(s.id,s),this._entities.push(s)),s.records.push(d)}}this._invalidated=!0}writeLabelVisibility(){if(this._clearedMetrics.length)return this._finalizeMetricClear();const e=this._meshes.get(this._labelInstanceId);if(e&&this._hasMetrics){for(const t of this._metrics){const s=this._entityIndex.get(t.featureID);if(!s)continue;const i=t.uniqueSymbol.show&&t.selectedForRendering;e.setEntityRecordRangeVisibility(s.records,t.recordStart,t.recordCount,i?0:255)}this._invalidated=!0}}_ensureMesh(e,t,s){return this._meshes.has(e)||this._meshes.set(e,new _(this._stage.bufferPool,t,s)),this._meshes.get(e)}_insert(e,t,s){if(!e.length)return;this._removeDuplicatedBufferedEntites(e);const i=this._insertVertexData(t);for(const r of e){for(const e of r.records)e.updateBaseOffsets(i.get(e.instanceId));s?this._tryInsertBufferedEntity(r):this._insertEntity(r)}this._invalidated=!0}_insertMetrics(e){for(const t of e)t.tile=this;this._metrics.push(...e),this._fader?.insertFeatureTileMetrics(this,e)}_insertVertexData(e){const t=new Map;for(const s of e){const{instanceId:e,layout:i}=s,r=i.attributes.some((e=>"visibility"===e.name)),n=this._ensureMesh(e,i,r).append(s);if(s.metrics){const e=y(new p(s.metrics),u)??[];this._insertMetrics(e)}t.set(e,n)}return t}_insertEntity(e){has("esri-2d-update-debug")&&this._entityIds.has(e.id)&&console.error(`Tile ${this.key.id} insertEntity: Already have entityId ${e.id}`),this._entityIds.add(e.id),this._entityIndex.set(e.id,e),this._entities.push(e)}_tryInsertBufferedEntity(e){this._entityIds.has(e.id)?this._removeRecordsFromMesh(e.records):(this._entityIdsFromBuffer.add(e.id),this._entityIndex.set(e.id,e),this._entities.push(e))}_removeDuplicatedBufferedEntites(e){if(!this._entityIdsFromBuffer.size)return;const t=[];for(const s of e)this._entityIdsFromBuffer.has(s.id)&&t.push(s.id);this._removeByIds(t)}_removeByIdsFromBuffer(e){this._removeByIds(e.filter((e=>this._entityIdsFromBuffer.has(e))))}_removeByIds(e){if(0===e.length)return;const t=new Set(e),s=[];for(const r of this._entities)t.has(r.id)?(this._remove(r),this._entityIndex.delete(r.id)):s.push(r);const i=[];for(const r of this._metrics)t.has(r.featureID)?this._clearedMetrics.push(r):i.push(r);this._entities=s,this._metrics=i,this._invalidated=!0}_remove(e){this._removeRecordsFromMesh(e.records),this._entityIds.delete(e.id),this._entityIdsFromBuffer.delete(e.id)}_removeRecordsFromMesh(e){for(const t of e){const{instanceId:e,indexStart:s,indexCount:i,vertexStart:r,vertexCount:n}=t;this._meshes.get(e)?.remove(s,i,r,n)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed=0,this.debugInfo.memory.bytesReserved=0;for(const e of this._meshes.values())this.debugInfo.memory.bytesUsed+=e.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=e.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const{bytesUsed:e,bytesReserved:t}=this.debugInfo.memory,s=e/t,{minOrderedLength:i,length:h}=this.debugInfo.display;return t>r&&s<n||h>o&&i/h<d}get entityIds(){return this._objectIdMap?this._entities.map((({id:e})=>({objectId:this._objectIdMap[e],displayId:e}))):[]}_finalizeMetricClear(){if(!this._clearedMetrics.length)return;this._fader.removeFeatureTileMetrics(this,this._clearedMetrics),this._clearedMetrics.length=0,this._invalidated=!0;const e=this._meshes.get(this._labelInstanceId);if(e)for(const t of this._metrics){const s=this._entityIndex.get(t.featureID);if(!s)continue;const i=t.uniqueSymbol.show&&t.uniqueSymbol.tileSymbols.some((e=>e.selectedForRendering&&e.tile.key.equals(this.key)));e.setEntityRecordRangeVisibility(s.records,t.recordStart,t.recordCount,i?0:255)}}}export{I as FeatureTile};
5
+ import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{AFeatureTile as i}from"./AFeatureTile.js";import{RESHUFFLING_EXEMPT_MEMORY_BYTES as r,RESHUFFLING_TARGET_MEMORY_EFFICIENCY as o,RESHUFFLING_EXEMPT_DRAW_CALLS as d,RESHUFFLING_TARGET_DRAW_EFFICIENCY as n,tileSize as h}from"./definitions.js";import a from"./DisplayEntity.js";import{FeatureBatchingStrategy as l}from"./enums.js";import{DisplayList as c}from"./FeatureDisplayList.js";import{ReshufflePlan as f}from"./ReshufflePlan.js";import{LabelMetric as u}from"./collisions/LabelMetric.js";import{MappedMesh as _}from"./cpuMapped/MappedMesh.js";import{debugMeshDataInfo as m}from"./mesh/meshDebugUtils.js";import p from"./util/Reader.js";import{deserializeList as y}from"./util/serializationUtils.js";const b=()=>e.getLogger("esri.views.2d.engine.webgl.FeatureTile");let g=0;class I extends i{constructor(e,i,r,o,d,n,h=!1){super(e,i,r,o),this._fader=d,this._labelInstanceId=n,this._meshes=new Map,this._entities=[],this._entityIndex=new Map,this._invalidated=!1,this._nextUploadAllowed=!1,this.tileAge=g++,this._metrics=[],this._metricsVisibility=new Set,this._entityIds=new Set,this._entityIdsFromBuffer=new Set,this._attributeEpoch=0,this._encounteredEnd=!1,this.neededForCoverage=!1,this.isCoverage=!1,this.rendering=!1,this._decluttered=!1,this._objectIdMap=null,this.visible=!0,this.transforms.labelMat2d=t(),this.transforms.tileUnitsToPixels=s(),this.enableDeferredUploads=h}destroy(){super.destroy(),this.clear()}clear(){for(const e of this._meshes.values())e.destroy();this._meshes.clear(),this._entities=[],this._fader?.removeFeatureTileMetrics(this,this._metrics),this._metrics=[],this._displayList=null,this._invalidated=!0,this._entityIds.clear(),this._nextUploadAllowed=!0}beforeRender(e){super.beforeRender(e),this._needsReshuffle&&e.reshuffleManager.schedule(this)}tryReady(e){const t=this._invalidated&&!this._uploadAllowed;return!(this.isReady||t||!this._encounteredEnd||!(e>=this._attributeEpoch))&&(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${e}]`),this.ready(),this.requestRender(),this.decluttered=!1,!0)}get symbols(){const e=new Map;for(const t of this._metrics)e.get(t.labelClassId)||e.set(t.labelClassId,[]),e.get(t.labelClassId).push(t);return e}get decluttered(){return this._decluttered}set decluttered(e){this._decluttered=e,this.requestRender()}get id(){return this.key.id}get hasData(){return!!this._meshes.size}get hasAnimations(){return!!this._objectIdMap}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}get _hasMetrics(){return this._metrics.length>0}upload(){this._nextUploadAllowed=!0}getDisplayList(e,t){if(this._uploadAllowed&&this._invalidated){this._entities.sort(((e,t)=>{const s=t.sortKey,i=e.sortKey;return i===s?e.id-t.id:i-s})),t===l.BATCHING&&this.reshuffle(!0),this._displayList=c.fromDisplayEntities(this._entities,this,e,t);for(const e of this._meshes.values())e.upload();this.debugInfo.display.length=this._displayList.length,this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength,this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength,this.requestRender(),this._invalidated=!1,this._nextUploadAllowed=!1}return this._displayList}getMesh(e){if(!this._meshes.has(e))throw new Error(`InternalError: Unable to find VAO for instance: ${e}`);return this._meshes.get(e)}getSortKeys(e){const t=new Map;for(const{id:s,sortKey:i}of this._entities)if(e.has(s)&&t.set(s,i),t.size===e.size)break;return t}onMessage(e){if(e.objectIdMap)for(const t in e.objectIdMap)this._objectIdMap||(this._objectIdMap={}),this._objectIdMap[t]=e.objectIdMap[t];switch(e.type){case"append":this._onAppendMessage(e);break;case"update":this._onUpdateMessage(e)}if(this._aggregateMemoryStats(),this.requestRender(),e.end){if(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${e.attributeEpoch}]`),!e.attributeEpoch)throw new Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=e.attributeEpoch,this._encounteredEnd=!0}this._writeLabelVisibilityToMesh()}_onAppendMessage(e){if(has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:m(e?.append)}),e.clear&&this.clear(),!e.append)return;const t=y(new p(e.append.entities),a);this._insert(t,e.append.data,!1)}_onUpdateMessage(e){has("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:e.isPixelBuffer,modify:m(e.modify),remove:e.remove});const t=y(new p(e.modify.entities),a),s=t.map((e=>e.id)),i=e.isPixelBuffer??!1,r=[...e.remove,...s];i?this._removeByIdsFromBuffer(r):this._removeByIds(r),this._insert(t,e.modify.data,i)}reshuffle(e=!1){if(this.destroyed)return;const t=new Map;for(const s of this._entities)for(const i of s.records){const s=this._meshes.get(i.instanceId);let r=t.get(s);r||(r=new f(e),t.set(s,r)),r.copyRecord(i)}for(const[s,i]of t)s.reshuffle(i);this._invalidated=!0,this._aggregateMemoryStats(),has("esri-2d-update-debug")&&b().info(`Tile ${this.key.id} was reshuffled.`)}copyPixelBufferedEntitesFrom(e,t,s,i){const r=s*h,o=i*h;for(const d of e._entities){let s=null;for(const i of d.records)if(i.overlaps&t){const t=e.getMesh(i.instanceId),n=this._ensureMesh(i.instanceId,t.layout,t.useVisibility).copyRecordFrom(t,i,r,o);s||(s=new a(d.id,d.sortKey),this._entityIdsFromBuffer.add(d.id),this._entityIndex.set(s.id,s),this._entities.push(s)),s.records.push(n)}}this._invalidated=!0}get metricsVisibility(){return this._metricsVisibility}copyMetricsVisibility(e){for(const t of e)this._metricsVisibility.add(t);this._writeLabelVisibilityToMesh()}updateLabelVisibility(){this._metricsVisibility.clear();for(const e of this._metrics){e.uniqueSymbol.show&&e.selectedForRendering&&this._metricsVisibility.add(e.hash)}this._writeLabelVisibilityToMesh()}_writeLabelVisibilityToMesh(){const e=this._meshes.get(this._labelInstanceId);if(e&&this._hasMetrics){for(const t of this._metrics){const s=this._entityIndex.get(t.id);if(!s)continue;const i=this._metricsVisibility.has(t.hash);e.setEntityRecordRangeVisibility(s.records,t.recordStart,t.recordCount,i?0:255)}this._invalidated=!0}}_ensureMesh(e,t,s){return this._meshes.has(e)||this._meshes.set(e,new _(this._stage.bufferPool,t,s)),this._meshes.get(e)}_insert(e,t,s){if(!e.length)return;this._removeDuplicatedBufferedEntites(e);const i=this._insertVertexData(t);for(const r of e){for(const e of r.records)e.updateBaseOffsets(i.get(e.instanceId));s?this._tryInsertBufferedEntity(r):this._insertEntity(r)}this._invalidated=!0}_insertMetrics(e){for(const t of e)t.tile=this;this._metrics.push(...e),this._fader?.insertFeatureTileMetrics(this,e)}_insertVertexData(e){const t=new Map;for(const s of e){const{instanceId:e,layout:i}=s,r=i.attributes.some((e=>"visibility"===e.name)),o=this._ensureMesh(e,i,r).append(s);if(s.metrics){const e=y(new p(s.metrics),u)??[];this._insertMetrics(e)}t.set(e,o)}return t}_insertEntity(e){has("esri-2d-update-debug")&&this._entityIds.has(e.id)&&console.error(`Tile ${this.key.id} insertEntity: Already have entityId ${e.id}`),this._entityIds.add(e.id),this._entityIndex.set(e.id,e),this._entities.push(e)}_tryInsertBufferedEntity(e){this._entityIds.has(e.id)?this._removeRecordsFromMesh(e.records):(this._entityIdsFromBuffer.add(e.id),this._entityIndex.set(e.id,e),this._entities.push(e))}_removeDuplicatedBufferedEntites(e){if(!this._entityIdsFromBuffer.size)return;const t=[];for(const s of e)this._entityIdsFromBuffer.has(s.id)&&t.push(s.id);this._removeByIds(t)}_removeByIdsFromBuffer(e){this._removeByIds(e.filter((e=>this._entityIdsFromBuffer.has(e))))}_removeByIds(e){if(0===e.length)return;const t=new Set(e),s=[];for(const r of this._entities)t.has(r.id)?(this._remove(r),this._entityIndex.delete(r.id)):s.push(r);this._entities=s;const i=this._metrics.filter((e=>t.has(e.displayId)));this._metrics=this._metrics.filter((e=>!t.has(e.displayId))),this._fader?.removeFeatureTileMetrics(this,i),this._invalidated=!0}_remove(e){this._removeRecordsFromMesh(e.records),this._entityIds.delete(e.id),this._entityIdsFromBuffer.delete(e.id)}_removeRecordsFromMesh(e){for(const t of e){const{instanceId:e,indexStart:s,indexCount:i,vertexStart:r,vertexCount:o}=t;this._meshes.get(e)?.remove(s,i,r,o)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed=0,this.debugInfo.memory.bytesReserved=0;for(const e of this._meshes.values())this.debugInfo.memory.bytesUsed+=e.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=e.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const{bytesUsed:e,bytesReserved:t}=this.debugInfo.memory,s=e/t,{minOrderedLength:i,length:h}=this.debugInfo.display;return t>r&&s<o||h>d&&i/h<n}get entityIds(){return this._objectIdMap?this._entities.map((({id:e})=>({objectId:this._objectIdMap[e],displayId:e}))):[]}}export{I as FeatureTile};
@@ -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{on as t}from"../../../../core/events.js";import e from"../../../../core/Handles.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{when as i,initial as o}from"../../../../core/reactiveUtils.js";import{createScreenPoint as s}from"../../../../core/screenUtils.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import a from"../../../../geometry/Point.js";import h from"../../../../geometry/Polygon.js";import{project as l}from"../../../../geometry/projection.js";import{DisplayObject as u}from"../DisplayObject.js";import m from"../../../layers/support/Geometry.js";import{TextureWrapMode as d}from"../../../webgl/enums.js";import{Texture as c}from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";const f=2;class x extends u{constructor(r){super(),this.element=r,this._handles=new e,this.isWrapAround=!1,this.perspectiveTransform=n(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(i((()=>this.element),(()=>{const e=this.element;this.ready(),e&&this._handles.add(t(e,"play",(()=>this.requestRender())))}),o))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=r(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(null==e)return;const{context:r}=t,{videoWidth:i,videoHeight:o}=e;if(0!==i&&0!==o){if(this.texture)e.paused||this.texture.setData(e);else{const t=new p;t.wrapMode=d.CLAMP_TO_EDGE,t.preMultiplyAlpha=!0,t.width=i,t.height=o,this.texture=new c(r,t,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const o=this.element,s=this._getFrameInfo();if(!o||!s)return;this._initializeData(t,s,r);const{controlPoints:n,horizon:a}=s,u=Math.sqrt(n.length),d=u,{x:c,y:p}=t,x=this._vertices,y=n[0],g=n[u-1],P=n[(d-1)*u],w=n[(d-1)*u+u-1],_=l(a?a[0].mapPoint:y.mapPoint,r),v=l(a?a[1].mapPoint:g.mapPoint,r),j=l(P.mapPoint,r),A=l(w.mapPoint,r);this.clipGeometry=a?new m({geometry:h.fromJSON({rings:[[[j.x,j.y],[A.x,A.y],[v.x,v.y],[_.x,_.y],[j.x,j.y]]],spatialReference:r})}):null;for(let h=0;h<n.length;h++){const t=n[h],{sourcePoint:e,mapPoint:i}=t;if(null==e||null==i)continue;const o=l(i,r);x[h*f+0]=o.x-c,x[h*f+1]=o.y-p}let M=e;if(i){const t=Math.min(_.x,v.x,j.x,A.x),e=Math.max(_.x,v.x,j.x,A.x),{worldWidth:r,xBounds:o}=i,[s,n]=o;t<s&&e>s?M=r:e>n&&t<n&&(M=-r)}this.wrapAroundShift=M,this.isWrapAround=0!==M}draw(t,e){this.isReady&&this._vertices&&this._indices&&this._texCoords?e.render(t,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:this.textureSize,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._texCoords,index:this._indices}):this.requestRender()}_initializeData(t,e,r){if(null!=this._vertices&&null!=this._indices)return;const{controlPoints:i}=e,o=Math.sqrt(i.length),s=o,n=new Float32Array(f*i.length),a=new Uint16Array(2*i.length);for(let m=0;m<i.length;m++){const e=i[m],{sourcePoint:o,mapPoint:s}=e;if(null==o||null==s)continue;const h=l(s,r);n[m*f+0]=h.x-t.x,n[m*f+1]=h.y-t.y,a[2*m+0]=o.x,a[2*m+1]=o.y}const h=new Uint16Array(s*o+(s-2)*(o+2));let u=0;for(let l=0;l<s;l++){for(let t=0;t<o;t++)h[u++]=l*o+t,h[u++]=(l+1)*o+t;l<s-2&&(h[u++]=(l+1)*o+(o-1),h[u++]=(l+1)*o)}this._vertices=n,this._texCoords=a,this._indices=h}_getFrameInfo(){if(!this.groundControlPoints)return null;const t=this._getFrameControlPoints(),e=this.frameHorizonPoints;let r=null;if(e){const t=e.startX,i=e.startY,o=e.endX,n=e.endY;r=[{sourcePoint:s(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)},{sourcePoint:s(o,n),mapPoint:new a(e.endLongitude,e.endLatitude)}]}return{controlPoints:t,horizon:r}}_getFrameControlPoints(){const t=this.groundControlPoints,e=t?.length;if(!e)return[];const r=new Array(e),i=Math.max(...t.map((({x:t})=>t))),o=this.element.videoWidth/i;for(let n=0;n<e;n++){const{x:e,y:i,lat:h,lon:l}=t[n];r[n]={sourcePoint:s(e*o,-i*o),mapPoint:new a(l,h)}}return r}}export{x as default};
5
+ import{on as t}from"../../../../core/events.js";import e from"../../../../core/Handles.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{when as i,initial as s}from"../../../../core/reactiveUtils.js";import{createScreenPoint as o}from"../../../../core/screenUtils.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import a from"../../../../geometry/Point.js";import h from"../../../../geometry/Polygon.js";import{project as l}from"../../../../geometry/projection.js";import{DisplayObject as u}from"../DisplayObject.js";import m from"../../../layers/support/Geometry.js";import{TextureWrapMode as d}from"../../../webgl/enums.js";import{Texture as c}from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";const f=2;class x extends u{constructor(r){super(),this.element=r,this._handles=new e,this.isWrapAround=!1,this.perspectiveTransform=n(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(i((()=>this.element),(()=>{const e=this.element;this.ready(),e&&this._handles.add(t(e,"play",(()=>this.requestRender())))}),s))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=r(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(null==e)return;const{context:r}=t,{videoWidth:i,videoHeight:s}=e;if(0!==i&&0!==s){if(this.texture)e.paused||this.texture.setData(e);else{const t=new p;t.wrapMode=d.CLAMP_TO_EDGE,t.preMultiplyAlpha=!0,t.width=i,t.height=s,this.texture=new c(r,t,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const s=this.element,o=this._getFrameInfo();if(!s||!o)return;this._initializeData(t,o,r);const{controlPoints:n,horizon:a}=o,u=Math.sqrt(n.length),d=u,{x:c,y:p}=t,x=this._vertices,y=n[0],g=n[u-1],P=n[(d-1)*u],w=n[(d-1)*u+u-1],_=l(a?a[0].mapPoint:y.mapPoint,r),v=l(a?a[1].mapPoint:g.mapPoint,r),j=l(P.mapPoint,r),A=l(w.mapPoint,r);this.clipGeometry=a?new m({geometry:h.fromJSON({rings:[[[j.x,j.y],[A.x,A.y],[v.x,v.y],[_.x,_.y],[j.x,j.y]]],spatialReference:r})}):null;for(let h=0;h<n.length;h++){const t=n[h],{sourcePoint:e,mapPoint:i}=t;if(null==e||null==i)continue;const s=l(i,r);x[h*f+0]=s.x-c,x[h*f+1]=s.y-p}let M=e;if(i){const t=Math.min(_.x,v.x,j.x,A.x),e=Math.max(_.x,v.x,j.x,A.x),{worldWidth:r,xBounds:s}=i,[o,n]=s;t<o&&e>o?M=r:e>n&&t<n&&(M=-r)}this.wrapAroundShift=M,this.isWrapAround=0!==M}draw(t,e){this.visible&&(this.isReady&&this._vertices&&this._indices&&this._texCoords?e.render(t,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:this.textureSize,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._texCoords,index:this._indices}):this.requestRender())}_initializeData(t,e,r){if(null!=this._vertices&&null!=this._indices)return;const{controlPoints:i}=e,s=Math.sqrt(i.length),o=s,n=new Float32Array(f*i.length),a=new Uint16Array(2*i.length);for(let m=0;m<i.length;m++){const e=i[m],{sourcePoint:s,mapPoint:o}=e;if(null==s||null==o)continue;const h=l(o,r);n[m*f+0]=h.x-t.x,n[m*f+1]=h.y-t.y,a[2*m+0]=s.x,a[2*m+1]=s.y}const h=new Uint16Array(o*s+(o-2)*(s+2));let u=0;for(let l=0;l<o;l++){for(let t=0;t<s;t++)h[u++]=l*s+t,h[u++]=(l+1)*s+t;l<o-2&&(h[u++]=(l+1)*s+(s-1),h[u++]=(l+1)*s)}this._vertices=n,this._texCoords=a,this._indices=h}_getFrameInfo(){if(!this.groundControlPoints)return null;const t=this._getFrameControlPoints(),e=this.frameHorizonPoints;let r=null;if(e){const t=e.startX,i=e.startY,s=e.endX,n=e.endY;r=[{sourcePoint:o(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)},{sourcePoint:o(s,n),mapPoint:new a(e.endLongitude,e.endLatitude)}]}return{controlPoints:t,horizon:r}}_getFrameControlPoints(){const t=this.groundControlPoints,e=t?.length;if(!e)return[];const r=new Array(e),i=Math.max(...t.map((({x:t})=>t))),s=this.element.videoWidth/i;for(let n=0;n<e;n++){const{x:e,y:i,lat:h,lon:l}=t[n];r[n]={sourcePoint:o(e*s,-i*s),mapPoint:new a(l,h)}}return r}}export{x 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{numericHash as e}from"../../../../../core/string.js";import{labelPlacementOffsetPadding as i}from"../definitions.js";import{VVBinding as t}from"../enums.js";import s from"./BoundingBox.js";import{serializeList as r,deserializeList as n}from"../util/serializationUtils.js";const a=2;class h{constructor(i,t,s,r,n,a,h,o,l,d,c=[],u=0,f=0){this.displayId=i,this.labelId=t,this.labelClassId=s,this.anchorX=r,this.anchorY=n,this.directionX=a,this.directionY=h,this.maxScale=o,this.minScale=l,this.referenceBounds=d,this.bounds=c,this.recordStart=u,this.recordCount=f,this.priority=0,this._colliders=null,this.uniqueSymbol=null,this.selectedForRendering=!1,this.hash=e(`${i}${t}${s}`)}get xTile(){return this.anchorX}get yTile(){return this.anchorY}colliders(e){if(!this._colliders){const s=e.attributeView,r=i;let n=this.referenceBounds?.size??0;const h=e.layerView.labelingCollisionInfos[0].vvEvaluators[0];if(null!=h){const e=h(s.getVisualVariableData(this.displayId,t.SIZE));n=isNaN(e)||null==e||e===1/0?n:e}const o=this.minScale?e.layerView.view.featuresTilingScheme.scaleToZoom(this.minScale):0,l=this.maxScale?e.layerView.view.featuresTilingScheme.scaleToZoom(this.maxScale):25,d=this.directionX*(r+n/2),c=this.directionY*(r+n/2);this._colliders=this.bounds.map((e=>({xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+d,dyPixels:e.y-e.halfHeight+c,hard:!0,partIndex:1,width:e.width+a,height:e.height+a,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:o,maxLod:l})))}return this._colliders}get featureID(){return this.displayId}serialize(e){e.push(this.displayId),e.push(this.labelId),e.push(this.labelClassId),e.push(this.recordStart),e.push(this.recordCount),e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),r(e,this.bounds)}static deserialize(e){const i=e.readInt32(),t=e.readInt32(),r=e.readInt32(),a=e.readInt32(),o=e.readInt32(),l=e.readF32(),d=e.readF32(),c=e.readF32(),u=e.readF32(),f=e.readF32(),m=e.readF32(),F=e.readF32(),w=e.readF32(),p=e.readF32(),S=n(e,s)??[];return new h(i,t,r,l,d,c,u,f,m,{size:F,offsetX:w,offsetY:p},S,a,o)}}export{h as LabelMetric};
5
+ import{labelPlacementOffsetPadding as e}from"../definitions.js";import{VVBinding as i}from"../enums.js";import t from"./BoundingBox.js";import{serializeList as s,deserializeList as r}from"../util/serializationUtils.js";const h=2;class n{constructor(e,i,t,s,r,h,n,a,o,l,d=[],c=0,u=0){this.displayId=e,this.labelClassId=i,this.hash=t,this.anchorX=s,this.anchorY=r,this.directionX=h,this.directionY=n,this.maxScale=a,this.minScale=o,this.referenceBounds=l,this.bounds=d,this.recordStart=c,this.recordCount=u,this.priority=0,this._colliders=null,this.uniqueSymbol=null,this.selectedForRendering=!1}get xTile(){return this.anchorX}get yTile(){return this.anchorY}colliders(t){if(!this._colliders){const s=t.attributeView,r=e;let n=this.referenceBounds?.size??0;const a=t.layerView.labelingCollisionInfos[0].vvEvaluators[0];if(null!=a){const e=a(s.getVisualVariableData(this.displayId,i.SIZE));n=isNaN(e)||null==e||e===1/0?n:e}const o=this.minScale?t.layerView.view.featuresTilingScheme.scaleToZoom(this.minScale):0,l=this.maxScale?t.layerView.view.featuresTilingScheme.scaleToZoom(this.maxScale):25,d=this.directionX*(r+n/2),c=this.directionY*(r+n/2);this._colliders=this.bounds.map((e=>({xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+d,dyPixels:e.y-e.halfHeight+c,hard:!0,partIndex:1,width:e.width+h,height:e.height+h,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:o,maxLod:l})))}return this._colliders}get id(){return this.displayId}serialize(e){e.push(this.displayId),e.push(this.labelClassId),e.push(this.hash),e.push(this.recordStart),e.push(this.recordCount),e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),s(e,this.bounds)}static deserialize(e){const i=e.readInt32(),s=e.readInt32(),h=e.readInt32(),a=e.readInt32(),o=e.readInt32(),l=e.readF32(),d=e.readF32(),c=e.readF32(),u=e.readF32(),f=e.readF32(),m=e.readF32(),F=e.readF32(),w=e.readF32(),S=e.readF32(),p=r(e,t)??[];return new n(i,s,h,l,d,c,u,f,m,{size:F,offsetX:w,offsetY:S},p,a,o)}}export{n as LabelMetric};
@@ -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{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{fromRotation as i,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as r}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as n,sub as a,normalize as l,add as c,scale as h}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as m}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{GeometryCursor as u}from"../../../../../../../geometry/GeometryCursor.js";import{generalizeOptimizedGeometry as f,convertToGeometry as g}from"../../../../../../../layers/graphics/featureConversionUtils.js";import _ from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as p,minMaxZoomPrecisionFactor as b}from"../../../definitions.js";import x from"../../../collisions/BoundingBox.js";import{LabelMetric as M}from"../../../collisions/LabelMetric.js";import{smoothPaths as v,pathDivide as y}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as P,processColorInput as w}from"../fill/meshWriterUtils.js";import{TextMeshWriter as L,maxLabelZoom as B}from"../text/TextMeshWriter.js";const S=1,z=0,A=128,D=e((e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t}));class I extends L{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),s=t.readYForDisplay();this._writePoint(e,i,s,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":{const i=t.readCentroidForDisplay();if(!i)return;const[s,r]=i.coords;this._writePoint(e,s,r,0,t);break}case"esriGeometryMultipoint":{let i=0;const s=u.fromFeatureSetReader(t);if(s?.nextPath())for(;s.nextPoint();)this._writePoint(e,s.x,s.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,s){const[r,o]=this._getMetricDir(),n=this.evaluatedMeshParams.scaleInfo?.maxScale??0,a=this.evaluatedMeshParams.scaleInfo?.minScale??0,l=this.evaluatedMeshParams.labelClassId;return new M(e,0,l,t,i,r,o,n,a,s)}_writePoint(e,t,i,s,r){if(t<0||t>p||i<0||i>p)return;const o=this._getShaping();if(!o)return;const n=r.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,[l,c]=this._getMetricDir(),h=this.evaluatedMeshParams.scaleInfo?.maxScale??0,m=this.evaluatedMeshParams.scaleInfo?.minScale??0,d=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new M(n,s,a,t,i,l,c,h,m,d)),this._writeGlyphs(e,n,t,i,o,0,d,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:s}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,s)=>this._placeSubdivGlyphs(e,t,i,s),a=(o.bounds.width+r)/(1<<S);this._current={out:e,id:t.getDisplayId(),shaping:o,zoomRange:P(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null},this._verticalPlacement="bottom"===s?"above":"top"===s?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:s}=this.evaluatedMeshParams,{shaping:r}=this._current,o=r.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=new _;f(a,n,!1,!1,"esriGeometryPolyline",1);const l=G(new _,a,o),c=G(new _,a,-o),h=g(c,"esriGeometryPolyline",!1,!1),m=g(l,"esriGeometryPolyline",!1,!1),d=v(m.paths,r.bounds.width),u=v(h.paths,r.bounds.width);this._current.offsetDirection="above";for(const f of d)y(f,i,t,!!s);this._current.offsetDirection="below";for(const f of u)y(f,i,t,!!s)}_writeCenterAlong(e,t,i){const{repeatLabel:s}=this.evaluatedMeshParams,{shaping:r}=this._current,o=v(e.readLegacyGeometryForDisplay().paths,r.bounds.width);for(const n of o)y(n,i,t,!!s)}_placeSubdivGlyphs(e,t,i,s){const{allowOverrun:r,labelPosition:o,repeatLabelDistance:n}=this.evaluatedMeshParams,a=this._current.zoomRange[0],l=D(t),c=this._current.shaping.bounds.width/(1<<S),h=Math.sqrt(n||A)/(1<<S),m=Math.min(i,s-i),d=this._current.shaping.isMultiline?B:Math.log2(m/(h+c/2)),u=0===t?d:Math.min(l,d),f=Math.max(a,this._zoomLevel+S-u),g=this._zoomLevel-f,_=this._current.shaping.bounds.width/2*2**g;this._current.shaping.isMultiline?0===t&&this._placeStraight(e,f):r&&g<0?this._placeStraightAlong(e,a):"parallel"===o?this._placeStraightAlong(e,f):"curved"===o&&this._placeCurved(e,f,_)}_placeStraight(e,t){const{out:i,id:s,shaping:r,referenceBounds:o}=this._current,{x:n,y:a}=e;i.metricStart(this._createLineLabelMetric(s,n,a)),i.metricBoxWrite(r.boundsT);const l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360,h={clipAngle:l,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(i,s,n,a,r,0,o,h,!1);const m={clipAngle:c,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(i,s,n,a,r,0,o,m,!1),i.metricEnd()}_placeCurved(e,t,i){const{out:s,id:r}=this._current;s.metricStart(this._createLineLabelMetric(r,e.x,e.y));const o=e.clone(),n=e.angle*(180/Math.PI)%360,a=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(o,t,1,n),this._placeBack(e,o,t,i,1,n),this._placeForward(e,o,t,i,1,n)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(o,t,0,a),this._placeBack(e,o,t,i,0,a),this._placeForward(e,o,t,i,0,a)),s.metricEnd()}_placeStraightAlong(e,o){const{out:n,id:a,shaping:l,zoomRange:c,referenceBounds:h}=this._current,{boxBorderLineColor:d,boxBackgroundColor:u}=this.evaluatedMeshParams,f=e.clone(),g=e.angle*(180/Math.PI)%360,_=(e.angle*(180/Math.PI)+180)%360,p=l.glyphs.length>0&&!(!d&&!u);if(n.metricStart(this._createLineLabelMetric(a,e.x,e.y)),p){const d=Math.max(o,c[0],0),u=Math.min(B,c[1]),f=i(r(),-e.angle),p={minZoom:d,maxZoom:u,clipAngle:g,mapAligned:!0,isLineLabel:!0},b=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=m(b,-1*x),[i,o]=l.shapeBackground(s(r(),f,t));n.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(n,a,e.x,e.y,o,h,p),n.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=m(b,x),[i,o]=l.shapeBackground(s(r(),f,t));p.clipAngle=_,n.recordStart(this.instanceId,this.attributeLayout,l.glyphs[0].textureBinding),this._writeTextBox(n,a,e.x,e.y,o,h,p),n.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(f,o,1,g,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(f,o,0,_,!0),n.metricEnd()}_placeBack(e,t,i,s,r,o){const n=e.clone();let a=e.backwardLength+z;for(;n.prev()&&!(a>=s);)this._placeOnSegment(n,t,a,i,-1,r,o),a+=n.length+z}_placeForward(e,t,i,s,r,o){const n=e.clone();let a=e.remainingLength+z;for(;n.next()&&!(a>=s);)this._placeOnSegment(n,t,a,i,1,r,o),a+=n.length+z}_placeFirst(e,s,n,a,l=!1){const{out:c,id:h,shaping:d,zoomRange:u,referenceBounds:f}=this._current,g=d.glyphs,_=t(this.evaluatedMeshParams.offsetX),p=t(this.evaluatedMeshParams.offsetY),b=m(_,p),M=i(r(),-e.angle);o(b,b,M);for(const t of g){const i=t.x>d.bounds.x?n:1-n,r=i*e.remainingLength+(1-i)*e.backwardLength,o=Math.abs(t.x+t.width/2-d.bounds.x),m=Math.max(0,this._zoomLevel+Math.log2(o/(r+z))),g=Math.max(s,l?0:m);if(t.maxZoom=Math.min(u[1],B),t.angle=e.angle+(1-n)*Math.PI,t.minZoom=Math.max(u[0],g),this._writeLineGlyph(c,h,e.x,e.y,t,a,f,!0),(n||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom)){const e=new x(t.bounds.x+b[0],t.bounds.y+b[1],t.bounds.width,t.bounds.height);c.metricBoxWrite(e)}}}_placeOnSegment(e,s,n,a,l,c,h){const{out:d,id:u,shaping:f,referenceBounds:g}=this._current,_=f.glyphs,p=e.dx/e.length,b=e.dy/e.length,M={x:e.x+n*-l*p,y:e.y+n*-l*b},v=t(this.evaluatedMeshParams.offsetX),y=t(this.evaluatedMeshParams.offsetY),P=m(v,y),w=i(r(),-e.angle);o(P,P,w);for(const t of _){const i=t.x>f.bounds.x?c:1-c;if(!(i&&1===l||!i&&-1===l))continue;const s=Math.abs(t.x+t.width/2-f.bounds.x),r=Math.max(0,this._zoomLevel+Math.log2(s/n)-.1),o=Math.max(a,this._zoomLevel+Math.log2(s/(n+e.length+z)));if(0!==r&&(t.angle=e.angle+(1-c)*Math.PI,t.minZoom=o,t.maxZoom=r,this._writeLineGlyph(d,u,M.x,M.y,t,h,g,!0),(c||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom))){const e=new x(t.bounds.x+P[0],t.bounds.y+P[1],t.bounds.width,t.bounds.height);d.metricBoxWrite(e)}}}_writeLineGlyph(e,t,i,s,r,o,n,a){if(i<0||i>p||s<0||s>p)return;e.recordStart(this.instanceId,this.attributeLayout,r.textureBinding);const{texcoords:l,offsets:c}=r,{fontSize:h,haloSize:m,outlineSize:d}=this._textMeshTransformProps;this._writeQuad(e,t,i,s,{texcoords:l,offsets:c,fontSize:h,haloSize:m,outlineSize:d,color:w(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:n,minZoom:Math.max(this._current.zoomRange[0],r.minZoom),maxZoom:Math.min(this._current.zoomRange[1],r.maxZoom),clipAngle:o,mapAligned:a,isLineLabel:!0}),e.recordEnd()}_packedZoom(e){return Math.floor(e*b)/b}_isVisible(e,t){let i=Math.max(this._current.zoomRange[0],e),s=Math.min(this._current.zoomRange[1],t);i=this._packedZoom(i),s=this._packedZoom(s);const r=this._packedZoom(this._zoomLevel);return i<=r&&r<=s}}function G(e,t,i){const{coords:s,lengths:r}=t,o=d(),m=d(),u=d(),f=d(),g=d(),_=d(),p=2;let b=0;for(let d=0;d<r.length;d++){const t=r[d];for(let r=0;r<t;r++){const d=p*(r+b-1),x=p*(r+b),M=p*(r+b+1);r>0?n(o,s[d],s[d+1]):n(o,0,0),n(m,s[x],s[x+1]),r<t-1?n(u,s[M],s[M+1]):n(u,0,0),0===r?n(f,0,0):(a(f,m,o),l(f,f),n(f,f[1],-f[0])),r===t-1?n(g,0,0):(a(g,u,m),l(g,g),n(g,g[1],-g[0])),c(_,f,g),l(_,_);const v=_[0]*g[0]+_[1]*g[1];0!==v&&h(_,_,v),h(_,_,i),e.coords.push(m[0]+_[0],m[1]+_[1])}e.lengths.push(t),b+=t}return e}export{I as LabelMeshWriter};
5
+ import{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{numericHash as i}from"../../../../../../../core/string.js";import{fromRotation as r,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as n,set as a,sub as l,normalize as h,add as c,scale as m}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as u}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{GeometryCursor as f}from"../../../../../../../geometry/GeometryCursor.js";import{generalizeOptimizedGeometry as g,convertToGeometry as _}from"../../../../../../../layers/graphics/featureConversionUtils.js";import p from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as b,minMaxZoomPrecisionFactor as x}from"../../../definitions.js";import M from"../../../collisions/BoundingBox.js";import{LabelMetric as v}from"../../../collisions/LabelMetric.js";import{smoothPaths as y,pathDivide as P}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as w,processColorInput as L}from"../fill/meshWriterUtils.js";import{TextMeshWriter as I,maxLabelZoom as B}from"../text/TextMeshWriter.js";const S=1,z=0,A=128;function D(e,t,r){return i(`${e}${t}${r}`)}function j(e,t,r,s,o){return i(`${e}${o}${t}${r*2**(B-s)}`)}const G=e((e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t}));class Z extends I{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,r){if(this._zoomLevel=r||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,i,r,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":{const i=t.readCentroidForDisplay();if(!i)return;const[r,s]=i.coords;this._writePoint(e,r,s,0,t);break}case"esriGeometryMultipoint":{let i=0;const r=f.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,r,s){const[o,n]=this._getMetricDir(),a=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this.evaluatedMeshParams.labelClassId;return new v(e,h,t,i,r,o,n,a,l,s)}_writePoint(e,t,i,r,s){if(t<0||t>b||i<0||i>b)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=D(s.getObjectId(),a,r),[h,c]=this._getMetricDir(),m=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0,u=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new v(n,a,l,t,i,h,c,m,d,u)),this._writeGlyphs(e,n,t,i,o,0,u,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:r}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,r)=>this._placeSubdivGlyphs(e,t,i,r),a=(o.bounds.width+s)/(1<<S);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:w(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===r?"above":"top"===r?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=new p;g(a,n,!1,!1,"esriGeometryPolyline",1);const l=k(new p,a,o),h=k(new p,a,-o),c=_(h,"esriGeometryPolyline",!1,!1),m=_(l,"esriGeometryPolyline",!1,!1),d=y(m.paths,s.bounds.width),u=y(c.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<d.length;f++)this._current.pathIndex=f,P(d[f],i,t,!!r);this._current.offsetDirection="below";for(let f=0;f<u.length;f++)this._current.pathIndex=f,P(u[f],i,t,!!r)}_writeCenterAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=y(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,P(o[n],i,t,!!r)}_placeSubdivGlyphs(e,t,i,r){const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n}=this.evaluatedMeshParams,a=this._current.zoomRange[0],l=G(t),h=this._current.shaping.bounds.width/(1<<S),c=Math.sqrt(n||A)/(1<<S),m=Math.min(i,r-i),d=this._current.shaping.isMultiline?B:Math.log2(m/(c+h/2)),u=0===t?d:Math.min(l,d),f=Math.max(a,this._zoomLevel+S-u),g=this._zoomLevel-f,_=this._current.shaping.bounds.width/2*2**g,p=j(this._current.objId,this._current.pathIndex,t,this._zoomLevel,this.evaluatedMeshParams.labelClassId);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,f,p):s&&g<0?this._placeStraightAlong(e,a,p):"parallel"===o?this._placeStraightAlong(e,f,p):"curved"===o&&this._placeCurved(e,f,_,p)}_placeStraight(e,t,i){const{out:r,id:s,shaping:o,referenceBounds:n}=this._current,{x:a,y:l}=e;r.metricStart(this._createLineLabelMetric(s,i,a,l)),r.metricBoxWrite(o.boundsT);const h=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360,m={clipAngle:h,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(r,s,a,l,o,0,n,m,!1);const d={clipAngle:c,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(r,s,a,l,o,0,n,d,!1),r.metricEnd()}_placeCurved(e,t,i,r){const{out:s,id:o}=this._current;s.metricStart(this._createLineLabelMetric(o,r,e.x,e.y));const n=e.clone(),a=e.angle*(180/Math.PI)%360,l=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(n,t,1,a),this._placeBack(e,n,t,i,1,a),this._placeForward(e,n,t,i,1,a)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(n,t,0,l),this._placeBack(e,n,t,i,0,l),this._placeForward(e,n,t,i,0,l)),s.metricEnd()}_placeStraightAlong(e,i,n){const{out:a,id:l,shaping:h,zoomRange:c,referenceBounds:m}=this._current,{boxBorderLineColor:u,boxBackgroundColor:f}=this.evaluatedMeshParams,g=e.clone(),_=e.angle*(180/Math.PI)%360,p=(e.angle*(180/Math.PI)+180)%360,b=h.glyphs.length>0&&!(!u&&!f);if(a.metricStart(this._createLineLabelMetric(l,n,e.x,e.y)),b){const n=Math.max(i,c[0],0),u=Math.min(B,c[1]),f=r(o(),-e.angle),g={minZoom:n,maxZoom:u,clipAngle:_,mapAligned:!0,isLineLabel:!0},b=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=d(b,-1*x),[i,r]=h.shapeBackground(s(o(),f,t));a.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(a,l,e.x,e.y,r,m,g),a.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=d(b,x),[i,r]=h.shapeBackground(s(o(),f,t));g.clipAngle=p,a.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(a,l,e.x,e.y,r,m,g),a.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(g,i,1,_,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(g,i,0,p,!0),a.metricEnd()}_placeBack(e,t,i,r,s,o){const n=e.clone();let a=e.backwardLength+z;for(;n.prev()&&!(a>=r);)this._placeOnSegment(n,t,a,i,-1,s,o),a+=n.length+z}_placeForward(e,t,i,r,s,o){const n=e.clone();let a=e.remainingLength+z;for(;n.next()&&!(a>=r);)this._placeOnSegment(n,t,a,i,1,s,o),a+=n.length+z}_placeFirst(e,i,s,a,l=!1){const{out:h,id:c,shaping:m,zoomRange:u,referenceBounds:f}=this._current,g=m.glyphs,_=t(this.evaluatedMeshParams.offsetX),p=t(this.evaluatedMeshParams.offsetY),b=d(_,p),x=r(o(),-e.angle);n(b,b,x);for(const t of g){const r=t.x>m.bounds.x?s:1-s,o=r*e.remainingLength+(1-r)*e.backwardLength,n=Math.abs(t.x+t.width/2-m.bounds.x),d=Math.max(0,this._zoomLevel+Math.log2(n/(o+z))),g=Math.max(i,l?0:d);if(t.maxZoom=Math.min(u[1],B),t.angle=e.angle+(1-s)*Math.PI,t.minZoom=Math.max(u[0],g),this._writeLineGlyph(h,c,e.x,e.y,t,a,f,!0),(s||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom)){const e=new M(t.bounds.x+b[0],t.bounds.y+b[1],t.bounds.width,t.bounds.height);h.metricBoxWrite(e)}}}_placeOnSegment(e,i,s,a,l,h,c){const{out:m,id:u,shaping:f,referenceBounds:g}=this._current,_=f.glyphs,p=e.dx/e.length,b=e.dy/e.length,x={x:e.x+s*-l*p,y:e.y+s*-l*b},v=t(this.evaluatedMeshParams.offsetX),y=t(this.evaluatedMeshParams.offsetY),P=d(v,y),w=r(o(),-e.angle);n(P,P,w);for(const t of _){const i=t.x>f.bounds.x?h:1-h;if(!(i&&1===l||!i&&-1===l))continue;const r=Math.abs(t.x+t.width/2-f.bounds.x),o=Math.max(0,this._zoomLevel+Math.log2(r/s)-.1),n=Math.max(a,this._zoomLevel+Math.log2(r/(s+e.length+z)));if(0!==o&&(t.angle=e.angle+(1-h)*Math.PI,t.minZoom=n,t.maxZoom=o,this._writeLineGlyph(m,u,x.x,x.y,t,c,g,!0),(h||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom))){const e=new M(t.bounds.x+P[0],t.bounds.y+P[1],t.bounds.width,t.bounds.height);m.metricBoxWrite(e)}}}_writeLineGlyph(e,t,i,r,s,o,n,a){if(i<0||i>b||r<0||r>b)return;e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:h}=s,{fontSize:c,haloSize:m,outlineSize:d}=this._textMeshTransformProps;this._writeQuad(e,t,i,r,{texcoords:l,offsets:h,fontSize:c,haloSize:m,outlineSize:d,color:L(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:n,minZoom:Math.max(this._current.zoomRange[0],s.minZoom),maxZoom:Math.min(this._current.zoomRange[1],s.maxZoom),clipAngle:o,mapAligned:a,isLineLabel:!0}),e.recordEnd()}_packedZoom(e){return Math.floor(e*x)/x}_isVisible(e,t){let i=Math.max(this._current.zoomRange[0],e),r=Math.min(this._current.zoomRange[1],t);i=this._packedZoom(i),r=this._packedZoom(r);const s=this._packedZoom(this._zoomLevel);return i<=s&&s<=r}}function k(e,t,i){const{coords:r,lengths:s}=t,o=u(),n=u(),d=u(),f=u(),g=u(),_=u(),p=2;let b=0;for(let u=0;u<s.length;u++){const t=s[u];for(let s=0;s<t;s++){const u=p*(s+b-1),x=p*(s+b),M=p*(s+b+1);s>0?a(o,r[u],r[u+1]):a(o,0,0),a(n,r[x],r[x+1]),s<t-1?a(d,r[M],r[M+1]):a(d,0,0),0===s?a(f,0,0):(l(f,n,o),h(f,f),a(f,f[1],-f[0])),s===t-1?a(g,0,0):(l(g,d,n),h(g,g),a(g,g[1],-g[0])),c(_,f,g),h(_,_);const v=_[0]*g[0]+_[1]*g[1];0!==v&&m(_,_,v),m(_,_,i),e.coords.push(n[0]+_[0],n[1]+_[1])}e.lengths.push(t),b+=t}return e}export{Z as LabelMeshWriter,D as labelMetricHash,j as lineLabelMetricHash};