@arcgis/core 5.1.0-next.78 → 5.1.0-next.79

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 (464) hide show
  1. package/analysis/ShadowCast/DiscreteOptions.d.ts +33 -6
  2. package/analysis/ShadowCast/DiscreteOptions.js +1 -1
  3. package/analysis/ShadowCast/MinDurationOptions.d.ts +6 -4
  4. package/analysis/ShadowCast/TotalDurationOptions.d.ts +33 -6
  5. package/analysis/ShadowCast/TotalDurationOptions.js +1 -1
  6. package/analysis/ShadowCast/colorStopsUtils.js +2 -0
  7. package/analysis/ShadowCastAnalysis.d.ts +24 -1
  8. package/analysis/ShadowCastAnalysis.js +1 -1
  9. package/analysis/Viewshed.d.ts +27 -0
  10. package/analysis/Viewshed.js +1 -1
  11. package/analysis/ViewshedAnalysis.js +1 -1
  12. package/arcade/FunctionWrapper.js +1 -1
  13. package/arcade/arcadeAsyncRuntime.js +1 -1
  14. package/arcade/arcadeCompiler.js +1 -1
  15. package/arcade/arcadeRuntime.js +1 -1
  16. package/arcade/compilerUtils.js +1 -1
  17. package/arcade/debug.d.ts +139 -0
  18. package/arcade/debug.js +2 -0
  19. package/arcade/featureSetCollection.js +1 -1
  20. package/arcade/featureSetUtils.js +1 -1
  21. package/arcade/featureset/actions/GroupBy.js +1 -1
  22. package/arcade/featureset/actions/OrderBy.js +1 -1
  23. package/arcade/functions/featuresetstring.js +1 -1
  24. package/arcade/languageUtils.js +1 -1
  25. package/arcade.d.ts +46 -2
  26. package/arcade.js +1 -1
  27. package/assets/esri/core/workers/RemoteClient.js +1 -1
  28. package/assets/esri/core/workers/chunks/{1c7183551f5269bdcf13.js → 01bd1b86ba899c6aa4c0.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{1f8ccf96069ac3a40c3d.js → 01ee18782a50279f907e.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{f81c6f6ccc201f584970.js → 022067e807905cabeaa1.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{11ea4be441a26134ce1f.js → 052cdc7aaa803b5873f0.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{b7bb7072dbee978f3ca3.js → 056fd7847caaff2c9514.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{8acee3fba488f202f82f.js → 05c3146d87d917606193.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{a8ca5d8740cc7e39197b.js → 0aebcbf41cb193e76809.js} +5 -5
  35. package/assets/esri/core/workers/chunks/{54023458195549f66215.js → 0b77c124b743067e4155.js} +1 -1
  36. package/assets/esri/core/workers/chunks/10408183681fd6c7b4ed.js +2 -0
  37. package/assets/esri/core/workers/chunks/{7595ceba529ed01c7590.js → 2c87c3112a43db8624f6.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{13e60f19f436b8d683ae.js → 3c9482764c9e4f8bcbb0.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{322c54081b25f1c53661.js → 3e37019eee1c49d2bf64.js} +1 -1
  40. package/assets/esri/core/workers/chunks/45c83eb7c2a06166e3b0.js +1 -0
  41. package/assets/esri/core/workers/chunks/48acd146bf0241d87647.js +1 -0
  42. package/assets/esri/core/workers/chunks/5818f1f526577068d6ca.js +2 -0
  43. package/assets/esri/core/workers/chunks/{34fe97bcacc0dfc5bce6.js → 5ccc325d83cec4f5ccdb.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{30e710ec4d22c43d4e7e.js → 5cffc7b49966201eccdb.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{1a87e9bbd85ba29b1514.js → 5da2051f548c2942e01a.js} +1 -1
  46. package/assets/esri/core/workers/chunks/5ec66e39e53c11e75179.js +2 -0
  47. package/assets/esri/core/workers/chunks/{0b1454a77a6a682541dc.js.LICENSE.txt → 5ec66e39e53c11e75179.js.LICENSE.txt} +9 -1
  48. package/assets/esri/core/workers/chunks/5f6fd20a7f4e80eafa25.js +1 -0
  49. package/assets/esri/core/workers/chunks/{abc06d10c7ac8ba5b0e4.js → 67ec1694d6e18b7c234c.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{32e22d6eee9fed1f70b0.js → 6d696beddcc5fbed5875.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{f590b60fca607d66001a.js → 716a4d7e8b908b81870b.js} +1 -1
  52. package/assets/esri/core/workers/chunks/71fe127734f33d020a44.js +1 -0
  53. package/assets/esri/core/workers/chunks/7cdd0492b2191df95102.js +2 -0
  54. package/assets/esri/core/workers/chunks/7cea68257d24ffd205bb.js +1 -0
  55. package/assets/esri/core/workers/chunks/7e530e635325dba07864.js +1 -0
  56. package/assets/esri/core/workers/chunks/8f6f5dad52747d252aac.js +596 -0
  57. package/assets/esri/core/workers/chunks/{d950d5c2844206502ff0.js → 992cd87ba0ab6346f692.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{73c87eb9bd8f0f848481.js → 9c11e1fe785e1385fdb1.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{5ed8d8b5336c81fbcda3.js → 9d216e30d04ea21fc8a2.js} +1 -1
  60. package/assets/esri/core/workers/chunks/a54aa93b6012a2597f82.js +1 -0
  61. package/assets/esri/core/workers/chunks/{cf14b3a44705dacefac4.js → a9b5ce00323cd5574bf7.js} +1 -1
  62. package/assets/esri/core/workers/chunks/ae6b3dfe5f757df539d6.js +1 -0
  63. package/assets/esri/core/workers/chunks/b14c4c3f295970f731ab.js +1 -0
  64. package/assets/esri/core/workers/chunks/{c70df6ed190f9ebcf6aa.js → bf2c202dec5ab7bc770b.js} +1 -1
  65. package/assets/esri/core/workers/chunks/c1d4110aa494a1dba3c4.js +1 -0
  66. package/assets/esri/core/workers/chunks/{85d8c7cc7f8decbe975d.js → c442916805975744dd92.js} +1 -1
  67. package/assets/esri/core/workers/chunks/dacc2e5fa462495ed1cc.js +2 -0
  68. package/assets/esri/core/workers/chunks/f227b34cce6843df0fb6.js +1 -0
  69. package/assets/esri/core/workers/chunks/{dda2cb5c073d1e65f14f.js → f43d628d47eec7d530c7.js} +1 -1
  70. package/assets/esri/core/workers/chunks/f7531aa69a87814c60d1.js +1 -0
  71. package/assets/esri/core/workers/chunks/{4ccb56333de0247dcb6f.js → fb100935fd8948d779f5.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{5ee4b630ad39c21d11db.js → fb9e3e7cd532ac4353f1.js} +12 -12
  73. package/assets/esri/core/workers/chunks/fc6ca7ffb9f1b875059c.js +1 -0
  74. package/assets/esri/core/workers/chunks/{3d9fcbe95dd22dbe730e.js → ffc4f3406ce383b9bd88.js} +1 -1
  75. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +6 -0
  76. package/assets/esri/themes/dark/main.css +1 -1
  77. package/assets/esri/themes/light/main.css +1 -1
  78. package/assets/esri/themes/light/view.css +1 -1
  79. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  80. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  81. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  82. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  83. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  84. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  85. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  86. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  87. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  88. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  89. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  90. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  91. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  92. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  93. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  94. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  95. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  96. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  97. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  98. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  99. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  100. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  101. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  102. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  103. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  104. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  105. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  106. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  107. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  108. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  109. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  110. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  111. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  112. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  113. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  114. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  115. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  116. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  117. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  118. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  119. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  120. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  121. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  122. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  123. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  124. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  125. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  126. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  127. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  128. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  129. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  130. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  131. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  132. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  133. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  134. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  135. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  136. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  137. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  138. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  139. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  140. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  141. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  142. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  143. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  144. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  145. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  146. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  147. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  148. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  149. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  150. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  151. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  152. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  153. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  154. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  155. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  156. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  157. package/chunks/ImageMaterial.glsl.js +7 -5
  158. package/chunks/SlicePlaneMaterial.glsl.js +21 -13
  159. package/chunks/arcade.js +1 -1
  160. package/chunks/languageUtils.js +1 -1
  161. package/config.js +1 -1
  162. package/core/MapUtils.js +1 -1
  163. package/core/arrayUtils.js +1 -1
  164. package/kernel.js +1 -1
  165. package/layers/IntegratedMeshLayer.d.ts +18 -14
  166. package/layers/SceneLayer.d.ts +35 -1
  167. package/layers/SceneLayer.js +1 -1
  168. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  169. package/layers/scene/ModelFileInfo.d.ts +29 -0
  170. package/layers/scene/ModelFileInfo.js +2 -0
  171. package/layers/scene/ModelInfo.d.ts +38 -0
  172. package/layers/scene/ModelInfo.js +2 -0
  173. package/layers/scene/modelQuerySupport.js +2 -0
  174. package/layers/scene/types.d.ts +14 -0
  175. package/layers/support/infoFor3D.js +1 -1
  176. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  177. package/layers/types.d.ts +13 -1
  178. package/package.json +3 -3
  179. package/popup/Features.d.ts +1 -6
  180. package/popup/Features.js +1 -1
  181. package/popup/actions.js +1 -1
  182. package/renderers/visualVariables/support/ColorStop.js +1 -1
  183. package/support/arcadeUtils.js +1 -1
  184. package/support/revision.js +1 -1
  185. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  186. package/views/2d/engine/flow/styles/Particles.js +1 -1
  187. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  188. package/views/2d/engine/vectorTiles/Placement.js +1 -1
  189. package/views/2d/engine/vectorTiles/TextShaping.js +1 -1
  190. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  191. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  192. package/views/2d/engine/webgl/GlyphSource.js +1 -1
  193. package/views/2d/engine/webgl/Overlay.js +1 -1
  194. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  195. package/views/2d/engine/webgl/RenderingDevice.js +1 -1
  196. package/views/2d/engine/webgl/TextureManager.js +1 -1
  197. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  198. package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
  199. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  200. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  201. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueProgramCache.js +1 -1
  202. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  203. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  206. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimationUniformInfo.js +1 -1
  207. package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
  208. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  209. package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +1 -1
  210. package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +1 -1
  211. package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +1 -1
  212. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  213. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
  214. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  215. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  216. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  217. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  218. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  219. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  220. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  221. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  222. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  223. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  224. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  225. package/views/2d/engine/webgl/shaderGraph/techniques/flow/FlowTechnique.js +1 -1
  226. package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
  227. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  228. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  229. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  230. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  231. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  232. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  233. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  234. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  235. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  236. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  237. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  238. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  239. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  240. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  241. package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +1 -1
  242. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/AspectTechnique.js +1 -1
  243. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BandArithmeticTechnique.js +1 -1
  244. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
  245. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ColormapToRGBTechnique.js +1 -1
  246. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CompositeBandTechnique.js +1 -1
  247. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ComputeChangeTechnique.js +1 -1
  248. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ContrastBrightnessTechnique.js +1 -1
  249. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ConvolutionTechnique.js +1 -1
  250. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CurvatureTechnique.js +1 -1
  251. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ExtractBandTechnique.js +1 -1
  252. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/FocalStatisticsTechnique.js +1 -1
  253. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/GrayscaleTechnique.js +1 -1
  254. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/HillshadeTechnique.js +1 -1
  255. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/LocalTechnique.js +1 -1
  256. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/MaskTechnique.js +1 -1
  257. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/NDVITechnique.js +1 -1
  258. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/RemapTechnique.js +1 -1
  259. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  260. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ShadedReliefTechnique.js +1 -1
  261. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SlopeTechnique.js +1 -1
  262. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SpectralConversionTechnique.js +1 -1
  263. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/StretchTechnique.js +1 -1
  264. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  265. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
  266. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
  267. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js +1 -1
  268. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
  269. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js +1 -1
  270. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js +1 -1
  271. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  272. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
  273. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +1 -1
  274. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/EntityStorage.js +1 -1
  275. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
  276. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
  277. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapResolveShader.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MosaicInfo.js +1 -1
  281. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js +1 -1
  282. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
  283. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
  284. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
  285. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsDiffShader.js +1 -1
  286. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsMinMaxSumShader.js +1 -1
  287. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsStdDevShader.js +1 -1
  288. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsSumOfSquaredDiffShader.js +1 -1
  289. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
  290. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js +1 -1
  291. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js +1 -1
  292. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowImageryShader.js +1 -1
  293. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowUtils.js +1 -1
  294. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
  295. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterHighlightShader.js +1 -1
  296. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerLUTShader.js +1 -1
  297. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerShadedReliefShader.js +1 -1
  298. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
  299. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterXYBandHighlightShader.js +1 -1
  300. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/lut.js +1 -1
  301. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
  302. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/BaseRasterProcessorShader.js +1 -1
  303. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ColormapToRGBShader.js +1 -1
  304. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ConvolutionShader.js +1 -1
  305. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
  306. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/FocalStatisticsShader.js +1 -1
  307. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/HillshadeShader.js +1 -1
  308. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MultiRasterMixin.js +1 -1
  309. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ShadedReliefShader.js +1 -1
  310. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
  311. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/projection.js +1 -1
  312. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
  313. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +1 -1
  314. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
  315. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +1 -1
  316. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
  317. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +1 -1
  318. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vvUtils.js +1 -1
  319. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  320. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  321. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
  322. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +1 -1
  323. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
  324. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
  325. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  326. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  327. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
  328. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  329. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  330. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  331. package/views/3d/FocusAreasView.js +1 -1
  332. package/views/3d/StencilGeometry.js +2 -0
  333. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  334. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  335. package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
  336. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  337. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  338. package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +1 -1
  339. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  340. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  341. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  342. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  343. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  344. package/views/3d/focusAreaUtils.js +2 -0
  345. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  346. package/views/3d/layers/I3SMeshView3D.js +1 -1
  347. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  348. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  349. package/views/3d/layers/IntegratedMeshNormals.js +1 -1
  350. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  351. package/views/3d/layers/SceneLayerView3D.js +1 -1
  352. package/views/3d/layers/SceneLayerWorker.js +1 -1
  353. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  354. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  355. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  356. package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
  357. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  358. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  359. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  360. package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
  361. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  362. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  363. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  364. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  365. package/views/3d/webgl-engine/effects/clouds/CloudsTechnique.js +1 -1
  366. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  367. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  368. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  369. package/views/3d/webgl-engine/effects/focusArea/focusAreaMaskUtils.js +2 -0
  370. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  371. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  372. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  373. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  374. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  375. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  376. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
  377. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  378. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  379. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  380. package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
  381. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  382. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  383. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  384. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  385. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  386. package/views/3d/webgl-engine/lib/Compositor.js +1 -1
  387. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  388. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  389. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  390. package/views/3d/webgl-engine/lib/Material.js +1 -1
  391. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  392. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  393. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  394. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  395. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  396. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  397. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  398. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  399. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  400. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  401. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  402. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  403. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  404. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  405. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +10 -10
  406. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  407. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  408. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  409. package/views/View2D.js +1 -1
  410. package/views/draw/support/GraphicMover.js +1 -1
  411. package/views/draw/support/Reshape.js +1 -1
  412. package/views/draw/support/editingSessionUtils.js +1 -1
  413. package/views/webgl/FramebufferObject.js +1 -1
  414. package/widgets/BatchAttributeForm/css.js +1 -1
  415. package/widgets/BatchAttributeForm/inputs/GroupInput.d.ts +2 -1
  416. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.d.ts +54 -0
  417. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +2 -0
  418. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  419. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  420. package/widgets/BatchAttributeForm/inputs/types.d.ts +4 -3
  421. package/widgets/BatchAttributeForm/templates/AttachmentElementTemplate.js +1 -1
  422. package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +2 -0
  423. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  424. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  425. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  426. package/widgets/BatchAttributeForm.js +1 -1
  427. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +21 -1
  428. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  429. package/widgets/CoordinateConversion/support/Format.js +1 -1
  430. package/widgets/CoordinateConversion/support/coordinateConversionUtils.js +1 -1
  431. package/widgets/CoordinateConversion.d.ts +21 -1
  432. package/widgets/CoordinateConversion.js +1 -1
  433. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  434. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  435. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  436. package/widgets/Editor/support/SketchController.js +1 -1
  437. package/widgets/Editor/workflowUtils.js +1 -1
  438. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  439. package/widgets/Sketch/SketchViewModel.js +1 -1
  440. package/widgets/support/ContingentValuesManager.js +1 -1
  441. package/widgets/types.d.ts +1 -1
  442. package/assets/esri/core/workers/chunks/07eff82916681fcff069.js +0 -1
  443. package/assets/esri/core/workers/chunks/0b1454a77a6a682541dc.js +0 -2
  444. package/assets/esri/core/workers/chunks/1c7fd0a229a8112b0539.js +0 -596
  445. package/assets/esri/core/workers/chunks/3697e51e1e4cf442f39a.js +0 -1
  446. package/assets/esri/core/workers/chunks/3cce9dad8ee0e4971d50.js +0 -1
  447. package/assets/esri/core/workers/chunks/3df8493b91aa3bce824d.js +0 -1
  448. package/assets/esri/core/workers/chunks/68a313155ddc29bd024d.js +0 -1
  449. package/assets/esri/core/workers/chunks/751609831b283903ba48.js +0 -1
  450. package/assets/esri/core/workers/chunks/7bacdd65a6cc4d284e0a.js +0 -2
  451. package/assets/esri/core/workers/chunks/7e97684e851274efd11f.js +0 -1
  452. package/assets/esri/core/workers/chunks/85aac8539996372f1ee8.js +0 -1
  453. package/assets/esri/core/workers/chunks/99d298d0039c536fcf3e.js +0 -1
  454. package/assets/esri/core/workers/chunks/9aaf78b831f8739bc127.js +0 -1
  455. package/assets/esri/core/workers/chunks/9b9916864b6575c42c8a.js +0 -1
  456. package/assets/esri/core/workers/chunks/bf7e019437a3b6036300.js +0 -2
  457. package/assets/esri/core/workers/chunks/d304343a781acfa3ff96.js +0 -1
  458. package/assets/esri/core/workers/chunks/dbb9bb28696ff9536678.js +0 -2
  459. package/assets/esri/core/workers/chunks/f09a41ad239d467d9438.js +0 -2
  460. package/assets/esri/core/workers/chunks/f6912532aae1638cbe8f.js +0 -1
  461. /package/assets/esri/core/workers/chunks/{7bacdd65a6cc4d284e0a.js.LICENSE.txt → 10408183681fd6c7b4ed.js.LICENSE.txt} +0 -0
  462. /package/assets/esri/core/workers/chunks/{f09a41ad239d467d9438.js.LICENSE.txt → 5818f1f526577068d6ca.js.LICENSE.txt} +0 -0
  463. /package/assets/esri/core/workers/chunks/{dbb9bb28696ff9536678.js.LICENSE.txt → 7cdd0492b2191df95102.js.LICENSE.txt} +0 -0
  464. /package/assets/esri/core/workers/chunks/{bf7e019437a3b6036300.js.LICENSE.txt → dacc2e5fa462495ed1cc.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{deserializeFlowPaths as e}from"../flowPathsIO.js";import{areStreamlinesCompatible as s,getFlowFloatUniforms as a,getFlowColorUniforms as i}from"../utils.js";import{AFlowResources as r}from"./AFlowResources.js";import{Mesh as o}from"../../webgl/meshing/Mesh.js";import{FlowStreamlinesShader as n}from"../../webgl/shaderGraph/techniques/shaders/flow/FlowStreamlinesShader.js";import{getPositions as p}from"../../../../support/flow/utils.js";import{PrimitiveType as m,DataType as h}from"../../../../webgl/enums.js";import{VertexElementDescriptor as l}from"../../../../webgl/VertexElementDescriptor.js";class d{constructor(t){this._params=t,this.supportsContinuation=!1,this.slideoutDuration=20}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof d&&s(this._params,t._params)}updateResource(t){t.updateParams(this._params.flowSpeed,this._params.trailLength)}async load(s,a,i){const{extent:r,size:o}=s;t(i);const n=await this._params.loadImagery(r,o[0],o[1],this._params.timeExtent,i),m=a&&this._params.simulationSettings.continuous?p(a.flowPaths,a.query,s,this._params.flowSpeed):[],{vertexData:h,indexData:l,pathData:d}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,n,{positions:m},i),u=e(d);return new c(h,l,s,u,{color:this._params.color,opacity:this._params.opacity,size:this._params.size},this._params)}}const u=[new l("positionAndSide",3,h.FLOAT,0,36),new l("timeInfo",3,h.FLOAT,12,36),new l("extrude",2,h.FLOAT,24,36),new l("speed",1,h.FLOAT,32,36)];class c extends r{static{this._shader=new n}constructor(t,e,s,a,i,r){super(s,a),this._vertexData=t,this._indexData=e,this._values=i,this._params=r,this.kind="streamlines"}attach(t){const{context:e}=t;this.mesh=new o(e,{vertex:{geometry:{data:this._vertexData,layout:u}},index:{indices:{data:this._indexData}},groups:[{index:"indices",primitive:m.TRIANGLES}],parts:[{group:0,start:0,count:this._indexData.length}]}),this._vertexData=null,this._indexData=null}detach(){this.mesh.destroy()}get ready(){return!0}updateParams(t,e){this._params.flowSpeed=t,this._params.trailLength=e}getProgramSpec(t){return{shader:c._shader,uniforms:{state:{time:t.time-this.query.time,dvsMat3:t.dvsMat3,displayViewMat3:t.displayViewMat3,displayOpacity:t.displayOpacity,startTime:t.startTime-this.query.time,endTime:t.endTime-this.query.time},config:{trailLength:this._params.trailLength,flowSpeed:this._params.flowSpeed,featheringSize:this._params.featheringSize,featheringOffset:this._params.featheringOffset,introFade:this._params.introFade?1:0,fadeToZero:this._params.fadeToZero?1:0,decayRate:this._params.decayRate},color:i(this._values.color),opacity:a(this._values.opacity),size:a(this._values.size)},defines:{vvColor:"ramp"===this._values.color.kind,vvOpacity:"ramp"===this._values.opacity.kind,vvSize:"ramp"===this._values.size.kind},optionalAttributes:null}}}export{d as default};
2
+ import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{deserializeFlowPaths as e}from"../flowPathsIO.js";import{areStreamlinesCompatible as s,getFlowFloatUniforms as a,getFlowColorUniforms as i}from"../utils.js";import{AFlowResources as r}from"./AFlowResources.js";import{Mesh as o}from"../../webgl/meshing/Mesh.js";import{FlowStreamlinesShader as n}from"../../webgl/shaderGraph/techniques/shaders/flow/FlowStreamlinesShader.js";import{getPositions as p}from"../../../../support/flow/utils.js";import{PrimitiveType as m,DataType as h}from"../../../../webgl/enums.js";import{VertexElementDescriptor as l}from"../../../../webgl/VertexElementDescriptor.js";class d{constructor(t){this._params=t,this.supportsContinuation=!1,this.slideoutDuration=20}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof d&&s(this._params,t._params)}updateResource(t){t.updateParams(this._params.flowSpeed,this._params.trailLength)}async load(s,a,i){const{extent:r,size:o}=s;t(i);const n=await this._params.loadImagery(r,o[0],o[1],this._params.timeExtent,i),m=a&&this._params.simulationSettings.continuous?p(a.flowPaths,a.query,s,this._params.flowSpeed):[],{vertexData:h,indexData:l,pathData:d}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,n,{positions:m},i),u=e(d);return new c(h,l,s,u,{color:this._params.color,opacity:this._params.opacity,size:this._params.size},this._params)}}const u=[new l("positionAndSide",3,h.FLOAT,0,36),new l("timeInfo",3,h.FLOAT,12,36),new l("extrude",2,h.FLOAT,24,36),new l("speed",1,h.FLOAT,32,36)];class c extends r{static{this._shader=new n}constructor(t,e,s,a,i,r){super(s,a),this._vertexData=t,this._indexData=e,this._values=i,this._params=r,this.kind="streamlines"}attach(t){const{context:e}=t;this.mesh=new o(e,{vertex:{geometry:{data:this._vertexData,layout:u}},index:{indices:{data:this._indexData}},groups:[{index:"indices",primitive:m.TRIANGLES}],parts:[{group:0,start:0,count:this._indexData.length}]}),this._vertexData=null,this._indexData=null}detach(){this.mesh.destroy()}get ready(){return!0}updateParams(t,e){this._params.flowSpeed=t,this._params.trailLength=e}getProgramSpec(t){return{shader:c._shader,uniforms:{state:{time:t.time-this.query.time,dvsMat3:t.dvsMat3,displayViewMat3:t.displayViewMat3,displayOpacity:t.displayOpacity,startTime:t.startTime-this.query.time,endTime:t.endTime-this.query.time},config:{trailLength:this._params.trailLength,flowSpeed:this._params.flowSpeed,featheringSize:this._params.featheringSize,featheringOffset:this._params.featheringOffset,introFade:this._params.introFade?1:0,fadeToZero:this._params.fadeToZero?1:0,decayRate:this._params.decayRate},color:i(this._values.color),opacity:a(this._values.opacity),size:a(this._values.size)},textures:{},defines:{vvColor:"ramp"===this._values.color.kind,vvOpacity:"ramp"===this._values.opacity.kind,vvSize:"ramp"===this._values.size.kind},optionalAttributes:null}}}export{d as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{Point as e}from"../../../../geometry/support/TileClipper.js";import{tilePixelRatio as t}from"./constants.js";import{cDegToRad as i,cPi as n,cInfinity as s,positiveMod as o,radToByte as a,c2pi as h}from"./GeometryUtils.js";import{TextShaping as l,sdfGlyphSize as r,sdfGlyphBaseline as c}from"./TextShaping.js";import{sdfBufferServer as g}from"../webgl/definitions.js";const m=.5,x=2;class d{constructor(e,t,i=0,n=-1,s=m){this.x=e,this.y=t,this.angle=i,this.segment=n,this.minzoom=s}}class p{constructor(e,t,i,n,o,a=m,h=s){this.anchor=e,this.labelAngle=t,this.glyphAngle=i,this.page=n,this.alternateVerticalGlyph=o,this.minzoom=a,this.maxzoom=h}}class w{constructor(e,t,i,n,s,o,a,h,l,r,c,g){this.tl=e,this.tr=t,this.bl=i,this.br=n,this.mosaicRect=s,this.labelAngle=o,this.minAngle=a,this.maxAngle=h,this.anchor=l,this.minzoom=r,this.maxzoom=c,this.page=g}}class y{constructor(e){this.shapes=e}}class f{getIconPlacement(t,s,o){const a=new e(t.x,t.y),h=0===o.rotationAlignment,l=o.keepUpright;let r=o.rotate*i;h&&(r+=t.angle);const c=new y([]);return c.iconColliders=[],this._addIconPlacement(c,a,s,o,r),h&&l&&this._addIconPlacement(c,a,s,o,r+n),c}_addIconPlacement(t,i,n,o,a){const h=n.rasterizationScale,l=n.width/h,r=n.height/h,c=o.offset;let g=c[0],x=c[1];switch(o.anchor){case 0:g-=l/2,x-=r/2;break;case 1:x-=r/2;break;case 2:g-=l,x-=r/2;break;case 3:g-=l/2;break;case 4:g-=l/2,x-=r;break;case 5:break;case 7:x-=r;break;case 6:g-=l;break;case 8:g-=l,x-=r}const d=n.rect,p=2/h,y=g-p,f=x-p,b=y+d.width/h,u=f+d.height/h,I=new e(y,f),T=new e(b,u),k=new e(y,u),P=new e(b,f);if(0!==a){const e=Math.cos(a),t=Math.sin(a);I.rotate(e,t),T.rotate(e,t),k.rotate(e,t),P.rotate(e,t)}const N=new w(I,P,k,T,d,a,0,256,i,m,s,0);t.shapes.push(N);{const e=o.size,n=o.padding,h={xTile:i.x,yTile:i.y,dxPixels:g*e-n,dyPixels:x*e-n,hard:!o.optional,partIndex:0,width:l*e+2*n,height:r*e+2*n,angle:a,minLod:m,maxLod:s};t.iconColliders.push(h)}}getTextPlacement(o,a,h,d){const f=new e(o.x,o.y),{keepUpright:b,rotate:u,rotationAlignment:I,size:T}=d,k=u*i,P=0===I,N=b,z=d.padding;let A=m;const _=!P?0:o.angle,G=o.segment>=0&&P,M=[],E=[],L=g,V=!G;let v=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,C=v,F=j;const S=(G||P)&&N,Y=T/r;let q=!1;for(const e of a)if(e.vertical){q=!0;break}let U,O=0,B=0;if(!G&&q){const e=l.getTextBox(a,d.lineHeight*r);switch(d.anchor){case 1:O=e.height/2,B=-e.width/2;break;case 2:O=-e.height/2,B=e.width/2;break;case 3:O=e.height/2,B=e.width/2;break;case 4:O=-e.height/2,B=-e.width/2;break;case 5:O=e.height;break;case 7:B=-e.width;break;case 6:B=e.width;break;case 8:O=-e.height}}O+=d.offset[0]*r,B+=d.offset[1]*r;for(const i of a){const a=i.glyphMosaicItem;if(!a||a.rect.isEmpty)continue;const l=a.rect,r=a.metrics,g=a.page;if(M&&V){if(void 0!==U&&U!==i.y){let e,t,i,n;q?(e=-F+O,t=v+B,i=F-C,n=j-v):(e=v+O,t=C+B,i=j-v,n=F-C);const a={xTile:o.x,yTile:o.y,dxPixels:e*Y-z,dyPixels:t*Y-z,hard:!d.optional,partIndex:1,width:i*Y+2*z,height:n*Y+2*z,angle:k,minLod:m,maxLod:s};M.push(a),v=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,C=v,F=j}U=i.y}const y=[];if(G){const e=.5*a.metrics.width,n=(i.x+r.left-L+e)*Y*t;if(A=this._placeGlyph(o,A,n,h,o.segment,1,i.vertical,g,y),N&&(A=this._placeGlyph(o,A,n,h,o.segment,-1,i.vertical,g,y)),A>=x)break}else y.push(new p(f,_,_,g,!1)),P&&N&&y.push(new p(f,_+n,_+n,g,!1));const b=i.x+r.left,u=i.y-c-r.top,I=b+r.width,T=u+r.height;let H,R,D,J,K,Q,W,X;if(!G&&q)if(i.vertical){const t=(b+I)/2-r.height/2,i=(u+T)/2+r.width/2;H=new e(-i-L+O,t-L+B),R=new e(H.x+l.width,H.y+l.height),D=new e(H.x,R.y),J=new e(R.x,H.y)}else H=new e(-u+L+O,b-L+B),R=new e(H.x-l.height,H.y+l.width),D=new e(R.x,H.y),J=new e(H.x,R.y);else H=new e(b-L+O,u-L+B),R=new e(H.x+l.width,H.y+l.height),D=new e(H.x,R.y),J=new e(R.x,H.y);for(const t of y){let n,s,a,h;if(t.alternateVerticalGlyph){if(!K){const t=(u+T)/2+B;K=new e((b+I)/2+O-r.height/2-L,t+r.width/2+L),Q=new e(K.x+l.height,K.y-l.width),W=new e(Q.x,K.y),X=new e(K.x,Q.y)}n=K,s=W,a=X,h=Q}else n=H,s=D,a=J,h=R;const c=u,g=T,m=t.glyphAngle+k;if(0!==m){const e=Math.cos(m),t=Math.sin(m);n=n.clone(),s=s?.clone(),a=a?.clone(),h=h?.clone(),n.rotate(e,t),h?.rotate(e,t),s?.rotate(e,t),a?.rotate(e,t)}let p=0,y=256;if(G&&q?i.vertical?t.alternateVerticalGlyph?(p=32,y=96):(p=224,y=32):(p=224,y=96):(p=192,y=64),E.push(new w(n,a,s,h,l,t.labelAngle,p,y,t.anchor,t.minzoom,t.maxzoom,t.page)),M&&(!S||this._legible(t.labelAngle)))if(V)b<v&&(v=b),c<C&&(C=c),I>j&&(j=I),g>F&&(F=g);else if(t.minzoom<x){const e={xTile:o.x,yTile:o.y,dxPixels:(b+O)*Y-z,dyPixels:(c+O)*Y-z,hard:!d.optional,partIndex:1,width:(I-b)*Y+2*z,height:(g-c)*Y+2*z,angle:m,minLod:t.minzoom,maxLod:t.maxzoom};M.push(e)}}}if(A>=x)return null;if(M&&V){let e,t,i,n;q?(e=-F+O,t=v+B,i=F-C,n=j-v):(e=v+O,t=C+B,i=j-v,n=F-C);const a={xTile:o.x,yTile:o.y,dxPixels:e*Y-z,dyPixels:t*Y-z,hard:!d.optional,partIndex:1,width:i*Y+2*z,height:n*Y+2*z,angle:k,minLod:m,maxLod:s};M.push(a)}const H=new y(E);return M&&M.length>0&&(H.textColliders=M),H}_legible(e){const t=a(e);return t<65||t>=193}_placeGlyph(t,i,a,l,r,c,g,m,x){let d=c;const w=d<0?o(t.angle+n,h):t.angle;let y=0;a<0&&(d*=-1,a*=-1,y=n),d>0&&++r;let f=new e(t.x,t.y),b=l[r],u=s;if(l.length<=r)return u;for(;;){const e=b.x-f.x,t=b.y-f.y,n=Math.sqrt(e*e+t*t),s=Math.max(a/n,i),c=e/n,I=t/n,T=o(Math.atan2(I,c)+y,h);if(x.push(new p(f,w,T,m,!1,s,u)),g&&x.push(new p(f,w,T,m,!0,s,u)),s<=i)return s;f=b.clone();do{if(r+=d,l.length<=r||r<0)return s;b=l[r]}while(f.isEqual(b));let k=b.x-f.x,P=b.y-f.y;const N=Math.sqrt(k*k+P*P);k*=n/N,P*=n/N,f.x-=k,f.y-=P,u=s}}}export{d as Anchor,w as PlacedSymbol,y as Placement,f as PlacementEngine};
2
+ import{Point as e}from"../../../../geometry/support/TileClipper.js";import{tilePixelRatio as t}from"./constants.js";import{cDegToRad as i,cPi as n,cInfinity as s,positiveMod as o,radToByte as a,c2pi as h}from"./GeometryUtils.js";import{TextShaping as l,sdfGlyphSize as r,sdfGlyphBaseline as c}from"./TextShaping.js";import{sdfBufferServer as g}from"../webgl/definitions.js";const m=.5,x=2;class d{constructor(e,t,i=0,n=-1,s=m){this.x=e,this.y=t,this.angle=i,this.segment=n,this.minzoom=s}}class p{constructor(e,t,i,n,o,a=m,h=s){this.anchor=e,this.labelAngle=t,this.glyphAngle=i,this.page=n,this.alternateVerticalGlyph=o,this.minzoom=a,this.maxzoom=h}}class w{constructor(e,t,i,n,s,o,a,h,l,r,c,g){this.tl=e,this.tr=t,this.bl=i,this.br=n,this.mosaicRect=s,this.labelAngle=o,this.minAngle=a,this.maxAngle=h,this.anchor=l,this.minzoom=r,this.maxzoom=c,this.page=g}}class y{constructor(e){this.shapes=e}}class f{getIconPlacement(t,s,o){const a=new e(t.x,t.y),h=0===o.rotationAlignment,l=o.keepUpright;let r=o.rotate*i;h&&(r+=t.angle);const c=new y([]);return c.iconColliders=[],this._addIconPlacement(c,a,s,o,r),h&&l&&this._addIconPlacement(c,a,s,o,r+n),c}_addIconPlacement(t,i,n,o,a){const h=n.rasterizationScale,l=n.width/h,r=n.height/h,c=o.offset;let g=c[0],x=c[1];switch(o.anchor){case 0:g-=l/2,x-=r/2;break;case 1:x-=r/2;break;case 2:g-=l,x-=r/2;break;case 3:g-=l/2;break;case 4:g-=l/2,x-=r;break;case 5:break;case 7:x-=r;break;case 6:g-=l;break;case 8:g-=l,x-=r}const d=n.rect,p=2/h,y=g-p,f=x-p,b=y+d.width/h,u=f+d.height/h,I=new e(y,f),T=new e(b,u),k=new e(y,u),P=new e(b,f);if(0!==a){const e=Math.cos(a),t=Math.sin(a);I.rotate(e,t),T.rotate(e,t),k.rotate(e,t),P.rotate(e,t)}const N=new w(I,P,k,T,d,a,0,256,i,m,s,0);t.shapes.push(N);{const e=o.size,n=o.padding,h={xTile:i.x,yTile:i.y,dxPixels:g*e-n,dyPixels:x*e-n,hard:!o.optional,partIndex:0,width:l*e+2*n,height:r*e+2*n,angle:a,minLod:m,maxLod:s};t.iconColliders.push(h)}}getTextPlacement(o,a,h,d){const f=new e(o.x,o.y),{keepUpright:b,rotate:u,rotationAlignment:I,size:T}=d,k=u*i,P=0===I,N=b,z=d.padding;let A=m;const _=!P?0:o.angle,G=o.segment>=0&&P,E=[],L=[],M=g,V=!G;let v=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,C=v,F=j;const S=(G||P)&&N,Y=T/r;let q=!1;for(const e of a)if(e.vertical){q=!0;break}let U,O=0,B=0;if(!G&&q){const e=l.getTextBox(a,d.lineHeight*r);switch(d.anchor){case 1:O=e.height/2,B=-e.width/2;break;case 2:O=-e.height/2,B=e.width/2;break;case 3:O=e.height/2,B=e.width/2;break;case 4:O=-e.height/2,B=-e.width/2;break;case 5:O=e.height;break;case 7:B=-e.width;break;case 6:B=e.width;break;case 8:O=-e.height}}O+=d.offset[0]*r,B+=d.offset[1]*r;for(const i of a){const a=i.glyphItem?.mosaicItem,l=i.glyphItem?.rect;if(!a||a.rect.isEmpty)continue;const r=a.rect,g=a.page;if(E&&V){if(void 0!==U&&U!==i.y){let e,t,i,n;q?(e=-F+O,t=v+B,i=F-C,n=j-v):(e=v+O,t=C+B,i=j-v,n=F-C);const a={xTile:o.x,yTile:o.y,dxPixels:e*Y-z,dyPixels:t*Y-z,hard:!d.optional,partIndex:1,width:i*Y+2*z,height:n*Y+2*z,angle:k,minLod:m,maxLod:s};E.push(a),v=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,C=v,F=j}U=i.y}const y=[];if(G){const e=.5*l.width,n=(i.x+l.left-M+e)*Y*t;if(A=this._placeGlyph(o,A,n,h,o.segment,1,i.vertical,g,y),N&&(A=this._placeGlyph(o,A,n,h,o.segment,-1,i.vertical,g,y)),A>=x)break}else y.push(new p(f,_,_,g,!1)),P&&N&&y.push(new p(f,_+n,_+n,g,!1));const b=i.x+l.left,u=i.y-c-l.top,I=b+l.width,T=u+l.height;let H,R,D,J,K,Q,W,X;if(!G&&q)if(i.vertical){const t=(b+I)/2-l.height/2,i=(u+T)/2+l.width/2;H=new e(-i-M+O,t-M+B),R=new e(H.x+r.width,H.y+r.height),D=new e(H.x,R.y),J=new e(R.x,H.y)}else H=new e(-u+M+O,b-M+B),R=new e(H.x-r.height,H.y+r.width),D=new e(R.x,H.y),J=new e(H.x,R.y);else H=new e(b-M+O,u-M+B),R=new e(H.x+r.width,H.y+r.height),D=new e(H.x,R.y),J=new e(R.x,H.y);for(const t of y){let n,s,a,h;if(t.alternateVerticalGlyph){if(!K){const t=(u+T)/2+B;K=new e((b+I)/2+O-l.height/2-M,t+l.width/2+M),Q=new e(K.x+r.height,K.y-r.width),W=new e(Q.x,K.y),X=new e(K.x,Q.y)}n=K,s=W,a=X,h=Q}else n=H,s=D,a=J,h=R;const c=u,g=T,m=t.glyphAngle+k;if(0!==m){const e=Math.cos(m),t=Math.sin(m);n=n.clone(),s=s?.clone(),a=a?.clone(),h=h?.clone(),n.rotate(e,t),h?.rotate(e,t),s?.rotate(e,t),a?.rotate(e,t)}let p=0,y=256;if(G&&q?i.vertical?t.alternateVerticalGlyph?(p=32,y=96):(p=224,y=32):(p=224,y=96):(p=192,y=64),L.push(new w(n,a,s,h,r,t.labelAngle,p,y,t.anchor,t.minzoom,t.maxzoom,t.page)),E&&(!S||this._legible(t.labelAngle)))if(V)b<v&&(v=b),c<C&&(C=c),I>j&&(j=I),g>F&&(F=g);else if(t.minzoom<x){const e={xTile:o.x,yTile:o.y,dxPixels:(b+O)*Y-z,dyPixels:(c+O)*Y-z,hard:!d.optional,partIndex:1,width:(I-b)*Y+2*z,height:(g-c)*Y+2*z,angle:m,minLod:t.minzoom,maxLod:t.maxzoom};E.push(e)}}}if(A>=x)return null;if(E&&V){let e,t,i,n;q?(e=-F+O,t=v+B,i=F-C,n=j-v):(e=v+O,t=C+B,i=j-v,n=F-C);const a={xTile:o.x,yTile:o.y,dxPixels:e*Y-z,dyPixels:t*Y-z,hard:!d.optional,partIndex:1,width:i*Y+2*z,height:n*Y+2*z,angle:k,minLod:m,maxLod:s};E.push(a)}const H=new y(L);return E&&E.length>0&&(H.textColliders=E),H}_legible(e){const t=a(e);return t<65||t>=193}_placeGlyph(t,i,a,l,r,c,g,m,x){let d=c;const w=d<0?o(t.angle+n,h):t.angle;let y=0;a<0&&(d*=-1,a*=-1,y=n),d>0&&++r;let f=new e(t.x,t.y),b=l[r],u=s;if(l.length<=r)return u;for(;;){const e=b.x-f.x,t=b.y-f.y,n=Math.sqrt(e*e+t*t),s=Math.max(a/n,i),c=e/n,I=t/n,T=o(Math.atan2(I,c)+y,h);if(x.push(new p(f,w,T,m,!1,s,u)),g&&x.push(new p(f,w,T,m,!0,s,u)),s<=i)return s;f=b.clone();do{if(r+=d,l.length<=r||r<0)return s;b=l[r]}while(f.isEqual(b));let k=b.x-f.x,P=b.y-f.y;const N=Math.sqrt(k*k+P*P);k*=n/N,P*=n/N,f.x-=k,f.y-=P,u=s}}}export{d as Anchor,w as PlacedSymbol,y as Placement,f as PlacementEngine};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isLineBreak as t,isWhiteSpace as e,allowsIdeographicBreak as i,hasVerticalOrientation as o}from"./ScriptUtils.js";import s from"../webgl/Rect.js";const c=24,h=17;class l{constructor(t,e,i,o,s,c,h){this._glyphItems=t,this._maxWidth=e,this._lineHeight=i,this._letterSpacing=o,this._hAnchor=s,this._vAnchor=c,this._justify=h}getShaping(s,c,h){const l=this._letterSpacing,n=this._lineHeight,a=this._justify,r=this._maxWidth,m=[];let f=0,p=0;for(const t of s){const e=t.codePointAt(0);if(null==e)continue;const i=h&&o(e);let s;for(const t of this._glyphItems)if(s=t[e],s)break;m.push({codePoint:e,x:f,y:p,vertical:i,glyphMosaicItem:s}),s&&(f+=s.metrics.advance+l)}let g=f;if(r>0){g=f/Math.max(1,Math.ceil(f/r))}const y=s.includes("​"),d=[],x=m.length;for(let e=0;e<x-1;e++){const o=m[e].codePoint,s=i(o);if(t(o)||s){let t=0;if(10===o)t-=1e4;else if(s&&y)t+=150;else{40!==o&&65288!==o||(t+=50);const i=m[e+1].codePoint;41!==i&&65289!==i||(t+=50)}d.push(this._buildBreak(e+1,m[e].x,g,d,t,!1))}}const u=this._optimalBreaks(this._buildBreak(x,f,g,d,0,!0));let M=0;const _=c?-n:n;let I=0;for(let t=0;t<u.length;t++){const i=u[t];let o=I;for(;o<i&&e(m[o].codePoint);)m[o].glyphMosaicItem=null,++o;let s=i-1;for(;s>o&&e(m[s].codePoint);)m[s].glyphMosaicItem=null,--s;if(o<=s){const t=m[o].x;for(let i=o;i<=s;i++)m[i].x-=t,m[i].y=p;let e=m[s].x;m[s].glyphMosaicItem&&(e+=m[s].glyphMosaicItem.metrics.advance),M=Math.max(e,M),a&&this._applyJustification(m,o,s)}I=i,p+=_}if(m.length>0){const t=u.length-1,e=(a-this._hAnchor)*M;let i=(-this._vAnchor*(t+1)+.5)*n;c&&t&&(i+=t*n);for(const o of m)o.x+=e,o.y+=i}return m.filter(t=>t.glyphMosaicItem)}static getTextBox(t,e){if(!t.length)return null;let i=1/0,o=1/0,s=0,c=0;for(const l of t){const t=l.glyphMosaicItem.metrics.advance,n=l.x,a=l.y-h,r=n+t,m=a+e;i=Math.min(i,n),s=Math.max(s,r),o=Math.min(o,a),c=Math.max(c,m)}return{x:i,y:o,width:s-i,height:c-o}}static getBox(t){if(!t.length)return null;let e=1/0,i=1/0,o=0,s=0;for(const c of t){const{height:t,left:h,top:l,width:n}=c.glyphMosaicItem.metrics,a=c.x,r=c.y-(t-Math.abs(l)),m=a+n+h,f=r+t;e=Math.min(e,a),o=Math.max(o,m),i=Math.min(i,r),s=Math.max(s,f)}return{x:e,y:i,width:o-e,height:s-i}}static addDecoration(t,e){const i=t.length;if(0===i)return;const o=3;let c=t[0].x+t[0].glyphMosaicItem.metrics.left,h=t[0].y;for(let n=1;n<i;n++){const i=t[n];if(i.y!==h){const l=t[n-1].x+t[n-1].glyphMosaicItem.metrics.left+t[n-1].glyphMosaicItem.metrics.width;t.push({codePoint:0,x:c,y:h+e-o,vertical:!1,glyphMosaicItem:{sdf:!0,rect:new s(4,0,4,8),metrics:{width:l-c,height:2+2*o,left:0,top:0,advance:0},page:0,code:0}}),h=i.y,c=i.x+i.glyphMosaicItem.metrics.left}}const l=t[i-1].x+t[i-1].glyphMosaicItem.metrics.left+t[i-1].glyphMosaicItem.metrics.width;t.push({codePoint:0,x:c,y:h+e-o,vertical:!1,glyphMosaicItem:{sdf:!0,rect:new s(4,0,4,8),metrics:{width:l-c,height:2+2*o,left:0,top:0,advance:0},page:0,code:0}})}_breakScore(t,e,i,o){const s=(t-e)*(t-e);return o?t<e?s/2:2*s:s+Math.abs(i)*i}_buildBreak(t,e,i,o,s,c){let h=null,l=this._breakScore(e,i,s,c);for(const n of o){const t=e-n.x,o=this._breakScore(t,i,s,c)+n.score;o<=l&&(h=n,l=o)}return{index:t,x:e,score:l,previousBreak:h}}_optimalBreaks(t){return t?this._optimalBreaks(t.previousBreak).concat(t.index):[]}_applyJustification(t,e,i){const o=t[i],s=o.vertical?c:o.glyphMosaicItem?o.glyphMosaicItem.metrics.advance:0,h=(o.x+s)*this._justify;for(let c=e;c<=i;c++)t[c].x-=h}}export{l as TextShaping,h as sdfGlyphBaseline,c as sdfGlyphSize};
2
+ import{isLineBreak as t,isWhiteSpace as e,allowsIdeographicBreak as i,hasVerticalOrientation as h}from"./ScriptUtils.js";import o from"../webgl/Rect.js";const n=24,s=17;class c{constructor(t,e,i,h,o,n,s){this._glyphItems=t,this._maxWidth=e,this._lineHeight=i,this._letterSpacing=h,this._hAnchor=o,this._vAnchor=n,this._justify=s}getShaping(o,n,s){const c=this._letterSpacing,l=this._lineHeight,r=this._justify,a=this._maxWidth,f=[];let p=0,g=0;for(const t of o){const e=t.codePointAt(0);if(null==e)continue;const i=s&&h(e);let o;for(const t of this._glyphItems)if(o=t[e],o)break;f.push({codePoint:e,x:p,y:g,vertical:i,glyphItem:o}),o&&(p+=o.shaping.xAdvance+c)}let m=p;if(a>0){m=p/Math.max(1,Math.ceil(p/a))}const x=o.includes("​"),y=[],d=f.length;for(let e=0;e<d-1;e++){const h=f[e].codePoint,o=i(h);if(t(h)||o){let t=0;if(10===h)t-=1e4;else if(o&&x)t+=150;else{40!==h&&65288!==h||(t+=50);const i=f[e+1].codePoint;41!==i&&65289!==i||(t+=50)}y.push(this._buildBreak(e+1,f[e].x,m,y,t,!1))}}const u=this._optimalBreaks(this._buildBreak(d,p,m,y,0,!0));let _=0;const I=n?-l:l;let v=0;for(let t=0;t<u.length;t++){const i=u[t];let h=v;for(;h<i&&e(f[h].codePoint);)f[h].glyphItem=null,++h;let o=i-1;for(;o>h&&e(f[o].codePoint);)f[o].glyphItem=null,--o;if(h<=o){const t=f[h].x;for(let i=h;i<=o;i++)f[i].x-=t,f[i].y=g;let e=f[o].x;f[o].glyphItem&&(e+=f[o].glyphItem.shaping.xAdvance),_=Math.max(e,_),r&&this._applyJustification(f,h,o)}v=i,g+=I}if(f.length>0){const t=u.length-1,e=(r-this._hAnchor)*_;let i=(-this._vAnchor*(t+1)+.5)*l;n&&t&&(i+=t*l);for(const h of f)h.x+=e,h.y+=i}return f.filter(t=>t.glyphItem)}static getTextBox(t,e){if(!t.length)return null;let i=1/0,h=1/0,o=0,n=0;for(const c of t){const t=c.glyphItem.shaping.xAdvance,l=c.x,r=c.y-s,a=l+t,f=r+e;i=Math.min(i,l),o=Math.max(o,a),h=Math.min(h,r),n=Math.max(n,f)}return{x:i,y:h,width:o-i,height:n-h}}static getBox(t){if(!t.length)return null;let e=1/0,i=1/0,h=0,o=0;for(const n of t){const{height:t,left:s,top:c,width:l}=n.glyphItem.rect,r=n.x,a=n.y-(t-Math.abs(c)),f=r+l+s,p=a+t;e=Math.min(e,r),h=Math.max(h,f),i=Math.min(i,a),o=Math.max(o,p)}return{x:e,y:i,width:h-e,height:o-i}}static addDecoration(t,e){const i=t.length;if(0===i)return;const h=3,n={rect:new o(4,0,4,8),sdf:!0,page:0};let s=t[0].x+t[0].glyphItem.rect.left,c=t[0].y;for(let o=1;o<i;o++){const i=t[o];if(i.y!==c){const l=t[o-1].x+t[o-1].glyphItem.rect.left+t[o-1].glyphItem.rect.width;t.push({codePoint:0,x:s,y:c+e-h,vertical:!1,glyphItem:{mosaicItem:n,rect:{width:l-s,height:2+2*h,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0},code:0}}),c=i.y,s=i.x+i.glyphItem.rect.left}}const l=t[i-1].x+t[i-1].glyphItem.rect.left+t[i-1].glyphItem.rect.width;t.push({codePoint:0,x:s,y:c+e-h,vertical:!1,glyphItem:{mosaicItem:n,rect:{width:l-s,height:2+2*h,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0},code:0}})}_breakScore(t,e,i,h){const o=(t-e)*(t-e);return h?t<e?o/2:2*o:o+Math.abs(i)*i}_buildBreak(t,e,i,h,o,n){let s=null,c=this._breakScore(e,i,o,n);for(const l of h){const t=e-l.x,h=this._breakScore(t,i,o,n)+l.score;h<=c&&(s=l,c=h)}return{index:t,x:e,score:c,previousBreak:s}}_optimalBreaks(t){return t?this._optimalBreaks(t.previousBreak).concat(t.index):[]}_applyJustification(t,e,i){const h=t[i],o=h.vertical?n:h.glyphItem?h.glyphItem.shaping.xAdvance:0,s=(h.x+o)*this._justify;for(let n=e;n<=i;n++)t[n].x-=s}}export{c as TextShaping,s as sdfGlyphBaseline,n as sdfGlyphSize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{dataDrivenUnit2 as s,dataDrivenUnit1 as r,dataDrivenUnit0 as a,visualVariableUnit as n,localTimeOriginUnit as u,gpgpuUnit as h,animationUnit as o,filterFlagsUnit as d}from"./definitions.js";import{getDisplayIdTexel as l}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as g}from"./Utils.js";import{DisposableFramebufferObject as _}from"../../../webgl/FramebufferObject.js";import c from"../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";const f=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class b{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:a}=t,n=p(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 x(this.size);return t.wrapMode=33071,t.samplingMode=9728,t.dataType=this.pixelType,t}get usedMemory(){return null!=this.data?i(this.data):0}setData(t,e,i){const s=l(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=l(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 _(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,d=h,l=this.size,g=o,_=h*this.size*u,c=(l+g*this.size)*u-_,x=p(this.pixelType),b=new x(a,_*x.BYTES_PER_ELEMENT,c),m=this.size,T=g-d+1;if(T>this.size)return void f().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));n.updateData(0,0,d,m,T,b)}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=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new c(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=g(r),h=new(p(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.boundFramebuffer,{x:d,y:l,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(d,l,_,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class m{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}get locked(){return this._locked}get usedMemory(){let t=0;for(const e of this._data??[])null!=e&&(t+=e.usedMemory);return t}_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 b(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 b(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,0,1,e)}setLocalTimeOrigin(t,e){this.setData(t,7,0,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVisualVariableData(t,e){return this.getData(t,3,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,0),unit:d},animation:{texture:this._getTexture(t,1),unit:o},gpgpu:{texture:this._getTexture(t,2),unit:h},localTimeOrigin:{texture:this._getTexture(t,7),unit:u},visualVariableData:{texture:this._getTexture(t,3),unit:n},dataDriven0:{texture:this._getTexture(t,4),unit:a},dataDriven1:{texture:this._getTexture(t,5),unit:r},dataDriven2:{texture:this._getTexture(t,6),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 x(1);e.wrapMode=33071,e.samplingMode=9728,this._defaultTexture=new c(t,e,new Uint8Array(4))}return this._defaultTexture}}export{m as AttributeStoreView};
2
+ import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{dataDrivenUnit2 as s,dataDrivenUnit1 as r,dataDrivenUnit0 as a,visualVariableUnit as n,localTimeOriginUnit as u,gpgpuUnit as h,animationUnit as o,filterFlagsUnit as d}from"./definitions.js";import{getDisplayIdTexel as l}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as g}from"./Utils.js";import{DisposableFramebufferObject as _}from"../../../webgl/FramebufferObject.js";import c from"../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";const f=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class b{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:a}=t,n=p(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 x(this.size);return t.wrapMode=33071,t.samplingMode=9728,t.dataType=this.pixelType,t}get usedMemory(){return null!=this.data?i(this.data):0}setData(t,e,i){const s=l(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=l(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 _(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,d=h,l=this.size,g=o,_=h*this.size*u,c=(l+g*this.size)*u-_,x=p(this.pixelType),b=new x(a,_*x.BYTES_PER_ELEMENT,c),m=this.size,T=g-d+1;if(T>this.size)return void f().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));n.updateData(0,0,d,m,T,b)}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=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new c(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=g(r),h=new(p(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.boundFramebuffer,{x:d,y:l,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(d,l,_,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class m{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}get locked(){return this._locked}get usedMemory(){let t=0;for(const e of this._data??[])null!=e&&(t+=e.usedMemory);return t}_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 b(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 b(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,0,1,e)}setLocalTimeOrigin(t,e){this.setData(t,7,0,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVisualVariableData(t,e){return this.getData(t,3,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(){return{size:this.size}}getTextures(t){return{filterFlags:{texture:this._getTexture(t,0),unit:d},animation:{texture:this._getTexture(t,1),unit:o},gpgpu:{texture:this._getTexture(t,2),unit:h},localTimeOrigin:{texture:this._getTexture(t,7),unit:u},visualVariableData:{texture:this._getTexture(t,3),unit:n},dataDriven0:{texture:this._getTexture(t,4),unit:a},dataDriven1:{texture:this._getTexture(t,5),unit:r},dataDriven2:{texture:this._getTexture(t,6),unit:s}}}_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 x(1);e.wrapMode=33071,e.samplingMode=9728,this._defaultTexture=new c(t,e,new Uint8Array(4))}return this._defaultTexture}}export{m as AttributeStoreView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../../../request.js";import{bidiText as e}from"../../../../core/BidiText.js";import has from"../../../../core/has.js";import{throwIfNotAbortError as s}from"../../../../core/promiseUtils.js";import{loadTextModule as i}from"../../../../libs/text/loadTextModule.js";import{sdfRadiusComplex as h,sdfBufferGlyphSDFCreator as r,sdfSizeComplex as a,sdfBufferServer as n,sdfRadiusSimple as o,sdfSizeSimple as c}from"./definitions.js";import{GlyphSDFCreator as l}from"./GlyphSDFCreator.js";import p from"./Rect.js";import g from"./RectangleBinPack.js";import{charCodes as _}from"./Utils.js";import d from"../../../webgl/Texture.js";import{TextureDescriptor as f}from"../../../webgl/TextureDescriptor.js";const u=256,y=.25,m=t=>Math.floor(t/256);function w(t){const e=new Set;for(const s of t)e.add(m(s));return e}function C(t,e,i){return t.has(e)||t.set(e,i().then(()=>{t.delete(e)}).catch(i=>{t.delete(e),s(i)})),t.get(e)}const x=t=>({rect:new p(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,s,i=!1){this._snapCoords=i,this.width=0,this.height=0,this._dirties=[],this._pageData=[],this._currentPage=0,this._glyphCache={},this._glyphCacheById={},this._textures=[],this._rangePromises=new Map,this._facePromises=new Map,this._preloadCache={},this._glyphSDFCreator=new l({sdfSizePx:a,sdfBufferPx:r,radius:h,cutoff:y}),this._faces=new Map,this.width=t,this.height=e,this._glyphSource=s,this._binPack=new g(t,e),this._pageData.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._pageData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],s=[];for(let a=0;a<t.length;a++){const i=t[a];for(let t=0;t<11;t++){const h=a>=3&&a<5&&t>=3&&t<8?255:0;e.push(i),s.push(h)}}const i={width:5,height:2,left:0,top:0,advance:0},h=new Uint8Array(e),r=new Uint8Array(s);this._recordGlyph(i,h,n),this._recordGlyph(i,r,n)}getTexture(t,e){if(!this._textures[e]){const s=new f(this.width,this.height);s.pixelFormat=6406,s.wrapMode=33071,this._textures[e]=new d(t,s,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._pageData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(t,s,i,l){const p=s?a:c,g=s?h:o,d=s?r:n;let f,u=[],y=!1;if(s){const s=this._getGlyphCacheById(i),h=await this.getFace(i);if(!h)return null;const r=this._glyphSDFCreator.sdfSizePx,[a,n,o]=e(t,!1);y=n;const c=new Uint32Array(Array.from(a).map((t,e)=>o.levels[o.targetToSource[e]]));f={baseline:h.baseline()/r,midline:h.midline()/r},u=h.shape(a,c,r).map(t=>this._getMosaicItemComplex(s,t,h))}else{const[s,h,r]=e(t);y=h;const a=this._getGlyphCache(i),n=_(s);try{await this._fetchRanges(i,n,l)}catch{return null}for(const t of n){const e=this._getMosaicItem(a,i,t);e&&u.push(e)}}return{type:"glyphs",isRightToLeft:y,glyphs:u,faceInfo:f,sdfSize:p,sdfRadius:g,sdfPadding:d}}async getGlyphItemsVTL(t,e){const s=this._getGlyphCache(t);await this._fetchRanges(t,e,null);const i=[];for(const h of e){const e=this._getMosaicItem(s,t,h,!0);e&&(i[h]=e)}return i}async getFace(e){if(this._faces.has(e))return this._faces.get(e);const s=this._glyphSource.woffURL(e);return await C(this._facePromises,e,async()=>{const h=await t(s,{responseType:"array-buffer"}),r=(await i()).Face.parseWoff2(new Uint8Array(h.data));this._faces.set(e,r)}),this._faces.get(e)}_getMosaicItem(t,e,s,i=!1){if(!t[s]){const{metrics:h,bitmap:r}=this._glyphSource.getGlyph(e,s);if(i&&!h)return;if(!h)return x(s);const a=r?this._recordGlyph(h,r,n):new p(0,0,0,0),o=this._currentPage;t[s]={rect:a,page:o,metrics:h,code:s,sdf:!0},this._invalidate()}return t[s]}_getMosaicItemComplex(t,e,s){if(!t[e.glyphId]){const i=this._glyphSDFCreator.draw(s,e.glyphId),h={width:i?.width??0,height:i?.height??0,left:i?.left??0,top:i?.top??0,advance:e.xAdvance},a=i?this._recordGlyph(h,i.buffer,r):new p(0,0,0,0),n=e.isNewline?10:e.isWhitespace?32:NaN;t[e.glyphId]={rect:a,page:this._currentPage,metrics:h,sdf:!0,code:n}}return t[e.glyphId]}bind(t,e,s,i){const h=this.getTexture(t,s);h.setSamplingMode(e),t.bindTexture(h,i)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const s=this._glyphSource.preloadASCIIRange(t).then(()=>{const e=this._getGlyphCache(t);for(let s=0;s<256;s++)this._getMosaicItem(e,t,s)});return this._preloadCache[t]=s,s}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_getGlyphCacheById(t){return this._glyphCacheById[t]||(this._glyphCacheById[t]={}),this._glyphCacheById[t]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,s){const i=w(e),h=[];i.forEach(e=>{h.push(this._fetchRange(t,e,s))}),await Promise.all(h)}async _fetchRange(t,e,s){if(e>u)return;const i=t+e;return C(this._rangePromises,i,()=>this._glyphSource.getRange(t,e,s))}_allocNewPage(){this._dirties[this._currentPage]||(this._pageData[this._currentPage]=null),this._currentPage=this._pageData.length,this._pageData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new g(this.width,this.height)}_recordGlyph(t,e,s){let i;if(0===t.width)i=new p(0,0,0,0);else{const h=t.width+2*s,r=t.height+2*s;let a=h,n=r;if(this._snapCoords){a+=h%4?4-h%4:4,n+=r%4?4-r%4:4}i=this._binPack.allocate(a,n),i.isEmpty&&(this._allocNewPage(),i=this._binPack.allocate(a,n));const o=this._pageData[this._currentPage];for(let t=0;t<r;t++){const s=h*t,r=this.width*(i.y+t)+i.x;for(let t=0;t<h;t++)o[r+t]=e[s+t]}has("esri-glyph-debug")&&this._showDebugPage(o)}return i}_showDebugPage(t){const e=document.createElement("canvas"),s=e.getContext("2d"),i=new ImageData(this.width,this.height),h=i.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let r=0;r<t.length;++r)h[4*r]=t[r],h[4*r+1]=0,h[4*r+2]=0,h[4*r+3]=255;s.putImageData(i,0,0),document.body.appendChild(e)}}export{P as default};
2
+ import t from"../../../../request.js";import{bidiText as e}from"../../../../core/BidiText.js";import has from"../../../../core/has.js";import{throwIfNotAbortError as s}from"../../../../core/promiseUtils.js";import{loadTextModule as i}from"../../../../libs/text/loadTextModule.js";import{sdfRadiusComplex as h,sdfBufferGlyphSDFCreator as a,sdfSizeComplex as r,sdfBufferServer as n,sdfRadiusSimple as o,sdfSizeSimple as c}from"./definitions.js";import{GlyphSDFCreator as l}from"./GlyphSDFCreator.js";import g from"./Rect.js";import p from"./RectangleBinPack.js";import{charCodes as d}from"./Utils.js";import _ from"../../../webgl/Texture.js";import{TextureDescriptor as f}from"../../../webgl/TextureDescriptor.js";const u=256,y=.25,m=t=>Math.floor(t/256);function w(t){const e=new Set;for(const s of t)e.add(m(s));return e}function x(t,e,i){return t.has(e)||t.set(e,i().then(()=>{t.delete(e)}).catch(i=>{t.delete(e),s(i)})),t.get(e)}const C=t=>({mosaicItem:{rect:new g(0,0,0,0),sdf:!0,page:0},rect:{left:0,width:0,height:0,top:0},shaping:{xAdvance:0,yAdvance:0,xOffset:0,yOffset:0},code:t});class I{constructor(t,e,s,i=!1){this._snapCoords=i,this.width=0,this.height=0,this._dirties=[],this._pageData=[],this._currentPage=0,this._glyphCache={},this._glyphCacheById={},this._textures=[],this._rangePromises=new Map,this._facePromises=new Map,this._preloadCache={},this._glyphSDFCreator=new l({sdfSizePx:r,sdfBufferPx:a,radius:h,cutoff:y}),this._faces=new Map,this.width=t,this.height=e,this._glyphSource=s,this._binPack=new p(t,e),this._pageData.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._pageData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],s=[];for(let r=0;r<t.length;r++){const i=t[r];for(let t=0;t<11;t++){const h=r>=3&&r<5&&t>=3&&t<8?255:0;e.push(i),s.push(h)}}const i={width:5,height:2,left:0,top:0,advance:0},h=new Uint8Array(e),a=new Uint8Array(s);this._recordGlyph(i,h,n),this._recordGlyph(i,a,n)}getTexture(t,e){if(!this._textures[e]){const s=new f(this.width,this.height);s.pixelFormat=6406,s.wrapMode=33071,this._textures[e]=new _(t,s,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._pageData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(t,s,i,l){const g=s?r:c,p=s?h:o,_=s?a:n;let f,u=[],y=!1;if(s){const s=this._getGlyphCacheById(i),h=await this.getFace(i);if(!h)return null;const a=this._glyphSDFCreator.sdfSizePx,[r,n,o]=e(t,!1);y=n;const c=new Uint32Array(Array.from(r).map((t,e)=>o.levels[o.targetToSource[e]]));f={baseline:h.baseline()/a,midline:h.midline()/a},u=h.shape(r,c,a).map(t=>this._getMosaicItemComplex(s,t,h))}else{const[s,h,a]=e(t);y=h;const r=this._getGlyphCache(i),n=d(s);try{await this._fetchRanges(i,n,l)}catch{return null}for(const t of n){const e=this._getMosaicItem(r,i,t);e&&u.push(e)}}return{type:"glyphs",isRightToLeft:y,glyphs:u,faceInfo:f,sdfSize:g,sdfRadius:p,sdfPadding:_}}async getGlyphItemsVTL(t,e){const s=this._getGlyphCache(t);await this._fetchRanges(t,e,null);const i=[];for(const h of e){const e=this._getMosaicItem(s,t,h,!0);e&&(i[h]=e)}return i}async getFace(e){if(this._faces.has(e))return this._faces.get(e);const s=this._glyphSource.woffURL(e);return await x(this._facePromises,e,async()=>{const h=await t(s,{responseType:"array-buffer"}),a=(await i()).Face.parseWoff2(new Uint8Array(h.data));this._faces.set(e,a)}),this._faces.get(e)}_getMosaicItem(t,e,s,i=!1){if(!t[s]){const h=this._glyphSource.getRange(e,s),a=h?.getRect(s),r=h?.getShaping(s),o=h?.getBitmap(s);if(i&&(!a||!r))return;if(!a||!r)return C(s);const c=o?this._recordGlyph(a,o,n):new g(0,0,0,0),l=this._currentPage;t[s]={mosaicItem:{rect:c,sdf:!0,page:l},rect:a,shaping:r,code:s},this._invalidate()}return t[s]}_getMosaicItemComplex(t,e,s){if(!t[e.glyphId]){const i=this._glyphSDFCreator.draw(s,e.glyphId),h=i??{width:0,height:0,top:0,left:0},r=i?this._recordGlyph(h,i.buffer,a):new g(0,0,0,0),n=e.isNewline?10:e.isWhitespace?32:NaN,o={rect:r,sdf:!0,page:this._currentPage};t[e.glyphId]={mosaicItem:o,rect:h,shaping:void 0,code:n}}return{...t[e.glyphId],shaping:{xOffset:e.xOffset,yOffset:e.yOffset,xAdvance:e.xAdvance,yAdvance:e.yAdvance}}}bind(t,e,s,i){const h=this.getTexture(t,s);h.setSamplingMode(e),t.bindTexture(h,i)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const s=this._glyphSource.preloadASCIIRange(t).then(()=>{const e=this._getGlyphCache(t);for(let s=0;s<256;s++)this._getMosaicItem(e,t,s)});return this._preloadCache[t]=s,s}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_getGlyphCacheById(t){return this._glyphCacheById[t]||(this._glyphCacheById[t]={}),this._glyphCacheById[t]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,s){const i=w(e),h=[];i.forEach(e=>{h.push(this._fetchRange(t,e,s))}),await Promise.all(h)}async _fetchRange(t,e,s){if(e>u)return;const i=t+e;return x(this._rangePromises,i,()=>this._glyphSource.fetchRange(t,e,s))}_allocNewPage(){this._dirties[this._currentPage]||(this._pageData[this._currentPage]=null),this._currentPage=this._pageData.length,this._pageData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new p(this.width,this.height)}_recordGlyph(t,e,s){let i;if(0===t.width)i=new g(0,0,0,0);else{const h=t.width+2*s,a=t.height+2*s;let r=h,n=a;if(this._snapCoords){r+=h%4?4-h%4:4,n+=a%4?4-a%4:4}i=this._binPack.allocate(r,n),i.isEmpty&&(this._allocNewPage(),i=this._binPack.allocate(r,n));const o=this._pageData[this._currentPage];for(let t=0;t<a;t++){const s=h*t,a=this.width*(i.y+t)+i.x;for(let t=0;t<h;t++)o[a+t]=e[s+t]}has("esri-glyph-debug")&&this._showDebugPage(o)}return i}_showDebugPage(t){const e=document.createElement("canvas"),s=e.getContext("2d"),i=new ImageData(this.width,this.height),h=i.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let a=0;a<t.length;++a)h[4*a]=t[a],h[4*a+1]=0,h[4*a+2]=0,h[4*a+3]=255;s.putImageData(i,0,0),document.body.appendChild(e)}}export{I as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../../../config.js";import e from"../../../../request.js";import a from"../../../../core/pbf.js";class s{constructor(t){this._metrics=[],this._bitmaps=[];const e=new Map;let a=0;for(;t.next();)switch(t.tag()){case 1:{const s=t.getMessage();for(;s.next();)switch(s.tag()){case 3:{const t=s.getMessage();let r,n,i,c,o,g,f;for(;t.next();)switch(t.tag()){case 1:r=t.getUInt32();break;case 2:n=t.getBytes();break;case 3:i=t.getUInt32();break;case 4:c=t.getUInt32();break;case 5:o=t.getSInt32();break;case 6:g=t.getSInt32();break;case 7:f=t.getUInt32();break;default:t.skip()}if(t.release(),r&&(this._metrics[r]={width:i,height:c,left:o,top:g,advance:f},n)){const t=n.length;e.set(r,n),this._bitmaps[r]={start:a,length:t},a+=t}break}default:s.skip()}s.release();break}default:t.skip()}this._buffer=new Uint8Array(a);for(const[s,r]of e)this._buffer.set(r,this._bitmaps[s].start)}getMetrics(t){return this._metrics.at(t)}getBitmap(t){const e=this._bitmaps.at(t);if(void 0!==e&&0!==e.length)return this._buffer.subarray(e.start,e.start+e.length)}}class r{constructor(){this._ranges=[]}getRange(t){return this._ranges.at(t)}addRange(t,e){this._ranges[t]=e}}class n{constructor(e){this._glyphInfo={},this._baseURL=e,this._woff2URL=`${t.fontsUrl}/woff2/{fontstack}.woff2`}async getRange(t,r,n){const i=this._getFontStack(t);if(i.getRange(r))return;const c=256*r,o=c+255,g=this._baseURL.replace("{fontstack}",t).replace("{range}",c+"-"+o);return e(g,{responseType:"array-buffer",...n}).then(t=>{i.addRange(r,new s(new a(new Uint8Array(t.data),new DataView(t.data))))})}async preloadASCIIRange(t){const r=this._getFontStack(t),n=0,i=255,c=this._baseURL.replace("{fontstack}",t).replace("{range}",n+"-"+i),o=await e(c,{responseType:"array-buffer"}),g=new s(new a(new Uint8Array(o.data),new DataView(o.data)));for(let e=n;e<=i;e++)r.getRange(e)||r.addRange(e,g)}getGlyph(t,e){let a,s;const r=this._getFontStack(t).getRange(Math.floor(e/256));return r&&(a=r.getMetrics(e),s=r.getBitmap(e)),{metrics:a,bitmap:s}}woffURL(t){return this._woff2URL.replace("{fontstack}",t)}_getFontStack(t){let e=this._glyphInfo[t];return e||(e=this._glyphInfo[t]=new r),e}}export{n as default};
2
+ import t from"../../../../config.js";import e from"../../../../request.js";import a from"../../../../core/pbf.js";class s{constructor(t){this._rects=[],this._shapings=[],this._bitmaps=[];const e=new Map;let a=0;for(;t.next();)switch(t.tag()){case 1:{const s=t.getMessage();for(;s.next();)switch(s.tag()){case 3:{const t=s.getMessage();let n,r,i,c,o,f,g;for(;t.next();)switch(t.tag()){case 1:n=t.getUInt32();break;case 2:r=t.getBytes();break;case 3:i=t.getUInt32();break;case 4:c=t.getUInt32();break;case 5:o=t.getSInt32();break;case 6:f=t.getSInt32();break;case 7:g=t.getUInt32();break;default:t.skip()}if(t.release(),n){const t={width:i,height:c,left:o,top:f};this._rects[n]=t;const s={xOffset:0,yOffset:0,xAdvance:g,yAdvance:0};if(this._shapings[n]=s,r){const t=r.length;e.set(n,r),this._bitmaps[n]={start:a,length:t},a+=t}}break}default:s.skip()}s.release();break}default:t.skip()}this._buffer=new Uint8Array(a);for(const[s,n]of e)this._buffer.set(n,this._bitmaps[s].start)}getRect(t){return this._rects.at(t)}getShaping(t){return this._shapings.at(t)}getBitmap(t){const e=this._bitmaps.at(t);if(void 0!==e&&0!==e.length)return this._buffer.subarray(e.start,e.start+e.length)}}class n{constructor(){this._ranges=[]}getRange(t){return this._ranges.at(t)}addRange(t,e){this._ranges[t]=e}}class r{constructor(e){this._glyphInfo={},this._baseURL=e,this._woff2URL=`${t.fontsUrl}/woff2/{fontstack}.woff2`}async fetchRange(t,n,r){const i=this._getFontStack(t);if(i.getRange(n))return;const c=256*n,o=c+255,f=this._baseURL.replace("{fontstack}",t).replace("{range}",c+"-"+o);return e(f,{responseType:"array-buffer",...r}).then(t=>{i.addRange(n,new s(new a(new Uint8Array(t.data),new DataView(t.data))))})}async preloadASCIIRange(t){const n=this._getFontStack(t),r=0,i=255,c=this._baseURL.replace("{fontstack}",t).replace("{range}",r+"-"+i),o=await e(c,{responseType:"array-buffer"}),f=new s(new a(new Uint8Array(o.data),new DataView(o.data)));for(let e=r;e<=i;e++)n.getRange(e)||n.addRange(e,f)}getRange(t,e){return this._getFontStack(t)?.getRange(Math.floor(e/256))}woffURL(t){return this._woff2URL.replace("{fontstack}",t)}_getFontStack(t){let e=this._glyphInfo[t];return e||(e=this._glyphInfo[t]=new n),e}}export{r as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Handles.js";import i from"../../../../core/Logger.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{getProjectiveTransform as n}from"../../../../core/perspectiveUtils.js";import{watch as o,initial as a,when 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{DisplayObject as u}from"../DisplayObject.js";import{createPlayer as c,updateIfNeeded as f}from"./animatedFormats/utils.js";import y from"../../../webgl/Texture.js";import{TextureDescriptor as w}from"../../../webgl/TextureDescriptor.js";const x=[1,1],v=l(),_={none:"None",loop:"Loop",oscillate:"Oscillate"};function g(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?_[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class A extends u{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._playAnimation=!0,this._handles.add([o(()=>this.elementView.element.opacity,e=>this.opacity=e,a),o(()=>[this.elementView.coords],()=>{this.requestRender()},a),o(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this.texture=s(this.texture),this.requestRender()},a),d(()=>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())},a)]),n.element.load().catch(t=>{i.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(){super.destroy(),this._handles.destroy(),this.texture=s(this.texture)}get textureSize(){return x}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const i=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,n=i?r.naturalWidth:s?r.videoWidth:r.width,o=i?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(n,o),this.texture)if(s)if(r.readyState>=r.HAVE_CURRENT_DATA)e.animationsEnabled&&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"getFrame"in r&&e.animationsEnabled&&this.requestRender();else{const e=new w(n,o);if(e.wrapMode=33071,e.preMultiplyAlpha=!0,"getFrame"in r){const i=r=>{this.texture?this.texture.setData(r):this.texture=new y(t,e,r)};if("animationOptions"in this.elementView.element){const e=g(this.elementView.element.animationOptions);this._playAnimation=e.playAnimation??!1,this._player=c(r,e,null,i)}}else this.texture=new y(t,e,r);this.texture.generateMipmap(),s&&this._requestVideoFrame(r)}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),this._requestVideoFrame(e)}_requestVideoFrame(e){"requestVideoFrameCallback"in e?e.requestVideoFrameCallback(()=>this.requestRender()):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,t){this.isReady&&null!=this.texture?(this._playAnimation&&f(e,this._player),t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:x,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,i){const{coords:s,bounds:n}=this.elementView;if(null==s||null==n)return;const[o,a,d,l]=s.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(i){const[e,,t]=n,{worldWidth:r,xBounds:s}=i,[o,a]=s;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(v,[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,v[6]/v[8]*e,v[7]/v[8]*t)}}export{A as default};
2
+ import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Handles.js";import i from"../../../../core/Logger.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{getProjectiveTransform as n}from"../../../../core/perspectiveUtils.js";import{watch as o,initial as a,when 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{DisplayObject as u}from"../DisplayObject.js";import{createPlayer as c,updateIfNeeded as f}from"./animatedFormats/utils.js";import y from"../../../webgl/Texture.js";import{TextureDescriptor as w}from"../../../webgl/TextureDescriptor.js";const x=[1,1],v=l(),_={none:"None",loop:"Loop",oscillate:"Oscillate"};function g(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?_[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class A extends u{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._playAnimation=!0,this._handles.add([o(()=>this.elementView.element.opacity,e=>this.opacity=e,a),o(()=>[this.elementView.coords],()=>{this.requestRender()},a),o(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this.texture=s(this.texture),this.requestRender()},a),d(()=>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())},a)]),n.element.load().catch(t=>{i.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(){super.destroy(),this._handles.destroy(),this.texture=s(this.texture)}get textureSize(){return x}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const i=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,n=i?r.naturalWidth:s?r.videoWidth:r.width,o=i?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(n,o),this.texture)if(s)if(r.readyState>=r.HAVE_CURRENT_DATA)e.animationsEnabled&&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"getFrame"in r&&e.animationsEnabled&&this.requestRender();else{const e=new w(n,o);if(e.wrapMode=33071,e.preMultiplyAlpha=!0,"getFrame"in r){const i=r=>{this.texture?this.texture.setData(r):this.texture=new y(t,e,r)};if("animationOptions"in this.elementView.element){const e=g(this.elementView.element.animationOptions);this._playAnimation=e.playAnimation??!1,this._player=c(r,e,null,i)}}else this.texture=new y(t,e,r);this.texture.generateMipmap(),s&&this._requestVideoFrame(r)}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),this._requestVideoFrame(e)}_requestVideoFrame(e){"requestVideoFrameCallback"in e?e.requestVideoFrameCallback(()=>this.requestRender()):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,t){this.isReady&&null!=this.texture?(this._playAnimation&&f(e,this._player),t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:x,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,i){const{coords:s,bounds:n}=this.elementView;if(null==s||null==n)return;const[o,a,d,l]=s.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(i){const[e,,t]=n,{worldWidth:r,xBounds:s}=i,[o,a]=s;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(v,[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,v[6]/v[8]*e,v[7]/v[8]*t)}}export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- 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 l from"../../../../geometry/Polygon.js";import{project as h}from"../../../../geometry/projectionUtils.js";import u from"../../../../layers/support/ControlPoint.js";import{DisplayObject as p}from"../DisplayObject.js";import m from"../../../layers/support/GeometryClipArea.js";import c from"../../../webgl/Texture.js";import{TextureDescriptor as d}from"../../../webgl/TextureDescriptor.js";const f=2;class x extends p{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(){super.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||t.animationsEnabled&&this.texture.setData(e);else{const t=new d(i,s);t.wrapMode=33071,t.preMultiplyAlpha=!0,this.texture=new c(r,t,e)}e.paused||null==this._vertices||this.texture.generateMipmap(),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const s=this.element,o=this._getFrameInfo();if(!s||!o)return;const{spatialReference:n}=r;this._initializeData(t,o,n);const{controlPoints:a,horizon:u}=o,p=Math.sqrt(a.length),c=p,{x:d,y:x}=t,y=this._vertices,g=a[0],w=a[p-1],P=a[(c-1)*p],_=a[(c-1)*p+p-1],v=h(u?u[0].mapPoint:g.mapPoint,n),j=h(u?u[1].mapPoint:w.mapPoint,n),A=h(P.mapPoint,n),M=h(_.mapPoint,n);this.clipGeometry=u?new m({geometry:l.fromJSON({rings:[[[A.x,A.y],[M.x,M.y],[j.x,j.y],[v.x,v.y],[A.x,A.y]]],spatialReference:n})}):null;for(let l=0;l<a.length;l++){const t=a[l],{sourcePoint:e,mapPoint:r}=t;if(null==e||null==r)continue;const i=h(r,n);y[l*f+0]=i.x-d,y[l*f+1]=i.y-x}let C=e;if(i){const t=Math.min(v.x,j.x,A.x,M.x),e=Math.max(v.x,j.x,A.x,M.x),{worldWidth:r,xBounds:s}=i,[o,n]=s;t<o&&e>o?C=r:e>n&&t<n&&(C=-r)}this.wrapAroundShift=C,this.isWrapAround=0!==C}draw(t,e){if(!this.visible)return;if(!(this.isReady&&this._vertices&&this._indices&&this._texCoords))return void this.requestRender();this.stage||console.warn("OverlayMultipoint: stage is null"),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})}_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 p=0;p<i.length;p++){const e=i[p],{sourcePoint:s,mapPoint:o}=e;if(null==s||null==o)continue;const l=h(o,r);n[p*f+0]=l.x-t.x,n[p*f+1]=l.y-t.y,a[2*p+0]=s.x,a[2*p+1]=s.y}const l=new Uint16Array(o*s+(o-2)*(s+2));let u=0;for(let h=0;h<o;h++){for(let t=0;t<s;t++)l[u++]=h*s+t,l[u++]=(h+1)*s+t;h<o-2&&(l[u++]=(h+1)*s+(s-1),l[u++]=(h+1)*s)}this._vertices=n,this._texCoords=a,this._indices=l}_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=[new u({sourcePoint:o(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)}),new u({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:l,lon:h}=t[n];r[n]=new u({sourcePoint:o(e*s,-i*s),mapPoint:new a(h,l)})}return r}}export{x as default};
2
+ 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 l from"../../../../geometry/Polygon.js";import{project as h}from"../../../../geometry/projectionUtils.js";import u from"../../../../layers/support/ControlPoint.js";import{DisplayObject as p}from"../DisplayObject.js";import m from"../../../layers/support/GeometryClipArea.js";import c from"../../../webgl/Texture.js";import{TextureDescriptor as d}from"../../../webgl/TextureDescriptor.js";const f=2;class x extends p{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(){super.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||t.animationsEnabled&&this.texture.setData(e);else{const t=new d(i,s);t.wrapMode=33071,t.preMultiplyAlpha=!0,this.texture=new c(r,t,e)}e.paused||null==this._vertices||this.texture.generateMipmap(),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const s=this.element,o=this._getFrameInfo();if(!s||!o)return;const{spatialReference:n}=r;this._initializeData(t,o,n);const{controlPoints:a,horizon:u}=o,p=Math.sqrt(a.length),c=p,{x:d,y:x}=t,y=this._vertices,g=a[0],w=a[p-1],P=a[(c-1)*p],_=a[(c-1)*p+p-1],v=h(u?u[0].mapPoint:g.mapPoint,n),j=h(u?u[1].mapPoint:w.mapPoint,n),A=h(P.mapPoint,n),M=h(_.mapPoint,n);this.clipGeometry=u?new m({geometry:l.fromJSON({rings:[[[A.x,A.y],[M.x,M.y],[j.x,j.y],[v.x,v.y],[A.x,A.y]]],spatialReference:n})}):null;for(let l=0;l<a.length;l++){const t=a[l],{sourcePoint:e,mapPoint:r}=t;if(null==e||null==r)continue;const i=h(r,n);y[l*f+0]=i.x-d,y[l*f+1]=i.y-x}let C=e;if(i){const t=Math.min(v.x,j.x,A.x,M.x),e=Math.max(v.x,j.x,A.x,M.x),{worldWidth:r,xBounds:s}=i,[o,n]=s;t<o&&e>o?C=r:e>n&&t<n&&(C=-r)}this.wrapAroundShift=C,this.isWrapAround=0!==C}draw(t,e){if(!this.visible)return;if(!(this.isReady&&this._vertices&&this._indices&&this._texCoords))return void this.requestRender();this.stage||console.warn("OverlayMultipoint: stage is null"),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})}_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 p=0;p<i.length;p++){const e=i[p],{sourcePoint:s,mapPoint:o}=e;if(null==s||null==o)continue;const l=h(o,r);n[p*f+0]=l.x-t.x,n[p*f+1]=l.y-t.y,a[2*p+0]=s.x,a[2*p+1]=s.y}const l=new Uint16Array(o*s+(o-2)*(s+2));let u=0;for(let h=0;h<o;h++){for(let t=0;t<s;t++)l[u++]=h*s+t,l[u++]=(h+1)*s+t;h<o-2&&(l[u++]=(h+1)*s+(s-1),l[u++]=(h+1)*s)}this._vertices=n,this._texCoords=a,this._indices=l}_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=[new u({sourcePoint:o(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)}),new u({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:l,lon:h}=t[n];r[n]=new u({sourcePoint:o(e*s,-i*s),mapPoint:new a(h,l)})}return r}}export{x as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../../../core/has.js";import"../../../../core/Logger.js";import{TechniqueProgramCache as e}from"./shaderGraph/techniques/TechniqueProgramCache.js";class t{constructor(){this._currentPipelineStateNeedsUpdate=!1,this._programCache=new e}dispose(){this._programCache.destroy()}clearShaderCache(){this._programCache.destroy(),this._programCache=new e}setShader(e){return this._shaderState={shader:e.shader,uniforms:e.uniforms,defines:e.defines,optionalAttributes:e.optionalAttributes,useComputeBuffer:e.useComputeBuffer??!1},this._shaderState}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}getPipelineState(){return this._currentPipelineState}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i}=r;if(null==t)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(1032,s,t,i)}}}setPipelineStateNeedsUpdate(e){this._currentPipelineStateNeedsUpdate=e}getShaderState(){return this._shaderState}getProgramCache(){return this._programCache}submitDraw(e,t,s){let r=s?.stencilRef;if(!this._shaderState)return null;const{shader:i,uniforms:n,defines:a,optionalAttributes:l}=this._shaderState,o=e.context,c=t.getAttributePrecisionPackFactors(),d=this._programCache.getProgram(i,c,n,a??{},l??{});if(d.setUniforms(n),d.bind(o),this.updatePipelineState(o),null==r){const e=t.getStencilReference();null!=e&&(r=e)}return null!=r&&this.setStencilRef(o,r),t.draw(e,i.locationInfo),d.cleanupTemporaryTextures(),{vertexShader:d.vertexShader,fragmentShader:d.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){const i=r?.parts,n=r?.stencilRef,{precisionFactors:a,materialKey:l}=t,{shader:o,uniforms:c,defines:d,optionalAttributes:p}=this.setShader(t),h=this._programCache.getProgram(o,a||{},c,d??{},p??{},l);if(h.setUniforms(c),h.bind(e),this.updatePipelineState(e),this.setStencilRef(e,n),i)for(const u of i)s.bind(e,t.shader.locationInfo,u),s.draw(e);else for(let u=0;u<s.parts.length;u++)s.bind(e,t.shader.locationInfo,u),s.draw(e);s.unbind(e),h.cleanupTemporaryTextures()}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled("none"!==s),e.setBlendEquation(32774),s){case"composite":e.setBlendFunctionSeparate(1,771,1,771);break;case"additive":e.setBlendFunctionSeparate(1,1,1,1);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(32779),e.setBlendFunctionSeparate(1,771,1,771);break;case"none":e.setBlendingEnabled(!1)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{op:s}=t;e.setStencilTestEnabled(!0),e.setStencilOpSeparate(1032,s.fail,s.zFail,s.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}}export{t as RenderingDevice};
2
+ import"../../../../core/has.js";import"../../../../core/Logger.js";import{TechniqueProgramCache as e}from"./shaderGraph/techniques/TechniqueProgramCache.js";class t{constructor(){this._currentPipelineStateNeedsUpdate=!1,this._programCache=new e}dispose(){this._programCache.destroy()}clearShaderCache(){this._programCache.destroy(),this._programCache=new e}setShader(e){return this._shaderState={shader:e.shader,uniforms:e.uniforms,textures:e.textures,defines:e.defines,optionalAttributes:e.optionalAttributes,useComputeBuffer:e.useComputeBuffer??!1},this._shaderState}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}getPipelineState(){return this._currentPipelineState}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i}=r;if(null==t)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(1032,s,t,i)}}}setPipelineStateNeedsUpdate(e){this._currentPipelineStateNeedsUpdate=e}getShaderState(){return this._shaderState}getProgramCache(){return this._programCache}submitDraw(e,t,s){let r=s?.stencilRef;if(!this._shaderState)return null;const{shader:i,uniforms:n,textures:a,defines:l,optionalAttributes:o}=this._shaderState,c=e.context,d=t.getAttributePrecisionPackFactors(),p=this._programCache.getProgram(i,d,n,a??{},l??{},o??{});if(p.setUniforms(n),p.setTextures(a),p.bind(c),this.updatePipelineState(c),null==r){const e=t.getStencilReference();null!=e&&(r=e)}return null!=r&&this.setStencilRef(c,r),t.draw(e,i.locationInfo),p.cleanupTemporaryTextures(),{vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){const i=r?.parts,n=r?.stencilRef,{precisionFactors:a,materialKey:l}=t,{shader:o,uniforms:c,textures:d,defines:p,optionalAttributes:h}=this.setShader(t),u=this._programCache.getProgram(o,a||{},c,d??{},p??{},h??{},l);if(u.setUniforms(c),u.setTextures(d),u.bind(e),this.updatePipelineState(e),this.setStencilRef(e,n),i)for(const S of i)s.bind(e,t.shader.locationInfo,S),s.draw(e);else for(let S=0;S<s.parts.length;S++)s.bind(e,t.shader.locationInfo,S),s.draw(e);s.unbind(e),u.cleanupTemporaryTextures()}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled("none"!==s),e.setBlendEquation(32774),s){case"composite":e.setBlendFunctionSeparate(1,771,1,771);break;case"additive":e.setBlendFunctionSeparate(1,1,1,1);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(32779),e.setBlendFunctionSeparate(1,771,1,771);break;case"none":e.setBlendingEnabled(!1)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{op:s}=t;e.setStencilTestEnabled(!0),e.setStencilOpSeparate(1032,s.fail,s.zFail,s.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}}export{t as RenderingDevice};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../config.js";import t from"../../../../request.js";import i from"../../../../core/Error.js";import{getFullyQualifiedFontName as r}from"../../../../core/fontUtils.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{throwIfAborted as a,isAbortError as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as o}from"../../../../core/QueueProcessor.js";import{pt2px as c}from"../../../../core/screenUtils.js";import{numericHash as h}from"../../../../core/string.js";import l from"../../../../symbols/cim/CIMResourceManager.js";import{CIMSymbolHelper as u}from"../../../../symbols/cim/CIMSymbolHelper.js";import p from"../../../../symbols/cim/Rasterizer.js";import{normalizeDashTemplate as m}from"../../../../symbols/cim/utils.js";import{svgSdfTextureInnerSize as d,textureBindingSpriteAtlas as g,textureBindingGlyphAtlas as f}from"./definitions.js";import y from"./GlyphMosaic.js";import _ from"./GlyphSource.js";import M from"./Rect.js";import I from"./SDFConverter.js";import w from"./SpriteMosaic.js";import{discardUrlIfHasUrlHash as S}from"./urlUtils.js";import{getCIMMarkerPlacementHash as z,isSVGImage as C}from"./Utils.js";import{AnimatableTextureResource as T}from"./animatedFormats/AnimatableTextureResource.js";import{AnimationStore as x}from"./animations/store/AnimationStore.js";const R="arial-unicode-ms-regular",b=/[\u0695\u0698\u06a9\u06af\u06b5\u06be\u06c6\u06cc\u06ce\u06d5\u06ca]|\p{Script=Thai}|\p{Script=Lao}|\p{Script=Tamil}|\p{Script=Khmer}/u,P=()=>s.getLogger("esri.views.MapView"),$=(e,t,r)=>P().error(new i(e,t,r)),v=(e,t="")=>P().warnOnce(e,t);class j{static fromMosaic(e,t){return new j(e,t.page,t.sdf,t.samplingMode)}constructor(e,t,i,r){this.mosaicType=e,this.page=t,this.sdf=i,this.samplingMode=r}}class k{constructor(r){this._requestRender=r,this._resourceManager=new l,this._invalidFonts=new Set,this._sdfConverter=new I(d),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new o({concurrency:10,process:async(e,r)=>{a(r);try{return await t(e,{responseType:"image",signal:r})}catch(s){if(!n(s))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${e}`,s);throw s}}}),this.animationStore=new x,this._spriteMosaic=new w(2048,2048,500),this._glyphSource=new _(`${e.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new y(1024,1024,this._glyphSource),this._rasterizer=new p(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(null==e)return $("mapview-null-resource","Unable to rasterize null resource"),null;if("animation-info"===e.type){const{resource:t}=e,i=this.animationStore.add(t),{location:r}=i;return{rect:new M(r.column,r.row,t.length,1),page:r.page,type:"sprite",width:t.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,samplingMode:"Linear",sdfDecodeCoeff:1,simplePattern:!1}}if("cim-rasterization-info"!==e.type)return $("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:i}=e;if("text"===i.type){const e=await this._rasterizeText(i,t);for(const t of e.glyphs)this._setTextureBinding(1,t);return e}const r=await this._rasterizeSprite(i,t);return r&&this._setTextureBinding(0,r),r}getMosaicInfo(e,t,i=!1){const r=this._getTextureBindingInfo(e,t,i);return r?{size:r.size,texture:{texture:r.texture,unit:"sprite"===r.type?g:f}}:($("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,i){const{context:r}=e,s=this._bindingInfos[t-1],a=s.page,n="Nearest"===s.samplingMode?9728:i?9987:9729;switch(s.mosaicType){case 0:{const t=[this.sprites.getWidth(a),this.sprites.getHeight(a)],i=this._spriteMosaic.getTexture(e,a);return i.setSamplingMode(n),{type:"sprite",texture:i,size:t}}case 1:{const e=[this.glyphs.width,this.glyphs.height],t=this._glyphMosaic.getTexture(r,a);return this._glyphMosaic.bind(r,n,a,f),t.setSamplingMode(n),{type:"glyph",texture:t,size:e}}default:return $("mapview-texture-manager",`Cannot handle unknown type ${s.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|("Nearest"===t.samplingMode?1:0)<<3|t.page<<4}_setTextureBinding(e,t){const i=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(i)){const r=j.fromMosaic(e,t),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(i,s),this._bindingInfos.push(r)}t.textureBinding=this._hashToBindingIndex.get(i)}async _rasterizeText(e,t){const{font:i,textString:s}=e,a=r(i),n=this._invalidFonts.has(a),o=!!has("esri-2d-force-complex-shaping")||!!has("esri-2d-complex-shaping")&&b.test(s),c=n?R:a;has("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(c);let h=await this._glyphMosaic.getGlyphItems(s,o,c,t);return h||(v(`Font ${a} is not available on the web, using "Arial Unicode MS Regular"`),this._invalidFonts.add(a),h=await this._glyphMosaic.getGlyphItems(s,o,R,t)),h}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}:${z(e.markerPlacement)}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${m(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geometry)}.${e.sdfTextureSize}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(S(e));case"CIMGradientFill":case"CIMGradientStroke":return`gradient:${JSON.stringify(e.colorRamp)}.${e.gradientType}.${e.interval}`;case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const i=h(this._hashSpriteResource(e));if(this._spriteMosaic.has(i))return this._spriteMosaic.getSpriteItem(i);if("url"in e&&e.url&&"animated"!==e.type||"CIMPictureFill"===e.type||"CIMPictureStroke"===e.type||"CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type){const t={type:"CIMPointSymbol",symbolLayers:[e]};await u.normalizeSymbolAndFetchResources(t,this._resourceManager)}switch(e.type){case"CIMPictureMarker":return"CIMMarkerPlacementInsidePolygon"===e.markerPlacement?.type?this._rasterizeJSONResource(i,e):this._handleAsyncResource(i,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(i,e,t);case"CIMGradientFill":case"CIMGradientStroke":case"CIMHatchFill":case"CIMVectorMarker":case"dash":case"fill-style":case"sdf":return this._rasterizeJSONResource(i,e)}}_rasterizeJSONResource(e,t){const i=this._rasterizer.rasterizeJSONResource(t);if(i){const{size:r,image:s,sdf:a,simplePattern:n,rasterizationScale:o,samplingMode:c,sdfPaddingRatio:h,sdfDecodeCoeff:l}=i;return this._addItemToMosaic(e,r,{type:"static",data:s},A(t),a,n,o,c,h,l)}return null}async _handleAsyncResource(e,t,i){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let r;return r="path"===t.type?this._handleSVG(t,e,i):this._handleImage(t,e,i),this._ongoingRasterizations.set(e,r),r.finally(()=>this._ongoingRasterizations.delete(e)),r}async _handleSVG(e,t,i){const r=[d,d],{asFill:s}=e,a=await this._sdfConverter.draw(e.path,s,i);return this._addItemToMosaic(t,r,{type:"static",data:new Uint32Array(a.buffer)},!1,!0,!0)}_handleGIFOrPNG(e,t,i){const r=e.url,s=this.resourceManager.getResource(r);if(null==s)return null;const{width:a,height:n}=s;if(s instanceof HTMLImageElement){if("animated"===e.type)return $("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const i="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:r,sdf:o,image:c}=this._rasterizer.rasterizeImageResource(a,n,s,i);return this._addItemToMosaic(t,r,{type:"static",data:c},A(e),o,!1)}let o,c,h;"animated"===e.type?(o=!1,c={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},h=e.startGroup||0):(o=A(e),c={type:"CIMAnimatedSymbolProperties",playAnimation:!0},h=0);const l=new T(s,this._requestRender,c,h);return this._addItemToMosaic(t,[l.width,l.height],{type:"animated",data:l},o,!1,!1)}async _handleImage(e,t,r){const s=e.url;if(G(s)||B(s))return this._handleGIFOrPNG(e,t,r);if("animated"===e.type)return $("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let i;const a=this.resourceManager.getResource(s);if(null!=a&&a instanceof HTMLImageElement)i=a;else{const{data:e}=await this._imageRequestQueue.push(s,{...r});i=e}if(C(s))if("width"in e&&"height"in e)i.width=c(e.width),i.height=c(e.height);else if("cim"in e){const t=e;i.width=c(t.width??t.scaleX*t.size),i.height=c(t.size)}if(!i.width||!i.height)return null;const n=i.width,o=i.height,h="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:l,sdf:u,image:p}=this._rasterizer.rasterizeImageResource(n,o,i,h);return this._addItemToMosaic(t,l,{type:"static",data:p},A(e),u,!1)}catch($){if(!n($))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${s}. ${$.message}`);throw $}}_addItemToMosaic(e,t,i,r,s,a,n,o,c,h){return this._spriteMosaic.addSpriteItem(e,t,i,r,s,a,n,o,c,h)}}function A(e){switch(e.type){case"CIMVectorMarker":case"CIMPictureMarker":return N(e);default:return!0}}const F=e=>null!=e&&e.startsWith("data:image/gif"),G=e=>e&&(e.includes(".gif")||F(e)),O=e=>null!=e&&e.startsWith("data:image/png"),B=e=>e&&(e.includes(".png")||O(e)),N=e=>e&&"markerPlacement"in e&&e.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===e.markerPlacement.type;export{k as default};
2
+ import e from"../../../../config.js";import t from"../../../../request.js";import i from"../../../../core/Error.js";import{getFullyQualifiedFontName as r}from"../../../../core/fontUtils.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{throwIfAborted as a,isAbortError as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as o}from"../../../../core/QueueProcessor.js";import{pt2px as c}from"../../../../core/screenUtils.js";import{numericHash as h}from"../../../../core/string.js";import l from"../../../../symbols/cim/CIMResourceManager.js";import{CIMSymbolHelper as u}from"../../../../symbols/cim/CIMSymbolHelper.js";import p from"../../../../symbols/cim/Rasterizer.js";import{normalizeDashTemplate as m}from"../../../../symbols/cim/utils.js";import{svgSdfTextureInnerSize as d,textureBindingSpriteAtlas as g,textureBindingGlyphAtlas as f}from"./definitions.js";import y from"./GlyphMosaic.js";import M from"./GlyphSource.js";import _ from"./Rect.js";import I from"./SDFConverter.js";import w from"./SpriteMosaic.js";import{discardUrlIfHasUrlHash as S}from"./urlUtils.js";import{getCIMMarkerPlacementHash as z,isSVGImage as T}from"./Utils.js";import{AnimatableTextureResource as C}from"./animatedFormats/AnimatableTextureResource.js";import{AnimationStore as R}from"./animations/store/AnimationStore.js";const x="arial-unicode-ms-regular",b=/[\u0695\u0698\u06a9\u06af\u06b5\u06be\u06c6\u06cc\u06ce\u06d5\u06ca]|\p{Script=Thai}|\p{Script=Lao}|\p{Script=Tamil}|\p{Script=Khmer}/u,P=new Set(["Noto Sans Khmer","Noto Sans Lao","Noto Sans Myanmar","Noto Sans Thai"]),$=()=>s.getLogger("esri.views.MapView"),v=(e,t,r)=>$().error(new i(e,t,r)),j=(e,t="")=>$().warnOnce(e,t);class k{static fromMosaic(e,t){return new k(e,t.page,t.sdf,t.samplingMode)}constructor(e,t,i,r){this.mosaicType=e,this.page=t,this.sdf=i,this.samplingMode=r}}class A{constructor(r){this._requestRender=r,this._resourceManager=new l,this._invalidFonts=new Set,this._sdfConverter=new I(d),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new o({concurrency:10,process:async(e,r)=>{a(r);try{return await t(e,{responseType:"image",signal:r})}catch(s){if(!n(s))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${e}`,s);throw s}}}),this.animationStore=new R,this._spriteMosaic=new w(2048,2048,500),this._glyphSource=new M(`${e.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new y(1024,1024,this._glyphSource),this._rasterizer=new p(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(null==e)return v("mapview-null-resource","Unable to rasterize null resource"),null;if("animation-info"===e.type){const{resource:t}=e,i=this.animationStore.add(t),{location:r}=i;return{rect:new _(r.column,r.row,t.length,1),page:r.page,type:"sprite",width:t.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,samplingMode:"Linear",sdfDecodeCoeff:1,simplePattern:!1}}if("cim-rasterization-info"!==e.type)return v("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:i}=e;if("text"===i.type){const e=await this._rasterizeText(i,t);for(const t of e.glyphs)this._setTextureBinding(1,t.mosaicItem);return e}const r=await this._rasterizeSprite(i,t);return r&&this._setTextureBinding(0,r),r}getMosaicInfo(e,t,i=!1){const r=this._getTextureBindingInfo(e,t,i);return r?{size:r.size}:(v("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0]})}getMosaicTexture(e,t,i=!1){const r=this._getTextureBindingInfo(e,t,i);return r?{texture:r.texture,unit:"sprite"===r.type?g:f}:(v("mapview-invalid-resource",`Unable to find resource for ${t}`),null)}_getTextureBindingInfo(e,t,i){const{context:r}=e,s=this._bindingInfos[t-1],a=s.page,n="Nearest"===s.samplingMode?9728:i?9987:9729;switch(s.mosaicType){case 0:{const t=[this.sprites.getWidth(a),this.sprites.getHeight(a)],i=this._spriteMosaic.getTexture(e,a);return i.setSamplingMode(n),{type:"sprite",texture:i,size:t}}case 1:{const e=[this.glyphs.width,this.glyphs.height],t=this._glyphMosaic.getTexture(r,a);return this._glyphMosaic.bind(r,n,a,f),t.setSamplingMode(n),{type:"glyph",texture:t,size:e}}default:return v("mapview-texture-manager",`Cannot handle unknown type ${s.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|("Nearest"===t.samplingMode?1:0)<<3|t.page<<4}_setTextureBinding(e,t){const i=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(i)){const r=k.fromMosaic(e,t),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(i,s),this._bindingInfos.push(r)}t.textureBinding=this._hashToBindingIndex.get(i)}async _rasterizeText(e,t){const{font:i,textString:s}=e,a=r(i),n=this._invalidFonts.has(a),o=!!has("esri-2d-force-complex-shaping"),c=!!has("esri-2d-complex-shaping")&&b.test(s),h=P.has(i.family),l=o||c||h,u=n?x:a;has("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(u);let p=await this._glyphMosaic.getGlyphItems(s,l,u,t);return p||(j(`Font ${a} is not available on the web, using "Arial Unicode MS Regular"`),this._invalidFonts.add(a),p=await this._glyphMosaic.getGlyphItems(s,l,x,t)),p}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}:${z(e.markerPlacement)}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${m(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geometry)}.${e.sdfTextureSize}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(S(e));case"CIMGradientFill":case"CIMGradientStroke":return`gradient:${JSON.stringify(e.colorRamp)}.${e.gradientType}.${e.interval}`;case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const i=h(this._hashSpriteResource(e));if(this._spriteMosaic.has(i))return this._spriteMosaic.getSpriteItem(i);if("url"in e&&e.url&&"animated"!==e.type||"CIMPictureFill"===e.type||"CIMPictureStroke"===e.type||"CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type){const t={type:"CIMPointSymbol",symbolLayers:[e]};await u.normalizeSymbolAndFetchResources(t,this._resourceManager)}switch(e.type){case"CIMPictureMarker":return"CIMMarkerPlacementInsidePolygon"===e.markerPlacement?.type?this._rasterizeJSONResource(i,e):this._handleAsyncResource(i,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(i,e,t);case"CIMGradientFill":case"CIMGradientStroke":case"CIMHatchFill":case"CIMVectorMarker":case"dash":case"fill-style":case"sdf":return this._rasterizeJSONResource(i,e)}}_rasterizeJSONResource(e,t){const i=this._rasterizer.rasterizeJSONResource(t);if(i){const{size:r,image:s,sdf:a,simplePattern:n,rasterizationScale:o,samplingMode:c,sdfPaddingRatio:h,sdfDecodeCoeff:l}=i;return this._addItemToMosaic(e,r,{type:"static",data:s},F(t),a,n,o,c,h,l)}return null}async _handleAsyncResource(e,t,i){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let r;return r="path"===t.type?this._handleSVG(t,e,i):this._handleImage(t,e,i),this._ongoingRasterizations.set(e,r),r.finally(()=>this._ongoingRasterizations.delete(e)),r}async _handleSVG(e,t,i){const r=[d,d],{asFill:s}=e,a=await this._sdfConverter.draw(e.path,s,i);return this._addItemToMosaic(t,r,{type:"static",data:new Uint32Array(a.buffer)},!1,!0,!0)}_handleGIFOrPNG(e,t,i){const r=e.url,s=this.resourceManager.getResource(r);if(null==s)return null;const{width:a,height:n}=s;if(s instanceof HTMLImageElement){if("animated"===e.type)return v("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const i="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:r,sdf:o,image:c}=this._rasterizer.rasterizeImageResource(a,n,s,i);return this._addItemToMosaic(t,r,{type:"static",data:c},F(e),o,!1)}let o,c,h;"animated"===e.type?(o=!1,c={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},h=e.startGroup||0):(o=F(e),c={type:"CIMAnimatedSymbolProperties",playAnimation:!0},h=0);const l=new C(s,this._requestRender,c,h);return this._addItemToMosaic(t,[l.width,l.height],{type:"animated",data:l},o,!1,!1)}async _handleImage(e,t,r){const s=e.url;if(N(s)||O(s))return this._handleGIFOrPNG(e,t,r);if("animated"===e.type)return v("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let i;const a=this.resourceManager.getResource(s);if(null!=a&&a instanceof HTMLImageElement)i=a;else{const{data:e}=await this._imageRequestQueue.push(s,{...r});i=e}if(T(s))if("width"in e&&"height"in e)i.width=c(e.width),i.height=c(e.height);else if("cim"in e){const t=e;i.width=c(t.width??t.scaleX*t.size),i.height=c(t.size)}if(!i.width||!i.height)return null;const n=i.width,o=i.height,h="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:l,sdf:u,image:p}=this._rasterizer.rasterizeImageResource(n,o,i,h);return this._addItemToMosaic(t,l,{type:"static",data:p},F(e),u,!1)}catch(v){if(!n(v))throw new i("mapview-invalid-resource",`Could not fetch requested resource at ${s}. ${v.message}`);throw v}}_addItemToMosaic(e,t,i,r,s,a,n,o,c,h){return this._spriteMosaic.addSpriteItem(e,t,i,r,s,a,n,o,c,h)}}function F(e){switch(e.type){case"CIMVectorMarker":case"CIMPictureMarker":return U(e);default:return!0}}const G=e=>null!=e&&e.startsWith("data:image/gif"),N=e=>e&&(e.includes(".gif")||G(e)),B=e=>null!=e&&e.startsWith("data:image/png"),O=e=>e&&(e.includes(".png")||B(e)),U=e=>e&&"markerPlacement"in e&&e.markerPlacement&&"CIMMarkerPlacementInsidePolygon"===e.markerPlacement.type;export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{fromRotation as t,multiply as e,translate as s,rotate as i}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as h}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as a,getYAnchorDirection as f}from"../../alignmentUtils.js";import c from"../../Rect.js";import d from"../../collisions/BoundingBox.js";const l=22,m=4,g=l+m,u=l-6,x=Math.PI/180,p=8,_=1.5;class b{constructor(t,e,s,i){this._rotationT=n(),this._transform=n(),this._angle=0,this._bounds=null;const o=s.rect;t*=i,e*=i,this.width=0===s.code?s.metrics.width:o.width*i,this.height=0===s.code?s.metrics.height:o.height*i,this.x=t,this.y=e,this.textureBinding=s.textureBinding,this.texcoords={topLeft:[o.x,o.y],topRight:[o.x+o.width,o.y],bottomLeft:[o.x,o.y+o.height],bottomRight:[o.x+o.width,o.y+o.height]}}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){const{x:s,y:i,width:h,height:r}=this,a=t(n(),-this.angle),f=e(n(),a,this._transform);this._offsets={topLeft:o([0,0],[s,i],f),topRight:o([0,0],[s+h,i],f),bottomLeft:o([0,0],[s,i+r],f),bottomRight:o([0,0],[s+h,i+r],f)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){const t=this.offsets;let e=1/0,s=1/0,i=-1/0,n=-1/0;for(const[f,c]of[t.topLeft,t.topRight,t.bottomLeft,t.bottomRight])e=Math.min(e,f),s=Math.min(s,c),i=Math.max(i,f),n=Math.max(n,c);const o=i-e,h=n-s,r=e+o/2,a=s+h/2;this._bounds=new d(r,a,o,h)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}}const w=(t,e)=>({code:0,page:0,sdf:!0,rect:new c(0,0,11,8),textureBinding:e,metrics:{advance:0,height:4,width:t,left:0,top:0}});function y(t,e){return t.forEach(t=>o(t,t,e)),{topLeft:t[0],topRight:t[1],bottomLeft:t[2],bottomRight:t[3]}}class M{constructor(t,e,s,i){this._rotation=0,this._decorate(t,e,s,i),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==s.angle,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const n of t)n.setTransform(this._transform)}setRotation(s){if(0===s&&0===this._rotation)return;this._rotation=s;const i=this._transform,o=t(n(),s);e(i,o,i);for(const t of this.glyphs)t.setTransform(this._transform)}_decorate(t,e,s,i){if(!s.decoration||"none"===s.decoration||!t.length)return;const n=s.scale,o="underline"===s.decoration?i?.baseline??g:i?.midline??u,h=t[0].textureBinding;for(const r of e){const e=r.startX*n,s=r.startY*n,i=(r.width+r.glyphWidthEnd)*n;t.push(new b(e,s+o*n,w(i,h),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,s=(_+e)/2,i=this._borderLineSizePx?s:0,{xmin:n,ymin:o,xmax:h,ymax:r,x:a,y:f,width:c,height:l}=this.bounds,m=[n-p,o-p],g=[h+p,o-p],u=[n-p,r+p],x=[h+p,r+p],b=y([[m[0]-s,m[1]-s],[g[0]+s,g[1]-s],[m[0]+i,m[1]+i],[g[0]-i,g[1]+i]],t),w=y([[u[0]+i,u[1]-i],[x[0]-i,x[1]-i],[u[0]-s,u[1]+s],[x[0]+s,x[1]+s]],t),M=y([[m[0]-s,m[1]-s],[m[0]+i,m[1]+i],[u[0]-s,u[1]+s],[u[0]+i,u[1]-i]],t),L=y([[g[0]-i,g[1]+i],[g[0]+s,g[1]-s],[x[0]-i,x[1]-i],[x[0]+s,x[1]+s]],t),R={main:y([m,g,u,x],t),top:b,bot:w,left:M,right:L};return[new d(a,f,c+2*s,l+2*s),R]}get boundsT(){const t=this.bounds,e=h(r(),t.x,t.y);if(o(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new d(e[0],e[1],s,s)}return new d(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,i=0,n=0;for(const r of t)e=Math.min(e,r.offsets.topLeft[0]),s=Math.min(s,r.offsets.topLeft[1]),i=Math.max(i,r.offsets.bottomRight[0]),n=Math.max(n,r.offsets.bottomRight[1]);const o=i-e,h=n-s;return new d(e+o/2,s+h/2,o,h)}_createGlyphTransform(t,e){const o=x*e.angle,a=n(),f=r();return s(a,a,h(f,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?i(a,a,o):(s(a,a,h(f,t.x,t.y)),i(a,a,o),s(a,a,h(f,-t.x,-t.y))),a}}class L{constructor(t,e,s,i,n,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].metrics.width),this.width=i,this.yMin=n,this.yMax=o}}const R=t=>10===t,B=t=>32===t;function v(t,e,s){const i=new Array,n=1/s.scale,o=s.maxLineWidth*n,h=e?t.length-1:0,r=e?-1:t.length,a=e?-1:1;let f=h,c=0,d=0,l=f,m=l,g=0,u=1/0,x=0;for(;f!==r;){const{code:e,metrics:s}=t[f],n=Math.abs(s.top);if(R(e)||B(e)||(u=Math.min(u,n),x=Math.max(x,n+s.height)),R(e))f!==h&&(i.push(new L(t,l,f-a,c,u===1/0?0:u,x)),u=1/0,x=0),c=0,l=f+a,m=f+a,d=0;else if(B(e))m=f+a,d=0,g=s.advance,c+=s.advance;else if(c>o){if(m!==l){const e=m-2*a;c-=g,i.push(new L(t,l,e,c-d,u,x)),u=1/0,x=0,l=m,c=d}else i.push(new L(t,l,f-a,c,u,x)),u=1/0,x=0,l=f,m=f,c=0;c+=s.advance,d+=s.advance}else c+=s.advance,d+=s.advance;f+=a}const p=new L(t,l,f-a,c,u,x);return p.start>=0&&p.end<t.length&&i.push(p),i}function T(t,e){let s=0;for(let o=0;o<t.length;o++){const{width:e}=t[o];s=Math.max(e,s)}const i="underline"===e.decoration?m:0,n=t[0].yMin;return{x:0,y:n,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+i-n,width:s}}function j(t,e){const s=e.scale,i=new Array,n=t.sdfPadding,{faceInfo:o,glyphs:h,isRightToLeft:r}=t,c=v(h,r,e),d=c.length?T(c,e):{y:0,height:0},m=a(e.horizontalAlignment),g=f(e.verticalAlignment),u=2===g?1:0,x=u?0:g-1,p=(1-u)*-d.y+x*(d.height/2)+u*-l;for(let a=0;a<c.length;a++){const{start:o,end:r,width:f}=c[a];let d=-1*(m+1)*(f/2)-n;const l=(t.isRightToLeft?c.length-1-a:a)*e.lineHeight+p-n;c[a].startX=d,c[a].startY=l;for(let t=o;t<=r;t++){const e=h[t];if(R(e.code))continue;const n=new b(d+e.metrics.left,l-e.metrics.top,e,s);d+=e.metrics.advance,i.push(n)}}return new M(i,c,e,o)}export{b as ShapedGlyph,M as ShapingInfo,j as shapeGlyphs};
2
+ import{fromRotation as t,multiply as e,translate as s,rotate as i}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as h}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as a,getYAnchorDirection as f}from"../../alignmentUtils.js";import c from"../../Rect.js";import d from"../../collisions/BoundingBox.js";const l=22,g=4,m=l+g,u=l-6,x=Math.PI/180,p=8,_=1.5;class b{constructor(t,e,s,i){this._rotationT=n(),this._transform=n(),this._angle=0,this._bounds=null;const{mosaicItem:o,rect:h,shaping:r,code:a}=s,f=o.rect;this.width=0===a?h.width:f.width*i,this.height=0===a?h.height:f.height*i,this.x=i*(t+r.xOffset+h.left),this.y=i*(e+r.yOffset-h.top),this.textureBinding=o.textureBinding,this.texcoords={topLeft:[f.x,f.y],topRight:[f.x+f.width,f.y],bottomLeft:[f.x,f.y+f.height],bottomRight:[f.x+f.width,f.y+f.height]}}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){const{x:s,y:i,width:h,height:r}=this,a=t(n(),-this.angle),f=e(n(),a,this._transform);this._offsets={topLeft:o([0,0],[s,i],f),topRight:o([0,0],[s+h,i],f),bottomLeft:o([0,0],[s,i+r],f),bottomRight:o([0,0],[s+h,i+r],f)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){const t=this.offsets;let e=1/0,s=1/0,i=-1/0,n=-1/0;for(const[f,c]of[t.topLeft,t.topRight,t.bottomLeft,t.bottomRight])e=Math.min(e,f),s=Math.min(s,c),i=Math.max(i,f),n=Math.max(n,c);const o=i-e,h=n-s,r=e+o/2,a=s+h/2;this._bounds=new d(r,a,o,h)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}}const y=(t,e)=>({code:0,mosaicItem:{rect:new c(0,0,11,8),sdf:!0,page:0,textureBinding:e},rect:{height:4,width:t,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function w(t,e){return t.forEach(t=>o(t,t,e)),{topLeft:t[0],topRight:t[1],bottomLeft:t[2],bottomRight:t[3]}}class M{constructor(t,e,s,i){this._rotation=0,this._decorate(t,e,s,i),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==s.angle,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const n of t)n.setTransform(this._transform)}setRotation(s){if(0===s&&0===this._rotation)return;this._rotation=s;const i=this._transform,o=t(n(),s);e(i,o,i);for(const t of this.glyphs)t.setTransform(this._transform)}_decorate(t,e,s,i){if(!s.decoration||"none"===s.decoration||!t.length)return;const n=s.scale,o="underline"===s.decoration?i?.baseline??m:i?.midline??u,h=t[0].textureBinding;for(const r of e){const e=r.startX*n,s=r.startY*n,i=(r.width+r.glyphWidthEnd)*n;t.push(new b(e,s+o*n,y(i,h),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,s=(_+e)/2,i=this._borderLineSizePx?s:0,{xmin:n,ymin:o,xmax:h,ymax:r,x:a,y:f,width:c,height:l}=this.bounds,g=[n-p,o-p],m=[h+p,o-p],u=[n-p,r+p],x=[h+p,r+p],b=w([[g[0]-s,g[1]-s],[m[0]+s,m[1]-s],[g[0]+i,g[1]+i],[m[0]-i,m[1]+i]],t),y=w([[u[0]+i,u[1]-i],[x[0]-i,x[1]-i],[u[0]-s,u[1]+s],[x[0]+s,x[1]+s]],t),M=w([[g[0]-s,g[1]-s],[g[0]+i,g[1]+i],[u[0]-s,u[1]+s],[u[0]+i,u[1]-i]],t),L=w([[m[0]-i,m[1]+i],[m[0]+s,m[1]-s],[x[0]-i,x[1]-i],[x[0]+s,x[1]+s]],t),R={main:w([g,m,u,x],t),top:b,bot:y,left:M,right:L};return[new d(a,f,c+2*s,l+2*s),R]}get boundsT(){const t=this.bounds,e=h(r(),t.x,t.y);if(o(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new d(e[0],e[1],s,s)}return new d(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,i=0,n=0;for(const r of t)e=Math.min(e,r.offsets.topLeft[0]),s=Math.min(s,r.offsets.topLeft[1]),i=Math.max(i,r.offsets.bottomRight[0]),n=Math.max(n,r.offsets.bottomRight[1]);const o=i-e,h=n-s;return new d(e+o/2,s+h/2,o,h)}_createGlyphTransform(t,e){const o=x*e.angle,a=n(),f=r();return s(a,a,h(f,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?i(a,a,o):(s(a,a,h(f,t.x,t.y)),i(a,a,o),s(a,a,h(f,-t.x,-t.y))),a}}class L{constructor(t,e,s,i,n,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].rect.width),this.width=i,this.yMin=n,this.yMax=o}}const R=t=>10===t,A=t=>32===t;function v(t,e,s){const i=new Array,n=1/s.scale,o=s.maxLineWidth*n,h=e?t.length-1:0,r=e?-1:t.length,a=e?-1:1;let f=h,c=0,d=0,l=f,g=l,m=0,u=1/0,x=0;for(;f!==r;){const{code:e,rect:s,shaping:n}=t[f],r=Math.abs(s.top);if(R(e)||A(e)||(u=Math.min(u,r),x=Math.max(x,r+s.height)),R(e))f!==h&&(i.push(new L(t,l,f-a,c,u===1/0?0:u,x)),u=1/0,x=0),c=0,l=f+a,g=f+a,d=0;else if(A(e))g=f+a,d=0,m=n.xAdvance,c+=n.xAdvance;else if(c>o){if(g!==l){const e=g-2*a;c-=m,i.push(new L(t,l,e,c-d,u,x)),u=1/0,x=0,l=g,c=d}else i.push(new L(t,l,f-a,c,u,x)),u=1/0,x=0,l=f,g=f,c=0;c+=n.xAdvance,d+=n.xAdvance}else c+=n.xAdvance,d+=n.xAdvance;f+=a}const p=new L(t,l,f-a,c,u,x);return p.start>=0&&p.end<t.length&&i.push(p),i}function B(t,e){let s=0;for(let o=0;o<t.length;o++){const{width:e}=t[o];s=Math.max(e,s)}const i="underline"===e.decoration?g:0,n=t[0].yMin;return{x:0,y:n,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+i-n,width:s}}function T(t,e){const s=e.scale,i=new Array,n=t.sdfPadding,{faceInfo:o,glyphs:h,isRightToLeft:r}=t,c=v(h,r,e),d=c.length?B(c,e):{y:0,height:0},g=a(e.horizontalAlignment),m=f(e.verticalAlignment),u=2===m?1:0,x=u?0:m-1,p=(1-u)*-d.y+x*(d.height/2)+u*-l;for(let a=0;a<c.length;a++){const{start:o,end:r,width:f}=c[a];let d=-1*(g+1)*(f/2)-n;const l=(t.isRightToLeft?c.length-1-a:a)*e.lineHeight+p-n;c[a].startX=d,c[a].startY=l;for(let t=o;t<=r;t++){const e=h[t];if(R(e.code))continue;const n=new b(d,l,e,s);d+=e.shaping.xAdvance,i.push(n)}}return new M(i,c,e,o)}export{b as ShapedGlyph,M as ShapingInfo,T as shapeGlyphs};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{TypedShaderProgram as t}from"./typed/TypedShaderProgram.js";class e{constructor(){this.computeAttributes={}}get locationsMap(){const t=new Map;for(const e in this.locations)t.set(e,this.locations[e].index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set(Object.keys(this.options));this._optionPropertyKeys=t}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map(([t,e])=>`${t}.${e}`).join(".");this._locationInfo={stringHash:e,locations:t,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const[e,o]of this.locationsMap.entries())t.set("a_"+e,o);return t}getShaderKey(t,e,o){return`${Object.keys(t).map(e=>`${e}.${t[e]}`).join(".")}.${Object.keys(o).filter(t=>o[t]).map(t=>`${t}_${o[t].toString()}`).join(".")}.${Object.keys(e).filter(t=>this.optionPropertyKeys.has(t)).join(".")}`}getProgram(e,o,n,r){let i="",s="";for(const t in n)if(n[t]){const e="boolean"==typeof n[t]?`#define ${t}\n`:`#define ${t} ${n[t]}\n`;i+=e,s+=e}return i+=this.vertexShader,s+=this.fragmentShader,new t("glslShaderModule",i,s,this.renamedLocationsMap,this._getUniformBindings(o),this._transformFeedbackBindings)}_getUniformBindings(t){const e=[];for(const r in this.required){const t=this.required[r];e.push({uniformHydrated:null,shaderModulePath:r,uniformName:r,uniformType:t.type,uniformArrayElementType:o(t),uniformArrayLength:n(t)})}for(const r in t){const i=this.options[r];if(t[r])for(const t in i){const s=i[t];e.push({uniformHydrated:null,shaderModulePath:`${r}.${t}`,uniformName:t,uniformType:s.type,uniformArrayElementType:o(s),uniformArrayLength:n(s)})}}return e}}const o=t=>"array"===t.type?t.elementType?.type:void 0,n=t=>"array"===t.type?t.size:void 0;export{e as GLSLShaderModule};
2
+ import{TypedShaderProgram as t}from"./typed/TypedShaderProgram.js";class e{constructor(){this.computeAttributes={}}get locationsMap(){const t=new Map;for(const e in this.locations)t.set(e,this.locations[e].index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set(Object.keys(this.options));this._optionPropertyKeys=t}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map(([t,e])=>`${t}.${e}`).join(".");this._locationInfo={stringHash:e,locations:t,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const[e,n]of this.locationsMap.entries())t.set("a_"+e,n);return t}getShaderKey(t,e,n,o,r){return`${Object.keys(t).map(e=>`${e}.${t[e]}`).join(".")}.${Object.keys(o).filter(t=>o[t]).map(t=>`${t}_${o[t].toString()}`).join(".")}.${Object.keys(e).filter(t=>this.optionPropertyKeys.has(t)).join(".")}.${Object.keys(n).filter(t=>n[t]).join(".")}`}getProgram(e,n,o,r){let i="",s="";for(const t in o)if(o[t]){const e="boolean"==typeof o[t]?`#define ${t}\n`:`#define ${t} ${o[t]}\n`;i+=e,s+=e}return i+=this.vertexShader,s+=this.fragmentShader,new t("glslShaderModule",i,s,this.renamedLocationsMap,this._getUniformBindings(n),this._getTextureBindings(),this._transformFeedbackBindings)}_getUniformBindings(t){const e=[];for(const r in this.required){const t=this.required[r];e.push({uniformHydrated:null,shaderModulePath:r,uniformName:r,uniformType:t.type,uniformArrayElementType:n(t),uniformArrayLength:o(t)})}for(const r in t){const i=this.options[r];if(t[r])for(const t in i){const s=i[t];e.push({uniformHydrated:null,shaderModulePath:`${r}.${t}`,uniformName:t,uniformType:s.type,uniformArrayElementType:n(s),uniformArrayLength:o(s)})}}return e}_getTextureBindings(){const t=[];for(const e in this.textures)t.push({textureHydrated:null,shaderModulePath:e,textureName:e});return t}}const n=t=>"array"===t.type?t.elementType?.type:void 0,o=t=>"array"===t.type?t.size:void 0;export{e as GLSLShaderModule};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{Float as r,Int as o,Vec4 as n,Vec2 as s}from"./graph/glsl.js";import{generateGLSL as i}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as p}from"./graph/ShaderGraphContext.js";import{setReachableUids as a}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as u}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as c}from"../../../../webgl/ShaderBuilder.js";function y(t){return new t}function d(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{d(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const h=t=>(e,r)=>{d(e,"builtins",{builtin:t,propertyKey:r})},l=t=>(e,r,o)=>{d(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},m=t=>(e,r)=>{d(e,"uniforms",{typeCtor:t,propertyKey:r})},g=t=>(e,r)=>{d(e,"options",{typeCtor:t,propertyKey:r})},_=(t,e)=>{d(t,"defines",{propertyKey:e})};function K(t){return(e,r)=>{d(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class C{static{this.builtins=[]}}t([b("gl_VertexID",o)],C.prototype,"glVertexID",void 0);class x{}class I{static{this.builtins=[]}}t([b("gl_FragCoord",n)],I.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",s)],I.prototype,"glPointCoord",void 0);class v{}t([h("gl_FragDepth")],v.prototype,"glFragDepth",void 0);class w{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class P{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&0===t.parameterIndex);if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&1===t.parameterIndex)}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"fragment"===t.propertyKey);if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map(([t,e])=>`${t}.${e}`).join("."),r=this.computeAttributes;this._locationInfo={stringHash:e,locations:t,computeAttributeMap:r}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new u(this.type,n,s,this.renamedLocationsMap,i,this.transformFeedbackBindings)}catch(n){return new u(this.type,"","",this.renamedLocationsMap,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find(e=>e.propertyKey===t);if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find(e=>e.propertyKey===t);if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map(e=>`${e}.${t[e]}`).join("."),s=Object.keys(r).map(t=>`${t}.${r[t]}`).join("."),i=Object.keys(o).map(t=>`${t}.${o[t]}`).join("."),p=Object.keys(e).filter(t=>this.optionPropertyKeys.has(t)&&e[t]).join(".");return`${this.type}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),u=this._injectPackPrecisionFactor(s,t),c=this._hydrateComputeInput(),y=c&&this._injectComputePackPrecisionFactor(c,t),d=this.vertex(u,y),f=this._hydrateFragmentInput(d),h=this.fragment(f),l=new Set;for(const i in h){const t=h[i];a(l,t)}const m=this._getVertexInputBuiltins(),g={};for(const[i,p]of Object.entries(s))g[i]=p;if(null!=c)for(const[i,p]of Object.entries(c))g[i]=p;const _=p.createVertex(g,d,m,n,this.transformFeedbackBindings,l);i(_);const K=this._getFragmentInputBuiltins(h);K.set("glPointCoord","gl_PointCoord"),K.set("glFragCoord","gl_FragCoord");const b=p.createFragment(f,h,K,n,_,this.transformFeedbackBindings);i(b);const C=this._createShaderBuilder(_,b),x=C.generate("vertex"),I=C.generate("fragment");return this.logShader&&(console.log(x),console.log(I)),{vertex:x,fragment:I,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=y(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:y(r.typeCtor)},{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=y(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce((t,e)=>({...t,[e.propertyKey]:y(e.typeCtor)}),{})}_injectPackPrecisionFactor(t,e){const o={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);o[n]=s.divide(new r(i))}else o[n]=s}return o}_injectComputePackPrecisionFactor(t,e){const o={},n=new Map;for(const r in this.computeAttributes)for(const t of this.computeAttributes[r]??[])n.set(t,r);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);o[s]=i.divide(new r(a))}else o[s]=i}return o}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of I.builtins){const t=y(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new c;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{x as ComputeVertexInput,I as FragmentInput,v as FragmentOutput,P as GraphShaderModule,w as UniformGroup,C as VertexInput,h as builtin,_ as define,l as input,f as location,g as option,K as transformFeedback,m as uniform};
2
+ import{__decorate as t}from"tslib";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{Sampler2D as r,Float as o,Int as n,Vec4 as s,Vec2 as i}from"./graph/glsl.js";import{generateGLSL as p}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as a}from"./graph/ShaderGraphContext.js";import{setReachableUids as u}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as y}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as c}from"../../../../webgl/ShaderBuilder.js";function d(t){return new t}function h(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{h(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{h(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{h(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{h(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{h(e,"textures",{typeCtor:t,propertyKey:r})},x=t=>(e,r)=>{h(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{h(t,"defines",{propertyKey:e})};function C(t){return(e,r)=>{h(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class I{static{this.builtins=[]}}t([b("gl_VertexID",n)],I.prototype,"glVertexID",void 0);class v{}class w{static{this.builtins=[]}}t([b("gl_FragCoord",s)],w.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",i)],w.prototype,"glPointCoord",void 0);class P{}t([l("gl_FragDepth")],P.prototype,"glFragDepth",void 0);class ${constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.type="texture-group"}get _textures(){return this.constructor.textures??[]}}class F{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&0===t.parameterIndex);if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast(t=>"vertex"===t.propertyKey&&1===t.parameterIndex)}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast(t=>"fragment"===t.propertyKey);if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map(([t,e])=>`${t}.${e}`).join("."),r=this.computeAttributes;this._locationInfo={stringHash:e,locations:t,computeAttributeMap:r}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}get _textures(){return this._shaderModuleClass.textures??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i,textureBindings:p}=this._generateShaders(t,e,r,o);return new y(this.type,n,s,this.renamedLocationsMap,i,p,this.transformFeedbackBindings)}catch(n){return new y(this.type,"","",this.renamedLocationsMap,[],[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find(e=>e.propertyKey===t);if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find(e=>e.propertyKey===t);if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getDebugTextureClassInfo(t){const e=this._textures.find(e=>e.propertyKey===t);if(!e)throw new Error(`Unable to find texture type for property: ${t}`);return{className:e.typeCtor}}getShaderKey(t,e,r,o,n){const s=Object.keys(t).map(e=>`${e}.${t[e]}`).join("."),i=Object.keys(o).map(t=>`${t}.${o[t]}`).join("."),p=Object.keys(n).map(t=>`${t}.${n[t]}`).join("."),a=Object.keys(e).filter(t=>this.optionPropertyKeys.has(t)&&e[t]).join("."),u=Object.keys(r).filter(t=>r[t]).join(".");return`${this.type}.${s}.${i}.${p}.${a}.${u}`}_generateShaders(t,e,r,o){const n=[],s=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n),this._setRequiredTextures(s);const i=this._hydrateVertexInput(o),y=this._injectPackPrecisionFactor(i,t),c=this._hydrateComputeInput(),d=c&&this._injectComputePackPrecisionFactor(c,t),h=this.vertex(y,d),f=this._hydrateFragmentInput(h),l=this.fragment(f),m=new Set;for(const p in l){const t=l[p];u(m,t)}const g=this._getVertexInputBuiltins(),_={};for(const[p,a]of Object.entries(i))_[p]=a;if(null!=c)for(const[p,a]of Object.entries(c))_[p]=a;const x=a.createVertex(_,h,g,n,s,this.transformFeedbackBindings,m);p(x);const K=this._getFragmentInputBuiltins(l);K.set("glPointCoord","gl_PointCoord"),K.set("glFragCoord","gl_FragCoord");const C=a.createFragment(f,l,K,n,s,x,this.transformFeedbackBindings);p(C);const b=this._createShaderBuilder(x,C),I=b.generate("vertex"),v=b.generate("fragment");return this.logShader&&(console.log(I),console.log(v)),{vertex:I,fragment:v,uniformBindings:n,textureBindings:s}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_setRequiredTextures(t){for(const e of this._textures)this[e.propertyKey]=this._hydrateTextureBinding(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateTextureBinding(t,e){const o=e.typeCtor;if(o===r){const o=new r,n=`u_${e.propertyKey}`,s=e.propertyKey;return t.push({shaderModulePath:s,textureName:n,textureHydrated:o}),o}const n=new o;for(const r of n._textures){const o=d(r.typeCtor),s=`u_${e.propertyKey}_${r.propertyKey}`,i=[e.propertyKey,r.propertyKey].join(".");t.push({shaderModulePath:i,textureName:s,textureHydrated:o}),n[r.propertyKey]=o}return n}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)},{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)}),{})}_injectPackPrecisionFactor(t,e){const r={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[n]=s.divide(new o(i))}else r[n]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},n=new Map;for(const o in this.computeAttributes)for(const t of this.computeAttributes[o]??[])n.set(t,o);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new o(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of w.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new c;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{v as ComputeVertexInput,w as FragmentInput,P as FragmentOutput,F as GraphShaderModule,j as TextureGroup,$ as UniformGroup,I as VertexInput,l as builtin,K as define,m as input,f as location,x as option,_ as texture,C as transformFeedback,g as uniform};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,n=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=n,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,n=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=n,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class n{static createVertex(e,d,i,s,r,u){const p=[];for(const a in e){const n=e[a],o=i.get(a);o?p.push(new t(o,"builtin",n)):p.push(new t("a_"+a,"in",n))}for(const a of s){const e=a.uniformHydrated;p.push(new t(a.uniformName,"uniform",e))}const c=[];for(const t in d){const e=d[t];if("glPosition"===t)c.push(new a("gl_Position","builtin",e));else if("glPointSize"===t)c.push(new a("gl_PointSize","builtin",e));else{const n=o(e),d=[];n&&d.push(n),c.push(new a("v_"+t,"out",e,d))}}return new n(p,c,r,u)}static createFragment(e,o,d,i,s,r){const u=[],p=Array.from(s.rootOutputNodes());for(const a in e){const n=e[a],o=d.get(a);if(o){u.push(new t(o,"builtin",n));continue}const i=p.find(e=>e.node===n);i&&u.push(new t(i.outVariableName,"in",n))}for(const a of i){const e=a.uniformHydrated;u.push(new t(a.uniformName,"uniform",e))}const c=[];for(const t in o){const e=o[t],n=d.get(t);switch(t){case"discard":c.push(new a(null,"discard",e));break;case"fragData0":c.push(new a("fragData0","fragData0",e));break;case"fragData1":c.push(new a("fragData1","fragData1",e));break;case"fragData2":c.push(new a("fragData2","fragData2",e));break;case"fragData3":c.push(new a("fragData3","fragData3",e));break;default:n?c.push(new a(n,"builtin",e)):c.push(new a(t,"out",e))}}return new n(u,c,r)}constructor(e,t,a,n){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const o of e)this._inputShaderTypesByNodeUid.set(o.node.uid,o);this._outputShaderTypes=t,this._transformFeedbackBindings=a,this._transformFeedbackNames=new Set(a.map(e=>"v_"+e.propertyKey)),this._usedInFragmentShader=n}shouldPruneOutputNode(e){return!!this._usedInFragmentShader&&("builtin"!==e.outVariableType&&(!this._transformFeedbackNames.has(e.outVariableName)&&!this._usedInFragmentShader.has(e.node.uid)))}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(const e of this._outputShaderTypes)yield e}*nodes(){const e=[];for(const t of this._outputShaderTypes.values())e.push(t.node);for(;e.length;){const t=e.pop();"number"!=typeof t&&"boolean"!=typeof t&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(const e of this.nodes())"number"!=typeof e&&"boolean"!=typeof e&&(yield e)}createSubgraphContext(){const e=this.clone();return e.body="",e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){const e=new n([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(""),this._insertInputs(e,"vertex"),e.vertex.code.add(""),e.vertex.code.add("// OUTPUTS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this.rootOutputNodes()){const a="builtin"===t.outVariableType;if(!this.shouldPruneOutputNode(t))if(a)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else{const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}e.vertex.code.add(""),e.vertex.code.add("void main() {"),e.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("// OUTPUTS: "),e.fragment.code.add("// --------------------------------------------------------- ");let t=0;for(const d of this.rootOutputNodes())"builtin"===d.outVariableType?e.fragment.code.add(`// ${d.outVariableType.padEnd(7)} ${d.node.type.padEnd(9)} ${d.outVariableName};`):"discard"===d.outVariableType||e.outputs.add(d.outVariableName,d.node.type,t++);e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split("\n").join("\n "));const a=Array.from(this.rootOutputNodes()),n=a.find(e=>"discard"===e.outVariableType),o=a.filter(e=>"discard"!==e.outVariableType);n&&(e.fragment.code.add(` if (${n.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" "));for(const d of o)e.fragment.code.add(` ${d.outVariableName} = ${d.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const a of this.inputs())if(a.isUsed&&"builtin"!==a.variableInputType)if("array"===a.node.type)e[t].code.add(`${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}];`);else if("array-2d"===a.node.type)e[t].code.add(`${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{const n=[...a.qualifiers,a.variableInputType].join(" ");e[t].code.add(` ${n.padEnd(10)} ${a.node.type.padEnd(9)} ${a.variableName};`)}}}function o(e){switch(e.type){case"float":case"vec2":case"vec3":case"vec4":return null;case"int":case"ivec2":case"ivec3":case"ivec4":case"uint":case"uvec2":case"uvec3":case"uvec4":case"bool":case"bvec2":case"bvec3":case"bvec4":return"flat";case"mat2":case"mat3":case"mat4":case"array":case"sampler2D":case"array-2d":throw new Error(`InternalError: ${e.type} is not a valid output type`)}}export{n as ShaderGraphContext,t as ShaderInput,a as ShaderOutput};
2
+ import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,o=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=o,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,o=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=o,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class o{static createVertex(e,r,s,d,i,u,c){const p=[];for(const a in e){const o=e[a],n=s.get(a);n?p.push(new t(n,"builtin",o)):p.push(new t("a_"+a,"in",o))}for(const a of d){const e=a.uniformHydrated;p.push(new t(a.uniformName,"uniform",e))}for(const a of i){const e=a.textureHydrated;p.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in r){const e=r[t];if("glPosition"===t)h.push(new a("gl_Position","builtin",e));else if("glPointSize"===t)h.push(new a("gl_PointSize","builtin",e));else{const o=n(e),r=[];o&&r.push(o),h.push(new a("v_"+t,"out",e,r))}}return new o(p,h,u,c)}static createFragment(e,n,r,s,d,i,u){const c=[],p=Array.from(i.rootOutputNodes());for(const a in e){const o=e[a],n=r.get(a);if(n){c.push(new t(n,"builtin",o));continue}const s=p.find(e=>e.node===o);s&&c.push(new t(s.outVariableName,"in",o))}for(const a of s){const e=a.uniformHydrated;c.push(new t(a.uniformName,"uniform",e))}for(const a of d){const e=a.textureHydrated;c.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in n){const e=n[t],o=r.get(t);switch(t){case"discard":h.push(new a(null,"discard",e));break;case"fragData0":h.push(new a("fragData0","fragData0",e));break;case"fragData1":h.push(new a("fragData1","fragData1",e));break;case"fragData2":h.push(new a("fragData2","fragData2",e));break;case"fragData3":h.push(new a("fragData3","fragData3",e));break;default:o?h.push(new a(o,"builtin",e)):h.push(new a(t,"out",e))}}return new o(c,h,u)}constructor(e,t,a,o){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const n of e)this._inputShaderTypesByNodeUid.set(n.node.uid,n);this._outputShaderTypes=t,this._transformFeedbackBindings=a,this._transformFeedbackNames=new Set(a.map(e=>"v_"+e.propertyKey)),this._usedInFragmentShader=o}shouldPruneOutputNode(e){return!!this._usedInFragmentShader&&("builtin"!==e.outVariableType&&(!this._transformFeedbackNames.has(e.outVariableName)&&!this._usedInFragmentShader.has(e.node.uid)))}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(const e of this._outputShaderTypes)yield e}*nodes(){const e=[];for(const t of this._outputShaderTypes.values())e.push(t.node);for(;e.length;){const t=e.pop();"number"!=typeof t&&"boolean"!=typeof t&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(const e of this.nodes())"number"!=typeof e&&"boolean"!=typeof e&&(yield e)}createSubgraphContext(){const e=this.clone();return e.body="",e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){const e=new o([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(""),this._insertInputs(e,"vertex"),e.vertex.code.add(""),e.vertex.code.add("// OUTPUTS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this.rootOutputNodes()){const a="builtin"===t.outVariableType;if(!this.shouldPruneOutputNode(t))if(a)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else{const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}e.vertex.code.add(""),e.vertex.code.add("void main() {"),e.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("// OUTPUTS: "),e.fragment.code.add("// --------------------------------------------------------- ");let t=0;for(const r of this.rootOutputNodes())"builtin"===r.outVariableType?e.fragment.code.add(`// ${r.outVariableType.padEnd(7)} ${r.node.type.padEnd(9)} ${r.outVariableName};`):"discard"===r.outVariableType||e.outputs.add(r.outVariableName,r.node.type,t++);e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split("\n").join("\n "));const a=Array.from(this.rootOutputNodes()),o=a.find(e=>"discard"===e.outVariableType),n=a.filter(e=>"discard"!==e.outVariableType);o&&(e.fragment.code.add(` if (${o.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" "));for(const r of n)e.fragment.code.add(` ${r.outVariableName} = ${r.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const a of this.inputs())if(a.isUsed&&"builtin"!==a.variableInputType)if("array"===a.node.type)e[t].code.add(`${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}];`);else if("array-2d"===a.node.type)e[t].code.add(`${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{const o=[...a.qualifiers,a.variableInputType].join(" ");e[t].code.add(` ${o.padEnd(10)} ${a.node.type.padEnd(9)} ${a.variableName};`)}}}function n(e){switch(e.type){case"float":case"vec2":case"vec3":case"vec4":return null;case"int":case"ivec2":case"ivec3":case"ivec4":case"uint":case"uvec2":case"uvec3":case"uvec4":case"bool":case"bvec2":case"bvec3":case"bvec4":return"flat";case"mat2":case"mat3":case"mat4":case"array":case"sampler2D":case"array-2d":throw new Error(`InternalError: ${e.type} is not a valid output type`)}}export{o as ShaderGraphContext,t as ShaderInput,a as ShaderOutput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- class r{constructor(){this._programCache=new Map}destroy(){for(const r of this._programCache.values())r.destroy();this._programCache.clear()}getProgram(r,e,t,a,o,s){const c=s??r.getShaderKey(e,t,a,o);let g=this._programCache.get(c);return g||(g=r.getProgram(e,t,a,o),this._programCache.set(c,g)),g}}export{r as TechniqueProgramCache};
2
+ class r{constructor(){this._programCache=new Map}destroy(){for(const r of this._programCache.values())r.destroy();this._programCache.clear()}getProgram(r,e,t,a,o,s,c){const g=c??r.getShaderKey(e,t,a,o,s);let h=this._programCache.get(g);return h||(h=r.getProgram(e,t,o,s),this._programCache.set(g,h)),h}}export{r as TechniqueProgramCache};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{FeatureTechnique as e}from"./FeatureTechnique.js";import{MeshWriter as t}from"./mesh/MeshWriter.js";import{TestShader as r}from"./shaders/TestShader.js";import{DataType as o}from"../../../../../webgl/enums.js";const i={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7681}}}};class s extends e{constructor(){super(...arguments),this.type=31,this.shaders={geometry:new r}}render(e,t){const{painter:r}=e,o=t.instance.getInput();r.setShader({shader:this.shaders.geometry,uniforms:{dataDrivenColor:o.uniforms.dataDrivenColor,view:{zoomLevel:1}},defines:{returnRed:!1},optionalAttributes:{},useComputeBuffer:!1}),r.setPipelineState(i),r.submitDraw(e,t)}}const n={createComputedParams:e=>e,optionalAttributes:{},attributes:{pos:{type:o.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:o.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:o.UNSIGNED_BYTE,count:1},size:{type:o.UNSIGNED_BYTE,count:1,packPrecisionFactor:10,pack:e=>.2},offset:{type:o.INT,count:2,packPrecisionFactor:10,packAlternating:{count:4,pack:()=>[[-1,1],[1,1],[-1,-1],[1,-1]]}},color:{type:o.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>e}}};class a extends t{constructor(){super(...arguments),this.vertexSpec=n}_write(e,t){e.recordStart(this.instanceId,this.attributeLayout);const r=655360,o=e.vertexCount(),i=t.readXForDisplay(),s=t.readYForDisplay();this._writeVertex(e,r,i,s),e.indexWrite(o+0),e.indexWrite(o+1),e.indexWrite(o+2),e.indexWrite(o+1),e.indexWrite(o+3),e.indexWrite(o+2),e.recordEnd()}}export{a as TestMeshWriter,s as TestTechnique};
2
+ import{FeatureTechnique as e}from"./FeatureTechnique.js";import{MeshWriter as t}from"./mesh/MeshWriter.js";import{TestShader as r}from"./shaders/TestShader.js";import{DataType as o}from"../../../../../webgl/enums.js";const i={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7681}}}};class s extends e{constructor(){super(...arguments),this.type=31,this.shaders={geometry:new r}}render(e,t){const{painter:r}=e,o=t.instance.getInput();r.setShader({shader:this.shaders.geometry,uniforms:{dataDrivenColor:o.uniforms.dataDrivenColor,view:{zoomLevel:1}},textures:{},defines:{returnRed:!1},optionalAttributes:{},useComputeBuffer:!1}),r.setPipelineState(i),r.submitDraw(e,t)}}const n={createComputedParams:e=>e,optionalAttributes:{},attributes:{pos:{type:o.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:o.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:o.UNSIGNED_BYTE,count:1},size:{type:o.UNSIGNED_BYTE,count:1,packPrecisionFactor:10,pack:e=>.2},offset:{type:o.INT,count:2,packPrecisionFactor:10,packAlternating:{count:4,pack:()=>[[-1,1],[1,1],[-1,-1],[1,-1]]}},color:{type:o.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>e}}};class a extends t{constructor(){super(...arguments),this.vertexSpec=n}_write(e,t){e.recordStart(this.instanceId,this.attributeLayout);const r=655360,o=e.vertexCount(),i=t.readXForDisplay(),s=t.readYForDisplay();this._writeVertex(e,r,i,s),e.indexWrite(o+0),e.indexWrite(o+1),e.indexWrite(o+2),e.indexWrite(o+1),e.indexWrite(o+3),e.indexWrite(o+2),e.recordEnd()}}export{a as TestMeshWriter,s as TestTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../../../../../core/has.js";import{isPowerOfTwo as e,nextPowerOfTwo as t}from"../../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../../core/maybe.js";import{simplePipelineState as s}from"../utils.js";import{Technique as u}from"./Technique.js";import{TextureStatisticsDiffShader as o}from"./shaders/TextureStatisticsDiffShader.js";import{TextureStatisticsMinMaxSumShader as i}from"./shaders/TextureStatisticsMinMaxSumShader.js";import{TextureStatisticsStdDevShader as a}from"./shaders/TextureStatisticsStdDevShader.js";import{TextureStatisticsSumOfSquaredDiffShader as n}from"./shaders/TextureStatisticsSumOfSquaredDiffShader.js";import{getWebGLCapabilities as f}from"../../../../../webgl/capabilities.js";import{ColorAttachment2 as l,ColorAttachment3 as h,ColorAttachment0 as m,ColorAttachment1 as x,SizedPixelFormat as c,PixelType as T}from"../../../../../webgl/enums.js";import{DisposableFramebufferObject as d}from"../../../../../webgl/FramebufferObject.js";import p from"../../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../../webgl/TextureDescriptor.js";const _=1048576;class F extends u{constructor(){super(...arguments),this.type=36,this._width=0,this._height=0,this._framebuffers=null,this._minTexture=null,this._maxTexture=null,this._sumTexture=null,this._numOfNoDataTexture=null,this._resultsFramebuffer=null,this._startFramebuffer=null,this._diffFramebuffer=null,this._scaleFbo=null,this.shaders={textureStatisticsMinMaxSum:new i,textureStatisticsSum:new n,textureStatisticsDiff:new o,textureStatisticsStdDev:new a}}dispose(){this.shaders.textureStatisticsMinMaxSum=null,this._framebuffers&&(this._framebuffers.forEach(e=>r(e)),this._framebuffers=null),r(this._resultsFramebuffer),r(this._startFramebuffer),r(this._diffFramebuffer),r(this._scaleFbo),r(this._minTexture),r(this._maxTexture),r(this._sumTexture),r(this._numOfNoDataTexture)}get minValuesTexture(){return this._minTexture||null}get maxValuesTexture(){return this._maxTexture||null}get meanValuesTexture(){return this._resultsFramebuffer?.getColorTexture(l)||null}get stdDevValuesTexture(){return this._resultsFramebuffer?.getColorTexture(h)||null}get statsFbo(){return this._resultsFramebuffer}render(t,r){const{context:u,painter:o}=t;let i=r.fbo.width,a=r.fbo.height,n=r.fbo;const f=u.gl,l=u.boundFramebuffer;if(i*a>_||!e(i)||!e(a)){const t=i/a;if(i*a>_){const e=Math.max(Math.floor(Math.sqrt(_/t)),1);i=Math.max(Math.floor(t*e),1),a=e}if(e(i)||(i=S(i)),e(a)||(a=S(a)),this._scaleFbo)this._scaleFbo.resize(i,a);else{const{dataType:e,internalFormat:t}=r.fbo.getColorTexture(m).descriptor,s=t??c.RGBA8;this._scaleFbo=w(u,i,a,e,s)}u.bindFramebuffer(this._scaleFbo),u.setViewport(0,0,i,a),o.blitTexture(u,n.getColorTexture(m),9728),n=this._scaleFbo}this._updateResources(t,n),o.setPipelineState({...s,color:{write:[!0,!0,!0,!0],blendMode:"none"}});const h=this._applyReductionPass(t);f.readBuffer(f.COLOR_ATTACHMENT3),h.copyToTexture(0,0,1,1,0,0,this._numOfNoDataTexture),f.readBuffer(f.COLOR_ATTACHMENT2),h.copyToTexture(0,0,1,1,0,0,this._sumTexture),f.readBuffer(f.COLOR_ATTACHMENT1),h.copyToTexture(0,0,1,1,0,0,this._maxTexture),f.readBuffer(f.COLOR_ATTACHMENT0),h.copyToTexture(0,0,1,1,0,0,this._minTexture);const x=r.fbo.getColorTexture(m);if(!x)throw new Error("Start buffer color texture is not available, cannot compute diff.");this._computeDiff(t,x,this._sumTexture,this._numOfNoDataTexture,i,a);const T=this._applySecondReductionPass(t,i,a).getColorTexture(m);this._computeSdtDev(t,this._minTexture,this._maxTexture,this._sumTexture,this._numOfNoDataTexture,T,i,a),u.bindFramebuffer(l),u.setViewport(0,0,r.fbo.width,r.fbo.height),o.setPipelineState(s)}_applyReductionPass(e){const{context:t,painter:r}=e,s=this.shaders.textureStatisticsMinMaxSum,u=this._framebuffers;if(null===u)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");const o=this._startFramebuffer;let i=o.getColorTexture(m),a=o.getColorTexture(x),n=o.getColorTexture(l),f=o.getColorTexture(h);const c=u;let T=0;for(const d of c){t.setViewport(0,0,d.width,d.height),t.bindFramebuffer(d),t.setClearColor(0,0,0,0),t.clear(16384);const e={shader:s,uniforms:{config:{minTexture:{texture:i,unit:1},maxTexture:{texture:a,unit:2},sumTexture:{texture:n,unit:3},numOfNoDataTexture:{texture:f,unit:4},width:d.width,height:d.height,isFirstPass:0===T?1:0}},defines:null,optionalAttributes:null,useComputeBuffer:!1};r.submitDrawMesh(t,e,r.quadMesh),i=d.getColorTexture(m),a=d.getColorTexture(x),n=d.getColorTexture(l),f=d.getColorTexture(h),T++}return u.at(-1)}_applySecondReductionPass(e,t,r){const{context:s,painter:u}=e,o=this.shaders.textureStatisticsSum,i=this._framebuffers;if(null===i||null==this._diffFramebuffer)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");let a=this._diffFramebuffer.getColorTexture(m);const n=i;for(const f of n){s.setViewport(0,0,f.width,f.height),s.bindFramebuffer(f),s.setClearColor(0,0,0,0),s.clear(16384);const e={shader:o,uniforms:{config:{sumTexture:{texture:a,unit:2},width:f.width,height:f.height}},defines:null,optionalAttributes:null,useComputeBuffer:!1};u.submitDrawMesh(s,e,u.quadMesh),a=f.getColorTexture(m)}return i.at(-1)}_updateResources(e,t){const{context:r}=e,s=t.width,u=t.height;if(null===this._startFramebuffer){if(!f().supportsColorBufferFloat)throw new Error("WebGL does not support color buffer float, cannot compute texture statistics.");const e=t.getColorTexture(m);if(!e)throw new Error("Input FBO does not have a color attachment 0, cannot compute texture statistics.");const o=e.descriptor,{dataType:i,internalFormat:a}=o,n=w(r,s,u,i,a??c.RGBA8,4),d=n.getColorTexture(m),p=n.getColorTexture(x),b=n.getColorTexture(l),_=n.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,d),t.copyToTexture(0,0,s,u,0,0,p),t.copyToTexture(0,0,s,u,0,0,b),t.copyToTexture(0,0,s,u,0,0,_),this._startFramebuffer=n,this._diffFramebuffer=w(r,s,u,T.FLOAT,c.RGBA32F),this._resultsFramebuffer=w(r,1,1,T.FLOAT,c.RGBA32F,4),this._minTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._maxTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._sumTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._numOfNoDataTexture=C(r,1,1,T.FLOAT,c.R32F)}else{const e=this._startFramebuffer;e.resize(s,u);const r=e.getColorTexture(m),o=e.getColorTexture(x),i=e.getColorTexture(l),a=e.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,r),t.copyToTexture(0,0,s,u,0,0,o),t.copyToTexture(0,0,s,u,0,0,i),t.copyToTexture(0,0,s,u,0,0,a),this._diffFramebuffer.resize(s,u)}if(this._width===s&&this._height===u&&null!==this._framebuffers)return;const o=(this._framebuffers||[]).reverse();this._framebuffers=null,this._width=s,this._height=u,this._framebuffers=this._updateFramebuffers(r,s,u,o,4)}_updateFramebuffers(e,t,s,u,o=1){const i=[];let a=t,n=s;for(;a>1||n>1;){const t=Math.max(1,Math.floor(a/2)),r=Math.max(1,Math.floor(n/2)),s=g(e,t,r,u,o);i.push(s),a=t,n=r}return i.at(-1),u.forEach(e=>r(e)),u.length=0,i}_computeDiff(e,t,r,s,u,o){const{context:i,painter:a}=e;i.bindFramebuffer(this._diffFramebuffer),i.setViewport(0,0,u,o),i.setClearColor(0,0,0,0),i.clear(16384);const n={shader:this.shaders.textureStatisticsDiff,uniforms:{config:{inputTexture:{texture:t,unit:1},sumTexture:{texture:r,unit:2},numOfNoDataTexture:{texture:s,unit:3},numTexels:u*o}},defines:null,optionalAttributes:null,useComputeBuffer:!1};a.submitDrawMesh(i,n,a.quadMesh)}_computeSdtDev(e,t,r,s,u,o,i,a){const{context:n,painter:f}=e;n.bindFramebuffer(this._resultsFramebuffer),n.setViewport(0,0,1,1),n.setClearColor(0,0,0,0),n.clear(16384);const l={shader:this.shaders.textureStatisticsStdDev,uniforms:{config:{minTexture:{texture:t,unit:1},maxTexture:{texture:r,unit:2},sumTexture:{texture:s,unit:3},numOfNoDataTexture:{texture:u,unit:4},diffSqTexture:{texture:o,unit:5},numTexels:i*a}},defines:null,optionalAttributes:null,useComputeBuffer:!1};f.submitDrawMesh(n,l,f.quadMesh)}}function g(e,t,r,s,u=1){let o=s.pop();return void 0!==o?o.resize(t,r):o=w(e,t,r,T.FLOAT,c.RGBA32F,u),o}function w(e,t,r,s,u,o=1){if(o<1||o>4)throw new Error("Number of color attachments must be between 1 and 4.");const i=new d(e,C(e,t,r,s,u));for(let a=1;a<o;a++){const o=C(e,t,r,s,u);i.attachColorTexture(o,m+a)}return i}function C(e,t,r,s,u){const o=new b(t,r);return o.samplingMode=9728,o.wrapMode=33071,o.pixelFormat=6408,o.dataType=s,o.internalFormat=u,new p(e,o)}function S(e){const r=t(e),s=r/2;return Math.abs(r-e)<Math.abs(s-e)?r:s}export{F as TextureStatisticsTechnique};
2
+ import"../../../../../../core/has.js";import{isPowerOfTwo as e,nextPowerOfTwo as t}from"../../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../../core/maybe.js";import{simplePipelineState as s}from"../utils.js";import{Technique as u}from"./Technique.js";import{TextureStatisticsDiffShader as o}from"./shaders/TextureStatisticsDiffShader.js";import{TextureStatisticsMinMaxSumShader as i}from"./shaders/TextureStatisticsMinMaxSumShader.js";import{TextureStatisticsStdDevShader as a}from"./shaders/TextureStatisticsStdDevShader.js";import{TextureStatisticsSumOfSquaredDiffShader as n}from"./shaders/TextureStatisticsSumOfSquaredDiffShader.js";import{getWebGLCapabilities as f}from"../../../../../webgl/capabilities.js";import{ColorAttachment2 as l,ColorAttachment3 as h,ColorAttachment0 as m,ColorAttachment1 as x,SizedPixelFormat as c,PixelType as T}from"../../../../../webgl/enums.js";import{DisposableFramebufferObject as d}from"../../../../../webgl/FramebufferObject.js";import p from"../../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../../webgl/TextureDescriptor.js";const _=1048576;class F extends u{constructor(){super(...arguments),this.type=36,this._width=0,this._height=0,this._framebuffers=null,this._minTexture=null,this._maxTexture=null,this._sumTexture=null,this._numOfNoDataTexture=null,this._resultsFramebuffer=null,this._startFramebuffer=null,this._diffFramebuffer=null,this._scaleFbo=null,this.shaders={textureStatisticsMinMaxSum:new i,textureStatisticsSum:new n,textureStatisticsDiff:new o,textureStatisticsStdDev:new a}}dispose(){this.shaders.textureStatisticsMinMaxSum=null,this._framebuffers&&(this._framebuffers.forEach(e=>r(e)),this._framebuffers=null),r(this._resultsFramebuffer),r(this._startFramebuffer),r(this._diffFramebuffer),r(this._scaleFbo),r(this._minTexture),r(this._maxTexture),r(this._sumTexture),r(this._numOfNoDataTexture)}get minValuesTexture(){return this._minTexture||null}get maxValuesTexture(){return this._maxTexture||null}get meanValuesTexture(){return this._resultsFramebuffer?.getColorTexture(l)||null}get stdDevValuesTexture(){return this._resultsFramebuffer?.getColorTexture(h)||null}get statsFbo(){return this._resultsFramebuffer}render(t,r){const{context:u,painter:o}=t;let i=r.fbo.width,a=r.fbo.height,n=r.fbo;const f=u.gl,l=u.boundFramebuffer;if(i*a>_||!e(i)||!e(a)){const t=i/a;if(i*a>_){const e=Math.max(Math.floor(Math.sqrt(_/t)),1);i=Math.max(Math.floor(t*e),1),a=e}if(e(i)||(i=S(i)),e(a)||(a=S(a)),this._scaleFbo)this._scaleFbo.resize(i,a);else{const{dataType:e,internalFormat:t}=r.fbo.getColorTexture(m).descriptor,s=t??c.RGBA8;this._scaleFbo=w(u,i,a,e,s)}u.bindFramebuffer(this._scaleFbo),u.setViewport(0,0,i,a),o.blitTexture(u,n.getColorTexture(m),9728),n=this._scaleFbo}this._updateResources(t,n),o.setPipelineState({...s,color:{write:[!0,!0,!0,!0],blendMode:"none"}});const h=this._applyReductionPass(t);f.readBuffer(f.COLOR_ATTACHMENT3),h.copyToTexture(0,0,1,1,0,0,this._numOfNoDataTexture),f.readBuffer(f.COLOR_ATTACHMENT2),h.copyToTexture(0,0,1,1,0,0,this._sumTexture),f.readBuffer(f.COLOR_ATTACHMENT1),h.copyToTexture(0,0,1,1,0,0,this._maxTexture),f.readBuffer(f.COLOR_ATTACHMENT0),h.copyToTexture(0,0,1,1,0,0,this._minTexture);const x=r.fbo.getColorTexture(m);if(!x)throw new Error("Start buffer color texture is not available, cannot compute diff.");this._computeDiff(t,x,this._sumTexture,this._numOfNoDataTexture,i,a);const T=this._applySecondReductionPass(t,i,a).getColorTexture(m);this._computeSdtDev(t,this._minTexture,this._maxTexture,this._sumTexture,this._numOfNoDataTexture,T,i,a),u.bindFramebuffer(l),u.setViewport(0,0,r.fbo.width,r.fbo.height),o.setPipelineState(s)}_applyReductionPass(e){const{context:t,painter:r}=e,s=this.shaders.textureStatisticsMinMaxSum,u=this._framebuffers;if(null===u)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");const o=this._startFramebuffer;let i=o.getColorTexture(m),a=o.getColorTexture(x),n=o.getColorTexture(l),f=o.getColorTexture(h);const c=u;let T=0;for(const d of c){t.setViewport(0,0,d.width,d.height),t.bindFramebuffer(d),t.setClearColor(0,0,0,0),t.clear(16384);const e={shader:s,uniforms:{config:{width:d.width,height:d.height,isFirstPass:0===T?1:0}},textures:{minTexture:{texture:i,unit:1},maxTexture:{texture:a,unit:2},sumTexture:{texture:n,unit:3},numOfNoDataTexture:{texture:f,unit:4}},defines:null,optionalAttributes:null,useComputeBuffer:!1};r.submitDrawMesh(t,e,r.quadMesh),i=d.getColorTexture(m),a=d.getColorTexture(x),n=d.getColorTexture(l),f=d.getColorTexture(h),T++}return u.at(-1)}_applySecondReductionPass(e,t,r){const{context:s,painter:u}=e,o=this.shaders.textureStatisticsSum,i=this._framebuffers;if(null===i||null==this._diffFramebuffer)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");let a=this._diffFramebuffer.getColorTexture(m);const n=i;for(const f of n){s.setViewport(0,0,f.width,f.height),s.bindFramebuffer(f),s.setClearColor(0,0,0,0),s.clear(16384);const e={shader:o,uniforms:{config:{width:f.width,height:f.height}},textures:{sumTexture:{texture:a,unit:2}},defines:null,optionalAttributes:null,useComputeBuffer:!1};u.submitDrawMesh(s,e,u.quadMesh),a=f.getColorTexture(m)}return i.at(-1)}_updateResources(e,t){const{context:r}=e,s=t.width,u=t.height;if(null===this._startFramebuffer){if(!f().supportsColorBufferFloat)throw new Error("WebGL does not support color buffer float, cannot compute texture statistics.");const e=t.getColorTexture(m);if(!e)throw new Error("Input FBO does not have a color attachment 0, cannot compute texture statistics.");const o=e.descriptor,{dataType:i,internalFormat:a}=o,n=w(r,s,u,i,a??c.RGBA8,4),d=n.getColorTexture(m),p=n.getColorTexture(x),b=n.getColorTexture(l),_=n.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,d),t.copyToTexture(0,0,s,u,0,0,p),t.copyToTexture(0,0,s,u,0,0,b),t.copyToTexture(0,0,s,u,0,0,_),this._startFramebuffer=n,this._diffFramebuffer=w(r,s,u,T.FLOAT,c.RGBA32F),this._resultsFramebuffer=w(r,1,1,T.FLOAT,c.RGBA32F,4),this._minTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._maxTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._sumTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._numOfNoDataTexture=C(r,1,1,T.FLOAT,c.R32F)}else{const e=this._startFramebuffer;e.resize(s,u);const r=e.getColorTexture(m),o=e.getColorTexture(x),i=e.getColorTexture(l),a=e.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,r),t.copyToTexture(0,0,s,u,0,0,o),t.copyToTexture(0,0,s,u,0,0,i),t.copyToTexture(0,0,s,u,0,0,a),this._diffFramebuffer.resize(s,u)}if(this._width===s&&this._height===u&&null!==this._framebuffers)return;const o=(this._framebuffers||[]).reverse();this._framebuffers=null,this._width=s,this._height=u,this._framebuffers=this._updateFramebuffers(r,s,u,o,4)}_updateFramebuffers(e,t,s,u,o=1){const i=[];let a=t,n=s;for(;a>1||n>1;){const t=Math.max(1,Math.floor(a/2)),r=Math.max(1,Math.floor(n/2)),s=g(e,t,r,u,o);i.push(s),a=t,n=r}return i.at(-1),u.forEach(e=>r(e)),u.length=0,i}_computeDiff(e,t,r,s,u,o){const{context:i,painter:a}=e;i.bindFramebuffer(this._diffFramebuffer),i.setViewport(0,0,u,o),i.setClearColor(0,0,0,0),i.clear(16384);const n={shader:this.shaders.textureStatisticsDiff,uniforms:{config:{numTexels:u*o}},textures:{inputTexture:{texture:t,unit:1},sumTexture:{texture:r,unit:2},numOfNoDataTexture:{texture:s,unit:3}},defines:null,optionalAttributes:null,useComputeBuffer:!1};a.submitDrawMesh(i,n,a.quadMesh)}_computeSdtDev(e,t,r,s,u,o,i,a){const{context:n,painter:f}=e;n.bindFramebuffer(this._resultsFramebuffer),n.setViewport(0,0,1,1),n.setClearColor(0,0,0,0),n.clear(16384);const l={shader:this.shaders.textureStatisticsStdDev,uniforms:{config:{numTexels:i*a}},textures:{minTexture:{texture:t,unit:1},maxTexture:{texture:r,unit:2},sumTexture:{texture:s,unit:3},numOfNoDataTexture:{texture:u,unit:4},diffSqTexture:{texture:o,unit:5}},defines:null,optionalAttributes:null,useComputeBuffer:!1};f.submitDrawMesh(n,l,f.quadMesh)}}function g(e,t,r,s,u=1){let o=s.pop();return void 0!==o?o.resize(t,r):o=w(e,t,r,T.FLOAT,c.RGBA32F,u),o}function w(e,t,r,s,u,o=1){if(o<1||o>4)throw new Error("Number of color attachments must be between 1 and 4.");const i=new d(e,C(e,t,r,s,u));for(let a=1;a<o;a++){const o=C(e,t,r,s,u);i.attachColorTexture(o,m+a)}return i}function C(e,t,r,s,u){const o=new b(t,r);return o.samplingMode=9728,o.wrapMode=33071,o.pixelFormat=6408,o.dataType=s,o.internalFormat=u,new p(e,o)}function S(e){const r=t(e),s=r/2;return Math.abs(r-e)<Math.abs(s-e)?r:s}export{F as TextureStatisticsTechnique};