@arcgis/core 4.34.0-next.2 → 4.34.0-next.4

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 (260) hide show
  1. package/Map.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{bf3555f91492a1a3b613.js → 09f76ca9b47b465c934f.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{397b15d46f22718c9f38.js → 0d78fc2c2bc1152f84db.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{ead5d4e271effc04def3.js → 1415d4e2f5f3193be004.js} +1 -1
  6. package/assets/esri/core/workers/chunks/17e43a050fbf8dc87588.js +1 -0
  7. package/assets/esri/core/workers/chunks/{ac2607f1e8cd2e99907c.js → 1bc4cb6366e733a7c7ef.js} +2 -2
  8. package/assets/esri/core/workers/chunks/1ee6e9a88f0676032e91.js +1 -0
  9. package/assets/esri/core/workers/chunks/{ece68a25651ef03fc95d.js → 342f61e784c9364a493b.js} +1 -1
  10. package/assets/esri/core/workers/chunks/3adcf78ed1e7cd82666d.js +1 -0
  11. package/assets/esri/core/workers/chunks/{07e58dff44fcbb3b3539.js → 562800b0af52a38a311b.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{32ee2708edd307954125.js → 7174150bf7595c22f976.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{e77371ddbaf4b2d9be8d.js → 74c0db9e3a62e9839b23.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{aba19485b6cdcb70dac6.js → 8008f5479f4d16964088.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{40f54c4f8ae63c6f3df9.js → a32dcd5bc4680374d30c.js} +1 -1
  16. package/assets/esri/core/workers/chunks/ad4f65d764654c70a117.js +1 -0
  17. package/assets/esri/core/workers/chunks/{d7b640f7a181bd26c7c7.js → bac5e1d50b69f0d94694.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{9ca480eb8b2312381ccf.js → bcadcb709e622f2aaaf9.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{677af0281e4fc9f3bd98.js → c6cd8784a3e222eb2d4a.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{54f4a1131f99468db076.js → d33a5d79f2163ad62b1d.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{e3c1aea34ece8336dae1.js → e9aa1d9ded8a52a40c57.js} +1 -1
  22. package/assets/esri/core/workers/chunks/f2aa8090827086c62dde.js +1 -0
  23. package/assets/esri/core/workers/chunks/fd4c020297badcb81947.js +1 -0
  24. package/assets/esri/core/workers/chunks/{b160dcbea6256e0cf689.js → feaf79b69d2e2a1f2aa2.js} +1 -1
  25. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  26. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  27. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  28. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  29. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  30. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  31. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  32. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  33. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  34. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  35. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  36. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  37. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  38. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  39. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  40. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  41. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  42. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  43. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  44. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  45. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  46. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  47. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  48. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  49. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  50. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  51. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  52. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  53. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  54. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  55. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  56. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  57. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  58. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  59. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  60. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  61. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  62. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  63. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  64. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  65. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  66. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  67. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  68. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  69. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  70. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  71. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  72. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  73. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  74. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  75. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  76. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  77. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  78. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  79. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  80. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  81. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  82. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  83. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  84. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  85. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  86. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  87. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  88. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  89. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  90. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  91. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  92. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  93. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  94. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  95. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  96. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  97. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  98. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  99. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  100. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  101. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  102. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  103. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  104. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  105. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  106. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  107. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  108. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  109. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  110. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  111. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  112. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  113. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  114. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  115. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  116. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  117. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  118. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  119. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  120. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  121. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  122. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  123. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  124. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  125. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  126. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  127. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  128. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  129. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  130. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  131. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  132. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  133. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  134. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  135. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  136. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  137. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  138. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  139. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  140. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  141. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  142. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  143. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  144. package/chunks/Laserlines.glsl.js +2 -2
  145. package/chunks/cameraUtilsSpherical.js +1 -1
  146. package/chunks/sphere.js +1 -1
  147. package/chunks/vec42.js +1 -1
  148. package/config.js +1 -1
  149. package/core/accessorSupport/ensureType.js +1 -1
  150. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  151. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  152. package/effects/FocusArea.js +5 -0
  153. package/{views → effects}/FocusAreaOutline.js +1 -1
  154. package/{views → effects}/FocusAreas.js +1 -1
  155. package/geometry/support/frustum.js +1 -1
  156. package/geometry/support/sphere.js +1 -1
  157. package/interfaces.d.ts +137 -66
  158. package/kernel.js +1 -1
  159. package/layers/VideoLayer.js +1 -1
  160. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  161. package/layers/video/VideoController.js +1 -1
  162. package/networks/support/UNTraceConfiguration.js +1 -1
  163. package/networks/support/typeUtils.js +1 -1
  164. package/package.json +1 -1
  165. package/rest/knowledgeGraph/GraphAddFieldIndexResult.js +5 -0
  166. package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
  167. package/rest/knowledgeGraph/GraphAddPropertyResult.js +1 -1
  168. package/rest/knowledgeGraph/GraphDataModelOperationResult.js +5 -0
  169. package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.js +5 -0
  170. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
  171. package/rest/knowledgeGraph/GraphDeletePropertyResult.js +1 -1
  172. package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +1 -1
  173. package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +1 -1
  174. package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.js +1 -1
  175. package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
  176. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
  177. package/rest/knowledgeGraphService.js +1 -1
  178. package/rest/networks/support/CircuitPath.js +5 -0
  179. package/rest/networks/support/CircuitPathConnectivityElement.js +5 -0
  180. package/rest/networks/support/TraceLocation.js +1 -1
  181. package/rest/networks/support/TraceResult.js +1 -1
  182. package/smartMapping/renderers/pieChart.js +1 -1
  183. package/smartMapping/renderers/predominance.js +1 -1
  184. package/smartMapping/renderers/support/rendererUtils.js +1 -1
  185. package/smartMapping/renderers/support/spikeUtils.d.ts +4 -0
  186. package/support/revision.js +1 -1
  187. package/views/2d/engine/Bitmap.js +1 -1
  188. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  189. package/views/2d/engine/vectorTiles/GlyphMosaic.js +1 -1
  190. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  191. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  192. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  193. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  194. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  195. package/views/2d/engine/webgl/Overlay.js +1 -1
  196. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  197. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  198. package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
  199. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  200. package/views/2d/engine/webgl/effects/post-processing/Colorize.js +1 -1
  201. package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +1 -1
  202. package/views/2d/engine/webgl/effects/post-processing/Opacity.js +1 -1
  203. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  206. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  207. package/views/2d/layers/VideoLayerView2D.js +1 -1
  208. package/views/3d/FocusAreasView.js +1 -1
  209. package/views/3d/camera/constraintUtils/distance.js +1 -1
  210. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  211. package/views/3d/environment/LocalAtmosphere.js +1 -1
  212. package/views/3d/environment/MarsAtmosphere.js +1 -1
  213. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  214. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  215. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  216. package/views/3d/state/NearFarHeuristic.js +1 -1
  217. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  218. package/views/3d/state/utils/navigationUtils.js +1 -1
  219. package/views/3d/support/engineContent/marker.js +1 -1
  220. package/views/3d/support/geometryUtils/sphere.js +1 -1
  221. package/views/3d/support/sunUtils.js +1 -1
  222. package/views/3d/terrain/OverlayManager.js +1 -1
  223. package/views/3d/terrain/OverlayRenderer.js +1 -1
  224. package/views/3d/webgl/RenderCamera.js +1 -1
  225. package/views/3d/webgl/RenderNode.js +1 -1
  226. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  227. package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +5 -0
  228. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  229. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
  230. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  231. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  232. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  233. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  234. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  235. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  236. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  237. package/views/VideoView.js +1 -1
  238. package/views/support/imageReprojection.js +1 -1
  239. package/views/webgl/RenderingContext.js +1 -1
  240. package/views/webgl/Texture.js +1 -1
  241. package/views/webgl/rasterUtils.js +1 -1
  242. package/widgets/Daylight/DaylightViewModel.js +1 -1
  243. package/widgets/Editor/EditorViewModel.js +1 -1
  244. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  245. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  246. package/widgets/Editor/UpdateWorkflow.js +1 -1
  247. package/widgets/Editor/components/Notices.js +1 -1
  248. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  249. package/widgets/Editor/workflowUtils.js +1 -1
  250. package/widgets/Editor.js +1 -1
  251. package/widgets/FeatureTable/FieldColumn.js +1 -1
  252. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  253. package/assets/esri/core/workers/chunks/094e8aae6dada24c8115.js +0 -1
  254. package/assets/esri/core/workers/chunks/24327d01cb2c5c55a4b7.js +0 -1
  255. package/assets/esri/core/workers/chunks/62b2d3720693c93a60f2.js +0 -1
  256. package/assets/esri/core/workers/chunks/a0f2df8ca7cd14bfa013.js +0 -1
  257. package/assets/esri/core/workers/chunks/b06cb23048c32940f5de.js +0 -1
  258. package/assets/esri/core/workers/chunks/d3d98ea5b5e56fc60a31.js +0 -1
  259. package/views/FocusArea.js +0 -5
  260. package/views/FocusAreaOutlineItem.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{createResolver as t,onAbortOrThrow as e,throwIfNotAbortError as i}from"../../../core/promiseUtils.js";import{identity as s,translate as r,rotate as h,scaleByVec2 as o,multiply as u}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{DisplayObject as l}from"./DisplayObject.js";import d from"./ImageryBitmapSource.js";import{SizedPixelFormat as c,PixelFormat as _,TextureWrapMode as p}from"../../webgl/enums.js";import{Texture as m}from"../../webgl/Texture.js";import{TextureDescriptor as x}from"../../webgl/TextureDescriptor.js";function g(t){return t&&"render"in t}function f(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}function w(t){return g(t)?t instanceof d?t.getRenderedRasterPixels()?.renderedRasterPixels:f(t):t}class S extends l{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._texture=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),null!=this._uploadStatus&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return void 0!==this._height?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){null==t&&null==this._source||(this._source=t,this.invalidateTexture(),this.requestRender())}get texture(){return this._texture}get width(){return void 0!==this._width?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(i,s){null!=this._uploadStatus&&this._uploadStatus.controller.abort();const r=new AbortController,h=t();return e(s,(()=>r.abort())),e(r,(t=>h.reject(t))),this._uploadStatus={controller:r,resolver:h},this.source=i,h.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=s(this.transforms.displayViewScreenMat3),[i,a]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,d=l*this.width,c=l*this.height,_=Math.PI*this.rotation/180;r(e,e,n(i,a)),r(e,e,n(d/2,c/2)),h(e,e,-_),r(e,e,n(-d/2,-c/2)),o(e,e,n(d,c)),u(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const s=w(this.source);try{if(null!=this._uploadStatus){const{controller:t,resolver:i}=this._uploadStatus,r={signal:t.signal},{width:h,height:o}=this,u=this._texture,a=e.textureUploadManager;await a.enqueueTextureUpdate({data:s,texture:u,width:h,height:o},r),i.resolve(),this._uploadStatus=null}else this._texture.setData(s);this.ready()}catch(r){i(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:a()}}_createTexture(t){const e=this.immutable,i=new x;return i.internalFormat=e?c.RGBA8:_.RGBA,i.wrapMode=p.CLAMP_TO_EDGE,i.isImmutable=e,i.width=this._sourceWidth,i.height=this._sourceHeight,new m(t,i)}}export{S as Bitmap,g as isImageSource,f as rasterize};
5
+ import{createResolver as t,onAbortOrThrow as e,throwIfNotAbortError as i}from"../../../core/promiseUtils.js";import{identity as s,translate as r,rotate as h,scaleByVec2 as o,multiply as u}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{DisplayObject as l}from"./DisplayObject.js";import d from"./ImageryBitmapSource.js";import{SizedPixelFormat as c,PixelFormat as _,TextureWrapMode as p}from"../../webgl/enums.js";import{Texture as m}from"../../webgl/Texture.js";import{TextureDescriptor as x}from"../../webgl/TextureDescriptor.js";function g(t){return t&&"render"in t}function f(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}function w(t){return g(t)?t instanceof d?t.getRenderedRasterPixels()?.renderedRasterPixels:f(t):t}class S extends l{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._texture=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),null!=this._uploadStatus&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return void 0!==this._height?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){null==t&&null==this._source||(this._source=t,this.invalidateTexture(),this.requestRender())}get texture(){return this._texture}get width(){return void 0!==this._width?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(i,s){null!=this._uploadStatus&&this._uploadStatus.controller.abort();const r=new AbortController,h=t();return e(s,(()=>r.abort())),e(r,(t=>h.reject(t))),this._uploadStatus={controller:r,resolver:h},this.source=i,h.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=s(this.transforms.displayViewScreenMat3),[i,a]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,d=l*this.width,c=l*this.height,_=Math.PI*this.rotation/180;r(e,e,n(i,a)),r(e,e,n(d/2,c/2)),h(e,e,-_),r(e,e,n(-d/2,-c/2)),o(e,e,n(d,c)),u(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const s=w(this.source);try{if(null!=this._uploadStatus){const{controller:t,resolver:i}=this._uploadStatus,r={signal:t.signal},{width:h,height:o}=this,u=this._texture,a=e.textureUploadManager;await a.enqueueTextureUpdate({data:s,texture:u,width:h,height:o},r),i.resolve(),this._uploadStatus=null}else this._texture.setData(s);this.ready()}catch(r){i(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:a()}}_createTexture(t){const e=this.immutable,i=new x(this._sourceWidth,this._sourceHeight);return i.internalFormat=e?c.RGBA8:_.RGBA,i.wrapMode=p.CLAMP_TO_EDGE,i.isImmutable=e,new m(t,i)}}export{S as Bitmap,g as isImageSource,f as rasterize};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{timeExtentsEqual as a,setUniforms as e}from"../utils.js";import{BufferObject as r}from"../../../../webgl/BufferObject.js";import{BlendFactor as s,PrimitiveType as o,Usage as i,PixelFormat as n,TextureWrapMode as m,DataType as l}from"../../../../webgl/enums.js";import{Texture as p}from"../../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../../webgl/TextureDescriptor.js";import{VertexArrayObject as h}from"../../../../webgl/VertexArrayObject.js";import{VertexElementDescriptor as _}from"../../../../webgl/VertexElementDescriptor.js";class f{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof f))return!1;if(!a(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}async load(a,e){const{extent:r,size:s}=a;t(e);const o=await this._params.loadImagery(r,s[0],s[1],this._params.timeExtent,e);return new x(o,{color:this._params.color,opacity:this._params.opacity})}render(t,a,r){const{context:i}=t,{program:n}=r;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(s.ONE,s.ONE_MINUS_SRC_ALPHA),i.useProgram(n),n.setUniformMatrix3fv("u_dvsMat3",a.dvsMat3),i.bindTexture(r.texture,0),n.setUniform1i("u_texture",0),n.setUniform1f("u_Min",r.min),n.setUniform1f("u_Max",r.max),e(n,"color","vec4",this._params.color),e(n,"opacity","float",this._params.opacity),i.bindVAO(r.vertexArray),i.drawArrays(o.TRIANGLE_STRIP,0,4)}}const d=new Map;d.set("a_position",0),d.set("a_texcoord",1);const w=new Map([["geometry",[new _("a_position",2,l.UNSIGNED_SHORT,0,8),new _("a_texcoord",2,l.UNSIGNED_SHORT,4,8)]]]),u={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:d};class x{constructor(t,a){this._flowData=t,this._values=a}attach(t){const{context:a}=t,{width:e,height:s}=this._flowData,o=r.createVertex(a,i.STATIC_DRAW,new Uint16Array([0,0,0,1,e,0,1,1,0,s,0,0,e,s,1,0])),l=new Map([["geometry",o]]),_=new h(a,d,w,l),f=[];"ramp"===this._values.color.kind&&f.push("vvColor"),"ramp"===this._values.opacity.kind&&f.push("vvOpacity");const x=t.getProgram(u,f);let y=1e6,g=-1e6;for(let r=0;r<s;r++)for(let t=0;t<e;t++)if(0!==this._flowData.mask[r*e+t]){const a=this._flowData.data[2*(r*e+t)],s=this._flowData.data[2*(r*e+t)+1],o=Math.sqrt(a*a+s*s);y=Math.min(y,o),g=Math.max(g,o)}const A=new Uint8Array(4*e*s);for(let r=0;r<s;r++)for(let t=0;t<e;t++)if(0!==this._flowData.mask[r*e+t]){const a=this._flowData.data[2*(r*e+t)],s=this._flowData.data[2*(r*e+t)+1],o=(Math.sqrt(a*a+s*s)-y)/(g-y);A[4*(r*e+t)]=255*o,A[4*(r*e+t)+1]=0,A[4*(r*e+t)+2]=0,A[4*(r*e+t)+3]=255}else A[4*(r*e+t)]=0,A[4*(r*e+t)+1]=0,A[4*(r*e+t)+2]=0,A[4*(r*e+t)+3]=0;const b=new c;b.internalFormat=n.RGBA,b.wrapMode=m.CLAMP_TO_EDGE,b.flipped=!0,b.width=e,b.height=s;const v=new p(a,b,A);this.vertexArray=_,this.program=x,this.texture=v,this.min=y,this.max=g,this._flowData=null}detach(){this.vertexArray.dispose(),this.texture.dispose()}get ready(){return this.program.compiled}}export{f as Imagery,x as ImageryResources};
5
+ import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{timeExtentsEqual as a,setUniforms as r}from"../utils.js";import{BufferObject as e}from"../../../../webgl/BufferObject.js";import{BlendFactor as s,PrimitiveType as o,Usage as i,PixelFormat as n,TextureWrapMode as m,DataType as l}from"../../../../webgl/enums.js";import{Texture as p}from"../../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../../webgl/TextureDescriptor.js";import{VertexArrayObject as h}from"../../../../webgl/VertexArrayObject.js";import{VertexElementDescriptor as _}from"../../../../webgl/VertexElementDescriptor.js";class f{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof f))return!1;if(!a(this._params.timeExtent,t._params.timeExtent))return!1;let r=!0;return r=r&&this._params.loadImagery===t._params.loadImagery,r=r&&this._params.color.kind===t._params.color.kind,r=r&&this._params.opacity.kind===t._params.opacity.kind,r}async load(a,r){const{extent:e,size:s}=a;t(r);const o=await this._params.loadImagery(e,s[0],s[1],this._params.timeExtent,r);return new x(o,{color:this._params.color,opacity:this._params.opacity})}render(t,a,e){const{context:i}=t,{program:n}=e;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(s.ONE,s.ONE_MINUS_SRC_ALPHA),i.useProgram(n),n.setUniformMatrix3fv("u_dvsMat3",a.dvsMat3),i.bindTexture(e.texture,0),n.setUniform1i("u_texture",0),n.setUniform1f("u_Min",e.min),n.setUniform1f("u_Max",e.max),r(n,"color","vec4",this._params.color),r(n,"opacity","float",this._params.opacity),i.bindVAO(e.vertexArray),i.drawArrays(o.TRIANGLE_STRIP,0,4)}}const d=new Map;d.set("a_position",0),d.set("a_texcoord",1);const u=new Map([["geometry",[new _("a_position",2,l.UNSIGNED_SHORT,0,8),new _("a_texcoord",2,l.UNSIGNED_SHORT,4,8)]]]),w={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:d};class x{constructor(t,a){this._flowData=t,this._values=a}attach(t){const{context:a}=t,{width:r,height:s}=this._flowData,o=e.createVertex(a,i.STATIC_DRAW,new Uint16Array([0,0,0,1,r,0,1,1,0,s,0,0,r,s,1,0])),l=new Map([["geometry",o]]),_=new h(a,d,u,l),f=[];"ramp"===this._values.color.kind&&f.push("vvColor"),"ramp"===this._values.opacity.kind&&f.push("vvOpacity");const x=t.getProgram(w,f);let y=1e6,g=-1e6;for(let e=0;e<s;e++)for(let t=0;t<r;t++)if(0!==this._flowData.mask[e*r+t]){const a=this._flowData.data[2*(e*r+t)],s=this._flowData.data[2*(e*r+t)+1],o=Math.sqrt(a*a+s*s);y=Math.min(y,o),g=Math.max(g,o)}const A=new Uint8Array(4*r*s);for(let e=0;e<s;e++)for(let t=0;t<r;t++)if(0!==this._flowData.mask[e*r+t]){const a=this._flowData.data[2*(e*r+t)],s=this._flowData.data[2*(e*r+t)+1],o=(Math.sqrt(a*a+s*s)-y)/(g-y);A[4*(e*r+t)]=255*o,A[4*(e*r+t)+1]=0,A[4*(e*r+t)+2]=0,A[4*(e*r+t)+3]=255}else A[4*(e*r+t)]=0,A[4*(e*r+t)+1]=0,A[4*(e*r+t)+2]=0,A[4*(e*r+t)+3]=0;const b=new c(r,s);b.internalFormat=n.RGBA,b.wrapMode=m.CLAMP_TO_EDGE,b.flipped=!0;const v=new p(a,b,A);this.vertexArray=_,this.program=x,this.texture=v,this.min=y,this.max=g,this._flowData=null}detach(){this.vertexArray.dispose(),this.texture.dispose()}get ready(){return this.program.compiled}}export{f as Imagery,x as ImageryResources};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"./RectangleBinPack.js";import e from"../webgl/Rect.js";import{PixelFormat as s,TextureWrapMode as i}from"../../../webgl/enums.js";import{Texture as h}from"../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../webgl/TextureDescriptor.js";class n{constructor(e,s,i){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphIndex={},this._textures=[],this._rangePromises=new Map,this.width=e,this.height=s,this._glyphSource=i,this._binPack=new t(e-4,s-4),this._glyphData.push(new Uint8Array(e*s)),this._dirties.push(!0),this._textures.push(void 0)}getGlyphItems(s,i){const h=[],r=this._glyphSource,n=new Set,o=1/256;for(const t of i){const e=Math.floor(t*o);n.add(e)}const a=[];return n.forEach((t=>{const e=s+t;if(this._rangePromises.has(e))a.push(this._rangePromises.get(e));else{const i=r.getRange(s,t).then((()=>{this._rangePromises.delete(e)}),(()=>{this._rangePromises.delete(e)}));this._rangePromises.set(e,i),a.push(i)}})),Promise.all(a).then((()=>{let n=this._glyphIndex[s];n||(n={},this._glyphIndex[s]=n);for(const o of i){const i=n[o];if(i){h[o]={sdf:!0,rect:i.rect,metrics:i.metrics,page:i.page,code:o};continue}const a=r.getGlyph(s,o);if(!a?.metrics)continue;const l=a.metrics;let c;if(0===l.width)c=new e(0,0,0,0);else{const e=3,s=l.width+2*e,i=l.height+2*e;let h=s%4?4-s%4:4,r=i%4?4-i%4:4;1===h&&(h=5),1===r&&(r=5),c=this._binPack.allocate(s+h,i+r),c.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new t(this.width-4,this.height-4),c=this._binPack.allocate(s+h,i+r));const n=this._glyphData[this._currentPage],o=a.bitmap;let g,_;if(o)for(let t=0;t<i;t++){g=s*t,_=this.width*(c.y+t+1)+c.x;for(let t=0;t<s;t++)n[_+t+1]=o.at(g+t)}}n[o]={rect:c,metrics:l,tileIDs:null,page:this._currentPage},h[o]={sdf:!0,rect:c,metrics:l,page:this._currentPage,code:o},this._dirties[this._currentPage]=!0}return h}))}removeGlyphs(t){for(const e in this._glyphIndex){const s=this._glyphIndex[e];if(!s)continue;let i;for(const e in s)if(i=s[e],i.tileIDs.delete(t),0===i.tileIDs.size){const t=this._glyphData[i.page],h=i.rect;let r,n;for(let e=0;e<h.height;e++)for(r=this.width*(h.y+e)+h.x,n=0;n<h.width;n++)t[r+n]=0;delete s[e],this._dirties[i.page]=!0}}}bind(t,e,n,o=0){if(!this._textures[n]){const e=new r;e.pixelFormat=s.ALPHA,e.wrapMode=i.CLAMP_TO_EDGE,e.width=this.width,e.height=this.height,this._textures[n]=new h(t,e,new Uint8Array(this.width*this.height))}const a=this._textures[n];a.setSamplingMode(e),this._dirties[n]&&a.setData(this._glyphData[n]),t.bindTexture(a,o),this._dirties[n]=!1}destroy(){this.dispose()}dispose(){this._glyphData.length=0,this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0}}export{n as default};
5
+ import t from"./RectangleBinPack.js";import e from"../webgl/Rect.js";import{PixelFormat as s,TextureWrapMode as i}from"../../../webgl/enums.js";import{Texture as h}from"../../../webgl/Texture.js";import{TextureDescriptor as r}from"../../../webgl/TextureDescriptor.js";class n{constructor(e,s,i){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphIndex={},this._textures=[],this._rangePromises=new Map,this.width=e,this.height=s,this._glyphSource=i,this._binPack=new t(e-4,s-4),this._glyphData.push(new Uint8Array(e*s)),this._dirties.push(!0),this._textures.push(void 0)}getGlyphItems(s,i){const h=[],r=this._glyphSource,n=new Set,o=1/256;for(const t of i){const e=Math.floor(t*o);n.add(e)}const a=[];return n.forEach((t=>{const e=s+t;if(this._rangePromises.has(e))a.push(this._rangePromises.get(e));else{const i=r.getRange(s,t).then((()=>{this._rangePromises.delete(e)}),(()=>{this._rangePromises.delete(e)}));this._rangePromises.set(e,i),a.push(i)}})),Promise.all(a).then((()=>{let n=this._glyphIndex[s];n||(n={},this._glyphIndex[s]=n);for(const o of i){const i=n[o];if(i){h[o]={sdf:!0,rect:i.rect,metrics:i.metrics,page:i.page,code:o};continue}const a=r.getGlyph(s,o);if(!a?.metrics)continue;const l=a.metrics;let c;if(0===l.width)c=new e(0,0,0,0);else{const e=3,s=l.width+2*e,i=l.height+2*e;let h=s%4?4-s%4:4,r=i%4?4-i%4:4;1===h&&(h=5),1===r&&(r=5),c=this._binPack.allocate(s+h,i+r),c.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new t(this.width-4,this.height-4),c=this._binPack.allocate(s+h,i+r));const n=this._glyphData[this._currentPage],o=a.bitmap;let g,_;if(o)for(let t=0;t<i;t++){g=s*t,_=this.width*(c.y+t+1)+c.x;for(let t=0;t<s;t++)n[_+t+1]=o.at(g+t)}}n[o]={rect:c,metrics:l,tileIDs:null,page:this._currentPage},h[o]={sdf:!0,rect:c,metrics:l,page:this._currentPage,code:o},this._dirties[this._currentPage]=!0}return h}))}removeGlyphs(t){for(const e in this._glyphIndex){const s=this._glyphIndex[e];if(!s)continue;let i;for(const e in s)if(i=s[e],i.tileIDs.delete(t),0===i.tileIDs.size){const t=this._glyphData[i.page],h=i.rect;let r,n;for(let e=0;e<h.height;e++)for(r=this.width*(h.y+e)+h.x,n=0;n<h.width;n++)t[r+n]=0;delete s[e],this._dirties[i.page]=!0}}}bind(t,e,n,o=0){if(!this._textures[n]){const e=new r(this.width,this.height);e.pixelFormat=s.ALPHA,e.wrapMode=i.CLAMP_TO_EDGE,this._textures[n]=new h(t,e,new Uint8Array(this.width*this.height))}const a=this._textures[n];a.setSamplingMode(e),this._dirties[n]&&a.setData(this._glyphData[n]),t.bindTexture(a,o),this._dirties[n]=!1}destroy(){this.dispose()}dispose(){this._glyphData.length=0,this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0}}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.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{rasterizeDash as t}from"../../../../symbols/cim/rasterizingUtils.js";import i from"./RectangleBinPack.js";import s from"../webgl/Rect.js";import{TextureWrapMode as e}from"../../../webgl/enums.js";import{Texture as h}from"../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../webgl/TextureDescriptor.js";const r="dasharray-";class o{constructor(t,s,e=0){this._size=[],this._mosaicsData=[],this._textures=[],this._dirties=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects={},this.pixelRatio=1,s<=0&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=t,this._pageHeight=s,e>0&&(this._maxItemSize=e),this._binPack=new i(t-4,s-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const t of this._textures)t&&t.dispose();this._textures.length=0}getWidth(t){return t>=this._size.length?-1:this._size[t][0]}getHeight(t){return t>=this._size.length?-1:this._size[t][1]}getPageSize(t){return t>=this._size.length?null:this._size[t]}setSpriteSource(t){if(this.dispose(),this.pixelRatio=t.devicePixelRatio,0===this._mosaicsData.length){this._binPack=new i(this._pageWidth-4,this._pageHeight-4);const t=Math.floor(this._pageWidth),s=Math.floor(this._pageHeight),e=new Uint32Array(t*s);this._mosaicsData[0]=e,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=t}getSpriteItem(t,i=!1){let s,e,h=this._mosaicRects[t];if(h)return h;if(!this._sprites||"loaded"!==this._sprites.loadStatus)return null;if(t&&t.startsWith(r)?([s,e]=this._rasterizeDash(t),i=!0):s=this._sprites.getSpriteInfo(t),!s?.width||!s.height||s.width<0||s.height<0)return null;const a=s.width,o=s.height,[n,_,g]=this._allocateImage(a,o);return n.width<=0?null:(this._copy(n,s,_,g,i,e),h={type:"sprite",rect:n,width:a,height:o,sdf:s.sdf,simplePattern:!1,rasterizationScale:s.pixelRatio??1,samplingMode:"Linear",page:_},this._mosaicRects[t]=h,h)}getSpriteItems(t){const i={};for(const s of t)i[s.name]=this.getSpriteItem(s.name,s.repeat);return i}getMosaicItemPosition(t,i){const s=this.getSpriteItem(t,i),e=s?.rect;if(!e)return null;e.width=s.width,e.height=s.height;const h=s.width,a=s.height,r=2;return{tl:[e.x+r,e.y+r],br:[e.x+r+h,e.y+r+a],page:s.page}}bind(t,i,s=0,r=0){if(s>=this._size.length||s>=this._mosaicsData.length)return;if(!this._textures[s]){const i=new a;i.wrapMode=e.CLAMP_TO_EDGE,i.width=this._size[s][0],i.height=this._size[s][1],this._textures[s]=new h(t,i,new Uint8Array(this._mosaicsData[s].buffer))}const o=this._textures[s];o.setSamplingMode(i),this._dirties[s]&&o.setData(new Uint8Array(this._mosaicsData[s].buffer)),t.bindTexture(o,r),this._dirties[s]=!1}static _copyBits(t,i,s,e,h,a,r,o,n,_,g){let p=e*i+s,c=o*a+r;if(g){c-=a;for(let r=-1;r<=_;r++,p=((r+_)%_+e)*i+s,c+=a)for(let i=-1;i<=n;i++)h[c+i]=t[p+(i+n)%n]}else for(let l=0;l<_;l++){for(let i=0;i<n;i++)h[c+i]=t[p+i];p+=i,c+=a}}_copy(t,i,s,e,h,a){if(!this._sprites||"loaded"!==this._sprites.loadStatus||s>=this._mosaicsData.length)return;const r=new Uint32Array(a?a.buffer:this._sprites.image.buffer),n=this._mosaicsData[s],_=2,g=a?i.width:this._sprites.width;o._copyBits(r,g,i.x,i.y,n,e[0],t.x+_,t.y+_,i.width,i.height,h),this._dirties[s]=!0}_allocateImage(t,e){t+=2,e+=2;const h=Math.max(t,e);if(this._maxItemSize&&this._maxItemSize<h){const i=new s(0,0,t,e);return this._mosaicsData.push(new Uint32Array(t*e)),this._dirties.push(!0),this._size.push([t,e]),this._textures.push(void 0),[i,this._mosaicsData.length-1,[t,e]]}let a=t%4?4-t%4:4,r=e%4?4-e%4:4;1===a&&(a=5),1===r&&(r=5);const o=this._binPack.allocate(t+a,e+r);return o.width<=0?(this._dirties[this._currentPage]||(this._mosaicsData[this._currentPage]=null),this._currentPage=this._mosaicsData.length,this._mosaicsData.push(new Uint32Array(this._pageWidth*this._pageHeight)),this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0),this._binPack=new i(this._pageWidth-4,this._pageHeight-4),this._allocateImage(t,e)):[o,this._currentPage,[this._pageWidth,this._pageHeight]]}_rasterizeDash(i){const s=/\[(.*?)\]/,e=i.match(s);if(!e)return null;const h=e[1].split(",").map(Number),a=i.slice(i.lastIndexOf("-")+1),[r,o,n]=t(h,a);return[{x:0,y:0,width:o,height:n,sdf:!0,pixelRatio:1},new Uint8Array(r.buffer)]}}export{o as default};
5
+ import"../../../../core/has.js";import{rasterizeDash as t}from"../../../../symbols/cim/rasterizingUtils.js";import i from"./RectangleBinPack.js";import s from"../webgl/Rect.js";import{TextureWrapMode as e}from"../../../webgl/enums.js";import{Texture as h}from"../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../webgl/TextureDescriptor.js";const r="dasharray-";class o{constructor(t,s,e=0){this._size=[],this._mosaicsData=[],this._textures=[],this._dirties=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects={},this.pixelRatio=1,s<=0&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=t,this._pageHeight=s,e>0&&(this._maxItemSize=e),this._binPack=new i(t-4,s-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const t of this._textures)t&&t.dispose();this._textures.length=0}getWidth(t){return t>=this._size.length?-1:this._size[t][0]}getHeight(t){return t>=this._size.length?-1:this._size[t][1]}getPageSize(t){return t>=this._size.length?null:this._size[t]}setSpriteSource(t){if(this.dispose(),this.pixelRatio=t.devicePixelRatio,0===this._mosaicsData.length){this._binPack=new i(this._pageWidth-4,this._pageHeight-4);const t=Math.floor(this._pageWidth),s=Math.floor(this._pageHeight),e=new Uint32Array(t*s);this._mosaicsData[0]=e,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=t}getSpriteItem(t,i=!1){let s,e,h=this._mosaicRects[t];if(h)return h;if(!this._sprites||"loaded"!==this._sprites.loadStatus)return null;if(t&&t.startsWith(r)?([s,e]=this._rasterizeDash(t),i=!0):s=this._sprites.getSpriteInfo(t),!s?.width||!s.height||s.width<0||s.height<0)return null;const a=s.width,o=s.height,[n,_,g]=this._allocateImage(a,o);return n.width<=0?null:(this._copy(n,s,_,g,i,e),h={type:"sprite",rect:n,width:a,height:o,sdf:s.sdf,simplePattern:!1,rasterizationScale:s.pixelRatio??1,samplingMode:"Linear",page:_},this._mosaicRects[t]=h,h)}getSpriteItems(t){const i={};for(const s of t)i[s.name]=this.getSpriteItem(s.name,s.repeat);return i}getMosaicItemPosition(t,i){const s=this.getSpriteItem(t,i),e=s?.rect;if(!e)return null;e.width=s.width,e.height=s.height;const h=s.width,a=s.height,r=2;return{tl:[e.x+r,e.y+r],br:[e.x+r+h,e.y+r+a],page:s.page}}bind(t,i,s=0,r=0){if(s>=this._size.length||s>=this._mosaicsData.length)return;if(!this._textures[s]){const i=new a(this._size[s][0],this._size[s][1]);i.wrapMode=e.CLAMP_TO_EDGE,this._textures[s]=new h(t,i,new Uint8Array(this._mosaicsData[s].buffer))}const o=this._textures[s];o.setSamplingMode(i),this._dirties[s]&&o.setData(new Uint8Array(this._mosaicsData[s].buffer)),t.bindTexture(o,r),this._dirties[s]=!1}static _copyBits(t,i,s,e,h,a,r,o,n,_,g){let p=e*i+s,c=o*a+r;if(g){c-=a;for(let r=-1;r<=_;r++,p=((r+_)%_+e)*i+s,c+=a)for(let i=-1;i<=n;i++)h[c+i]=t[p+(i+n)%n]}else for(let l=0;l<_;l++){for(let i=0;i<n;i++)h[c+i]=t[p+i];p+=i,c+=a}}_copy(t,i,s,e,h,a){if(!this._sprites||"loaded"!==this._sprites.loadStatus||s>=this._mosaicsData.length)return;const r=new Uint32Array(a?a.buffer:this._sprites.image.buffer),n=this._mosaicsData[s],_=2,g=a?i.width:this._sprites.width;o._copyBits(r,g,i.x,i.y,n,e[0],t.x+_,t.y+_,i.width,i.height,h),this._dirties[s]=!0}_allocateImage(t,e){t+=2,e+=2;const h=Math.max(t,e);if(this._maxItemSize&&this._maxItemSize<h){const i=new s(0,0,t,e);return this._mosaicsData.push(new Uint32Array(t*e)),this._dirties.push(!0),this._size.push([t,e]),this._textures.push(void 0),[i,this._mosaicsData.length-1,[t,e]]}let a=t%4?4-t%4:4,r=e%4?4-e%4:4;1===a&&(a=5),1===r&&(r=5);const o=this._binPack.allocate(t+a,e+r);return o.width<=0?(this._dirties[this._currentPage]||(this._mosaicsData[this._currentPage]=null),this._currentPage=this._mosaicsData.length,this._mosaicsData.push(new Uint32Array(this._pageWidth*this._pageHeight)),this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0),this._binPack=new i(this._pageWidth-4,this._pageHeight-4),this._allocateImage(t,e)):[o,this._currentPage,[this._pageWidth,this._pageHeight]]}_rasterizeDash(i){const s=/\[(.*?)\]/,e=i.match(s);if(!e)return null;const h=e[1].split(",").map(Number),a=i.slice(i.lastIndexOf("-")+1),[r,o,n]=t(h,a);return[{x:0,y:0,width:o,height:n,sdf:!0,pixelRatio:1},new Uint8Array(r.buffer)]}}export{o 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{MinPriority as e}from"../../../../core/MemCache.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{create as i}from"../../../../geometry/support/aaBoundingRect.js";import{tilePixelSize as s}from"./constants.js";import{TileHandler as r}from"./TileHandler.js";import{VectorTile as n}from"./VectorTile.js";import l from"../../tiling/TileInfoViewPOT.js";import a from"../../tiling/TileKey.js";class g extends r{constructor(e,t,o,i){super(e,t,o,e.tileInfo.lods.length-1),this._memCache=i,this._ongoingTileRequests=new Map,this._ongoingRequestToController=new Map,this._tileInfoView=new l(e.tileInfo,e.fullExtent)}destroy(){super.destroy(),this._ongoingRequestToController.forEach((e=>e.abort())),this._ongoingRequestToController.clear(),this._ongoingTileRequests.clear()}async getVectorTile(r,l){const g=new a(r[0],r[1],r[2],0);let h=this._memCache.get(g.id);if(h)return h.retain(),h;const m=await this._getVectorTileData(g);if(t(l),!this._layer)return null;if(h=this._memCache.get(g.id),h)return h.retain(),h;const c=this._layer.tileInfo.getTileBounds(i(),g),u=this._tileInfoView.getTileResolution(r[0]);return h=new n(g,u,c[0],c[3],s,s,this._styleRepository,this._memCache),h.setData(m),m&&(h.retain(),this._memCache.put(g.id,h,e)),h.neededForCoverage=!0,h.transforms.tileUnitsToPixels=o(1/8,0,0,0,1/8,0,0,0,1),h}_getVectorTileData(e){const t=e.id;if(this._ongoingTileRequests.has(t))return this._ongoingTileRequests.get(t);const o=new AbortController,i={signal:o.signal},s=this._getParsedVectorTileData(e,i).then((e=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),e))).catch((()=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),null)));return this._ongoingTileRequests.set(t,s),this._ongoingRequestToController.set(t,o),s}_getParsedVectorTileData(e,t){return this.fetchTileData(e,t).then((o=>this.parseTileData({key:e,data:o},t)))}}export{g as default};
5
+ import{MinPriority as e}from"../../../../core/MemCache.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{create as o}from"../../../../geometry/support/aaBoundingRect.js";import{tilePixelSize as s}from"./constants.js";import{TileHandler as r}from"./TileHandler.js";import{VectorTile as n}from"./VectorTile.js";import l from"../../tiling/TileInfoViewPOT.js";import a from"../../tiling/TileKey.js";class g extends r{constructor(e,t,i,o){super(e,t,i,e.tileInfo.lods.length-1),this._memCache=o,this._vectorTiles=new Map,this._ongoingTileRequests=new Map,this._ongoingRequestToController=new Map,this._tileInfoView=new l(e.tileInfo,e.fullExtent)}destroy(){super.destroy(),this._ongoingRequestToController.forEach((e=>e.abort())),this._ongoingRequestToController.clear(),this._ongoingTileRequests.clear(),this._vectorTiles.clear()}async getVectorTile(r,l){const g=new a(r[0],r[1],r[2],0);let h=this._vectorTiles.get(g.id)??this._memCache.get(g.id);if(h)return h.retain(),h;const c=await this._getVectorTileData(g);if(t(l),!this._layer)return null;if(h=this._vectorTiles.get(g.id)??this._memCache.get(g.id),h)return h.retain(),h;const T=this._layer.tileInfo.getTileBounds(o(),g),m=this._tileInfoView.getTileResolution(r[0]);return h=new n(g,m,T[0],T[3],s,s,this._styleRepository,this),h.setData(c),c&&(h.retain(),this._memCache.put(g.id,h,e),this._vectorTiles.set(g.id,h)),h.neededForCoverage=!0,h.transforms.tileUnitsToPixels=i(1/8,0,0,0,1/8,0,0,0,1),h}updateTileSize(e){this._memCache.updateSize(e.id,e)}onDisposeTile(e){this._vectorTiles.delete(e.id)}_getVectorTileData(e){const t=e.id;if(this._ongoingTileRequests.has(t))return this._ongoingTileRequests.get(t);const i=new AbortController,o={signal:i.signal},s=this._getParsedVectorTileData(e,o).then((e=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),e))).catch((()=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),null)));return this._ongoingTileRequests.set(t,s),this._ongoingRequestToController.set(t,i),s}_getParsedVectorTileData(e,t){return this.fetchTileData(e,t).then((i=>this.parseTileData({key:e,data:i},t)))}}export{g 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.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{identity as e,translate as t,rotate as s,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{tileCoordSize as i}from"./constants.js";import{BucketType as o}from"./enums.js";import{CircleRenderBucket as h,SymbolRenderBucket as n,LineRenderBucket as l,FillRenderBucket as c}from"./RenderBucket.js";import{fadeDuration as d}from"./decluttering/config.js";import{TiledDisplayObject as u}from"../webgl/TiledDisplayObject.js";const y=null;class m extends u{constructor(e,t,s,r,a,o,h,n=null){super(e,t,s,r,a,o,i,i),this.styleRepository=h,this._memCache=n,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get styleLayerUIDs(){return Array.from(this.layerData.keys())}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<d}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<d)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,e.type===o.SYMBOL&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._memCache?.updateSize(this.key.id,this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(m._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0===--this._referenced&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get cachedMemory(){return this._usedMemory}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,i]of a)this._deleteLayerData(e),i.type===o.SYMBOL&&(this.symbols.set(e,i.symbols),t=!0),this._usedMemory+=i.usedMemory,this.layerData.set(e,i);this._memCache?.updateSize(this.key.id,this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===o.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(a){super.setTransform(a);const i=this.resolution/(a.resolution*a.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];a.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;e(l),t(l,l,n),s(l,l,Math.PI*a.rotation/180),r(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:a(),tileMat3:a(),tileUnitsToPixels:a()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case o.FILL:s=new c(e,this.styleRepository);break;case o.LINE:s=new l(e,this.styleRepository);break;case o.SYMBOL:s=new n(e,this.styleRepository,this);break;case o.CIRCLE:s=new h(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{m as VectorTile,y as tracer};
5
+ import"../../../../core/has.js";import{identity as e,translate as t,rotate as s,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{tileCoordSize as i}from"./constants.js";import{BucketType as o}from"./enums.js";import{CircleRenderBucket as h,SymbolRenderBucket as n,LineRenderBucket as l,FillRenderBucket as c}from"./RenderBucket.js";import{fadeDuration as d}from"./decluttering/config.js";import{TiledDisplayObject as u}from"../webgl/TiledDisplayObject.js";const y=null;class m extends u{constructor(e,t,s,r,a,o,h,n=null){super(e,t,s,r,a,o,i,i),this.styleRepository=h,this._owner=n,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get styleLayerUIDs(){return Array.from(this.layerData.keys())}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<d}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<d)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,e.type===o.SYMBOL&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._owner?.updateTileSize(this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(m._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0===--this._referenced&&(this._owner?.onDisposeTile(this),this.dispose(),this.stage=null)}retain(){++this._referenced}get cachedMemory(){return this._usedMemory}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,i]of a)this._deleteLayerData(e),i.type===o.SYMBOL&&(this.symbols.set(e,i.symbols),t=!0),this._usedMemory+=i.usedMemory,this.layerData.set(e,i);this._owner?.updateTileSize(this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===o.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(a){super.setTransform(a);const i=this.resolution/(a.resolution*a.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];a.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;e(l),t(l,l,n),s(l,l,Math.PI*a.rotation/180),r(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:a(),tileMat3:a(),tileUnitsToPixels:a()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case o.FILL:s=new c(e,this.styleRepository);break;case o.LINE:s=new l(e,this.styleRepository);break;case o.SYMBOL:s=new n(e,this.styleRepository,this);break;case o.CIRCLE:s=new h(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{m as VectorTile,y as tracer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{AttributeDataType as i,dataDrivenUnit2 as s,dataDrivenUnit1 as r,dataDrivenUnit0 as a,visualVariableUnit as n,localTimeOriginUnit as u,gpgpuUnit as h,animationUnit as o,filterFlagsUnit as l}from"./definitions.js";import{getDisplayIdTexel as d}from"./DisplayId.js";import{getPixelArrayCtor as g,getPixelBytes as p}from"./Utils.js";import{TextureWrapMode as _,TextureSamplingMode as c}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const T=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:a}=t,n=g(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=a,a||(this.data=new n(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b;return t.wrapMode=_.CLAMP_TO_EDGE,t.samplingMode=c.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=d(t),r=this.data,a=s*this.texelSize+e;!r||a>=r.length||(r[a]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=d(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const a=this.data.buffer,n=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,l=h,d=this.size,p=o,_=h*this.size*u,c=(d+p*this.size)*u-_,x=g(this.pixelType),f=new x(a,_*x.BYTES_PER_ELEMENT,c),b=this.size,m=p-l+1;if(m>this.size)return void T().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));n.updateData(0,0,l,b,m,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const a=1<<i%this.texelSize;t.layout&a&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=g(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,a=this._lastTexture.descriptor.pixelFormat,n=this.getFBO(t),u=p(r),h=new(g(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.getBoundFramebufferObject(),{x:l,y:d,width:_,height:c}=t.getViewport();t.bindFramebuffer(n),n.readPixels(0,0,i,s,a,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(l,d,_,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}get locked(){return this._locked}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map(((t,e)=>null!=t?new m(t,this.size,e):null));else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new m(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,i.FilterFlags,1,e)}setLocalTimeOrigin(t,e){this.setData(t,i.LocalTimeOrigin,0,e)}getLabelMinZoom(t){return this.getData(t,i.FilterFlags,1,255)}getFilterFlags(t){return this.getData(t,i.FilterFlags,0,0)}getVisualVariableData(t,e){return this.getData(t,i.VV,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const a=r.getData(t,i);return null!=a?a:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}get hasPendingUpdates(){return this._pendingAttributeUpdates.length>0}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const e of t){const{blockData:t,initArgs:i,sendUpdateEpoch:s,version:r}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=i&&this._initialize(i);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}}}getUniforms(t){return{filterFlags:{texture:this._getTexture(t,i.FilterFlags),unit:l},animation:{texture:this._getTexture(t,i.Animation),unit:o},gpgpu:{texture:this._getTexture(t,i.GPGPU),unit:h},localTimeOrigin:{texture:this._getTexture(t,i.LocalTimeOrigin),unit:u},visualVariableData:{texture:this._getTexture(t,i.VV),unit:n},dataDriven0:{texture:this._getTexture(t,i.DD0),unit:a},dataDriven1:{texture:this._getTexture(t,i.DD1),unit:r},dataDriven2:{texture:this._getTexture(t,i.DD2),unit:s},size:this.size}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b;e.wrapMode=_.CLAMP_TO_EDGE,e.samplingMode=c.NEAREST,e.width=1,e.height=1,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
5
+ import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{AttributeDataType as i,dataDrivenUnit2 as s,dataDrivenUnit1 as r,dataDrivenUnit0 as a,visualVariableUnit as n,localTimeOriginUnit as u,gpgpuUnit as h,animationUnit as o,filterFlagsUnit as l}from"./definitions.js";import{getDisplayIdTexel as d}from"./DisplayId.js";import{getPixelArrayCtor as g,getPixelBytes as p}from"./Utils.js";import{TextureWrapMode as _,TextureSamplingMode as c}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const T=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:a}=t,n=g(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=a,a||(this.data=new n(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b(this.size);return t.wrapMode=_.CLAMP_TO_EDGE,t.samplingMode=c.NEAREST,t.dataType=this.pixelType,t}setData(t,e,i){const s=d(t),r=this.data,a=s*this.texelSize+e;!r||a>=r.length||(r[a]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=d(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const a=this.data.buffer,n=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,l=h,d=this.size,p=o,_=h*this.size*u,c=(d+p*this.size)*u-_,x=g(this.pixelType),f=new x(a,_*x.BYTES_PER_ELEMENT,c),b=this.size,m=p-l+1;if(m>this.size)return void T().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));n.updateData(0,0,l,b,m,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const a=1<<i%this.texelSize;t.layout&a&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=g(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,a=this._lastTexture.descriptor.pixelFormat,n=this.getFBO(t),u=p(r),h=new(g(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.getBoundFramebufferObject(),{x:l,y:d,width:_,height:c}=t.getViewport();t.bindFramebuffer(n),n.readPixels(0,0,i,s,a,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(l,d,_,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}get locked(){return this._locked}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map(((t,e)=>null!=t?new m(t,this.size,e):null));else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new m(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,i.FilterFlags,1,e)}setLocalTimeOrigin(t,e){this.setData(t,i.LocalTimeOrigin,0,e)}getLabelMinZoom(t){return this.getData(t,i.FilterFlags,1,255)}getFilterFlags(t){return this.getData(t,i.FilterFlags,0,0)}getVisualVariableData(t,e){return this.getData(t,i.VV,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const a=r.getData(t,i);return null!=a?a:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}get hasPendingUpdates(){return this._pendingAttributeUpdates.length>0}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const e of t){const{blockData:t,initArgs:i,sendUpdateEpoch:s,version:r}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=i&&this._initialize(i);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}}}getUniforms(t){return{filterFlags:{texture:this._getTexture(t,i.FilterFlags),unit:l},animation:{texture:this._getTexture(t,i.Animation),unit:o},gpgpu:{texture:this._getTexture(t,i.GPGPU),unit:h},localTimeOrigin:{texture:this._getTexture(t,i.LocalTimeOrigin),unit:u},visualVariableData:{texture:this._getTexture(t,i.VV),unit:n},dataDriven0:{texture:this._getTexture(t,i.DD0),unit:a},dataDriven1:{texture:this._getTexture(t,i.DD1),unit:r},dataDriven2:{texture:this._getTexture(t,i.DD2),unit:s},size:this.size}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b(1);e.wrapMode=_.CLAMP_TO_EDGE,e.samplingMode=c.NEAREST,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{throwIfNotAbortError as t}from"../../../../core/promiseUtils.js";import e from"./Rect.js";import i from"./RectangleBinPack.js";import{PixelFormat as h,TextureWrapMode as s}from"../../../webgl/enums.js";import{Texture as r}from"../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../webgl/TextureDescriptor.js";const n=256,o=t=>Math.floor(t/256);function c(t){const e=new Set;for(const i of t)e.add(o(i));return e}function l(e,i,h){return e.has(i)||e.set(i,h().then((()=>{e.delete(i)})).catch((h=>{e.delete(i),t(h)}))),e.get(i)}const g=t=>({rect:new e(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:t,sdf:!0});class p{constructor(t,e,h){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=t,this.height=e,this._glyphSource=h,this._binPack=new i(t-4,e-4),this._glyphData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],i=[];for(let r=0;r<t.length;r++){const h=t[r];for(let t=0;t<11;t++){const s=r>=3&&r<5&&t>=3&&t<8?255:0;e.push(h),i.push(s)}}const h={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(e)},s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(i)};this._recordGlyph(h),this._recordGlyph(s)}getTexture(t,e){if(!this._textures[e]){const i=new a;i.pixelFormat=h.ALPHA,i.wrapMode=s.CLAMP_TO_EDGE,i.width=this.width,i.height=this.height,this._textures[e]=new r(t,i,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._glyphData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(t,e,i){const h=this._getGlyphCache(t);return await this._fetchRanges(t,e,i),e.map((e=>this._getMosaicItem(h,t,e)))}bind(t,e,i,h){const s=this.getTexture(t,i);s.setSamplingMode(e),t.bindTexture(s,h)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const i=this._glyphSource.preloadASCIIRange(t).then((()=>{const e=this._getGlyphCache(t);for(let i=0;i<256;i++)this._getMosaicItem(e,t,i)}));return this._preloadCache[t]=i,i}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,i){const h=c(e),s=[];h.forEach((e=>{s.push(this._fetchRange(t,e,i))})),await Promise.all(s)}async _fetchRange(t,e,i){if(e>n)return;const h=t+e;return l(this._rangePromises,h,(()=>this._glyphSource.getRange(t,e,i)))}_getMosaicItem(t,e,i){if(!t[i]){const h=this._glyphSource.getGlyph(e,i);if(!h?.metrics)return g(i);const s=this._recordGlyph(h),r=this._currentPage,a=h.metrics;t[i]={rect:s,page:r,metrics:a,code:i,sdf:!0},this._invalidate()}return t[i]}_recordGlyph(t){const h=t.metrics;let s;if(0===h.width)s=new e(0,0,0,0);else{const e=3,r=h.width+2*e,a=h.height+2*e;s=this._binPack.allocate(r,a),s.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new i(this.width-4,this.height-4),s=this._binPack.allocate(r,a));const n=this._glyphData[this._currentPage],o=t.bitmap;let c,l;if(o)for(let t=0;t<a;t++){c=r*t,l=this.width*(s.y+t)+s.x;for(let t=0;t<r;t++)n[l+t]=o[c+t]}has("esri-glyph-debug")&&this._showDebugPage(n)}return s}_showDebugPage(t){const e=document.createElement("canvas"),i=e.getContext("2d"),h=new ImageData(this.width,this.height),s=h.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let r=0;r<t.length;++r)s[4*r]=t[r],s[4*r+1]=0,s[4*r+2]=0,s[4*r+3]=255;i.putImageData(h,0,0),document.body.appendChild(e)}}export{p as default};
5
+ import has from"../../../../core/has.js";import{throwIfNotAbortError as t}from"../../../../core/promiseUtils.js";import e from"./Rect.js";import i from"./RectangleBinPack.js";import{PixelFormat as h,TextureWrapMode as s}from"../../../webgl/enums.js";import{Texture as r}from"../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../webgl/TextureDescriptor.js";const n=256,o=t=>Math.floor(t/256);function c(t){const e=new Set;for(const i of t)e.add(o(i));return e}function l(e,i,h){return e.has(i)||e.set(i,h().then((()=>{e.delete(i)})).catch((h=>{e.delete(i),t(h)}))),e.get(i)}const g=t=>({rect:new e(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:t,sdf:!0});class p{constructor(t,e,h){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=t,this.height=e,this._glyphSource=h,this._binPack=new i(t-4,e-4),this._glyphData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],i=[];for(let r=0;r<t.length;r++){const h=t[r];for(let t=0;t<11;t++){const s=r>=3&&r<5&&t>=3&&t<8?255:0;e.push(h),i.push(s)}}const h={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(e)},s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(i)};this._recordGlyph(h),this._recordGlyph(s)}getTexture(t,e){if(!this._textures[e]){const i=new a(this.width,this.height);i.pixelFormat=h.ALPHA,i.wrapMode=s.CLAMP_TO_EDGE,this._textures[e]=new r(t,i,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._glyphData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(t,e,i){const h=this._getGlyphCache(t);return await this._fetchRanges(t,e,i),e.map((e=>this._getMosaicItem(h,t,e)))}bind(t,e,i,h){const s=this.getTexture(t,i);s.setSamplingMode(e),t.bindTexture(s,h)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const i=this._glyphSource.preloadASCIIRange(t).then((()=>{const e=this._getGlyphCache(t);for(let i=0;i<256;i++)this._getMosaicItem(e,t,i)}));return this._preloadCache[t]=i,i}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,i){const h=c(e),s=[];h.forEach((e=>{s.push(this._fetchRange(t,e,i))})),await Promise.all(s)}async _fetchRange(t,e,i){if(e>n)return;const h=t+e;return l(this._rangePromises,h,(()=>this._glyphSource.getRange(t,e,i)))}_getMosaicItem(t,e,i){if(!t[i]){const h=this._glyphSource.getGlyph(e,i);if(!h?.metrics)return g(i);const s=this._recordGlyph(h),r=this._currentPage,a=h.metrics;t[i]={rect:s,page:r,metrics:a,code:i,sdf:!0},this._invalidate()}return t[i]}_recordGlyph(t){const h=t.metrics;let s;if(0===h.width)s=new e(0,0,0,0);else{const e=3,r=h.width+2*e,a=h.height+2*e;s=this._binPack.allocate(r,a),s.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new i(this.width-4,this.height-4),s=this._binPack.allocate(r,a));const n=this._glyphData[this._currentPage],o=t.bitmap;let c,l;if(o)for(let t=0;t<a;t++){c=r*t,l=this.width*(s.y+t)+s.x;for(let t=0;t<r;t++)n[l+t]=o[c+t]}has("esri-glyph-debug")&&this._showDebugPage(n)}return s}_showDebugPage(t){const e=document.createElement("canvas"),i=e.getContext("2d"),h=new ImageData(this.width,this.height),s=h.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let r=0;r<t.length;++r)s[4*r]=t[r],s[4*r+1]=0,s[4*r+2]=0,s[4*r+3]=255;i.putImageData(h,0,0),document.body.appendChild(e)}}export{p 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.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Handles.js";import s from"../../../../core/Logger.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{getProjectiveTransform as n}from"../../../../core/perspectiveUtils.js";import{watch as o,when as a,initial as d}from"../../../../core/reactiveUtils.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isVideoElement as p}from"../../../../support/mediaLayerUtils.js";import{AnimatedSymbolRepeatType as u}from"../../../../symbols/cim/enums.js";import{DisplayObject as c}from"../DisplayObject.js";import{play as f}from"./animatedFormats/utils.js";import{TextureWrapMode as w}from"../../../webgl/enums.js";import{Texture as y}from"../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";const v=[1,1],g=l(),R={none:u.None,loop:u.Loop,oscillate:u.Oscillate};function q(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?R[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class _ extends c{constructor(n){super(),this.elementView=n,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=h(),this._handles=new r,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([o((()=>this.elementView.element.opacity),(e=>this.opacity=e),d),o((()=>[this.elementView.coords]),(()=>{this.requestRender()}),d),o((()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions]),(()=>{this._handles.remove("play"),this.texture=i(this.texture),this.requestRender()}),d),a((()=>this.elementView.element.loaded),(()=>{const e=this.elementView.element;this.ready(),p(e)&&null!=e.content&&(this._handles.add([t(e.content,"play",(()=>this.requestRender())),t(e.content,"loadeddata",(()=>this.requestRender())),t(e.content,"loaded",(()=>this.requestRender()))]),"requestVideoFrameCallback"in e.content?e.content.requestVideoFrameCallback((()=>this.requestRender())):this._handles.add([t(e.content,"seeked",(()=>this.requestRender()))]),this.requestRender())}),d)]),n.element.load().catch((t=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:n,error:t}))}))}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=i(this.texture)}get textureSize(){return v}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const e=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,i=e?r.naturalWidth:s?r.videoWidth:r.width,n=e?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(i,n),this.texture){if(s)if(r.readyState>=r.HAVE_CURRENT_DATA)this._updateTextureAndRequestRender(r);else{const e=()=>{this._updateTextureAndRequestRender(r),r.removeEventListener("canplay",e),r.removeEventListener("seeked",e)};r.addEventListener("canplay",e),r.addEventListener("seeked",e)}}else{const e=new x;if(e.wrapMode=w.CLAMP_TO_EDGE,e.preMultiplyAlpha=!0,e.width=i,e.height=n,"getFrame"in r){const s=r=>{this.texture?this.texture.setData(r):this.texture=new y(t,e,r),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.add(f(r,q(this.elementView.element.animationOptions),null,s),"play")}else this.texture=new y(t,e,r);this.texture.generateMipmap(),s&&("requestVideoFrameCallback"in r?r.requestVideoFrameCallback((()=>this.requestRender())):r.paused||this.requestRender())}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),"requestVideoFrameCallback"in e?e.requestVideoFrameCallback((()=>this.requestRender())):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,t){this.isReady&&null!=this.texture?t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:v,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices}):this.requestRender()}updateDrawCoords(e,t,r,s){const{coords:i,bounds:n}=this.elementView;if(null==i||null==n)return;const[o,a,d,l]=i.rings[0],m=this._vertices,{x:h,y:p}=e;m.set([a[0]-h,a[1]-p,o[0]-h,o[1]-p,d[0]-h,d[1]-p,l[0]-h,l[1]-p]);let u=t;if(s){const[e,,t]=n,{worldWidth:r,xBounds:i}=s,[o,a]=i;e<o&&t>o?u=r:t>a&&e<a&&(u=-r)}this.wrapAroundShift=u,this.isWrapAround=0!==u}_updatePerspectiveTransform(e,t){const r=this._vertices;n(g,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),m(this.perspectiveTransform,g[6]/g[8]*e,g[7]/g[8]*t)}}export{_ as default};
5
+ import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Handles.js";import s from"../../../../core/Logger.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{getProjectiveTransform as n}from"../../../../core/perspectiveUtils.js";import{watch as o,when as a,initial as d}from"../../../../core/reactiveUtils.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isVideoElement as p}from"../../../../support/mediaLayerUtils.js";import{AnimatedSymbolRepeatType as u}from"../../../../symbols/cim/enums.js";import{DisplayObject as c}from"../DisplayObject.js";import{play as f}from"./animatedFormats/utils.js";import{TextureWrapMode as w}from"../../../webgl/enums.js";import{Texture as y}from"../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";const v=[1,1],R=l(),g={none:u.None,loop:u.Loop,oscillate:u.Oscillate};function q(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?g[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class _ extends c{constructor(n){super(),this.elementView=n,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=h(),this._handles=new r,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([o((()=>this.elementView.element.opacity),(e=>this.opacity=e),d),o((()=>[this.elementView.coords]),(()=>{this.requestRender()}),d),o((()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions]),(()=>{this._handles.remove("play"),this.texture=i(this.texture),this.requestRender()}),d),a((()=>this.elementView.element.loaded),(()=>{const e=this.elementView.element;this.ready(),p(e)&&null!=e.content&&(this._handles.add([t(e.content,"play",(()=>this.requestRender())),t(e.content,"loadeddata",(()=>this.requestRender())),t(e.content,"loaded",(()=>this.requestRender()))]),"requestVideoFrameCallback"in e.content?e.content.requestVideoFrameCallback((()=>this.requestRender())):this._handles.add([t(e.content,"seeked",(()=>this.requestRender()))]),this.requestRender())}),d)]),n.element.load().catch((t=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:n,error:t}))}))}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=i(this.texture)}get textureSize(){return v}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const e=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,i=e?r.naturalWidth:s?r.videoWidth:r.width,n=e?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(i,n),this.texture){if(s)if(r.readyState>=r.HAVE_CURRENT_DATA)this._updateTextureAndRequestRender(r);else{const e=()=>{this._updateTextureAndRequestRender(r),r.removeEventListener("canplay",e),r.removeEventListener("seeked",e)};r.addEventListener("canplay",e),r.addEventListener("seeked",e)}}else{const e=new x(i,n);if(e.wrapMode=w.CLAMP_TO_EDGE,e.preMultiplyAlpha=!0,"getFrame"in r){const s=r=>{this.texture?this.texture.setData(r):this.texture=new y(t,e,r),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.add(f(r,q(this.elementView.element.animationOptions),null,s),"play")}else this.texture=new y(t,e,r);this.texture.generateMipmap(),s&&("requestVideoFrameCallback"in r?r.requestVideoFrameCallback((()=>this.requestRender())):r.paused||this.requestRender())}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),"requestVideoFrameCallback"in e?e.requestVideoFrameCallback((()=>this.requestRender())):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,t){this.isReady&&null!=this.texture?t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:v,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices}):this.requestRender()}updateDrawCoords(e,t,r,s){const{coords:i,bounds:n}=this.elementView;if(null==i||null==n)return;const[o,a,d,l]=i.rings[0],m=this._vertices,{x:h,y:p}=e;m.set([a[0]-h,a[1]-p,o[0]-h,o[1]-p,d[0]-h,d[1]-p,l[0]-h,l[1]-p]);let u=t;if(s){const[e,,t]=n,{worldWidth:r,xBounds:i}=s,[o,a]=i;e<o&&t>o?u=r:t>a&&e<a&&(u=-r)}this.wrapAroundShift=u,this.isWrapAround=0!==u}_updatePerspectiveTransform(e,t){const r=this._vertices;n(R,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),m(this.perspectiveTransform,R[6]/R[8]*e,R[7]/R[8]*t)}}export{_ 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.34/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 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/projectionUtils.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};
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/projectionUtils.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(i,s);t.wrapMode=d.CLAMP_TO_EDGE,t.preMultiplyAlpha=!0,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.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import{spritePadding as e}from"./definitions.js";import{log2 as i}from"./GeometryUtils.js";import s from"./Rect.js";import a from"./RectangleBinPack.js";import{TextureWrapMode as r}from"../../../webgl/enums.js";import{Texture as o}from"../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../webgl/TextureDescriptor.js";function c(t){return t&&"static"===t.type}class n{constructor(t,e,i=0){this._mosaicPages=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects=new Map,this._spriteCopyQueue=[],this.pixelRatio=1,this._pageWidth=t,this._pageHeight=e,i>0&&(this._maxItemSize=i),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new a(this._pageWidth,this._pageHeight);const s=Math.floor(this._pageWidth),r=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(s*r)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(t){return t>=this._mosaicPages.length?-1:this._mosaicPages[t].size[0]}getHeight(t){return t>=this._mosaicPages.length?-1:this._mosaicPages[t].size[1]}getPageTexture(t){return t<this._mosaicPages.length?this._mosaicPages[t].texture:null}has(t){return this._mosaicRects.has(t)}get itemCount(){return this._mosaicRects.size}getSpriteItem(t){return this._mosaicRects.get(t)}addSpriteItem(t,i,a,r,o,h,n=1,g="Linear",p=.5,m=1){if(this._mosaicRects.has(t))return this._mosaicRects.get(t);let d,u,l;if(c(a))[d,u,l]=this._allocateImage(i[0],i[1]);else{d=new s(0,0,i[0],i[1]),u=this._mosaicPages.length;const t=void 0;this._mosaicPages.push({mosaicsData:a,size:[i[0]+2*e,i[1]+2*e],dirty:!0,texture:t})}if(d.width<=0||d.height<=0)return null;const _={type:"sprite",rect:d,width:i[0],height:i[1],sdf:o,simplePattern:h,rasterizationScale:n,samplingMode:g,sdfPaddingRatio:p,sdfDecodeCoeff:m,page:u};return this._mosaicRects.set(t,_),c(a)&&(has("esri-mosaic-debug")&&this._showDebugSprite(i,a.data),this._copy({rect:d,spriteSize:i,spriteData:a.data,page:u,pageSize:l,repeat:r,sdf:o})),_}hasItemsToProcess(){return 0!==this._spriteCopyQueue.length}processNextItem(){const t=this._spriteCopyQueue.pop();t&&this._copy(t)}getMosaicItemPosition(t){const i=this.getSpriteItem(t),s=i?.rect;if(!s)return null;s.width=i.width,s.height=i.height;const a=i.width,r=i.height,o=e,h=this._mosaicPages[i.page].size;return{size:[i.width,i.height],tl:[(s.x+o)/h[0],(s.y+o)/h[1]],br:[(s.x+o+a)/h[0],(s.y+o+r)/h[1]],page:i.page}}bind(t,e,i=0,s=0){const a=this._mosaicPages[i],r=a.mosaicsData;let o=a.texture;if(o||(o=p(t,a.size),a.texture=o),o.setSamplingMode(e),c(r))t.bindTexture(o,s),a.dirty&&(o.setData(new Uint8Array(r.data.buffer)),o.generateMipmap(),has("esri-mosaic-debug")&&this._showDebugPage(i));else{r.data.loadFrame(o),t.bindTexture(o,s),o.generateMipmap()}a.dirty=!1}getTexture(t,e=0){const i=this._mosaicPages[e],s=i.mosaicsData;let a=i.texture;if(a||(a=p(t,i.size),i.texture=a),c(s))i.dirty&&(a.setData(new Uint8Array(s.data.buffer)),a.generateMipmap(),has("esri-mosaic-debug")&&this._showDebugPage(e));else{s.data.loadFrame(a),a.generateMipmap()}return i.dirty=!1,a}dispose(){this._binPack=null;for(const t of this._mosaicPages){const e=t.texture;e&&e.dispose();const i=t.mosaicsData;if(!c(i)){i.data.destroy()}}this._mosaicPages=null,this._mosaicRects.clear()}static _copyBits(t,e,i,s,a,r,o,h,c,n,g){let p=s*e+i,m=h*r+o;if(g){m-=r;for(let o=-1;o<=n;o++,p=((o+n)%n+s)*e+i,m+=r)for(let e=-1;e<=c;e++)a[m+e]=t[p+(e+c)%c]}else for(let d=0;d<n;d++){for(let e=0;e<c;e++)a[m+e]=t[p+e];p+=e,m+=r}}_copy(i){if(i.page>=this._mosaicPages.length)return;const s=this._mosaicPages[i.page],a=s.mosaicsData;if(!c(s.mosaicsData))throw new t("mapview-invalid-resource","unsuitable data type!");const r=i.spriteData,o=a.data;n._copyBits(r,i.spriteSize[0],0,0,o,i.pageSize[0],i.rect.x+e,i.rect.y+e,i.spriteSize[0],i.spriteSize[1],i.repeat),s.dirty=!0}_allocateImage(t,r){t+=2*e,r+=2*e;const o=Math.max(t,r);if(this._maxItemSize&&this._maxItemSize<o){const e=2**Math.ceil(i(t)),a=2**Math.ceil(i(r)),o=new s(0,0,t,r);return this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(e*a)},size:[e,a],dirty:!0,texture:void 0}),[o,this._mosaicPages.length-1,[e,a]]}const h=this._binPack.allocate(t,r);if(h.width<=0){const e=this._mosaicPages[this._currentPage];return!e.dirty&&c(e.mosaicsData)&&(e.mosaicsData.data=null),this._currentPage=this._mosaicPages.length,this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(this._pageWidth*this._pageHeight)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0}),this._binPack=new a(this._pageWidth,this._pageHeight),this._allocateImage(t,r)}return[h,this._currentPage,[this._pageWidth,this._pageHeight]]}_showDebugSprite([t,e],i){const s=document.createElement("canvas");s.width=t,s.height=e,s.setAttribute("style",`position: absolute; top: ${4+204*g++}px; right: 208px; width: 200px; height: 200px; border: 1px solid black;`);const a=s.getContext("2d"),r=new ImageData(t,e);r.data.set(new Uint8Array(i.buffer)),a.putImageData(r,0,0),document.body.appendChild(s)}_showDebugPage(t){const e=this._mosaicPages[t],{size:[i,s],mosaicsData:a}=e;if(!c(a))return;const r=`mosaicDebugPage${t}`,o=document.getElementById(r)??document.createElement("canvas");o.id=r,o.width=i,o.height=s,o.setAttribute("style",`position: absolute; top: ${4+204*t}px; right: 4px; width: 200px; height: 200px; border: 1px solid black;`);const h=o.getContext("2d"),n=new ImageData(i,s);n.data.set(new Uint8Array(a.data.buffer)),h.putImageData(n,0,0),document.body.appendChild(o)}}let g=0;function p(t,e){const i=new h;return i.width=e[0],i.height=e[1],i.wrapMode=r.CLAMP_TO_EDGE,new o(t,i,null)}export{n as default};
5
+ import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import{spritePadding as e}from"./definitions.js";import{log2 as i}from"./GeometryUtils.js";import s from"./Rect.js";import a from"./RectangleBinPack.js";import{TextureWrapMode as r}from"../../../webgl/enums.js";import{Texture as o}from"../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../webgl/TextureDescriptor.js";function c(t){return t&&"static"===t.type}class n{constructor(t,e,i=0){this._mosaicPages=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects=new Map,this._spriteCopyQueue=[],this.pixelRatio=1,this._pageWidth=t,this._pageHeight=e,i>0&&(this._maxItemSize=i),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new a(this._pageWidth,this._pageHeight);const s=Math.floor(this._pageWidth),r=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(s*r)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(t){return t>=this._mosaicPages.length?-1:this._mosaicPages[t].size[0]}getHeight(t){return t>=this._mosaicPages.length?-1:this._mosaicPages[t].size[1]}getPageTexture(t){return t<this._mosaicPages.length?this._mosaicPages[t].texture:null}has(t){return this._mosaicRects.has(t)}get itemCount(){return this._mosaicRects.size}getSpriteItem(t){return this._mosaicRects.get(t)}addSpriteItem(t,i,a,r,o,h,n=1,g="Linear",p=.5,m=1){if(this._mosaicRects.has(t))return this._mosaicRects.get(t);let d,u,l;if(c(a))[d,u,l]=this._allocateImage(i[0],i[1]);else{d=new s(0,0,i[0],i[1]),u=this._mosaicPages.length;const t=void 0;this._mosaicPages.push({mosaicsData:a,size:[i[0]+2*e,i[1]+2*e],dirty:!0,texture:t})}if(d.width<=0||d.height<=0)return null;const _={type:"sprite",rect:d,width:i[0],height:i[1],sdf:o,simplePattern:h,rasterizationScale:n,samplingMode:g,sdfPaddingRatio:p,sdfDecodeCoeff:m,page:u};return this._mosaicRects.set(t,_),c(a)&&(has("esri-mosaic-debug")&&this._showDebugSprite(i,a.data),this._copy({rect:d,spriteSize:i,spriteData:a.data,page:u,pageSize:l,repeat:r,sdf:o})),_}hasItemsToProcess(){return 0!==this._spriteCopyQueue.length}processNextItem(){const t=this._spriteCopyQueue.pop();t&&this._copy(t)}getMosaicItemPosition(t){const i=this.getSpriteItem(t),s=i?.rect;if(!s)return null;s.width=i.width,s.height=i.height;const a=i.width,r=i.height,o=e,h=this._mosaicPages[i.page].size;return{size:[i.width,i.height],tl:[(s.x+o)/h[0],(s.y+o)/h[1]],br:[(s.x+o+a)/h[0],(s.y+o+r)/h[1]],page:i.page}}bind(t,e,i=0,s=0){const a=this._mosaicPages[i],r=a.mosaicsData;let o=a.texture;if(o||(o=p(t,a.size),a.texture=o),o.setSamplingMode(e),c(r))t.bindTexture(o,s),a.dirty&&(o.setData(new Uint8Array(r.data.buffer)),o.generateMipmap(),has("esri-mosaic-debug")&&this._showDebugPage(i));else{r.data.loadFrame(o),t.bindTexture(o,s),o.generateMipmap()}a.dirty=!1}getTexture(t,e=0){const i=this._mosaicPages[e],s=i.mosaicsData;let a=i.texture;if(a||(a=p(t,i.size),i.texture=a),c(s))i.dirty&&(a.setData(new Uint8Array(s.data.buffer)),a.generateMipmap(),has("esri-mosaic-debug")&&this._showDebugPage(e));else{s.data.loadFrame(a),a.generateMipmap()}return i.dirty=!1,a}dispose(){this._binPack=null;for(const t of this._mosaicPages){const e=t.texture;e&&e.dispose();const i=t.mosaicsData;if(!c(i)){i.data.destroy()}}this._mosaicPages=null,this._mosaicRects.clear()}static _copyBits(t,e,i,s,a,r,o,h,c,n,g){let p=s*e+i,m=h*r+o;if(g){m-=r;for(let o=-1;o<=n;o++,p=((o+n)%n+s)*e+i,m+=r)for(let e=-1;e<=c;e++)a[m+e]=t[p+(e+c)%c]}else for(let d=0;d<n;d++){for(let e=0;e<c;e++)a[m+e]=t[p+e];p+=e,m+=r}}_copy(i){if(i.page>=this._mosaicPages.length)return;const s=this._mosaicPages[i.page],a=s.mosaicsData;if(!c(s.mosaicsData))throw new t("mapview-invalid-resource","unsuitable data type!");const r=i.spriteData,o=a.data;n._copyBits(r,i.spriteSize[0],0,0,o,i.pageSize[0],i.rect.x+e,i.rect.y+e,i.spriteSize[0],i.spriteSize[1],i.repeat),s.dirty=!0}_allocateImage(t,r){t+=2*e,r+=2*e;const o=Math.max(t,r);if(this._maxItemSize&&this._maxItemSize<o){const e=2**Math.ceil(i(t)),a=2**Math.ceil(i(r)),o=new s(0,0,t,r);return this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(e*a)},size:[e,a],dirty:!0,texture:void 0}),[o,this._mosaicPages.length-1,[e,a]]}const h=this._binPack.allocate(t,r);if(h.width<=0){const e=this._mosaicPages[this._currentPage];return!e.dirty&&c(e.mosaicsData)&&(e.mosaicsData.data=null),this._currentPage=this._mosaicPages.length,this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(this._pageWidth*this._pageHeight)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0}),this._binPack=new a(this._pageWidth,this._pageHeight),this._allocateImage(t,r)}return[h,this._currentPage,[this._pageWidth,this._pageHeight]]}_showDebugSprite([t,e],i){const s=document.createElement("canvas");s.width=t,s.height=e,s.setAttribute("style",`position: absolute; top: ${4+204*g++}px; right: 208px; width: 200px; height: 200px; border: 1px solid black;`);const a=s.getContext("2d"),r=new ImageData(t,e);r.data.set(new Uint8Array(i.buffer)),a.putImageData(r,0,0),document.body.appendChild(s)}_showDebugPage(t){const e=this._mosaicPages[t],{size:[i,s],mosaicsData:a}=e;if(!c(a))return;const r=`mosaicDebugPage${t}`,o=document.getElementById(r)??document.createElement("canvas");o.id=r,o.width=i,o.height=s,o.setAttribute("style",`position: absolute; top: ${4+204*t}px; right: 4px; width: 200px; height: 200px; border: 1px solid black;`);const h=o.getContext("2d"),n=new ImageData(i,s);n.data.set(new Uint8Array(a.data.buffer)),h.putImageData(n,0,0),document.body.appendChild(o)}}let g=0;function p(t,e){const i=new h(e[0],e[1]);return i.wrapMode=r.CLAMP_TO_EDGE,new o(t,i,null)}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.34/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{Pos2b as t}from"../DefaultVertexAttributeLayouts.js";import{FeatureTile as r}from"../FeatureTile.js";import o from"./WGLBrush.js";import{background as i}from"../shaders/BackgroundPrograms.js";import{tileInfo as s}from"../shaders/TileInfoPrograms.js";import{BufferObject as n}from"../../../../webgl/BufferObject.js";import{BlendFactor as a,PrimitiveType as l,Usage as f,TextureWrapMode as m,TextureSamplingMode as u}from"../../../../webgl/enums.js";import{createProgram as c}from"../../../../webgl/ProgramTemplate.js";import{Texture as d}from"../../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../../webgl/TextureDescriptor.js";import{VertexArrayObject as g}from"../../../../webgl/VertexArrayObject.js";const _=512,x=512,b=16,p=8,T=(x-2*p)/5;class y extends o{constructor(){super(...arguments),this._color=e(1,0,0,1)}dispose(){this._outlineProgram?.dispose(),this._outlineProgram=null,this._tileInfoProgram?.dispose(),this._tileInfoProgram=null,this._outlineVertexArrayObject?.dispose(),this._outlineVertexArrayObject=null,this._tileInfoVertexArrayObject?.dispose(),this._tileInfoVertexArrayObject=null,this._ctx=null}prepareState({context:e}){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(a.ONE,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1)}draw(e,t){const{context:o,requestRender:i,allowDelayedRender:s}=e;if(!t.isReady&&t instanceof r&&t.hasData)return;if(this._loadWGLResources(o),s&&null!=i&&(!this._outlineProgram.compiled||!this._tileInfoProgram.compiled))return void i();o.bindVAO(this._outlineVertexArrayObject),o.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3),this._outlineProgram.setUniform2f("u_coord_range",t.rangeX,t.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),o.drawArrays(l.LINE_STRIP,0,4);const n=this._getTexture(o,t);n?(o.bindVAO(this._tileInfoVertexArrayObject),o.useProgram(this._tileInfoProgram),o.bindTexture(n,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",t.rangeX/t.width,t.rangeY/t.height),this._tileInfoProgram.setUniform2f("u_delta",0,0),this._tileInfoProgram.setUniform2f("u_dimensions",n.descriptor.width,n.descriptor.height),o.drawArrays(l.TRIANGLE_STRIP,0,4),o.bindVAO()):o.bindVAO()}_loadWGLResources(e){if(this._outlineProgram&&this._tileInfoProgram)return;const r=c(e,i),o=c(e,s),a=new Int8Array([0,0,1,0,1,1,0,1]),l=n.createVertex(e,f.STATIC_DRAW,a),m=new g(e,i.attributes,t,new Map([["geometry",l]])),u=new Int8Array([0,0,1,0,0,1,1,1]),d=n.createVertex(e,f.STATIC_DRAW,u),h=new g(e,s.attributes,t,new Map([["geometry",d]]));this._outlineProgram=r,this._tileInfoProgram=o,this._outlineVertexArrayObject=m,this._tileInfoVertexArrayObject=h}_getTexture(e,t){if(!this._ctx){const e=document.createElement("canvas");e.width=_,e.height=x,this._ctx=e.getContext("2d")}if(!t.tileDebugInfoTexture){const r=new h;r.wrapMode=m.CLAMP_TO_EDGE,r.samplingMode=u.LINEAR,r.isImmutable=!0,r.width=_,r.height=x,t.tileDebugInfoTexture=new d(e,r)}const r=this._ctx;r.clearRect(0,0,r.canvas.width,r.canvas.height),r.textAlign="left",r.textBaseline="top",r.font=b-2+"px sans-serif",r.lineWidth=2,r.fillStyle="white",r.strokeStyle="black";const{debugSlot:o}=t;let i=p+T*o;const s=`${o}) ${t.key.id} (${t.constructor.name})`;r.strokeText(s,p,i),r.fillText(s,p,i),i+=b;const{debugInfo:n}=t;if(n){const{length:e,minOrderedLength:t,minUnorderedLength:o,triangleCount:s}=n.display;if(e>0){const t=`Length: ${e}`;r.strokeText(t,p,i),r.fillText(t,p,i),i+=b}if(t){const e=`Min ordered length: ${t}`;r.strokeText(e,p,i),r.fillText(e,p,i),i+=b}if(o){const e=`Min unordered length: ${o}`;r.strokeText(e,p,i),r.fillText(e,p,i),i+=b}if(s>0){s>1e5&&(r.fillStyle="red",r.strokeStyle="white");const e=`Triangle count: ${s}`;r.strokeText(e,p,i),r.fillText(e,p,i),i+=b}const{bytesUsed:a,bytesReserved:l}=n.memory;if(r.fillStyle="white",r.strokeStyle="black",a>0||l>0){const e=`Memory usage: ${a} of ${l} bytes`;r.strokeText(e,p,i),r.fillText(e,p,i),i+=b}}return t.tileDebugInfoTexture.setData(r.canvas),t.tileDebugInfoTexture}}export{y as default};
5
+ import{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{Pos2b as t}from"../DefaultVertexAttributeLayouts.js";import{FeatureTile as r}from"../FeatureTile.js";import o from"./WGLBrush.js";import{background as i}from"../shaders/BackgroundPrograms.js";import{tileInfo as s}from"../shaders/TileInfoPrograms.js";import{BufferObject as n}from"../../../../webgl/BufferObject.js";import{BlendFactor as a,PrimitiveType as l,Usage as f,TextureWrapMode as m,TextureSamplingMode as u}from"../../../../webgl/enums.js";import{createProgram as c}from"../../../../webgl/ProgramTemplate.js";import{Texture as d}from"../../../../webgl/Texture.js";import{TextureDescriptor as g}from"../../../../webgl/TextureDescriptor.js";import{VertexArrayObject as h}from"../../../../webgl/VertexArrayObject.js";const _=512,x=512,b=16,p=8,T=(x-2*p)/5;class y extends o{constructor(){super(...arguments),this._color=e(1,0,0,1)}dispose(){this._outlineProgram?.dispose(),this._outlineProgram=null,this._tileInfoProgram?.dispose(),this._tileInfoProgram=null,this._outlineVertexArrayObject?.dispose(),this._outlineVertexArrayObject=null,this._tileInfoVertexArrayObject?.dispose(),this._tileInfoVertexArrayObject=null,this._ctx=null}prepareState({context:e}){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(a.ONE,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1)}draw(e,t){const{context:o,requestRender:i,allowDelayedRender:s}=e;if(!t.isReady&&t instanceof r&&t.hasData)return;if(this._loadWGLResources(o),s&&null!=i&&(!this._outlineProgram.compiled||!this._tileInfoProgram.compiled))return void i();o.bindVAO(this._outlineVertexArrayObject),o.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3),this._outlineProgram.setUniform2f("u_coord_range",t.rangeX,t.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),o.drawArrays(l.LINE_STRIP,0,4);const n=this._getTexture(o,t);n?(o.bindVAO(this._tileInfoVertexArrayObject),o.useProgram(this._tileInfoProgram),o.bindTexture(n,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",t.rangeX/t.width,t.rangeY/t.height),this._tileInfoProgram.setUniform2f("u_delta",0,0),this._tileInfoProgram.setUniform2f("u_dimensions",n.descriptor.width,n.descriptor.height),o.drawArrays(l.TRIANGLE_STRIP,0,4),o.bindVAO()):o.bindVAO()}_loadWGLResources(e){if(this._outlineProgram&&this._tileInfoProgram)return;const r=c(e,i),o=c(e,s),a=new Int8Array([0,0,1,0,1,1,0,1]),l=n.createVertex(e,f.STATIC_DRAW,a),m=new h(e,i.attributes,t,new Map([["geometry",l]])),u=new Int8Array([0,0,1,0,0,1,1,1]),d=n.createVertex(e,f.STATIC_DRAW,u),g=new h(e,s.attributes,t,new Map([["geometry",d]]));this._outlineProgram=r,this._tileInfoProgram=o,this._outlineVertexArrayObject=m,this._tileInfoVertexArrayObject=g}_getTexture(e,t){if(!this._ctx){const e=document.createElement("canvas");e.width=_,e.height=x,this._ctx=e.getContext("2d")}if(!t.tileDebugInfoTexture){const r=new g(_,x);r.wrapMode=m.CLAMP_TO_EDGE,r.samplingMode=u.LINEAR,r.isImmutable=!0,t.tileDebugInfoTexture=new d(e,r)}const r=this._ctx;r.clearRect(0,0,r.canvas.width,r.canvas.height),r.textAlign="left",r.textBaseline="top",r.font=b-2+"px sans-serif",r.lineWidth=2,r.fillStyle="white",r.strokeStyle="black";const{debugSlot:o}=t;let i=p+T*o;const s=`${o}) ${t.key.id} (${t.constructor.name})`;r.strokeText(s,p,i),r.fillText(s,p,i),i+=b;const{debugInfo:n}=t;if(n){const{length:e,minOrderedLength:t,minUnorderedLength:o,triangleCount:s}=n.display;if(e>0){const t=`Length: ${e}`;r.strokeText(t,p,i),r.fillText(t,p,i),i+=b}if(t){const e=`Min ordered length: ${t}`;r.strokeText(e,p,i),r.fillText(e,p,i),i+=b}if(o){const e=`Min unordered length: ${o}`;r.strokeText(e,p,i),r.fillText(e,p,i),i+=b}if(s>0){s>1e5&&(r.fillStyle="red",r.strokeStyle="white");const e=`Triangle count: ${s}`;r.strokeText(e,p,i),r.fillText(e,p,i),i+=b}const{bytesUsed:a,bytesReserved:l}=n.memory;if(r.fillStyle="white",r.strokeStyle="black",a>0||l>0){const e=`Memory usage: ${a} of ${l} bytes`;r.strokeText(e,p,i),r.fillText(e,p,i),i+=b}}return t.tileDebugInfoTexture.setData(r.canvas),t.tileDebugInfoTexture}}export{y 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.34/esri/copyright.txt for details.
4
4
  */
5
- import o from"../../../../../../core/Logger.js";import{textureBindingHighlight1 as i,maxHighlightReasons as t}from"../../definitions.js";import{shadeTextureSize as e,sigma as l}from"./parameters.js";import r from"../../../../../support/HighlightOptions.js";import{TextureWrapMode as h}from"../../../../../webgl/enums.js";import{Texture as n}from"../../../../../webgl/Texture.js";import{TextureDescriptor as s}from"../../../../../webgl/TextureDescriptor.js";const a=()=>o.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function u(o,i){i.fillColor[0]=o.color.r/255,i.fillColor[1]=o.color.g/255,i.fillColor[2]=o.color.b/255,i.fillColor[3]=o.color.a,o.haloColor?(i.outlineColor[0]=o.haloColor.r/255,i.outlineColor[1]=o.haloColor.g/255,i.outlineColor[2]=o.haloColor.b/255,i.outlineColor[3]=o.haloColor.a):(i.outlineColor[0]=i.fillColor[0],i.outlineColor[1]=i.fillColor[1],i.outlineColor[2]=i.fillColor[2],i.outlineColor[3]=i.fillColor[3]),i.fillColor[3]*=o.fillOpacity,i.outlineColor[3]*=o.haloOpacity,i.fillColor[0]*=i.fillColor[3],i.fillColor[1]*=i.fillColor[3],i.fillColor[2]*=i.fillColor[3],i.outlineColor[0]*=i.outlineColor[3],i.outlineColor[1]*=i.outlineColor[3],i.outlineColor[2]*=i.outlineColor[3],i.outlineWidth=(1-o.haloBlur)*o.haloWidth,i.outerHaloWidth=o.haloBlur*o.haloWidth/2,i.innerHaloWidth=o.haloBlur*o.haloWidth/2,i.outlinePosition=0}const d=[0,0,0,0];class g{constructor(){this.type="single",this._highlightOptions=new r,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*e),this._minMaxDistance=[0,0]}setHighlightOptions(o){this._highlightOptions=o}applyHighlightOptions(o,t){this._updateGradientTexture(o),o.bindTexture(this._shadeTex,i),t.setUniform2fv("u_minMaxDistance",this._minMaxDistance)}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<<t)-1,activeGradient:this}]}_updateGradientTexture(o){const i=f(this._highlightOptions);if(i===this._optionsShadeTexKey)return;this._optionsShadeTexKey=i,u(this._highlightOptions,this._convertedHighlightOptions);const t=this._convertedHighlightOptions,r=t.outlinePosition-t.outlineWidth/2-t.outerHaloWidth,g=t.outlinePosition-t.outlineWidth/2,p=t.outlinePosition+t.outlineWidth/2,C=t.outlinePosition+t.outlineWidth/2+t.innerHaloWidth,c=Math.sqrt(Math.PI/2)*l,m=Math.abs(r)>c?Math.round(10*(Math.abs(r)-c))/10:0,x=Math.abs(C)>c?Math.round(10*(Math.abs(C)-c))/10:0;let _;m&&!x?a().error("The outer rim of the highlight is "+m+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!m&&x?a().error("The inner rim of the highlight is "+x+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):m&&x&&a().error("The highlight is "+Math.max(m,x)+"px away from the edge of the feature; consider reducing some width values.");const w=[void 0,void 0,void 0,void 0];function T(o,i,t){w[0]=(1-t)*o[0]+t*i[0],w[1]=(1-t)*o[1]+t*i[1],w[2]=(1-t)*o[2]+t*i[2],w[3]=(1-t)*o[3]+t*i[3]}const{_texelData:v}=this;for(let l=0;l<e;++l)_=r+l/(e-1)*(C-r),_<r?(w[0]=0,w[1]=0,w[2]=0,w[3]=0):_<g?T(d,t.outlineColor,(_-r)/(g-r)):_<p?[w[0],w[1],w[2],w[3]]=t.outlineColor:_<C?T(t.outlineColor,t.fillColor,(_-p)/(C-p)):[w[0],w[1],w[2],w[3]]=t.fillColor,v[4*l]=255*w[0],v[4*l+1]=255*w[1],v[4*l+2]=255*w[2],v[4*l+3]=255*w[3];if(this._minMaxDistance[0]=r,this._minMaxDistance[1]=C,!this._shadeTex){const i=new s;i.wrapMode=h.CLAMP_TO_EDGE,i.width=e,i.height=1,this._shadeTex=new n(o,i)}this._shadeTex.updateData(0,0,0,e,1,this._texelData)}}function f(o){return`${o.color};${o.haloColor};${o.haloOpacity};${o.fillOpacity};${o.haloWidth};${o.haloBlur}`}export{g as default};
5
+ import o from"../../../../../../core/Logger.js";import{textureBindingHighlight1 as i,maxHighlightReasons as t}from"../../definitions.js";import{shadeTextureSize as e,sigma as l}from"./parameters.js";import r from"../../../../../support/HighlightOptions.js";import{TextureWrapMode as h}from"../../../../../webgl/enums.js";import{Texture as n}from"../../../../../webgl/Texture.js";import{TextureDescriptor as s}from"../../../../../webgl/TextureDescriptor.js";const a=()=>o.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function u(o,i){i.fillColor[0]=o.color.r/255,i.fillColor[1]=o.color.g/255,i.fillColor[2]=o.color.b/255,i.fillColor[3]=o.color.a,o.haloColor?(i.outlineColor[0]=o.haloColor.r/255,i.outlineColor[1]=o.haloColor.g/255,i.outlineColor[2]=o.haloColor.b/255,i.outlineColor[3]=o.haloColor.a):(i.outlineColor[0]=i.fillColor[0],i.outlineColor[1]=i.fillColor[1],i.outlineColor[2]=i.fillColor[2],i.outlineColor[3]=i.fillColor[3]),i.fillColor[3]*=o.fillOpacity,i.outlineColor[3]*=o.haloOpacity,i.fillColor[0]*=i.fillColor[3],i.fillColor[1]*=i.fillColor[3],i.fillColor[2]*=i.fillColor[3],i.outlineColor[0]*=i.outlineColor[3],i.outlineColor[1]*=i.outlineColor[3],i.outlineColor[2]*=i.outlineColor[3],i.outlineWidth=(1-o.haloBlur)*o.haloWidth,i.outerHaloWidth=o.haloBlur*o.haloWidth/2,i.innerHaloWidth=o.haloBlur*o.haloWidth/2,i.outlinePosition=0}const d=[0,0,0,0];class g{constructor(){this.type="single",this._highlightOptions=new r,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*e),this._minMaxDistance=[0,0]}setHighlightOptions(o){this._highlightOptions=o}applyHighlightOptions(o,t){this._updateGradientTexture(o),o.bindTexture(this._shadeTex,i),t.setUniform2fv("u_minMaxDistance",this._minMaxDistance)}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<<t)-1,activeGradient:this}]}_updateGradientTexture(o){const i=f(this._highlightOptions);if(i===this._optionsShadeTexKey)return;this._optionsShadeTexKey=i,u(this._highlightOptions,this._convertedHighlightOptions);const t=this._convertedHighlightOptions,r=t.outlinePosition-t.outlineWidth/2-t.outerHaloWidth,g=t.outlinePosition-t.outlineWidth/2,p=t.outlinePosition+t.outlineWidth/2,C=t.outlinePosition+t.outlineWidth/2+t.innerHaloWidth,c=Math.sqrt(Math.PI/2)*l,m=Math.abs(r)>c?Math.round(10*(Math.abs(r)-c))/10:0,x=Math.abs(C)>c?Math.round(10*(Math.abs(C)-c))/10:0;let _;m&&!x?a().error("The outer rim of the highlight is "+m+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!m&&x?a().error("The inner rim of the highlight is "+x+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):m&&x&&a().error("The highlight is "+Math.max(m,x)+"px away from the edge of the feature; consider reducing some width values.");const w=[void 0,void 0,void 0,void 0];function T(o,i,t){w[0]=(1-t)*o[0]+t*i[0],w[1]=(1-t)*o[1]+t*i[1],w[2]=(1-t)*o[2]+t*i[2],w[3]=(1-t)*o[3]+t*i[3]}const{_texelData:v}=this;for(let l=0;l<e;++l)_=r+l/(e-1)*(C-r),_<r?(w[0]=0,w[1]=0,w[2]=0,w[3]=0):_<g?T(d,t.outlineColor,(_-r)/(g-r)):_<p?[w[0],w[1],w[2],w[3]]=t.outlineColor:_<C?T(t.outlineColor,t.fillColor,(_-p)/(C-p)):[w[0],w[1],w[2],w[3]]=t.fillColor,v[4*l]=255*w[0],v[4*l+1]=255*w[1],v[4*l+2]=255*w[2],v[4*l+3]=255*w[3];if(this._minMaxDistance[0]=r,this._minMaxDistance[1]=C,!this._shadeTex){const i=new s(e,1);i.wrapMode=h.CLAMP_TO_EDGE,this._shadeTex=new n(o,i)}this._shadeTex.updateData(0,0,0,e,1,this._texelData)}}function f(o){return`${o.color};${o.haloColor};${o.haloOpacity};${o.fillOpacity};${o.haloWidth};${o.haloBlur}`}export{g 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../../../core/maybe.js";import t from"../../VertexStream.js";import{BlendFactor as r,PixelFormat as s,TextureWrapMode as i}from"../../../../../webgl/enums.js";import{Texture as o}from"../../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../../webgl/TextureDescriptor.js";class n{constructor(){this._layerFBOTexture=null,this._size=[0,0],this._programDesc={vsPath:"post-processing/pp",fsPath:"post-processing/filterEffect",attributes:new Map([["a_position",0]])}}dispose(){this._layerFBOTexture=e(this._layerFBOTexture)}draw(e,t,s){const{width:i,height:o}=t;this._createOrResizeResources(e,i,o);const{context:a,painter:n}=e,{materialManager:c}=n,l=this._programDesc,u=this._quad,_=s.colorMatrix;u.bind();const h=this._layerFBOTexture;a.bindFramebuffer(t),t.copyToTexture(0,0,i,o,0,0,h),a.setBlendingEnabled(!1),a.setStencilTestEnabled(!1);const m=c.getProgram(l);a.useProgram(m),a.bindTexture(h,2),m.setUniformMatrix4fv("u_coefficients",_),m.setUniform1i("u_colorTexture",2),u.draw(),a.setBlendingEnabled(!0),a.setBlendFunction(r.ONE,r.ONE_MINUS_SRC_ALPHA),a.setStencilTestEnabled(!0),u.unbind()}_createOrResizeResources(e,r,n){const{context:c}=e;if(!this._layerFBOTexture||this._size[0]!==r||this._size[1]!==n){if(this._size[0]=r,this._size[1]=n,this._layerFBOTexture)this._layerFBOTexture.resize(r,n);else{const e=new a;e.internalFormat=s.RGBA,e.wrapMode=i.CLAMP_TO_EDGE,e.width=r,e.height=n,this._layerFBOTexture=new o(c,e)}this._quad||(this._quad=new t(c,[-1,-1,1,-1,-1,1,1,1]))}}}export{n as Colorize};
5
+ import{disposeMaybe as e}from"../../../../../../core/maybe.js";import t from"../../VertexStream.js";import{BlendFactor as r,PixelFormat as s,TextureWrapMode as i}from"../../../../../webgl/enums.js";import{Texture as o}from"../../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../../webgl/TextureDescriptor.js";class n{constructor(){this._layerFBOTexture=null,this._size=[0,0],this._programDesc={vsPath:"post-processing/pp",fsPath:"post-processing/filterEffect",attributes:new Map([["a_position",0]])}}dispose(){this._layerFBOTexture=e(this._layerFBOTexture)}draw(e,t,s){const{width:i,height:o}=t;this._createOrResizeResources(e,i,o);const{context:a,painter:n}=e,{materialManager:c}=n,l=this._programDesc,u=this._quad,_=s.colorMatrix;u.bind();const h=this._layerFBOTexture;a.bindFramebuffer(t),t.copyToTexture(0,0,i,o,0,0,h),a.setBlendingEnabled(!1),a.setStencilTestEnabled(!1);const m=c.getProgram(l);a.useProgram(m),a.bindTexture(h,2),m.setUniformMatrix4fv("u_coefficients",_),m.setUniform1i("u_colorTexture",2),u.draw(),a.setBlendingEnabled(!0),a.setBlendFunction(r.ONE,r.ONE_MINUS_SRC_ALPHA),a.setStencilTestEnabled(!0),u.unbind()}_createOrResizeResources(e,r,n){const{context:c}=e;if(!this._layerFBOTexture||this._size[0]!==r||this._size[1]!==n){if(this._size[0]=r,this._size[1]=n,this._layerFBOTexture)this._layerFBOTexture.resize(r,n);else{const e=new a(r,n);e.internalFormat=s.RGBA,e.wrapMode=i.CLAMP_TO_EDGE,this._layerFBOTexture=new o(c,e)}this._quad||(this._quad=new t(c,[-1,-1,1,-1,-1,1,1,1]))}}}export{n as Colorize};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../../../core/maybe.js";import{pt2px as t}from"../../../../../../core/screenUtils.js";import r from"../../VertexStream.js";import{BlendFactor as s,PixelFormat as i,TextureWrapMode as o}from"../../../../../webgl/enums.js";import{FramebufferObject as a}from"../../../../../webgl/FramebufferObject.js";import{Texture as n}from"../../../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../../../webgl/TextureDescriptor.js";const u=[1,0],h=[0,1];class _{constructor(){this._layerFBOTexture=null,this._horizontalBlurFBO=null,this._verticalBlurFBO=null,this._size=[0,0],this._quad=null,this._programDesc={blur:{vsPath:"post-processing/pp",fsPath:"post-processing/blur/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/drop-shadow/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){this._layerFBOTexture=e(this._layerFBOTexture),this._horizontalBlurFBO=e(this._horizontalBlurFBO),this._verticalBlurFBO=e(this._verticalBlurFBO)}draw(e,i,o){const{context:a,state:n,painter:l}=e,{materialManager:_}=l,c=this._programDesc,p=i.width,m=i.height,f=[Math.round(p),Math.round(m)],{blurRadius:B,offsetX:d,offsetY:b,color:O}=o,F=[t(d),t(b)];this._createOrResizeResources(e,p,m,f);const w=this._horizontalBlurFBO,T=this._verticalBlurFBO;a.setStencilWriteMask(0),a.setStencilTestEnabled(!1),a.setDepthWriteEnabled(!1),a.setDepthTestEnabled(!1);const x=this._layerFBOTexture;i.copyToTexture(0,0,p,m,0,0,x),this._quad||(this._quad=new r(a,[-1,-1,1,-1,-1,1,1,1])),a.setViewport(0,0,f[0],f[1]);const g=this._quad;g.bind(),a.setBlendingEnabled(!1);const z=_.getProgram(c.blur,[{name:"radius",value:Math.ceil(B)}]);a.useProgram(z),a.bindFramebuffer(w),a.bindTexture(i.colorTexture,4),z.setUniform1i("u_colorTexture",4),z.setUniform2fv("u_texSize",f),z.setUniform2fv("u_direction",u),z.setUniform1f("u_sigma",B),g.draw(),a.bindFramebuffer(T),a.bindTexture(w?.colorTexture,5),z.setUniform1i("u_colorTexture",5),z.setUniform2fv("u_direction",h),g.draw(),a.bindFramebuffer(i),a.setViewport(0,0,p,m);const M=_.getProgram(c.composite);a.useProgram(M),a.bindTexture(T?.colorTexture,2),M.setUniform1i("u_blurTexture",2),a.bindTexture(x,3),M.setUniform1i("u_layerFBOTexture",3),M.setUniform4fv("u_shadowColor",[O[3]*(O[0]/255),O[3]*(O[1]/255),O[3]*(O[2]/255),O[3]]),M.setUniformMatrix3fv("u_displayViewMat3",n.displayMat3),M.setUniform2fv("u_shadowOffset",F),g.draw(),a.setBlendingEnabled(!0),a.setStencilTestEnabled(!0),a.setBlendFunction(s.ONE,s.ONE_MINUS_SRC_ALPHA),g.unbind()}_createOrResizeResources(e,t,r,s){const{context:u}=e;if(!this._horizontalBlurFBO||this._size[0]!==t||this._size[1]!==r){if(this._size[0]=t,this._size[1]=r,this._horizontalBlurFBO)this._horizontalBlurFBO.resize(s[0],s[1]);else{const e=new l(s[0],s[1]);e.internalFormat=i.RGBA,e.wrapMode=o.CLAMP_TO_EDGE,this._horizontalBlurFBO=new a(u,e)}if(this._verticalBlurFBO)this._verticalBlurFBO.resize(s[0],s[1]);else{const e=new l(s[0],s[1]);e.internalFormat=i.RGBA,e.wrapMode=o.CLAMP_TO_EDGE,this._verticalBlurFBO=new a(u,e)}if(this._layerFBOTexture)this._layerFBOTexture.resize(t,r);else{const e=new l;e.internalFormat=i.RGBA,e.wrapMode=o.CLAMP_TO_EDGE,e.width=t,e.height=r,this._layerFBOTexture=new n(u,e)}}}}export{_ as DropShadow};
5
+ import{disposeMaybe as e}from"../../../../../../core/maybe.js";import{pt2px as t}from"../../../../../../core/screenUtils.js";import r from"../../VertexStream.js";import{BlendFactor as s,PixelFormat as i,TextureWrapMode as o}from"../../../../../webgl/enums.js";import{FramebufferObject as a}from"../../../../../webgl/FramebufferObject.js";import{Texture as n}from"../../../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../../../webgl/TextureDescriptor.js";const u=[1,0],h=[0,1];class _{constructor(){this._layerFBOTexture=null,this._horizontalBlurFBO=null,this._verticalBlurFBO=null,this._size=[0,0],this._quad=null,this._programDesc={blur:{vsPath:"post-processing/pp",fsPath:"post-processing/blur/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/drop-shadow/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){this._layerFBOTexture=e(this._layerFBOTexture),this._horizontalBlurFBO=e(this._horizontalBlurFBO),this._verticalBlurFBO=e(this._verticalBlurFBO)}draw(e,i,o){const{context:a,state:n,painter:l}=e,{materialManager:_}=l,c=this._programDesc,p=i.width,m=i.height,f=[Math.round(p),Math.round(m)],{blurRadius:B,offsetX:d,offsetY:b,color:O}=o,F=[t(d),t(b)];this._createOrResizeResources(e,p,m,f);const T=this._horizontalBlurFBO,w=this._verticalBlurFBO;a.setStencilWriteMask(0),a.setStencilTestEnabled(!1),a.setDepthWriteEnabled(!1),a.setDepthTestEnabled(!1);const x=this._layerFBOTexture;i.copyToTexture(0,0,p,m,0,0,x),this._quad||(this._quad=new r(a,[-1,-1,1,-1,-1,1,1,1])),a.setViewport(0,0,f[0],f[1]);const g=this._quad;g.bind(),a.setBlendingEnabled(!1);const z=_.getProgram(c.blur,[{name:"radius",value:Math.ceil(B)}]);a.useProgram(z),a.bindFramebuffer(T),a.bindTexture(i.colorTexture,4),z.setUniform1i("u_colorTexture",4),z.setUniform2fv("u_texSize",f),z.setUniform2fv("u_direction",u),z.setUniform1f("u_sigma",B),g.draw(),a.bindFramebuffer(w),a.bindTexture(T?.colorTexture,5),z.setUniform1i("u_colorTexture",5),z.setUniform2fv("u_direction",h),g.draw(),a.bindFramebuffer(i),a.setViewport(0,0,p,m);const M=_.getProgram(c.composite);a.useProgram(M),a.bindTexture(w?.colorTexture,2),M.setUniform1i("u_blurTexture",2),a.bindTexture(x,3),M.setUniform1i("u_layerFBOTexture",3),M.setUniform4fv("u_shadowColor",[O[3]*(O[0]/255),O[3]*(O[1]/255),O[3]*(O[2]/255),O[3]]),M.setUniformMatrix3fv("u_displayViewMat3",n.displayMat3),M.setUniform2fv("u_shadowOffset",F),g.draw(),a.setBlendingEnabled(!0),a.setStencilTestEnabled(!0),a.setBlendFunction(s.ONE,s.ONE_MINUS_SRC_ALPHA),g.unbind()}_createOrResizeResources(e,t,r,s){const{context:u}=e;if(!this._horizontalBlurFBO||this._size[0]!==t||this._size[1]!==r){if(this._size[0]=t,this._size[1]=r,this._horizontalBlurFBO)this._horizontalBlurFBO.resize(s[0],s[1]);else{const e=new l(s[0],s[1]);e.internalFormat=i.RGBA,e.wrapMode=o.CLAMP_TO_EDGE,this._horizontalBlurFBO=new a(u,e)}if(this._verticalBlurFBO)this._verticalBlurFBO.resize(s[0],s[1]);else{const e=new l(s[0],s[1]);e.internalFormat=i.RGBA,e.wrapMode=o.CLAMP_TO_EDGE,this._verticalBlurFBO=new a(u,e)}if(this._layerFBOTexture)this._layerFBOTexture.resize(t,r);else{const e=new l(t,r);e.internalFormat=i.RGBA,e.wrapMode=o.CLAMP_TO_EDGE,this._layerFBOTexture=new n(u,e)}}}}export{_ as DropShadow};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../../../core/maybe.js";import{TextureSamplingMode as t,PixelFormat as r,TextureWrapMode as s}from"../../../../../webgl/enums.js";import{Texture as i}from"../../../../../webgl/Texture.js";import{TextureDescriptor as o}from"../../../../../webgl/TextureDescriptor.js";class l{constructor(){this._size=[0,0],this._layerFBOTexture=null}dispose(){this._layerFBOTexture=e(this._layerFBOTexture)}draw(e,r,s){const{width:i,height:o}=r;this._createOrResizeResources(e,i,o);const{context:l,painter:a}=e,{amount:n}=s,h=l.gl,u=this._layerFBOTexture;l.bindFramebuffer(r),r.copyToTexture(0,0,i,o,0,0,u),l.setBlendingEnabled(!0),l.setStencilTestEnabled(!1),l.setDepthTestEnabled(!1),l.setClearColor(0,0,0,0),l.clear(h.COLOR_BUFFER_BIT),a.blitTexture(l,u,t.NEAREST,n)}_createOrResizeResources(e,l,a){const{context:n}=e;if(!this._layerFBOTexture||this._size[0]!==l||this._size[1]!==a)if(this._size[0]=l,this._size[1]=a,this._layerFBOTexture)this._layerFBOTexture.resize(l,a);else{const e=new o;e.internalFormat=r.RGBA,e.wrapMode=s.CLAMP_TO_EDGE,e.samplingMode=t.NEAREST,e.width=l,e.height=a,this._layerFBOTexture=new i(n,e)}}}export{l as Opacity};
5
+ import{disposeMaybe as e}from"../../../../../../core/maybe.js";import{TextureSamplingMode as t,PixelFormat as r,TextureWrapMode as s}from"../../../../../webgl/enums.js";import{Texture as i}from"../../../../../webgl/Texture.js";import{TextureDescriptor as o}from"../../../../../webgl/TextureDescriptor.js";class l{constructor(){this._size=[0,0],this._layerFBOTexture=null}dispose(){this._layerFBOTexture=e(this._layerFBOTexture)}draw(e,r,s){const{width:i,height:o}=r;this._createOrResizeResources(e,i,o);const{context:l,painter:a}=e,{amount:n}=s,u=l.gl,T=this._layerFBOTexture;l.bindFramebuffer(r),r.copyToTexture(0,0,i,o,0,0,T),l.setBlendingEnabled(!0),l.setStencilTestEnabled(!1),l.setDepthTestEnabled(!1),l.setClearColor(0,0,0,0),l.clear(u.COLOR_BUFFER_BIT),a.blitTexture(l,T,t.NEAREST,n)}_createOrResizeResources(e,l,a){const{context:n}=e;if(!this._layerFBOTexture||this._size[0]!==l||this._size[1]!==a)if(this._size[0]=l,this._size[1]=a,this._layerFBOTexture)this._layerFBOTexture.resize(l,a);else{const e=new o(l,a);e.internalFormat=r.RGBA,e.wrapMode=s.CLAMP_TO_EDGE,e.samplingMode=t.NEAREST,this._layerFBOTexture=new i(n,e)}}}export{l as Opacity};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{simplePipelineState as e}from"../../utils.js";import{Technique as t}from"../Technique.js";import{TechniqueType as r}from"../TechniqueType.js";import{BlendShader as s}from"../shaders/BlendShader.js";import{OpacityShader as i}from"../shaders/OpacityShader.js";import{BlendFactor as u,PixelFormat as o,TextureWrapMode as n}from"../../../../../../webgl/enums.js";import{Texture as a}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../../../../webgl/TextureDescriptor.js";class f extends t{constructor(){super(...arguments),this.type=r.Blend,this._backBufferTexture=null,this.shaders={blend:new s,opacity:new i}}shutdown(){super.shutdown(),null!==this._backBufferTexture&&(this._backBufferTexture.dispose(),this._backBufferTexture=null)}render(t,r){const{context:s,state:i,pixelRatio:o,inFadeTransition:n,painter:a}=t,{size:c}=i,f=s.getBoundFramebufferObject();let h,l;null!=f?(h=f.width,l=f.height):(h=Math.round(o*c[0]),l=Math.round(o*c[1]));const{blendMode:d}=r;if("normal"===d){const t={shader:this.shaders.opacity,uniforms:{config:{layerTexture:{texture:r.colorTexture,unit:0},opacity:r.config.opacity}},defines:null,optionalAttributes:null,useComputeBuffer:!1};return a.setPipelineState(e),void a.submitDrawMesh(s,t,a.quadMesh)}const p=this._createOrResizeTexture(t,h,l);f.copyToTexture(0,0,h,l,0,0,p);const x={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:u.ONE,dstRGB:u.ZERO,srcAlpha:u.ONE,dstAlpha:u.ZERO}},depth:!1,stencil:!1};a.setPipelineState(x);const b={backbufferTexture:{texture:p,unit:0},layerTexture:{texture:r.colorTexture,unit:1},inFadeOpacity:n?1:0,...r.config},T={shader:this.shaders.blend,uniforms:{config:b},defines:{blendMode:d},optionalAttributes:null,useComputeBuffer:!1};a.submitDrawMesh(s,T,a.quadMesh)}_createOrResizeTexture(e,t,r){const{context:s}=e;if(null!==this._backBufferTexture&&this._backBufferTexture.descriptor?.width===t&&this._backBufferTexture.descriptor?.height===r)return this._backBufferTexture;if(null===this._backBufferTexture){const e=new c;e.internalFormat=o.RGBA,e.wrapMode=n.CLAMP_TO_EDGE,e.width=t,e.height=r,this._backBufferTexture=new a(s,e)}else this._backBufferTexture.resize(t,r);return this._backBufferTexture}}export{f as BlendTechnique};
5
+ import{simplePipelineState as e}from"../../utils.js";import{Technique as t}from"../Technique.js";import{TechniqueType as r}from"../TechniqueType.js";import{BlendShader as s}from"../shaders/BlendShader.js";import{OpacityShader as u}from"../shaders/OpacityShader.js";import{BlendFactor as i,PixelFormat as o,TextureWrapMode as n}from"../../../../../../webgl/enums.js";import{Texture as a}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../../../../webgl/TextureDescriptor.js";class f extends t{constructor(){super(...arguments),this.type=r.Blend,this._backBufferTexture=null,this.shaders={blend:new s,opacity:new u}}shutdown(){super.shutdown(),null!==this._backBufferTexture&&(this._backBufferTexture.dispose(),this._backBufferTexture=null)}render(t,r){const{context:s,state:u,pixelRatio:o,inFadeTransition:n,painter:a}=t,{size:c}=u,f=s.getBoundFramebufferObject();let l,h;null!=f?(l=f.width,h=f.height):(l=Math.round(o*c[0]),h=Math.round(o*c[1]));const{blendMode:d}=r;if("normal"===d){const t={shader:this.shaders.opacity,uniforms:{config:{layerTexture:{texture:r.colorTexture,unit:0},opacity:r.config.opacity}},defines:null,optionalAttributes:null,useComputeBuffer:!1};return a.setPipelineState(e),void a.submitDrawMesh(s,t,a.quadMesh)}const p=this._createOrResizeTexture(t,l,h);f.copyToTexture(0,0,l,h,0,0,p);const x={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:i.ONE,dstRGB:i.ZERO,srcAlpha:i.ONE,dstAlpha:i.ZERO}},depth:!1,stencil:!1};a.setPipelineState(x);const b={backbufferTexture:{texture:p,unit:0},layerTexture:{texture:r.colorTexture,unit:1},inFadeOpacity:n?1:0,...r.config},T={shader:this.shaders.blend,uniforms:{config:b},defines:{blendMode:d},optionalAttributes:null,useComputeBuffer:!1};a.submitDrawMesh(s,T,a.quadMesh)}_createOrResizeTexture(e,t,r){const{context:s}=e;if(null!==this._backBufferTexture&&this._backBufferTexture.descriptor?.width===t&&this._backBufferTexture.descriptor?.height===r)return this._backBufferTexture;if(null===this._backBufferTexture){const e=new c(t,r);e.internalFormat=o.RGBA,e.wrapMode=n.CLAMP_TO_EDGE,this._backBufferTexture=new a(s,e)}else this._backBufferTexture.resize(t,r);return this._backBufferTexture}}export{f as BlendTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{TextureSamplingMode as o,TextureWrapMode as r,SizedDepthStencilFormat as i,DataType as n,PrimitiveType as h,PixelType as d}from"../../../../../../webgl/enums.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../../../../webgl/TextureDescriptor.js";const p={pos:{count:2,type:n.UNSIGNED_SHORT}};class f{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,n=e,h=new m(s,n);h.samplingMode=o.NEAREST,h.wrapMode=r.CLAMP_TO_EDGE;const d=new l(t,new _(i.DEPTH24_STENCIL8,s,n));this._dotFBO=new u(t,h,d)}return this._dotFBO}getDotDensityMesh(t){if(null==this._dotMesh){const o=e,r=o*o,i=2,n=new Int16Array(r*i);for(let t=0;t<o;t++)for(let e=0;e<o;e++)n[i*(e+t*o)]=e,n[i*(e+t*o)+1]=t;this._dotMesh=s.create(t,{primitive:h.POINTS,vertex:n,count:r,layout:p})}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const r=new Float32Array(e*e*4);for(let o=0;o<r.length;o++)r[o]=s.getFloat();const i=new m;return i.dataType=d.FLOAT,i.samplingMode=o.NEAREST,i.width=e,i.height=e,new T(t,i,r)}}export{f as DotDensityResources};
5
+ import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{TextureSamplingMode as o,TextureWrapMode as r,SizedDepthStencilFormat as i,DataType as n,PrimitiveType as d,PixelType as h}from"../../../../../../webgl/enums.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../../../../webgl/TextureDescriptor.js";const p={pos:{count:2,type:n.UNSIGNED_SHORT}};class f{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,n=e,d=new m(s,n);d.samplingMode=o.NEAREST,d.wrapMode=r.CLAMP_TO_EDGE;const h=new l(t,new _(i.DEPTH24_STENCIL8,s,n));this._dotFBO=new u(t,d,h)}return this._dotFBO}getDotDensityMesh(t){if(null==this._dotMesh){const o=e,r=o*o,i=2,n=new Int16Array(r*i);for(let t=0;t<o;t++)for(let e=0;e<o;e++)n[i*(e+t*o)]=e,n[i*(e+t*o)+1]=t;this._dotMesh=s.create(t,{primitive:d.POINTS,vertex:n,count:r,layout:p})}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const r=new Float32Array(e*e*4);for(let o=0;o<r.length;o++)r[o]=s.getFloat();const i=new m(e);return i.dataType=h.FLOAT,i.samplingMode=o.NEAREST,new T(t,i,r)}}export{f as DotDensityResources};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as e}from"../../../../../../../core/mathUtils.js";import{disposeMaybe as t}from"../../../../../../../core/maybe.js";import{isSVG as i}from"../../../../../../../core/urlUtils.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{TechniqueType as o}from"../TechniqueType.js";import{MagnifierShader as a}from"../shaders/MagnifierShader.js";import{PixelFormat as n,TextureWrapMode as u,TextureSamplingMode as h}from"../../../../../../webgl/enums.js";import{Texture as l}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../../../../webgl/TextureDescriptor.js";class p extends s{constructor(){super(...arguments),this.type=o.Magnifier,this._resourcePixelRatio=1,this._position=[0,0,0,0],this.shaders={magnifier:new a}}updateResources(t,i,r,s){t.pixelRatio!==this._resourcePixelRatio&&this._destroyResources(),this._readbackTexture||this._initializeResources(t,i,r,s);const{context:o,pixelRatio:a}=t,{factor:n,offset:u,position:h}=s,{size:l}=t.state,c=s.size*a,p=1/n,x=Math.ceil(p*c);this._readbackTexture.resize(x,x);const m=a*l[0],d=a*l[1],_=.5*x,T=.5*x,f=e(a*h.x,_,m-_-1),g=e(d-a*h.y,T,d-T-1),R=f-_,b=g-T,w=this._readbackTexture;o.bindTexture(w,0),o.gl.copyTexImage2D(w.descriptor.target,0,w.descriptor.pixelFormat,R,b,x,x,0);const y=(f+u.x*a)/m*2-1,k=(g-u.y*a)/d*2-1,M=c/m*2,j=c/d*2;this._position[0]=y,this._position[1]=k,this._position[2]=M,this._position[3]=j}render(e,t){const{context:i,painter:s}=e;s.setPipelineState(r);const o={readbackTexture:{texture:this._readbackTexture,unit:0},maskTexture:{texture:this._maskTexture,unit:7},overlayTexture:{texture:this._overlayTexture,unit:6},drawPos:this._position,...t};s.submitDrawMesh(i,{shader:this.shaders.magnifier,uniforms:{config:o},defines:null,optionalAttributes:null,useComputeBuffer:!1},s.quadMesh)}shutdown(){this._destroyResources()}_initializeResources(e,t,r,s){const o=e.context;this._resourcePixelRatio=e.pixelRatio;const a=Math.ceil(s.size*e.pixelRatio);r.width=a,r.height=a;const p=new c;p.internalFormat=n.RGBA,p.wrapMode=u.CLAMP_TO_EDGE,p.samplingMode=h.NEAREST,p.flipped=!0,p.preMultiplyAlpha=!i(r.src)||!e.context.driverTest.svgPremultipliesAlpha.result,this._overlayTexture=new l(o,p,r),t.width=a,t.height=a,p.pixelFormat=p.internalFormat=n.ALPHA,this._maskTexture=new l(o,p,t);const x=1/s.factor;p.pixelFormat=p.internalFormat=n.RGBA,p.width=p.height=Math.ceil(x*a),p.samplingMode=h.LINEAR,p.flipped=!1,this._readbackTexture=new l(o,p)}_destroyResources(){t(this._maskTexture),t(this._overlayTexture),t(this._readbackTexture),this._maskTexture=null,this._overlayTexture=null,this._readbackTexture=null}}export{p as MagnifierTechnique};
5
+ import{clamp as e}from"../../../../../../../core/mathUtils.js";import{disposeMaybe as t}from"../../../../../../../core/maybe.js";import{isSVG as i}from"../../../../../../../core/urlUtils.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{TechniqueType as o}from"../TechniqueType.js";import{MagnifierShader as a}from"../shaders/MagnifierShader.js";import{PixelFormat as u,TextureWrapMode as n,TextureSamplingMode as l}from"../../../../../../webgl/enums.js";import{Texture as h}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../../../../webgl/TextureDescriptor.js";class c extends s{constructor(){super(...arguments),this.type=o.Magnifier,this._resourcePixelRatio=1,this._position=[0,0,0,0],this.shaders={magnifier:new a}}updateResources(t,i,r,s){t.pixelRatio!==this._resourcePixelRatio&&this._destroyResources(),this._readbackTexture||this._initializeResources(t,i,r,s);const{context:o,pixelRatio:a}=t,{factor:u,offset:n,position:l}=s,{size:h}=t.state,p=s.size*a,c=1/u,x=Math.ceil(c*p);this._readbackTexture.resize(x,x);const m=a*h[0],d=a*h[1],_=.5*x,T=.5*x,f=e(a*l.x,_,m-_-1),R=e(d-a*l.y,T,d-T-1),g=f-_,b=R-T,y=this._readbackTexture;o.bindTexture(y,0),o.gl.copyTexImage2D(y.descriptor.target,0,y.descriptor.pixelFormat,g,b,x,x,0);const w=(f+n.x*a)/m*2-1,k=(R-n.y*a)/d*2-1,M=p/m*2,j=p/d*2;this._position[0]=w,this._position[1]=k,this._position[2]=M,this._position[3]=j}render(e,t){const{context:i,painter:s}=e;s.setPipelineState(r);const o={readbackTexture:{texture:this._readbackTexture,unit:0},maskTexture:{texture:this._maskTexture,unit:7},overlayTexture:{texture:this._overlayTexture,unit:6},drawPos:this._position,...t};s.submitDrawMesh(i,{shader:this.shaders.magnifier,uniforms:{config:o},defines:null,optionalAttributes:null,useComputeBuffer:!1},s.quadMesh)}shutdown(){this._destroyResources()}_initializeResources(e,t,r,s){const o=e.context;this._resourcePixelRatio=e.pixelRatio;const a=Math.ceil(s.size*e.pixelRatio);r.width=a,r.height=a;const c=new p(Math.ceil(a/s.factor));c.internalFormat=u.RGBA,c.wrapMode=n.CLAMP_TO_EDGE,c.samplingMode=l.NEAREST,c.flipped=!0,c.preMultiplyAlpha=!i(r.src)||!e.context.driverTest.svgPremultipliesAlpha.result,this._overlayTexture=new h(o,c,r),t.width=a,t.height=a,c.pixelFormat=c.internalFormat=u.ALPHA,this._maskTexture=new h(o,c,t),c.pixelFormat=c.internalFormat=u.RGBA,c.samplingMode=l.LINEAR,c.flipped=!1,this._readbackTexture=new h(o,c)}_destroyResources(){t(this._maskTexture),t(this._overlayTexture),t(this._readbackTexture),this._maskTexture=null,this._overlayTexture=null,this._readbackTexture=null}}export{c as MagnifierTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{SizedPixelFormat as e,TextureSamplingMode as r,PixelType as t,TextureWrapMode as n}from"../../../../../../../webgl/enums.js";import{FramebufferObject as o}from"../../../../../../../webgl/FramebufferObject.js";import{Texture as m}from"../../../../../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../../../../../webgl/TextureDescriptor.js";function s(o,m){const s=new i;return s.width=o,s.height=m,s.internalFormat=e.RGBA32F,s.samplingMode=r.NEAREST,s.dataType=t.FLOAT,s.isImmutable=!0,s.wrapMode=n.CLAMP_TO_EDGE,s}function u(e,r,t){const n=s(r,t);return new m(e,n)}function a(e,r,t){const n=s(r,t);return new o(e,n)}export{a as createNewFBO,u as createProcessedTexture};
5
+ import{SizedPixelFormat as e,TextureSamplingMode as r,PixelType as t,TextureWrapMode as n}from"../../../../../../../webgl/enums.js";import{FramebufferObject as o}from"../../../../../../../webgl/FramebufferObject.js";import{Texture as m}from"../../../../../../../webgl/Texture.js";import{TextureDescriptor as s}from"../../../../../../../webgl/TextureDescriptor.js";function u(o,m){const u=new s(o,m);return u.internalFormat=e.RGBA32F,u.samplingMode=r.NEAREST,u.dataType=t.FLOAT,u.isImmutable=!0,u.wrapMode=n.CLAMP_TO_EDGE,u}function i(e,r,t){const n=u(r,t);return new m(e,n)}function a(e,r,t){const n=u(r,t);return new o(e,n)}export{a as createNewFBO,i as createProcessedTexture};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import r from"../../../Graphic.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as s,initial as l}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/GraphicsLayer.js";import m from"../../../layers/support/TelemetryDisplay.js";import y from"../../../symbols/SimpleFillSymbol.js";import h from"../../../symbols/SimpleLineSymbol.js";import p from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolRotation as c,applyCIMSymbolColor as b}from"../../../symbols/support/cimSymbolUtils.js";import{symbolTypes as u}from"../../../symbols/support/typeUtils.js";import f from"../engine/webgl/OverlayContainer.js";import d from"../engine/webgl/OverlayMultipoint.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import S from"./graphics/GraphicContainer.js";import _ from"./graphics/GraphicsView2D.js";import C from"../../layers/LayerView.js";const L=new t([255,127,0]),v=10005;let T=class extends(g(C)){constructor(){super(...arguments),this._graphicsLayer=new n,this._frameOutlineGraphic=new r({symbol:new y({outline:{type:"simple-line",color:L}})}),this._frameCenterGraphic=new r({symbol:new p({color:L,style:"cross"})}),this._sensorTrailGraphic=new r({symbol:new h({color:L})}),this._sensorSightlineGraphic=new r({symbol:new h({color:L})}),this._sensorLocationGraphic=new r({symbol:new p({color:L})}),this._overlayContainer=null,this._sensorLocationSymbolType=null,this.layer=null,this.sensorLocationSymbol=null,this.symbolAngle=0,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=i(this._graphicsLayer)}initialize(){this._sensorLocationSymbolType=this.layer?.sensorSymbol.type,this._graphicsLayer.graphics.addMany([this._frameCenterGraphic,this._frameOutlineGraphic,this._sensorLocationGraphic,this._sensorSightlineGraphic,this._sensorTrailGraphic]),this.visibleTelemetryElements=new m({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new f,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new _({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new S(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([s((()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight]),(()=>this._updateVisibleTelemetryElements()),l),s((()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight]),(()=>this._updateGraphicGeometries()),l),s((()=>this.layer.metadata),(()=>this._updateSensorLocationSymbolAngle()),l),s((()=>this.layer?.frameCenterSymbol),(()=>this._updateFrameCenterSymbol()),l),s((()=>this.layer?.frameOutlineSymbol),(()=>this._updateFrameOutlineSymbol()),l),s((()=>this.layer?.sensorSightLineSymbol),(()=>this._updateSensorSightlineSymbol()),l),s((()=>this.layer?.sensorSymbol),(()=>this._updateSensorLocationSymbol()),l),s((()=>this.layer?.sensorTrailSymbol),(()=>this._updateSensorTrailSymbol()),l),s((()=>this.layer?.telemetryColor),(()=>this._updateTelemetryColor()),l)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=i(this.graphicsView)}supportsSpatialReference(e){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:t}=this;e&&t&&(t.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&e.lineOfSight?this._sensorSightlineGraphic.geometry=this.layer.telemetry.lineOfSight:this._sensorSightlineGraphic.geometry=null,t.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}_updateSensorLocationSymbolAngle(){if(!this.layer?.metadata?.size||!this._sensorLocationGraphic.symbol)return;const e=this.layer?.metadata?.get(v);if(!e?.value||"number"!=typeof e?.value)return;this.symbolAngle=Math.round(e?.value);const t=this._sensorLocationGraphic.symbol.clone();"simple-marker"===t.type||"picture-marker"===t.type?t.angle=this.symbolAngle:"cim"===t.type&&c(t,this.symbolAngle,!0),this._sensorLocationGraphic.symbol=t}_updateSensorLocationSymbolColor(){if(!this._sensorLocationGraphic?.symbol)return;const e=this._sensorLocationGraphic.symbol.clone();"simple-marker"===e.type?(e.color=this.layer?.telemetryColor||L,e.outline.color=this.layer.telemetryColor):"picture-marker"===e.type?e.color=this.layer?.telemetryColor||L:"cim"===e.type&&(e.color=this.layer?.telemetryColor||L,e?.color&&b(e,e.color||L)),this._sensorLocationGraphic.symbol=e.clone()}_updateTelemetryColor(){this._frameOutlineGraphic.symbol.outline.color=this.layer?.telemetryColor||L,this._sensorTrailGraphic.symbol.color=this.layer?.telemetryColor||L,this._sensorSightlineGraphic.symbol.color=this.layer?.telemetryColor||L,this._frameCenterGraphic.symbol.color=this.layer?.telemetryColor||L,this._updateSensorLocationSymbolColor()}_updateSensorLocationSymbol(){switch(this._sensorLocationSymbolType){case"simple-marker":case"picture-marker":case"cim":this.sensorLocationSymbol=this.layer.sensorSymbol,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol}}_updateFrameCenterSymbol(){this.layer?.frameCenterSymbol&&(this._frameCenterGraphic.symbol=this.layer.frameCenterSymbol.clone())}_updateFrameOutlineSymbol(){this.layer?.frameOutlineSymbol&&(this._frameOutlineGraphic.symbol=this.layer.frameOutlineSymbol.clone())}_updateSensorSightlineSymbol(){this.layer?.sensorSightLineSymbol&&(this._sensorSightlineGraphic.symbol=this.layer.sensorSightLineSymbol.clone())}_updateSensorTrailSymbol(){this.layer?.sensorTrailSymbol&&(this._sensorTrailGraphic.symbol=this.layer.sensorTrailSymbol.clone())}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const e=new d(this.layer.videoElement);this.addAttachHandles([s((()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints,this.layer.frameOpacity]),(()=>{const{visibleTelemetryElements:t}=this;e.frameHorizonPoints=this.layer.frameHorizonPoints,e.groundControlPoints=this.layer.groundControlPoints,e.opacity=this.layer.frameOpacity,e.visible=t?.frame??!1}),l)]),this._overlayContainer.addChild(e),this.view.stage.requestRender()}};e([o()],T.prototype,"graphicsView",void 0),e([o()],T.prototype,"layer",void 0),e([o({types:u})],T.prototype,"sensorLocationSymbol",void 0),e([o()],T.prototype,"symbolAngle",void 0),e([o({type:m})],T.prototype,"visibleTelemetryElements",void 0),T=e([a("esri.views.2d.layers.VideoLayerView2D")],T);const G=T;export{G as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import r from"../../../Graphic.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as s,initial as l}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/GraphicsLayer.js";import m from"../../../layers/support/TelemetryDisplay.js";import y from"../../../symbols/SimpleFillSymbol.js";import h from"../../../symbols/SimpleLineSymbol.js";import p from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolRotation as c,applyCIMSymbolColor as b}from"../../../symbols/support/cimSymbolUtils.js";import{symbolTypes as u}from"../../../symbols/support/typeUtils.js";import f from"../engine/webgl/OverlayContainer.js";import d from"../engine/webgl/OverlayMultipoint.js";import{LayerView2DMixin as g}from"./LayerView2D.js";import S from"./graphics/GraphicContainer.js";import _ from"./graphics/GraphicsView2D.js";import C from"../../layers/LayerView.js";const L=new t([255,127,0]),v=10005;let T=class extends(g(C)){constructor(){super(...arguments),this._graphicsLayer=new n,this._frameOutlineGraphic=new r({symbol:new y({outline:{type:"simple-line",color:L}})}),this._frameCenterGraphic=new r({symbol:new p({color:L,style:"cross"})}),this._sensorTrailGraphic=new r({symbol:new h({color:L})}),this._sensorSightlineGraphic=new r({symbol:new h({color:L})}),this._sensorLocationGraphic=new r({symbol:new p({color:L})}),this._overlayContainer=null,this._sensorLocationSymbolType=null,this.layer=null,this.sensorLocationSymbol=null,this.symbolAngle=0,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=i(this._graphicsLayer)}initialize(){this._sensorLocationSymbolType=this.layer?.sensorSymbol.type,this._graphicsLayer.graphics.addMany([this._frameCenterGraphic,this._frameOutlineGraphic,this._sensorLocationGraphic,this._sensorSightlineGraphic,this._sensorTrailGraphic]),this.visibleTelemetryElements=new m({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new f,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new _({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new S(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([s((()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight]),(()=>this._updateVisibleTelemetryElements()),l),s((()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight]),(()=>this._updateGraphicGeometries()),l),s((()=>this.layer.metadata),(()=>this._updateSensorLocationSymbolAngle()),l),s((()=>this.layer?.frameCenterSymbol),(()=>this._updateFrameCenterSymbol()),l),s((()=>this.layer?.frameOutlineSymbol),(()=>this._updateFrameOutlineSymbol()),l),s((()=>this.layer?.sensorSightLineSymbol),(()=>this._updateSensorSightlineSymbol()),l),s((()=>this.layer?.sensorSymbol),(()=>this._updateSensorLocationSymbol()),l),s((()=>this.layer?.sensorTrailSymbol),(()=>this._updateSensorTrailSymbol()),l),s((()=>this.layer?.telemetryColor),(()=>this._updateTelemetryColor()),l)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=i(this.graphicsView)}supportsSpatialReference(e){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:t}=this;e&&t&&(t.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&e.lineOfSight?this._sensorSightlineGraphic.geometry=this.layer.telemetry.lineOfSight:this._sensorSightlineGraphic.geometry=null,t.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}_updateSensorLocationSymbolAngle(){if(!this.layer?.metadata?.size||!this._sensorLocationGraphic.symbol)return;const e=this.layer?.metadata?.get(v);if(!e?.value||"number"!=typeof e?.value)return;this.symbolAngle=Math.round(e?.value);const t=this._sensorLocationGraphic.symbol.clone();"simple-marker"===t.type||"picture-marker"===t.type?t.angle=this.symbolAngle:"cim"===t.type&&c(t,this.symbolAngle,!0),this._sensorLocationGraphic.symbol=t}_updateSensorLocationSymbolColor(){if(!this._sensorLocationGraphic?.symbol)return;const e=this._sensorLocationGraphic.symbol.clone();"simple-marker"===e.type?(e.color=this.layer?.telemetryColor||L,e.outline.color=this.layer.telemetryColor):"picture-marker"===e.type?e.color=this.layer?.telemetryColor||L:"cim"===e.type&&(e.color=this.layer?.telemetryColor||L,e?.color&&b(e,e.color||L)),this._sensorLocationGraphic.symbol=e.clone()}_updateTelemetryColor(){this._frameOutlineGraphic.symbol.outline.color=this.layer?.telemetryColor||L,this._sensorTrailGraphic.symbol.color=this.layer?.telemetryColor||L,this._sensorSightlineGraphic.symbol.color=this.layer?.telemetryColor||L,this._frameCenterGraphic.symbol.color=this.layer?.telemetryColor||L,this._updateSensorLocationSymbolColor()}_updateSensorLocationSymbol(){switch(this._sensorLocationSymbolType){case"simple-marker":case"picture-marker":case"cim":this.sensorLocationSymbol=this.layer.sensorSymbol,this._sensorLocationGraphic.symbol=this.sensorLocationSymbol}}_updateFrameCenterSymbol(){this.layer?.frameCenterSymbol&&(this._frameCenterGraphic.symbol=this.layer.frameCenterSymbol.clone())}_updateFrameOutlineSymbol(){this.layer?.frameOutlineSymbol&&(this._frameOutlineGraphic.symbol=this.layer.frameOutlineSymbol.clone())}_updateSensorSightlineSymbol(){this.layer?.sensorSightLineSymbol&&(this._sensorSightlineGraphic.symbol=this.layer.sensorSightLineSymbol.clone())}_updateSensorTrailSymbol(){this.layer?.sensorTrailSymbol&&(this._sensorTrailGraphic.symbol=this.layer.sensorTrailSymbol.clone())}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const e=new d(this.layer.videoElement);this.addAttachHandles([s((()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints,this.layer.frameOpacity,this.layer.telemetryDisplay?.frame]),(()=>{const{visibleTelemetryElements:t}=this;e.frameHorizonPoints=this.layer.frameHorizonPoints,e.groundControlPoints=this.layer.groundControlPoints,e.opacity=this.layer.frameOpacity,e.visible=t?.frame??!1}),l)]),this._overlayContainer.addChild(e),this.view.stage.requestRender()}};e([o()],T.prototype,"graphicsView",void 0),e([o()],T.prototype,"layer",void 0),e([o({types:u})],T.prototype,"sensorLocationSymbol",void 0),e([o()],T.prototype,"symbolAngle",void 0),e([o({type:m})],T.prototype,"visibleTelemetryElements",void 0),T=e([a("esri.views.2d.layers.VideoLayerView2D")],T);const G=T;export{G as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{equals as r}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import{mapCollection as t}from"../../core/mapCollectionUtils.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as n,syncAndInitial as a}from"../../core/reactiveUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{e as c}from"../../chunks/earcut.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as d}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../geometry/ellipsoidUtils.js";import h from"../../geometry/Point.js";import{e as f}from"../../chunks/densifyOperator.js";import{computeTranslationToOriginAndRotation as g}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as y}from"../../geometry/support/DoubleArray.js";import{earth as w}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as v}from"../../geometry/support/Indices.js";import{t as j}from"../../chunks/vec3.js";import{FocusAreaOutlineItem as _}from"../FocusAreaOutlineItem.js";import{ViewingMode as A}from"../ViewingMode.js";import{ElevationContext as b}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as R}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as C}from"./layers/graphics/graphicUtils.js";import{geometryToRenderInfo as x}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as N}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaGeometry as k,FocusAreaMaskNode as H}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";const M=-2e4,U=65e5;let V=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new b,this._outlineMap=new s}initialize(){this.addHandles([n((()=>this.polygons),(e=>this._updateVolumes(e)),a)]),this._outlineMap=t((()=>this.areas?.areas),(e=>new _({area:e,view:this.view})),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter((({enabled:e})=>e))??[]}get style(){return this.areas?.style??"bright"}get polygons(){return this.enabledAreas.reduce(((e,o)=>e.concat(o.geometries.toArray())),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new h(e);return this.polygons.some((e=>e.contains(o)))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes()}_extrude(e){if(!this.view.renderCoordsHelper||r(Array.from(this._volumes.keys()),e))return;const o=U-M,s=d(),t=this.view.renderCoordsHelper.viewingMode===A.Global,i=p(),n=p();t||this.view.renderCoordsHelper.worldUpAtPosition([0,0,0],s);const a=new Map;for(const r of e){const e=this._volumes.get(r);if(e){a.set(r,e);continue}const m=C(r);if(null==m)continue;const l=f(r,u(this.view.spatialReference).radius/w.radius*5e5,{unit:"meters"});g(l.spatialReference,[m.x,m.y,0],i,this.view.renderCoordsHelper.spatialReference);const p=this.view.renderCoordsHelper.worldUpAtPosition([i[12],i[13],i[14]],P);n[12]=-i[12],n[13]=-i[13],n[14]=-i[14];const d=x(l,this.view.elevationProvider,this.view.renderCoordsHelper,this._elevationContext),{polygons:h,mapPositions:_,position:A}=d,b=new Array;for(const r of h){const e=r.count,a=c(r.mapPositions,r.holeIndices,3);if(0===a.length)continue;const m=a.length,l=6*e,d=l+m,u=y(3*l),h=v(d),f=v(m);R(A,_,a,r,u,null,null,null,h,f,o,s,t),j(u,u,n);const g=new k(u,f,h,o,[i[12]+M*p[0],i[13]+M*p[1],i[14]+M*p[2]]);b.push(g)}a.set(r,b)}this._volumes=a,this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(){this.view.stage&&(0===this.volumes.size?(this._maskRenderNode=i(this._maskRenderNode),this._colorRenderNode=i(this._colorRenderNode)):(this._maskRenderNode??=new H({focusAreasView:this}),this._colorRenderNode??=new N({focusAreasView:this}),this.view.stage.renderView.requestRender()))}get volumes(){return this._volumes}};e([m()],V.prototype,"_volumes",void 0),e([m({constructOnly:!0})],V.prototype,"view",void 0),V=e([l("esri.views.3d.FocusAreasView")],V);const P=d();export{V as FocusAreasView};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{equals as r}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import{mapCollection as t}from"../../core/mapCollectionUtils.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as n,syncAndInitial as a}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{e as c}from"../../chunks/earcut.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as u}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../geometry/ellipsoidUtils.js";import f from"../../geometry/Point.js";import{e as h}from"../../chunks/densifyOperator.js";import{computeTranslationToOriginAndRotation as g}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as y}from"../../geometry/support/DoubleArray.js";import{earth as w}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as v}from"../../geometry/support/Indices.js";import{t as j}from"../../chunks/vec3.js";import{ViewingMode as _}from"../ViewingMode.js";import{ElevationContext as A}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as b}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as R}from"./layers/graphics/graphicUtils.js";import{geometryToRenderInfo as C}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as x}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaGeometry as N,FocusAreaMaskNode as k}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";import{FocusAreaOutlineItem as H}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";const M=-2e4,U=65e5;let V=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new A,this._outlineMap=new s}initialize(){this.addHandles([n((()=>this.polygons),(e=>this._updateVolumes(e)),a)]),this._outlineMap=t((()=>this.areas?.areas),(e=>new H({area:e,view:this.view})),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter((({enabled:e})=>e))??[]}get style(){return this.areas?.style??"bright"}get polygons(){return this.enabledAreas.reduce(((e,o)=>e.concat(o.geometries.toArray())),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new f(e);return this.polygons.some((e=>e.contains(o)))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes()}_extrude(e){if(!this.view.renderCoordsHelper||r(Array.from(this._volumes.keys()),e))return;const o=U-M,s=u(),t=this.view.renderCoordsHelper.viewingMode===_.Global,i=p(),n=p();t||this.view.renderCoordsHelper.worldUpAtPosition([0,0,0],s);const a=new Map;for(const r of e){const e=this._volumes.get(r);if(e){a.set(r,e);continue}const l=R(r);if(null==l)continue;const m=h(r,d(this.view.spatialReference).radius/w.radius*5e5,{unit:"meters"});g(m.spatialReference,[l.x,l.y,0],i,this.view.renderCoordsHelper.spatialReference);const p=this.view.renderCoordsHelper.worldUpAtPosition([i[12],i[13],i[14]],P);n[12]=-i[12],n[13]=-i[13],n[14]=-i[14];const u=C(m,this.view.elevationProvider,this.view.renderCoordsHelper,this._elevationContext),{polygons:f,mapPositions:_,position:A}=u,x=new Array;for(const r of f){const e=r.count,a=c(r.mapPositions,r.holeIndices,3);if(0===a.length)continue;const l=a.length,m=6*e,u=m+l,d=y(3*m),f=v(u),h=v(l);b(A,_,a,r,d,null,null,null,f,h,o,s,t),j(d,d,n);const g=new N(d,h,f,o,[i[12]+M*p[0],i[13]+M*p[1],i[14]+M*p[2]]);x.push(g)}a.set(r,x)}this._volumes=a,this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(){this.view.stage&&(0===this.volumes.size?(this._maskRenderNode=i(this._maskRenderNode),this._colorRenderNode=i(this._colorRenderNode)):(this._maskRenderNode??=new k({focusAreasView:this}),this._colorRenderNode??=new x({focusAreasView:this}),this.view.stage.renderView.requestRender()))}get volumes(){return this._volumes}};e([l()],V.prototype,"_volumes",void 0),e([l({constructOnly:!0})],V.prototype,"view",void 0),V=e([m("esri.views.3d.FocusAreasView")],V);const P=u();export{V as FocusAreasView};