@arcgis/core 6.0.0-next.23 → 6.0.0-next.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/Graphic.d.ts +47 -14
  2. package/PopupTemplate.js +1 -1
  3. package/WebScene.d.ts +3 -0
  4. package/arcade/functions/string.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/{db9921fbda556f142c4a.js → 04d55ed51e8b2683c4b4.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{435b90168f79c5587a07.js → 04ecf15524ff3838c01c.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{e2f42aec02bff33b25dd.js → 09300e74e5b014ce6269.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{fcb86d24fc7e0666b564.js → 096b2bf1c0d69d27f20c.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{612345f17f5eeb99ea8f.js → 0d9c4c6c571ce26d356b.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{0f725cf79ce00e790a7d.js → 1168bc5c9f0a7e1f63a2.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{12a7997a40c77f5c9160.js → 151e5799ede763a03ee2.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{a64446a3328a7323e307.js → 173f89c55a5c79ff065b.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{8715661a838361d4211a.js → 1b24a40c0fa197014873.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{ca0d4ce453d8eb35467d.js → 277263466837e1673f56.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{b1d989b72203113a06fe.js → 2a36fe3f3f257a779a1b.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{ffcb99693182a621a93e.js → 2cf8172be83b10b11bdc.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{fcaf9450642fcef83286.js → 3048e74e6246324ce6fc.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{95b82cbbe355266c65d7.js → 30af63b3b750142faadb.js} +1 -1
  20. package/assets/esri/core/workers/chunks/30dcf2cfb31cb70de7df.js +1 -0
  21. package/assets/esri/core/workers/chunks/{9f0a973a0dd28953ce25.js → 371e2ddb88cc6b9a41e8.js} +1 -1
  22. package/assets/esri/core/workers/chunks/3fd5c3cd8457ddc68798.js +1 -0
  23. package/assets/esri/core/workers/chunks/{62fec1816907f070f079.js → 3fe04f13215474accb09.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f47fe4433b05fca5c3ad.js → 42f6194633c2d879c8da.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{cddc3e285f763ccf33c2.js → 4869e097261ded90b8bb.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{d8a7eba588d374b2f961.js → 4bb9a5f4ca944d3fc206.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{8052da8be251c3ff2176.js → 4d93bed14945e3d34d5c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{65cb5e39c467a35621ca.js → 56e903ccef66cbe18f92.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{44d5508042cacdfcac47.js → 58da3f8cf0f7f6a7e4fa.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{bc915fb182d463d804e6.js → 5c04835b0b52461183cd.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{7e8611cb709f105946f5.js → 6061232c96e11eb7b25d.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{1e514e1c9aabefa04201.js → 64382363d6dc04ff1eac.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{c82daefb193aae895bc0.js → 67e06d606c7fd2064adf.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{434a8ba841a59e0deab9.js → 67e533748435253aaba6.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{feb41abc03d677df6f73.js → 6b9961261241fdce0e94.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{949bee7b304e625a7891.js → 6db0f8fe1402643fbe1a.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{96c4ea9cfa3930f1c3fb.js → 6f1d6453184e0a1530ad.js} +1 -1
  38. package/assets/esri/core/workers/chunks/6f897b4e7ddd1dd1672b.js +1 -0
  39. package/assets/esri/core/workers/chunks/{0049b66ccbfb168caa76.js → 7124ad8dc5ad40dc66f3.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{6e107ce73633de8ac257.js → 72f4dad65e16a7d7c58f.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{0df9a906f7823c23d426.js → 7566321c6a2913f2852b.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{c4ddac23bd649d24f3f2.js → 75d551a449bba61ce238.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{af349c7bc8ef41a0e1bd.js → 7748c2886d0122b40eeb.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{b4c3ec081874b49ff89b.js → 78fbe330f16bdbdb886e.js} +1 -1
  45. package/assets/esri/core/workers/chunks/79483c05867ba1386f5a.js +1 -0
  46. package/assets/esri/core/workers/chunks/7b482afb9fd1229f5707.js +1 -0
  47. package/assets/esri/core/workers/chunks/7c631e2947243e2c9bde.js +1 -0
  48. package/assets/esri/core/workers/chunks/7db9e615e60d824eac1b.js +1 -0
  49. package/assets/esri/core/workers/chunks/{8a7b02037151767542f1.js → 7dbf4c7480bf9c72820d.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{64b360625c68cb863a08.js → 84940d8e14caf5a27e04.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{1b1d3f6916d2cb751435.js → 87177e0f82e8a6ae3189.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{5cb26bbaa08114aec5ce.js → 89cc1a5539b82fb46216.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{9d40786c5ceface786ba.js → 8a485130781b49dbf608.js} +1 -1
  54. package/assets/esri/core/workers/chunks/8b5dcc4282772bf6b675.js +1 -0
  55. package/assets/esri/core/workers/chunks/{8c12269d26f5a4c753cb.js → 8ebaf5754e86a45b0497.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{542e5640ea1b80ef801a.js → 9189dfe19a2a2ccd5173.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{67a35155b8b4d36f171e.js → 926e0a3827eaf16ca8b4.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{dc1761cba0454fda3cf9.js → 9630234267098115de4d.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{10d80e793019dfb45ca2.js → 987424121cf30b0f3c50.js} +1 -1
  60. package/assets/esri/core/workers/chunks/9afc87474cef1fc4fe4a.js +1 -0
  61. package/assets/esri/core/workers/chunks/{facd1ff23203fed67686.js → 9b048f80c2d28d527373.js} +1 -1
  62. package/assets/esri/core/workers/chunks/9dd48e75b4e8d9811d81.js +1 -0
  63. package/assets/esri/core/workers/chunks/{ee08ae5b73439a1ff666.js → a163c6005aba3378edaa.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{517106048980a3cbe072.js → a4b822ee45810c4c292a.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{092e311cb7aea92a6a26.js → acb265a22be5e12f38e5.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{1a411ddae7a47015370c.js → acf4737ba509cbd73cce.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{d247dd53788d512b9c9f.js → af3c6794334626b94f00.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{532e9cda8ac3601d8892.js → b12acf1f694f82e00df9.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{636cd05abfbdff19029e.js → ba3d5abff65aefcb8dee.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{504184828048310a052c.js → bdc221d94300c225665a.js} +1 -1
  71. package/assets/esri/core/workers/chunks/c0eb27263f608dc3684b.js +1 -0
  72. package/assets/esri/core/workers/chunks/c2318c014e97ba519be8.js +1 -0
  73. package/assets/esri/core/workers/chunks/{7f8e327acad48c9e75ea.js → c62237c344e341619341.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{a2ad3e620c98e2b2eb06.js → cd355baab983033c3ef0.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{7be6d621a0d1e33dfff4.js → d070fcb73ce274ab80e4.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{6d41444b46677aa762a7.js → db41490bd39d863305bf.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{fc5a36e54929e03efa86.js → dba5f44c4e4a3f075df2.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{3e30b96a8c75bd5b9ae2.js → ddc95cdac6c06fc4794c.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{a5c8f9f5be4ef5063b42.js → df26ec0b508cf4716e0a.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{f426da2210888cc264b4.js → e83f9abee611c5b80009.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{8487727f1197cf7dbf50.js → ef12fa3574d4cbf8b084.js} +1 -1
  82. package/assets/esri/core/workers/chunks/f10c883eb26330e3421c.js +1 -0
  83. package/assets/esri/core/workers/chunks/f46e92c67986c8c09bdd.js +1 -0
  84. package/assets/esri/core/workers/chunks/{709e019885822b1f6f3e.js → f905f1a1aa4c123cbe83.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{5b91e2dffdc84c006539.js → fb37f0848196c28b7fd7.js} +1 -1
  86. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  87. package/assets/esri/libs/librust-text/pkg/text_bg.wasm +0 -0
  88. package/chunks/MultiPathImpl.js +1 -1
  89. package/chunks/OperatorProximityGeodesic.js +1 -1
  90. package/chunks/basis_encoder.js +1 -1
  91. package/chunks/basis_transcoder.js +1 -1
  92. package/chunks/draco_mesh_decoder.js +1 -1
  93. package/chunks/dxt_encoder.js +1 -1
  94. package/chunks/i3s.js +1 -1
  95. package/chunks/lclayout.js +1 -1
  96. package/chunks/lerc-wasm.js +1 -1
  97. package/chunks/libtess-f32.js +1 -1
  98. package/chunks/libtess-f64.js +1 -1
  99. package/chunks/lyr3DMain.js +1 -1
  100. package/chunks/lyr3DWorker.js +1 -1
  101. package/chunks/parquet.js +1 -1
  102. package/chunks/qb3-wasm.js +1 -1
  103. package/chunks/rbush.js +1 -1
  104. package/chunks/text.js +1 -1
  105. package/chunks/vxlLayer.js +1 -1
  106. package/config.js +1 -1
  107. package/core/workers/WorkerFallback.js +4 -2
  108. package/core/workers/workerFactory.js +1 -1
  109. package/core/workers/workers.js +4 -2
  110. package/geometry/support/labelPoint.js +1 -1
  111. package/graphic/AnnotationFeatureGraphicOrigin.d.ts +49 -9
  112. package/graphic/BuildingGraphicOrigin.d.ts +49 -0
  113. package/graphic/CSVGraphicOrigin.d.ts +42 -9
  114. package/graphic/CatalogGraphicOrigin.d.ts +42 -9
  115. package/graphic/DimensionFeatureGraphicOrigin.d.ts +42 -9
  116. package/graphic/FeatureGraphicOrigin.d.ts +42 -9
  117. package/graphic/GeoJSONGraphicOrigin.d.ts +42 -9
  118. package/graphic/GeoRSSGraphicOrigin.d.ts +42 -9
  119. package/graphic/GraphicOrigin.d.ts +52 -12
  120. package/graphic/ImageryGraphicOrigin.d.ts +42 -9
  121. package/graphic/ImageryTileGraphicOrigin.d.ts +42 -9
  122. package/graphic/KMLGraphicOrigin.d.ts +47 -10
  123. package/graphic/KnowledgeGraphGraphicOrigin.d.ts +49 -1
  124. package/graphic/LinkChartGraphicOrigin.d.ts +49 -1
  125. package/graphic/MapImageGraphicOrigin.d.ts +49 -1
  126. package/graphic/MapNotesGraphicOrigin.d.ts +48 -1
  127. package/graphic/OGCFeatureGraphicOrigin.d.ts +42 -9
  128. package/graphic/OrientedImageryGraphicOrigin.d.ts +42 -9
  129. package/graphic/ParquetGraphicOrigin.d.ts +42 -9
  130. package/graphic/PointCloudGraphicOrigin.d.ts +43 -0
  131. package/graphic/SceneGraphicOrigin.d.ts +43 -0
  132. package/graphic/SketchGraphicOrigin.d.ts +43 -0
  133. package/graphic/StreamGraphicOrigin.d.ts +43 -0
  134. package/graphic/SubtypeGroupGraphicOrigin.d.ts +49 -1
  135. package/graphic/TileGraphicOrigin.d.ts +49 -1
  136. package/graphic/VectorTileGraphicOrigin.d.ts +43 -14
  137. package/graphic/VoxelGraphicOrigin.d.ts +43 -0
  138. package/graphic/WCSGraphicOrigin.d.ts +43 -0
  139. package/graphic/WFSGraphicOrigin.d.ts +42 -9
  140. package/graphic/getGraphicOriginTitle.d.ts +21 -3
  141. package/kernel.js +1 -1
  142. package/layers/GaussianSplatLayer.d.ts +2 -1
  143. package/layers/ParquetLayer.d.ts +24 -1
  144. package/layers/ParquetLayer.js +1 -1
  145. package/layers/mixins/ReloadableLayer.js +1 -1
  146. package/layers/orientedImagery/transformations/utils.js +1 -1
  147. package/layers/save/featureLayerUtils.js +1 -1
  148. package/layers/save/imageryUtils.js +1 -1
  149. package/layers/save/mapImageLayerUtils.js +1 -1
  150. package/layers/save/mediaLayerUtils.js +1 -1
  151. package/layers/save/parquetLayerUtils.js +2 -0
  152. package/layers/save/streamLayerUtils.js +1 -1
  153. package/layers/support/LabelClass.d.ts +8 -2
  154. package/layers/support/layersMapping.js +1 -1
  155. package/layers/support/rasterJobHelper.js +1 -1
  156. package/layers/video/VideoController.js +5 -5
  157. package/package.json +2 -2
  158. package/popup/content.js +1 -1
  159. package/portal/schemas/definitions.js +1 -1
  160. package/portal/schemas/webScene.js +1 -1
  161. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  162. package/rest/query/operations/pbfFlatFeatureSet.js +1 -1
  163. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  164. package/undoredo/support/ApplySet.js +1 -1
  165. package/views/2d/engine/flow/ProcessingTimeEstimate.js +1 -1
  166. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  167. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  168. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  169. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  170. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  171. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  172. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  173. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  174. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  175. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  176. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  177. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  178. package/views/3d/layers/graphics/LabelParameters.js +1 -1
  179. package/views/3d/layers/graphics/Labeler.js +1 -1
  180. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  181. package/views/3d/layers/graphics/pointUtils.js +1 -1
  182. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  183. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  184. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  185. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  186. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  187. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  188. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  189. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  190. package/views/3d/state/utils/navigationUtils.js +1 -1
  191. package/views/3d/terrain/TerrainRenderer.js +1 -1
  192. package/views/3d/terrain/TerrainSurface.js +1 -1
  193. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  194. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastRenderer.js +1 -1
  195. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  196. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  197. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  198. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  199. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  200. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  201. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  202. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  203. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  204. package/views/3d/webgl-engine/materials/internal/worldSizedRibbonLineIntersectionUtils.js +1 -1
  205. package/views/DOMContainer.js +1 -1
  206. package/views/draw/SegmentDrawAction.js +1 -1
  207. package/views/interactive/snapping/SnappingManagerPool.js +1 -1
  208. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  209. package/views/interactive/tooltip/fields/TooltipField.js +1 -1
  210. package/views/support/LayerViewManager.js +1 -1
  211. package/views/support/ScheduledQueueProcessor.js +1 -1
  212. package/views/support/screenshotUtils.js +1 -1
  213. package/views/ui/UI.js +1 -1
  214. package/webdoc/support/webdocSaveUtils.js +1 -1
  215. package/webscene/Slide.d.ts +1 -2
  216. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  217. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  218. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  219. package/widgets/FeatureTable/RelationshipColumn.js +1 -1
  220. package/widgets/OrientedImageryViewer/ImageMeasurementWorker.js +1 -1
  221. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  222. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  223. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  224. package/widgets/Sketch/SketchViewModel.js +1 -1
  225. package/assets/esri/core/workers/chunks/14d5d219e7fe017f23f0.js +0 -1
  226. package/assets/esri/core/workers/chunks/42753cf4965a94bc91ca.js +0 -1
  227. package/assets/esri/core/workers/chunks/42e985a576d7aaeed0cf.js +0 -1
  228. package/assets/esri/core/workers/chunks/5046214dd32029cb733d.js +0 -1
  229. package/assets/esri/core/workers/chunks/58865772bed48141a56a.js +0 -1
  230. package/assets/esri/core/workers/chunks/72e6d594b7262430ae55.js +0 -1
  231. package/assets/esri/core/workers/chunks/7d11710e1586a3d75887.js +0 -1
  232. package/assets/esri/core/workers/chunks/8f74d92ac69714b9fd4e.js +0 -1
  233. package/assets/esri/core/workers/chunks/947674b2ca8be65b9bcc.js +0 -1
  234. package/assets/esri/core/workers/chunks/9e7c4eda135c4911b268.js +0 -1
  235. package/assets/esri/core/workers/chunks/a09d2e1e2540921e4717.js +0 -1
  236. package/assets/esri/core/workers/chunks/dfa5f1311806473e473f.js +0 -1
  237. package/assets/esri/core/workers/chunks/fc76aff0f7d95e517d8f.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "6.0.0-next.23",
3
+ "version": "6.0.0-next.24",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,7 +20,7 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.21.5",
23
- "@arcgis/toolkit": "6.0.0-next.23",
23
+ "@arcgis/toolkit": "6.0.0-next.24",
24
24
  "@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
25
25
  "@esri/calcite-components": "^5.2.0",
26
26
  "@vaadin/grid": "~25.3.4",
package/popup/content.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{deprecatedModule as e}from"../core/deprecate.js";import t from"../core/Logger.js";import n from"./content/AttachmentsContent.js";import r from"./content/Content.js";import i from"./content/CustomContent.js";import a from"./content/ExpressionContent.js";import o from"./content/FieldsContent.js";import s from"./content/MediaContent.js";import c from"./content/RelationshipContent.js";import l from"./content/TextContent.js";import u from"./content/UtilityNetworkAssociationsContent.js";e(t.getLogger(`esri.popup.content`),`esri.popup.content`,{replacement:`Individual content module imports`,version:`5.2`,warnOnce:!0});const d=n,f=r,p=i,m=a,h=o,g=s,_=c,v=l,y=u;function b(e){return e instanceof f}const x={base:null,key:`type`,typeMap:{attachment:d,media:g,text:v,expression:m,field:h,relationship:_,utilityNetworkAssociations:y}},S={base:null,key:`type`,typeMap:{attachment:d,media:g,text:v,expression:m,field:h,relationship:_}};export{d as AttachmentsContent,f as BaseContent,p as CustomContent,m as ExpressionContent,h as FieldsContent,g as MediaContent,_ as RelationshipContent,v as TextContent,y as UtilityNetworkAssociationsContent,b as isContent,x as persistableTypes,S as persistableWebSceneTypes};
2
+ import{deprecatedModule as e}from"../core/deprecate.js";import t from"../core/Logger.js";import n from"./content/AttachmentsContent.js";import r from"./content/Content.js";import i from"./content/CustomContent.js";import a from"./content/ExpressionContent.js";import o from"./content/FieldsContent.js";import s from"./content/MediaContent.js";import c from"./content/RelationshipContent.js";import l from"./content/TextContent.js";import u from"./content/UtilityNetworkAssociationsContent.js";e(t.getLogger(`esri.popup.content`),`esri.popup.content`,{replacement:`Individual content module imports`,version:`5.2`,warnOnce:!0});const d=n,f=r,p=i,m=a,h=o,g=s,_=c,v=l,y=u;function b(e){return e instanceof f}export{d as AttachmentsContent,f as BaseContent,p as CustomContent,m as ExpressionContent,h as FieldsContent,g as MediaContent,_ as RelationshipContent,v as TextContent,y as UtilityNetworkAssociationsContent,b as isContent};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- const e={"applicationProperties_schema.json":{title:`applicationProperties`,type:`object`,description:`Configuration of application and UI elements.`,properties:{viewing:{type:`object`,$ref:`#/definitions/viewing_schema.json`}},additionalProperties:!1},"baseMap_schema.json":{title:`baseMap`,type:`object`,description:`The basemap provides geographic context to the map and scene.`,properties:{baseMapLayers:{type:`array`,description:`An array of baseMapLayer objects defining the basemaps used in the web scene.`,items:{$ref:`#/definitions/baseMapLayer_schema.json`},uniqueItems:!0},elevationLayers:{type:`array`,description:"<em>Deprecated, use `baseMap.groundLayers` or `ground.layers` instead.<sup>[1](./baseMap.md#additional-information)</sup></em> An array of elevationLayer objects defining the basemaps used in the web scene.",items:{$ref:`#/definitions/elevationLayers_schema.json`},uniqueItems:!0},groundLayers:{type:`array`,description:`A Collection of integrated mesh layers which constitute the ground of the basemap used in the web scene.<sup>[2](./baseMap.md#additional-information)</sup>`,items:{$ref:`#/definitions/integratedMesh3DTilesLayer_schema.json`},uniqueItems:!0},id:{type:`string`,description:`A unique identifying string for the basemap.`},title:{type:`string`,description:`Required string title for the basemap that can be used in a table of contents.`}},required:[`baseMapLayers`,`title`],additionalProperties:!1},"clippingArea_schema.json":{title:`clippingArea`,type:`object`,description:`Defines area to be clipped for display.`,properties:{clip:{type:`boolean`,description:`enable / disable clipping`},geometry:{description:`envelope of clip area`,$ref:`#/definitions/extent_schema.json`}}},"focusAreas_schema.json":{title:`Focus Areas`,type:`object`,description:`Container holding the scene's focus areas.`,properties:{areas:{type:`array`,description:`Array of focus area objects.`,items:{$ref:`#/definitions/focusArea_schema.json`}},style:{description:`The global visual effect applied to all focus areas.`,enum:[`bright`,`dark`]}},required:[`areas`],additionalProperties:!1},"ground_schema.json":{title:`Ground`,type:`object`,description:`Ground defines the main surface of the web scene, based on elevation layers.`,properties:{layers:{type:`array`,description:`An array of elevationLayer objects defining the elevation of the ground in the web scene.`,items:{$ref:`#/definitions/elevationLayers_schema.json`},uniqueItems:!0},navigationConstraint:{description:`Object determining whether the camera is constrained to navigate only above, or also under the ground surface. If not specified, navigation is constrained to above ground.`,$ref:`#/definitions/navigationConstraint_schema.json`},surfaceColor:{description:`Defines the color of the ground surface, displayed underneath the basemap. If no color, the default grid is shown.`,$ref:`#/definitions/color_schema.json`},transparency:{type:`integer`,description:"The transparency of the ground surface. It is used for seeing through the ground, therefore this property also changes the transparency of the basemap. Draped operational layers are not affected by this property. The value has to lie between `100` (full transparency) and `0` (full opacity).",minimum:0,maximum:100}},required:[`layers`],additionalProperties:!1},"heightModelInfo_schema.json":{title:`heightModelInfo`,type:`object`,description:`An object that defines the characteristics of the vertical coordinate system used by the web scene.`,properties:{heightModel:{type:`string`,description:`The surface type or height model of the vertical coordinate system.`,enum:[`ellipsoidal`,`gravity_related_height`],default:`ellipsoidal`},heightUnit:{type:`string`,description:`The unit of the vertical coordinate system.<a href="#heightUnit"><sup>1</sup></a>`,enum:[`150-kilometers`,`50-kilometers`,`benoit-1895-b-chain`,`clarke-foot`,`clarke-link`,`clarke-yard`,`foot`,`gold-coast-foot`,`indian-1937-yard`,`indian-yard`,`meter`,`sears-1922-truncated-chain`,`sears-chain`,`sears-foot`,`sears-yard`,`us-foot`]},vertCRS:{type:`string`,description:`(Optional) The datum realization of the vertical coordinate system.`}},required:[`heightModel`,`heightUnit`],additionalProperties:!1},"initialState_schema.json":{title:`initialState`,type:`object`,description:`An object that provides information about the initial environment settings and viewpoint of the web scene.`,properties:{analyses:{type:`array`,description:`List of analyses which are part of the view.`,items:{$ref:`#/definitions/analyses_schema.json`}},environment:{type:`object`,$ref:`#/definitions/environment_schema.json`},timeExtent:{description:`Represents the time extent for the data displayed on the scene.`,$ref:`#/definitions/timeExtent_schema.json`},viewpoint:{description:`Describes a point of view for a 2D or 3D view. In a 3D view, it is determined using a camera position.`,$ref:`#/definitions/viewpoint_schema.json`}},required:[`environment`,`viewpoint`],additionalProperties:!1},"mapFloorInfo_schema.json":{title:`mapFloorInfo`,type:`object`,description:`Contains floor-awareness information for the web scene. Defines the layers and required fields for each layer that are used for floor filtering.`,properties:{facilityLayer:{description:`Defines the layer and field properties for the Facility layer used for floor filtering.`,$ref:`#/definitions/facilityLayerInfo_schema.json`},levelLayer:{description:`Defines the layer and field properties for the Level layer used for floor filtering.`,$ref:`#/definitions/levelLayerInfo_schema.json`},siteLayer:{description:`Defines the layer and field properties for the Site layer used for floor filtering. This property is optional.`,$ref:`#/definitions/siteLayerInfo_schema.json`}},required:[`facilityLayer`,`levelLayer`],additionalProperties:!1},"mapRangeInfo_schema.json":{title:`Map Range Information`,description:`Map range information`,properties:{activeRangeName:{type:`string`,description:`Active range ID that slider/picker acts upon.`},currentRangeExtent:{type:`array`,description:`Current range for the active range.`,items:{type:`number`},minItems:2,maxItems:2},fullRangeExtent:{type:`array`,description:`Full range extent for the active range to be presented in the UI.`,items:{type:`number`},minItems:2,maxItems:2}},required:[`activeRangeName`],additionalProperties:!1},"operationalLayers_schema.json":{title:`operationalLayers`,type:`object`,description:`Operational layers contain your data. Usually, a basemap sits beneath your operational layers to give them geographic context.`,oneOf:[{$ref:`#/definitions/buildingSceneLayer_schema.json`},{$ref:`#/definitions/catalogLayer_schema.json`},{$ref:`#/definitions/csvLayer_schema.json`},{$ref:`#/definitions/dimensionLayer_schema.json`},{$ref:`#/definitions/featureLayer_schema.json`},{$ref:`#/definitions/gaussianSplatLayer_schema.json`},{$ref:`#/definitions/geojsonLayer_schema.json`},{$ref:`#/definitions/groupLayer_schema.json`},{$ref:`#/definitions/imageServiceLayer_schema.json`},{$ref:`#/definitions/integratedMesh3DTilesLayer_schema.json`},{$ref:`#/definitions/integratedMeshLayer_schema.json`},{$ref:`#/definitions/kmlLayer_schema.json`},{$ref:`#/definitions/lineOfSightLayer_schema.json`},{$ref:`#/definitions/mapServiceLayer_schema.json`},{$ref:`#/definitions/mediaLayer_schema.json`},{$ref:`#/definitions/object3DTilesLayer_schema.json`},{$ref:`#/definitions/ogcFeatureLayer_schema.json`},{$ref:`#/definitions/orientedImageryLayer_schema.json`},{$ref:`#/definitions/pointCloudLayer_schema.json`},{$ref:`#/definitions/rasterDataLayer_schema.json`},{$ref:`#/definitions/sceneLayer_schema.json`},{$ref:`#/definitions/tiledImageServiceLayer_schema.json`},{$ref:`#/definitions/tiledMapServiceLayer_schema.json`},{$ref:`#/definitions/vectorTileLayer_schema.json`},{$ref:`#/definitions/viewshedLayer_schema.json`},{$ref:`#/definitions/voxelLayer_schema.json`},{$ref:`#/definitions/wcsLayer_schema.json`},{$ref:`#/definitions/webTiledLayer_schema.json`},{$ref:`#/definitions/wfsLayer_schema.json`},{$ref:`#/definitions/wmsLayer_schema.json`}]},"presentation_schema.json":{title:`presentation`,type:`object`,description:`A presentation consists of multiple slides, where each slide is a specific view into the web scene.`,properties:{slides:{type:`array`,description:`Array of slide objects.`,items:{$ref:`#/definitions/slide_schema.json`}}},additionalProperties:!1},"spatialReference_schema.json":{title:`spatialReference`,type:`object`,description:`The spatialReference object is located at the top level of the JSON hierarchy. In addition to this, it is also available within the operationalLayer and basemap objects.
2
+ const e={"applicationProperties_schema.json":{title:`applicationProperties`,type:`object`,description:`Configuration of application and UI elements.`,properties:{viewing:{type:`object`,$ref:`#/definitions/viewing_schema.json`}},additionalProperties:!1},"baseMap_schema.json":{title:`baseMap`,type:`object`,description:`The basemap provides geographic context to the map and scene.`,properties:{baseMapLayers:{type:`array`,description:`An array of baseMapLayer objects defining the basemaps used in the web scene.`,items:{$ref:`#/definitions/baseMapLayer_schema.json`},uniqueItems:!0},elevationLayers:{type:`array`,description:"<em>Deprecated, use `baseMap.groundLayers` or `ground.layers` instead.<sup>[1](./baseMap.md#additional-information)</sup></em> An array of elevationLayer objects defining the basemaps used in the web scene.",items:{$ref:`#/definitions/elevationLayers_schema.json`},uniqueItems:!0},groundLayers:{type:`array`,description:`A Collection of integrated mesh layers which constitute the ground of the basemap used in the web scene.<sup>[2](./baseMap.md#additional-information)</sup>`,items:{$ref:`#/definitions/integratedMesh3DTilesLayer_schema.json`},uniqueItems:!0},id:{type:`string`,description:`A unique identifying string for the basemap.`},title:{type:`string`,description:`Required string title for the basemap that can be used in a table of contents.`}},required:[`baseMapLayers`,`title`],additionalProperties:!1},"clippingArea_schema.json":{title:`clippingArea`,type:`object`,description:`Defines area to be clipped for display.`,properties:{clip:{type:`boolean`,description:`enable / disable clipping`},geometry:{description:`envelope of clip area`,$ref:`#/definitions/extent_schema.json`}}},"focusAreas_schema.json":{title:`Focus Areas`,type:`object`,description:`Container holding the scene's focus areas.`,properties:{areas:{type:`array`,description:`Array of focus area objects.`,items:{$ref:`#/definitions/focusArea_schema.json`}},style:{description:`The global visual effect applied to all focus areas.`,enum:[`bright`,`dark`]}},required:[`areas`],additionalProperties:!1},"ground_schema.json":{title:`Ground`,type:`object`,description:`Ground defines the main surface of the web scene, based on elevation layers.`,properties:{layers:{type:`array`,description:`An array of elevationLayer objects defining the elevation of the ground in the web scene.`,items:{$ref:`#/definitions/elevationLayers_schema.json`},uniqueItems:!0},navigationConstraint:{description:`Object determining whether the camera is constrained to navigate only above, or also under the ground surface. If not specified, navigation is constrained to above ground.`,$ref:`#/definitions/navigationConstraint_schema.json`},surfaceColor:{description:`Defines the color of the ground surface, displayed underneath the basemap. If no color, the default grid is shown.`,$ref:`#/definitions/color_schema.json`},transparency:{type:`integer`,description:"The transparency of the ground surface. It is used for seeing through the ground, therefore this property also changes the transparency of the basemap. Draped operational layers are not affected by this property. The value has to lie between `100` (full transparency) and `0` (full opacity).",minimum:0,maximum:100}},required:[`layers`],additionalProperties:!1},"heightModelInfo_schema.json":{title:`heightModelInfo`,type:`object`,description:"<em>Deprecated. Use `spatialReference` instead to determine the scene's vertical coordinate system.</em><br> An object that defines the characteristics of the vertical coordinate system used by the web scene.",properties:{heightModel:{type:`string`,description:`The surface type or height model of the vertical coordinate system.`,enum:[`ellipsoidal`,`gravity_related_height`],default:`ellipsoidal`},heightUnit:{type:`string`,description:`The unit of the vertical coordinate system.<a href="#heightUnit"><sup>1</sup></a>`,enum:[`150-kilometers`,`50-kilometers`,`benoit-1895-b-chain`,`clarke-foot`,`clarke-link`,`clarke-yard`,`foot`,`gold-coast-foot`,`indian-1937-yard`,`indian-yard`,`meter`,`sears-1922-truncated-chain`,`sears-chain`,`sears-foot`,`sears-yard`,`us-foot`]},vertCRS:{type:`string`,description:`(Optional) The datum realization of the vertical coordinate system.`}},required:[`heightModel`,`heightUnit`],additionalProperties:!1},"initialState_schema.json":{title:`initialState`,type:`object`,description:`An object that provides information about the initial environment settings and viewpoint of the web scene.`,properties:{analyses:{type:`array`,description:`List of analyses which are part of the view.`,items:{$ref:`#/definitions/analyses_schema.json`}},environment:{type:`object`,$ref:`#/definitions/environment_schema.json`},timeExtent:{description:`Represents the time extent for the data displayed on the scene.`,$ref:`#/definitions/timeExtent_schema.json`},viewpoint:{description:`Describes a point of view for a 2D or 3D view. In a 3D view, it is determined using a camera position.`,$ref:`#/definitions/viewpoint_schema.json`}},required:[`environment`,`viewpoint`],additionalProperties:!1},"mapFloorInfo_schema.json":{title:`mapFloorInfo`,type:`object`,description:`Contains floor-awareness information for the web scene. Defines the layers and required fields for each layer that are used for floor filtering.`,properties:{facilityLayer:{description:`Defines the layer and field properties for the Facility layer used for floor filtering.`,$ref:`#/definitions/facilityLayerInfo_schema.json`},levelLayer:{description:`Defines the layer and field properties for the Level layer used for floor filtering.`,$ref:`#/definitions/levelLayerInfo_schema.json`},siteLayer:{description:`Defines the layer and field properties for the Site layer used for floor filtering. This property is optional.`,$ref:`#/definitions/siteLayerInfo_schema.json`}},required:[`facilityLayer`,`levelLayer`],additionalProperties:!1},"mapRangeInfo_schema.json":{title:`Map Range Information`,description:`Map range information`,properties:{activeRangeName:{type:`string`,description:`Active range ID that slider/picker acts upon.`},currentRangeExtent:{type:`array`,description:`Current range for the active range.`,items:{type:`number`},minItems:2,maxItems:2},fullRangeExtent:{type:`array`,description:`Full range extent for the active range to be presented in the UI.`,items:{type:`number`},minItems:2,maxItems:2}},required:[`activeRangeName`],additionalProperties:!1},"operationalLayers_schema.json":{title:`operationalLayers`,type:`object`,description:`Operational layers contain your data. Usually, a basemap sits beneath your operational layers to give them geographic context.`,oneOf:[{$ref:`#/definitions/buildingSceneLayer_schema.json`},{$ref:`#/definitions/catalogLayer_schema.json`},{$ref:`#/definitions/csvLayer_schema.json`},{$ref:`#/definitions/dimensionLayer_schema.json`},{$ref:`#/definitions/featureLayer_schema.json`},{$ref:`#/definitions/gaussianSplatLayer_schema.json`},{$ref:`#/definitions/geojsonLayer_schema.json`},{$ref:`#/definitions/groupLayer_schema.json`},{$ref:`#/definitions/imageServiceLayer_schema.json`},{$ref:`#/definitions/integratedMesh3DTilesLayer_schema.json`},{$ref:`#/definitions/integratedMeshLayer_schema.json`},{$ref:`#/definitions/kmlLayer_schema.json`},{$ref:`#/definitions/lineOfSightLayer_schema.json`},{$ref:`#/definitions/mapServiceLayer_schema.json`},{$ref:`#/definitions/mediaLayer_schema.json`},{$ref:`#/definitions/object3DTilesLayer_schema.json`},{$ref:`#/definitions/ogcFeatureLayer_schema.json`},{$ref:`#/definitions/orientedImageryLayer_schema.json`},{$ref:`#/definitions/pointCloudLayer_schema.json`},{$ref:`#/definitions/rasterDataLayer_schema.json`},{$ref:`#/definitions/sceneLayer_schema.json`},{$ref:`#/definitions/tiledImageServiceLayer_schema.json`},{$ref:`#/definitions/tiledMapServiceLayer_schema.json`},{$ref:`#/definitions/vectorTileLayer_schema.json`},{$ref:`#/definitions/viewshedLayer_schema.json`},{$ref:`#/definitions/voxelLayer_schema.json`},{$ref:`#/definitions/wcsLayer_schema.json`},{$ref:`#/definitions/webTiledLayer_schema.json`},{$ref:`#/definitions/wfsLayer_schema.json`},{$ref:`#/definitions/wmsLayer_schema.json`}]},"presentation_schema.json":{title:`presentation`,type:`object`,description:`A presentation consists of multiple slides, where each slide is a specific view into the web scene.`,properties:{slides:{type:`array`,description:`Array of slide objects.`,items:{$ref:`#/definitions/slide_schema.json`}}},additionalProperties:!1},"spatialReference_schema.json":{title:`spatialReference`,type:`object`,description:`The spatialReference object is located at the top level of the JSON hierarchy. In addition to this, it is also available within the operationalLayer and basemap objects.
3
3
 
4
4
  Many predefined spatial references have already been defined and are available for use. A spatial reference can be defined using a well-known ID (WKID) or well-known text (WKT). The default tolerance and resolution values for the associated coordinate system are used.
5
5
 
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{schema_definitions as e}from"./definitions.js";const t={title:`Webscene`,type:`object`,description:`The web scene data lists the basemap, operational layers, and presentation slides to be used in the web scene. It also contains information about pop-up windows and layer styling overrides to be used in the web scene. A version property allows you to supply the version of the web scene JSON format being used.`,properties:{applicationProperties:{$ref:`#/definitions/applicationProperties_schema.json`},authoringApp:{type:`string`,description:`String value indicating the application which authored the webmap`},authoringAppVersion:{type:`string`,description:`String value indicating the authoring App's version number.`},baseMap:{description:`Basemaps give the web scene a geographic context.`,$ref:`#/definitions/baseMap_schema.json`},clippingArea:{$ref:`#/definitions/clippingArea_schema.json`},focusAreas:{$ref:`#/definitions/focusAreas_schema.json`},ground:{$ref:`#/definitions/ground_schema.json`},heightModelInfo:{$ref:`#/definitions/heightModelInfo_schema.json`},initialState:{$ref:`#/definitions/initialState_schema.json`},mapFloorInfo:{$ref:`#/definitions/mapFloorInfo_schema.json`},mapRangeInfo:{description:`Map Range Information`,$ref:`#/definitions/mapRangeInfo_schema.json`},operationalLayers:{type:`array`,description:`Operational layers contain business data which are used to make thematic scenes.`,items:{$ref:`#/definitions/operationalLayers_schema.json`},uniqueItems:!0},presentation:{$ref:`#/definitions/presentation_schema.json`},spatialReference:{description:`An object used to specify the spatial reference of the given geometry.`,$ref:`#/definitions/spatialReference_schema.json`},tables:{type:`array`,description:`An array of table objects.`,items:{$ref:`#/definitions/table_schema.json`}},timeZone:{$ref:`#/definitions/timeZone_schema.json`},transportationNetworks:{type:`array`,description:`Used to specify the transportation networks of the scene.`,items:{$ref:`#/definitions/transportationNetwork_schema.json`}},version:{$ref:`#/definitions/version_schema.json`},viewingMode:{type:`string`,enum:[`global`,`local`]},widgets:{description:`the widgets object contains widgets that should be exposed to the user.`,$ref:`#/definitions/widgets_schema.json`}},required:[`ground`,`operationalLayers`,`spatialReference`,`version`,`viewingMode`],additionalProperties:!1,$schema:`http://json-schema.org/draft-07/schema`,definitions:e};export{t as json};
2
+ import{schema_definitions as e}from"./definitions.js";const t={title:`Webscene`,type:`object`,description:`The web scene data lists the basemap, operational layers, and presentation slides to be used in the web scene. It also contains information about pop-up windows and layer styling overrides to be used in the web scene. A version property allows you to supply the version of the web scene JSON format being used.`,properties:{applicationProperties:{$ref:`#/definitions/applicationProperties_schema.json`},authoringApp:{type:`string`,description:`String value indicating the application which authored the webmap`},authoringAppVersion:{type:`string`,description:`String value indicating the authoring App's version number.`},baseMap:{description:`Basemaps give the web scene a geographic context.`,$ref:`#/definitions/baseMap_schema.json`},clippingArea:{$ref:`#/definitions/clippingArea_schema.json`},focusAreas:{$ref:`#/definitions/focusAreas_schema.json`},ground:{$ref:`#/definitions/ground_schema.json`},heightModelInfo:{description:"<em>Deprecated. Use `spatialReference` instead to determine the scene's vertical coordinate system.</em><br> An object that defines the characteristics of the vertical coordinate system used by the web scene.",$ref:`#/definitions/heightModelInfo_schema.json`},initialState:{$ref:`#/definitions/initialState_schema.json`},mapFloorInfo:{$ref:`#/definitions/mapFloorInfo_schema.json`},mapRangeInfo:{description:`Map Range Information`,$ref:`#/definitions/mapRangeInfo_schema.json`},operationalLayers:{type:`array`,description:`Operational layers contain business data which are used to make thematic scenes.`,items:{$ref:`#/definitions/operationalLayers_schema.json`},uniqueItems:!0},presentation:{$ref:`#/definitions/presentation_schema.json`},spatialReference:{description:`An object used to specify the spatial reference of the given geometry.`,$ref:`#/definitions/spatialReference_schema.json`},tables:{type:`array`,description:`An array of table objects.`,items:{$ref:`#/definitions/table_schema.json`}},timeZone:{$ref:`#/definitions/timeZone_schema.json`},transportationNetworks:{type:`array`,description:`Used to specify the transportation networks of the scene.`,items:{$ref:`#/definitions/transportationNetwork_schema.json`}},version:{$ref:`#/definitions/version_schema.json`},viewingMode:{type:`string`,enum:[`global`,`local`]},widgets:{description:`the widgets object contains widgets that should be exposed to the user.`,$ref:`#/definitions/widgets_schema.json`}},required:[`ground`,`operationalLayers`,`spatialReference`,`version`,`viewingMode`],additionalProperties:!1,$schema:`http://json-schema.org/draft-07/schema`,definitions:e};export{t as json};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{generateUID as e}from"../../../core/uid.js";import{zScale as t}from"../../../geometry/support/zscale.js";import{DehydratedFeatureSetClass as n,DehydratedFeatureClass as r,removeLargeStringAttributes as i}from"../../../layers/graphics/dehydratedFeatures.js";import{makeVertexTransformer as a,makeAttributesClass as o}from"./pbfFeatureSetUtils.js";class s{constructor(e){this._options=e,this.featureSet=new n,this.usesShortGeometryTypes=!0,this.transferList=[],this.coordinates=[],this._queryGeometryType=null,this._queryGeometry=null,this._queryCoordinates=null,this.parseOnly=null,this.missingAttributes=[],this._transformInPlace=null,this._attributesClass=null,this._previousX=0,this._previousY=0,this._point=null,this._lengths=null,this._coords=null,this._coordinateIndex=0,this._partIndex=0,this._partEnd=0,this._vertex=[],this._i=0,this._finishVertex=null}queryGeometryType(){return this._queryGeometryType}queryGeometry(){return this._queryGeometry}queryCoordinates(){return this._queryCoordinates}idField(e){typeof e==`string`&&(this.featureSet.objectIdFieldName=e)}finish(){this._options.applyTransform&&(this.featureSet.transform=null)}_setVertexTransformer(){let{sourceSpatialReference:e}=this._options,{spatialReference:n,hasZ:r}=this.featureSet,i=r?t(e,n):1;this._transformInPlace??=a(this.featureSet,i)}feature(){this._attributesClass??=o(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push(new r(e(),null,new this._attributesClass)),this.coordinates.push(null),this._options.applyTransform&&this._setVertexTransformer()}finishFeature(){let{maxStringAttributeLength:e,maxStringAttributeFields:t}=this._options,{attributes:n}=this.featureSet.features.at(-1),r=n[this.featureSet.objectIdFieldName];i(n,t,e,e=>{r!=null&&this.missingAttributes.push({objectId:r,attribute:e})})}_createPoint(){let{hasZ:e,hasM:t}=this.featureSet,n={type:`point`,x:0,y:0,spatialReference:null,hasZ:e,hasM:t};return e&&(n.z=0),t&&(n.m=0),n}centroid(e){let{hasZ:t,hasM:n}=this.featureSet,r={type:`point`,x:0,y:0,spatialReference:null,hasZ:t,hasM:n};[r.x,r.y]=e,t&&(r.z=e[2]),n&&(r.m=e.at(-1)),this.featureSet.features.at(-1).centroid=r}geometry(e,t,n){this._previousX=this._previousY=0,this._lengths=n;let{hasZ:r,hasM:i}=this.featureSet;r??=!1,i??=!1,this._vertex=[0,0],r&&this._vertex.push(0),i&&this._vertex.push(0);let a,o=null;switch(t){case`esriGeometryPoint`:this._point=this._createPoint(),a=this._point,this._finishVertex=r?i?s._finishVertexPointXYZM:s._finishVertexPointXYZ:i?s._finishVertexPointXYM:s._finishVertexPointXY;break;case`esriGeometryMultipoint`:this._createPackedCoordinates(n),o={coords:this._coords,lengths:n.slice()},a={type:`multipoint`,points:null,spatialReference:null,hasZ:r,hasM:i};break;case`esriGeometryPolyline`:case`esriGeometryPolygon`:this._createPackedCoordinates(n),o={coords:this._coords,lengths:n.slice()},a=t===`esriGeometryPolygon`?{type:`polygon`,rings:null,spatialReference:null,hasZ:r,hasM:i}:{type:`polyline`,paths:null,spatialReference:null,hasZ:r,hasM:i}}e===1?(this._queryGeometry=a,this._queryCoordinates=o,this._queryGeometryType=t,this._options.applyTransform||this._setVertexTransformer()):(this.featureSet.features.at(-1).geometry=a,this.coordinates[this.coordinates.length-1]=o)}_createPackedCoordinates(e){let t=this._vertex.length;for(this._coords=new Float64Array(e.reduce((e,t)=>e+t,0)*t),this._coordinateIndex=this._partIndex=0,this._partEnd=(e[0]??0)*t;this._partEnd===0&&++this._partIndex<e.length;)this._partEnd+=e[this._partIndex]*t;this._finishVertex=s._finishVertexPacked,this.transferList.push(this._coords.buffer)}coord(e){let t=this._vertex;t[this._i++]=e,!(this._i<t.length)&&(this._i=0,this._transformInPlace&&(t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,this._transformInPlace(t)),this._finishVertex(this))}static _finishVertexPointXY({_point:e,_vertex:t}){[e.x,e.y]=t}static _finishVertexPointXYZ({_point:e,_vertex:t}){[e.x,e.y,e.z]=t}static _finishVertexPointXYM({_point:e,_vertex:t}){[e.x,e.y,e.m]=t}static _finishVertexPointXYZM({_point:e,_vertex:t}){[e.x,e.y,e.z,e.m]=t}static _finishVertexPacked(e){let{_vertex:t,_coords:n,_lengths:r}=e;if(n.set(t,e._coordinateIndex),e._coordinateIndex+=t.length,e._coordinateIndex===e._partEnd)for(e._previousX=e._previousY=0;e._coordinateIndex===e._partEnd&&++e._partIndex<r.length;)e._partEnd+=r[e._partIndex]*t.length}}export{s as DehydratedFeatureSetParserContext};
2
+ import{generateUID as e}from"../../../core/uid.js";import{zScale as t}from"../../../geometry/support/zscale.js";import{DehydratedFeatureSetClass as n,DehydratedFeatureClass as r,removeLargeStringAttributes as i}from"../../../layers/graphics/dehydratedFeatures.js";import{makeVertexTransformer as a,makeAttributesClass as o}from"./pbfFeatureSetUtils.js";class s{constructor(e){this._options=e,this.featureSet=new n,this.usesShortGeometryTypes=!0,this.transferList=[],this.coordinates=[],this._queryGeometryType=null,this._queryGeometry=null,this._queryCoordinates=null,this.parseOnly=null,this.missingAttributes=[],this._transformInPlace=null,this._attributesClass=null,this._previousX=0,this._previousY=0,this._point=null,this._lengths=null,this._coords=null,this._coordinateIndex=0,this._partIndex=0,this._partEnd=0,this._vertex=[],this._i=0,this._finishVertex=null}queryGeometryType(){return this._queryGeometryType}queryGeometry(){return this._queryGeometry}queryCoordinates(){return this._queryCoordinates}idField(e){typeof e==`string`&&(this.featureSet.objectIdFieldName=e)}finish(){this._options.applyTransform&&(this.featureSet.transform=null)}_setVertexTransformer(){let{sourceSpatialReference:e}=this._options,{spatialReference:n,hasZ:r}=this.featureSet,i=r?t(e,n):1;this._transformInPlace??=a(this.featureSet,i)}feature(){this._attributesClass??=o(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push(new r(e(),null,new this._attributesClass)),this.coordinates.push(null),this._options.applyTransform&&this._setVertexTransformer()}finishFeature(){let{maxStringAttributeLength:e,maxStringAttributeFields:t}=this._options,{attributes:n}=this.featureSet.features.at(-1),r=n[this.featureSet.objectIdFieldName];i(n,t,e,e=>{r!=null&&this.missingAttributes.push({objectId:r,attribute:e})})}_createPoint(){let{hasZ:e,hasM:t}=this.featureSet,n={type:`point`,x:0,y:0,spatialReference:null,hasZ:e,hasM:t};return e&&(n.z=0),t&&(n.m=0),n}centroid(e){let{hasZ:t,hasM:n}=this.featureSet,r={type:`point`,x:0,y:0,spatialReference:null,hasZ:t,hasM:n};[r.x,r.y]=e,t&&(r.z=e[2]),n&&(r.m=e.at(-1)),this.featureSet.features.at(-1).centroid=r}geometry(e,t,n){this._previousX=this._previousY=0,this._lengths=n;let{hasZ:r,hasM:i}=this.featureSet;r??=!1,i??=!1,this._vertex=[0,0],r&&this._vertex.push(0),i&&this._vertex.push(0);let a,o=null;switch(t){case`esriGeometryPoint`:this._point=this._createPoint(),a=this._point,this._finishVertex=r?i?s._finishVertexPointXYZM:s._finishVertexPointXYZ:i?s._finishVertexPointXYM:s._finishVertexPointXY;break;case`esriGeometryMultipoint`:this._createPackedCoordinates(n),o={coords:this._coords,lengths:n.slice()},a={type:`multipoint`,points:null,spatialReference:null,hasZ:r,hasM:i};break;case`esriGeometryPolyline`:case`esriGeometryPolygon`:this._createPackedCoordinates(n),o={coords:this._coords,lengths:n.slice()},a=t===`esriGeometryPolygon`?{type:`polygon`,rings:null,spatialReference:null,hasZ:r,hasM:i}:{type:`polyline`,paths:null,spatialReference:null,hasZ:r,hasM:i}}e===1?(this._queryGeometry=a,this._queryCoordinates=o,this._queryGeometryType=t,this._options.applyTransform||this._setVertexTransformer()):(this.featureSet.features.at(-1).geometry=a,this.coordinates[this.coordinates.length-1]=o)}_createPackedCoordinates(e){let t=this._vertex.length;for(this._coords=new Float64Array(e.reduce((e,t)=>e+t,0)*t),this._coordinateIndex=this._partIndex=0,this._partEnd=(e[0]??0)*t;this._partEnd===0&&++this._partIndex<e.length;)this._partEnd+=e[this._partIndex]*t;this._finishVertex=s._finishVertexPacked,this.transferList.push(this._coords.buffer)}coord(e){let t=this._vertex;t[this._i++]=e,this._i<t.length||(this._i=0,this._transformInPlace&&(t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,this._transformInPlace(t)),this._finishVertex(this))}static _finishVertexPointXY({_point:e,_vertex:t}){[e.x,e.y]=t}static _finishVertexPointXYZ({_point:e,_vertex:t}){[e.x,e.y,e.z]=t}static _finishVertexPointXYM({_point:e,_vertex:t}){[e.x,e.y,e.m]=t}static _finishVertexPointXYZM({_point:e,_vertex:t}){[e.x,e.y,e.z,e.m]=t}static _finishVertexPacked(e){let{_vertex:t,_coords:n,_lengths:r}=e;if(n.set(t,e._coordinateIndex),e._coordinateIndex+=t.length,e._coordinateIndex===e._partEnd)for(e._previousX=e._previousY=0;e._coordinateIndex===e._partEnd&&++e._partIndex<r.length;)e._partEnd+=r[e._partIndex]*t.length}}export{s as DehydratedFeatureSetParserContext};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{allocateFlatGeometry as e,writeBezierCurveSegment as t,writeCircularArcSegment as n,writeEllipticArc7Segment as r,FlatGeometry as i}from"../../../geometry/FlatGeometry.js";import{featureGeometryTypeKebabDictionary as a}from"../../../geometry/support/typeUtils.js";import{zScale as o}from"../../../geometry/support/zscale.js";import{FlatFeature as s}from"../../../layers/graphics/FlatFeature.js";import{FlatFeatureSet as c}from"../../../layers/graphics/FlatFeatureSet.js";import l from"../../../layers/graphics/OptimizedGeometry.js";import{createFeatureId as u}from"../../../layers/graphics/data/createFeatureId.js";import{makeAttributesClass as d,makeVertexTransformer as f}from"./pbfFeatureSetUtils.js";class p{constructor(e){this._options=e,this.featureSet=new c,this.parseOnly=null,this._idInfo=null,this._transformInPlace=null,this._transformInPlaceXY=null,this._push=p._pushXY,this._attributesClass=null,this._previousX=0,this._previousY=0,this._vertex=[],this._i=0,this._geometry=null,this._iVertex=0,this._iPart=0,this._isPolygon=!1,this._ringEndsAt=-1,this._pointBuffer=null,this._pointBufferOffset=0}queryGeometryType(){return this.featureSet.queryGeometryType}queryGeometry(){return this.featureSet.queryGeometry}idField(e){typeof e==`string`?this._idInfo??={type:`object-id`,fieldName:e}:this._idInfo={type:`unique-id-simple`,fieldName:e.name}}finish(){if(this._idInfo)for(let e of this.featureSet.features)e.objectId=u(e,this._idInfo);let{spatialReference:e,features:t}=this.featureSet;if(e)for(let{geometry:n}of t)n&&(n.spatialReference=e);this.featureSet.transform=null}feature(){this._attributesClass??=d(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push(new s(null,new this._attributesClass,null,0)),this._setVertexTransformer()}centroid(e){let{hasZ:t,hasM:n}=this.featureSet;this.featureSet.features.at(-1).centroid=new l([],e,t,n)}geometry(t,n,r){this._previousX=this._previousY=0,this._i=this._iVertex=this._iPart=0;let{hasZ:i,hasM:o}=this.featureSet;i??=!1,o??=!1,this._vertex=[0,0],i&&this._vertex.push(0),o&&this._vertex.push(0);let s=a.fromJSON(n);this._isPolygon=s===`polygon`;let c=Number(this._isPolygon),l=s===`point`?1:r.reduce((e,t)=>e+t-c,0),u=s===`point`?0:r.length;if(this._geometry=s===`point`?this._allocatePoint():e(s,l,u,i,o,!1),this._push=i?o?p._pushXYZM:p._pushXYZ:o?p._pushXYM:p._pushXY,this._geometry.isMultipart()){this._geometry.partOffsets[0]=0;for(let e=0;e<u;++e)this._geometry.partOffsets[e+1]=this._geometry.partOffsets[e]+r[e]-c}this._ringEndsAt=c?this._geometry.partOffsets.at(1)??0:-1,t===1?(this.featureSet.queryGeometry=this._geometry,this.featureSet.queryGeometryType=n):this.featureSet.features.at(-1).geometry=this._geometry}coord(e){let t=this._vertex;t[this._i++]=e,!(this._i<t.length)&&(this._i=0,t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,!(this._iVertex===this._ringEndsAt&&(++this._iPart,this._ringEndsAt=this._geometry.partOffsets[this._iPart+1],this._previousX=this._previousY=0,this._isPolygon))&&(this._transformInPlace?.(t),this._push(this)))}curvedGeometry(t,n,r,i){let{hasZ:o,hasM:s}=this.featureSet;o??=!1,s??=!1,this._i=this._iVertex=this._iPart=0;let c=a.fromJSON(t);this._isPolygon=c===`polygon`;let l=Number(!this._isPolygon),u=n.length,d=0,f=0,p=l*u;for(let e=0;e<r.length;++e)switch(p+=i[e],r[e]){case 1:case 3:d+=i[e];continue;case 2:f+=i[e]}this._geometry=e(c,p,u,o,s,!0,d,f);let{partOffsets:m}=this._geometry;m[0]=0;for(let e=0,t=0;e<u;++e){m[e+1]=m[e]+l;for(let r=0;r<n[e];++r)m[e+1]+=i[t++]}switch(t){case`esriGeometryPoint`:case`esriGeometryMultipoint`:throw Error(`Curved ${t} does not make sense`)}this.featureSet.features.at(-1).geometry=this._geometry}startCurvedPart(e){}finishCurvedPart(e){this._isPolygon||(this._transform(e,this._vertex),this._push(this)),++this._iPart}lineSegment(e,t){this._transform(e,this._vertex),this._push(this)}bezierSegment(e,n,r,i){this._transform(e,this._vertex),this._push(this),this._transformXY(n,g.b[0]),this._transformXY(r,g.b[1]),this._transformXY(i,g.b[2]),this._i=t(this._vertex,g,this._geometry,this._iVertex-1,this._i)}circularArcSegment(e,t,r){this._transform(e,this._vertex),this._push(this),this._transformXY(t,m.c[0]),this._transformXY(r,m.c[1]),this._i=n(this._vertex,m,this._geometry,this._iVertex-1,this._i)}ellipticArcSegment(e,t,n,i,a,o,s,c){this._transform(e,this._vertex),this._push(this),this._transformXY(t,h.a[0]),this._transformXY(n,h.a[1]),h.a[2]=i,h.a[3]=a,h.a[4]=o,h.a[5]=s,h.a[6]=c,this._i=r(this._vertex,h,this._geometry,this._iVertex-1,this._i)}_allocatePoint(){let{hasZ:e,hasM:t}=this.featureSet,n=Float64Array.BYTES_PER_ELEMENT*(2+Number(e)+Number(t));if(this._pointBuffer??=new ArrayBuffer(32*n),this._pointBufferOffset>=this._pointBuffer.byteLength){let e=Math.floor(this._pointBuffer.byteLength/n*1.5);this._pointBuffer=new ArrayBuffer(e*n),this._pointBufferOffset=0}let r=new Float64Array(this._pointBuffer,this._pointBufferOffset,2);this._pointBufferOffset+=r.byteLength;let a=new i({type:`point`,vertexCount:1,vertexXY:r,vertexZ:void 0,vertexM:void 0,partCount:0,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:0,segmentCountBezier:0});return e&&(a.vertexZ=new Float64Array(this._pointBuffer,this._pointBufferOffset,1),this._pointBufferOffset+=a.vertexZ.byteLength),t&&(a.vertexM=new Float64Array(this._pointBuffer,this._pointBufferOffset,1),this._pointBufferOffset+=a.vertexM.byteLength),a}static _pushXY(e){let t=e._iVertex++,{vertexXY:n}=e._geometry;[n[t*2],n[t*2+1]]=e._vertex}static _pushXYZ(e){let t=e._iVertex++,{vertexXY:n,vertexZ:r}=e._geometry;[n[t*2],n[t*2+1],r[t]]=e._vertex}static _pushXYM(e){let t=e._iVertex++,{vertexXY:n,vertexM:r}=e._geometry;[n[t*2],n[t*2+1],r[t]]=e._vertex}static _pushXYZM(e){let t=e._iVertex++,{vertexXY:n,vertexM:r,vertexZ:i}=e._geometry;[n[t*2],n[t*2+1],i[t],r[t]]=e._vertex}_setVertexTransformer(){let{sourceSpatialReference:e}=this._options,{spatialReference:t,hasZ:n,transform:r}=this.featureSet,i=n?o(e,t):1;this._transformInPlace??=f(this.featureSet,i),this._transformInPlaceXY??=f({transform:r})}_transform(e,t){for(let n=0;n<e.length;++n)t[n]=e[n];this._transformInPlace?.(t)}_transformXY(e,t){t[0]=e[0],t[1]=e[1],this._transformInPlaceXY?.(t)}}const m={c:[[0,0],[0,0]]},h={a:[[0,0],[0,0],0,0,0,0,0]},g={b:[[0,0],[0,0],[0,0]]};export{p as FlatFeatureSetParserContext};
2
+ import{allocateFlatGeometry as e,writeBezierCurveSegment as t,writeCircularArcSegment as n,writeEllipticArc7Segment as r,FlatGeometry as i}from"../../../geometry/FlatGeometry.js";import{featureGeometryTypeKebabDictionary as a}from"../../../geometry/support/typeUtils.js";import{zScale as o}from"../../../geometry/support/zscale.js";import{FlatFeature as s}from"../../../layers/graphics/FlatFeature.js";import{FlatFeatureSet as c}from"../../../layers/graphics/FlatFeatureSet.js";import l from"../../../layers/graphics/OptimizedGeometry.js";import{createFeatureId as u}from"../../../layers/graphics/data/createFeatureId.js";import{makeAttributesClass as d,makeVertexTransformer as f}from"./pbfFeatureSetUtils.js";class p{constructor(e){this._options=e,this.featureSet=new c,this.parseOnly=null,this._idInfo=null,this._transformInPlace=null,this._transformInPlaceXY=null,this._push=p._pushXY,this._attributesClass=null,this._previousX=0,this._previousY=0,this._vertex=[],this._i=0,this._geometry=null,this._iVertex=0,this._iPart=0,this._isPolygon=!1,this._ringEndsAt=-1,this._pointBuffer=null,this._pointBufferOffset=0}queryGeometryType(){return this.featureSet.queryGeometryType}queryGeometry(){return this.featureSet.queryGeometry}idField(e){typeof e==`string`?this._idInfo??={type:`object-id`,fieldName:e}:this._idInfo={type:`unique-id-simple`,fieldName:e.name}}finish(){if(this._idInfo)for(let e of this.featureSet.features)e.objectId=u(e,this._idInfo);let{spatialReference:e,features:t}=this.featureSet;if(e)for(let{geometry:n}of t)n&&(n.spatialReference=e);this.featureSet.transform=null}feature(){this._attributesClass??=d(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push(new s(null,new this._attributesClass,null,0)),this._setVertexTransformer()}centroid(e){let{hasZ:t,hasM:n}=this.featureSet;this.featureSet.features.at(-1).centroid=new l([],e,t,n)}geometry(t,n,r){this._previousX=this._previousY=0,this._i=this._iVertex=this._iPart=0;let{hasZ:i,hasM:o}=this.featureSet;i??=!1,o??=!1,this._vertex=[0,0],i&&this._vertex.push(0),o&&this._vertex.push(0);let s=a.fromJSON(n);this._isPolygon=s===`polygon`;let c=Number(this._isPolygon),l=s===`point`?1:r.reduce((e,t)=>e+t-c,0),u=s===`point`?0:r.length;if(this._geometry=s===`point`?this._allocatePoint():e(s,l,u,i,o,!1),this._push=i?o?p._pushXYZM:p._pushXYZ:o?p._pushXYM:p._pushXY,this._geometry.isMultipart()){this._geometry.partOffsets[0]=0;for(let e=0;e<u;++e)this._geometry.partOffsets[e+1]=this._geometry.partOffsets[e]+r[e]-c}this._ringEndsAt=c?this._geometry.partOffsets.at(1)??0:-1,t===1?(this.featureSet.queryGeometry=this._geometry,this.featureSet.queryGeometryType=n):this.featureSet.features.at(-1).geometry=this._geometry}coord(e){let t=this._vertex;t[this._i++]=e,this._i<t.length||(this._i=0,t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,this._iVertex===this._ringEndsAt&&(++this._iPart,this._ringEndsAt=this._geometry.partOffsets[this._iPart+1],this._previousX=this._previousY=0,this._isPolygon)||(this._transformInPlace?.(t),this._push(this)))}curvedGeometry(t,n,r,i){let{hasZ:o,hasM:s}=this.featureSet;o??=!1,s??=!1,this._i=this._iVertex=this._iPart=0;let c=a.fromJSON(t);this._isPolygon=c===`polygon`;let l=Number(!this._isPolygon),u=n.length,d=0,f=0,p=l*u;for(let e=0;e<r.length;++e)switch(p+=i[e],r[e]){case 1:case 3:d+=i[e];continue;case 2:f+=i[e]}this._geometry=e(c,p,u,o,s,!0,d,f);let{partOffsets:m}=this._geometry;m[0]=0;for(let e=0,t=0;e<u;++e){m[e+1]=m[e]+l;for(let r=0;r<n[e];++r)m[e+1]+=i[t++]}switch(t){case`esriGeometryPoint`:case`esriGeometryMultipoint`:throw Error(`Curved ${t} does not make sense`)}this.featureSet.features.at(-1).geometry=this._geometry}startCurvedPart(e){}finishCurvedPart(e){this._isPolygon||(this._transform(e,this._vertex),this._push(this)),++this._iPart}lineSegment(e,t){this._transform(e,this._vertex),this._push(this)}bezierSegment(e,n,r,i){this._transform(e,this._vertex),this._push(this),this._transformXY(n,g.b[0]),this._transformXY(r,g.b[1]),this._transformXY(i,g.b[2]),this._i=t(this._vertex,g,this._geometry,this._iVertex-1,this._i)}circularArcSegment(e,t,r){this._transform(e,this._vertex),this._push(this),this._transformXY(t,m.c[0]),this._transformXY(r,m.c[1]),this._i=n(this._vertex,m,this._geometry,this._iVertex-1,this._i)}ellipticArcSegment(e,t,n,i,a,o,s,c){this._transform(e,this._vertex),this._push(this),this._transformXY(t,h.a[0]),this._transformXY(n,h.a[1]),h.a[2]=i,h.a[3]=a,h.a[4]=o,h.a[5]=s,h.a[6]=c,this._i=r(this._vertex,h,this._geometry,this._iVertex-1,this._i)}_allocatePoint(){let{hasZ:e,hasM:t}=this.featureSet,n=Float64Array.BYTES_PER_ELEMENT*(2+Number(e)+Number(t));if(this._pointBuffer??=new ArrayBuffer(32*n),this._pointBufferOffset>=this._pointBuffer.byteLength){let e=Math.floor(this._pointBuffer.byteLength/n*1.5);this._pointBuffer=new ArrayBuffer(e*n),this._pointBufferOffset=0}let r=new Float64Array(this._pointBuffer,this._pointBufferOffset,2);this._pointBufferOffset+=r.byteLength;let a=new i({type:`point`,vertexCount:1,vertexXY:r,vertexZ:void 0,vertexM:void 0,partCount:0,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:0,segmentCountBezier:0});return e&&(a.vertexZ=new Float64Array(this._pointBuffer,this._pointBufferOffset,1),this._pointBufferOffset+=a.vertexZ.byteLength),t&&(a.vertexM=new Float64Array(this._pointBuffer,this._pointBufferOffset,1),this._pointBufferOffset+=a.vertexM.byteLength),a}static _pushXY(e){let t=e._iVertex++,{vertexXY:n}=e._geometry;[n[t*2],n[t*2+1]]=e._vertex}static _pushXYZ(e){let t=e._iVertex++,{vertexXY:n,vertexZ:r}=e._geometry;[n[t*2],n[t*2+1],r[t]]=e._vertex}static _pushXYM(e){let t=e._iVertex++,{vertexXY:n,vertexM:r}=e._geometry;[n[t*2],n[t*2+1],r[t]]=e._vertex}static _pushXYZM(e){let t=e._iVertex++,{vertexXY:n,vertexM:r,vertexZ:i}=e._geometry;[n[t*2],n[t*2+1],i[t],r[t]]=e._vertex}_setVertexTransformer(){let{sourceSpatialReference:e}=this._options,{spatialReference:t,hasZ:n,transform:r}=this.featureSet,i=n?o(e,t):1;this._transformInPlace??=f(this.featureSet,i),this._transformInPlaceXY??=f({transform:r})}_transform(e,t){for(let n=0;n<e.length;++n)t[n]=e[n];this._transformInPlace?.(t)}_transformXY(e,t){t[0]=e[0],t[1]=e[1],this._transformInPlaceXY?.(t)}}const m={c:[[0,0],[0,0]]},h={a:[[0,0],[0,0],0,0,0,0,0]},g={b:[[0,0],[0,0],[0,0]]};export{p as FlatFeatureSetParserContext};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{zScale as e}from"../../../geometry/support/zscale.js";import{makeAttributesClass as t,makeVertexTransformer as n}from"./pbfFeatureSetUtils.js";class r{constructor(e){this._options=e,this.featureSet={features:[]},this.parseOnly=null,this._transformInPlace=null,this._transformInPlaceXY=null,this._finishVertex=r._finishVertexNonPoint,this._attributesClass=null,this._previousX=0,this._previousY=0,this._point=null,this._lengths=null,this._vertex=[],this._part=null,this._parts=null,this._i=0}queryGeometryType(){return this.featureSet.queryGeometryType}queryGeometry(){return this.featureSet.queryGeometry}idField(e){typeof e==`string`&&(this.featureSet.objectIdFieldName=e)}finish(){this._options.applyTransform&&(this.featureSet.transform=null);let{spatialReference:e,features:t}=this.featureSet;if(e)for(let{geometry:n}of t)n&&(n.spatialReference=e)}feature(){this._attributesClass??=t(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push({attributes:new this._attributesClass}),this._options.applyTransform&&this._setVertexTransformer()}centroid([e,t]){this.featureSet.features.at(-1).centroid={x:e,y:t}}geometry(e,t,n){this._previousX=this._previousY=0,this._lengths=n;let{hasZ:i,hasM:a}=this.featureSet;i??=!1,a??=!1,this._i=0,this._vertex=[0,0],i&&this._vertex.push(0),a&&this._vertex.push(0);let o;switch(this._finishVertex=r._finishVertexNonPoint,t){case`esriGeometryPoint`:this._point={x:0,y:0},o=this._point,this._finishVertex=i?a?r._finishVertexPointXYZM:r._finishVertexPointXYZ:a?r._finishVertexPointXYM:r._finishVertexPointXY;break;case`esriGeometryMultipoint`:o={points:[],hasZ:i,hasM:a},this._part=o.points,this._parts=[];break;case`esriGeometryPolyline`:o={paths:[],hasZ:i,hasM:a},this._parts=o.paths,this._part=[];break;case`esriGeometryPolygon`:o={rings:[],hasZ:i,hasM:a},this._parts=o.rings,this._part=[]}e===1?(this.featureSet.queryGeometry=o,this.featureSet.queryGeometryType=t,this._options.applyTransform||this._setVertexTransformer()):this.featureSet.features.at(-1).geometry=o}coord(e){let t=this._vertex;t[this._i++]=e,!(this._i<t.length)&&(this._i=0,this._transformInPlace&&(t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,this._transformInPlace(t)),this._finishVertex(this))}curvedGeometry(e,t,n,r){let{hasZ:i,hasM:a}=this.featureSet;i??=!1,a??=!1;let o;switch(e){case`esriGeometryPoint`:case`esriGeometryMultipoint`:throw Error(`Curved ${e} does not make sense`);case`esriGeometryPolyline`:o={paths:[],curvePaths:[],hasZ:i,hasM:a},this._parts=o.curvePaths,this._part=[];break;case`esriGeometryPolygon`:o={rings:[],curveRings:[],hasZ:i,hasM:a},this._parts=o.curveRings,this._part=[]}this.featureSet.features.at(-1).geometry=o}startCurvedPart(e){this._part.push(this._transform(e))}finishCurvedPart(e){this._parts.push(this._part),this._part=[]}lineSegment(e,t){this._part.push(this._transform(t))}bezierSegment(e,t,n,r){this._part.push({b:[this._transform(t),this._transformXY(n),this._transformXY(r)]})}circularArcSegment(e,t,n){this._part.push({c:[this._transform(t),this._transformXY(n)]})}ellipticArcSegment(e,t,n,r,i,a,o,s){this._part.push({a:[this._transform(t),this._transformXY(n),r,i,a,o,s]})}static _finishVertexPointXY({_point:e,_vertex:t}){[e.x,e.y]=t}static _finishVertexPointXYZ({_point:e,_vertex:t}){[e.x,e.y,e.z]=t}static _finishVertexPointXYM({_point:e,_vertex:t}){[e.x,e.y,e.m]=t}static _finishVertexPointXYZM({_point:e,_vertex:t}){[e.x,e.y,e.z,e.m]=t}static _finishVertexNonPoint(e){let{_part:t,_parts:n,_lengths:r,_vertex:i}=e;t.push([...i]),!(t.length<r[n.length])&&(e._previousX=e._previousY=0,e._part=[],n.push(t))}_setVertexTransformer(){let{sourceSpatialReference:t}=this._options,{spatialReference:r,hasZ:i,transform:a}=this.featureSet,o=i?e(t,r):1;this._transformInPlace??=n(this.featureSet,o),this._transformInPlaceXY??=n({transform:a})}_transform(e){let t=[...e];return this._transformInPlace?.(t),t}_transformXY(e){let t=[e[0],e[1]];return this._transformInPlaceXY?.(t),t}}export{r as JSONFeatureSetParserContext};
2
+ import{zScale as e}from"../../../geometry/support/zscale.js";import{makeAttributesClass as t,makeVertexTransformer as n}from"./pbfFeatureSetUtils.js";class r{constructor(e){this._options=e,this.featureSet={features:[]},this.parseOnly=null,this._transformInPlace=null,this._transformInPlaceXY=null,this._finishVertex=r._finishVertexNonPoint,this._attributesClass=null,this._previousX=0,this._previousY=0,this._point=null,this._lengths=null,this._vertex=[],this._part=null,this._parts=null,this._i=0}queryGeometryType(){return this.featureSet.queryGeometryType}queryGeometry(){return this.featureSet.queryGeometry}idField(e){typeof e==`string`&&(this.featureSet.objectIdFieldName=e)}finish(){this._options.applyTransform&&(this.featureSet.transform=null);let{spatialReference:e,features:t}=this.featureSet;if(e)for(let{geometry:n}of t)n&&(n.spatialReference=e)}feature(){this._attributesClass??=t(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push({attributes:new this._attributesClass}),this._options.applyTransform&&this._setVertexTransformer()}centroid([e,t]){this.featureSet.features.at(-1).centroid={x:e,y:t}}geometry(e,t,n){this._previousX=this._previousY=0,this._lengths=n;let{hasZ:i,hasM:a}=this.featureSet;i??=!1,a??=!1,this._i=0,this._vertex=[0,0],i&&this._vertex.push(0),a&&this._vertex.push(0);let o;switch(this._finishVertex=r._finishVertexNonPoint,t){case`esriGeometryPoint`:this._point={x:0,y:0},o=this._point,this._finishVertex=i?a?r._finishVertexPointXYZM:r._finishVertexPointXYZ:a?r._finishVertexPointXYM:r._finishVertexPointXY;break;case`esriGeometryMultipoint`:o={points:[],hasZ:i,hasM:a},this._part=o.points,this._parts=[];break;case`esriGeometryPolyline`:o={paths:[],hasZ:i,hasM:a},this._parts=o.paths,this._part=[];break;case`esriGeometryPolygon`:o={rings:[],hasZ:i,hasM:a},this._parts=o.rings,this._part=[]}e===1?(this.featureSet.queryGeometry=o,this.featureSet.queryGeometryType=t,this._options.applyTransform||this._setVertexTransformer()):this.featureSet.features.at(-1).geometry=o}coord(e){let t=this._vertex;t[this._i++]=e,this._i<t.length||(this._i=0,this._transformInPlace&&(t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,this._transformInPlace(t)),this._finishVertex(this))}curvedGeometry(e,t,n,r){let{hasZ:i,hasM:a}=this.featureSet;i??=!1,a??=!1;let o;switch(e){case`esriGeometryPoint`:case`esriGeometryMultipoint`:throw Error(`Curved ${e} does not make sense`);case`esriGeometryPolyline`:o={paths:[],curvePaths:[],hasZ:i,hasM:a},this._parts=o.curvePaths,this._part=[];break;case`esriGeometryPolygon`:o={rings:[],curveRings:[],hasZ:i,hasM:a},this._parts=o.curveRings,this._part=[]}this.featureSet.features.at(-1).geometry=o}startCurvedPart(e){this._part.push(this._transform(e))}finishCurvedPart(e){this._parts.push(this._part),this._part=[]}lineSegment(e,t){this._part.push(this._transform(t))}bezierSegment(e,t,n,r){this._part.push({b:[this._transform(t),this._transformXY(n),this._transformXY(r)]})}circularArcSegment(e,t,n){this._part.push({c:[this._transform(t),this._transformXY(n)]})}ellipticArcSegment(e,t,n,r,i,a,o,s){this._part.push({a:[this._transform(t),this._transformXY(n),r,i,a,o,s]})}static _finishVertexPointXY({_point:e,_vertex:t}){[e.x,e.y]=t}static _finishVertexPointXYZ({_point:e,_vertex:t}){[e.x,e.y,e.z]=t}static _finishVertexPointXYM({_point:e,_vertex:t}){[e.x,e.y,e.m]=t}static _finishVertexPointXYZM({_point:e,_vertex:t}){[e.x,e.y,e.z,e.m]=t}static _finishVertexNonPoint(e){let{_part:t,_parts:n,_lengths:r,_vertex:i}=e;t.push([...i]),t.length<r[n.length]||(e._previousX=e._previousY=0,e._part=[],n.push(t))}_setVertexTransformer(){let{sourceSpatialReference:t}=this._options,{spatialReference:r,hasZ:i,transform:a}=this.featureSet,o=i?e(t,r):1;this._transformInPlace??=n(this.featureSet,o),this._transformInPlaceXY??=n({transform:a})}_transform(e){let t=[...e];return this._transformInPlace?.(t),t}_transformXY(e){let t=[e[0],e[1]];return this._transformInPlaceXY?.(t),t}}export{r as JSONFeatureSetParserContext};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{isDeleteItem as e,isAddAttachmentItem as t,isDeleteAttachmentItem as n,isModifyAttachmentItem as r,isAddItem as i,isModifyItem as a}from"./ApplySetItem.js";class o{constructor(){this.applyItems=new Map,this.featureState=null}get items(){return[...this.applyItems.values()]}get deleteItems(){return this.items.filter(e)}_add(e){this.applyItems.set(e.featureChangeId,e)}revert(){this.featureState?.clearAll(),this.applyItems.clear()}push(o){if(t(o)){this._add(o);return}let s=this.applyItems.get(o.featureChangeId);s?(i(s)&&e(o)&&(this.applyItems.delete(s.featureChangeId),this.featureState?.removeLocalState(s)),i(s)&&a(o)&&(s.graphic=o.graphic,this.featureState?.updateLocalState(s)),a(s)&&e(o)&&(this.applyItems.delete(s.featureChangeId),o.graphic=s.revertGraphic,this._add(o),this.featureState?.removeLocalState(s),this.featureState?.applyLocalState(o)),a(s)&&a(o)&&(s.graphic=o.graphic,this.featureState?.updateLocalState(s)),r(s)&&n(o)&&(this.applyItems.delete(s.featureChangeId),this._add(o)),r(s)&&r(o)&&(s.attachmentData=o.attachmentData)):(this._add(o),!n(o)&&!r(o)&&this.featureState?.applyLocalState(o))}remove(e){this.applyItems.has(e.featureChangeId)&&(this.applyItems.delete(e.featureChangeId),!(t(e)||n(e)||r(e))&&this.featureState&&this.featureState.removeLocalState(e))}}export{o as ApplySet};
2
+ import{isDeleteItem as e,isAddAttachmentItem as t,isDeleteAttachmentItem as n,isModifyAttachmentItem as r,isAddItem as i,isModifyItem as a}from"./ApplySetItem.js";class o{constructor(){this.applyItems=new Map,this.featureState=null}get items(){return[...this.applyItems.values()]}get deleteItems(){return this.items.filter(e)}_add(e){this.applyItems.set(e.featureChangeId,e)}revert(){this.featureState?.clearAll(),this.applyItems.clear()}push(o){if(t(o)){this._add(o);return}let s=this.applyItems.get(o.featureChangeId);s?(i(s)&&e(o)&&(this.applyItems.delete(s.featureChangeId),this.featureState?.removeLocalState(s)),i(s)&&a(o)&&(s.graphic=o.graphic,this.featureState?.updateLocalState(s)),a(s)&&e(o)&&(this.applyItems.delete(s.featureChangeId),o.graphic=s.revertGraphic,this._add(o),this.featureState?.removeLocalState(s),this.featureState?.applyLocalState(o)),a(s)&&a(o)&&(s.graphic=o.graphic,this.featureState?.updateLocalState(s)),r(s)&&n(o)&&(this.applyItems.delete(s.featureChangeId),this._add(o)),r(s)&&r(o)&&(s.attachmentData=o.attachmentData)):(this._add(o),!n(o)&&!r(o)&&this.featureState?.applyLocalState(o))}remove(e){this.applyItems.has(e.featureChangeId)&&(this.applyItems.delete(e.featureChangeId),t(e)||n(e)||r(e)||this.featureState&&this.featureState.removeLocalState(e))}}export{o as ApplySet};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- class e{constructor(){this._skipInitialSamples=3,this._samples=[.35,.4,.45,.4,.35],this._maxSampleMemory=this._samples.length,this._average=this._computeAverage(),this._standardDeviation=this._computeStandardDeviation()}get average(){return this._average}get standardDeviation(){return this._standardDeviation}addSample(e){this._skipInitialSamples--,!(this._skipInitialSamples>0)&&(this._samples.push(e),this._samples.length>this._maxSampleMemory&&this._samples.splice(0,this._samples.length-this._maxSampleMemory),this._average=this._computeAverage(),this._standardDeviation=this._computeStandardDeviation())}getSafeTime(){return this._average+this._standardDeviation*3}_computeAverage(){return this._samples.reduce((e,t)=>e+t,0)/this._samples.length}_computeStandardDeviation(){return Math.sqrt(this._samples.map(e=>t(e-this._average)).reduce((e,t)=>e+t,0)/this._samples.length)}}function t(e){return e*e}export{e as ProcessingTimeEstimate};
2
+ class e{constructor(){this._skipInitialSamples=3,this._samples=[.35,.4,.45,.4,.35],this._maxSampleMemory=this._samples.length,this._average=this._computeAverage(),this._standardDeviation=this._computeStandardDeviation()}get average(){return this._average}get standardDeviation(){return this._standardDeviation}addSample(e){this._skipInitialSamples--,this._skipInitialSamples>0||(this._samples.push(e),this._samples.length>this._maxSampleMemory&&this._samples.splice(0,this._samples.length-this._maxSampleMemory),this._average=this._computeAverage(),this._standardDeviation=this._computeStandardDeviation())}getSafeTime(){return this._average+this._standardDeviation*3}_computeAverage(){return this._samples.reduce((e,t)=>e+t,0)/this._samples.length}_computeStandardDeviation(){return Math.sqrt(this._samples.map(e=>t(e-this._average)).reduce((e,t)=>e+t,0)/this._samples.length)}}function t(e){return e*e}export{e as ProcessingTimeEstimate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import t from"../../../../layers/support/TileInfo.js";import{tileSizeInTileUnits as n,tileSizeInPixels as r}from"./constants.js";import{SymbolFader as i}from"./decluttering/SymbolFader.js";import{writeOpacityToBuffers as a}from"./decluttering/util.js";import{RenderableTile as o}from"../webgl/RenderableTile.js";import s from"../webgl/TileContainer.js";import{simplePipelineState as c}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as l}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";import u from"../../tiling/TileCoverage.js";import d from"../../tiling/TileKey.js";const f=1e-6;function p(e,t){if(e){let n=e.getLayoutProperty(`visibility`);if(!n||n.getValue()!==1&&(e.minzoom===void 0||e.minzoom<t+f)&&(e.maxzoom===void 0||e.maxzoom>=t-f))return!0}return!1}class m extends s{constructor(e){super(e),this._backgroundTiles=[],this._techniques=new l,this._computeDisplayInfoView(e),this._techniques.startup()}destroy(){super.destroy(),this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null);let e=this.stage?.context;e&&this._techniques.shutdown(e),this._styleRepository=null;for(let e of this._backgroundTiles)e.destroy();this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,o){if(this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this.tilingScheme=o,this._computeDisplayInfoView(o),this._symbolFader==null){let e=(e,t)=>{e.allSymbolsFadingOut=!0,e.lastOpacityUpdate=t,a(e,t,!0),e.decluttered=!0,e.requestRender()};this._symbolFader=new i(`vector-tile`,this._styleRepository,e,this.children,n)}this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,displayLevel:this._displayInfo.scaleToZoom(e.state.scale)}}doRender(e){let{drawPhase:t}=e,n=t===1||t===32;this.visible&&n&&this._spriteMosaic!==void 0&&super.doRender(e)}addChild(e){return super.addChild(e),this._symbolFader==null?e.decluttered=!0:this._symbolFader.addTile(e),this.requestRender(),e}removeChild(e){return this._symbolFader!=null&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){let{drawPhase:t}=e;t===32?super.renderChildren(e):this._doRender(e)}removeAllChildren(){for(let e=0;e<this.children.length;e++){let t=this.children[e];this._symbolFader!=null&&this._symbolFader.removeTile(t),t.dispose()}super.removeAllChildren()}getStencilTarget(){return this.children.filter(e=>e.neededForCoverage&&e.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(e){let{context:t,displayLevel:n,painter:r,state:i}=e,a=this._styleRepository;if(!a)return;let o=a.layers;this.children.forEach(e=>e.disposeLayerData()),super.renderChildren(e),a.backgroundBucketIds.length>0&&(e.renderPass=`background`,this._renderBackgroundLayers(e,a.backgroundBucketIds)),e.drawPhase===1&&this._fade(n,i);let s=this.children.filter(t=>(e.drawPhase===1&&t.fader.fade()<1&&this.requestRender(),t.visible&&t.hasData()));if(!s||s.length===0)t.bindVAO(null);else{for(let e of s)e.triangleCount=0;t.setClearDepth(1),t.clear(256),r.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:`composite`},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}}),e.renderPass=`translucent`;for(let t=0;t<o.length;t++)this._renderStyleLayer(o[t],e,s);t.bindVAO(null),r.setPipelineState(c);for(let e of s)e.debugInfo.display.triangleCount=e.triangleCount}}_fade(e,t){this._symbolFader!=null&&(this._symbolFader.update(e,t)||this.requestRender())}_renderStyleLayer(e,t,n){let{displayLevel:r,renderPass:i}=t;if(e===void 0)return;let a=e.getLayoutProperty(`visibility`);if(!(a&&a.getValue()===1)){switch(e.type){case 0:return;case 1:if(i!==`translucent`)return;break;case 2:if(i!==`translucent`)return;break;case 4:if(i!==`translucent`)return;break;case 3:if(i!==`translucent`)return}n=e.type===3?n.filter(e=>e.decluttered):n.filter(e=>e.neededForCoverage),!(e.type!==3&&(n.length===0||e.minzoom!==void 0&&e.minzoom>=r+f||e.maxzoom!==void 0&&e.maxzoom<r-f))&&(t.styleLayerUID=e.uid,t.styleLayer=e,this._techniques.getTechnique(e.type)?.render(t,{tiles:n}))}}_renderBackgroundLayers(e,t){let{displayLevel:n,state:r}=e,i=this._styleRepository,a=!1;for(let e of t){let t=i.getLayerById(e);if(t&&t.type===0&&p(i.getLayerById(e),n)){a=!0;break}}if(!a)return;let o=this.tilingScheme.getTileCoverage(e.state,0,!0,`smallest`),{spans:s,lodInfo:c}=o,{level:l}=c,m=[],h=0;for(let{row:e,colFrom:t,colTo:n}of s)for(let i=t;i<=n;i++){let t=new d(l,e,c.normalizeCol(i),c.getWorldForColumn(i)),n=this._getOrCreateBackgroundTile(h,t);n.setTransform(r),m.push(n),h++}let g=this._techniques.getTechnique(0);for(let r of t){let t=i.getLayerById(r);t.type!==0||!p(t,n)||t.minzoom!==void 0&&t.minzoom>=n+f||t.maxzoom!==void 0&&t.maxzoom<n-f||(e.styleLayerUID=t.uid,e.styleLayer=t,g.render(e,{tiles:m}))}u.pool.release(o)}_getOrCreateBackgroundTile(t,i){let a=this._backgroundTiles[t];if(a?.key.equals(i))return a;let s=this.tilingScheme.getTileBounds(e(),i),c=this.tilingScheme.getTileResolution(i.level),l=new o(i,c,s[0],s[3],r,r,n,n);return a?(a.destroy(),this._backgroundTiles[t]=l):this._backgroundTiles.push(l),l}_computeDisplayInfoView(e){let n=e.tileInfo.lods,i=n.map(e=>e.scale),a=i[i.length-1],o=Math.max(25,n.length);for(;i.length<=o;)a/=2,i.push(a);this._displayInfo=t.create({scales:i,size:r,spatialReference:e.spatialReference,numLODs:o})}}export{m as VectorTileContainer};
2
+ import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import t from"../../../../layers/support/TileInfo.js";import{tileSizeInTileUnits as n,tileSizeInPixels as r}from"./constants.js";import{SymbolFader as i}from"./decluttering/SymbolFader.js";import{writeOpacityToBuffers as a}from"./decluttering/util.js";import{RenderableTile as o}from"../webgl/RenderableTile.js";import s from"../webgl/TileContainer.js";import{simplePipelineState as c}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as l}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";import u from"../../tiling/TileCoverage.js";import d from"../../tiling/TileKey.js";const f=1e-6;function p(e,t){if(e){let n=e.getLayoutProperty(`visibility`);if(!n||n.getValue()!==1&&(e.minzoom===void 0||e.minzoom<t+f)&&(e.maxzoom===void 0||e.maxzoom>=t-f))return!0}return!1}class m extends s{constructor(e){super(e),this._backgroundTiles=[],this._techniques=new l,this._computeDisplayInfoView(e),this._techniques.startup()}destroy(){super.destroy(),this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null);let e=this.stage?.context;e&&this._techniques.shutdown(e),this._styleRepository=null;for(let e of this._backgroundTiles)e.destroy();this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,o){if(this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this.tilingScheme=o,this._computeDisplayInfoView(o),this._symbolFader==null){let e=(e,t)=>{e.allSymbolsFadingOut=!0,e.lastOpacityUpdate=t,a(e,t,!0),e.decluttered=!0,e.requestRender()};this._symbolFader=new i(`vector-tile`,this._styleRepository,e,this.children,n)}this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,displayLevel:this._displayInfo.scaleToZoom(e.state.scale)}}doRender(e){let{drawPhase:t}=e,n=t===1||t===32;this.visible&&n&&this._spriteMosaic!==void 0&&super.doRender(e)}addChild(e){return super.addChild(e),this._symbolFader==null?e.decluttered=!0:this._symbolFader.addTile(e),this.requestRender(),e}removeChild(e){return this._symbolFader!=null&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){let{drawPhase:t}=e;t===32?super.renderChildren(e):this._doRender(e)}removeAllChildren(){for(let e=0;e<this.children.length;e++){let t=this.children[e];this._symbolFader!=null&&this._symbolFader.removeTile(t),t.dispose()}super.removeAllChildren()}getStencilTarget(){return this.children.filter(e=>e.neededForCoverage&&e.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(e){let{context:t,displayLevel:n,painter:r,state:i}=e,a=this._styleRepository;if(!a)return;let o=a.layers;this.children.forEach(e=>e.disposeLayerData()),super.renderChildren(e),a.backgroundBucketIds.length>0&&(e.renderPass=`background`,this._renderBackgroundLayers(e,a.backgroundBucketIds)),e.drawPhase===1&&this._fade(n,i);let s=this.children.filter(t=>(e.drawPhase===1&&t.fader.fade()<1&&this.requestRender(),t.visible&&t.hasData()));if(!s||s.length===0)t.bindVAO(null);else{for(let e of s)e.triangleCount=0;t.setClearDepth(1),t.clear(256),r.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:`composite`},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}}),e.renderPass=`translucent`;for(let t=0;t<o.length;t++)this._renderStyleLayer(o[t],e,s);t.bindVAO(null),r.setPipelineState(c);for(let e of s)e.debugInfo.display.triangleCount=e.triangleCount}}_fade(e,t){this._symbolFader!=null&&(this._symbolFader.update(e,t)||this.requestRender())}_renderStyleLayer(e,t,n){let{displayLevel:r,renderPass:i}=t;if(e===void 0)return;let a=e.getLayoutProperty(`visibility`);if(!(a&&a.getValue()===1)){switch(e.type){case 0:return;case 1:if(i!==`translucent`)return;break;case 2:if(i!==`translucent`)return;break;case 4:if(i!==`translucent`)return;break;case 3:if(i!==`translucent`)return}n=e.type===3?n.filter(e=>e.decluttered):n.filter(e=>e.neededForCoverage),e.type!==3&&(n.length===0||e.minzoom!==void 0&&e.minzoom>=r+f||e.maxzoom!==void 0&&e.maxzoom<r-f)||(t.styleLayerUID=e.uid,t.styleLayer=e,this._techniques.getTechnique(e.type)?.render(t,{tiles:n}))}}_renderBackgroundLayers(e,t){let{displayLevel:n,state:r}=e,i=this._styleRepository,a=!1;for(let e of t){let t=i.getLayerById(e);if(t&&t.type===0&&p(i.getLayerById(e),n)){a=!0;break}}if(!a)return;let o=this.tilingScheme.getTileCoverage(e.state,0,!0,`smallest`),{spans:s,lodInfo:c}=o,{level:l}=c,m=[],h=0;for(let{row:e,colFrom:t,colTo:n}of s)for(let i=t;i<=n;i++){let t=new d(l,e,c.normalizeCol(i),c.getWorldForColumn(i)),n=this._getOrCreateBackgroundTile(h,t);n.setTransform(r),m.push(n),h++}let g=this._techniques.getTechnique(0);for(let r of t){let t=i.getLayerById(r);t.type!==0||!p(t,n)||t.minzoom!==void 0&&t.minzoom>=n+f||t.maxzoom!==void 0&&t.maxzoom<n-f||(e.styleLayerUID=t.uid,e.styleLayer=t,g.render(e,{tiles:m}))}u.pool.release(o)}_getOrCreateBackgroundTile(t,i){let a=this._backgroundTiles[t];if(a?.key.equals(i))return a;let s=this.tilingScheme.getTileBounds(e(),i),c=this.tilingScheme.getTileResolution(i.level),l=new o(i,c,s[0],s[3],r,r,n,n);return a?(a.destroy(),this._backgroundTiles[t]=l):this._backgroundTiles.push(l),l}_computeDisplayInfoView(e){let n=e.tileInfo.lods,i=n.map(e=>e.scale),a=i[i.length-1],o=Math.max(25,n.length);for(;i.length<=o;)a/=2,i.push(a);this._displayInfo=t.create({scales:i,size:r,spatialReference:e.spatialReference,numLODs:o})}}export{m as VectorTileContainer};
@@ -1,3 +1,3 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
2
  import e from"../../../../../core/BidiEngine.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{numericHash as n}from"../../../../../core/string.js";import{Point as r}from"../../../../../geometry/support/TileClipper.js";import{tilePixelRatio as i,tileSizeInTileUnits as a}from"../constants.js";import{cDegToRad as o,log2 as s,interpolate as c}from"../GeometryUtils.js";import{Anchor as l}from"../Placement.js";import{sdfGlyphSize as u,TextShaping as d}from"../TextShaping.js";import f from"./BaseBucket.js";import{getPolygonLabelPlacement as p}from"../style/GeoJSONLabelUtils.js";import{IconLayout as m,TextLayout as h}from"../style/StyleLayer.js";function g(e,t){return e.iconMosaicItem&&t.iconMosaicItem?e.iconMosaicItem.page===t.iconMosaicItem.page?0:e.iconMosaicItem.page-t.iconMosaicItem.page:e.iconMosaicItem&&!t.iconMosaicItem?1:!e.iconMosaicItem&&t.iconMosaicItem?-1:0}class _ extends f{constructor(e,t,n,r,i,a,o,s,c){super(t,n,c.getSpriteItems()),this.type=3,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=e,this._iconVertexBuffer=r,this._iconIndexBuffer=i,this._textVertexBuffer=a,this._textIndexBuffer=o,this._placementEngine=s,this._workerTileHandler=c}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}static{this._bidiEngine=new e}getResources(e,t,r){let i=this.layer,a=this.zoom;e&&e.setExtent(this.layerExtent);let o=i.getLayoutProperty(`icon-image`),s=i.getLayoutProperty(`text-field`),c=i.getLayoutProperty(`text-transform`),l=i.getLayoutProperty(`text-font`),u=[],d;o&&!o.isDataDriven&&(d=o.getValue(a));let f;s&&!s.isDataDriven&&(f=s.getValue(a));let p;c&&c.isDataDriven||(p=i.getLayoutValue(`text-transform`,a),c=null);let m;l&&l.isDataDriven||(m=i.getLayoutValue(`text-font`,a),l=null);for(let h of this._features){let g=h.getGeometry(e);if(!g||g.length===0)continue;let v;o&&(v=o.isDataDriven?o.getValue(a,h):this._replaceKeys(d,h.values),v&&t(v));let y,b=!1;if(s&&(y=s.isDataDriven?s.getValue(a,h):this._replaceKeys(f,h.values),y)){switch(y=y.replaceAll(`\\n`,`
3
- `),c&&(p=c.getValue(a,h)),p){case 2:y=y.toLowerCase();break;case 1:y=y.toUpperCase()}if(_._bidiEngine.hasBidiChar(y)){let e=_._bidiEngine.checkContextual(y),t;t=e===`rtl`?`IDNNN`:`ICNNN`,y=_._bidiEngine.bidiTransform(y,t,`VLYSN`),b=!0}if(y.length>0){l&&(m=l.getValue(a,h));for(let e of m){let t=r[e];t||=r[e]=new Set;for(let e of y){let n=e.codePointAt(0);n!=null&&t.add(n)}}}}if(!v&&!y)continue;let x=i.getLayoutValue(`symbol-sort-key`,a,h),S={feature:h,sprite:v,label:y,rtl:b,geometry:g,hash:(y?n(y):0)^(v?n(v):0),priority:x,textFont:m};u.push(S)}this._symbolFeatures=u}processFeatures(e){e&&e.setExtent(this.layerExtent);let n=this.layer,r=this.zoom,s=n.getLayoutValue(`symbol-placement`,r),c=s!==0,f=n.getLayoutValue(`symbol-spacing`,r)*i,p=n.getLayoutProperty(`icon-image`),v=n.getLayoutProperty(`text-field`),y=p?new m(n,r,c):null,b=v?new h(n,r,c):null,x=this._workerTileHandler,S;p&&(S=x.getSpriteItems()),this._iconIndexStart=this._iconIndexBuffer.index*3,this._textIndexStart=this._textIndexBuffer.index*3,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();let C=[],w=1;b?.size&&(w=b.size/u);let T=b?b.maxAngle*o:0,E=b?b.size*i:0;for(let e of this._symbolFeatures){let o;y&&S&&e.sprite&&(o=S[e.sprite],o&&o.sdf&&(this._isIconSDF=!0)),o&&y.update(r,e.feature);let p,m=0,h=e.label;if(h){t(b),b.update(r,e.feature);let n=c&&b.rotationAlignment===0?b.keepUpright:b.writingMode&&b.writingMode.includes(1),a=.5;switch(b.anchor){case 5:case 1:case 7:a=0;break;case 6:case 2:case 8:a=1}let o=.5;switch(b.anchor){case 5:case 3:case 6:o=0;break;case 7:case 4:case 8:o=1}let s=.5;switch(b.justify){case 0:s=a;break;case 1:s=0;break;case 3:s=1}let l=b.letterSpacing*u,f=c?0:b.maxWidth*u,g=b.lineHeight*u,_=e.textFont.map(e=>x.getGlyphItems(e));if(p=new d(_,f,g,l,a,o,s).getShaping(h,e.rtl,n),p&&p.length>0){let e=1e30,t=-1e30;for(let n of p)e=Math.min(e,n.x),t=Math.max(t,n.x);m=(t-e+u*2)*w*i}}let g=_._getPlacementCandidates(n,s,e.feature,e.geometry);for(let t of g){let{vertices:n}=t,r=[];if(s===1){if(p?.length&&b?.size){let e=b.size*i*(2+Math.min(2,Math.abs(b.offset[1])*4));n=_._smoothVertices(n,e)}_._pushAnchors(r,n,f,m)}else s===2?_._pushCenterAnchor(r,n):e.feature.type===3?t.anchor?r.push(t.anchor):_._pushCentroid(r,n):r.push(new l(n[0].x,n[0].y));for(let t of r){if(t.x<0||t.x>a||t.y<0||t.y>a||c&&m>0&&b?.rotationAlignment===0&&!_._honorsTextMaxAngle(n,t,m,T,E))continue;let r={shaping:p,line:n,iconMosaicItem:o,anchor:t,symbolFeature:e,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};C.push(r),this._processFeature(r,y,b)}}}C.sort(g),this._addPlacedGlyphs(),this._symbolInstances=C}serialize(){let e=14;e+=this.layerUIDs.length,e+=this.markerPageMap.size*3,e+=this.glyphsPageMap.size*3,e+=_._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;let t=new Uint32Array(e),n=new Int32Array(t.buffer),r=new Float32Array(t.buffer),[i,a,o]=this._sourceTileKey.split(`/`),s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[s++]=this.layerUIDs[e];t[s++]=+!!this._isIconSDF,t[s++]=parseFloat(i),t[s++]=parseFloat(a),t[s++]=parseFloat(o),t[s++]=this.markerPageMap.size;for(let[e,[n,r]]of this.markerPageMap)t[s++]=e,t[s++]=n,t[s++]=r;t[s++]=this.glyphsPageMap.size;for(let[e,[n,r]]of this.glyphsPageMap)t[s++]=e,t[s++]=n,t[s++]=r;t[s++]=this._iconVertexBuffer.index/4,t[s++]=this._textVertexBuffer.index/4,s=_.serializeSymbols(t,n,r,s,this._symbolInstances),t[s++]=this._iconVertexBuffer.array.length;for(let e=0;e<this._iconVertexBuffer.array.length;e++)n[s++]=this._iconVertexBuffer.array[e];t[s++]=this._iconIndexBuffer.array.length;for(let e=0;e<this._iconIndexBuffer.array.length;e++)t[s++]=this._iconIndexBuffer.array[e];t[s++]=this._textVertexBuffer.array.length;for(let e=0;e<this._textVertexBuffer.array.length;e++)n[s++]=this._textVertexBuffer.array[e];t[s++]=this._textIndexBuffer.array.length;for(let e=0;e<this._textIndexBuffer.array.length;e++)t[s++]=this._textIndexBuffer.array[e];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(let n of e||[]){t+=5,t+=1;for(let e of n.textColliders)t+=10;for(let e of n.iconColliders)t+=10;t+=1,t+=n.textVertexRanges.length*2,t+=1,t+=n.iconVertexRanges.length*2}return t}static serializeSymbols(e,t,n,r,i){i||=[],t[r++]=i.length;for(let e of i){t[r++]=e.anchor.x,t[r++]=e.anchor.y,t[r++]=e.symbolFeature.hash,t[r++]=e.symbolFeature.priority,t[r++]=e.symbolFeature.feature.featureIndex,t[r++]=e.textColliders.length+e.iconColliders.length;for(let i of e.textColliders)t[r++]=i.xTile,t[r++]=i.yTile,t[r++]=i.dxPixels,t[r++]=i.dyPixels,t[r++]=+!!i.hard,t[r++]=i.partIndex,n[r++]=i.minLod,n[r++]=i.maxLod,t[r++]=i.width,t[r++]=i.height;for(let i of e.iconColliders)t[r++]=i.xTile,t[r++]=i.yTile,t[r++]=i.dxPixels,t[r++]=i.dyPixels,t[r++]=+!!i.hard,t[r++]=i.partIndex,n[r++]=i.minLod,n[r++]=i.maxLod,t[r++]=i.width,t[r++]=i.height;t[r++]=e.textVertexRanges.length;for(let[n,i]of e.textVertexRanges)t[r++]=n,t[r++]=i;t[r++]=e.iconVertexRanges.length;for(let[n,i]of e.iconVertexRanges)t[r++]=n,t[r++]=i}return r}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,(e,n)=>n in t?t[n]:``)}_processFeature(e,t,n){let{line:r,iconMosaicItem:i,shaping:a,anchor:o}=e,c=this.zoom,l=this.layer,u=!!i,d=!0;u&&(d=t?.optional||!i);let f=a&&a.length>0,p=!f||n?.optional,m;if(u&&(m=this._placementEngine.getIconPlacement(o,i,t)),!m&&!d)return;let h;if(f&&(h=this._placementEngine.getTextPlacement(o,a,r,n)),h||p){if(m&&h||(!p&&!d?(m=null,h=null):!p&&!h?m=null:!d&&!m&&(h=null)),h){let t=l.hasDataDrivenText?l.textMaterial.encodeAttributes(e.symbolFeature.feature,c,l):null;if(this._storePlacedGlyphs(e,h.shapes,c,n.rotationAlignment,t),h.textColliders){e.textColliders=h.textColliders;for(let e of h.textColliders){e.minLod=Math.max(c+s(e.minLod),0),e.maxLod=Math.min(c+s(e.maxLod),25);let t=e.angle;if(t){let n=Math.cos(t),r=Math.sin(t),i=e.dxPixels*n-e.dyPixels*r,a=e.dxPixels*r+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*r,s=(e.dxPixels+e.width)*r+e.dyPixels*n,c=e.dxPixels*n-(e.dyPixels+e.height)*r,l=e.dxPixels*r+(e.dyPixels+e.height)*n,u=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*r,d=(e.dxPixels+e.width)*r+(e.dyPixels+e.height)*n,f=Math.min(i,o,c,u),p=Math.max(i,o,c,u),m=Math.min(a,s,l,d),h=Math.max(a,s,l,d);e.dxPixels=f,e.dyPixels=m,e.width=p-f,e.height=h-m}}}}if(m){let n=l.hasDataDrivenIcon?l.iconMaterial.encodeAttributes(e.symbolFeature.feature,c,l):null;if(this._addPlacedIcons(e,m.shapes,c,i.page,t.rotationAlignment===1,n),m.iconColliders){e.iconColliders=m.iconColliders;for(let e of m.iconColliders){e.minLod=Math.max(c+s(e.minLod),0),e.maxLod=Math.min(c+s(e.maxLod),25);let t=e.angle;if(t){let n=Math.cos(t),r=Math.sin(t),i=e.dxPixels*n-e.dyPixels*r,a=e.dxPixels*r+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*r,s=(e.dxPixels+e.width)*r+e.dyPixels*n,c=e.dxPixels*n-(e.dyPixels+e.height)*r,l=e.dxPixels*r+(e.dyPixels+e.height)*n,u=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*r,d=(e.dxPixels+e.width)*r+(e.dyPixels+e.height)*n,f=Math.min(i,o,c,u),p=Math.max(i,o,c,u),m=Math.min(a,s,l,d),h=Math.max(a,s,l,d);e.dxPixels=f,e.dyPixels=m,e.width=p-f,e.height=h-m}}}}}}_addPlacedIcons(e,t,n,r,i,a){let o=Math.max(n-1,0),c=this._iconVertexBuffer,l=this._iconIndexBuffer,u=this._markerMap;for(let d of t){let t=i?0:Math.max(n+s(d.minzoom),o),f=i?25:Math.min(n+s(d.maxzoom),25);if(f<=t)continue;let p=d.tl,m=d.tr,h=d.bl,g=d.br,_=d.mosaicRect,v=d.labelAngle,y=d.minAngle,b=d.maxAngle,x=d.anchor,S=c.index,C=_.x,w=_.y,T=C+_.width,E=w+_.height,D=c.index;c.add(x.x,x.y,p.x,p.y,C,w,v,y,b,t,f,a),c.add(x.x,x.y,m.x,m.y,T,w,v,y,b,t,f,a),c.add(x.x,x.y,h.x,h.y,C,E,v,y,b,t,f,a),c.add(x.x,x.y,g.x,g.y,T,E,v,y,b,t,f,a),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===D?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([D,4]),l.add(S,S+1,S+2),l.add(S+1,S+2,S+3),u.has(r)?u.get(r)[1]+=6:u.set(r,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){let e=this._textVertexBuffer,t=this._textIndexBuffer,n=this._glyphMap;for(let[r,i]of this._glyphBufferDataStorage)for(let a of i){let i=e.index,o=a.symbolInstance,s=a.ddAttributes,c=e.index;e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tl[0],a.tl[1],a.xmin,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,s),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tr[0],a.tr[1],a.xmax,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,s),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.bl[0],a.bl[1],a.xmin,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,s),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.br[0],a.br[1],a.xmax,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,s),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===c?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([c,4]),t.add(i,i+1,i+2),t.add(i+1,i+2,i+3),n.has(r)?n.get(r)[1]+=6:n.set(r,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,n,r,i){let a=Math.max(n-1,0),o=r===1,c,l,u,d,f,p,m,h,g,_,v;for(let r of t)c=o?0:Math.max(n+s(r.minzoom),a),l=o?25:Math.min(n+s(r.maxzoom),25),!(l<=c)&&(u=r.tl,d=r.tr,f=r.bl,p=r.br,m=r.labelAngle,h=r.minAngle,g=r.maxAngle,_=r.anchor,v=r.mosaicRect,this._glyphBufferDataStorage.has(r.page)||this._glyphBufferDataStorage.set(r.page,[]),this._glyphBufferDataStorage.get(r.page).push({glyphAnchor:[_.x,_.y],tl:[u.x,u.y],tr:[d.x,d.y],bl:[f.x,f.y],br:[p.x,p.y],xmin:v.x,ymin:v.y,xmax:v.x+v.width,ymax:v.y+v.height,labelAngle:m,minAngle:h,maxAngle:g,minLod:c,maxLod:l,placementLod:a,symbolInstance:e,ddAttributes:i}))}static _pushAnchors(e,t,n,i){n+=i;let a=0,o=t.length-1;for(let e=0;e<o;e++)a+=r.distance(t[e],t[e+1]);let s=i||n;if(s*=.5,a<=s)return;let u=s/a;n=a/Math.max(Math.round(a/n),1);let d=0,f=-n/2,p=t.length-1;for(let r=0;r<p;r++){let i=t[r],a=t[r+1],o=a.x-i.x,s=a.y-i.y,p=Math.sqrt(o*o+s*s),m;for(;f+n<d+p;){f+=n;let t=(f-d)/p,h=c(i.x,a.x,t),g=c(i.y,a.y,t);m===void 0&&(m=Math.atan2(s,o)),e.push(new l(h,g,m,r,u))}d+=p}}static _pushCenterAnchor(e,t){let n=0,i=t.length-1;for(let e=0;e<i;e++)n+=r.distance(t[e],t[e+1]);let a=n/2,o=0,s=t.length-1;for(let n=0;n<s;n++){let r=t[n],i=t[n+1],s=i.x-r.x,u=i.y-r.y,d=Math.sqrt(s*s+u*u);if(a<o+d){let t=(a-o)/d,f=c(r.x,i.x,t),p=c(r.y,i.y,t),m=Math.atan2(u,s);e.push(new l(f,p,m,n,0));return}o+=d}}static _deviation(e,t,n){let r=(t.x-e.x)*(n.x-t.x)+(t.y-e.y)*(n.y-t.y),i=(t.x-e.x)*(n.y-t.y)-(t.y-e.y)*(n.x-t.x);return Math.atan2(i,r)}static _honorsTextMaxAngle(e,t,n,i,a){let o=0,s=n/2,c=new r(t.x,t.y),l=t.segment+1;for(;o>-s;){if(--l,l<0)return!1;o-=r.distance(e[l],c),c=e[l]}o+=r.distance(e[l],e[l+1]);let u=[],d=0,f=e.length;for(;o<s;){let t=e[l],n=l,s;do{if(++n,n===f)return!1;s=e[n]}while(s.isEqual(t));let c=n,p;do{if(++c,c===f)return!1;p=e[c]}while(p.isEqual(s));let m=this._deviation(t,s,p);for(u.push({deviation:m,distToAnchor:o}),d+=m;o-u[0].distToAnchor>a;)d-=u.shift().deviation;if(Math.abs(d)>i)return!1;o+=r.distance(s,p),l=n}return!0}static _smoothVertices(e,t){if(t<=0)return e;let n=e.length;if(n<3)return e;let i=[],a=0,o=0;i.push(0);for(let t=1;t<n;t++){let n=r.distance(e[t],e[t-1]);n>0&&(a+=n,i.push(a),o++,o!==t&&(e[o]=e[t]))}if(n=o+1,n<3)return e;t=Math.min(t,.2*a);let s=e[0].x,c=e[0].y,l=e[n-1].x,u=e[n-1].y,d=r.sub(e[0],e[1]);d.normalize(),e[0].x+=t*d.x,e[0].y+=t*d.y,d.assignSub(e[n-1],e[n-2]),d.normalize(),e[n-1].x+=t*d.x,e[n-1].y+=t*d.y,i[0]-=t,i[n-1]+=t;let f=[];f.push(new r(s,c));let p=1e-6,m=.5*t;for(let a=1;a<n-1;a++){let o=0,s=0,c=0;for(let n=a-1;n>=0;n--){let r=m+i[n+1]-i[a];if(r<0)break;let l=i[n+1]-i[n],u=i[a]-i[n]<m?1:r/l;if(u<p)break;let d=u*u,f=u*r-.5*d*l,h=u*l/t,g=e[n+1],_=e[n].x-g.x,v=e[n].y-g.y;o+=h/f*(g.x*u*r+.5*d*(r*_-l*g.x)-d*u*l*_/3),s+=h/f*(g.y*u*r+.5*d*(r*v-l*g.y)-d*u*l*v/3),c+=h}for(let r=a+1;r<n;r++){let n=m-i[r-1]+i[a];if(n<0)break;let l=i[r]-i[r-1],u=i[r]-i[a]<m?1:n/l;if(u<p)break;let d=u*u,f=u*n-.5*d*l,h=u*l/t,g=e[r-1],_=e[r].x-g.x,v=e[r].y-g.y;o+=h/f*(g.x*u*n+.5*d*(n*_-l*g.x)-d*u*l*_/3),s+=h/f*(g.y*u*n+.5*d*(n*v-l*g.y)-d*u*l*v/3),c+=h}f.push(new r(o/c,s/c))}return f.push(new r(l,u)),e[0].x=s,e[0].y=c,e[n-1].x=l,e[n-1].y=u,f}static _getPlacementCandidates(e,t,n,r){if(t!==0||n.type!==3||e.sourceType!==`geojson`)return r.map(e=>({anchor:null,vertices:e}));let i=p(r);return i?[{anchor:new l(i.x,i.y),vertices:i.vertices}]:[]}static _pushCentroid(e,t){let n=a,r=a,i=t.length-1,o=0,s=0,c=0,u=t[0].x,d=t[0].y;u>n&&(u=n),u<0&&(u=0),d>r&&(d=r),d<0&&(d=0);for(let e=1;e<i;e++){let i=t[e].x,a=t[e].y,l=t[e+1].x,f=t[e+1].y;i>n&&(i=n),i<0&&(i=0),a>r&&(a=r),a<0&&(a=0),l>n&&(l=n),l<0&&(l=0),f>r&&(f=r),f<0&&(f=0);let p=(i-u)*(f-d)-(l-u)*(a-d);o+=p*(u+i+l),s+=p*(d+a+f),c+=p}o/=3*c,s/=3*c,!isNaN(o)&&!isNaN(s)&&e.push(new l(o,s))}}export{_ as default};
3
+ `),c&&(p=c.getValue(a,h)),p){case 2:y=y.toLowerCase();break;case 1:y=y.toUpperCase()}if(_._bidiEngine.hasBidiChar(y)){let e=_._bidiEngine.checkContextual(y),t;t=e===`rtl`?`IDNNN`:`ICNNN`,y=_._bidiEngine.bidiTransform(y,t,`VLYSN`),b=!0}if(y.length>0){l&&(m=l.getValue(a,h));for(let e of m){let t=r[e];t||=r[e]=new Set;for(let e of y){let n=e.codePointAt(0);n!=null&&t.add(n)}}}}if(!v&&!y)continue;let x=i.getLayoutValue(`symbol-sort-key`,a,h),S={feature:h,sprite:v,label:y,rtl:b,geometry:g,hash:(y?n(y):0)^(v?n(v):0),priority:x,textFont:m};u.push(S)}this._symbolFeatures=u}processFeatures(e){e&&e.setExtent(this.layerExtent);let n=this.layer,r=this.zoom,s=n.getLayoutValue(`symbol-placement`,r),c=s!==0,f=n.getLayoutValue(`symbol-spacing`,r)*i,p=n.getLayoutProperty(`icon-image`),v=n.getLayoutProperty(`text-field`),y=p?new m(n,r,c):null,b=v?new h(n,r,c):null,x=this._workerTileHandler,S;p&&(S=x.getSpriteItems()),this._iconIndexStart=this._iconIndexBuffer.index*3,this._textIndexStart=this._textIndexBuffer.index*3,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();let C=[],w=1;b?.size&&(w=b.size/u);let T=b?b.maxAngle*o:0,E=b?b.size*i:0;for(let e of this._symbolFeatures){let o;y&&S&&e.sprite&&(o=S[e.sprite],o&&o.sdf&&(this._isIconSDF=!0)),o&&y.update(r,e.feature);let p,m=0,h=e.label;if(h){t(b),b.update(r,e.feature);let n=c&&b.rotationAlignment===0?b.keepUpright:b.writingMode&&b.writingMode.includes(1),a=.5;switch(b.anchor){case 5:case 1:case 7:a=0;break;case 6:case 2:case 8:a=1}let o=.5;switch(b.anchor){case 5:case 3:case 6:o=0;break;case 7:case 4:case 8:o=1}let s=.5;switch(b.justify){case 0:s=a;break;case 1:s=0;break;case 3:s=1}let l=b.letterSpacing*u,f=c?0:b.maxWidth*u,g=b.lineHeight*u,_=e.textFont.map(e=>x.getGlyphItems(e));if(p=new d(_,f,g,l,a,o,s).getShaping(h,e.rtl,n),p&&p.length>0){let e=1e30,t=-1e30;for(let n of p)e=Math.min(e,n.x),t=Math.max(t,n.x);m=(t-e+u*2)*w*i}}let g=_._getPlacementCandidates(n,s,e.feature,e.geometry);for(let t of g){let{vertices:n}=t,r=[];if(s===1){if(p?.length&&b?.size){let e=b.size*i*(2+Math.min(2,Math.abs(b.offset[1])*4));n=_._smoothVertices(n,e)}_._pushAnchors(r,n,f,m)}else s===2?_._pushCenterAnchor(r,n):e.feature.type===3?t.anchor?r.push(t.anchor):_._pushCentroid(r,n):r.push(new l(n[0].x,n[0].y));for(let t of r){if(t.x<0||t.x>a||t.y<0||t.y>a||c&&m>0&&b?.rotationAlignment===0&&!_._honorsTextMaxAngle(n,t,m,T,E))continue;let r={shaping:p,line:n,iconMosaicItem:o,anchor:t,symbolFeature:e,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};C.push(r),this._processFeature(r,y,b)}}}C.sort(g),this._addPlacedGlyphs(),this._symbolInstances=C}serialize(){let e=14;e+=this.layerUIDs.length,e+=this.markerPageMap.size*3,e+=this.glyphsPageMap.size*3,e+=_._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;let t=new Uint32Array(e),n=new Int32Array(t.buffer),r=new Float32Array(t.buffer),[i,a,o]=this._sourceTileKey.split(`/`),s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[s++]=this.layerUIDs[e];t[s++]=+!!this._isIconSDF,t[s++]=parseFloat(i),t[s++]=parseFloat(a),t[s++]=parseFloat(o),t[s++]=this.markerPageMap.size;for(let[e,[n,r]]of this.markerPageMap)t[s++]=e,t[s++]=n,t[s++]=r;t[s++]=this.glyphsPageMap.size;for(let[e,[n,r]]of this.glyphsPageMap)t[s++]=e,t[s++]=n,t[s++]=r;t[s++]=this._iconVertexBuffer.index/4,t[s++]=this._textVertexBuffer.index/4,s=_.serializeSymbols(t,n,r,s,this._symbolInstances),t[s++]=this._iconVertexBuffer.array.length;for(let e=0;e<this._iconVertexBuffer.array.length;e++)n[s++]=this._iconVertexBuffer.array[e];t[s++]=this._iconIndexBuffer.array.length;for(let e=0;e<this._iconIndexBuffer.array.length;e++)t[s++]=this._iconIndexBuffer.array[e];t[s++]=this._textVertexBuffer.array.length;for(let e=0;e<this._textVertexBuffer.array.length;e++)n[s++]=this._textVertexBuffer.array[e];t[s++]=this._textIndexBuffer.array.length;for(let e=0;e<this._textIndexBuffer.array.length;e++)t[s++]=this._textIndexBuffer.array[e];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(let n of e||[]){t+=5,t+=1;for(let e of n.textColliders)t+=10;for(let e of n.iconColliders)t+=10;t+=1,t+=n.textVertexRanges.length*2,t+=1,t+=n.iconVertexRanges.length*2}return t}static serializeSymbols(e,t,n,r,i){i||=[],t[r++]=i.length;for(let e of i){t[r++]=e.anchor.x,t[r++]=e.anchor.y,t[r++]=e.symbolFeature.hash,t[r++]=e.symbolFeature.priority,t[r++]=e.symbolFeature.feature.featureIndex,t[r++]=e.textColliders.length+e.iconColliders.length;for(let i of e.textColliders)t[r++]=i.xTile,t[r++]=i.yTile,t[r++]=i.dxPixels,t[r++]=i.dyPixels,t[r++]=+!!i.hard,t[r++]=i.partIndex,n[r++]=i.minLod,n[r++]=i.maxLod,t[r++]=i.width,t[r++]=i.height;for(let i of e.iconColliders)t[r++]=i.xTile,t[r++]=i.yTile,t[r++]=i.dxPixels,t[r++]=i.dyPixels,t[r++]=+!!i.hard,t[r++]=i.partIndex,n[r++]=i.minLod,n[r++]=i.maxLod,t[r++]=i.width,t[r++]=i.height;t[r++]=e.textVertexRanges.length;for(let[n,i]of e.textVertexRanges)t[r++]=n,t[r++]=i;t[r++]=e.iconVertexRanges.length;for(let[n,i]of e.iconVertexRanges)t[r++]=n,t[r++]=i}return r}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,(e,n)=>n in t?t[n]:``)}_processFeature(e,t,n){let{line:r,iconMosaicItem:i,shaping:a,anchor:o}=e,c=this.zoom,l=this.layer,u=!!i,d=!0;u&&(d=t?.optional||!i);let f=a&&a.length>0,p=!f||n?.optional,m;if(u&&(m=this._placementEngine.getIconPlacement(o,i,t)),!m&&!d)return;let h;if(f&&(h=this._placementEngine.getTextPlacement(o,a,r,n)),h||p){if(m&&h||(!p&&!d?(m=null,h=null):!p&&!h?m=null:!d&&!m&&(h=null)),h){let t=l.hasDataDrivenText?l.textMaterial.encodeAttributes(e.symbolFeature.feature,c,l):null;if(this._storePlacedGlyphs(e,h.shapes,c,n.rotationAlignment,t),h.textColliders){e.textColliders=h.textColliders;for(let e of h.textColliders){e.minLod=Math.max(c+s(e.minLod),0),e.maxLod=Math.min(c+s(e.maxLod),25);let t=e.angle;if(t){let n=Math.cos(t),r=Math.sin(t),i=e.dxPixels*n-e.dyPixels*r,a=e.dxPixels*r+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*r,s=(e.dxPixels+e.width)*r+e.dyPixels*n,c=e.dxPixels*n-(e.dyPixels+e.height)*r,l=e.dxPixels*r+(e.dyPixels+e.height)*n,u=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*r,d=(e.dxPixels+e.width)*r+(e.dyPixels+e.height)*n,f=Math.min(i,o,c,u),p=Math.max(i,o,c,u),m=Math.min(a,s,l,d),h=Math.max(a,s,l,d);e.dxPixels=f,e.dyPixels=m,e.width=p-f,e.height=h-m}}}}if(m){let n=l.hasDataDrivenIcon?l.iconMaterial.encodeAttributes(e.symbolFeature.feature,c,l):null;if(this._addPlacedIcons(e,m.shapes,c,i.page,t.rotationAlignment===1,n),m.iconColliders){e.iconColliders=m.iconColliders;for(let e of m.iconColliders){e.minLod=Math.max(c+s(e.minLod),0),e.maxLod=Math.min(c+s(e.maxLod),25);let t=e.angle;if(t){let n=Math.cos(t),r=Math.sin(t),i=e.dxPixels*n-e.dyPixels*r,a=e.dxPixels*r+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*r,s=(e.dxPixels+e.width)*r+e.dyPixels*n,c=e.dxPixels*n-(e.dyPixels+e.height)*r,l=e.dxPixels*r+(e.dyPixels+e.height)*n,u=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*r,d=(e.dxPixels+e.width)*r+(e.dyPixels+e.height)*n,f=Math.min(i,o,c,u),p=Math.max(i,o,c,u),m=Math.min(a,s,l,d),h=Math.max(a,s,l,d);e.dxPixels=f,e.dyPixels=m,e.width=p-f,e.height=h-m}}}}}}_addPlacedIcons(e,t,n,r,i,a){let o=Math.max(n-1,0),c=this._iconVertexBuffer,l=this._iconIndexBuffer,u=this._markerMap;for(let d of t){let t=i?0:Math.max(n+s(d.minzoom),o),f=i?25:Math.min(n+s(d.maxzoom),25);if(f<=t)continue;let p=d.tl,m=d.tr,h=d.bl,g=d.br,_=d.mosaicRect,v=d.labelAngle,y=d.minAngle,b=d.maxAngle,x=d.anchor,S=c.index,C=_.x,w=_.y,T=C+_.width,E=w+_.height,D=c.index;c.add(x.x,x.y,p.x,p.y,C,w,v,y,b,t,f,a),c.add(x.x,x.y,m.x,m.y,T,w,v,y,b,t,f,a),c.add(x.x,x.y,h.x,h.y,C,E,v,y,b,t,f,a),c.add(x.x,x.y,g.x,g.y,T,E,v,y,b,t,f,a),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===D?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([D,4]),l.add(S,S+1,S+2),l.add(S+1,S+2,S+3),u.has(r)?u.get(r)[1]+=6:u.set(r,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){let e=this._textVertexBuffer,t=this._textIndexBuffer,n=this._glyphMap;for(let[r,i]of this._glyphBufferDataStorage)for(let a of i){let i=e.index,o=a.symbolInstance,s=a.ddAttributes,c=e.index;e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tl[0],a.tl[1],a.xmin,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,s),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tr[0],a.tr[1],a.xmax,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,s),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.bl[0],a.bl[1],a.xmin,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,s),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.br[0],a.br[1],a.xmax,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,s),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===c?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([c,4]),t.add(i,i+1,i+2),t.add(i+1,i+2,i+3),n.has(r)?n.get(r)[1]+=6:n.set(r,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,n,r,i){let a=Math.max(n-1,0),o=r===1,c,l,u,d,f,p,m,h,g,_,v;for(let r of t)c=o?0:Math.max(n+s(r.minzoom),a),l=o?25:Math.min(n+s(r.maxzoom),25),l<=c||(u=r.tl,d=r.tr,f=r.bl,p=r.br,m=r.labelAngle,h=r.minAngle,g=r.maxAngle,_=r.anchor,v=r.mosaicRect,this._glyphBufferDataStorage.has(r.page)||this._glyphBufferDataStorage.set(r.page,[]),this._glyphBufferDataStorage.get(r.page).push({glyphAnchor:[_.x,_.y],tl:[u.x,u.y],tr:[d.x,d.y],bl:[f.x,f.y],br:[p.x,p.y],xmin:v.x,ymin:v.y,xmax:v.x+v.width,ymax:v.y+v.height,labelAngle:m,minAngle:h,maxAngle:g,minLod:c,maxLod:l,placementLod:a,symbolInstance:e,ddAttributes:i}))}static _pushAnchors(e,t,n,i){n+=i;let a=0,o=t.length-1;for(let e=0;e<o;e++)a+=r.distance(t[e],t[e+1]);let s=i||n;if(s*=.5,a<=s)return;let u=s/a;n=a/Math.max(Math.round(a/n),1);let d=0,f=-n/2,p=t.length-1;for(let r=0;r<p;r++){let i=t[r],a=t[r+1],o=a.x-i.x,s=a.y-i.y,p=Math.sqrt(o*o+s*s),m;for(;f+n<d+p;){f+=n;let t=(f-d)/p,h=c(i.x,a.x,t),g=c(i.y,a.y,t);m===void 0&&(m=Math.atan2(s,o)),e.push(new l(h,g,m,r,u))}d+=p}}static _pushCenterAnchor(e,t){let n=0,i=t.length-1;for(let e=0;e<i;e++)n+=r.distance(t[e],t[e+1]);let a=n/2,o=0,s=t.length-1;for(let n=0;n<s;n++){let r=t[n],i=t[n+1],s=i.x-r.x,u=i.y-r.y,d=Math.sqrt(s*s+u*u);if(a<o+d){let t=(a-o)/d,f=c(r.x,i.x,t),p=c(r.y,i.y,t),m=Math.atan2(u,s);e.push(new l(f,p,m,n,0));return}o+=d}}static _deviation(e,t,n){let r=(t.x-e.x)*(n.x-t.x)+(t.y-e.y)*(n.y-t.y),i=(t.x-e.x)*(n.y-t.y)-(t.y-e.y)*(n.x-t.x);return Math.atan2(i,r)}static _honorsTextMaxAngle(e,t,n,i,a){let o=0,s=n/2,c=new r(t.x,t.y),l=t.segment+1;for(;o>-s;){if(--l,l<0)return!1;o-=r.distance(e[l],c),c=e[l]}o+=r.distance(e[l],e[l+1]);let u=[],d=0,f=e.length;for(;o<s;){let t=e[l],n=l,s;do{if(++n,n===f)return!1;s=e[n]}while(s.isEqual(t));let c=n,p;do{if(++c,c===f)return!1;p=e[c]}while(p.isEqual(s));let m=this._deviation(t,s,p);for(u.push({deviation:m,distToAnchor:o}),d+=m;o-u[0].distToAnchor>a;)d-=u.shift().deviation;if(Math.abs(d)>i)return!1;o+=r.distance(s,p),l=n}return!0}static _smoothVertices(e,t){if(t<=0)return e;let n=e.length;if(n<3)return e;let i=[],a=0,o=0;i.push(0);for(let t=1;t<n;t++){let n=r.distance(e[t],e[t-1]);n>0&&(a+=n,i.push(a),o++,o!==t&&(e[o]=e[t]))}if(n=o+1,n<3)return e;t=Math.min(t,.2*a);let s=e[0].x,c=e[0].y,l=e[n-1].x,u=e[n-1].y,d=r.sub(e[0],e[1]);d.normalize(),e[0].x+=t*d.x,e[0].y+=t*d.y,d.assignSub(e[n-1],e[n-2]),d.normalize(),e[n-1].x+=t*d.x,e[n-1].y+=t*d.y,i[0]-=t,i[n-1]+=t;let f=[];f.push(new r(s,c));let p=1e-6,m=.5*t;for(let a=1;a<n-1;a++){let o=0,s=0,c=0;for(let n=a-1;n>=0;n--){let r=m+i[n+1]-i[a];if(r<0)break;let l=i[n+1]-i[n],u=i[a]-i[n]<m?1:r/l;if(u<p)break;let d=u*u,f=u*r-.5*d*l,h=u*l/t,g=e[n+1],_=e[n].x-g.x,v=e[n].y-g.y;o+=h/f*(g.x*u*r+.5*d*(r*_-l*g.x)-d*u*l*_/3),s+=h/f*(g.y*u*r+.5*d*(r*v-l*g.y)-d*u*l*v/3),c+=h}for(let r=a+1;r<n;r++){let n=m-i[r-1]+i[a];if(n<0)break;let l=i[r]-i[r-1],u=i[r]-i[a]<m?1:n/l;if(u<p)break;let d=u*u,f=u*n-.5*d*l,h=u*l/t,g=e[r-1],_=e[r].x-g.x,v=e[r].y-g.y;o+=h/f*(g.x*u*n+.5*d*(n*_-l*g.x)-d*u*l*_/3),s+=h/f*(g.y*u*n+.5*d*(n*v-l*g.y)-d*u*l*v/3),c+=h}f.push(new r(o/c,s/c))}return f.push(new r(l,u)),e[0].x=s,e[0].y=c,e[n-1].x=l,e[n-1].y=u,f}static _getPlacementCandidates(e,t,n,r){if(t!==0||n.type!==3||e.sourceType!==`geojson`)return r.map(e=>({anchor:null,vertices:e}));let i=p(r);return i?[{anchor:new l(i.x,i.y),vertices:i.vertices}]:[]}static _pushCentroid(e,t){let n=a,r=a,i=t.length-1,o=0,s=0,c=0,u=t[0].x,d=t[0].y;u>n&&(u=n),u<0&&(u=0),d>r&&(d=r),d<0&&(d=0);for(let e=1;e<i;e++){let i=t[e].x,a=t[e].y,l=t[e+1].x,f=t[e+1].y;i>n&&(i=n),i<0&&(i=0),a>r&&(a=r),a<0&&(a=0),l>n&&(l=n),l<0&&(l=0),f>r&&(f=r),f<0&&(f=0);let p=(i-u)*(f-d)-(l-u)*(a-d);o+=p*(u+i+l),s+=p*(d+a+f),c+=p}o/=3*c,s/=3*c,!isNaN(o)&&!isNaN(s)&&e.push(new l(o,s))}}export{_ as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{pt2px as e}from"../../../../../../core/screenUtils.js";import{fromRotation as t,multiply as n,translate as r,rotate as i}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as s}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as l,getYAnchorDirection as u}from"../../alignmentUtils.js";import{magicLabelLineHeight as d}from"../../definitions.js";import f from"../../Rect.js";import p from"../../collisions/BoundingBox.js";const m=Math.PI/180;class h{static fromGlyph(e,t,n,r,i){let{mosaicItem:a,rect:o,shaping:s,code:c}=n,l=a.rect;return new h({width:c===0?o.width:l.width*r,height:c===0?o.height:l.height*r,x:r*(e+s.xOffset+o.left),y:r*(t+s.yOffset-o.top),textureBinding:a.textureBinding,texcoords:{topLeft:[l.x,l.y],topRight:[l.x+l.width,l.y],bottomLeft:[l.x,l.y+l.height],bottomRight:[l.x+l.width,l.y+l.height]},fontSize:i?.fontSize,color:i?.color})}constructor(e){this._rotationT=a(),this._transform=a(),this._angle=0,this._bounds=null,this.width=e.width,this.height=e.height,this.x=e.x,this.y=e.y,this.textureBinding=e.textureBinding,this.texcoords=e.texcoords,this.fontSize=e.fontSize,this.color=e.color}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){let{x:e,y:r,width:i,height:s}=this,c=t(a(),-this.angle),l=n(a(),c,this._transform);this._offsets={topLeft:o([0,0],[e,r],l),topRight:o([0,0],[e+i,r],l),bottomLeft:o([0,0],[e,r+s],l),bottomRight:o([0,0],[e+i,r+s],l)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){let e=this.offsets,t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,o]of[e.topLeft,e.topRight,e.bottomLeft,e.bottomRight])t=Math.min(t,a),n=Math.min(n,o),r=Math.max(r,a),i=Math.max(i,o);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;this._bounds=new p(s,c,a,o)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}}const g=(e,t)=>({code:0,mosaicItem:{rect:new f(0,0,11,8),sdf:!0,page:0,textureBinding:t},rect:{height:4,width:e,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function _(t){return t===`underline`?e(2):0}function v(e,t,n,r,i){switch(e){case`underline`:return(n??i?.baseline??22)+4+_(e)/t;case`line-through`:return r??i?.midline??16;default:return 0}}function y(e,t){return e.forEach(e=>o(e,e,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}class b{constructor(e,t,n,r){this._rotation=0,this._decorate(e,t,n,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=n.angle!==0,this._transform=this._createGlyphTransform(this.bounds,n),this._borderLineSizePx=n.borderLineSizePx,(n.borderLineSizePx||n.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(let t of e)t.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;let r=this._transform,i=t(a(),e);n(r,i,r);for(let e of this.glyphs)e.setTransform(this._transform)}_decorate(e,t,n,r){if(!n.decoration||n.decoration===`none`||!e.length)return;let i=n.scale,a=e[0].textureBinding;for(let o of t){let t=o.scale??i,s=v(n.decoration,t,o.baseline,o.midline,r),c=o.startX*t,l=o.startY*t,u=(o.width+o.glyphWidthEnd)*t;e.push(h.fromGlyph(c,l+s*t,g(u,a),1))}}shapeBackground(e){let t=(1.5+(this._borderLineSizePx||0))/2,n=this._borderLineSizePx?t:0,{xmin:r,ymin:i,xmax:a,ymax:o,x:s,y:c,width:l,height:u}=this.bounds,d=[r-8,i-8],f=[a+8,i-8],m=[r-8,o+8],h=[a+8,o+8],g=y([[d[0]-t,d[1]-t],[f[0]+t,f[1]-t],[d[0]+n,d[1]+n],[f[0]-n,f[1]+n]],e),_=y([[m[0]+n,m[1]-n],[h[0]-n,h[1]-n],[m[0]-t,m[1]+t],[h[0]+t,h[1]+t]],e),v=y([[d[0]-t,d[1]-t],[d[0]+n,d[1]+n],[m[0]-t,m[1]+t],[m[0]+n,m[1]-n]],e),b=y([[f[0]-n,f[1]+n],[f[0]+t,f[1]-t],[h[0]-n,h[1]-n],[h[0]+t,h[1]+t]],e),x={main:y([d,f,m,h],e),top:g,bot:_,left:v,right:b};return[new p(s,c,l+t*2,u+t*2),x]}get boundsT(){let e=this.bounds,t=s(c(),e.x,e.y);if(o(t,t,this._transform),this._hasRotation){let n=Math.max(e.width,e.height);return new p(t[0],t[1],n,n)}return new p(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,n=1/0,r=0,i=0;for(let a of e)t=Math.min(t,a.offsets.topLeft[0]),n=Math.min(n,a.offsets.topLeft[1]),r=Math.max(r,a.offsets.bottomRight[0]),i=Math.max(i,a.offsets.bottomRight[1]);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;return new p(s,c,a,o)}_createGlyphTransform(e,t){let n=m*t.angle,o=a(),l=c();return r(o,o,s(l,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?i(o,o,n):(r(o,o,s(l,e.x,e.y)),i(o,o,n),r(o,o,s(l,-e.x,-e.y))),o}}class x{constructor(e,t,n,r,i,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,n)),this.end=Math.max(0,Math.max(t,n)),this.end<e.length&&(this.glyphWidthEnd=e[this.end].rect.width),this.width=r,this.yMin=i,this.yMax=a}}const S=e=>e===10,C=e=>e===32;function w(e,t,n){let r=[],i=1/n.scale,a=n.maxLineWidth*i,o=e.length,s=0,c=0,l=0,u=s,d=u,f=0,p=1/0,m=0;for(;s!==o;){let{code:t,rect:n,shaping:i}=e[s],o=Math.abs(n.top);if(!S(t)&&!C(t)&&(p=Math.min(p,o),m=Math.max(m,o+n.height)),S(t))s!==0&&(r.push(new x(e,u,s-1,c,p===1/0?0:p,m)),p=1/0,m=0),c=0,u=s+1,d=s+1,l=0;else if(C(t))d=s+1,l=0,f=i.xAdvance,c+=i.xAdvance;else if(c>a){if(d!==u){let t=d-2;c-=f,r.push(new x(e,u,t,c-l,p,m)),p=1/0,m=0,u=d,c=l}else r.push(new x(e,u,s-1,c,p,m)),p=1/0,m=0,u=s,d=s,c=0;c+=i.xAdvance,l+=i.xAdvance}else c+=i.xAdvance,l+=i.xAdvance;s+=1}let h=new x(e,u,s-1,c,p,m);return h.start>=0&&h.end<e.length&&r.push(h),r}function T(e,t){let n=0;for(let t=0;t<e.length;t++){let{width:r}=e[t];n=Math.max(r,n)}let r=t.decoration===`underline`?4:0,i=e[0].yMin;return{x:0,y:i,height:e[e.length-1].yMax+t.lineHeight*(e.length-1)+r-i,width:n}}function E(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].code)&&!S(e[i+1].code)&&r++;return r}function D(e,t){let n=t.scale,r=[],i=e.sdfPadding,{faceInfo:a,glyphs:o,isRightToLeft:s}=e,c=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,d=w(o,!1,t),f=d.length?T(d,t):{y:0,height:0,width:0},p=c?s?1:-1:l(t.horizontalAlignment),m=u(t.verticalAlignment),g=+(m===2),_=g?0:m-1,v=a?.baseline??22,y=d.length>1,x=g?y?-f.y-f.height:-v:-f.y+_*(f.height/2);for(let a=0;a<d.length;a++){let{start:s,end:l,width:u}=d[a],m=c&&a<d.length-1?E(o,s,l):0,g=m>0?(f.width-u)/m:0,_=g>0?f.width:u,v=(p+1)*-1*(_/2)-i,y=(e.isRightToLeft?d.length-1-a:a)*t.lineHeight+x-i;d[a].startX=v,d[a].startY=y;for(let e=s;e<=l;e++){let t=o[e];if(S(t.code))continue;let i=h.fromGlyph(v,y,t,n);v+=t.shaping.xAdvance,g>0&&C(t.code)&&(v+=g),r.push(i)}}return new b(r,d,t,a)}function O(e,t){let n=t.scale,{faceInfo:r,glyphs:i}=e,a=i.reduce((e,t)=>Math.max(e,t.rect.height),0),o=i.filter(e=>!S(e.code)&&e.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.rect.width/2,-a,e,n));return new b(o,[],t,r)}function k(e,t){return e.type===`glyphs`?D(e,t):j(e,t)}function A(e,t){return e.type===`glyphs`?O(e,t):M(e,t)}function j(e,t){let n=N(e,t),r=P(n,t),i=r.length?I(r):{width:0},a=[],o=t.decoration===`underline`?`none`:t.decoration,s=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,c=s?-1:l(t.horizontalAlignment),d=u(t.verticalAlignment),f=d===2,p=r.length?r[0].yMin:0,m=r.length?L(r[r.length-1]):0,g=m-p,_=f?r.length>1?-m:-(r[0]?.baseline??0):d===1?-p:d===-1?-m:-(p+g/2);for(let e=0;e<r.length;e++){let t=r[e],o=s&&e<r.length-1?R(n,t.start,t.end):0,l=o>0?(i.width-t.width)/o:0,u=l>0?i.width:t.width,d=(c+1)*-1*(u/2),f=t.startY+_,p=null;t.startX=d,t.startY=f;for(let e=t.start;e<=t.end;e++){let r=n[e],{glyph:i,scale:o,fontSize:s}=r,c=d;if(S(i.code)){p=z(a,p,f,t.baseline);continue}r.decoration===`underline`?(p&&p.underlineOffset!==r.underlineOffset||p&&!B(p.color,r.color))&&(p=z(a,p,f,t.baseline)):p=z(a,p,f,t.baseline);let u=f+t.baseline-r.baseline;a.push(h.fromGlyph(d/o,u/o,i,o,{fontSize:s,color:r.color})),d+=r.xAdvance,r.decoration===`underline`&&(p??={startX:c,endX:d,glyphWidthEnd:i.rect.width*o,textureBinding:i.mosaicItem.textureBinding,underlineOffset:r.underlineOffset,color:r.color},p.endX=d,p.glyphWidthEnd=i.rect.width*o,p.textureBinding=p.textureBinding??i.mosaicItem.textureBinding),l>0&&C(i.code)&&(d+=l,p&&(p.endX=d))}z(a,p,f,t.baseline)}return new b(a,r,{...t,decoration:o})}function M(e,t){let n=N(e,t),r=n.reduce((e,t)=>Math.max(e,t.glyph.rect.height*t.scale),0),i=n.filter(e=>!S(e.glyph.code)&&e.glyph.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.glyph.rect.width/2,-r/e.scale,e.glyph,e.scale,{fontSize:e.fontSize,color:e.color}));return new b(i,[],t)}function N(t,n){let r=n.lineHeightRatio??1,i=[];for(let n of t.runs){let t=e(n.fontSize),a=t/n.glyphs.sdfSize,o=d/24*t*r,s=(n.glyphs.faceInfo?.baseline??22)*a,c=(n.glyphs.faceInfo?.midline??16)*a,l=4*a+_(n.decoration),u=1+(n.characterSpacing??0);for(let e of n.glyphs.glyphs){let r=e.shaping.xAdvance*a,d=Math.abs(e.rect.top)*a,f=d+e.rect.height*a;i.push({glyph:e,scale:a,fontSize:t,decoration:n.decoration,underlineOffset:l,color:n.color,xAdvance:!S(e.code)&&!C(e.code)?r*u:r,top:d,bottom:f,lineHeight:o,baseline:s,midline:c})}}return i}function P(e,t){let n=[],r=t.maxLineWidth,i=0,a=0,o=0,s=0,c=0,l=0;for(;i<e.length;){let t=e[i],{glyph:u}=t;if(S(u.code))i!==0&&n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),a=0,s=i+1,c=s,o=0,l=0;else if(C(u.code))c=i+1,o=0,l=t.xAdvance,a+=t.xAdvance;else if(a>r){if(c!==s){let t=c-2;a-=l,n.push({width:a-o,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=c,a=o}else n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=i,c=i,a=0;a+=t.xAdvance,o+=t.xAdvance}else a+=t.xAdvance,o+=t.xAdvance;i++}if(s<e.length){let t=e.length-1;n.push({width:a,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1})}return F(e,n)}function F(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=0,a=1/0,o=0,s=0;for(let t=r.start;t<=r.end;t++){let n=e[t];n.decoration===`underline`&&(s=Math.max(s,n.underlineOffset)),!(S(n.glyph.code)||C(n.glyph.code))&&(i=Math.max(i,n.baseline),o=Math.max(o,n.lineHeight))}let c=1/0,l=-1/0;for(let t=r.start;t<=r.end;t++){let n=e[t];S(n.glyph.code)||C(n.glyph.code)||(c=Math.min(c,i-n.baseline+n.top),l=Math.max(l,i-n.baseline+n.bottom),a=Math.min(a,i-n.baseline+n.midline))}s>0&&(l=Math.max(l,i+s)),r.baseline=i,r.midline=a===1/0?i:a,r.lineHeight=Math.max(o,l),r.yMin=c===1/0?0:c,r.yMax=l===-1/0?0:l,r.startY=n>0?t[n-1].startY+t[n-1].lineHeight:0}return t}function I(e){let t=0;for(let n of e)t=Math.max(n.width+n.glyphWidthEnd,t);let n=e[0].yMin,r=e[e.length-1];return{x:0,y:n,height:L(r)-n,width:t}}function L(e){return e.startY+e.lineHeight}function R(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].glyph.code)&&!S(e[i+1].glyph.code)&&r++;return r}function z(e,t,n,r){return t&&e.push(h.fromGlyph(t.startX,n+r+t.underlineOffset,g(t.endX-t.startX+t.glyphWidthEnd,t.textureBinding),1,{color:t.color})),null}function B(e,t){return e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}export{h as ShapedGlyph,b as ShapingInfo,D as shapeGlyphs,O as shapeGlyphsForMultipoint,j as shapeRichText,M as shapeRichTextForMultipoint,k as shapeTextResource,A as shapeTextResourceForMultipoint};
2
+ import{pt2px as e}from"../../../../../../core/screenUtils.js";import{fromRotation as t,multiply as n,translate as r,rotate as i}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as s}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as l,getYAnchorDirection as u}from"../../alignmentUtils.js";import{magicLabelLineHeight as d}from"../../definitions.js";import f from"../../Rect.js";import p from"../../collisions/BoundingBox.js";const m=Math.PI/180;class h{static fromGlyph(e,t,n,r,i){let{mosaicItem:a,rect:o,shaping:s,code:c}=n,l=a.rect;return new h({width:c===0?o.width:l.width*r,height:c===0?o.height:l.height*r,x:r*(e+s.xOffset+o.left),y:r*(t+s.yOffset-o.top),textureBinding:a.textureBinding,texcoords:{topLeft:[l.x,l.y],topRight:[l.x+l.width,l.y],bottomLeft:[l.x,l.y+l.height],bottomRight:[l.x+l.width,l.y+l.height]},fontSize:i?.fontSize,color:i?.color})}constructor(e){this._rotationT=a(),this._transform=a(),this._angle=0,this._bounds=null,this.width=e.width,this.height=e.height,this.x=e.x,this.y=e.y,this.textureBinding=e.textureBinding,this.texcoords=e.texcoords,this.fontSize=e.fontSize,this.color=e.color}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){let{x:e,y:r,width:i,height:s}=this,c=t(a(),-this.angle),l=n(a(),c,this._transform);this._offsets={topLeft:o([0,0],[e,r],l),topRight:o([0,0],[e+i,r],l),bottomLeft:o([0,0],[e,r+s],l),bottomRight:o([0,0],[e+i,r+s],l)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){let e=this.offsets,t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,o]of[e.topLeft,e.topRight,e.bottomLeft,e.bottomRight])t=Math.min(t,a),n=Math.min(n,o),r=Math.max(r,a),i=Math.max(i,o);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;this._bounds=new p(s,c,a,o)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}}const g=(e,t)=>({code:0,mosaicItem:{rect:new f(0,0,11,8),sdf:!0,page:0,textureBinding:t},rect:{height:4,width:e,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function _(t){return t===`underline`?e(2):0}function v(e,t,n,r,i){switch(e){case`underline`:return(n??i?.baseline??22)+4+_(e)/t;case`line-through`:return r??i?.midline??16;default:return 0}}function y(e,t){return e.forEach(e=>o(e,e,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}class b{constructor(e,t,n,r){this._rotation=0,this._decorate(e,t,n,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=n.angle!==0,this._transform=this._createGlyphTransform(this.bounds,n),this._borderLineSizePx=n.borderLineSizePx,(n.borderLineSizePx||n.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(let t of e)t.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;let r=this._transform,i=t(a(),e);n(r,i,r);for(let e of this.glyphs)e.setTransform(this._transform)}_decorate(e,t,n,r){if(!n.decoration||n.decoration===`none`||!e.length)return;let i=n.scale,a=e[0].textureBinding;for(let o of t){let t=o.scale??i,s=v(n.decoration,t,o.baseline,o.midline,r),c=o.startX*t,l=o.startY*t,u=(o.width+o.glyphWidthEnd)*t;e.push(h.fromGlyph(c,l+s*t,g(u,a),1))}}shapeBackground(e){let t=(1.5+(this._borderLineSizePx||0))/2,n=this._borderLineSizePx?t:0,{xmin:r,ymin:i,xmax:a,ymax:o,x:s,y:c,width:l,height:u}=this.bounds,d=[r-8,i-8],f=[a+8,i-8],m=[r-8,o+8],h=[a+8,o+8],g=y([[d[0]-t,d[1]-t],[f[0]+t,f[1]-t],[d[0]+n,d[1]+n],[f[0]-n,f[1]+n]],e),_=y([[m[0]+n,m[1]-n],[h[0]-n,h[1]-n],[m[0]-t,m[1]+t],[h[0]+t,h[1]+t]],e),v=y([[d[0]-t,d[1]-t],[d[0]+n,d[1]+n],[m[0]-t,m[1]+t],[m[0]+n,m[1]-n]],e),b=y([[f[0]-n,f[1]+n],[f[0]+t,f[1]-t],[h[0]-n,h[1]-n],[h[0]+t,h[1]+t]],e),x={main:y([d,f,m,h],e),top:g,bot:_,left:v,right:b};return[new p(s,c,l+t*2,u+t*2),x]}get boundsT(){let e=this.bounds,t=s(c(),e.x,e.y);if(o(t,t,this._transform),this._hasRotation){let n=Math.max(e.width,e.height);return new p(t[0],t[1],n,n)}return new p(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,n=1/0,r=0,i=0;for(let a of e)t=Math.min(t,a.offsets.topLeft[0]),n=Math.min(n,a.offsets.topLeft[1]),r=Math.max(r,a.offsets.bottomRight[0]),i=Math.max(i,a.offsets.bottomRight[1]);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;return new p(s,c,a,o)}_createGlyphTransform(e,t){let n=m*t.angle,o=a(),l=c();return r(o,o,s(l,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?i(o,o,n):(r(o,o,s(l,e.x,e.y)),i(o,o,n),r(o,o,s(l,-e.x,-e.y))),o}}class x{constructor(e,t,n,r,i,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,n)),this.end=Math.max(0,Math.max(t,n)),this.end<e.length&&(this.glyphWidthEnd=e[this.end].rect.width),this.width=r,this.yMin=i,this.yMax=a}}const S=e=>e===10,C=e=>e===32;function w(e,t,n){let r=[],i=1/n.scale,a=n.maxLineWidth*i,o=e.length,s=0,c=0,l=0,u=s,d=u,f=0,p=1/0,m=0;for(;s!==o;){let{code:t,rect:n,shaping:i}=e[s],o=Math.abs(n.top);if(!S(t)&&!C(t)&&(p=Math.min(p,o),m=Math.max(m,o+n.height)),S(t))s!==0&&(r.push(new x(e,u,s-1,c,p===1/0?0:p,m)),p=1/0,m=0),c=0,u=s+1,d=s+1,l=0;else if(C(t))d=s+1,l=0,f=i.xAdvance,c+=i.xAdvance;else if(c>a){if(d!==u){let t=d-2;c-=f,r.push(new x(e,u,t,c-l,p,m)),p=1/0,m=0,u=d,c=l}else r.push(new x(e,u,s-1,c,p,m)),p=1/0,m=0,u=s,d=s,c=0;c+=i.xAdvance,l+=i.xAdvance}else c+=i.xAdvance,l+=i.xAdvance;s+=1}let h=new x(e,u,s-1,c,p,m);return h.start>=0&&h.end<e.length&&r.push(h),r}function T(e,t){let n=0;for(let t=0;t<e.length;t++){let{width:r}=e[t];n=Math.max(r,n)}let r=t.decoration===`underline`?4:0,i=e[0].yMin;return{x:0,y:i,height:e[e.length-1].yMax+t.lineHeight*(e.length-1)+r-i,width:n}}function E(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].code)&&!S(e[i+1].code)&&r++;return r}function D(e,t){let n=t.scale,r=[],i=e.sdfPadding,{faceInfo:a,glyphs:o,isRightToLeft:s}=e,c=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,d=w(o,!1,t),f=d.length?T(d,t):{y:0,height:0,width:0},p=c?s?1:-1:l(t.horizontalAlignment),m=u(t.verticalAlignment),g=+(m===2),_=g?0:m-1,v=a?.baseline??22,y=d.length>1,x=g?y?-f.y-f.height:-v:-f.y+_*(f.height/2);for(let a=0;a<d.length;a++){let{start:s,end:l,width:u}=d[a],m=c&&a<d.length-1?E(o,s,l):0,g=m>0?(f.width-u)/m:0,_=g>0?f.width:u,v=(p+1)*-1*(_/2)-i,y=(e.isRightToLeft?d.length-1-a:a)*t.lineHeight+x-i;d[a].startX=v,d[a].startY=y;for(let e=s;e<=l;e++){let t=o[e];if(S(t.code))continue;let i=h.fromGlyph(v,y,t,n);v+=t.shaping.xAdvance,g>0&&C(t.code)&&(v+=g),r.push(i)}}return new b(r,d,t,a)}function O(e,t){let n=t.scale,{faceInfo:r,glyphs:i}=e,a=i.reduce((e,t)=>Math.max(e,t.rect.height),0),o=i.filter(e=>!S(e.code)&&e.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.rect.width/2,-a,e,n));return new b(o,[],t,r)}function k(e,t){return e.type===`glyphs`?D(e,t):j(e,t)}function A(e,t){return e.type===`glyphs`?O(e,t):M(e,t)}function j(e,t){let n=N(e,t),r=P(n,t),i=r.length?I(r):{width:0},a=[],o=t.decoration===`underline`?`none`:t.decoration,s=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,c=s?-1:l(t.horizontalAlignment),d=u(t.verticalAlignment),f=d===2,p=r.length?r[0].yMin:0,m=r.length?L(r[r.length-1]):0,g=m-p,_=f?r.length>1?-m:-(r[0]?.baseline??0):d===1?-p:d===-1?-m:-(p+g/2);for(let e=0;e<r.length;e++){let t=r[e],o=s&&e<r.length-1?R(n,t.start,t.end):0,l=o>0?(i.width-t.width)/o:0,u=l>0?i.width:t.width,d=(c+1)*-1*(u/2),f=t.startY+_,p=null;t.startX=d,t.startY=f;for(let e=t.start;e<=t.end;e++){let r=n[e],{glyph:i,scale:o,fontSize:s}=r,c=d;if(S(i.code)){p=z(a,p,f,t.baseline);continue}r.decoration===`underline`?(p&&p.underlineOffset!==r.underlineOffset||p&&!B(p.color,r.color))&&(p=z(a,p,f,t.baseline)):p=z(a,p,f,t.baseline);let u=f+t.baseline-r.baseline;a.push(h.fromGlyph(d/o,u/o,i,o,{fontSize:s,color:r.color})),d+=r.xAdvance,r.decoration===`underline`&&(p??={startX:c,endX:d,glyphWidthEnd:i.rect.width*o,textureBinding:i.mosaicItem.textureBinding,underlineOffset:r.underlineOffset,color:r.color},p.endX=d,p.glyphWidthEnd=i.rect.width*o,p.textureBinding=p.textureBinding??i.mosaicItem.textureBinding),l>0&&C(i.code)&&(d+=l,p&&(p.endX=d))}z(a,p,f,t.baseline)}return new b(a,r,{...t,decoration:o})}function M(e,t){let n=N(e,t),r=n.reduce((e,t)=>Math.max(e,t.glyph.rect.height*t.scale),0),i=n.filter(e=>!S(e.glyph.code)&&e.glyph.mosaicItem.textureBinding).map(e=>h.fromGlyph(-e.glyph.rect.width/2,-r/e.scale,e.glyph,e.scale,{fontSize:e.fontSize,color:e.color}));return new b(i,[],t)}function N(t,n){let r=n.lineHeightRatio??1,i=[];for(let n of t.runs){let t=e(n.fontSize),a=t/n.glyphs.sdfSize,o=d/24*t*r,s=(n.glyphs.faceInfo?.baseline??22)*a,c=(n.glyphs.faceInfo?.midline??16)*a,l=4*a+_(n.decoration),u=1+(n.characterSpacing??0);for(let e of n.glyphs.glyphs){let r=e.shaping.xAdvance*a,d=Math.abs(e.rect.top)*a,f=d+e.rect.height*a;i.push({glyph:e,scale:a,fontSize:t,decoration:n.decoration,underlineOffset:l,color:n.color,xAdvance:!S(e.code)&&!C(e.code)?r*u:r,top:d,bottom:f,lineHeight:o,baseline:s,midline:c})}}return i}function P(e,t){let n=[],r=t.maxLineWidth,i=0,a=0,o=0,s=0,c=0,l=0;for(;i<e.length;){let t=e[i],{glyph:u}=t;if(S(u.code))i!==0&&n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),a=0,s=i+1,c=s,o=0,l=0;else if(C(u.code))c=i+1,o=0,l=t.xAdvance,a+=t.xAdvance;else if(a>r){if(c!==s){let t=c-2;a-=l,n.push({width:a-o,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=c,a=o}else n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=i,c=i,a=0;a+=t.xAdvance,o+=t.xAdvance}else a+=t.xAdvance,o+=t.xAdvance;i++}if(s<e.length){let t=e.length-1;n.push({width:a,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1})}return F(e,n)}function F(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=0,a=1/0,o=0,s=0;for(let t=r.start;t<=r.end;t++){let n=e[t];n.decoration===`underline`&&(s=Math.max(s,n.underlineOffset)),S(n.glyph.code)||C(n.glyph.code)||(i=Math.max(i,n.baseline),o=Math.max(o,n.lineHeight))}let c=1/0,l=-1/0;for(let t=r.start;t<=r.end;t++){let n=e[t];S(n.glyph.code)||C(n.glyph.code)||(c=Math.min(c,i-n.baseline+n.top),l=Math.max(l,i-n.baseline+n.bottom),a=Math.min(a,i-n.baseline+n.midline))}s>0&&(l=Math.max(l,i+s)),r.baseline=i,r.midline=a===1/0?i:a,r.lineHeight=Math.max(o,l),r.yMin=c===1/0?0:c,r.yMax=l===-1/0?0:l,r.startY=n>0?t[n-1].startY+t[n-1].lineHeight:0}return t}function I(e){let t=0;for(let n of e)t=Math.max(n.width+n.glyphWidthEnd,t);let n=e[0].yMin,r=e[e.length-1];return{x:0,y:n,height:L(r)-n,width:t}}function L(e){return e.startY+e.lineHeight}function R(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].glyph.code)&&!S(e[i+1].glyph.code)&&r++;return r}function z(e,t,n,r){return t&&e.push(h.fromGlyph(t.startX,n+r+t.underlineOffset,g(t.endX-t.startX+t.glyphWidthEnd,t.textureBinding),1,{color:t.color})),null}function B(e,t){return e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}export{h as ShapedGlyph,b as ShapingInfo,D as shapeGlyphs,O as shapeGlyphsForMultipoint,j as shapeRichText,M as shapeRichTextForMultipoint,k as shapeTextResource,A as shapeTextResourceForMultipoint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{pt2px as e,onePointInPixels as t}from"../../../../../../../core/screenUtils.js";import{identity as n,translate as r,rotate as i}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as a}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{GeometryCursor as s}from"../../../../../../../geometry/GeometryCursor.js";import{clipCursorToTileExtent as c}from"../../../../../../../symbols/cim/CIMEffects.js";import{maxTileCoordValue as l}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as u}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{packByteSqrt as d,processColorInput as f,getMinMaxZoom as p,getBitMask as m}from"../fill/meshWriterUtils.js";import{ComputedMarkerParams as h}from"./ComputedMarkerParams.js";import{MarkerConstants as g}from"./markerConstants.js";import{MeshWriter as _}from"../mesh/MeshWriter.js";import{DataType as v}from"../../../../../../webgl/enums.js";const y=128/Math.PI;function b(e,t){return e%=t,Math.abs(e>=0?e:e+t)}function x(e){return b(e*y,256)}function S(e,t,o,s,c=!1){let l=a(),u=c?1:-1;return n(l),(t||o)&&r(l,l,[t,-o]),s&&i(l,l,u*.017453292519944444*-s),l}const C={createComputedParams:e=>h.from(e),optionalAttributes:{zoomRange:{type:v.HALF_FLOAT,count:2,pack:({scaleInfo:e},{tileInfo:t})=>p(e,t)}},attributes:{pos:{type:v.SHORT,count:2,pack:`position`,packPrecisionFactor:10},id:{type:v.UNSIGNED_BYTE,count:3,pack:`id`},bitset:{type:v.UNSIGNED_BYTE,count:1,pack:({sprite:e,alignment:t,scaleSymbolsProportionally:n,overrideOutlineColor:r,colorLocked:i})=>{let a=0;return e.sdf&&(a|=m(g.bitset.isSDF)),t===1&&(a|=m(g.bitset.isMapAligned)),n&&(a|=m(g.bitset.scaleSymbolsProportionally)),r&&(a|=m(g.bitset.overrideOutlineColor)),i&&(a|=m(g.bitset.colorLocked)),a}},offset:{type:v.HALF_FLOAT,count:2,packAlternating:{count:4,pack:({angle:e,computedWidth:t,computedHeight:n,anchorX:r,anchorY:i,offsetX:a,offsetY:s,rotateClockwise:c})=>{let l=S(0,a,s,-e,c),u=-(.5+r)*t,d=-(.5-i)*n,f=[u,d],p=[u+t,d],m=[u,d+n],h=[u+t,d+n];return o(f,f,l),o(p,p,l),o(m,m,l),o(h,h,l),[f,p,m,h]}}},textureUV:{type:v.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:e,texXmin:t,texYmax:n,texYmin:r})=>[[t,r],[e,r],[t,n],[e,n]]}},color:{type:v.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>f(e)},outlineColor:{type:v.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>f(e)},sizing:{type:v.UNSIGNED_BYTE,count:4,pack:({rawWidth:e,rawHeight:t,outlineSize:n,referenceSize:r})=>[d(Math.max(e,t),128),d(n,128),d(r,128),0]},placementAngle:{type:v.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:e})=>x(e)},sdfDecodeCoeff:{type:v.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:e})=>e}}};class w extends _{constructor(){super(...arguments),this.calloutRecordsUseLabelPhase=!1,this.vertexSpec=C}get _requiresPerFeaturePacking(){return this._getPointSymbolCalloutMarkerEffect()!=null}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}getLocalCalloutReferenceInfo(){let e=this.evaluatedMeshParams.boundsInfo;if(!e)return;let t=e.size/2;return{anchor:{x:0,y:0},bodyBounds:{xmin:e.offsetX-t,ymin:e.offsetY-t,xmax:e.offsetX+t,ymax:e.offsetY+t},bodyBoundsUseReferenceScale:!0}}getCalloutCollisionBounds(e){if(this._getPointSymbolCalloutMarkerEffect())return this.evaluatedMeshParams.getPointSymbolCalloutBounds(e.bodyBounds)}_prepareEvaluatedMeshParams(t,n,r,i){let a=this._getPointSymbolCalloutMarkerEffect();if(!a)return;let o=i?.effect?.referenceBounds;if(!o){t.resetSizeOverride();return}let s=o.xmax-o.xmin,c=o.ymax-o.ymin;t.applyPointSymbolCalloutBackgroundScale(a.backgroundScale,s,c,e(a.gap??0),a.contentWidthRatio,a.contentHeightRatio,a.contentRequiresRadialFit)}_write(e,{target:t,effect:n,scaleFactor:r}){let i=n?.geometry,a=this.evaluatedMeshParams.sprite?.textureBinding,o=t.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,a);let s=this.evaluatedMeshParams.minPixelBuffer,u=Math.max(this.evaluatedMeshParams.computedWidth,s),d=Math.max(this.evaluatedMeshParams.computedHeight,s),f=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,p=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,m=this.evaluatedMeshParams.offsetX+f,h=-this.evaluatedMeshParams.offsetY+p;if(this.evaluatedMeshParams.placement!=null){let n=null;if(i!=null){let e=Math.max(this.evaluatedMeshParams.computedWidth,this.evaluatedMeshParams.computedHeight)*(r??1);if(n=c(i,2*e,!1),n===null)return}this._writePlacedMarkers(e,t,n,u,d)}else if(i?.nextPath()){i.nextPoint();let t=i.x,n=i.y;e.recordBounds(t+m,n+h,u,d),this._writeQuad(e,o,t,n)}else if(t.geometryType===`esriGeometryPolygon`){let n=t.readCentroidForDisplay();if(!n)return;let[r,i]=n.coords;e.recordBounds(r+m,i+h,u,d),this._writeQuad(e,o,r,i)}else if(t.geometryType===`esriGeometryPoint`){let n=t.readXForDisplay(),r=t.readYForDisplay();e.recordBounds(n+m,r+h,u,d),this._writeQuad(e,o,n,r)}else t.readGeometryForDisplay()?.forEachVertex((t,n)=>{e.recordBounds(t+m,n+h,u,d),!(Math.abs(t)>l||Math.abs(n)>l)&&this._writeQuad(e,o,t,n)});e.recordEnd()}_writePlacedMarkers(e,n,r,i,a){let o=r??s.fromFeatureSetReaderCIM(n);if(!o)return;let c=u.getPlacement(o,-1,this.evaluatedMeshParams.placement,t,e.id);if(!c)return;let d=n.getDisplayId(),f=c.next(),p=this.evaluatedMeshParams.offsetX,m=-this.evaluatedMeshParams.offsetY;for(;f!=null;){let t=f.tx,n=-f.ty;if(Math.abs(t)>l||Math.abs(n)>l){f=c.next();continue}let r=-f.getAngle();e.recordBounds(t+p,n+m,i,a),this._writeQuad(e,d,t,n,r),f=c.next()}}_writeQuad(e,t,n,r,i){let a=e.vertexCount(),o=i==null?null:{placementAngle:i};this._writeVertex(e,t,n,r,o),e.indexWrite(a+0),e.indexWrite(a+1),e.indexWrite(a+2),e.indexWrite(a+1),e.indexWrite(a+3),e.indexWrite(a+2)}_getPointSymbolCalloutMarkerEffect(){for(let{effect:e}of this.effectInfos??[])if(e.type===`CIMPointSymbolCallout`&&e.part===`marker`)return e}}export{w as MarkerMeshWriter,C as MarkerVertexSpec};
2
+ import{pt2px as e,onePointInPixels as t}from"../../../../../../../core/screenUtils.js";import{identity as n,translate as r,rotate as i}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as a}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{GeometryCursor as s}from"../../../../../../../geometry/GeometryCursor.js";import{clipCursorToTileExtent as c}from"../../../../../../../symbols/cim/CIMEffects.js";import{maxTileCoordValue as l}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as u}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{packByteSqrt as d,processColorInput as f,getMinMaxZoom as p,getBitMask as m}from"../fill/meshWriterUtils.js";import{ComputedMarkerParams as h}from"./ComputedMarkerParams.js";import{MarkerConstants as g}from"./markerConstants.js";import{MeshWriter as _}from"../mesh/MeshWriter.js";import{DataType as v}from"../../../../../../webgl/enums.js";const y=128/Math.PI;function b(e,t){return e%=t,Math.abs(e>=0?e:e+t)}function x(e){return b(e*y,256)}function S(e,t,o,s,c=!1){let l=a(),u=c?1:-1;return n(l),(t||o)&&r(l,l,[t,-o]),s&&i(l,l,u*.017453292519944444*-s),l}const C={createComputedParams:e=>h.from(e),optionalAttributes:{zoomRange:{type:v.HALF_FLOAT,count:2,pack:({scaleInfo:e},{tileInfo:t})=>p(e,t)}},attributes:{pos:{type:v.SHORT,count:2,pack:`position`,packPrecisionFactor:10},id:{type:v.UNSIGNED_BYTE,count:3,pack:`id`},bitset:{type:v.UNSIGNED_BYTE,count:1,pack:({sprite:e,alignment:t,scaleSymbolsProportionally:n,overrideOutlineColor:r,colorLocked:i})=>{let a=0;return e.sdf&&(a|=m(g.bitset.isSDF)),t===1&&(a|=m(g.bitset.isMapAligned)),n&&(a|=m(g.bitset.scaleSymbolsProportionally)),r&&(a|=m(g.bitset.overrideOutlineColor)),i&&(a|=m(g.bitset.colorLocked)),a}},offset:{type:v.HALF_FLOAT,count:2,packAlternating:{count:4,pack:({angle:e,computedWidth:t,computedHeight:n,anchorX:r,anchorY:i,offsetX:a,offsetY:s,rotateClockwise:c})=>{let l=S(0,a,s,-e,c),u=-(.5+r)*t,d=-(.5-i)*n,f=[u,d],p=[u+t,d],m=[u,d+n],h=[u+t,d+n];return o(f,f,l),o(p,p,l),o(m,m,l),o(h,h,l),[f,p,m,h]}}},textureUV:{type:v.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:e,texXmin:t,texYmax:n,texYmin:r})=>[[t,r],[e,r],[t,n],[e,n]]}},color:{type:v.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>f(e)},outlineColor:{type:v.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>f(e)},sizing:{type:v.UNSIGNED_BYTE,count:4,pack:({rawWidth:e,rawHeight:t,outlineSize:n,referenceSize:r})=>[d(Math.max(e,t),128),d(n,128),d(r,128),0]},placementAngle:{type:v.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:e})=>x(e)},sdfDecodeCoeff:{type:v.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:e})=>e}}};class w extends _{constructor(){super(...arguments),this.calloutRecordsUseLabelPhase=!1,this.vertexSpec=C}get _requiresPerFeaturePacking(){return this._getPointSymbolCalloutMarkerEffect()!=null}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}getLocalCalloutReferenceInfo(){let e=this.evaluatedMeshParams.boundsInfo;if(!e)return;let t=e.size/2;return{anchor:{x:0,y:0},bodyBounds:{xmin:e.offsetX-t,ymin:e.offsetY-t,xmax:e.offsetX+t,ymax:e.offsetY+t},bodyBoundsUseReferenceScale:!0}}getCalloutCollisionBounds(e){if(this._getPointSymbolCalloutMarkerEffect())return this.evaluatedMeshParams.getPointSymbolCalloutBounds(e.bodyBounds)}_prepareEvaluatedMeshParams(t,n,r,i){let a=this._getPointSymbolCalloutMarkerEffect();if(!a)return;let o=i?.effect?.referenceBounds;if(!o){t.resetSizeOverride();return}let s=o.xmax-o.xmin,c=o.ymax-o.ymin;t.applyPointSymbolCalloutBackgroundScale(a.backgroundScale,s,c,e(a.gap??0),a.contentWidthRatio,a.contentHeightRatio,a.contentRequiresRadialFit)}_write(e,{target:t,effect:n,scaleFactor:r}){let i=n?.geometry,a=this.evaluatedMeshParams.sprite?.textureBinding,o=t.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,a);let s=this.evaluatedMeshParams.minPixelBuffer,u=Math.max(this.evaluatedMeshParams.computedWidth,s),d=Math.max(this.evaluatedMeshParams.computedHeight,s),f=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,p=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,m=this.evaluatedMeshParams.offsetX+f,h=-this.evaluatedMeshParams.offsetY+p;if(this.evaluatedMeshParams.placement!=null){let n=null;if(i!=null){let e=Math.max(this.evaluatedMeshParams.computedWidth,this.evaluatedMeshParams.computedHeight)*(r??1);if(n=c(i,2*e,!1),n===null)return}this._writePlacedMarkers(e,t,n,u,d)}else if(i?.nextPath()){i.nextPoint();let t=i.x,n=i.y;e.recordBounds(t+m,n+h,u,d),this._writeQuad(e,o,t,n)}else if(t.geometryType===`esriGeometryPolygon`){let n=t.readCentroidForDisplay();if(!n)return;let[r,i]=n.coords;e.recordBounds(r+m,i+h,u,d),this._writeQuad(e,o,r,i)}else if(t.geometryType===`esriGeometryPoint`){let n=t.readXForDisplay(),r=t.readYForDisplay();e.recordBounds(n+m,r+h,u,d),this._writeQuad(e,o,n,r)}else t.readGeometryForDisplay()?.forEachVertex((t,n)=>{e.recordBounds(t+m,n+h,u,d),Math.abs(t)>l||Math.abs(n)>l||this._writeQuad(e,o,t,n)});e.recordEnd()}_writePlacedMarkers(e,n,r,i,a){let o=r??s.fromFeatureSetReaderCIM(n);if(!o)return;let c=u.getPlacement(o,-1,this.evaluatedMeshParams.placement,t,e.id);if(!c)return;let d=n.getDisplayId(),f=c.next(),p=this.evaluatedMeshParams.offsetX,m=-this.evaluatedMeshParams.offsetY;for(;f!=null;){let t=f.tx,n=-f.ty;if(Math.abs(t)>l||Math.abs(n)>l){f=c.next();continue}let r=-f.getAngle();e.recordBounds(t+p,n+m,i,a),this._writeQuad(e,d,t,n,r),f=c.next()}}_writeQuad(e,t,n,r,i){let a=e.vertexCount(),o=i==null?null:{placementAngle:i};this._writeVertex(e,t,n,r,o),e.indexWrite(a+0),e.indexWrite(a+1),e.indexWrite(a+2),e.indexWrite(a+1),e.indexWrite(a+3),e.indexWrite(a+2)}_getPointSymbolCalloutMarkerEffect(){for(let{effect:e}of this.effectInfos??[])if(e.type===`CIMPointSymbolCallout`&&e.part===`marker`)return e}}export{w as MarkerMeshWriter,C as MarkerVertexSpec};