@arcgis/core 4.27.0-next.20230317 → 4.27.0-next.20230321

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 (300) hide show
  1. package/TimeExtent.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/05e47e78e258dd5ab6ea.js +1 -0
  4. package/assets/esri/core/workers/chunks/{b661d2c785333429aad3.js → 0b005e3502dd97562701.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{8812629e07e5bf46caa7.js → 1d2271a36641f6834401.js} +1 -1
  6. package/assets/esri/core/workers/chunks/1d65a2bc91774fdbd690.js +1 -0
  7. package/assets/esri/core/workers/chunks/273a894ab44b76ee4488.js +1 -0
  8. package/assets/esri/core/workers/chunks/29ee4f14602caf6967e4.js +1 -0
  9. package/assets/esri/core/workers/chunks/{56ddde83f40cda0a8a5c.js → 2c0775541cfec9d43acb.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{48a1b8be3c2a59c4c925.js → 32f9b488915a4a8864e5.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{790d62ea3c90ca076095.js → 403c18eaa30673b096fe.js} +1 -1
  12. package/assets/esri/core/workers/chunks/41bbf58417f4085657f4.js +1 -0
  13. package/assets/esri/core/workers/chunks/{c36efbdd0a84fe851bbb.js → 433686dfda9e2ff1f98b.js} +1 -1
  14. package/assets/esri/core/workers/chunks/4be7647605300e07e843.js +1 -0
  15. package/assets/esri/core/workers/chunks/5cc99e9e974fec32b597.js +1 -0
  16. package/assets/esri/core/workers/chunks/6062bc79ebd5047a473a.js +1 -0
  17. package/assets/esri/core/workers/chunks/{57aa75a10fb8bb3fa517.js → 622139ef8f7181e48cd0.js} +1 -1
  18. package/assets/esri/core/workers/chunks/6b14673a4afd6ef81487.js +1 -0
  19. package/assets/esri/core/workers/chunks/70ea44365021b665c213.js +1 -0
  20. package/assets/esri/core/workers/chunks/{7727e6a4338c831f272f.js → 7570ec6a64a88ddc0fdd.js} +1 -1
  21. package/assets/esri/core/workers/chunks/81a6f4b43e047c3395c0.js +1 -0
  22. package/assets/esri/core/workers/chunks/87edeb09a948122fa030.js +1 -0
  23. package/assets/esri/core/workers/chunks/8daa0523d49653cc5861.js +1 -0
  24. package/assets/esri/core/workers/chunks/{3ff3d67f1bc6e2b2f48e.js → 90e12cff7672f3d92ced.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{f150bd21c3b9e098da57.js → 92951b85676df776961f.js} +56 -56
  26. package/assets/esri/core/workers/chunks/983b26414cc46d9c3105.js +1 -0
  27. package/assets/esri/core/workers/chunks/{19355af765993931a7c0.js → 9b196a726c6d175ca60f.js} +1 -1
  28. package/assets/esri/core/workers/chunks/a27951dbe83c63f9d01a.js +1 -0
  29. package/assets/esri/core/workers/chunks/bc002e4dff8859571a7a.js +1 -0
  30. package/assets/esri/core/workers/chunks/bfc2b40f1892970281c6.js +1 -0
  31. package/assets/esri/core/workers/chunks/c162d1e27e779732d494.js +1 -0
  32. package/assets/esri/core/workers/chunks/c5d872adce711ec61ede.js +1 -0
  33. package/assets/esri/core/workers/chunks/c5dd23d11fa91b0f318e.js +1 -0
  34. package/assets/esri/core/workers/chunks/{e97c4beb3a6cf1d91310.js → c6c2f771bca0e303b5c0.js} +1 -1
  35. package/assets/esri/core/workers/chunks/c8f019d13f6b22481f2e.js +1 -0
  36. package/assets/esri/core/workers/chunks/d34dbb49508a95588423.js +1 -0
  37. package/assets/esri/core/workers/chunks/e637e47000f4dc48054d.js +1 -0
  38. package/assets/esri/core/workers/chunks/e7093d27a31345953dca.js +1 -0
  39. package/assets/esri/core/workers/chunks/f1ab86dbbd5b04e2a96c.js +1 -0
  40. package/assets/esri/core/workers/chunks/f85a01429959e60a8713.js +1 -0
  41. package/assets/esri/core/workers/chunks/ff9efa829497557ec26a.js +1 -0
  42. package/assets/esri/themes/base/widgets/_Bookmarks.scss +3 -0
  43. package/assets/esri/themes/base/widgets/_Editor.scss +18 -0
  44. package/assets/esri/themes/base/widgets/_ItemList.scss +13 -33
  45. package/assets/esri/themes/dark/main.css +1 -1
  46. package/assets/esri/themes/light/main.css +1 -1
  47. package/assets/esri/themes/light/view.css +1 -1
  48. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  49. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  50. package/assets/esri/widgets/Slice/t9n/Slice_ar.json +1 -1
  51. package/assets/esri/widgets/Slice/t9n/Slice_bg.json +1 -1
  52. package/assets/esri/widgets/Slice/t9n/Slice_bs.json +1 -1
  53. package/assets/esri/widgets/Slice/t9n/Slice_ca.json +1 -1
  54. package/assets/esri/widgets/Slice/t9n/Slice_cs.json +1 -1
  55. package/assets/esri/widgets/Slice/t9n/Slice_da.json +1 -1
  56. package/assets/esri/widgets/Slice/t9n/Slice_de.json +1 -1
  57. package/assets/esri/widgets/Slice/t9n/Slice_el.json +1 -1
  58. package/assets/esri/widgets/Slice/t9n/Slice_es.json +1 -1
  59. package/assets/esri/widgets/Slice/t9n/Slice_et.json +1 -1
  60. package/assets/esri/widgets/Slice/t9n/Slice_fi.json +1 -1
  61. package/assets/esri/widgets/Slice/t9n/Slice_fr.json +1 -1
  62. package/assets/esri/widgets/Slice/t9n/Slice_he.json +1 -1
  63. package/assets/esri/widgets/Slice/t9n/Slice_hr.json +1 -1
  64. package/assets/esri/widgets/Slice/t9n/Slice_hu.json +1 -1
  65. package/assets/esri/widgets/Slice/t9n/Slice_id.json +1 -1
  66. package/assets/esri/widgets/Slice/t9n/Slice_it.json +1 -1
  67. package/assets/esri/widgets/Slice/t9n/Slice_ja.json +1 -1
  68. package/assets/esri/widgets/Slice/t9n/Slice_ko.json +1 -1
  69. package/assets/esri/widgets/Slice/t9n/Slice_lt.json +1 -1
  70. package/assets/esri/widgets/Slice/t9n/Slice_lv.json +1 -1
  71. package/assets/esri/widgets/Slice/t9n/Slice_nb.json +1 -1
  72. package/assets/esri/widgets/Slice/t9n/Slice_nl.json +1 -1
  73. package/assets/esri/widgets/Slice/t9n/Slice_pl.json +1 -1
  74. package/assets/esri/widgets/Slice/t9n/Slice_pt-BR.json +1 -1
  75. package/assets/esri/widgets/Slice/t9n/Slice_pt-PT.json +1 -1
  76. package/assets/esri/widgets/Slice/t9n/Slice_ro.json +1 -1
  77. package/assets/esri/widgets/Slice/t9n/Slice_ru.json +1 -1
  78. package/assets/esri/widgets/Slice/t9n/Slice_sk.json +1 -1
  79. package/assets/esri/widgets/Slice/t9n/Slice_sl.json +1 -1
  80. package/assets/esri/widgets/Slice/t9n/Slice_sr.json +1 -1
  81. package/assets/esri/widgets/Slice/t9n/Slice_sv.json +1 -1
  82. package/assets/esri/widgets/Slice/t9n/Slice_th.json +1 -1
  83. package/assets/esri/widgets/Slice/t9n/Slice_tr.json +1 -1
  84. package/assets/esri/widgets/Slice/t9n/Slice_uk.json +1 -1
  85. package/assets/esri/widgets/Slice/t9n/Slice_vi.json +1 -1
  86. package/assets/esri/widgets/Slice/t9n/Slice_zh-CN.json +1 -1
  87. package/assets/esri/widgets/Slice/t9n/Slice_zh-HK.json +1 -1
  88. package/assets/esri/widgets/Slice/t9n/Slice_zh-TW.json +1 -1
  89. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ar.json +1 -1
  90. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bg.json +1 -1
  91. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bs.json +1 -1
  92. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ca.json +1 -1
  93. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_cs.json +1 -1
  94. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_da.json +1 -1
  95. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_de.json +1 -1
  96. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_el.json +1 -1
  97. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_es.json +1 -1
  98. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_et.json +1 -1
  99. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fi.json +1 -1
  100. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fr.json +1 -1
  101. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_he.json +1 -1
  102. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hr.json +1 -1
  103. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hu.json +1 -1
  104. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_id.json +1 -1
  105. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_it.json +1 -1
  106. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ja.json +1 -1
  107. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ko.json +1 -1
  108. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lt.json +1 -1
  109. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lv.json +1 -1
  110. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nb.json +1 -1
  111. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nl.json +1 -1
  112. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pl.json +1 -1
  113. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-BR.json +1 -1
  114. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-PT.json +1 -1
  115. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ro.json +1 -1
  116. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ru.json +1 -1
  117. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sk.json +1 -1
  118. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sl.json +1 -1
  119. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sr.json +1 -1
  120. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sv.json +1 -1
  121. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_th.json +1 -1
  122. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_tr.json +1 -1
  123. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_uk.json +1 -1
  124. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_vi.json +1 -1
  125. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-CN.json +1 -1
  126. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-HK.json +1 -1
  127. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-TW.json +1 -1
  128. package/chunks/ColorMaterial.glsl.js +16 -14
  129. package/core/domUtils.js +1 -1
  130. package/core/maybe.js +1 -1
  131. package/core/urlUtils.js +1 -1
  132. package/geohash/GeohashTree.js +1 -1
  133. package/interfaces.d.ts +12 -214
  134. package/layers/SceneLayer.js +1 -1
  135. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  136. package/layers/support/FieldsIndex.js +1 -1
  137. package/layers/support/fieldType.js +1 -1
  138. package/layers/support/fieldUtils.js +1 -1
  139. package/layers/support/rasterFunctionConstants.js +1 -1
  140. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  141. package/layers/support/rasterFunctions/CurvatureFunction.js +5 -0
  142. package/layers/support/rasterFunctions/CurvatureFunctionArguments.js +5 -0
  143. package/layers/support/rasterFunctions/SlopeFunction.js +1 -1
  144. package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
  145. package/layers/support/rasterFunctions/surfaceUtils.js +1 -1
  146. package/package.json +1 -1
  147. package/portal/schemas/definitions.js +1 -1
  148. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  149. package/support/revision.js +1 -1
  150. package/views/2d/engine/imagery/processor/curvatureProcessor.js +5 -0
  151. package/views/2d/engine/imagery/processor/rasterProcessor.js +1 -1
  152. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  153. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  154. package/views/2d/layers/features/support/BinStore.js +1 -1
  155. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  156. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  157. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  158. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  159. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  160. package/views/2d/layers/features/support/FeatureSetReaderPBFIndirect.js +1 -1
  161. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  162. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  163. package/views/3d/environment/CloudsData.js +1 -1
  164. package/views/3d/environment/CloudsGenerator.js +1 -1
  165. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  166. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  167. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  168. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  169. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
  170. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  171. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  172. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  173. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  174. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  175. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  176. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  177. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  178. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  179. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  180. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  181. package/views/3d/layers/graphics/interfaces.js +1 -1
  182. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  183. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  184. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  185. package/views/3d/support/buffer/glUtil.js +1 -1
  186. package/views/3d/support/buffer/workerHelper.js +1 -1
  187. package/views/3d/support/engineContent/line.js +1 -1
  188. package/views/3d/terrain/PatchRenderData.js +1 -1
  189. package/views/3d/terrain/TerrainSurface.js +1 -1
  190. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +2 -2
  191. package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
  192. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  193. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  194. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  195. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  196. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  197. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  198. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  199. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  200. package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
  201. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  202. package/views/interactive/tooltip/TransformTooltipInfos.js +1 -1
  203. package/views/interactive/tooltip/content/TooltipContentTransformRotate.js +1 -1
  204. package/views/interactive/tooltip/content/TooltipContentTransformScale.js +1 -1
  205. package/widgets/Bookmarks/css.js +1 -1
  206. package/widgets/Bookmarks.js +1 -1
  207. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  208. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  209. package/widgets/Editor/EditorViewModel.js +1 -1
  210. package/widgets/Editor/Upload.js +5 -0
  211. package/widgets/Editor/UploadState.js +4 -0
  212. package/widgets/Editor/workflowUtils.js +1 -1
  213. package/widgets/Editor.js +1 -1
  214. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  215. package/widgets/FeatureForm/{InputField.js → FieldInput.js} +1 -1
  216. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  217. package/widgets/FeatureForm/GroupInput.js +5 -0
  218. package/widgets/FeatureForm/css.js +1 -1
  219. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  220. package/widgets/FeatureForm.js +1 -1
  221. package/widgets/FeatureTable/FieldColumn.js +1 -1
  222. package/widgets/FeatureTemplates/ItemList.js +1 -1
  223. package/widgets/FeatureTemplates/TemplateItem.js +1 -1
  224. package/widgets/FeatureTemplates.js +1 -1
  225. package/widgets/Fullscreen/FullscreenViewModel.js +1 -1
  226. package/widgets/LayerList/LayerListViewModel.js +1 -1
  227. package/widgets/LayerList.js +1 -1
  228. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  229. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  230. package/assets/esri/core/workers/chunks/009348f65fab440f7752.js +0 -1
  231. package/assets/esri/core/workers/chunks/075ecd53fb229dfee53c.js +0 -1
  232. package/assets/esri/core/workers/chunks/1c77b92063ee36421914.js +0 -1
  233. package/assets/esri/core/workers/chunks/1ee774c3f29d8074da12.js +0 -1
  234. package/assets/esri/core/workers/chunks/262b6de5a29c713b4010.js +0 -1
  235. package/assets/esri/core/workers/chunks/281c0f936b5645a673ab.js +0 -1
  236. package/assets/esri/core/workers/chunks/2883a59fc1fc9e4d71af.js +0 -1
  237. package/assets/esri/core/workers/chunks/2e032a58ac6717313227.js +0 -1
  238. package/assets/esri/core/workers/chunks/4d4cbfe72835c0460b09.js +0 -1
  239. package/assets/esri/core/workers/chunks/5504dff4113dd74d2fa7.js +0 -1
  240. package/assets/esri/core/workers/chunks/5bded2588008117d0c35.js +0 -1
  241. package/assets/esri/core/workers/chunks/6caf8a0b49bd01906f32.js +0 -1
  242. package/assets/esri/core/workers/chunks/9cab04c71d8bccf0156d.js +0 -1
  243. package/assets/esri/core/workers/chunks/9f02a0670ad73718d8f9.js +0 -1
  244. package/assets/esri/core/workers/chunks/a265e454461edb306e2d.js +0 -1
  245. package/assets/esri/core/workers/chunks/a50ca44a62434bf18664.js +0 -1
  246. package/assets/esri/core/workers/chunks/bd090f9ec6cfe08e19a3.js +0 -1
  247. package/assets/esri/core/workers/chunks/c3338bdce8368731c4e9.js +0 -1
  248. package/assets/esri/core/workers/chunks/c54df59b2b3f73828a44.js +0 -1
  249. package/assets/esri/core/workers/chunks/ddebf3b5a131a6da5419.js +0 -1
  250. package/assets/esri/core/workers/chunks/de461c30aa24ec8bb212.js +0 -1
  251. package/assets/esri/core/workers/chunks/e23f56bee694a38da5b9.js +0 -1
  252. package/assets/esri/core/workers/chunks/ec73d16ef169adfc34fb.js +0 -1
  253. package/assets/esri/core/workers/chunks/ef884e2833868234c13c.js +0 -1
  254. package/assets/esri/core/workers/chunks/f3c99525fb1b0f719fe0.js +0 -1
  255. package/assets/esri/core/workers/chunks/fe314feede84dd688010.js +0 -1
  256. package/assets/esri/core/workers/chunks/ff15557dc7b74162ed75.js +0 -1
  257. package/assets/esri/widgets/Directions/t9n/Printout.json +0 -1
  258. package/assets/esri/widgets/Directions/t9n/Printout_ar.json +0 -1
  259. package/assets/esri/widgets/Directions/t9n/Printout_bg.json +0 -1
  260. package/assets/esri/widgets/Directions/t9n/Printout_bs.json +0 -1
  261. package/assets/esri/widgets/Directions/t9n/Printout_ca.json +0 -1
  262. package/assets/esri/widgets/Directions/t9n/Printout_cs.json +0 -1
  263. package/assets/esri/widgets/Directions/t9n/Printout_da.json +0 -1
  264. package/assets/esri/widgets/Directions/t9n/Printout_de.json +0 -1
  265. package/assets/esri/widgets/Directions/t9n/Printout_el.json +0 -1
  266. package/assets/esri/widgets/Directions/t9n/Printout_en.json +0 -1
  267. package/assets/esri/widgets/Directions/t9n/Printout_es.json +0 -1
  268. package/assets/esri/widgets/Directions/t9n/Printout_et.json +0 -1
  269. package/assets/esri/widgets/Directions/t9n/Printout_fi.json +0 -1
  270. package/assets/esri/widgets/Directions/t9n/Printout_fr.json +0 -1
  271. package/assets/esri/widgets/Directions/t9n/Printout_he.json +0 -1
  272. package/assets/esri/widgets/Directions/t9n/Printout_hr.json +0 -1
  273. package/assets/esri/widgets/Directions/t9n/Printout_hu.json +0 -1
  274. package/assets/esri/widgets/Directions/t9n/Printout_id.json +0 -1
  275. package/assets/esri/widgets/Directions/t9n/Printout_it.json +0 -1
  276. package/assets/esri/widgets/Directions/t9n/Printout_ja.json +0 -1
  277. package/assets/esri/widgets/Directions/t9n/Printout_ko.json +0 -1
  278. package/assets/esri/widgets/Directions/t9n/Printout_lt.json +0 -1
  279. package/assets/esri/widgets/Directions/t9n/Printout_lv.json +0 -1
  280. package/assets/esri/widgets/Directions/t9n/Printout_nb.json +0 -1
  281. package/assets/esri/widgets/Directions/t9n/Printout_nl.json +0 -1
  282. package/assets/esri/widgets/Directions/t9n/Printout_pl.json +0 -1
  283. package/assets/esri/widgets/Directions/t9n/Printout_pt-BR.json +0 -1
  284. package/assets/esri/widgets/Directions/t9n/Printout_pt-PT.json +0 -1
  285. package/assets/esri/widgets/Directions/t9n/Printout_ro.json +0 -1
  286. package/assets/esri/widgets/Directions/t9n/Printout_ru.json +0 -1
  287. package/assets/esri/widgets/Directions/t9n/Printout_sk.json +0 -1
  288. package/assets/esri/widgets/Directions/t9n/Printout_sl.json +0 -1
  289. package/assets/esri/widgets/Directions/t9n/Printout_sr.json +0 -1
  290. package/assets/esri/widgets/Directions/t9n/Printout_sv.json +0 -1
  291. package/assets/esri/widgets/Directions/t9n/Printout_th.json +0 -1
  292. package/assets/esri/widgets/Directions/t9n/Printout_tr.json +0 -1
  293. package/assets/esri/widgets/Directions/t9n/Printout_uk.json +0 -1
  294. package/assets/esri/widgets/Directions/t9n/Printout_vi.json +0 -1
  295. package/assets/esri/widgets/Directions/t9n/Printout_zh-CN.json +0 -1
  296. package/assets/esri/widgets/Directions/t9n/Printout_zh-HK.json +0 -1
  297. package/assets/esri/widgets/Directions/t9n/Printout_zh-TW.json +0 -1
  298. package/widgets/FeatureForm/InputField.d.ts +0 -4
  299. package/widgets/FeatureForm/InputFieldGroup.d.ts +0 -4
  300. package/widgets/FeatureForm/InputFieldGroup.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{Z as e}from"../../../../chunks/vec4f64.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as r}from"../lib/basicInterfaces.js";import s from"../lib/GLMaterial.js";import{MaterialParameters as i}from"../lib/Material.js";import{OITPolygonOffsetLimit as a}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{PositionColorLayoutObjectAndLayerId as h,PositionColorLayout as l}from"./DefaultLayouts.js";import{TriangleMaterial as u}from"./TriangleMaterial.js";import{ColorMaterialTechnique as c}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as p}from"../shaders/ColorMaterialTechniqueConfiguration.js";class f extends u{constructor(e){super(e,new d),this.supportsEdges=!0,this._configuration=new p}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<a,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}requiresSlot(e,r){if(r===t.Color||r===t.Alpha||r===t.Highlight||r===t.Depth&&this.parameters.writeLinearDepth||r===t.ObjectAndLayerIdColor){if(e===o.DRAPED_MATERIAL)return!0;if(r===t.Highlight)return e===o.OPAQUE_MATERIAL;return e===(this.parameters.transparent?this.parameters.writeDepth?o.TRANSPARENT_MATERIAL:o.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:o.OPAQUE_MATERIAL)}return!1}createGLMaterial(e){return new m(e)}createBufferWriter(){return new n(has("enable-feature:objectAndLayerId-rendering")?h:l)}}class m extends s{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==t.Color&&this._output!==t.Alpha||this._updateOccludeeState(e),this.ensureTechnique(c,e)}}class d extends i{constructor(){super(...arguments),this.color=e,this.transparent=!1,this.writeDepth=!0,this.writeLinearDepth=!1,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=r.None,this.hasOccludees=!1}}export{f as ColorMaterial,d as Parameters};
5
+ import has from"../../../../core/has.js";import{Z as e}from"../../../../chunks/vec4f64.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as s}from"../lib/basicInterfaces.js";import a from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as i}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{VertexAttribute as n}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{TriangleMaterial as l}from"./TriangleMaterial.js";import{VisualVariablePassParameters as u}from"./VisualVariablePassParameters.js";import{ColorMaterialTechnique as c}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as p}from"../shaders/ColorMaterialTechniqueConfiguration.js";class f extends l{constructor(e){super(e,new d),this.supportsEdges=!0,this._configuration=new p}getConfiguration(e,r){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.enableOffset=r.camera.relativeElevation<i,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}requiresSlot(e,r){if(r===t.Color||r===t.Alpha||r===t.Highlight||r===t.Depth&&this.parameters.writeLinearDepth||r===t.ObjectAndLayerIdColor){if(e===o.DRAPED_MATERIAL)return!0;if(r===t.Highlight)return e===o.OPAQUE_MATERIAL;return e===(this.parameters.transparent?this.parameters.writeDepth?o.TRANSPARENT_MATERIAL:o.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:o.OPAQUE_MATERIAL)}return!1}createGLMaterial(e){return new m(e)}createBufferWriter(){const e=r().vec3f(n.POSITION);return has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(n.OBJECTANDLAYERIDCOLOR),this.parameters.vvColor?e.f32(n.COLORFEATUREATTRIBUTE):e.vec4u8(n.COLOR),new h(e)}}class m extends a{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==t.Color&&this._output!==t.Alpha||this._updateOccludeeState(e),this.ensureTechnique(c,e)}}class d extends u{constructor(){super(...arguments),this.color=e,this.transparent=!1,this.writeDepth=!0,this.writeLinearDepth=!1,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=s.None,this.hasOccludees=!1}}export{f as ColorMaterial,d as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{f as t}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f as e,BufferViewVec4f as r,BufferViewVec4u8 as i,BufferViewVec3f as s}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as n}from"../lib/basicInterfaces.js";import c from"../lib/GLMaterial.js";import{MaterialParameters as u}from"../lib/Material.js";import{OITPolygonOffsetLimit as h}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as l}from"../lib/RenderSlot.js";import{assert as p}from"../lib/Util.js";import{VertexAttribute as f}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as m}from"./DefaultBufferWriter.js";import{Style as d}from"./PatternStyle.js";import{TriangleMaterial as g}from"./TriangleMaterial.js";import{writeBufferVec4 as _,writeColor as A,writePosition as b}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocations as O,PatternTechniqueConfiguration as T,PatternTechnique as P}from"../shaders/PatternTechnique.js";class S extends g{constructor(t){super(t,new R),this.supportsEdges=!0,this._vertexAttributeLocations=O,this._configuration=new T}getConfiguration(t,e){return this._configuration.output=t,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.style=this.parameters.style,this._configuration.patternSpacing=this.parameters.patternSpacing,this._configuration.lineWidth=this.parameters.lineWidth,this._configuration.draped=this.parameters.draped,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration.enableOffset=e.camera.relativeElevation<h,this._configuration.hasMultipassTerrain=e.multipassTerrain.enabled,this._configuration.cullAboveGround=e.multipassTerrain.cullAboveGround,this._configuration}requiresSlot(t,e){if(e===o.Color||e===o.Alpha||e===o.Highlight||e===o.Depth&&this.parameters.writeLinearDepth){if(t===l.DRAPED_MATERIAL)return!0;if(e===o.Highlight)return t===l.OPAQUE_MATERIAL;return t===(this.parameters.writeDepth?l.TRANSPARENT_MATERIAL:l.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return!1}createGLMaterial(t){return new y(t)}createBufferWriter(){const t=a().vec3f(f.POSITION).vec4u8(f.COLOR).vec4f(f.UVMAPSPACE);return this.parameters.draped||t.mat3f(f.BOUNDINGRECT),new E(t)}}class y extends c{_updateParameters(t){return this.ensureTechnique(P,t)}_updateOccludeeState(t){t.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:t.hasOccludees})}beginSlot(t){return this._output!==o.Color&&this._output!==o.Alpha||this._updateOccludeeState(t),this._updateParameters(t)}}class E extends m{write(t,a,o,n,c){for(const u of this.vertexBufferLayout.fieldNames){const a=o.vertexAttributes.get(u),h=o.indices.get(u);if(a&&h)switch(u){case f.POSITION:{p(3===a.size);const e=n.getField(u,s);e&&b(h,a.data,t,e,c);break}case f.COLOR:{p(3===a.size||4===a.size);const t=n.getField(u,i);t&&A(h,a.data,a.size,t,c);break}case f.UVMAPSPACE:{p(4===a.size);const t=n.getField(u,r);t&&_(h,a.data,t,c);break}case f.BOUNDINGRECT:{p(9===a.size);const r=n.getField(u,e);r&&this.writeBoundingRect(h,a.data,t,r,c);break}}}}writeBoundingRect(t,e,r,i,s){const a=r,o=i.typedBuffer,n=i.typedBufferStride,c=t.length;s*=n;for(let u=0;u<c;++u){const r=9*t[u],i=e[r],c=e[r+1],h=e[r+2];o[s]=a[0]*i+a[4]*c+a[8]*h+a[12],o[s+1]=a[1]*i+a[5]*c+a[9]*h+a[13],o[s+2]=a[2]*i+a[6]*c+a[10]*h+a[14];for(let t=3;t<9;++t)o[s+t]=e[r+t];s+=n}}}class R extends u{constructor(){super(...arguments),this.color=t(1,1,1,1),this.writeDepth=!0,this.writeLinearDepth=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=n.None,this.hasOccludees=!1,this.style=d.Cross,this.patternSpacing=10,this.lineWidth=1,this.draped=!0}}export{R as Parameters,S as PatternMaterial};
5
+ import{f as e}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f as t,BufferViewVec4f as r,BufferViewVec4u8 as i,BufferViewVec3f as s}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as n}from"../lib/basicInterfaces.js";import c from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{assert as l}from"../lib/Util.js";import{VertexAttribute as p}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as f}from"./DefaultBufferWriter.js";import{Style as m}from"./PatternStyle.js";import{TriangleMaterial as d}from"./TriangleMaterial.js";import{VisualVariablePassParameters as g}from"./VisualVariablePassParameters.js";import{writeBufferVec4 as _,writeColor as A,writePosition as b}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocations as O,PatternTechniqueConfiguration as P,PatternTechnique as T}from"../shaders/PatternTechnique.js";class S extends d{constructor(e){super(e,new R),this.supportsEdges=!0,this._vertexAttributeLocations=O,this._configuration=new P}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.style=this.parameters.style,this._configuration.patternSpacing=this.parameters.patternSpacing,this._configuration.lineWidth=this.parameters.lineWidth,this._configuration.draped=this.parameters.draped,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<u,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}requiresSlot(e,t){if(t===o.Color||t===o.Alpha||t===o.Highlight||t===o.Depth&&this.parameters.writeLinearDepth){if(e===h.DRAPED_MATERIAL)return!0;if(t===o.Highlight)return e===h.OPAQUE_MATERIAL;return e===(this.parameters.writeDepth?h.TRANSPARENT_MATERIAL:h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return!1}createGLMaterial(e){return new y(e)}createBufferWriter(){const e=a().vec3f(p.POSITION).vec4u8(p.COLOR).vec4f(p.UVMAPSPACE);return this.parameters.draped||e.mat3f(p.BOUNDINGRECT),new E(e)}}class y extends c{_updateParameters(e){return this.ensureTechnique(T,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==o.Color&&this._output!==o.Alpha||this._updateOccludeeState(e),this._updateParameters(e)}}class E extends f{write(e,a,o,n,c){for(const u of this.vertexBufferLayout.fields.keys()){const a=o.vertexAttributes.get(u),h=o.indices.get(u);if(a&&h)switch(u){case p.POSITION:{l(3===a.size);const t=n.getField(u,s);t&&b(h,a.data,e,t,c);break}case p.COLOR:{l(3===a.size||4===a.size);const e=n.getField(u,i);e&&A(h,a.data,a.size,e,c);break}case p.UVMAPSPACE:{l(4===a.size);const e=n.getField(u,r);e&&_(h,a.data,e,c);break}case p.BOUNDINGRECT:{l(9===a.size);const r=n.getField(u,t);r&&this.writeBoundingRect(h,a.data,e,r,c);break}}}}writeBoundingRect(e,t,r,i,s){const a=r,o=i.typedBuffer,n=i.typedBufferStride,c=e.length;s*=n;for(let u=0;u<c;++u){const r=9*e[u],i=t[r],c=t[r+1],h=t[r+2];o[s]=a[0]*i+a[4]*c+a[8]*h+a[12],o[s+1]=a[1]*i+a[5]*c+a[9]*h+a[13],o[s+2]=a[2]*i+a[6]*c+a[10]*h+a[14];for(let e=3;e<9;++e)o[s+e]=t[r+e];s+=n}}}class R extends g{constructor(){super(...arguments),this.color=e(1,1,1,1),this.writeDepth=!0,this.writeLinearDepth=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=n.None,this.hasOccludees=!1,this.style=m.Cross,this.patternSpacing=10,this.lineWidth=1,this.draped=!0}}export{R as Parameters,S as PatternMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{c as i}from"../../../../chunks/vec2.js";import{s,b as a,e as n,g as o,a as l,c,l as h,i as u,m as p}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{O as f}from"../../../../chunks/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as d,fromPoints as A,closestLineSegmentPoint as E}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as R,signedDistance as S,normal as I}from"../../../../geometry/support/plane.js";import{newLayout as g}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as O}from"../core/shaderLibrary/ShaderOutput.js";import b from"../lib/GLMaterial.js";import{Material as L,RenderOccludedFlag as P}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as C}from"../lib/Util.js";import{VertexAttribute as y}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as j}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as D}from"../shaders/LineMarkerTechniqueConfiguration.js";import{R as U}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as x,RibbonLineTechnique as F}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as w,CapType as M}from"../shaders/RibbonLineTechniqueConfiguration.js";var J;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(J||(J={}));class B extends L{constructor(e){super(e,new G),this._configuration=new w,this._vertexAttributeLocations=x,this._layout=this.createLayout()}isClosed(e,t){return V(this.parameters,e,t)}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===N.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==O.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stippleScaleWithLineWidth=r&&this.parameters.stippleScaleWithLineWidth,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&Z(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===P.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,i,s,a,n){if(!i.options.selectionMode)return;const o=e.vertexAttributes.get(y.POSITION).data,l=e.vertexAttributes.get(y.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0];c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const h=s[0],u=s[1],p=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,f=0;for(let T=0;T<o.length-5;T+=3){const e=o[T],r=o[T+1],i=h-e,s=u-r,a=o[T+3]-e,n=o[T+4]-r,l=t((a*i+n*s)/(a*a+n*n),0,1),c=a*l-i,p=n*l-s,_=c*c+p*p;_<m&&(m=_,f=T/3)}m<p*p&&a(n.dist,n.normal,f,!1)}intersect(r,p,m,f,_,v){if(!m.options.selectionMode||!r.visible)return;if(!C(p))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const g=r.vertexAttributes,O=g.get(y.POSITION).data;let b=this.parameters.width;if(this.parameters.vvSize){const e=g.get(y.SIZEFEATUREATTRIBUTE).data[0];b*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else g.has(y.SIZE)&&(b*=g.get(y.SIZE).data[0]);const L=m.camera,P=K;i(P,m.point);const N=b*L.pixelRatio/2+4*L.pixelRatio;s(le[0],P[0]-N,P[1]+N,0),s(le[1],P[0]+N,P[1]+N,0),s(le[2],P[0]+N,P[1]-N,0),s(le[3],P[0]-N,P[1]-N,0);for(let e=0;e<4;e++)if(!L.unprojectFromRenderScreen(le[e],ce[e]))return;R(L.eye,ce[0],ce[1],he),R(L.eye,ce[1],ce[2],ue),R(L.eye,ce[2],ce[3],pe),R(L.eye,ce[3],ce[0],me);let j=Number.MAX_VALUE,D=0;const U=W(this.parameters,g,r.indices)?O.length-2:O.length-5;for(let e=0;e<U;e+=3){q[0]=O[e]+p[12],q[1]=O[e+1]+p[13],q[2]=O[e+2]+p[14];const t=(e+3)%O.length;if(X[0]=O[t]+p[12],X[1]=O[t+1]+p[13],X[2]=O[t+2]+p[14],S(he,q)<0&&S(he,X)<0||S(ue,q)<0&&S(ue,X)<0||S(pe,q)<0&&S(pe,X)<0||S(me,q)<0&&S(me,X)<0)continue;if(L.projectToRenderScreen(q,$),L.projectToRenderScreen(X,ee),$[2]<0&&ee[2]>0){a(Y,q,X);const e=L.frustum,t=-S(e[T.NEAR],q)/n(Y,I(e[T.NEAR]));o(Y,Y,t),l(q,q,Y),L.projectToRenderScreen(q,$)}else if($[2]>0&&ee[2]<0){a(Y,X,q);const e=L.frustum,t=-S(e[T.NEAR],X)/n(Y,I(e[T.NEAR]));o(Y,Y,t),l(X,X,Y),L.projectToRenderScreen(X,ee)}else if($[2]<0&&ee[2]<0)continue;$[2]=0,ee[2]=0;const r=d(A($,ee,ie),P);r<j&&(j=r,c(te,q),c(re,X),D=e/3)}const x=m.rayBegin,F=m.rayEnd;if(j<N*N){let e=Number.MAX_VALUE;if(E(A(te,re,ie),A(x,F,se),Q)){a(Q,Q,x);const t=h(Q);o(Q,Q,1/t),e=t/u(x,F)}v(e,Q,D,!1)}}createLayout(){const e=g().vec3f(y.POSITION).f32(y.SUBDIVISIONFACTOR).vec2f(y.UV0).vec3f(y.AUXPOS1).vec3f(y.AUXPOS2);return this.parameters.vvSize?e.f32(y.SIZEFEATUREATTRIBUTE):e.f32(y.SIZE),this.parameters.vvColor?e.f32(y.COLORFEATUREATTRIBUTE):e.vec4f(y.COLOR),this.parameters.vvOpacity&&e.f32(y.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(y.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new H(this._layout,this.parameters)}requiresSlot(e,t){if(t===O.Color||t===O.Alpha||t===O.Highlight||t===O.Depth||t===O.ObjectAndLayerIdColor){if(e===N.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===P.OccludeAndTransparentStencil)return e===N.OPAQUE_MATERIAL||e===N.OCCLUDER_MATERIAL||e===N.TRANSPARENT_OCCLUDER_MATERIAL;if(t===O.Color||t===O.Alpha){return e===(this.parameters.writeDepth?N.TRANSPARENT_MATERIAL:N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===N.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new z(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class z extends b{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==O.Color&&this._output!==O.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,t)),this._stipplePattern=t),this.ensureTechnique(F,e)}}class G extends j{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=M.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}}class H{constructor(e,t){this._parameters=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=U+r}}_isClosed(e){return W(this._parameters,e.vertexAttributes,e.indices)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.indices.get(y.POSITION).length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a){const n=ae,o=ne,l=oe,h=r.vertexAttributes.get(y.POSITION).data,m=r.indices&&r.indices.get(y.POSITION),f=r.vertexAttributes.get(y.DISTANCETOSTART)?.data;m&&m.length!==2*(h.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let T=1,_=0;this._parameters.vvSize?_=r.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.SIZE)&&(T=r.vertexAttributes.get(y.SIZE).data[0]);let d=[1,1,1,1],A=0;this._parameters.vvColor?A=r.vertexAttributes.get(y.COLORFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.COLOR)&&(d=r.vertexAttributes.get(y.COLOR).data);const E=has("enable-feature:objectAndLayerId-rendering")?r.objectAndLayerIdColor:null;let v=0;this._parameters.vvOpacity&&(v=r.vertexAttributes.get(y.OPACITYFEATUREATTRIBUTE).data[0]);const R=h.length/3,S=new Float32Array(i.buffer),I=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(i.buffer):null,g=this.vertexBufferLayout.stride/4;let O=a*g;const b=O;let L=0;const P=f?(e,t,r)=>L=f[r]:(e,t,r)=>L+=u(e,t),N=has("enable-feature:objectAndLayerId-rendering"),C=(e,t,r,i,s,a,n)=>{if(S[O++]=t[0],S[O++]=t[1],S[O++]=t[2],S[O++]=i,S[O++]=n,S[O++]=s,S[O++]=e[0],S[O++]=e[1],S[O++]=e[2],S[O++]=r[0],S[O++]=r[1],S[O++]=r[2],S[O++]=this._parameters.vvSize?_:T,this._parameters.vvColor)S[O++]=A;else{const e=Math.min(4*a,d.length-4);S[O++]=d[e],S[O++]=d[e+1],S[O++]=d[e+2],S[O++]=d[e+3]}this._parameters.vvOpacity&&(S[O++]=v),N&&(null!=E&&(I[4*O]=E[0],I[4*O+1]=E[1],I[4*O+2]=E[2],I[4*O+3]=E[3]),O++)};O+=g,s(o,h[0],h[1],h[2]),e&&p(o,o,e);const j=this._isClosed(r);if(j){const t=h.length-3;s(n,h[t],h[t+1],h[t+2]),e&&p(n,n,e)}else s(l,h[3],h[4],h[5]),e&&p(l,l,e),C(o,o,l,1,J.LEFT_CAP_START,0,0),C(o,o,l,1,J.RIGHT_CAP_START,0,0),c(n,o),c(o,l);const D=j?0:1,U=j?R:R-1;for(let u=D;u<U;u++){const t=(u+1)%R*3;s(l,h[t],h[t+1],h[t+2]),e&&p(l,l,e),P(n,o,u),C(n,o,l,0,J.LEFT_JOIN_END,u,L),C(n,o,l,0,J.RIGHT_JOIN_END,u,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);C(n,o,l,t,J.LEFT_JOIN_END,u,L),C(n,o,l,t,J.RIGHT_JOIN_END,u,L)}C(n,o,l,1,J.LEFT_JOIN_START,u,L),C(n,o,l,1,J.RIGHT_JOIN_START,u,L),c(n,o),c(o,l)}j?(s(l,h[3],h[4],h[5]),e&&p(l,l,e),L=P(n,o,U),C(n,o,l,0,J.LEFT_JOIN_END,D,L),C(n,o,l,0,J.RIGHT_JOIN_END,D,L)):(L=P(n,o,U),C(n,o,o,0,J.LEFT_CAP_END,U,L),C(n,o,o,0,J.RIGHT_CAP_END,U,L)),k(S,b+g,S,b,g);O=k(S,O-g,S,O,g),this._parameters.wireframe&&this._addWireframeVertices(i,b,O,g)}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=k(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function k(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function W(e,t,r){return V(e,t.get(y.POSITION).data,r?r.get(y.POSITION):null)}function V(e,t,r){return!!e.isClosed&&(r?r.length>2:t.length>6)}function Z(e){return e.anchor===D.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const q=m(),X=m(),Y=m(),Q=m(),K=m(),$=r(),ee=r(),te=m(),re=m(),ie=_(),se=_(),ae=m(),ne=m(),oe=m(),le=[r(),r(),r(),r()],ce=[m(),m(),m(),m()],he=v(),ue=v(),pe=v(),me=v();export{G as Parameters,B as RibbonLineMaterial};
5
+ import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{c as i}from"../../../../chunks/vec2.js";import{s,b as a,e as n,g as o,a as l,c,l as h,i as u,m as p}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{O as f}from"../../../../chunks/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as d,fromPoints as A,closestLineSegmentPoint as E}from"../../../../geometry/support/lineSegment.js";import{create as v,fromPoints as R,signedDistance as S,normal as g}from"../../../../geometry/support/plane.js";import{newLayout as I}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as O}from"../core/shaderLibrary/ShaderOutput.js";import b from"../lib/GLMaterial.js";import{Material as P,RenderOccludedFlag as L}from"../lib/Material.js";import{RenderSlot as N}from"../lib/RenderSlot.js";import{isTranslationMatrix as C}from"../lib/Util.js";import{VertexAttribute as y}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as j}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as D}from"../shaders/LineMarkerTechniqueConfiguration.js";import{R as U}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as x,RibbonLineTechnique as F}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as w,CapType as M}from"../shaders/RibbonLineTechniqueConfiguration.js";var J;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(J||(J={}));class B extends P{constructor(e){super(e,new G),this._configuration=new w,this._vertexAttributeLocations=x}isClosed(e,t){return V(this.parameters,e,t)}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===N.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==O.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stippleScaleWithLineWidth=r&&this.parameters.stippleScaleWithLineWidth,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&Z(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===L.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,r,i,s,a,n){if(!i.options.selectionMode)return;const o=e.vertexAttributes.get(y.POSITION).data,l=e.vertexAttributes.get(y.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0];c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const h=s[0],u=s[1],p=(c/2+4)*e.screenToWorldRatio;let m=Number.MAX_VALUE,f=0;for(let T=0;T<o.length-5;T+=3){const e=o[T],r=o[T+1],i=h-e,s=u-r,a=o[T+3]-e,n=o[T+4]-r,l=t((a*i+n*s)/(a*a+n*n),0,1),c=a*l-i,p=n*l-s,_=c*c+p*p;_<m&&(m=_,f=T/3)}m<p*p&&a(n.dist,n.normal,f,!1)}intersect(r,p,m,f,_,v){if(!m.options.selectionMode||!r.visible)return;if(!C(p))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const I=r.vertexAttributes,O=I.get(y.POSITION).data;let b=this.parameters.width;if(this.parameters.vvSize){const e=I.get(y.SIZEFEATUREATTRIBUTE).data[0];b*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else I.has(y.SIZE)&&(b*=I.get(y.SIZE).data[0]);const P=m.camera,L=K;i(L,m.point);const N=b*P.pixelRatio/2+4*P.pixelRatio;s(le[0],L[0]-N,L[1]+N,0),s(le[1],L[0]+N,L[1]+N,0),s(le[2],L[0]+N,L[1]-N,0),s(le[3],L[0]-N,L[1]-N,0);for(let e=0;e<4;e++)if(!P.unprojectFromRenderScreen(le[e],ce[e]))return;R(P.eye,ce[0],ce[1],he),R(P.eye,ce[1],ce[2],ue),R(P.eye,ce[2],ce[3],pe),R(P.eye,ce[3],ce[0],me);let j=Number.MAX_VALUE,D=0;const U=W(this.parameters,I,r.indices)?O.length-2:O.length-5;for(let e=0;e<U;e+=3){q[0]=O[e]+p[12],q[1]=O[e+1]+p[13],q[2]=O[e+2]+p[14];const t=(e+3)%O.length;if(X[0]=O[t]+p[12],X[1]=O[t+1]+p[13],X[2]=O[t+2]+p[14],S(he,q)<0&&S(he,X)<0||S(ue,q)<0&&S(ue,X)<0||S(pe,q)<0&&S(pe,X)<0||S(me,q)<0&&S(me,X)<0)continue;if(P.projectToRenderScreen(q,$),P.projectToRenderScreen(X,ee),$[2]<0&&ee[2]>0){a(Y,q,X);const e=P.frustum,t=-S(e[T.NEAR],q)/n(Y,g(e[T.NEAR]));o(Y,Y,t),l(q,q,Y),P.projectToRenderScreen(q,$)}else if($[2]>0&&ee[2]<0){a(Y,X,q);const e=P.frustum,t=-S(e[T.NEAR],X)/n(Y,g(e[T.NEAR]));o(Y,Y,t),l(X,X,Y),P.projectToRenderScreen(X,ee)}else if($[2]<0&&ee[2]<0)continue;$[2]=0,ee[2]=0;const r=d(A($,ee,ie),L);r<j&&(j=r,c(te,q),c(re,X),D=e/3)}const x=m.rayBegin,F=m.rayEnd;if(j<N*N){let e=Number.MAX_VALUE;if(E(A(te,re,ie),A(x,F,se),Q)){a(Q,Q,x);const t=h(Q);o(Q,Q,1/t),e=t/u(x,F)}v(e,Q,D,!1)}}get _layout(){const e=I().vec3f(y.POSITION).f32(y.SUBDIVISIONFACTOR).vec2f(y.UV0).vec3f(y.AUXPOS1).vec3f(y.AUXPOS2);return this.parameters.vvSize?e.f32(y.SIZEFEATUREATTRIBUTE):e.f32(y.SIZE),this.parameters.vvColor?e.f32(y.COLORFEATUREATTRIBUTE):e.vec4f(y.COLOR),this.parameters.vvOpacity&&e.f32(y.OPACITYFEATUREATTRIBUTE),has("enable-feature:objectAndLayerId-rendering")&&e.vec4u8(y.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new H(this._layout,this.parameters)}requiresSlot(e,t){if(t===O.Color||t===O.Alpha||t===O.Highlight||t===O.Depth||t===O.ObjectAndLayerIdColor){if(e===N.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===L.OccludeAndTransparentStencil)return e===N.OPAQUE_MATERIAL||e===N.OCCLUDER_MATERIAL||e===N.TRANSPARENT_OCCLUDER_MATERIAL;if(t===O.Color||t===O.Alpha){return e===(this.parameters.writeDepth?N.TRANSPARENT_MATERIAL:N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===N.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new z(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class z extends b{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==O.Color&&this._output!==O.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,t)),this._stipplePattern=t),this.ensureTechnique(F,e)}}class G extends j{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=M.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}}class H{constructor(e,t){this._parameters=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=U+r}}_isClosed(e){return W(this._parameters,e.vertexAttributes,e.indices)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.indices.get(y.POSITION).length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a){const n=ae,o=ne,l=oe,h=r.vertexAttributes.get(y.POSITION).data,m=r.indices&&r.indices.get(y.POSITION),f=r.vertexAttributes.get(y.DISTANCETOSTART)?.data;m&&m.length!==2*(h.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let T=1,_=0;this._parameters.vvSize?_=r.vertexAttributes.get(y.SIZEFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.SIZE)&&(T=r.vertexAttributes.get(y.SIZE).data[0]);let d=[1,1,1,1],A=0;this._parameters.vvColor?A=r.vertexAttributes.get(y.COLORFEATUREATTRIBUTE).data[0]:r.vertexAttributes.has(y.COLOR)&&(d=r.vertexAttributes.get(y.COLOR).data);const E=has("enable-feature:objectAndLayerId-rendering")?r.objectAndLayerIdColor:null;let v=0;this._parameters.vvOpacity&&(v=r.vertexAttributes.get(y.OPACITYFEATUREATTRIBUTE).data[0]);const R=h.length/3,S=new Float32Array(i.buffer),g=has("enable-feature:objectAndLayerId-rendering")?new Uint8Array(i.buffer):null,I=this.vertexBufferLayout.stride/4;let O=a*I;const b=O;let P=0;const L=f?(e,t,r)=>P=f[r]:(e,t,r)=>P+=u(e,t),N=has("enable-feature:objectAndLayerId-rendering"),C=(e,t,r,i,s,a,n)=>{if(S[O++]=t[0],S[O++]=t[1],S[O++]=t[2],S[O++]=i,S[O++]=n,S[O++]=s,S[O++]=e[0],S[O++]=e[1],S[O++]=e[2],S[O++]=r[0],S[O++]=r[1],S[O++]=r[2],S[O++]=this._parameters.vvSize?_:T,this._parameters.vvColor)S[O++]=A;else{const e=Math.min(4*a,d.length-4);S[O++]=d[e],S[O++]=d[e+1],S[O++]=d[e+2],S[O++]=d[e+3]}this._parameters.vvOpacity&&(S[O++]=v),N&&(null!=E&&(g[4*O]=E[0],g[4*O+1]=E[1],g[4*O+2]=E[2],g[4*O+3]=E[3]),O++)};O+=I,s(o,h[0],h[1],h[2]),e&&p(o,o,e);const j=this._isClosed(r);if(j){const t=h.length-3;s(n,h[t],h[t+1],h[t+2]),e&&p(n,n,e)}else s(l,h[3],h[4],h[5]),e&&p(l,l,e),C(o,o,l,1,J.LEFT_CAP_START,0,0),C(o,o,l,1,J.RIGHT_CAP_START,0,0),c(n,o),c(o,l);const D=j?0:1,U=j?R:R-1;for(let u=D;u<U;u++){const t=(u+1)%R*3;s(l,h[t],h[t+1],h[t+2]),e&&p(l,l,e),L(n,o,u),C(n,o,l,0,J.LEFT_JOIN_END,u,P),C(n,o,l,0,J.RIGHT_JOIN_END,u,P);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);C(n,o,l,t,J.LEFT_JOIN_END,u,P),C(n,o,l,t,J.RIGHT_JOIN_END,u,P)}C(n,o,l,1,J.LEFT_JOIN_START,u,P),C(n,o,l,1,J.RIGHT_JOIN_START,u,P),c(n,o),c(o,l)}j?(s(l,h[3],h[4],h[5]),e&&p(l,l,e),P=L(n,o,U),C(n,o,l,0,J.LEFT_JOIN_END,D,P),C(n,o,l,0,J.RIGHT_JOIN_END,D,P)):(P=L(n,o,U),C(n,o,o,0,J.LEFT_CAP_END,U,P),C(n,o,o,0,J.RIGHT_CAP_END,U,P)),k(S,b+I,S,b,I);O=k(S,O-I,S,O,I),this._parameters.wireframe&&this._addWireframeVertices(i,b,O,I)}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=k(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function k(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function W(e,t,r){return V(e,t.get(y.POSITION).data,r?r.get(y.POSITION):null)}function V(e,t,r){return!!e.isClosed&&(r?r.length>2:t.length>6)}function Z(e){return e.anchor===D.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const q=m(),X=m(),Y=m(),Q=m(),K=m(),$=r(),ee=r(),te=m(),re=m(),ie=_(),se=_(),ae=m(),ne=m(),oe=m(),le=[r(),r(),r(),r()],ce=[m(),m(),m(),m()],he=v(),ue=v(),pe=v(),me=v();export{G as Parameters,B as RibbonLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{y as e,z as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4f as f,BufferViewVec4u8 as o,BufferViewVec2f as r,BufferViewVec3f as n}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as s}from"../../lib/Util.js";import{VertexAttribute as i}from"../../lib/VertexAttribute.js";function l(e,t,f,o,r=1){const n=f.typedBuffer,s=f.typedBufferStride,i=e.length;if(o*=s,1===r)for(let l=0;l<i;++l)n[o]=t[e[l]],o+=s;else for(let l=0;l<i;++l){const f=t[e[l]];for(let e=0;e<r;e++)n[o]=f,o+=s}}function c(e,t,f,o){const r=f.typedBuffer,n=f.typedBufferStride,s=e.length;o*=n;for(let i=0;i<s;++i){const f=2*e[i];r[o]=t[f],r[o+1]=t[f+1],o+=n}}function d(e,t,f,o,r){const n=f.typedBuffer,s=f.typedBufferStride,i=e.length;if(o*=s,null==r||1===r)for(let l=0;l<i;++l){const f=3*e[l];n[o]=t[f],n[o+1]=t[f+1],n[o+2]=t[f+2],o+=s}else for(let l=0;l<i;++l){const f=3*e[l];for(let e=0;e<r;++e)n[o]=t[f],n[o+1]=t[f+1],n[o+2]=t[f+2],o+=s}}function u(e,t,f,o,r=1){const n=f.typedBuffer,s=f.typedBufferStride,i=e.length;if(o*=s,1===r)for(let l=0;l<i;++l){const f=4*e[l];n[o]=t[f],n[o+1]=t[f+1],n[o+2]=t[f+2],n[o+3]=t[f+3],o+=s}else for(let l=0;l<i;++l){const f=4*e[l];for(let e=0;e<r;++e)n[o]=t[f],n[o+1]=t[f+1],n[o+2]=t[f+2],n[o+3]=t[f+3],o+=s}}function a(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride;t*=r;for(let n=0;n<f;++n)o[t]=0,o[t+1]=0,o[t+2]=0,o[t+3]=0,t+=r}function p(e,t,f,o){const r=f.typedBuffer,n=f.typedBufferStride,s=e.length;o*=n;for(let i=0;i<s;++i){const f=9*e[i];for(let e=0;e<9;++e)r[o+e]=t[f+e];o+=n}}function y(e,t,f,o){const r=f.typedBuffer,n=f.typedBufferStride,s=e.length;o*=n;for(let i=0;i<s;++i){const f=16*e[i];for(let e=0;e<16;++e)r[o+e]=t[f+e];o+=n}}function B(t,f,o,r,n,s=1){if(!o)return void d(t,f,r,n,s);const i=r.typedBuffer,l=r.typedBufferStride,c=t.length,u=o[0],a=o[1],p=o[2],y=o[4],B=o[5],g=o[6],b=o[8],h=o[9],O=o[10],N=o[12],S=o[13],A=o[14];n*=l;let L=0,R=0,m=0;const v=e(o)?e=>{L=f[e]+N,R=f[e+1]+S,m=f[e+2]+A}:e=>{const t=f[e],o=f[e+1],r=f[e+2];L=u*t+y*o+b*r+N,R=a*t+B*o+h*r+S,m=p*t+g*o+O*r+A};if(1===s)for(let e=0;e<c;++e)v(3*t[e]),i[n]=L,i[n+1]=R,i[n+2]=m,n+=l;else for(let e=0;e<c;++e){v(3*t[e]);for(let e=0;e<s;++e)i[n]=L,i[n+1]=R,i[n+2]=m,n+=l}}function g(f,o,r,n,s,i=1){if(!r)return void d(f,o,n,s,i);const l=r,c=n.typedBuffer,u=n.typedBufferStride,a=f.length,p=l[0],y=l[1],B=l[2],g=l[4],b=l[5],h=l[6],O=l[8],N=l[9],S=l[10],A=!t(l),L=1e-6,R=1-L;s*=u;let m=0,v=0,E=0;const F=e(l)?e=>{m=o[e],v=o[e+1],E=o[e+2]}:e=>{const t=o[e],f=o[e+1],r=o[e+2];m=p*t+g*f+O*r,v=y*t+b*f+N*r,E=B*t+h*f+S*r};if(1===i)if(A)for(let e=0;e<a;++e){F(3*f[e]);const t=m*m+v*v+E*E;if(t<R&&t>L){const e=1/Math.sqrt(t);c[s]=m*e,c[s+1]=v*e,c[s+2]=E*e}else c[s]=m,c[s+1]=v,c[s+2]=E;s+=u}else for(let e=0;e<a;++e)F(3*f[e]),c[s]=m,c[s+1]=v,c[s+2]=E,s+=u;else for(let e=0;e<a;++e){if(F(3*f[e]),A){const e=m*m+v*v+E*E;if(e<R&&e>L){const t=1/Math.sqrt(e);m*=t,v*=t,E*=t}}for(let e=0;e<i;++e)c[s]=m,c[s+1]=v,c[s+2]=E,s+=u}}function b(e,f,o,r,n,s=1){if(!o)return void u(e,f,r,n,s);const i=o,l=r.typedBuffer,c=r.typedBufferStride,d=e.length,a=i[0],p=i[1],y=i[2],B=i[4],g=i[5],b=i[6],h=i[8],O=i[9],N=i[10],S=!t(i),A=1e-6,L=1-A;if(n*=c,1===s)for(let t=0;t<d;++t){const o=4*e[t],r=f[o],s=f[o+1],i=f[o+2],d=f[o+3];let u=a*r+B*s+h*i,R=p*r+g*s+O*i,m=y*r+b*s+N*i;if(S){const e=u*u+R*R+m*m;if(e<L&&e>A){const t=1/Math.sqrt(e);u*=t,R*=t,m*=t}}l[n]=u,l[n+1]=R,l[n+2]=m,l[n+3]=d,n+=c}else for(let t=0;t<d;++t){const o=4*e[t],r=f[o],i=f[o+1],d=f[o+2],u=f[o+3];let R=a*r+B*i+h*d,m=p*r+g*i+O*d,v=y*r+b*i+N*d;if(S){const e=R*R+m*m+v*v;if(e<L&&e>A){const t=1/Math.sqrt(e);R*=t,m*=t,v*=t}}for(let e=0;e<s;++e)l[n]=R,l[n+1]=m,l[n+2]=v,l[n+3]=u,n+=c}}function h(e,t,f,o,r,n=1){const s=o.typedBuffer,i=o.typedBufferStride,l=e.length;if(r*=i,f!==t.length||4!==f)if(1!==n)if(4!==f)for(let c=0;c<l;++c){const f=3*e[c];for(let e=0;e<n;++e)s[r]=t[f],s[r+1]=t[f+1],s[r+2]=t[f+2],s[r+3]=255,r+=i}else for(let c=0;c<l;++c){const f=4*e[c];for(let e=0;e<n;++e)s[r]=t[f],s[r+1]=t[f+1],s[r+2]=t[f+2],s[r+3]=t[f+3],r+=i}else{if(4===f){for(let f=0;f<l;++f){const o=4*e[f];s[r]=t[o],s[r+1]=t[o+1],s[r+2]=t[o+2],s[r+3]=t[o+3],r+=i}return}for(let f=0;f<l;++f){const o=3*e[f];s[r]=t[o],s[r+1]=t[o+1],s[r+2]=t[o+2],s[r+3]=255,r+=i}}else{s[r]=t[0],s[r+1]=t[1],s[r+2]=t[2],s[r+3]=t[3];const e=new Uint32Array(o.typedBuffer.buffer,o.start),f=i/4,c=e[r/=4];r+=f;const d=l*n;for(let t=1;t<d;++t)e[r]=c,r+=f}}function O(e,t,f,o,r=1){const n=t.typedBuffer,s=t.typedBufferStride;if(o*=s,1===r)for(let i=0;i<f;++i)n[o]=e[0],n[o+1]=e[1],n[o+2]=e[2],n[o+3]=e[3],o+=s;else for(let i=0;i<f;++i)for(let t=0;t<r;++t)n[o]=e[0],n[o+1]=e[1],n[o+2]=e[2],n[o+3]=e[3],o+=s}function N(e,t,l,d,a,p){for(const y of t.fieldNames){const t=e.vertexAttributes.get(y),N=e.indices.get(y);if(t&&N)switch(y){case i.POSITION:{s(3===t.size);const e=a.getField(y,n);s(!!e,`No buffer view for ${y}`),e&&B(N,t.data,l,e,p);break}case i.NORMAL:{s(3===t.size);const e=a.getField(y,n);s(!!e,`No buffer view for ${y}`),e&&g(N,t.data,d,e,p);break}case i.UV0:{s(2===t.size);const e=a.getField(y,r);s(!!e,`No buffer view for ${y}`),e&&c(N,t.data,e,p);break}case i.COLOR:case i.SYMBOLCOLOR:{s(3===t.size||4===t.size);const e=a.getField(y,o);s(!!e,`No buffer view for ${y}`),e&&h(N,t.data,t.size,e,p);break}case i.TANGENT:{s(4===t.size);const e=a.getField(y,f);s(!!e,`No buffer view for ${y}`),e&&b(N,t.data,d,e,p);break}case i.PROFILERIGHT:case i.PROFILEUP:case i.PROFILEVERTEXANDNORMAL:case i.FEATUREVALUE:{s(4===t.size);const e=a.getField(y,f);s(!!e,`No buffer view for ${y}`),e&&u(N,t.data,e,p)}}else if(y===i.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(i.POSITION);if(s(!!t,`No buffer view for ${y}`),t){const f=t.length,r=a.getField(y,o);O(e.objectAndLayerIdColor,r,f,p)}}}}export{l as writeBufferFloat,p as writeBufferMat3f,y as writeBufferMat4f,c as writeBufferVec2,d as writeBufferVec3,u as writeBufferVec4,a as writeBufferVec4Zeros,h as writeColor,N as writeDefaultAttributes,g as writeNormal,O as writeObjectAndLayerIdColor,B as writePosition,b as writeTangent};
5
+ import{y as e,z as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4f as f,BufferViewFloat as o,BufferViewVec4u8 as r,BufferViewVec2f as s,BufferViewVec3f as n}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as i}from"../../lib/Util.js";import{VertexAttribute as l}from"../../lib/VertexAttribute.js";function c(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let l=0;l<i;++l)s[o]=t[e[l]],o+=n;else for(let l=0;l<i;++l){const f=t[e[l]];for(let e=0;e<r;e++)s[o]=f,o+=n}}function d(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=2*e[i];r[o]=t[f],r[o+1]=t[f+1],o+=s}}function u(e,t,f,o,r){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,null==r||1===r)for(let l=0;l<i;++l){const f=3*e[l];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}else for(let l=0;l<i;++l){const f=3*e[l];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}}function a(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let l=0;l<i;++l){const f=4*e[l];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}else for(let l=0;l<i;++l){const f=4*e[l];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}}function p(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride;t*=r;for(let s=0;s<f;++s)o[t]=0,o[t+1]=0,o[t+2]=0,o[t+3]=0,t+=r}function y(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=9*e[i];for(let e=0;e<9;++e)r[o+e]=t[f+e];o+=s}}function B(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=16*e[i];for(let e=0;e<16;++e)r[o+e]=t[f+e];o+=s}}function g(t,f,o,r,s,n=1){if(!o)return void u(t,f,r,s,n);const i=r.typedBuffer,l=r.typedBufferStride,c=t.length,d=o[0],a=o[1],p=o[2],y=o[4],B=o[5],g=o[6],b=o[8],h=o[9],O=o[10],N=o[12],S=o[13],A=o[14];s*=l;let R=0,E=0,L=0;const z=e(o)?e=>{R=f[e]+N,E=f[e+1]+S,L=f[e+2]+A}:e=>{const t=f[e],o=f[e+1],r=f[e+2];R=d*t+y*o+b*r+N,E=a*t+B*o+h*r+S,L=p*t+g*o+O*r+A};if(1===n)for(let e=0;e<c;++e)z(3*t[e]),i[s]=R,i[s+1]=E,i[s+2]=L,s+=l;else for(let e=0;e<c;++e){z(3*t[e]);for(let e=0;e<n;++e)i[s]=R,i[s+1]=E,i[s+2]=L,s+=l}}function b(f,o,r,s,n,i=1){if(!r)return void u(f,o,s,n,i);const l=r,c=s.typedBuffer,d=s.typedBufferStride,a=f.length,p=l[0],y=l[1],B=l[2],g=l[4],b=l[5],h=l[6],O=l[8],N=l[9],S=l[10],A=!t(l),R=1e-6,E=1-R;n*=d;let L=0,z=0,F=0;const v=e(l)?e=>{L=o[e],z=o[e+1],F=o[e+2]}:e=>{const t=o[e],f=o[e+1],r=o[e+2];L=p*t+g*f+O*r,z=y*t+b*f+N*r,F=B*t+h*f+S*r};if(1===i)if(A)for(let e=0;e<a;++e){v(3*f[e]);const t=L*L+z*z+F*F;if(t<E&&t>R){const e=1/Math.sqrt(t);c[n]=L*e,c[n+1]=z*e,c[n+2]=F*e}else c[n]=L,c[n+1]=z,c[n+2]=F;n+=d}else for(let e=0;e<a;++e)v(3*f[e]),c[n]=L,c[n+1]=z,c[n+2]=F,n+=d;else for(let e=0;e<a;++e){if(v(3*f[e]),A){const e=L*L+z*z+F*F;if(e<E&&e>R){const t=1/Math.sqrt(e);L*=t,z*=t,F*=t}}for(let e=0;e<i;++e)c[n]=L,c[n+1]=z,c[n+2]=F,n+=d}}function h(e,f,o,r,s,n=1){if(!o)return void a(e,f,r,s,n);const i=o,l=r.typedBuffer,c=r.typedBufferStride,d=e.length,u=i[0],p=i[1],y=i[2],B=i[4],g=i[5],b=i[6],h=i[8],O=i[9],N=i[10],S=!t(i),A=1e-6,R=1-A;if(s*=c,1===n)for(let t=0;t<d;++t){const o=4*e[t],r=f[o],n=f[o+1],i=f[o+2],d=f[o+3];let a=u*r+B*n+h*i,E=p*r+g*n+O*i,L=y*r+b*n+N*i;if(S){const e=a*a+E*E+L*L;if(e<R&&e>A){const t=1/Math.sqrt(e);a*=t,E*=t,L*=t}}l[s]=a,l[s+1]=E,l[s+2]=L,l[s+3]=d,s+=c}else for(let t=0;t<d;++t){const o=4*e[t],r=f[o],i=f[o+1],d=f[o+2],a=f[o+3];let E=u*r+B*i+h*d,L=p*r+g*i+O*d,z=y*r+b*i+N*d;if(S){const e=E*E+L*L+z*z;if(e<R&&e>A){const t=1/Math.sqrt(e);E*=t,L*=t,z*=t}}for(let e=0;e<n;++e)l[s]=E,l[s+1]=L,l[s+2]=z,l[s+3]=a,s+=c}}function O(e,t,f,o,r,s=1){const n=o.typedBuffer,i=o.typedBufferStride,l=e.length;if(r*=i,f!==t.length||4!==f)if(1!==s)if(4!==f)for(let c=0;c<l;++c){const f=3*e[c];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=255,r+=i}else for(let c=0;c<l;++c){const f=4*e[c];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=t[f+3],r+=i}else{if(4===f){for(let f=0;f<l;++f){const o=4*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=t[o+3],r+=i}return}for(let f=0;f<l;++f){const o=3*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=255,r+=i}}else{n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3];const e=new Uint32Array(o.typedBuffer.buffer,o.start),f=i/4,c=e[r/=4];r+=f;const d=l*s;for(let t=1;t<d;++t)e[r]=c,r+=f}}function N(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length,i=t[0];o*=s;for(let l=0;l<n;++l)r[o]=i,o+=s}function S(e,t,f,o,r=1){const s=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let i=0;i<f;++i)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n;else for(let i=0;i<f;++i)for(let t=0;t<r;++t)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n}function A(e,t,c,u,p,y){for(const B of t.fields.keys()){const t=e.vertexAttributes.get(B),A=e.indices.get(B);if(t&&A)switch(B){case l.POSITION:{i(3===t.size);const e=p.getField(B,n);i(!!e,`No buffer view for ${B}`),e&&g(A,t.data,c,e,y);break}case l.NORMAL:{i(3===t.size);const e=p.getField(B,n);i(!!e,`No buffer view for ${B}`),e&&b(A,t.data,u,e,y);break}case l.UV0:{i(2===t.size);const e=p.getField(B,s);i(!!e,`No buffer view for ${B}`),e&&d(A,t.data,e,y);break}case l.COLOR:case l.SYMBOLCOLOR:{const e=p.getField(B,r);i(!!e,`No buffer view for ${B}`),i(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||O(A,t.data,t.size,e,y);break}case l.COLORFEATUREATTRIBUTE:{const e=p.getField(B,o);i(!!e,`No buffer view for ${B}`),i(1===t.size),e&&1===t.size&&N(A,t.data,e,y);break}case l.TANGENT:{i(4===t.size);const e=p.getField(B,f);i(!!e,`No buffer view for ${B}`),e&&h(A,t.data,u,e,y);break}case l.PROFILERIGHT:case l.PROFILEUP:case l.PROFILEVERTEXANDNORMAL:case l.FEATUREVALUE:{i(4===t.size);const e=p.getField(B,f);i(!!e,`No buffer view for ${B}`),e&&a(A,t.data,e,y)}}else if(B===l.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(l.POSITION);if(i(!!t,`No buffer view for ${B}`),t){const f=t.length,o=p.getField(B,r);S(e.objectAndLayerIdColor,o,f,y)}}}}export{c as writeBufferFloat,y as writeBufferMat3f,B as writeBufferMat4f,d as writeBufferVec2,u as writeBufferVec3,a as writeBufferVec4,p as writeBufferVec4Zeros,O as writeColor,N as writeColorFeatureAttribute,A as writeDefaultAttributes,b as writeNormal,S as writeObjectAndLayerIdColor,g as writePosition,h as writeTangent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/ColorMaterial.glsl.js";
5
+ import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaCutoff.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../lib/TransparencyPassType.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/ColorMaterial.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{Z as e}from"../../../../chunks/vec4f64.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{NoParameters as t}from"../core/shaderModules/interfaces.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../lib/DefaultVertexAttributeLocations.js";import{blendingDefault as n,oitBlending as l,oitDepthTest as a,getOITPolygonOffset as c}from"../lib/OrderIndependentTransparency.js";import{Program as p}from"../lib/Program.js";import{stencilWriteMaskOn as u,stencilToolMaskBaseParams as h,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{TransparencyPassType as m}from"../lib/TransparencyPassType.js";import{C as d}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as g,cullingParams as j,defaultDepthWriteParams as P,defaultColorWriteParams as b}from"../../../webgl/renderState.js";class y extends t{constructor(){super(...arguments),this.color=e}}class T extends s{initializeProgram(e){return new p(e.rctx,T.shader.get().build(this.configuration),o)}_createPipeline(e,t){const i=this.configuration,s=e===m.NONE,o=e===m.FrontFace;return g({blending:i.output!==r.Color&&i.output!==r.Alpha||!i.transparent?null:s?n:l(e),culling:j(i.cullFace),depthTest:{func:a(e)},depthWrite:(s||o)&&i.writeDepth?P:null,colorWrite:b,stencilWrite:i.hasOccludees?u:null,stencilTest:i.hasOccludees?t?h:f:null,polygonOffset:s||o?i.polygonOffset?S:null:c(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._createPipeline(this.configuration.transparencyPassType,!0),this._createPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,r){return r?this._occludeePipelineState:super.getPipelineState(e,r)}}T.shader=new i(d,(()=>import("./ColorMaterial.glsl.js")));const S={factor:1,units:1};export{y as ColorMaterialPassParameters,T as ColorMaterialTechnique};
5
+ import{Z as e}from"../../../../chunks/vec4f64.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as s}from"../lib/DefaultVertexAttributeLocations.js";import{blendingDefault as o,oitBlending as n,oitDepthTest as a,getOITPolygonOffset as l}from"../lib/OrderIndependentTransparency.js";import{Program as c}from"../lib/Program.js";import{stencilWriteMaskOn as p,stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as m}from"../lib/StencilUtils.js";import{TransparencyPassType as h}from"../lib/TransparencyPassType.js";import{VisualVariablePassParameters as f}from"../materials/VisualVariablePassParameters.js";import{C as d}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as g,cullingParams as P,defaultDepthWriteParams as b,defaultColorWriteParams as j}from"../../../webgl/renderState.js";class y extends f{constructor(){super(...arguments),this.color=e}}class T extends i{initializeProgram(e){return new c(e.rctx,T.shader.get().build(this.configuration),s)}_createPipeline(e,t){const i=this.configuration,s=e===h.NONE,c=e===h.FrontFace;return g({blending:i.output!==r.Color&&i.output!==r.Alpha||!i.transparent?null:s?o:n(e),culling:P(i.cullFace),depthTest:{func:a(e)},depthWrite:(s||c)&&i.writeDepth?b:null,colorWrite:j,stencilWrite:i.hasOccludees?p:null,stencilTest:i.hasOccludees?t?u:m:null,polygonOffset:s||c?i.polygonOffset?S:null:l(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._createPipeline(this.configuration.transparencyPassType,!0),this._createPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,r){return r?this._occludeePipelineState:super.getPipelineState(e,r)}}T.shader=new t(d,(()=>import("./ColorMaterial.glsl.js")));const S={factor:1,units:1};export{y as ColorMaterialPassParameters,T as ColorMaterialTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as r}from"../lib/basicInterfaces.js";import{TransparencyPassType as s}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as i}from"../materials/DefaultTechniqueConfiguration.js";class p extends i{constructor(){super(...arguments),this.output=t.Color,this.cullFace=r.None,this.transparencyPassType=s.NONE,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.transparent=!1,this.polygonOffset=!1,this.enableOffset=!0,this.writeDepth=!0,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.objectAndLayerIdColorInstanced=!1}}o([e({count:t.COUNT})],p.prototype,"output",void 0),o([e({count:r.COUNT})],p.prototype,"cullFace",void 0),o([e({count:s.COUNT})],p.prototype,"transparencyPassType",void 0),o([e()],p.prototype,"hasSlicePlane",void 0),o([e()],p.prototype,"hasVertexColors",void 0),o([e()],p.prototype,"transparent",void 0),o([e()],p.prototype,"polygonOffset",void 0),o([e()],p.prototype,"enableOffset",void 0),o([e()],p.prototype,"writeDepth",void 0),o([e()],p.prototype,"hasOccludees",void 0),o([e()],p.prototype,"hasMultipassTerrain",void 0),o([e()],p.prototype,"cullAboveGround",void 0),o([e()],p.prototype,"objectAndLayerIdColorInstanced",void 0);export{p as ColorMaterialTechniqueConfiguration};
5
+ import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as r}from"../lib/basicInterfaces.js";import{TransparencyPassType as s}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as i}from"../materials/DefaultTechniqueConfiguration.js";class p extends i{constructor(){super(...arguments),this.output=t.Color,this.cullFace=r.None,this.transparencyPassType=s.NONE,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.transparent=!1,this.polygonOffset=!1,this.enableOffset=!0,this.writeDepth=!0,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.objectAndLayerIdColorInstanced=!1,this.vvColor=!1}}o([e({count:t.COUNT})],p.prototype,"output",void 0),o([e({count:r.COUNT})],p.prototype,"cullFace",void 0),o([e({count:s.COUNT})],p.prototype,"transparencyPassType",void 0),o([e()],p.prototype,"hasSlicePlane",void 0),o([e()],p.prototype,"hasVertexColors",void 0),o([e()],p.prototype,"transparent",void 0),o([e()],p.prototype,"polygonOffset",void 0),o([e()],p.prototype,"enableOffset",void 0),o([e()],p.prototype,"writeDepth",void 0),o([e()],p.prototype,"hasOccludees",void 0),o([e()],p.prototype,"hasMultipassTerrain",void 0),o([e()],p.prototype,"cullAboveGround",void 0),o([e()],p.prototype,"objectAndLayerIdColorInstanced",void 0),o([e()],p.prototype,"vvColor",void 0),o([e({constValue:!0})],p.prototype,"hasVvInstancing",void 0),o([e({constValue:!1})],p.prototype,"vvSize",void 0),o([e({constValue:!1})],p.prototype,"vvOpacity",void 0);export{p as ColorMaterialTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{HandleOwnerMixin as r}from"../../../../core/HandleOwner.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{applySome as s,mapOr as o}from"../../../../core/maybe.js";import{throwIfAborted as a,ignoreAbortErrors as n}from"../../../../core/promiseUtils.js";import{watch as l,on as u,initial as p,sync as c}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{ObservableValue as y}from"../../../../core/accessorSupport/tracking/ObservableValue.js";import{elevationContextAffectsAlignment as g}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as f}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as m}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{convertSnappingCandidate as S,makeGetGroundElevation as _}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as v}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as w}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as b}from"./featureServiceSource/FeatureServiceTilesSimple.js";import I from"../../../support/debugFlags.js";let j=class extends(r(t)){get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get updating(){return this._workerHandle?.updating||this.updatingHandles.updating}get configuration(){const{view:e}=this,t=null!=e?e.type:"2d";return{filter:this._layer.createQuery(),customParameters:this._layer.customParameters,viewType:t}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._workerHandle=null,this._debug=null}initialize(){let e;const t=this.view;if(null!=t)switch(t.type){case"2d":this._tilesOfInterest=new f({view:t,layer:this._layer}),e=this._workerHandle=new w;break;case"3d":{const{resourceController:r}=t,i=this._layer,c=t.whenLayerView(i);this._tilesOfInterest=new m({view:t}),e=this._workerHandle=new w({schedule:e=>r.immediate.schedule(e),hasZ:this._layer.hasZ&&(this._layer.returnZ??!0),elevationAlignPointsInFeatures:async(e,t)=>{const r=await c;return a(t),r.elevationAlignPointsInFeatures(e,t)},queryForSymbologySnapping:async(e,t)=>{const r=await c;return a(t),r.queryForSymbologySnapping(e,t)}});const d=new y(null);c.then((e=>d.set(e))),this.addHandles([t.elevationProvider.on("elevation-change",(({context:t})=>{const{elevationInfo:r}=i;g(t,r)&&n(e.notifyElevationSourceChange())})),l((()=>i.elevationInfo),(()=>n(e.notifyElevationSourceChange())),p),l((()=>s(d.get(),(({processor:e})=>e?.renderer))),(()=>n(e.notifySymbologyChange())),p),l((()=>o(d.get(),!1,(e=>e.symbologySnappingSupported))),(t=>n(e.setSymbologySnappingSupported(t))),p),u((()=>d.get()?.layer),["edits","apply-edits","graphic-update"],(()=>e.notifySymbologyChange()))]);break}}else this._tilesOfInterest=new b({layer:this._layer}),e=this._workerHandle=new w;this.handles.add([i(e)]),n(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this.updatingHandles.add((()=>this._updateTilesParameters),(()=>n(e.updateTiles(this._updateTilesParameters,null))),p),this.handles.add([l((()=>this.configuration),(t=>n(e.configure(t,null))),c)]),null!=t&&this.handles.add(l((()=>I.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES),(r=>{r&&!this._debug?(this._debug=new v({view:t,handle:e}),this.handles.add(i(this._debug),"debug")):!r&&this._debug&&this.handles.remove("debug")}),p)),this.handles.add(this.layerSource.layer.on("apply-edits",(t=>{n(e.applyEdits(t,null))})))}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:r,point:i}=e;this._tilesOfInterest.pointOfInterest=r.arrayToPoint(i);const s=this._getGroundElevation;return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map((e=>S(e,s)))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}get _getGroundElevation(){return _(this.view)}};e([d({constructOnly:!0})],j.prototype,"spatialReference",void 0),e([d({constructOnly:!0})],j.prototype,"layerSource",void 0),e([d({constructOnly:!0})],j.prototype,"view",void 0),e([d()],j.prototype,"_tilesOfInterest",void 0),e([d({readOnly:!0})],j.prototype,"_updateTilesParameters",null),e([d({readOnly:!0})],j.prototype,"updating",null),e([d({readOnly:!0})],j.prototype,"configuration",null),e([d({readOnly:!0})],j.prototype,"availability",null),e([d()],j.prototype,"_getGroundElevation",null),j=e([h("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],j);export{j as FeatureServiceSnappingSource};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{HandleOwnerMixin as r}from"../../../../core/HandleOwner.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{applySome as s}from"../../../../core/maybe.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{watch as n,on as l,initial as u,sync as p}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{ObservableValue as h}from"../../../../core/accessorSupport/tracking/ObservableValue.js";import{elevationContextAffectsAlignment as y}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as g}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as f}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{convertSnappingCandidate as m,makeGetGroundElevation as S}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as _}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as v}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as w}from"./featureServiceSource/FeatureServiceTilesSimple.js";import b from"../../../support/debugFlags.js";let I=class extends(r(t)){get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get updating(){return this._workerHandle?.updating||this.updatingHandles.updating}get configuration(){const{view:e}=this,t=null!=e?e.type:"2d";return{filter:this._layer.createQuery(),customParameters:this._layer.customParameters,viewType:t}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._workerHandle=null,this._debug=null}initialize(){let e;const t=this.view;if(null!=t)switch(t.type){case"2d":this._tilesOfInterest=new g({view:t,layer:this._layer}),e=this._workerHandle=new v;break;case"3d":{const{resourceController:r}=t,i=this._layer,p=t.whenLayerView(i);this._tilesOfInterest=new f({view:t}),e=this._workerHandle=new v({schedule:e=>r.immediate.schedule(e),hasZ:this._layer.hasZ&&(this._layer.returnZ??!0),elevationAlignPointsInFeatures:async(e,t)=>{const r=await p;return o(t),r.elevationAlignPointsInFeatures(e,t)},queryForSymbologySnapping:async(e,t)=>{const r=await p;return o(t),r.queryForSymbologySnapping(e,t)}});const c=new h(null);p.then((e=>c.set(e))),this.addHandles([t.elevationProvider.on("elevation-change",(({context:t})=>{const{elevationInfo:r}=i;y(t,r)&&a(e.notifyElevationSourceChange())})),n((()=>i.elevationInfo),(()=>a(e.notifyElevationSourceChange())),u),n((()=>s(c.get(),(({processor:e})=>e?.renderer))),(()=>a(e.notifySymbologyChange())),u),n((()=>c.get()?.symbologySnappingSupported??!1),(t=>a(e.setSymbologySnappingSupported(t))),u),l((()=>c.get()?.layer),["edits","apply-edits","graphic-update"],(()=>e.notifySymbologyChange()))]);break}}else this._tilesOfInterest=new w({layer:this._layer}),e=this._workerHandle=new v;this.handles.add([i(e)]),a(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this.updatingHandles.add((()=>this._updateTilesParameters),(()=>a(e.updateTiles(this._updateTilesParameters,null))),u),this.handles.add([n((()=>this.configuration),(t=>a(e.configure(t,null))),p)]),null!=t&&this.handles.add(n((()=>b.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES),(r=>{r&&!this._debug?(this._debug=new _({view:t,handle:e}),this.handles.add(i(this._debug),"debug")):!r&&this._debug&&this.handles.remove("debug")}),u)),this.handles.add(this.layerSource.layer.on("apply-edits",(t=>{a(e.applyEdits(t,null))})))}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:r,point:i}=e;this._tilesOfInterest.pointOfInterest=r.arrayToPoint(i);const s=this._getGroundElevation;return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map((e=>m(e,s)))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}get _getGroundElevation(){return S(this.view)}};e([c({constructOnly:!0})],I.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],I.prototype,"layerSource",void 0),e([c({constructOnly:!0})],I.prototype,"view",void 0),e([c()],I.prototype,"_tilesOfInterest",void 0),e([c({readOnly:!0})],I.prototype,"_updateTilesParameters",null),e([c({readOnly:!0})],I.prototype,"updating",null),e([c({readOnly:!0})],I.prototype,"configuration",null),e([c({readOnly:!0})],I.prototype,"availability",null),e([c()],I.prototype,"_getGroundElevation",null),I=e([d("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],I);export{I as FeatureServiceSnappingSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as e}from"./SketchTooltipInfo.js";let r=class extends e{constructor(o){super(o),this.type="transform-rotate",this.rotationType="geographic"}};o([t()],r.prototype,"type",void 0),o([t()],r.prototype,"rotation",void 0),o([t()],r.prototype,"rotationPrecision",void 0),o([t()],r.prototype,"orientation",void 0),o([t()],r.prototype,"orientationPrecision",void 0),o([t()],r.prototype,"rotationType",void 0),r=o([i("esri.views.interactive.tooltip.TransformRotateTooltipInfo")],r);let s=class extends e{constructor(o){super(o),this.type="transform-scale",this.sizeUnit=null,this.sizePrecision=null}};o([t()],s.prototype,"type",void 0),o([t()],s.prototype,"scale",void 0),o([t()],s.prototype,"size",void 0),o([t()],s.prototype,"sizeUnit",void 0),o([t()],s.prototype,"sizePrecision",void 0),s=o([i("esri.views.interactive.tooltip.TransformScaleTooltipInfo")],s);let p=class extends e{constructor(o){super(o),this.type="transform-absolute",this.orientationEnabled=!0,this.orientationPrecision=null,this.rotationType="geographic",this.sizeUnit=null,this.sizeEnabled=!0,this.sizePrecision=null}};o([t()],p.prototype,"type",void 0),o([t()],p.prototype,"orientation",void 0),o([t()],p.prototype,"orientationEnabled",void 0),o([t()],p.prototype,"orientationPrecision",void 0),o([t()],p.prototype,"rotationType",void 0),o([t()],p.prototype,"size",void 0),o([t()],p.prototype,"sizeUnit",void 0),o([t()],p.prototype,"sizeEnabled",void 0),o([t()],p.prototype,"sizePrecision",void 0),p=o([i("esri.views.interactive.tooltip.TransformAbsoluteTooltipInfo")],p);export{p as TransformAbsoluteTooltipInfo,r as TransformRotateTooltipInfo,s as TransformScaleTooltipInfo};
5
+ import{_ as o}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as e}from"./SketchTooltipInfo.js";let r=class extends e{constructor(o){super(o),this.type="transform-rotate",this.orientationEnabled=!0,this.rotationType="geographic"}};o([t()],r.prototype,"type",void 0),o([t()],r.prototype,"rotation",void 0),o([t()],r.prototype,"rotationPrecision",void 0),o([t()],r.prototype,"orientation",void 0),o([t()],r.prototype,"orientationEnabled",void 0),o([t()],r.prototype,"orientationPrecision",void 0),o([t()],r.prototype,"rotationType",void 0),r=o([i("esri.views.interactive.tooltip.TransformRotateTooltipInfo")],r);let s=class extends e{constructor(o){super(o),this.type="transform-scale",this.sizeEnabled=!0,this.sizeUnit=null,this.sizePrecision=null}};o([t()],s.prototype,"type",void 0),o([t()],s.prototype,"scale",void 0),o([t()],s.prototype,"size",void 0),o([t()],s.prototype,"sizeEnabled",void 0),o([t()],s.prototype,"sizeUnit",void 0),o([t()],s.prototype,"sizePrecision",void 0),s=o([i("esri.views.interactive.tooltip.TransformScaleTooltipInfo")],s);let p=class extends e{constructor(o){super(o),this.type="transform-absolute",this.orientationEnabled=!0,this.orientationPrecision=null,this.rotationType="geographic",this.sizeEnabled=!0,this.sizePrecision=null,this.sizeUnit=null}};o([t()],p.prototype,"type",void 0),o([t()],p.prototype,"orientation",void 0),o([t()],p.prototype,"orientationEnabled",void 0),o([t()],p.prototype,"orientationPrecision",void 0),o([t()],p.prototype,"rotationType",void 0),o([t()],p.prototype,"size",void 0),o([t()],p.prototype,"sizeEnabled",void 0),o([t()],p.prototype,"sizePrecision",void 0),o([t()],p.prototype,"sizeUnit",void 0),p=o([i("esri.views.interactive.tooltip.TransformAbsoluteTooltipInfo")],p);export{p as TransformAbsoluteTooltipInfo,r as TransformRotateTooltipInfo,s as TransformScaleTooltipInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{formatAngle as o,formatRelativeAngle as r}from"../../../../core/quantityFormatUtils.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as e}from"../css.js";import{TooltipContent as i}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as p}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as n}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as a}from"../../../../widgets/support/jsxFactory.js";const m={base:`${e} ${`${e}--transform-rotate`}`};let c=class extends i{render(){const{info:t}=this,{visibleElements:s}=t.tooltipOptions,e=this._messagesTooltip.sketch;return a(p,{className:m.base,helpMessage:this._getHelpMessage()},s.rotation&&a(n,{title:e.rotation,value:r(t.rotation,t.rotationType,t.rotationPrecision)}),s.orientation&&a(n,{title:e.orientation,value:o(t.orientation,t.rotationType,t.orientationPrecision)}))}};c=t([s("esri.views.interactive.tooltip.content.TooltipContentTransformRotate")],c);export{c as TooltipContentTransformRotate};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{formatAngle as o,formatRelativeAngle as r}from"../../../../core/quantityFormatUtils.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as e}from"../css.js";import{TooltipContent as i}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as n}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as p}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as a}from"../../../../widgets/support/jsxFactory.js";const m={base:`${e} ${`${e}--transform-rotate`}`};let l=class extends i{render(){const{info:t}=this,{visibleElements:s}=t.tooltipOptions,e=this._messagesTooltip.sketch;return a(n,{className:m.base,helpMessage:this._getHelpMessage()},s.rotation&&a(p,{title:e.rotation,value:r(t.rotation,t.rotationType,t.rotationPrecision)}),s.orientation&&t.orientationEnabled&&a(p,{title:e.orientation,value:o(t.orientation,t.rotationType,t.orientationPrecision)}))}};l=t([s("esri.views.interactive.tooltip.content.TooltipContentTransformRotate")],l);export{l as TooltipContentTransformRotate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as s}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as e}from"../css.js";import{TooltipContent as o}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${e} ${`${e}--transform-scale`}`};let c=class extends o{render(){const{scale:s,size:t,sizePrecision:e,sizeUnit:o,tooltipOptions:c}=this.info,{visibleElements:l}=c,m=this._messagesTooltip.sketch;return p(r,{className:a.base,helpMessage:this._getHelpMessage()},l.scale&&p(i,{title:m.scale,value:this._formatPercentage(s)}),l.size&&p(i,{title:m.size,value:this._formatLength(t,o,e)}))}};c=s([t("esri.views.interactive.tooltip.content.TooltipContentTransformScale")],c);export{c as TooltipContentTransformScale};
5
+ import{_ as s}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as t}from"../css.js";import{TooltipContent as o}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${t} ${`${t}--transform-scale`}`};let l=class extends o{render(){const{info:s}=this,{visibleElements:e}=s.tooltipOptions,t=this._messagesTooltip.sketch;return p(r,{className:a.base,helpMessage:this._getHelpMessage()},e.scale&&p(i,{title:t.scale,value:this._formatPercentage(s.scale)}),e.size&&s.sizeEnabled&&p(i,{title:t.size,value:this._formatLength(s.size,s.sizeUnit,s.sizePrecision)}))}};l=s([e("esri.views.interactive.tooltip.content.TooltipContentTransformScale")],l);export{l as TooltipContentTransformScale};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- const o="esri-bookmarks",e=`${o}__authoring`,i=`${o}__bookmark`,a=`${o}__time-extent`,n={base:`${o} esri-widget--panel`,loaderContainer:`${o}__loader-container`,loader:`${o}__loader`,fadeIn:`${o}--fade-in`,bookmarkList:`${o}__list`,bookmarkListSortable:`${o}__list--sortable`,bookmark:i,bookmarkButton:`${i}-button`,bookmarkImageContainer:`${i}-image-container`,bookmarkImageContainerHasImage:`${i}-image-container--has-image`,bookmarkEditButtonContainer:`${i}-edit-button-container`,bookmarkEditButton:`${i}-edit-button`,bookmarkDragHandle:`${o}_bookmark-drag-handle`,bookmarkDragHandleIcon:`${o}_bookmark-drag-handle-icon`,bookmarkIcon:`${i}-icon`,bookmarkImage:`${o}__image`,bookmarkLabel:`${i}-label`,bookmarkName:`${i}-name`,bookmarkTimeExtent:`${i}-time-extent`,bookmarkActive:`${i}--active`,noBookmarksContainer:"esri-widget__content--empty",noBookmarksHeader:`${o}__no-bookmarks-heading`,noBookmarksIcon:"esri-widget__no-bookmark-icon",noBookmarksDescription:`${o}__no-bookmarks-description`,addingBookmark:`${o}__adding-bookmark`,addBookmark:`${o}__add-bookmark`,addBookmarkButton:`${o}__add-bookmark-button`,addBookmarkIcon:`${o}__add-bookmark-icon`,authoringCard:`${e}-card`,authoringContainer:`${e}-container`,authoringForm:`${e}-form`,authoringLabel:`${e}-label`,authoringActions:`${e}-actions`,authoringInputInvalid:`${e}-input--invalid`,authoringDeleteButton:`${e}-delete-button`,authoringCancelButton:`${e}-cancel-button`,timeExtentContainer:`${a}-container`,timeExtent:a,timeExtentGroup:`${a}-group`,timeExtentDate:`${a}-date`,timeExtentTime:`${a}-time`,esriWidget:"esri-widget",esriWidgetDisabled:"esri-widget--disabled",esriButton:"esri-button",esriButtonTertiary:"esri-button--tertiary",esriInput:"esri-input",iconHandle:"esri-icon-handle-vertical",iconPlus:"esri-icon-plus",iconEdit:"esri-icon-edit",iconHandleHorizontal:"esri-icon-handle-horizontal",iconRefresh:"esri-icon-refresh",iconLink:"esri-icon-link",iconRemove:"esri-icon-erase",widgetIcon:"esri-icon-bookmark",header:"esri-widget__heading",loading:"esri-icon-loading-indicator",rotating:"esri-rotating"};export{n as CSS};
5
+ const o="esri-bookmarks",e=`${o}__authoring`,a=`${o}__bookmark`,i=`${o}__time-extent`,n={base:`${o} esri-widget--panel`,loaderContainer:`${o}__loader-container`,loader:`${o}__loader`,fadeIn:`${o}--fade-in`,bookmarkList:`${o}__list`,bookmarkListSortable:`${o}__list--sortable`,bookmark:a,bookmarkButton:`${a}-button`,bookmarkImageContainer:`${a}-image-container`,bookmarkImageContainerHasImage:`${a}-image-container--has-image`,bookmarkEditButtonContainer:`${a}-edit-button-container`,bookmarkEditButton:`${a}-edit-button`,bookmarkDragHandle:`${o}_bookmark-drag-handle`,bookmarkDragHandleIcon:`${o}_bookmark-drag-handle-icon`,bookmarkIcon:`${a}-icon`,bookmarkImage:`${o}__image`,bookmarkLabel:`${a}-label`,bookmarkName:`${a}-name`,bookmarkTimeExtent:`${a}-time-extent`,bookmarkActive:`${a}--active`,noBookmarksContainer:"esri-widget__content--empty",noBookmarksHeader:`${o}__no-bookmarks-heading`,noBookmarksIcon:"esri-widget__no-bookmark-icon",noBookmarksDescription:`${o}__no-bookmarks-description`,addingBookmark:`${o}__adding-bookmark`,addBookmark:`${o}__add-bookmark`,addBookmarkButton:`${o}__add-bookmark-button`,addBookmarkIcon:`${o}__add-bookmark-icon`,authoringCard:`${e}-card`,authoringContainer:`${e}-container`,authoringForm:`${e}-form`,authoringLabel:`${e}-label`,authoringLabelStartPadding:`${e}-label--start-padding`,authoringActions:`${e}-actions`,authoringInputInvalid:`${e}-input--invalid`,authoringDeleteButton:`${e}-delete-button`,authoringCancelButton:`${e}-cancel-button`,timeExtentContainer:`${i}-container`,timeExtent:i,timeExtentGroup:`${i}-group`,timeExtentDate:`${i}-date`,timeExtentTime:`${i}-time`,esriWidget:"esri-widget",esriWidgetDisabled:"esri-widget--disabled",esriButton:"esri-button",esriButtonTertiary:"esri-button--tertiary",esriInput:"esri-input",iconHandle:"esri-icon-handle-vertical",iconPlus:"esri-icon-plus",iconEdit:"esri-icon-edit",iconHandleHorizontal:"esri-icon-handle-horizontal",iconRefresh:"esri-icon-refresh",iconLink:"esri-icon-link",iconRemove:"esri-icon-erase",widgetIcon:"esri-icon-bookmark",header:"esri-widget__heading",loading:"esri-icon-loading-indicator",rotating:"esri-rotating"};export{n as CSS};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import{eventKey as e}from"../core/events.js";import{isSome as o}from"../core/maybe.js";import{watch as s,initial as i,on as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as l,convertDateFormatToIntlOptions as u}from"../intl/date.js";import{SlideThumbnail as m}from"../webdoc/support/SlideThumbnail.js";import k from"./Widget.js";import h from"./Bookmarks/BookmarksUserState.js";import c from"./Bookmarks/BookmarksViewModel.js";import{CSS as p}from"./Bookmarks/css.js";import b from"./FeatureTable/Grid/support/ButtonMenu.js";import _ from"./FeatureTable/Grid/support/ButtonMenuItem.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{Heading as B}from"./support/Heading.js";import{isActivationKey as f}from"./support/widgetUtils.js";import{messageBundle as v}from"./support/decorators/messageBundle.js";import{vmEvent as E}from"./support/decorators/vmEvent.js";import{tsx as I}from"./support/jsxFactory.js";import y from"sortablejs";function S(t,e,o){t.splice(o,0,t.splice(e,1)[0])}const w="bookmarks",T="data-bookmark-uid",A={addBookmark:!0,thumbnail:!0,time:!0},x=/^https:\/\/.*/i,U="esri.widgets.Bookmarks";let C=class extends k{constructor(t,e){super(t,e),this._tooltipReferenceMap=new Map,this._addInputNode=null,this._editInputNode=null,this._urlEditInputNode=null,this._addBookmarkButtonNode=null,this._focusAddBookmarkButton=!1,this._focusEditInputBox=!1,this._focusAddInputBox=!1,this._focusUrlEditInputBox=!1,this._sortable=null,this._sortableNode=null,this._focusSortUid=null,this._selectedSortUid=null,this._sortableSavedItems=[],this._editIncludeTimeExtent=void 0,this._userState=null,this.disabled=!1,this.editingEnabled=!1,this.headingLevel=2,this.iconClass=p.widgetIcon,this.icon=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.viewModel=new c,this.visibleElements={...A}}initialize(){this.addHandles([s((()=>this.viewModel?.bookmarks),(()=>this._bookmarksInitialized()),i),s((()=>this.editingEnabled),(()=>this._toggleSorting()),i)])}destroy(){this.removeAllHandles(),this._destroySortable(),this._editMenu.destroy(),this._tooltipReferenceMap.clear()}loadDependencies(){return g({label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}get _editMenuItems(){const{messages:t,_userState:e}=this,s=e?.editedBookmark?.thumbnail?.url;return[new _({label:t?.menu.refreshThumbnail,iconClass:p.iconRefresh,clickFunction:()=>this._refreshThumbnail()}),new _({label:s&&x.test(s)?t?.menu.editImageUrl:t?.menu.useImageUrl,iconClass:p.iconLink,clickFunction:()=>this._startUseImageUrl()}),s?new _({label:t?.menu.removeThumbnail,iconClass:p.iconRemove,clickFunction:()=>this._removeThumbnail()}):null].filter(o)}get _editMenu(){const{_editMenuItems:t,messages:e,disabled:o}=this,s=this._get("_editMenu");s&&s.destroy();const i=new b({disabled:o,iconClass:p.iconHandleHorizontal,label:e?.menu.label});return i.items=t,i}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(t){this.viewModel.defaultCreateOptions=t}get defaultEditOptions(){return this.viewModel.defaultEditOptions}set defaultEditOptions(t){this.viewModel.defaultEditOptions=t}get bookmarks(){return this.viewModel.bookmarks}set bookmarks(t){this.viewModel.bookmarks=t}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}castVisibleElements(t){return{...A,...t}}endAddBookmark(){this._userState=null}goTo(t){return this.viewModel.goTo(t)}render(){const{state:t}=this.viewModel,e="loading"===t?this.renderLoading():this.renderBookmarks();return I("div",{class:this.classes(p.base,p.esriWidget,{[p.esriWidgetDisabled]:this.disabled})},e)}startAddBookmark(){this._userState=new h({state:"add"}),this._focusAddInputBox=!0,this.scheduleRender()}renderBookmarkTooltips(t){return t.toArray().map((t=>this.renderBookmarkTooltip(t)))??[]}renderBookmarkTooltip(t){const{_tooltipReferenceMap:e,messagesCommon:o}=this,s=this._getBookmarkTitle(t),i=`${o?.dragHandleTitle} ${s}`;return t?I("calcite-tooltip",{key:`tooltip-${t.uid}`,label:i,referenceElement:e.get(t.uid)},i):null}renderLoading(){return I("div",{class:p.loaderContainer,key:"loader",tabIndex:this.disabled?-1:void 0},I("div",{class:p.loader}))}renderNoBookmarksContainer(){const{messages:t,disabled:e}=this;return I("div",{class:p.noBookmarksContainer,key:"no-bookmarks",tabIndex:e?-1:void 0},I("span",{"aria-hidden":"true",class:this.classes(p.noBookmarksIcon,p.widgetIcon)}),I(B,{level:this.headingLevel,class:this.classes(p.header,p.noBookmarksHeader)},t?.noBookmarksHeading),I("p",{class:p.noBookmarksDescription},t?.noBookmarksDescription))}renderAddBookmarkLoading(){return I("div",{key:"adding-bookmark",class:p.addingBookmark},I("span",{"aria-hidden":"true",class:this.classes(p.loading,p.rotating)}),this.messages?.addingBookmark)}renderBookmarkItems(t){if(!t)return[];const{_userState:e,editingEnabled:o}=this;return t.map((t=>o&&t&&e&&("edit"===e.state||"edit-thumbnail"===e.state)&&e.bookmark===t?"edit-thumbnail"===e.state?this.renderEditingBookmarkUrl(e.editedBookmark):this.renderEditingBookmark(e.editedBookmark):this.renderBookmark(t))).toArray()}renderBookmarksContainer(t){const{_userState:e,editingEnabled:o,disabled:s}=this,i="add"===e?.state,r=o&&!i?this.renderAddBookmarkButton():null,a=o?i&&e.loading?this.renderAddBookmarkLoading():"add"===e?.state?this.renderAddingBookmark():null:null;return[I("ul",{key:"bookmark-list","aria-label":this.messages?.widgetLabel,class:this.classes(p.bookmarkList,{[p.bookmarkListSortable]:this.editingEnabled}),afterCreate:this._sortNodeCreated,afterRemoved:this._destroySortable,"data-node-ref":"_sortableNode",bind:this,tabIndex:s?-1:void 0},this.renderBookmarkItems(t)),r,a]}renderAddBookmarkButton(){return this.visibleElements.addBookmark?I("div",{key:"add-bookmark-item",class:p.addBookmark},I("button",{class:this.classes(p.esriButton,p.esriButtonTertiary,p.addBookmarkButton),disabled:this.disabled,onclick:this.startAddBookmark,afterCreate:this._storeAddBookmarkButton,afterUpdate:this._storeAddBookmarkButton,"data-node-ref":"_addBookmarkButtonNode",bind:this,type:"button"},I("span",{"aria-hidden":"true",class:this.classes(p.addBookmarkIcon,p.iconPlus)}),this.messages?.addBookmark)):null}renderBookmarks(){const{bookmarks:t}=this.viewModel,e=t&&t.filter(Boolean),o=e&&e.length,s=o||this.editingEnabled?this.renderBookmarksContainer(e):null;return[o?null:this.renderNoBookmarksContainer(),s,this.renderBookmarkTooltips(t)]}renderEditContainer(t){const{messagesCommon:e,disabled:o}=this,s=this._getBookmarkTitle(t);return I("div",{class:p.bookmarkEditButtonContainer,key:"edit-container"},I("button",{disabled:o,title:`${e?.edit} ${s}`,"aria-label":`${e?.edit} ${s}`,"data-bookmark":t,onclick:this._showEditBookmarkForm,bind:this,class:p.bookmarkEditButton,type:"button"},I("span",{"aria-hidden":"true",class:p.iconEdit})))}renderDragHandle(t){const{messagesCommon:e,disabled:o}=this,s=this._getBookmarkTitle(t),i={[T]:t.uid};return I("div",{role:"button",tabIndex:o?-1:0,key:"drag-handle",bind:this,class:p.bookmarkDragHandle,onkeydown:this._dragHandleKeydown,"data-bookmark":t,afterCreate:this._focusDragHandle,afterUpdate:this._focusDragHandle,onblur:this._dragHandleBlur,"aria-pressed":this._selectedSortUid===t.uid?"true":"false","aria-label":`${e?.dragHandleTitle} ${s}`,...i},I("span",{"aria-hidden":"true",class:this.classes(p.bookmarkDragHandleIcon,p.iconHandle)}))}renderBookmarkImageIcon(){return I("span",{"aria-hidden":"true",class:this.classes(p.bookmarkIcon,p.widgetIcon)})}renderBookmarkImage(t){const{visibleElements:e}=this,{thumbnail:o}=t,s=o&&o.url||"";return e.thumbnail&&s?I("img",{src:s,alt:"",class:p.bookmarkImage}):null}renderBookmarkTimeSwitch(t){const{messages:e,disabled:o}=this,{timeExtent:s}=t,{view:i}=this.viewModel;return i?.timeExtent??s?I("calcite-label",{layout:"inline-space-between"},e?.includeTimeExtent,I("calcite-switch",{scale:"s",disabled:o,checked:!!s,onCalciteSwitchChange:t=>{const e=t.currentTarget;this._editIncludeTimeExtent=!!e.checked}})):null}renderBookmarkTimeExtent(t){const{visibleElements:e}=this,{timeExtent:o}=t;return o?I("span",{class:p.timeExtent},[null!=o.start&&I("span",{key:"start-date-group",class:p.timeExtentGroup},I("span",{key:"start-date",class:p.timeExtentDate},this._formatDate(o.start)),e.time&&I("span",{key:"start-time",class:p.timeExtentTime},this._formatTime(o.start))),null!=o.end&&(null==o.start||o.start.getTime()!==o.end.getTime())&&I("span",{key:"end-date-group",class:p.timeExtentGroup},I("span",{key:"end-date",class:p.timeExtentDate},this._formatDate(o.end)),e.time&&I("span",{key:"end-time",class:p.timeExtentTime},this._formatTime(o.end)))]):null}renderBookmarkButton(t){const{disabled:e}=this,{timeExtent:o}=t,{abilities:s}=this.viewModel,i=this._getBookmarkTitle(t),{thumbnail:r}=t,a=I("div",{class:this.classes(p.bookmarkImageContainer,r&&r.url?p.bookmarkImageContainerHasImage:null)},this.renderBookmarkImage(t)||this.renderBookmarkImageIcon()),n=s.time&&o?I("span",{key:"time-extent",class:p.bookmarkTimeExtent},this.renderBookmarkTimeExtent(t)):null;return I("button",{disabled:e,key:"bookmark-button",class:p.bookmarkButton,bind:this,"data-bookmark":t,onclick:this._goToBookmark,type:"button"},a,I("div",{class:p.bookmarkLabel},I("span",{key:"bookmark-title",class:p.bookmarkName},i),n))}renderBookmark(t){const{activeBookmark:e}=this.viewModel,o={[p.bookmarkActive]:e===t},s=this.editingEnabled?this.renderEditContainer(t):null,i={[T]:t.uid},r=this.editingEnabled?this.renderDragHandle(t):null;return I("li",{key:t,class:this.classes(p.bookmark,o),...i},r,this.renderBookmarkButton(t),s)}renderEditingBookmarkName(t){const{messages:e,_userState:o,disabled:s}=this,i="name-required"===o?.validationState;return I("label",{class:p.authoringLabel},e?.title,i?I("strong",null,e?.invalidTitle):null,I("input",{required:!0,disabled:s,bind:this,class:this.classes(p.esriInput,i?p.authoringInputInvalid:null),type:"text",value:t.name,afterCreate:this._storeEditInput,afterUpdate:this._focusEditInput,"data-bookmark":t,"data-node-ref":"_editInputNode",placeholder:e?.titlePlaceholder}))}renderEditingBookmarkUrlActions(){const{messagesCommon:t,disabled:e}=this;return I("div",{class:p.authoringActions},I("input",{type:"button",disabled:e,value:t?.back,class:this.classes(p.esriButton,p.esriButtonTertiary),onclick:this._closeUrlEditBookmarkForm,bind:this}),I("input",{class:p.esriButton,disabled:e,type:"submit",value:t?.add}))}renderEditingBookmarkActions(){const{messagesCommon:t,disabled:e}=this,o=this._userState?.bookmark;return I("div",{class:p.authoringActions},I("input",{type:"button",disabled:e,value:t?.delete,class:this.classes(p.esriButton,p.esriButtonTertiary,p.authoringDeleteButton),"data-bookmark":o,onclick:this._deleteBookmark,bind:this}),I("input",{disabled:e,type:"button",value:t?.cancel,class:this.classes(p.esriButton,p.esriButtonTertiary),onclick:this._closeEditBookmarkForm,bind:this}),I("input",{class:p.esriButton,disabled:e,type:"submit",value:t?.save}))}renderEditingBookmarkUrlInput(t){const{messages:e,_userState:o,disabled:s}=this,i=t.thumbnail?.url,r=i&&x.test(i)?i:void 0,a="absolute-url-required"===o?.validationState;return I("label",{class:p.authoringLabel},a?I("strong",null,e?.invalidImageUrl):null,I("input",{required:!0,disabled:s,bind:this,class:this.classes(p.esriInput,a?p.authoringInputInvalid:null),type:"text",value:r,afterCreate:this._storeUrlEditInput,afterUpdate:this._focusUrlEditInput,"data-bookmark":t,"data-node-ref":"_urlEditInputNode",title:e?.imageUrlTooltip,placeholder:e?`https://<${e.imageUrlPlaceholder}>`:void 0}))}renderEditingBookmarkUrl(t){if(!t)return null;const e={[T]:t.uid};return I("li",{key:"edit-bookmark-url-form",class:p.authoringCard,...e},I("form",{class:p.authoringForm,disabled:this.disabled,onsubmit:this._editBookmarkUrlSubmit,bind:this},this.renderEditingBookmarkUrlInput(t),this.renderEditingBookmarkUrlActions()))}renderEditingBookmark(t){if(!t)return null;const e={[T]:t.uid},{abilities:o}=this.viewModel,s=o.time?I("div",{key:"edit-bookmark-time-container",class:p.timeExtentContainer},this.renderBookmarkTimeSwitch(t),this._editIncludeTimeExtent&&this.renderBookmarkTimeExtent(t)):null;return I("li",{key:"edit-bookmark-form",class:p.authoringCard,...e},I("form",{class:p.authoringForm,disabled:this.disabled,onsubmit:this._editBookmarkSubmit,bind:this},I("div",{class:p.authoringContainer},this.visibleElements.thumbnail?I("div",{class:p.bookmarkImageContainer},this.renderBookmarkImage(t),this._editMenu.render()):null,this.renderEditingBookmarkName(t)),s,this.renderEditingBookmarkActions()))}renderAddingBookmarkName(){const{_userState:t,messages:e,disabled:o}=this,s="name-required"===t?.validationState;return I("label",{class:p.authoringLabel},e?.title,s?I("strong",null,e?.invalidTitle):null,I("input",{required:!0,disabled:o,bind:this,class:this.classes(p.esriInput,s?p.authoringInputInvalid:null),type:"text",afterCreate:this._storeAddInput,afterUpdate:this._focusAddInput,"data-node-ref":"_addInputNode",value:"",placeholder:e?.titlePlaceholder}))}renderAddingBookmarkActions(){const{messagesCommon:t,disabled:e}=this;return I("div",{class:this.classes(p.authoringActions)},I("input",{type:"button",disabled:e,value:t?.cancel,class:this.classes(p.esriButton,p.esriButtonTertiary,p.authoringCancelButton),onclick:this._endAddBookmark.bind(this),bind:this}),I("input",{class:p.esriButton,disabled:e,type:"submit",value:t?.add}))}renderAddingBookmark(){return I("div",{key:"add-bookmark-form",class:p.authoringCard},I("form",{class:p.authoringForm,onsubmit:this._addBookmarkSubmit,bind:this},this.renderAddingBookmarkName(),this.renderAddingBookmarkActions()))}_setTooltipReference(t,e){this._tooltipReferenceMap.set(e.uid,t),this.scheduleRender()}_getBookmarkTitle(t){return(t?.name||this.messagesCommon?.untitled)??""}_formatDate(t){return t?l(t,u("short-date")):""}_formatTime(t){return t?l(t,u("long-time")):""}_dragHandleBlur(){this._selectedSortUid=null,this.scheduleRender()}_dragHandleKeydown(t){const{_sortableSavedItems:o}=this,s=["ArrowDown","ArrowUp","Escape","Tab"," ","Enter"],i=e(t);if(!s.includes(i))return;const{_sortable:r,_selectedSortUid:a}=this;if(!r)return;const n=r.toArray(),d=t.target.getAttribute(T),l=n.indexOf(d);if(f(i)){const t=a&&a===d;return this._selectedSortUid=t?null:d,this._sortableSavedItems=t?[]:r.toArray(),void this.scheduleRender()}if("Tab"===i)return this._selectedSortUid=null,void this.scheduleRender();if("Escape"===i&&0!==o.length)return t.stopPropagation(),this._selectedSortUid=null,this._updateSortItems(o,r,d),void this.scheduleRender();if(-1===l||!a)return;const u="ArrowUp"===i?l-1:l+1;u>=n.length||u<=-1||(S(n,l,u),this._updateSortItems(n,r,d))}_updateSortItems(t,e,o){e.sort(t),this._sortBookmarks(e),this._focusSortUid=o,this._selectedSortUid=o}_focusDragHandle(t){const e=t["data-bookmark"];this._setTooltipReference(t,e);const{_focusSortUid:o}=this;if(!t||!o)return;t.getAttribute(T)===o&&(t.focus(),this._focusSortUid=null)}_toggleSorting(){const{_sortable:t,_sortableNode:e,editingEnabled:o,disabled:s}=this;if(e)if(t)t.option("disabled",s||!o);else{const t=y.create(e,{dataIdAttr:T,handle:`.${p.bookmarkDragHandle}`,group:w,disabled:s||!o,onSort:()=>this._sortBookmarks(t)});this._sortable=t}}_sortNodeCreated(t){this._sortableNode=t,this._toggleSorting()}_sortBookmarks(t){const{bookmarks:e}=this.viewModel;if(!e)return;const o=t.toArray();e.sort(((t,e)=>{const s=o.indexOf(t.uid),i=o.indexOf(e.uid);return s>i?1:s<i?-1:0}))}_destroySortable(){const{_sortable:t}=this;t&&t.destroy(),this._sortable=null}_endAddBookmark(){this._focusAddBookmarkButton=!0,this.endAddBookmark()}_bookmarksInitialized(){const t="bookmarks-init";this.removeHandles(t),this.addHandles(r((()=>this.viewModel?.bookmarks),"change",(()=>this._bookmarksChanged())),t)}_bookmarksChanged(){const t="bookmarks-change",{bookmarks:e}=this.viewModel;this.removeHandles(t);const o=e.map((t=>s((()=>[t?.name,t?.thumbnail?.url]),(()=>this.scheduleRender()))));this.addHandles(o.toArray(),t),this.scheduleRender()}_showEditBookmarkForm(t){const e=t.currentTarget["data-bookmark"];this._editIncludeTimeExtent=!!e.timeExtent,this._focusEditInputBox=!0,this._userState=new h({bookmark:e,state:"edit"}),this.viewModel.goTo(e),this.scheduleRender()}_closeUrlEditBookmarkForm(){this._focusEditInputBox=!0,this._userState&&(this._userState.state="edit")}_closeEditBookmarkForm(){this._userState=null}_addBookmarkSubmit(t){t.preventDefault();const{_addInputNode:e,_userState:o}=this;if(!o)return;const s=e?e.value.trim():null;s?(o.loading=!0,this.viewModel.createBookmark().then((t=>{t.name=s,this.viewModel.bookmarks.add(t),this._endAddBookmark()}))):o.validationState="name-required"}async _editBookmarkAndClose(t,e){const{viewModel:o}=this;await o.editBookmark(t,{...o.defaultEditOptions,...e}),this._closeEditBookmarkForm()}_editBookmarkSubmit(t){t.preventDefault();const{_editInputNode:e,_userState:o,_editIncludeTimeExtent:s}=this;if(!o?.bookmark||!o.editedBookmark)return;const i=e&&e.value.trim();i?(o.bookmark.name=i,o.bookmark.thumbnail=o.editedBookmark.thumbnail,s||(o.bookmark.timeExtent=null),this._editBookmarkAndClose(o.bookmark,{takeScreenshot:!1,captureTimeExtent:s})):o.validationState="name-required"}_storeAddBookmarkButton(t){this._addBookmarkButtonNode=t,this._focusAddBookmark()}_storeEditInput(t){this._editInputNode=t,this._focusEditInput()}_storeAddInput(t){this._addInputNode=t,this._focusAddInput()}_storeUrlEditInput(t){this._urlEditInputNode=t,this._focusUrlEditInput()}_focusUrlEditInput(){this._urlEditInputNode&&this._focusUrlEditInputBox&&(this._focusUrlEditInputBox=!1,this._urlEditInputNode.focus())}_focusAddInput(){this._addInputNode&&this._focusAddInputBox&&(this._focusAddInputBox=!1,this._addInputNode.focus())}_focusAddBookmark(){this._addBookmarkButtonNode&&this._focusAddBookmarkButton&&(this._focusAddBookmarkButton=!1,this._addBookmarkButtonNode.focus())}_focusEditInput(){this._editInputNode&&this._focusEditInputBox&&(this._focusEditInputBox=!1,this._editInputNode.focus())}_deleteBookmark(t){const e=t.currentTarget["data-bookmark"];this.viewModel.bookmarks.remove(e)}_goToBookmark(t){const e=t.currentTarget["data-bookmark"];this.endAddBookmark(),this._closeEditBookmarkForm(),this.viewModel.goTo(e)}async _refreshThumbnail(){const{_userState:t,_editMenu:e,viewModel:o}=this;t&&(t.validationState=void 0,await o.editBookmark(t.editedBookmark,{takeScreenshot:!0,captureViewpoint:!1,captureRotation:!1,captureScale:!1,captureTimeExtent:!1}),e.open=!1,this._focusEditInputBox=!0,this.scheduleRender())}_removeThumbnail(){const{_userState:t,_editMenu:e}=this;t?.editedBookmark&&(t.editedBookmark.thumbnail=null,t.validationState=void 0,e.open=!1,this._focusEditInputBox=!0,this.scheduleRender())}_startUseImageUrl(){this._userState&&(this._userState.state="edit-thumbnail"),this._editMenu.open=!1,this._focusUrlEditInputBox=!0,this.scheduleRender()}_editBookmarkUrlSubmit(t){t.preventDefault();const{_urlEditInputNode:e,_userState:o}=this;if(!e||!o)return;const s=e.value;x.test(s)?(s&&o.editedBookmark&&(o.editedBookmark.thumbnail=new m({url:s})),this._closeUrlEditBookmarkForm()):o.validationState="absolute-url-required"}};t([a()],C.prototype,"_editIncludeTimeExtent",void 0),t([a({type:h})],C.prototype,"_userState",void 0),t([a({readOnly:!0})],C.prototype,"_editMenuItems",null),t([a({readOnly:!0})],C.prototype,"_editMenu",null),t([a()],C.prototype,"defaultCreateOptions",null),t([a()],C.prototype,"defaultEditOptions",null),t([a()],C.prototype,"bookmarks",null),t([a()],C.prototype,"disabled",void 0),t([a()],C.prototype,"editingEnabled",void 0),t([a()],C.prototype,"headingLevel",void 0),t([a()],C.prototype,"goToOverride",null),t([a()],C.prototype,"iconClass",void 0),t([a()],C.prototype,"icon",void 0),t([a()],C.prototype,"label",null),t([a(),v("esri/widgets/Bookmarks/t9n/Bookmarks")],C.prototype,"messages",void 0),t([a(),v("esri/t9n/common")],C.prototype,"messagesCommon",void 0),t([a(),v("esri/core/t9n/Units")],C.prototype,"messagesUnits",void 0),t([a()],C.prototype,"uiStrings",void 0),t([a()],C.prototype,"view",null),t([a({type:c}),E(["select-bookmark","bookmark-edit","bookmark-select"])],C.prototype,"viewModel",void 0),t([a()],C.prototype,"visibleElements",void 0),t([n("visibleElements")],C.prototype,"castVisibleElements",null),t([a()],C.prototype,"endAddBookmark",null),t([a()],C.prototype,"startAddBookmark",null),C=t([d(U)],C);const M=C;export{M as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import{eventKey as e}from"../core/events.js";import{isSome as o}from"../core/maybe.js";import{watch as s,initial as i,on as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as l,convertDateFormatToIntlOptions as u}from"../intl/date.js";import{SlideThumbnail as m}from"../webdoc/support/SlideThumbnail.js";import k from"./Widget.js";import h from"./Bookmarks/BookmarksUserState.js";import c from"./Bookmarks/BookmarksViewModel.js";import{CSS as p}from"./Bookmarks/css.js";import b from"./FeatureTable/Grid/support/ButtonMenu.js";import _ from"./FeatureTable/Grid/support/ButtonMenuItem.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{Heading as B}from"./support/Heading.js";import{isActivationKey as v}from"./support/widgetUtils.js";import{messageBundle as f}from"./support/decorators/messageBundle.js";import{vmEvent as E}from"./support/decorators/vmEvent.js";import{tsx as I}from"./support/jsxFactory.js";import y from"sortablejs";function S(t,e,o){t.splice(o,0,t.splice(e,1)[0])}const w="bookmarks",T="data-bookmark-uid",A={addBookmark:!0,thumbnail:!0,time:!0},x=/^https:\/\/.*/i,U="esri.widgets.Bookmarks";let C=class extends k{constructor(t,e){super(t,e),this._tooltipReferenceMap=new Map,this._addInputNode=null,this._editInputNode=null,this._urlEditInputNode=null,this._addBookmarkButtonNode=null,this._focusAddBookmarkButton=!1,this._focusEditInputBox=!1,this._focusAddInputBox=!1,this._focusUrlEditInputBox=!1,this._sortable=null,this._sortableNode=null,this._focusSortUid=null,this._selectedSortUid=null,this._sortableSavedItems=[],this._editIncludeTimeExtent=void 0,this._userState=null,this.disabled=!1,this.editingEnabled=!1,this.headingLevel=2,this.iconClass=p.widgetIcon,this.icon=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.viewModel=new c,this.visibleElements={...A}}initialize(){this.addHandles([s((()=>this.viewModel?.bookmarks),(()=>this._bookmarksInitialized()),i),s((()=>this.editingEnabled),(()=>this._toggleSorting()),i)])}destroy(){this.removeAllHandles(),this._destroySortable(),this._editMenu.destroy(),this._tooltipReferenceMap.clear()}loadDependencies(){return g({label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}get _editMenuItems(){const{messages:t,_userState:e}=this,s=e?.editedBookmark?.thumbnail?.url;return[new _({label:t?.menu.refreshThumbnail,iconClass:p.iconRefresh,clickFunction:()=>this._refreshThumbnail()}),new _({label:s&&x.test(s)?t?.menu.editImageUrl:t?.menu.useImageUrl,iconClass:p.iconLink,clickFunction:()=>this._startUseImageUrl()}),s?new _({label:t?.menu.removeThumbnail,iconClass:p.iconRemove,clickFunction:()=>this._removeThumbnail()}):null].filter(o)}get _editMenu(){const{_editMenuItems:t,messages:e,disabled:o}=this,s=this._get("_editMenu");s&&s.destroy();const i=new b({disabled:o,iconClass:p.iconHandleHorizontal,label:e?.menu.label});return i.items=t,i}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(t){this.viewModel.defaultCreateOptions=t}get defaultEditOptions(){return this.viewModel.defaultEditOptions}set defaultEditOptions(t){this.viewModel.defaultEditOptions=t}get bookmarks(){return this.viewModel.bookmarks}set bookmarks(t){this.viewModel.bookmarks=t}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}castVisibleElements(t){return{...A,...t}}endAddBookmark(){this._userState=null}goTo(t){return this.viewModel.goTo(t)}render(){const{state:t}=this.viewModel,e="loading"===t?this.renderLoading():this.renderBookmarks();return I("div",{class:this.classes(p.base,p.esriWidget,{[p.esriWidgetDisabled]:this.disabled})},e)}startAddBookmark(){this._userState=new h({state:"add"}),this._focusAddInputBox=!0,this.scheduleRender()}renderBookmarkTooltips(t){return t.toArray().map((t=>this.renderBookmarkTooltip(t)))??[]}renderBookmarkTooltip(t){const{_tooltipReferenceMap:e,messagesCommon:o}=this,s=this._getBookmarkTitle(t),i=`${o?.dragHandleTitle} ${s}`;return t?I("calcite-tooltip",{key:`tooltip-${t.uid}`,label:i,referenceElement:e.get(t.uid)},i):null}renderLoading(){return I("div",{class:p.loaderContainer,key:"loader",tabIndex:this.disabled?-1:void 0},I("div",{class:p.loader}))}renderNoBookmarksContainer(){const{messages:t,disabled:e}=this;return I("div",{class:p.noBookmarksContainer,key:"no-bookmarks",tabIndex:e?-1:void 0},I("span",{"aria-hidden":"true",class:this.classes(p.noBookmarksIcon,p.widgetIcon)}),I(B,{level:this.headingLevel,class:this.classes(p.header,p.noBookmarksHeader)},t?.noBookmarksHeading),I("p",{class:p.noBookmarksDescription},t?.noBookmarksDescription))}renderAddBookmarkLoading(){return I("div",{key:"adding-bookmark",class:p.addingBookmark},I("span",{"aria-hidden":"true",class:this.classes(p.loading,p.rotating)}),this.messages?.addingBookmark)}renderBookmarkItems(t){if(!t)return[];const{_userState:e,editingEnabled:o}=this;return t.map((t=>o&&t&&e&&("edit"===e.state||"edit-thumbnail"===e.state)&&e.bookmark===t?"edit-thumbnail"===e.state?this.renderEditingBookmarkUrl(e.editedBookmark):this.renderEditingBookmark(e.editedBookmark):this.renderBookmark(t))).toArray()}renderBookmarksContainer(t){const{_userState:e,editingEnabled:o,disabled:s}=this,i="add"===e?.state,r=o&&!i?this.renderAddBookmarkButton():null,a=o?i&&e.loading?this.renderAddBookmarkLoading():"add"===e?.state?this.renderAddingBookmark():null:null;return[I("ul",{key:"bookmark-list","aria-label":this.messages?.widgetLabel,class:this.classes(p.bookmarkList,{[p.bookmarkListSortable]:this.editingEnabled}),afterCreate:this._sortNodeCreated,afterRemoved:this._destroySortable,"data-node-ref":"_sortableNode",bind:this,tabIndex:s?-1:void 0},this.renderBookmarkItems(t)),r,a]}renderAddBookmarkButton(){return this.visibleElements.addBookmark?I("div",{key:"add-bookmark-item",class:p.addBookmark},I("button",{class:this.classes(p.esriButton,p.esriButtonTertiary,p.addBookmarkButton),disabled:this.disabled,onclick:this.startAddBookmark,afterCreate:this._storeAddBookmarkButton,afterUpdate:this._storeAddBookmarkButton,"data-node-ref":"_addBookmarkButtonNode",bind:this,type:"button"},I("span",{"aria-hidden":"true",class:this.classes(p.addBookmarkIcon,p.iconPlus)}),this.messages?.addBookmark)):null}renderBookmarks(){const{bookmarks:t}=this.viewModel,e=t&&t.filter(Boolean),o=e&&e.length,s=o||this.editingEnabled?this.renderBookmarksContainer(e):null;return[o?null:this.renderNoBookmarksContainer(),s,this.renderBookmarkTooltips(t)]}renderEditContainer(t){const{messagesCommon:e,disabled:o}=this,s=this._getBookmarkTitle(t);return I("div",{class:p.bookmarkEditButtonContainer,key:"edit-container"},I("button",{disabled:o,title:`${e?.edit} ${s}`,"aria-label":`${e?.edit} ${s}`,"data-bookmark":t,onclick:this._showEditBookmarkForm,bind:this,class:p.bookmarkEditButton,type:"button"},I("span",{"aria-hidden":"true",class:p.iconEdit})))}renderDragHandle(t){const{messagesCommon:e,disabled:o}=this,s=this._getBookmarkTitle(t),i={[T]:t.uid};return I("div",{role:"button",tabIndex:o?-1:0,key:"drag-handle",bind:this,class:p.bookmarkDragHandle,onkeydown:this._dragHandleKeydown,"data-bookmark":t,afterCreate:this._focusDragHandle,afterUpdate:this._focusDragHandle,onblur:this._dragHandleBlur,"aria-pressed":this._selectedSortUid===t.uid?"true":"false","aria-label":`${e?.dragHandleTitle} ${s}`,...i},I("span",{"aria-hidden":"true",class:this.classes(p.bookmarkDragHandleIcon,p.iconHandle)}))}renderBookmarkImageIcon(){return I("span",{"aria-hidden":"true",class:this.classes(p.bookmarkIcon,p.widgetIcon)})}renderBookmarkImage(t){const{visibleElements:e}=this,{thumbnail:o}=t,s=o&&o.url||"";return e.thumbnail&&s?I("img",{src:s,alt:"",class:p.bookmarkImage}):null}renderBookmarkTimeSwitch(t){const{messages:e,disabled:o}=this,{timeExtent:s}=t,{view:i}=this.viewModel;return i?.timeExtent??s?I("calcite-label",{layout:"inline-space-between"},e?.includeTimeExtent,I("calcite-switch",{scale:"s",disabled:o,checked:!!s,onCalciteSwitchChange:t=>{const e=t.currentTarget;this._editIncludeTimeExtent=!!e.checked}})):null}renderBookmarkTimeExtent(t){const{visibleElements:e}=this,{timeExtent:o}=t;return o?I("span",{class:p.timeExtent},[null!=o.start&&I("span",{key:"start-date-group",class:p.timeExtentGroup},I("span",{key:"start-date",class:p.timeExtentDate},this._formatDate(o.start)),e.time&&I("span",{key:"start-time",class:p.timeExtentTime},this._formatTime(o.start))),null!=o.end&&(null==o.start||o.start.getTime()!==o.end.getTime())&&I("span",{key:"end-date-group",class:p.timeExtentGroup},I("span",{key:"end-date",class:p.timeExtentDate},this._formatDate(o.end)),e.time&&I("span",{key:"end-time",class:p.timeExtentTime},this._formatTime(o.end)))]):null}renderBookmarkButton(t){const{disabled:e}=this,{timeExtent:o}=t,{abilities:s}=this.viewModel,i=this._getBookmarkTitle(t),{thumbnail:r}=t,a=I("div",{class:this.classes(p.bookmarkImageContainer,r&&r.url?p.bookmarkImageContainerHasImage:null)},this.renderBookmarkImage(t)||this.renderBookmarkImageIcon()),n=s.time&&o?I("span",{key:"time-extent",class:p.bookmarkTimeExtent},this.renderBookmarkTimeExtent(t)):null;return I("button",{disabled:e,key:"bookmark-button",class:p.bookmarkButton,bind:this,"data-bookmark":t,onclick:this._goToBookmark,type:"button"},a,I("div",{class:p.bookmarkLabel},I("span",{key:"bookmark-title",class:p.bookmarkName},i),n))}renderBookmark(t){const{activeBookmark:e}=this.viewModel,o={[p.bookmarkActive]:e===t},s=this.editingEnabled?this.renderEditContainer(t):null,i={[T]:t.uid},r=this.editingEnabled?this.renderDragHandle(t):null;return I("li",{key:t,class:this.classes(p.bookmark,o),...i},r,this.renderBookmarkButton(t),s)}renderEditingBookmarkName(t){const{messages:e,_userState:o,disabled:s}=this,i="name-required"===o?.validationState;return I("label",{class:this.classes({[p.authoringLabel]:!0,[p.authoringLabelStartPadding]:!!this.visibleElements?.thumbnail})},e?.title,i?I("strong",null,e?.invalidTitle):null,I("input",{required:!0,disabled:s,bind:this,class:this.classes(p.esriInput,i?p.authoringInputInvalid:null),type:"text",value:t.name,afterCreate:this._storeEditInput,afterUpdate:this._focusEditInput,"data-bookmark":t,"data-node-ref":"_editInputNode",placeholder:e?.titlePlaceholder}))}renderEditingBookmarkUrlActions(){const{messagesCommon:t,disabled:e}=this;return I("div",{class:p.authoringActions},I("input",{type:"button",disabled:e,value:t?.back,class:this.classes(p.esriButton,p.esriButtonTertiary),onclick:this._closeUrlEditBookmarkForm,bind:this}),I("input",{class:p.esriButton,disabled:e,type:"submit",value:t?.add}))}renderEditingBookmarkActions(){const{messagesCommon:t,disabled:e}=this,o=this._userState?.bookmark;return I("div",{class:p.authoringActions},I("input",{type:"button",disabled:e,value:t?.delete,class:this.classes(p.esriButton,p.esriButtonTertiary,p.authoringDeleteButton),"data-bookmark":o,onclick:this._deleteBookmark,bind:this}),I("input",{disabled:e,type:"button",value:t?.cancel,class:this.classes(p.esriButton,p.esriButtonTertiary),onclick:this._closeEditBookmarkForm,bind:this}),I("input",{class:p.esriButton,disabled:e,type:"submit",value:t?.save}))}renderEditingBookmarkUrlInput(t){const{messages:e,_userState:o,disabled:s}=this,i=t.thumbnail?.url,r=i&&x.test(i)?i:void 0,a="absolute-url-required"===o?.validationState;return I("label",{class:this.classes({[p.authoringLabel]:!0,[p.authoringLabelStartPadding]:!!this.visibleElements?.thumbnail})},a?I("strong",null,e?.invalidImageUrl):null,I("input",{required:!0,disabled:s,bind:this,class:this.classes(p.esriInput,a?p.authoringInputInvalid:null),type:"text",value:r,afterCreate:this._storeUrlEditInput,afterUpdate:this._focusUrlEditInput,"data-bookmark":t,"data-node-ref":"_urlEditInputNode",title:e?.imageUrlTooltip,placeholder:e?`https://<${e.imageUrlPlaceholder}>`:void 0}))}renderEditingBookmarkUrl(t){if(!t)return null;const e={[T]:t.uid};return I("li",{key:"edit-bookmark-url-form",class:p.authoringCard,...e},I("form",{class:p.authoringForm,disabled:this.disabled,onsubmit:this._editBookmarkUrlSubmit,bind:this},this.renderEditingBookmarkUrlInput(t),this.renderEditingBookmarkUrlActions()))}renderEditingBookmark(t){if(!t)return null;const e={[T]:t.uid},{abilities:o}=this.viewModel,s=o.time?I("div",{key:"edit-bookmark-time-container",class:p.timeExtentContainer},this.renderBookmarkTimeSwitch(t),this._editIncludeTimeExtent&&this.renderBookmarkTimeExtent(t)):null;return I("li",{key:"edit-bookmark-form",class:p.authoringCard,...e},I("form",{class:p.authoringForm,disabled:this.disabled,onsubmit:this._editBookmarkSubmit,bind:this},I("div",{class:p.authoringContainer},this.visibleElements.thumbnail?I("div",{class:p.bookmarkImageContainer},this.renderBookmarkImage(t),this._editMenu.render()):null,this.renderEditingBookmarkName(t)),s,this.renderEditingBookmarkActions()))}renderAddingBookmarkName(){const{_userState:t,messages:e,disabled:o}=this,s="name-required"===t?.validationState;return I("label",{class:this.classes({[p.authoringLabel]:!0,[p.authoringLabelStartPadding]:!0})},e?.title,s?I("strong",null,e?.invalidTitle):null,I("input",{required:!0,disabled:o,bind:this,class:this.classes(p.esriInput,s?p.authoringInputInvalid:null),type:"text",afterCreate:this._storeAddInput,afterUpdate:this._focusAddInput,"data-node-ref":"_addInputNode",value:"",placeholder:e?.titlePlaceholder}))}renderAddingBookmarkActions(){const{messagesCommon:t,disabled:e}=this;return I("div",{class:this.classes(p.authoringActions)},I("input",{type:"button",disabled:e,value:t?.cancel,class:this.classes(p.esriButton,p.esriButtonTertiary,p.authoringCancelButton),onclick:this._endAddBookmark.bind(this),bind:this}),I("input",{class:p.esriButton,disabled:e,type:"submit",value:t?.add}))}renderAddingBookmark(){return I("div",{key:"add-bookmark-form",class:p.authoringCard},I("form",{class:p.authoringForm,onsubmit:this._addBookmarkSubmit,bind:this},this.renderAddingBookmarkName(),this.renderAddingBookmarkActions()))}_setTooltipReference(t,e){this._tooltipReferenceMap.set(e.uid,t),this.scheduleRender()}_getBookmarkTitle(t){return(t?.name||this.messagesCommon?.untitled)??""}_formatDate(t){return t?l(t,u("short-date")):""}_formatTime(t){return t?l(t,u("long-time")):""}_dragHandleBlur(){this._selectedSortUid=null,this.scheduleRender()}_dragHandleKeydown(t){const{_sortableSavedItems:o}=this,s=["ArrowDown","ArrowUp","Escape","Tab"," ","Enter"],i=e(t);if(!s.includes(i))return;const{_sortable:r,_selectedSortUid:a}=this;if(!r)return;const n=r.toArray(),d=t.target.getAttribute(T),l=n.indexOf(d);if(v(i)){const t=a&&a===d;return this._selectedSortUid=t?null:d,this._sortableSavedItems=t?[]:r.toArray(),void this.scheduleRender()}if("Tab"===i)return this._selectedSortUid=null,void this.scheduleRender();if("Escape"===i&&0!==o.length)return t.stopPropagation(),this._selectedSortUid=null,this._updateSortItems(o,r,d),void this.scheduleRender();if(-1===l||!a)return;const u="ArrowUp"===i?l-1:l+1;u>=n.length||u<=-1||(S(n,l,u),this._updateSortItems(n,r,d))}_updateSortItems(t,e,o){e.sort(t),this._sortBookmarks(e),this._focusSortUid=o,this._selectedSortUid=o}_focusDragHandle(t){const e=t["data-bookmark"];this._setTooltipReference(t,e);const{_focusSortUid:o}=this;if(!t||!o)return;t.getAttribute(T)===o&&(t.focus(),this._focusSortUid=null)}_toggleSorting(){const{_sortable:t,_sortableNode:e,editingEnabled:o,disabled:s}=this;if(e)if(t)t.option("disabled",s||!o);else{const t=y.create(e,{dataIdAttr:T,handle:`.${p.bookmarkDragHandle}`,group:w,disabled:s||!o,onSort:()=>this._sortBookmarks(t)});this._sortable=t}}_sortNodeCreated(t){this._sortableNode=t,this._toggleSorting()}_sortBookmarks(t){const{bookmarks:e}=this.viewModel;if(!e)return;const o=t.toArray();e.sort(((t,e)=>{const s=o.indexOf(t.uid),i=o.indexOf(e.uid);return s>i?1:s<i?-1:0}))}_destroySortable(){const{_sortable:t}=this;t&&t.destroy(),this._sortable=null}_endAddBookmark(){this._focusAddBookmarkButton=!0,this.endAddBookmark()}_bookmarksInitialized(){const t="bookmarks-init";this.removeHandles(t),this.addHandles(r((()=>this.viewModel?.bookmarks),"change",(()=>this._bookmarksChanged())),t)}_bookmarksChanged(){const t="bookmarks-change",{bookmarks:e}=this.viewModel;this.removeHandles(t);const o=e.map((t=>s((()=>[t?.name,t?.thumbnail?.url]),(()=>this.scheduleRender()))));this.addHandles(o.toArray(),t),this.scheduleRender()}_showEditBookmarkForm(t){const e=t.currentTarget["data-bookmark"];this._editIncludeTimeExtent=!!e.timeExtent,this._focusEditInputBox=!0,this._userState=new h({bookmark:e,state:"edit"}),this.viewModel.goTo(e),this.scheduleRender()}_closeUrlEditBookmarkForm(){this._focusEditInputBox=!0,this._userState&&(this._userState.state="edit")}_closeEditBookmarkForm(){this._userState=null}_addBookmarkSubmit(t){t.preventDefault();const{_addInputNode:e,_userState:o}=this;if(!o)return;const s=e?e.value.trim():null;s?(o.loading=!0,this.viewModel.createBookmark().then((t=>{t.name=s,this.viewModel.bookmarks.add(t),this._endAddBookmark()}))):o.validationState="name-required"}async _editBookmarkAndClose(t,e){const{viewModel:o}=this;await o.editBookmark(t,{...o.defaultEditOptions,...e}),this._closeEditBookmarkForm()}_editBookmarkSubmit(t){t.preventDefault();const{_editInputNode:e,_userState:o,_editIncludeTimeExtent:s}=this;if(!o?.bookmark||!o.editedBookmark)return;const i=e&&e.value.trim();i?(o.bookmark.name=i,o.bookmark.thumbnail=o.editedBookmark.thumbnail,s||(o.bookmark.timeExtent=null),this._editBookmarkAndClose(o.bookmark,{takeScreenshot:!1,captureTimeExtent:s})):o.validationState="name-required"}_storeAddBookmarkButton(t){this._addBookmarkButtonNode=t,this._focusAddBookmark()}_storeEditInput(t){this._editInputNode=t,this._focusEditInput()}_storeAddInput(t){this._addInputNode=t,this._focusAddInput()}_storeUrlEditInput(t){this._urlEditInputNode=t,this._focusUrlEditInput()}_focusUrlEditInput(){this._urlEditInputNode&&this._focusUrlEditInputBox&&(this._focusUrlEditInputBox=!1,this._urlEditInputNode.focus())}_focusAddInput(){this._addInputNode&&this._focusAddInputBox&&(this._focusAddInputBox=!1,this._addInputNode.focus())}_focusAddBookmark(){this._addBookmarkButtonNode&&this._focusAddBookmarkButton&&(this._focusAddBookmarkButton=!1,this._addBookmarkButtonNode.focus())}_focusEditInput(){this._editInputNode&&this._focusEditInputBox&&(this._focusEditInputBox=!1,this._editInputNode.focus())}_deleteBookmark(t){const e=t.currentTarget["data-bookmark"];this.viewModel.bookmarks.remove(e)}_goToBookmark(t){const e=t.currentTarget["data-bookmark"];this.endAddBookmark(),this._closeEditBookmarkForm(),this.viewModel.goTo(e)}async _refreshThumbnail(){const{_userState:t,_editMenu:e,viewModel:o}=this;t&&(t.validationState=void 0,await o.editBookmark(t.editedBookmark,{takeScreenshot:!0,captureViewpoint:!1,captureRotation:!1,captureScale:!1,captureTimeExtent:!1}),e.open=!1,this._focusEditInputBox=!0,this.scheduleRender())}_removeThumbnail(){const{_userState:t,_editMenu:e}=this;t?.editedBookmark&&(t.editedBookmark.thumbnail=null,t.validationState=void 0,e.open=!1,this._focusEditInputBox=!0,this.scheduleRender())}_startUseImageUrl(){this._userState&&(this._userState.state="edit-thumbnail"),this._editMenu.open=!1,this._focusUrlEditInputBox=!0,this.scheduleRender()}_editBookmarkUrlSubmit(t){t.preventDefault();const{_urlEditInputNode:e,_userState:o}=this;if(!e||!o)return;const s=e.value;x.test(s)?(s&&o.editedBookmark&&(o.editedBookmark.thumbnail=new m({url:s})),this._closeUrlEditBookmarkForm()):o.validationState="absolute-url-required"}};t([a()],C.prototype,"_editIncludeTimeExtent",void 0),t([a({type:h})],C.prototype,"_userState",void 0),t([a({readOnly:!0})],C.prototype,"_editMenuItems",null),t([a({readOnly:!0})],C.prototype,"_editMenu",null),t([a()],C.prototype,"defaultCreateOptions",null),t([a()],C.prototype,"defaultEditOptions",null),t([a()],C.prototype,"bookmarks",null),t([a()],C.prototype,"disabled",void 0),t([a()],C.prototype,"editingEnabled",void 0),t([a()],C.prototype,"headingLevel",void 0),t([a()],C.prototype,"goToOverride",null),t([a()],C.prototype,"iconClass",void 0),t([a()],C.prototype,"icon",void 0),t([a()],C.prototype,"label",null),t([a(),f("esri/widgets/Bookmarks/t9n/Bookmarks")],C.prototype,"messages",void 0),t([a(),f("esri/t9n/common")],C.prototype,"messagesCommon",void 0),t([a(),f("esri/core/t9n/Units")],C.prototype,"messagesUnits",void 0),t([a()],C.prototype,"uiStrings",void 0),t([a()],C.prototype,"view",null),t([a({type:c}),E(["select-bookmark","bookmark-edit","bookmark-select"])],C.prototype,"viewModel",void 0),t([a()],C.prototype,"visibleElements",void 0),t([n("visibleElements")],C.prototype,"castVisibleElements",null),t([a()],C.prototype,"endAddBookmark",null),t([a()],C.prototype,"startAddBookmark",null),C=t([d(U)],C);const M=C;export{M as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{remove as t}from"../../core/arrayUtils.js";import{makeHandle as a,handlesGroup as i}from"../../core/handleUtils.js";import{removeMaybe as r,destroyMaybe as o}from"../../core/maybe.js";import{whenOnce as s,watch as n,syncAndInitial as l}from"../../core/reactiveUtils.js";import{generateUUID as c}from"../../core/uuid.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveLayerCapabilities as h,getEffectiveEditingEnabled as p}from"../../layers/support/layerUtils.js";import{getDrawHelpMessage as f}from"../../views/draw/support/helpMessageUtils.js";import m from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{CreateFeaturesWorkflowData as w}from"./CreateFeaturesWorkflowData.js";import g from"./Workflow.js";import{shouldShowAttachmentsForCreateWorkflow as v,startCreatingNewFeature as y,findLayerInfo as M,updateGraphicSymbolWhenRequired as _,isTerminalUpdateEventType as A,getVisualVariableAttributes as b,startUpdatingFeature as F,createWorkflowSteps as V,avoidFeatureTemplateSelectionWithOnlyOneItem as I,prepareAttachmentsForCreateWorkflow as k,visualVariableInteractiveUpdate as S}from"./workflowUtils.js";var j;const C=Symbol();let E=j=class extends g{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._attachmentFileInfos=new Map,this._highlightHandles=new Map,this._preventDefaultActionOnCancel=!1,this._lastActiveGraphics=[]}get numPendingFeatures(){return this.data.viewModel.sketchViewModel.layer.graphics.length}get pendingFeatures(){return this.data.viewModel.sketchViewModel.layer.graphics}get reliesOnOwnerAdminPrivileges(){const{layer:e}=this.data.creationInfo,t=e.capabilities?.operations.supportsAdd,a=h(e)?.operations.supportsAdd;return p(e)&&!e.editingEnabled||!!a&&!t}get shouldShowAttachments(){return!!(this.data&&this.data.creationInfo&&this.data.viewModel)&&v(this.data)}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get helpMessage(){if("creating-features"!==this.stepId)return;const{creationInfo:e,viewModel:t}=this.data;return f(e.layer.geometryType,t.sketchViewModel.createGraphic?.geometry)}async updatePendingFeature(e,a){return this._preventDefaultActionOnCancel=!0,this.data.viewModel.sketchViewModel.cancel(),t(this._lastActiveGraphics,e),this._startUpdating(e,a)}static create(e,t,a,i,r){const o=new j({data:new w({creationInfo:t,viewModel:e}),onCommit:async e=>{const t=e.viewModel.sketchViewModel.layer.graphics.toArray(),a=e.creationInfo.layer,s=a.capabilities?.editing.supportsGlobalId&&"globalIdField"in a,n=o._attachmentFileInfos;if(0===n.size)return void await i(a,{addFeatures:t});if(s){const e=o._getAttachmentEditsWithGlobalIds(t,a,n),r="addAttachments"in e?{globalIdUsed:!0}:void 0;return void await i(a,e,r)}const{addFeatureResults:l}=await i(a,{addFeatures:t}),c=o._getAddAttachmentsData(t,l,a,n);await r(a,c)}});return o._set("steps",this._createWorkflowSteps(o,a)),o}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",a((()=>e.effect=t))}const t=e.opacity;return e.opacity=.7,a((()=>e.opacity=t))}_highlight(e){const t=this.data.viewModel.view;"3d"===t?.type&&this._highlightHandles.set(e,t.highlight(e))}_removeHighlight(e){r(this._highlightHandles.get(e)),this._highlightHandles.delete(e)}async _startCreating(e){return this.createFeatureState="create-new",y(this.data.viewModel.sketchViewModel,this.data.creationInfo,e)}async _startUpdating(e,t){const{featureFormViewModel:a,layerInfos:o,sketchViewModel:s,view:n}=this.data.viewModel;if(!n)return;const l=this.data.creationInfo.layer,c=M(o,l),d=c?.formTemplate,u=n.spatialReference;return a.set({arcadeEditType:"INSERT",feature:e,formTemplate:d,spatialReference:u,view:n}),r(this._featureFormHandle),this._featureFormHandle=i([a.on("value-change",(async()=>{e.attributes=a.getValues(),await _(e,t)})),s.on(["update","undo","redo"],(e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&A(e.toolEventInfo.type))&&a.notifyFeatureGeometryChanged()}))]),this._removeHighlight(e),this.createFeatureState="update-pending",this._visualVariableAttributes=b(e),F(s,e,l,this._visualVariableAttributes,t)}static _createWorkflowSteps(e,i="awaiting-feature-creation-info"){const{data:c,handles:d}=e;let u=null,h=!0;const p=new Map,f=V(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],i,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){c.creationInfo=null,d.add(c.viewModel.featureTemplatesViewModel.on("select",(({item:e})=>{e&&(c.creationInfo=e,c.viewModel.activeWorkflow?.next())})),this.id)},async tearDown(){d.remove(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){if(d.has(this.id))return;const i=c.viewModel.view;if(!i)return;const f=c.viewModel.sketchViewModel;h=f.updateOnGraphicClick,f.updateOnGraphicClick=!1,e._lastActiveGraphics=[],e._featureFormHandle=r(e._featureFormHandle),e._visualVariableAttributes={rotation:null,size:null},k(c.viewModel.attachmentsViewModel);const w="2d"===i.type?e._fadeExistingFeatures(c.creationInfo.layer):null,g=f.on("create",(async t=>{if("cancel"===t.state){if(e._preventDefaultActionOnCancel)return void(e._preventDefaultActionOnCancel=!1);if(e._lastActiveGraphics.length<1)return e._startCreating(p);const t=e._lastActiveGraphics.pop();return e._startUpdating(t,p)}if("complete"===t.state&&t.graphic)return e._startUpdating(t.graphic,p)})),v=f.on("update",(async t=>{const r=t.graphics[0];if("complete"===t.state){if(r!==u&&(e._lastActiveGraphics.push(r),e._highlight(r)),u=null,"add"!==c.viewModel.attachmentsViewModel.mode&&"edit"!==c.viewModel.attachmentsViewModel.mode||c.viewModel.activeWorkflow?.previous(),t.aborted&&e._preventDefaultActionOnCancel)return void(e._preventDefaultActionOnCancel=!1);const o=i.cursor;return i.cursor="progress",d.add([a((()=>i.cursor=o)),i.on("click",(e=>e.preventDefault()))],C),s((()=>!c.viewModel.featureFormViewModel.updating)).then((()=>{d.remove(C),e._startCreating(p)}))}if("start"===t.state){e._removeHighlight(r);const t=c.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||c.viewModel.activeWorkflow?.previous(),t.fileInfos.removeAll(),t.graphic=r,t.mode="view";(e._attachmentFileInfos.get(r)||[]).forEach((({file:e,form:a})=>t.addFile(e,a)))}await S(i,r,t,e._visualVariableAttributes,p);const o=r.attributes;if(null!=e._visualVariableAttributes.rotation){const{field:t}=e._visualVariableAttributes.rotation;c.viewModel.featureFormViewModel.setValue(t,o[t])}if(null!=e._visualVariableAttributes.size){const{field:t}=e._visualVariableAttributes.size;c.viewModel.featureFormViewModel.setValue(t,o[t])}})),y=f.on("delete",(async a=>{const i=a.graphics[0];t(e._lastActiveGraphics,i),u=i}));let M=null;const _=n((()=>{const e=f.snappingOptions.featureSources.find((e=>e.layer===c.creationInfo.layer));return{hasFeatureLayerSource:!!e,enabled:e?.enabled??!1}}),(({hasFeatureLayerSource:e,enabled:t})=>{const a=f.snappingOptions.featureSources;e?(null==M&&(M=new m({layer:f.layer,enabled:t}),a.add(M)),M.enabled=t):(null!=M&&a.remove(M),M=o(M))}),l),A=i.on("immediate-click",(async t=>{const{results:a}=await i.hitTest(t,{include:f.layer}),r=a.find((e=>"graphic"===e.type));if(r){const t=r.graphic;if("transform"===f.activeTool||"reshape"===f.activeTool){if(f.updateGraphics.getItemAt(0)===t)return;await e.updatePendingFeature(t,p)}}})),b=n((()=>c.viewModel.attachmentsViewModel.mode),(e=>{"add"===e&&c.viewModel.activeWorkflow.go("adding-attachment"),"edit"===e&&c.viewModel.activeWorkflow.go("editing-attachment")}));await e._startCreating(p);const F={remove:()=>{r(e._featureFormHandle),g.remove(),v.remove(),y.remove(),_.remove(),null!=M&&f.snappingOptions.featureSources.remove(M),M=o(M),f.cancel(),A.remove(),b.remove(),r(w)}};d.add(F,this.id)},async tearDown(t){t.cancelled&&(c.viewModel.sketchViewModel.layer.removeAll(),d.remove([this.id,C]),c.viewModel.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear(),c.viewModel.sketchViewModel.updateOnGraphicClick=h)}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{graphic:t,fileInfos:a}=c.viewModel.attachmentsViewModel;e._attachmentFileInfos.set(t,a.toArray()),c.viewModel.attachmentsViewModel.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{graphic:t,fileInfos:a}=c.viewModel.attachmentsViewModel;e._attachmentFileInfos.set(t,a.toArray()),c.viewModel.attachmentsViewModel.mode="view"}})});return I(c,f)}_getAddAttachmentsData(e,t,a,i){const r=[];return t.forEach(((t,o)=>{if(!t.error){const s=e[o],n=i.get(s)||[];s.attributes[a.objectIdField]=t.objectId,n.forEach((({form:e})=>r.push({feature:s,attachment:e})))}})),r}_getAttachmentEditsWithGlobalIds(e,t,a){const i=[],r=t.globalIdField;return e.forEach(((t,o)=>{const s=a.get(t)||[];let n=t.attributes[r];null==n&&(n=c(),e[o].attributes[r]=n),s.forEach((({file:e})=>i.push({feature:t,attachment:{globalId:c(),data:e}})))})),i.length?{addFeatures:e,addAttachments:i}:{addFeatures:e}}};e([d()],E.prototype,"reliesOnOwnerAdminPrivileges",null),e([d()],E.prototype,"shouldShowAttachments",null),e([d()],E.prototype,"shouldAllowAttachmentEditing",null),e([d()],E.prototype,"helpMessage",null),E=j=e([u("esri.widgets.Editor.CreateFeaturesWorkflow")],E);const G=E;export{G as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{remove as t}from"../../core/arrayUtils.js";import{makeHandle as a,handlesGroup as i}from"../../core/handleUtils.js";import{removeMaybe as r,destroyMaybe as o}from"../../core/maybe.js";import{watch as s,whenOnce as n,syncAndInitial as l}from"../../core/reactiveUtils.js";import{generateUUID as c}from"../../core/uuid.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveLayerCapabilities as h,getEffectiveEditingEnabled as p}from"../../layers/support/layerUtils.js";import{getDrawHelpMessage as f}from"../../views/draw/support/helpMessageUtils.js";import m from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{CreateFeaturesWorkflowData as w}from"./CreateFeaturesWorkflowData.js";import g from"./Upload.js";import v from"./Workflow.js";import{shouldShowAttachmentsForCreateWorkflow as y,startCreatingNewFeature as M,findLayerInfo as _,updateGraphicSymbolWhenRequired as A,isTerminalUpdateEventType as b,getVisualVariableAttributes as F,startUpdatingFeature as I,createWorkflowSteps as V,avoidFeatureTemplateSelectionWithOnlyOneItem as k,prepareAttachmentsForCreateWorkflow as S,visualVariableInteractiveUpdate as j}from"./workflowUtils.js";var C;const E=Symbol();let G=C=class extends v{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._attachmentFileInfos=new Map,this._highlightHandles=new Map,this._preventDefaultActionOnCancel=!1,this._lastActiveGraphics=[]}get numPendingFeatures(){return this.data.viewModel.sketchViewModel.layer.graphics.length}get pendingFeatures(){return this.data.viewModel.sketchViewModel.layer.graphics}get reliesOnOwnerAdminPrivileges(){const{creationInfo:e}=this.data;if(!e)return!1;const{layer:t}=e,a=t.capabilities?.operations.supportsAdd,i=h(t)?.operations.supportsAdd;return p(t)&&!t.editingEnabled||!!i&&!a}get shouldShowAttachments(){return!!(this.data&&this.data.creationInfo&&this.data.viewModel)&&y(this.data)}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"===this.stepId&&e)return f(e.layer.geometryType,t.sketchViewModel.createGraphic?.geometry)}async updatePendingFeature(e,a){return this._preventDefaultActionOnCancel=!0,this.data.viewModel.sketchViewModel.cancel(),t(this._lastActiveGraphics,e),this._startUpdating(e,a)}static create(e,t,a,i,r){const o=new C({data:new w({creationInfo:t,viewModel:e}),onCommit:async e=>{const{creationInfo:t,viewModel:a}=e;if(!t)return;const s=a.sketchViewModel.layer.graphics.toArray(),n=t.layer,l=n.capabilities?.editing.supportsGlobalId&&"globalIdField"in n,c=o._attachmentFileInfos;if(0===c.size)return void await i(n,{addFeatures:s});if(l){const e=o._getAttachmentEditsWithGlobalIds(s,n,c),t="addAttachments"in e?{globalIdUsed:!0}:void 0;return void await i(n,e,t)}const{addFeatureResults:d}=await i(n,{addFeatures:s}),u=o._getAddAttachmentsData(s,d,n,c);await r(n,u)}});return o._set("steps",this._createWorkflowSteps(o,a)),o}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",a((()=>e.effect=t))}const t=e.opacity;return e.opacity=.7,a((()=>e.opacity=t))}_highlight(e){const t=this.data.viewModel.view;"3d"===t?.type&&this._highlightHandles.set(e,t.highlight(e))}_removeHighlight(e){r(this._highlightHandles.get(e)),this._highlightHandles.delete(e)}async _startCreating(e){const{creationInfo:t}=this.data;if(t)return this.createFeatureState="create-new",M(this.data.viewModel.sketchViewModel,t,e)}async _startUpdating(e,t){const{creationInfo:a,viewModel:o}=this.data,{featureFormViewModel:s,layerInfos:n,sketchViewModel:l,view:c}=o;if(!c||!a)return;const d=a.layer,u=_(n,d),h=u?.formTemplate,p=c.spatialReference;return s.set({arcadeEditType:"INSERT",feature:e,formTemplate:h,spatialReference:p,view:c}),r(this._featureFormHandle),this._featureFormHandle=i([s.on("value-change",(async()=>{e.attributes=s.getValues(),await A(e,t)})),l.on(["update","undo","redo"],(e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&b(e.toolEventInfo.type))&&s.notifyFeatureGeometryChanged()}))]),this._removeHighlight(e),this.createFeatureState="update-pending",this._visualVariableAttributes=F(e),I(l,e,d,this._visualVariableAttributes,t)}static _createWorkflowSteps(e,i="awaiting-feature-creation-info"){const{data:c,handles:d}=e;let u=null,h=!0;const p=new Map,f=V(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],i,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t}=c;if("scene"===t?.layer?.type){const a=null!=t.geometryToPlace;if(t.geometryToPlace=null,a)return c.viewModel.cancelWorkflow();const i=new g;c.upload=i,i.start(),d.add(s((()=>i.state),(a=>{switch(a){case"success":t.geometryToPlace=i.result,e.next();break;case"error":case"cancelled":c.viewModel.cancelWorkflow()}})),this.id)}else c.creationInfo=null,d.add(c.viewModel.featureTemplatesViewModel.on("select",(({item:e})=>{e&&(c.creationInfo=e,c.viewModel.activeWorkflow?.next())})),this.id)},async tearDown(){c.upload?.destroy(),c.upload=null,d.remove(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){if(d.has(this.id))return;const i=c.viewModel.view;if(!i)return;const f=c.viewModel.sketchViewModel;h=f.updateOnGraphicClick,f.updateOnGraphicClick=!1,e._lastActiveGraphics=[],e._featureFormHandle=r(e._featureFormHandle),e._visualVariableAttributes={rotation:null,size:null},S(c.viewModel.attachmentsViewModel);const w="2d"===i.type&&c.creationInfo?e._fadeExistingFeatures(c.creationInfo.layer):null,g=f.on("create",(async t=>{if("cancel"===t.state){if(e._preventDefaultActionOnCancel)return void(e._preventDefaultActionOnCancel=!1);if(e._lastActiveGraphics.length<1)return e._startCreating(p);const t=e._lastActiveGraphics.pop();return e._startUpdating(t,p)}if("complete"===t.state&&t.graphic)return e._startUpdating(t.graphic,p)})),v=f.on("update",(async t=>{const r=t.graphics[0];if("complete"===t.state){if(r!==u&&(e._lastActiveGraphics.push(r),e._highlight(r)),u=null,"add"!==c.viewModel.attachmentsViewModel.mode&&"edit"!==c.viewModel.attachmentsViewModel.mode||c.viewModel.activeWorkflow?.previous(),t.aborted&&e._preventDefaultActionOnCancel)return void(e._preventDefaultActionOnCancel=!1);const o=i.cursor;return i.cursor="progress",d.add([a((()=>i.cursor=o)),i.on("click",(e=>e.preventDefault()))],E),n((()=>!c.viewModel.featureFormViewModel.updating)).then((()=>{d.remove(E),e._startCreating(p)}))}if("start"===t.state){e._removeHighlight(r);const t=c.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||c.viewModel.activeWorkflow?.previous(),t.fileInfos.removeAll(),t.graphic=r,t.mode="view";(e._attachmentFileInfos.get(r)||[]).forEach((({file:e,form:a})=>t.addFile(e,a)))}await j(i,r,t,e._visualVariableAttributes,p);const o=r.attributes;if(null!=e._visualVariableAttributes.rotation){const{field:t}=e._visualVariableAttributes.rotation;c.viewModel.featureFormViewModel.setValue(t,o[t])}if(null!=e._visualVariableAttributes.size){const{field:t}=e._visualVariableAttributes.size;c.viewModel.featureFormViewModel.setValue(t,o[t])}})),y=f.on("delete",(async a=>{const i=a.graphics[0];t(e._lastActiveGraphics,i),u=i}));let M=null;const _=s((()=>{const e=f.snappingOptions.featureSources.find((e=>e.layer===c.creationInfo?.layer));return{hasFeatureLayerSource:!!e,enabled:e?.enabled??!1}}),(({hasFeatureLayerSource:e,enabled:t})=>{const a=f.snappingOptions.featureSources;e?(null==M&&(M=new m({layer:f.layer,enabled:t}),a.add(M)),M.enabled=t):(null!=M&&a.remove(M),M=o(M))}),l),A=i.on("immediate-click",(async t=>{const{results:a}=await i.hitTest(t,{include:f.layer}),r=a.find((e=>"graphic"===e.type));if(r){const t=r.graphic;if("transform"===f.activeTool||"reshape"===f.activeTool){if(f.updateGraphics.getItemAt(0)===t)return;await e.updatePendingFeature(t,p)}}})),b=s((()=>c.viewModel.attachmentsViewModel.mode),(e=>{"add"===e&&c.viewModel.activeWorkflow.go("adding-attachment"),"edit"===e&&c.viewModel.activeWorkflow.go("editing-attachment")}));await e._startCreating(p);const F={remove:()=>{r(e._featureFormHandle),g.remove(),v.remove(),y.remove(),_.remove(),null!=M&&f.snappingOptions.featureSources.remove(M),M=o(M),f.cancel(),A.remove(),b.remove(),r(w)}};d.add(F,this.id)},async tearDown(t){t.cancelled&&(c.viewModel.sketchViewModel.layer.removeAll(),d.remove([this.id,E]),c.viewModel.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear(),c.viewModel.sketchViewModel.updateOnGraphicClick=h)}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{graphic:t,fileInfos:a}=c.viewModel.attachmentsViewModel;e._attachmentFileInfos.set(t,a.toArray()),c.viewModel.attachmentsViewModel.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{graphic:t,fileInfos:a}=c.viewModel.attachmentsViewModel;e._attachmentFileInfos.set(t,a.toArray()),c.viewModel.attachmentsViewModel.mode="view"}})});return k(c,f)}_getAddAttachmentsData(e,t,a,i){const r=[];return t.forEach(((t,o)=>{if(!t.error){const s=e[o],n=i.get(s)||[];s.attributes[a.objectIdField]=t.objectId,n.forEach((({form:e})=>r.push({feature:s,attachment:e})))}})),r}_getAttachmentEditsWithGlobalIds(e,t,a){const i=[],r=t.globalIdField;return e.forEach(((t,o)=>{const s=a.get(t)||[];let n=t.attributes[r];null==n&&(n=c(),e[o].attributes[r]=n),s.forEach((({file:e})=>i.push({feature:t,attachment:{globalId:c(),data:e}})))})),i.length?{addFeatures:e,addAttachments:i}:{addFeatures:e}}};e([d()],G.prototype,"reliesOnOwnerAdminPrivileges",null),e([d()],G.prototype,"shouldShowAttachments",null),e([d()],G.prototype,"shouldAllowAttachmentEditing",null),e([d()],G.prototype,"helpMessage",null),G=C=e([u("esri.widgets.Editor.CreateFeaturesWorkflow")],G);const O=G;export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let t=class extends r{constructor(o){super(o),this.creationInfo=null,this.viewModel=null}};o([s()],t.prototype,"creationInfo",void 0),o([s()],t.prototype,"viewModel",void 0),t=o([e("esri.widgets.Editor.CreateFeaturesWorkflowData")],t);export{t as CreateFeaturesWorkflowData};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let t=class extends r{constructor(o){super(o),this.creationInfo=null,this.viewModel=null,this.upload=null}};o([s()],t.prototype,"creationInfo",void 0),o([s()],t.prototype,"viewModel",void 0),o([s()],t.prototype,"upload",void 0),t=o([e("esri.widgets.Editor.CreateFeaturesWorkflowData")],t);export{t as CreateFeaturesWorkflowData};