@jxsuite/studio 4.0.0 → 5.0.0

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 (613) hide show
  1. package/README.md +1 -1
  2. package/data/elements-meta.json +5 -15
  3. package/data/html-meta.json +51 -6
  4. package/dist/chunks/{2020-xp8vnwma.js → 2020-g79n01v9.js} +14 -14
  5. package/dist/chunks/action-group-sp6tna8v.js +118 -0
  6. package/dist/chunks/adapter-nj7tnjfn.js +13 -0
  7. package/dist/chunks/cf-account-picker-fyf63pmy.js +495 -0
  8. package/dist/chunks/cf-settings-71bv5zn9.js +20 -0
  9. package/dist/chunks/color-area-v17df7b8.js +154 -0
  10. package/dist/chunks/color-field-anwybnkn.js +208 -0
  11. package/dist/chunks/color-slider-44ez96fc.js +79 -0
  12. package/dist/chunks/color-xgg3kfw7.js +35 -0
  13. package/dist/chunks/combobox-5e7jev23.js +236 -0
  14. package/dist/chunks/components-2w1f35qs.js +18 -0
  15. package/dist/chunks/content-source-3wqeas45.js +46 -0
  16. package/dist/chunks/convert-to-repeater-d0cgnb6d.js +639 -0
  17. package/dist/chunks/dialog-s890b918.js +85 -0
  18. package/dist/chunks/editor-3qhbg51x.js +35 -0
  19. package/dist/chunks/entry-commands-d6g50j7s.js +42 -0
  20. package/dist/chunks/extension-sections-fy7q4fe9.js +651 -0
  21. package/dist/chunks/file-ops-3btj6st0.js +47 -0
  22. package/dist/chunks/files-ef8fgs3w.js +72 -0
  23. package/dist/chunks/format-host-3c33nwr8.js +40 -0
  24. package/dist/chunks/fs-events-13tj6sex.js +18 -0
  25. package/dist/chunks/git-panel-4wp2rn9b.js +49 -0
  26. package/dist/chunks/icons-yy10wk9r.js +402 -0
  27. package/dist/chunks/iframe-entry-15g3n6xv.js +114 -0
  28. package/dist/chunks/iframe-entry-b27vq81n.js +203 -0
  29. package/dist/chunks/iframe-entry-nbyxee1y.js +154 -0
  30. package/dist/chunks/iframe-host-jgesd924.js +115 -0
  31. package/dist/chunks/{index-nj44jpzj.js → index-mdmyx6s2.js} +11 -11
  32. package/dist/chunks/index-n4j7qxyr.js +109 -0
  33. package/dist/chunks/{javascript-q8kpmfah.js → javascript-xvrfrpkb.js} +8 -9
  34. package/dist/chunks/{jsonMode-dkr040ga.js → jsonMode-tyx2kj6p.js} +526 -527
  35. package/dist/chunks/jx-validate-j0wxk72w.js +15 -0
  36. package/dist/chunks/layers-1nq5evsh.js +29 -0
  37. package/dist/chunks/layers-panel-ar2gh90g.js +40 -0
  38. package/dist/chunks/listbox-6v2ac08j.js +44 -0
  39. package/dist/chunks/lit-html-m244w9nh.js +17 -0
  40. package/dist/chunks/media-picker-2qbetq73.js +33 -0
  41. package/dist/chunks/menu-q99sy9rf.js +285 -0
  42. package/dist/chunks/menu-rf7n72mf.js +14 -0
  43. package/dist/chunks/{monaco-binding-rj6xpx9y.js → monaco-binding-sw6en4dw.js} +12 -15
  44. package/dist/chunks/monaco-buffer-bhy3hb6m.js +24 -0
  45. package/dist/chunks/{monaco-setup-rws7k4br.js → monaco-setup-8r62fj6y.js} +27 -37
  46. package/dist/chunks/notify-628t0anh.js +21 -0
  47. package/dist/chunks/number-field-5cndyft8.js +72 -0
  48. package/dist/chunks/parse-0zx14y15.js +10 -0
  49. package/dist/chunks/platform-ts9cg1a4.js +15 -0
  50. package/dist/chunks/popover-47z3ytva.js +25 -0
  51. package/dist/chunks/publish-panel-98f7sr3g.js +27 -0
  52. package/dist/chunks/quick-search-srzz83k2.js +45 -0
  53. package/dist/chunks/references-n553f0e1.js +26 -0
  54. package/dist/chunks/right-panel-rrgx2dn3.js +45 -0
  55. package/dist/chunks/section-registry-5pq32t0q.js +25 -0
  56. package/dist/chunks/select-2r16ez41.js +49 -0
  57. package/dist/chunks/split-g7nm1rgb.js +191 -0
  58. package/dist/chunks/studio-0hqbpbd0.js +62 -0
  59. package/dist/chunks/studio-18avnhjp.js +2430 -0
  60. package/dist/chunks/{studio-kryvsw6j.js → studio-1k325pwf.js} +48 -48
  61. package/dist/chunks/{studio-hbtp0eh1.js → studio-25hkdrkw.js} +356 -85
  62. package/dist/chunks/studio-26d7myd1.js +258 -0
  63. package/dist/chunks/{studio-p8j86wag.js → studio-38emantv.js} +22 -5
  64. package/dist/chunks/studio-3gxv60tn.js +422 -0
  65. package/dist/chunks/{studio-8swrjbny.js → studio-3hxkd92t.js} +275 -163
  66. package/dist/chunks/studio-4m0haseg.js +185 -0
  67. package/dist/chunks/{studio-ynxwkrzd.js → studio-4wbb9ct0.js} +1953 -1785
  68. package/dist/chunks/{studio-gv8vvshc.js → studio-5523bpzt.js} +11 -11
  69. package/dist/chunks/{studio-5q69gfag.js → studio-57mf66w2.js} +1753 -2484
  70. package/dist/chunks/studio-5jy81t3s.js +17463 -0
  71. package/dist/chunks/studio-5rt7sqa0.js +1168 -0
  72. package/dist/chunks/studio-5te5tqng.js +81 -0
  73. package/dist/chunks/{studio-p4ngc046.js → studio-6ewqv390.js} +9 -9
  74. package/dist/chunks/{studio-9ab8gqsm.js → studio-6nzaktvy.js} +7 -7
  75. package/dist/chunks/studio-6xa21ej9.js +28 -0
  76. package/dist/chunks/{studio-5ehhackm.js → studio-727xh0e3.js} +19 -19
  77. package/dist/chunks/{studio-eenfkt4e.js → studio-79y5sz51.js} +52 -38
  78. package/dist/chunks/{studio-4q0wznzf.js → studio-7e11jpa9.js} +461 -145
  79. package/dist/chunks/{studio-q7v10cg2.js → studio-7r42c6ca.js} +17 -7
  80. package/dist/chunks/studio-7xptrg0j.js +954 -0
  81. package/dist/chunks/{studio-cft9r4r7.js → studio-81390n6f.js} +22 -22
  82. package/dist/chunks/{studio-q43a5y9h.js → studio-8jn5yhyn.js} +16 -16
  83. package/dist/chunks/studio-8qtrpzr3.js +839 -0
  84. package/dist/chunks/{studio-dg7zyt5x.js → studio-98b3z07n.js} +1 -1
  85. package/dist/chunks/studio-9xxz1q69.js +1356 -0
  86. package/dist/chunks/studio-akbww0j5.js +13615 -0
  87. package/dist/chunks/studio-arfpe389.js +195 -0
  88. package/dist/chunks/{studio-2zkz8evn.js → studio-az3zd49t.js} +473 -281
  89. package/dist/chunks/studio-cpvb2ed1.js +1171 -0
  90. package/dist/chunks/{studio-9r6j5ev1.js → studio-d0300636.js} +5078 -19
  91. package/dist/chunks/{studio-bgxt93ga.js → studio-d055c37e.js} +13 -13
  92. package/dist/chunks/studio-d1ja2x9r.js +362 -0
  93. package/dist/chunks/{studio-b9b6t1dg.js → studio-e1f24eff.js} +5664 -5666
  94. package/dist/chunks/{studio-4pqqxbrt.js → studio-em9nw8eh.js} +301 -112
  95. package/dist/chunks/studio-erdatzvp.js +1190 -0
  96. package/dist/chunks/{studio-g1wdche0.js → studio-esrxgwh6.js} +80 -80
  97. package/dist/chunks/studio-fabxk6r9.js +2811 -0
  98. package/dist/chunks/{studio-3n4ndrzh.js → studio-h4nvnjvz.js} +303 -303
  99. package/dist/chunks/studio-hhvs4sdg.js +195 -0
  100. package/dist/chunks/{studio-68n67094.js → studio-kcgff4r0.js} +15 -18
  101. package/dist/chunks/{studio-685s0ytq.js → studio-nqgawfks.js} +572 -572
  102. package/dist/chunks/{studio-xrapxwwc.js → studio-p1dw8wfw.js} +55 -29
  103. package/dist/chunks/studio-pm6hgy7r.js +4763 -0
  104. package/dist/chunks/studio-q0a3yk4n.js +33 -0
  105. package/dist/chunks/{studio-wcy8trfx.js → studio-q3x06vmj.js} +23 -22
  106. package/dist/chunks/studio-qahxvnan.js +111 -0
  107. package/dist/chunks/{studio-53n8bp04.js → studio-r6xmmtfh.js} +1 -1
  108. package/dist/chunks/{studio-kjjsjak4.js → studio-rkstz940.js} +3661 -6136
  109. package/dist/chunks/{studio-tvgyw9xw.js → studio-rnyf3f8e.js} +83 -250
  110. package/dist/chunks/studio-rpyah2ew.js +2805 -0
  111. package/dist/chunks/studio-rs76k67r.js +12 -0
  112. package/dist/chunks/{studio-yxrkyv8a.js → studio-s6z853aq.js} +12108 -11766
  113. package/dist/chunks/{studio-sf7zjgv1.js → studio-sgdc5pfc.js} +8 -8
  114. package/dist/chunks/studio-tb3ev01j.js +763 -0
  115. package/dist/chunks/{studio-t5wqwzdh.js → studio-tjjk7jvk.js} +1 -1
  116. package/dist/chunks/studio-vhv5tgxm.js +51 -0
  117. package/dist/chunks/{studio-htsf0w6m.js → studio-vz68yn9e.js} +31 -154
  118. package/dist/chunks/studio-wqpngpsk.js +174 -0
  119. package/dist/chunks/{studio-eesa1myv.js → studio-x3rty6tr.js} +58 -58
  120. package/dist/chunks/studio-xsykpvsh.js +8448 -0
  121. package/dist/chunks/{studio-92ab2jqe.js → studio-y9zedyjn.js} +14 -14
  122. package/dist/chunks/studio-yxa81f45.js +12 -0
  123. package/dist/chunks/swatch-group-t0n6h2rn.js +139 -0
  124. package/dist/chunks/tabs-wbp1cdws.js +156 -0
  125. package/dist/chunks/textfield-abk6qyee.js +73 -0
  126. package/dist/chunks/toast-780pvfbv.js +27 -0
  127. package/dist/chunks/toast-host-3sqv46sn.js +116 -0
  128. package/dist/chunks/toolbar-xbh5bhtr.js +194 -0
  129. package/dist/chunks/tooltip-eptb614w.js +369 -0
  130. package/dist/chunks/tree-a73p0pqm.js +367 -0
  131. package/dist/chunks/{tsMode-76kr53q0.js → tsMode-jy4m86rv.js} +83 -85
  132. package/dist/chunks/workspace-wrew8zk4.js +69 -0
  133. package/dist/chunks/{ws-client-6shc5rze.js → ws-client-ny4zc51r.js} +20 -22
  134. package/dist/iframe-entry.js +1812 -698
  135. package/dist/manifest.json +7 -0
  136. package/dist/studio.js +52900 -36573
  137. package/dist/workers/editor.worker.js +1040 -1085
  138. package/dist/workers/json.worker.js +1946 -1991
  139. package/dist/workers/ts.worker.js +4960 -5005
  140. package/favicon.ico +0 -0
  141. package/index.html +2 -0
  142. package/package.json +22 -55
  143. package/src/about/about-modal.ts +73 -123
  144. package/src/browse/library-commands.ts +20 -49
  145. package/src/browse/library-layouts.ts +87 -218
  146. package/src/browse/library-pane.ts +406 -438
  147. package/src/canvas/canvas-helpers.ts +0 -49
  148. package/src/canvas/canvas-live-render.ts +25 -2
  149. package/src/canvas/canvas-render.ts +666 -231
  150. package/src/canvas/canvas-surface.ts +0 -1
  151. package/src/canvas/canvas-utils.ts +310 -117
  152. package/src/canvas/dialog-path.ts +76 -0
  153. package/src/canvas/dialog-state.ts +67 -0
  154. package/src/canvas/diff-marks.ts +252 -0
  155. package/src/canvas/diff-toolbar.ts +349 -0
  156. package/src/canvas/diff-view.ts +123 -0
  157. package/src/canvas/edit-width-drag.ts +187 -0
  158. package/src/canvas/edit-width.ts +150 -0
  159. package/src/canvas/iframe-entry.ts +125 -8
  160. package/src/canvas/iframe-host.ts +271 -15
  161. package/src/canvas/iframe-interaction.ts +133 -13
  162. package/src/canvas/iframe-patch.ts +7 -1
  163. package/src/canvas/iframe-position.ts +5 -6
  164. package/src/canvas/iframe-protocol.ts +106 -5
  165. package/src/canvas/iframe-render.ts +373 -5
  166. package/src/canvas/iframe-slash.ts +2 -2
  167. package/src/canvas/iframe-subtree.ts +5 -8
  168. package/src/canvas/path-mapping.ts +25 -3
  169. package/src/canvas/popover-path.ts +106 -0
  170. package/src/canvas/popover-state.ts +155 -0
  171. package/src/canvas/surface-registry.ts +21 -10
  172. package/src/collab/presence-chips.ts +51 -73
  173. package/src/commands/app-commands.ts +10 -0
  174. package/src/commands/budget.ts +12 -0
  175. package/src/commands/command-args.ts +369 -6
  176. package/src/commands/defaults.ts +44 -14
  177. package/src/commands/live-context.ts +11 -5
  178. package/src/commands/reference.ts +12 -2
  179. package/src/commands/registry.ts +165 -8
  180. package/src/content/entry-commands.ts +16 -23
  181. package/src/content/entry-editor.ts +144 -101
  182. package/src/editor/canvas-slash-bridge.ts +2 -2
  183. package/src/editor/context-menu.ts +49 -200
  184. package/src/editor/convert-to-component.ts +42 -82
  185. package/src/editor/convert-to-repeater.ts +132 -173
  186. package/src/editor/inline-edit.ts +11 -0
  187. package/src/editor/shortcuts.ts +65 -26
  188. package/src/editor/slash-menu.ts +150 -157
  189. package/src/files/file-ops.ts +117 -11
  190. package/src/files/files.ts +949 -664
  191. package/src/files/json-layout.ts +474 -0
  192. package/src/files/media-paths.ts +13 -42
  193. package/src/files/media-usage.ts +41 -131
  194. package/src/files/serialize-document.ts +8 -1
  195. package/src/format/convert-file.ts +16 -10
  196. package/src/format/format-host.ts +50 -1
  197. package/src/github/github-auth.ts +71 -29
  198. package/src/github/github-publish.ts +57 -65
  199. package/src/grid/cell-editors.ts +46 -4
  200. package/src/grid/cell-popovers.ts +65 -62
  201. package/src/grid/grid-open.ts +86 -64
  202. package/src/grid/grid-panel.ts +390 -469
  203. package/src/grid/redirects-grid.ts +40 -44
  204. package/src/hosting/document.ts +2 -0
  205. package/src/hosting/layout.ts +10 -0
  206. package/src/i18n/i18n-commands.ts +127 -62
  207. package/src/media/media-pane.ts +83 -133
  208. package/src/new-project/add-repo-modal.ts +125 -176
  209. package/src/new-project/import-tab.ts +201 -250
  210. package/src/new-project/location-fields.ts +101 -165
  211. package/src/new-project/new-project-modal.ts +376 -367
  212. package/src/packages/jxsuite-update.ts +76 -18
  213. package/src/panels/activity-panel.ts +137 -104
  214. package/src/panels/ai-chat/chat-markdown.ts +15 -13
  215. package/src/panels/ai-chat/chat-view.ts +307 -472
  216. package/src/panels/ai-chat/composer.ts +175 -153
  217. package/src/panels/ai-chat/sessions-view.ts +31 -62
  218. package/src/panels/ai-panel.ts +210 -185
  219. package/src/panels/block-action-bar.ts +437 -643
  220. package/src/panels/bottom-dock.ts +112 -47
  221. package/src/panels/chat-panel.ts +19 -14
  222. package/src/panels/data-explorer.ts +141 -102
  223. package/src/panels/data-grid.ts +183 -150
  224. package/src/panels/dnd.ts +75 -20
  225. package/src/panels/editors.ts +26 -19
  226. package/src/panels/elements-panel.ts +243 -186
  227. package/src/panels/empty-state.ts +26 -42
  228. package/src/panels/events-panel.ts +950 -729
  229. package/src/panels/formula-workspace.ts +434 -207
  230. package/src/panels/frontmatter-fields.ts +185 -153
  231. package/src/panels/frontmatter-panel.ts +411 -187
  232. package/src/panels/git-diff-open.ts +148 -0
  233. package/src/panels/git-panel.ts +679 -605
  234. package/src/panels/head-panel.ts +617 -435
  235. package/src/panels/i18n-panel.ts +153 -133
  236. package/src/panels/imports-panel.ts +388 -414
  237. package/src/panels/jump-bar.ts +174 -147
  238. package/src/panels/layers-panel.ts +785 -671
  239. package/src/panels/left-panel.ts +166 -94
  240. package/src/panels/navigator-panels.ts +1 -1
  241. package/src/panels/pane-context.ts +529 -677
  242. package/src/panels/pane-grid.ts +265 -241
  243. package/src/panels/panel-registry.ts +15 -4
  244. package/src/panels/problems-panel.ts +177 -99
  245. package/src/panels/properties-panel.ts +1525 -966
  246. package/src/panels/provenance.ts +31 -113
  247. package/src/panels/quick-search.ts +217 -172
  248. package/src/panels/right-panel.ts +135 -169
  249. package/src/panels/seo-modal.ts +346 -167
  250. package/src/panels/settings-menu.ts +109 -646
  251. package/src/panels/settings-pane.ts +102 -86
  252. package/src/panels/signals-panel.ts +1318 -1172
  253. package/src/panels/statement-editor.ts +556 -428
  254. package/src/panels/style-panel.ts +1367 -630
  255. package/src/panels/style-utils.ts +36 -32
  256. package/src/panels/stylebook-doc.ts +30 -73
  257. package/src/panels/stylebook-layers-panel.ts +202 -109
  258. package/src/panels/stylebook-panel.ts +124 -88
  259. package/src/panels/tab-strip.ts +385 -287
  260. package/src/platforms/cloud.ts +347 -86
  261. package/src/platforms/devserver.ts +13 -0
  262. package/src/publish/deploy-checklist.ts +124 -78
  263. package/src/publish/publish-commands.ts +4 -12
  264. package/src/publish/publish-panel.ts +165 -299
  265. package/src/services/a11y-report.ts +100 -43
  266. package/src/services/ai-command-tools.ts +468 -0
  267. package/src/services/ai-import-tools.ts +50 -12
  268. package/src/services/ai-models.ts +108 -1
  269. package/src/services/ai-session-store.ts +6 -0
  270. package/src/services/ai-system-prompt.ts +110 -18
  271. package/src/services/ai-tools.ts +28 -143
  272. package/src/services/ai-write-report.ts +174 -0
  273. package/src/services/context-manager.ts +12 -1
  274. package/src/services/document-assistant.ts +50 -2
  275. package/src/services/idle.ts +16 -14
  276. package/src/services/live-surfaces.ts +237 -0
  277. package/src/services/model-uri.ts +75 -0
  278. package/src/services/notify.ts +63 -6
  279. package/src/services/popover-report.ts +325 -0
  280. package/src/services/surface-registry.ts +56 -0
  281. package/src/services/tool-executor.ts +17 -0
  282. package/src/settings/contexts-section.ts +301 -299
  283. package/src/settings/contributed-section.ts +361 -222
  284. package/src/settings/css-vars-editor.ts +320 -325
  285. package/src/settings/defs-editor.ts +572 -535
  286. package/src/settings/dependencies-editor.ts +79 -107
  287. package/src/settings/extension-commands.ts +379 -0
  288. package/src/settings/extension-rows.ts +113 -0
  289. package/src/settings/extensions-section.ts +287 -0
  290. package/src/settings/general-settings.ts +130 -181
  291. package/src/settings/head-editor.ts +10 -305
  292. package/src/settings/locales-section.ts +146 -196
  293. package/src/settings/preferences-accounts.ts +193 -12
  294. package/src/settings/preferences-dialog.ts +384 -307
  295. package/src/settings/project-sections.ts +108 -181
  296. package/src/settings/schema-field-ui.ts +11 -399
  297. package/src/settings/section-registry.ts +8 -1
  298. package/src/settings/settings-document.ts +31 -29
  299. package/src/shell/tree.ts +42 -87
  300. package/src/shell.ts +48 -36
  301. package/src/studio.ts +90 -67
  302. package/src/style/token-ref.ts +0 -39
  303. package/src/surfaces/about.json +263 -0
  304. package/src/surfaces/about.ts +163 -0
  305. package/src/surfaces/add-repo.json +486 -0
  306. package/src/surfaces/add-repo.ts +236 -0
  307. package/src/surfaces/ai-chat.json +2185 -0
  308. package/src/surfaces/ai-chat.ts +549 -0
  309. package/src/surfaces/ai-credentials-form.json +332 -0
  310. package/src/surfaces/ai-credentials-form.ts +151 -0
  311. package/src/surfaces/ai-managed-connect.json +108 -0
  312. package/src/surfaces/ai-managed-connect.ts +123 -0
  313. package/src/surfaces/ai-model-picker.json +114 -0
  314. package/src/surfaces/ai-model-picker.ts +139 -0
  315. package/src/surfaces/block-action-bar.json +640 -0
  316. package/src/surfaces/block-action-bar.ts +368 -0
  317. package/src/surfaces/bottom-dock.json +154 -0
  318. package/src/surfaces/bottom-dock.ts +125 -0
  319. package/src/surfaces/canvas-stage.json +444 -0
  320. package/src/surfaces/canvas-stage.ts +253 -0
  321. package/src/surfaces/cf-account-picker.json +300 -0
  322. package/src/surfaces/cf-account-picker.ts +214 -0
  323. package/src/surfaces/commandbar.json +984 -0
  324. package/src/{panels/toolbar.ts → surfaces/commandbar.ts} +414 -389
  325. package/src/surfaces/convert-repeater.json +309 -0
  326. package/src/surfaces/convert-repeater.ts +276 -0
  327. package/src/surfaces/data-actions.json +157 -0
  328. package/src/surfaces/data-actions.ts +115 -0
  329. package/src/surfaces/dialog.json +289 -0
  330. package/src/surfaces/dialog.ts +343 -0
  331. package/src/surfaces/diff-toolbar.json +266 -0
  332. package/src/surfaces/diff-toolbar.ts +139 -0
  333. package/src/surfaces/doc-header.json +739 -0
  334. package/src/surfaces/doc-header.ts +223 -0
  335. package/src/surfaces/empty-state.json +152 -0
  336. package/src/surfaces/empty-state.ts +173 -0
  337. package/src/surfaces/entry-editor.json +281 -0
  338. package/src/surfaces/entry-editor.ts +191 -0
  339. package/src/surfaces/expression-editor.json +977 -0
  340. package/src/surfaces/expression-editor.ts +266 -0
  341. package/src/surfaces/files-panel.json +592 -0
  342. package/src/surfaces/files-panel.ts +301 -0
  343. package/src/surfaces/formula-palette.json +364 -0
  344. package/src/surfaces/formula-palette.ts +340 -0
  345. package/src/surfaces/git-panel.json +1822 -0
  346. package/src/surfaces/git-panel.ts +272 -0
  347. package/src/surfaces/github-auth.json +112 -0
  348. package/src/surfaces/github-auth.ts +139 -0
  349. package/src/surfaces/github-publish.json +206 -0
  350. package/src/surfaces/github-publish.ts +169 -0
  351. package/src/surfaces/grid-cell.json +218 -0
  352. package/src/surfaces/grid-cell.ts +120 -0
  353. package/src/surfaces/grid-open.json +147 -0
  354. package/src/surfaces/grid-open.ts +87 -0
  355. package/src/surfaces/grid-panel.json +706 -0
  356. package/src/surfaces/grid-panel.ts +206 -0
  357. package/src/surfaces/grid-replace.json +179 -0
  358. package/src/surfaces/grid-replace.ts +89 -0
  359. package/src/surfaces/grid-views.json +446 -0
  360. package/src/surfaces/grid-views.ts +172 -0
  361. package/src/surfaces/inspector-dock.json +187 -0
  362. package/src/surfaces/inspector-dock.ts +161 -0
  363. package/src/surfaces/jump-bar.json +243 -0
  364. package/src/surfaces/jump-bar.ts +129 -0
  365. package/src/surfaces/jxsuite-update.json +146 -0
  366. package/src/surfaces/jxsuite-update.ts +149 -0
  367. package/src/surfaces/library-pane.json +1509 -0
  368. package/src/surfaces/library-pane.ts +363 -0
  369. package/src/surfaces/logic-panel.json +1949 -0
  370. package/src/surfaces/logic-panel.ts +369 -0
  371. package/src/surfaces/logic-workspace.json +685 -0
  372. package/src/surfaces/logic-workspace.ts +238 -0
  373. package/src/surfaces/media-browser.json +303 -0
  374. package/src/surfaces/media-browser.ts +145 -0
  375. package/src/surfaces/media-field.json +163 -0
  376. package/src/surfaces/media-field.ts +116 -0
  377. package/src/surfaces/media-pane.json +513 -0
  378. package/src/surfaces/media-pane.ts +197 -0
  379. package/src/surfaces/menu.json +232 -0
  380. package/src/surfaces/menu.ts +375 -0
  381. package/src/surfaces/navigator-dock.json +113 -0
  382. package/src/surfaces/navigator-dock.ts +130 -0
  383. package/src/surfaces/new-project.json +1654 -0
  384. package/src/surfaces/new-project.ts +411 -0
  385. package/src/surfaces/palette.json +535 -0
  386. package/src/surfaces/pane-context.json +1497 -0
  387. package/src/surfaces/pane-context.ts +513 -0
  388. package/src/surfaces/pane-grid.json +188 -0
  389. package/src/surfaces/pane-grid.ts +250 -0
  390. package/src/surfaces/panel-activity.json +563 -0
  391. package/src/surfaces/panel-activity.ts +187 -0
  392. package/src/surfaces/panel-data.json +141 -0
  393. package/src/surfaces/panel-data.ts +156 -0
  394. package/src/surfaces/panel-deploy-checklist.json +283 -0
  395. package/src/surfaces/panel-deploy-checklist.ts +175 -0
  396. package/src/surfaces/panel-elements.json +367 -0
  397. package/src/surfaces/panel-elements.ts +175 -0
  398. package/src/surfaces/panel-i18n.json +569 -0
  399. package/src/surfaces/panel-i18n.ts +212 -0
  400. package/src/surfaces/panel-imports.json +780 -0
  401. package/src/surfaces/panel-imports.ts +209 -0
  402. package/src/surfaces/panel-outline.json +734 -0
  403. package/src/surfaces/panel-outline.ts +326 -0
  404. package/src/surfaces/panel-page.json +1017 -0
  405. package/src/surfaces/panel-page.ts +240 -0
  406. package/src/surfaces/panel-problems.json +497 -0
  407. package/src/surfaces/panel-problems.ts +157 -0
  408. package/src/surfaces/panel-signals.json +1973 -0
  409. package/src/surfaces/panel-signals.ts +436 -0
  410. package/src/surfaces/panel-stylebook-layers.json +317 -0
  411. package/src/surfaces/panel-stylebook-layers.ts +155 -0
  412. package/src/surfaces/preferences.json +850 -0
  413. package/src/surfaces/preferences.ts +332 -0
  414. package/src/surfaces/progress-modal.json +110 -0
  415. package/src/surfaces/progress-modal.ts +150 -0
  416. package/src/surfaces/properties-panel.json +1578 -0
  417. package/src/surfaces/properties-panel.ts +337 -0
  418. package/src/surfaces/publish.json +945 -0
  419. package/src/surfaces/publish.ts +392 -0
  420. package/src/surfaces/push-plan.json +110 -0
  421. package/src/surfaces/push-plan.ts +87 -0
  422. package/src/surfaces/rail.json +255 -0
  423. package/src/surfaces/rail.ts +206 -0
  424. package/src/surfaces/reference-field.json +191 -0
  425. package/src/surfaces/reference-field.ts +168 -0
  426. package/src/surfaces/schema-builder.json +1011 -0
  427. package/src/surfaces/schema-builder.ts +181 -0
  428. package/src/surfaces/schema-form.json +1013 -0
  429. package/src/surfaces/schema-form.ts +287 -0
  430. package/src/surfaces/secret-field.json +60 -0
  431. package/src/surfaces/secret-field.ts +146 -0
  432. package/src/surfaces/seo.json +932 -0
  433. package/src/surfaces/seo.ts +334 -0
  434. package/src/surfaces/settings-contexts.json +538 -0
  435. package/src/surfaces/settings-contexts.ts +196 -0
  436. package/src/surfaces/settings-contributed.json +489 -0
  437. package/src/surfaces/settings-contributed.ts +199 -0
  438. package/src/surfaces/settings-css-vars.json +820 -0
  439. package/src/surfaces/settings-css-vars.ts +199 -0
  440. package/src/surfaces/settings-defs.json +1363 -0
  441. package/src/surfaces/settings-defs.ts +232 -0
  442. package/src/surfaces/settings-deploy.json +108 -0
  443. package/src/surfaces/settings-deploy.ts +135 -0
  444. package/src/surfaces/settings-extensions.json +486 -0
  445. package/src/surfaces/settings-extensions.ts +201 -0
  446. package/src/surfaces/settings-head.json +779 -0
  447. package/src/surfaces/settings-head.ts +397 -0
  448. package/src/surfaces/settings-locales.json +420 -0
  449. package/src/surfaces/settings-locales.ts +137 -0
  450. package/src/surfaces/settings-overview.json +423 -0
  451. package/src/surfaces/settings-overview.ts +218 -0
  452. package/src/surfaces/settings-packages.json +549 -0
  453. package/src/surfaces/settings-packages.ts +158 -0
  454. package/src/surfaces/settings-pane.json +147 -0
  455. package/src/surfaces/settings-pane.ts +150 -0
  456. package/src/surfaces/settings-rawjson.json +104 -0
  457. package/src/surfaces/settings-rawjson.ts +107 -0
  458. package/src/surfaces/shell.json +99 -0
  459. package/src/surfaces/shell.ts +30 -0
  460. package/src/surfaces/slash-menu.json +180 -0
  461. package/src/surfaces/slash-menu.ts +272 -0
  462. package/src/surfaces/statements.json +607 -0
  463. package/src/surfaces/statements.ts +238 -0
  464. package/src/surfaces/statusbar.json +94 -0
  465. package/src/{panels → surfaces}/statusbar.ts +163 -90
  466. package/src/surfaces/style-panel.json +1643 -0
  467. package/src/surfaces/style-panel.ts +338 -0
  468. package/src/surfaces/stylebook-chrome.json +122 -0
  469. package/src/surfaces/stylebook-chrome.ts +122 -0
  470. package/src/surfaces/tab-strip.json +448 -0
  471. package/src/surfaces/tab-strip.ts +200 -0
  472. package/src/surfaces/target-line.json +419 -0
  473. package/src/surfaces/target-line.ts +349 -0
  474. package/src/surfaces/toasts.json +189 -0
  475. package/src/surfaces/welcome.json +571 -0
  476. package/src/surfaces/welcome.ts +338 -0
  477. package/src/tabs/project-config.ts +71 -15
  478. package/src/tabs/tab.ts +52 -1
  479. package/src/types.ts +49 -3
  480. package/src/ui/ai-credentials-form.ts +104 -100
  481. package/src/ui/ai-managed-connect.ts +116 -49
  482. package/src/ui/ai-model-picker.ts +102 -47
  483. package/src/ui/cf-account-picker.ts +135 -0
  484. package/src/ui/color-selector.ts +80 -301
  485. package/src/ui/dynamic-slot.ts +43 -283
  486. package/src/ui/expression-editor.ts +797 -576
  487. package/src/ui/field-input.ts +8 -181
  488. package/src/ui/form-controls.ts +838 -366
  489. package/src/ui/formula-chips.ts +80 -85
  490. package/src/ui/kit.ts +33 -0
  491. package/src/ui/layers.ts +293 -593
  492. package/src/ui/media-picker.ts +203 -284
  493. package/src/ui/panel-resize.ts +251 -64
  494. package/src/ui/popover-surface.ts +153 -0
  495. package/src/ui/progress-modal.ts +22 -60
  496. package/src/ui/regions.ts +13 -7
  497. package/src/ui/schema-form.ts +906 -440
  498. package/src/ui/surface.ts +122 -0
  499. package/src/ui/unit-selector.ts +15 -131
  500. package/src/ui/value-source.ts +14 -0
  501. package/src/ui/virtual-window.ts +88 -9
  502. package/src/utils/canvas-media.ts +72 -0
  503. package/src/utils/edit-display.ts +7 -2
  504. package/src/utils/element-selectors.ts +69 -0
  505. package/src/utils/link-target.ts +2 -2
  506. package/src/utils/studio-utils.ts +0 -10
  507. package/src/view.ts +15 -0
  508. package/src/workspace/pane-derive.ts +36 -14
  509. package/src/workspace/workspace.ts +15 -6
  510. package/styles/canvas.css +72 -467
  511. package/styles/forced-colors.css +48 -82
  512. package/styles/forced-colors.json +41 -0
  513. package/styles/inspector.css +2 -1301
  514. package/styles/overlays.css +96 -2823
  515. package/styles/panels.css +6 -1423
  516. package/styles/shell-frame.css +272 -0
  517. package/styles/shell-frame.json +227 -0
  518. package/styles/shell.css +0 -1532
  519. package/styles/tokens.css +65 -136
  520. package/styles/tokens.json +84 -0
  521. package/dist/chunks/Overlay.dev-723bv0df.js +0 -23
  522. package/dist/chunks/adapter-jkcyhgtr.js +0 -14
  523. package/dist/chunks/cf-settings-45fgyx8y.js +0 -21
  524. package/dist/chunks/components-zmx10t62.js +0 -21
  525. package/dist/chunks/content-source-t88vb2dr.js +0 -49
  526. package/dist/chunks/convert-to-repeater-dhw1nrz9.js +0 -268
  527. package/dist/chunks/editor-cptq5jp1.js +0 -37
  528. package/dist/chunks/entry-commands-6z6bhxg0.js +0 -46
  529. package/dist/chunks/extension-sections-3ydgjbdy.js +0 -311
  530. package/dist/chunks/file-ops-rskmhxyq.js +0 -48
  531. package/dist/chunks/files-0cratsr0.js +0 -92
  532. package/dist/chunks/flow-qbfgrpeh.js +0 -634
  533. package/dist/chunks/focus-trap.esm-ggawf1hy.js +0 -1024
  534. package/dist/chunks/focus-visible-6eg70z18.js +0 -167
  535. package/dist/chunks/format-host-tgcmfs4p.js +0 -43
  536. package/dist/chunks/fs-events-hrrg328g.js +0 -21
  537. package/dist/chunks/git-panel-0yywyk76.js +0 -58
  538. package/dist/chunks/index-zqxmqxmh.js +0 -109
  539. package/dist/chunks/jx-validate-8q2g05x1.js +0 -19
  540. package/dist/chunks/layers-panel-z3tqe5cd.js +0 -67
  541. package/dist/chunks/layers-q75tj2mf.js +0 -45
  542. package/dist/chunks/lit-html-j055mkh8.js +0 -22
  543. package/dist/chunks/monaco-buffer-dqw0xxpx.js +0 -25
  544. package/dist/chunks/notify-yjm79n4s.js +0 -30
  545. package/dist/chunks/parse-24d0gay3.js +0 -19
  546. package/dist/chunks/platform-ba1j1gbh.js +0 -16
  547. package/dist/chunks/publish-panel-54jvhskq.js +0 -28
  548. package/dist/chunks/quick-search-cgfmjwq5.js +0 -65
  549. package/dist/chunks/references-3qx8fkyp.js +0 -29
  550. package/dist/chunks/right-panel-cqp8bc4v.js +0 -46
  551. package/dist/chunks/section-registry-sx1ykvkw.js +0 -30
  552. package/dist/chunks/sp-overlay.dev-yztmtrs1.js +0 -18
  553. package/dist/chunks/sp-popover.dev-n2etmqdp.js +0 -9
  554. package/dist/chunks/sp-progress-circle.dev-hryhj0es.js +0 -15
  555. package/dist/chunks/sp-tooltip.dev-xcvpnqr0.js +0 -15
  556. package/dist/chunks/sp-tray.dev-tkbscm06.js +0 -199
  557. package/dist/chunks/studio-0a5qrh01.js +0 -3
  558. package/dist/chunks/studio-18j3bmcz.js +0 -14
  559. package/dist/chunks/studio-1hbqnt19.js +0 -1823
  560. package/dist/chunks/studio-4rzyrtjz.js +0 -426
  561. package/dist/chunks/studio-5rywrkxz.js +0 -1903
  562. package/dist/chunks/studio-7afd21nw.js +0 -67
  563. package/dist/chunks/studio-7nte2hj4.js +0 -613
  564. package/dist/chunks/studio-8jpzqk5s.js +0 -128
  565. package/dist/chunks/studio-8q517dfr.js +0 -24
  566. package/dist/chunks/studio-9c4k4vhv.js +0 -357
  567. package/dist/chunks/studio-9n4mrmnb.js +0 -184
  568. package/dist/chunks/studio-a0tswy0w.js +0 -58
  569. package/dist/chunks/studio-ahjfdy6e.js +0 -387
  570. package/dist/chunks/studio-ahnzd9rg.js +0 -23
  571. package/dist/chunks/studio-bw5dz6km.js +0 -608
  572. package/dist/chunks/studio-cb12yz9w.js +0 -15055
  573. package/dist/chunks/studio-d1ks410h.js +0 -175
  574. package/dist/chunks/studio-eqq1w638.js +0 -113
  575. package/dist/chunks/studio-ex8zyp98.js +0 -1813
  576. package/dist/chunks/studio-h4rxscfc.js +0 -10
  577. package/dist/chunks/studio-kyh9avvv.js +0 -28
  578. package/dist/chunks/studio-kyk2v92a.js +0 -659
  579. package/dist/chunks/studio-m3hwn7y1.js +0 -120
  580. package/dist/chunks/studio-mmv72a27.js +0 -4344
  581. package/dist/chunks/studio-n8b9wqwy.js +0 -291
  582. package/dist/chunks/studio-pdfjntbk.js +0 -6939
  583. package/dist/chunks/studio-qq6jym04.js +0 -53
  584. package/dist/chunks/studio-r1r7afxx.js +0 -1066
  585. package/dist/chunks/studio-rdx8jcxy.js +0 -83
  586. package/dist/chunks/studio-rn9ta2mz.js +0 -111
  587. package/dist/chunks/studio-t7qb9db8.js +0 -665
  588. package/dist/chunks/studio-tmc5emrw.js +0 -8
  589. package/dist/chunks/studio-txwkm6p9.js +0 -12
  590. package/dist/chunks/studio-v38hmvx1.js +0 -390
  591. package/dist/chunks/studio-vadzgkrz.js +0 -318
  592. package/dist/chunks/studio-wx5609xd.js +0 -341
  593. package/dist/chunks/studio-z6nw2ek2.js +0 -18
  594. package/dist/chunks/studio-zczps70q.js +0 -378
  595. package/dist/chunks/workspace-xpres40v.js +0 -89
  596. package/src/panels/activity-bar.ts +0 -251
  597. package/src/panels/panel-scheduler.ts +0 -219
  598. package/src/panels/style-inputs.ts +0 -237
  599. package/src/panels/target-line.ts +0 -274
  600. package/src/panels/welcome-screen.ts +0 -346
  601. package/src/ui/button-group.ts +0 -102
  602. package/src/ui/choice-field.ts +0 -72
  603. package/src/ui/field-row.ts +0 -249
  604. package/src/ui/formula-palette.ts +0 -213
  605. package/src/ui/icons.ts +0 -52
  606. package/src/ui/jx-theme.ts +0 -130
  607. package/src/ui/spectrum.ts +0 -340
  608. package/src/ui/value-selector.ts +0 -174
  609. package/src/ui/widgets.ts +0 -172
  610. /package/dist/chunks/{javascript-s56a8dpk.css → javascript-4abzjcy9.css} +0 -0
  611. /package/dist/chunks/{jsonMode-zr9sw0c7.css → jsonMode-vvmpmk34.css} +0 -0
  612. /package/dist/chunks/{monaco-setup-pav68602.css → monaco-setup-8vbyqnhr.css} +0 -0
  613. /package/dist/chunks/{tsMode-ef187txx.css → tsMode-hnxxb73h.css} +0 -0
@@ -1,4344 +0,0 @@
1
- import {
2
- firstFocusableIn,
3
- firstFocusableSlottedIn
4
- } from "./studio-z6nw2ek2.js";
5
- import {
6
- userFocusableSelector
7
- } from "./studio-8q517dfr.js";
8
- import {
9
- SpectrumElement,
10
- property,
11
- query,
12
- queryAssignedElements,
13
- queryAssignedNodes,
14
- state
15
- } from "./studio-zczps70q.js";
16
- import {
17
- css
18
- } from "./studio-7nte2hj4.js";
19
- import {
20
- ifDefined,
21
- styleMap
22
- } from "./studio-m3hwn7y1.js";
23
- import {
24
- html,
25
- nothing
26
- } from "./studio-kryvsw6j.js";
27
- import {
28
- __require,
29
- __toESM
30
- } from "./studio-a0tswy0w.js";
31
-
32
- // ../../node_modules/@spectrum-web-components/reactive-controllers/src/ElementResolution.dev.js
33
- var elementResolverUpdatedSymbol = Symbol("element resolver updated");
34
-
35
- class ElementResolutionController {
36
- constructor(host, { selector } = { selector: "" }) {
37
- this._element = null;
38
- this._selector = "";
39
- this.mutationCallback = (mutationList) => {
40
- let needsResolution = false;
41
- mutationList.forEach((mutation) => {
42
- if (needsResolution) {
43
- return;
44
- }
45
- if (mutation.type === "childList") {
46
- const currentElementRemoved = this.element && [...mutation.removedNodes].includes(this.element);
47
- const matchingElementAdded = !!this.selector && [...mutation.addedNodes].some(this.elementIsSelected);
48
- needsResolution = needsResolution || currentElementRemoved || matchingElementAdded;
49
- }
50
- if (mutation.type === "attributes") {
51
- const attributeChangedOnCurrentElement = mutation.target === this.element;
52
- const attributeChangedOnMatchingElement = !!this.selector && this.elementIsSelected(mutation.target);
53
- needsResolution = needsResolution || attributeChangedOnCurrentElement || attributeChangedOnMatchingElement;
54
- }
55
- });
56
- if (needsResolution) {
57
- this.resolveElement();
58
- }
59
- };
60
- this.elementIsSelected = (el) => {
61
- var _a;
62
- return this.selectorIsId ? (el == null ? undefined : el.id) === this.selectorAsId : (_a = el == null ? undefined : el.matches) == null ? undefined : _a.call(el, this.selector);
63
- };
64
- this.host = host;
65
- this.selector = selector;
66
- this.observer = new MutationObserver(this.mutationCallback);
67
- this.host.addController(this);
68
- }
69
- get element() {
70
- return this._element;
71
- }
72
- set element(element) {
73
- if (element === this.element) {
74
- return;
75
- }
76
- const previous = this.element;
77
- this._element = element;
78
- this.host.requestUpdate(elementResolverUpdatedSymbol, previous);
79
- }
80
- get selector() {
81
- return this._selector;
82
- }
83
- set selector(selector) {
84
- if (selector === this.selector) {
85
- return;
86
- }
87
- this.releaseElement();
88
- this._selector = selector;
89
- this.resolveElement();
90
- }
91
- get selectorAsId() {
92
- return this.selector.slice(1);
93
- }
94
- get selectorIsId() {
95
- return !!this.selector && this.selector.startsWith("#");
96
- }
97
- hostConnected() {
98
- this.resolveElement();
99
- this.observer.observe(this.host.getRootNode(), {
100
- subtree: true,
101
- childList: true,
102
- attributes: true
103
- });
104
- }
105
- hostDisconnected() {
106
- this.releaseElement();
107
- this.observer.disconnect();
108
- }
109
- resolveElement() {
110
- if (!this.selector) {
111
- this.releaseElement();
112
- return;
113
- }
114
- const parent = this.host.getRootNode();
115
- this.element = this.selectorIsId ? parent.getElementById(this.selectorAsId) : parent.querySelector(this.selector);
116
- }
117
- releaseElement() {
118
- this.element = null;
119
- }
120
- }
121
-
122
- // ../../node_modules/@spectrum-web-components/shared/src/random-id.dev.js
123
- function randomID() {
124
- return Array.from(crypto.getRandomValues(new Uint8Array(4)), (b) => `0${(b & 255).toString(16)}`.slice(-2)).join("");
125
- }
126
-
127
- // ../../node_modules/@spectrum-web-components/shared/src/reparent-children.dev.js
128
- function restoreChildren(placeholderItems, srcElements, cleanupCallbacks = []) {
129
- for (let index = 0;index < srcElements.length; ++index) {
130
- const srcElement = srcElements[index];
131
- const placeholderItem = placeholderItems[index];
132
- const parentElement = placeholderItem.parentElement || placeholderItem.getRootNode();
133
- if (cleanupCallbacks[index]) {
134
- cleanupCallbacks[index](srcElement);
135
- }
136
- if (parentElement && parentElement !== placeholderItem) {
137
- parentElement.replaceChild(srcElement, placeholderItem);
138
- }
139
- delete placeholderItems[index];
140
- }
141
- return srcElements;
142
- }
143
- var reparentChildren = (srcElements, destination, {
144
- position,
145
- prepareCallback
146
- } = { position: "beforeend" }) => {
147
- let { length } = srcElements;
148
- if (length === 0) {
149
- return () => srcElements;
150
- }
151
- let step = 1;
152
- let index = 0;
153
- if (position === "afterbegin" || position === "afterend") {
154
- step = -1;
155
- index = length - 1;
156
- }
157
- const placeholderItems = new Array(length);
158
- const cleanupCallbacks = new Array(length);
159
- const placeholderTemplate = document.createComment("placeholder for reparented element");
160
- do {
161
- const srcElement = srcElements[index];
162
- if (prepareCallback) {
163
- cleanupCallbacks[index] = prepareCallback(srcElement);
164
- }
165
- placeholderItems[index] = placeholderTemplate.cloneNode();
166
- const parentElement = srcElement.parentElement || srcElement.getRootNode();
167
- if (parentElement && parentElement !== srcElement) {
168
- parentElement.replaceChild(placeholderItems[index], srcElement);
169
- }
170
- destination.insertAdjacentElement(position, srcElement);
171
- index += step;
172
- } while (--length > 0);
173
- return function() {
174
- return restoreChildren(placeholderItems, srcElements, cleanupCallbacks);
175
- };
176
- };
177
-
178
- // ../../node_modules/@spectrum-web-components/overlay/src/overlay-timer.dev.js
179
- var DEFAULT_WARMUP = 1000;
180
- var DEFAULT_COOLDOWN = 1000;
181
-
182
- class OverlayTimer {
183
- constructor(options = {}) {
184
- this.warmUpDelay = DEFAULT_WARMUP;
185
- this.coolDownDelay = DEFAULT_COOLDOWN;
186
- this.isWarm = false;
187
- this.timeout = 0;
188
- Object.assign(this, options);
189
- }
190
- async openTimer(component) {
191
- this.cancelCooldownTimer();
192
- if (!this.component || component !== this.component) {
193
- if (this.component) {
194
- this.close(this.component);
195
- this.cancelCooldownTimer();
196
- }
197
- this.component = component;
198
- if (this.isWarm) {
199
- return false;
200
- }
201
- this.promise = new Promise((resolve) => {
202
- this.resolve = resolve;
203
- this.timeout = window.setTimeout(() => {
204
- if (this.resolve) {
205
- this.resolve(false);
206
- this.isWarm = true;
207
- }
208
- }, this.warmUpDelay);
209
- });
210
- return this.promise;
211
- } else if (this.promise) {
212
- return this.promise;
213
- } else {
214
- throw new Error("Inconsistent state");
215
- }
216
- }
217
- close(component) {
218
- if (this.component && this.component === component) {
219
- this.resetCooldownTimer();
220
- if (this.timeout > 0) {
221
- clearTimeout(this.timeout);
222
- this.timeout = 0;
223
- }
224
- if (this.resolve) {
225
- this.resolve(true);
226
- delete this.resolve;
227
- }
228
- delete this.promise;
229
- delete this.component;
230
- }
231
- }
232
- resetCooldownTimer() {
233
- if (this.isWarm) {
234
- if (this.cooldownTimeout) {
235
- window.clearTimeout(this.cooldownTimeout);
236
- }
237
- this.cooldownTimeout = window.setTimeout(() => {
238
- this.isWarm = false;
239
- delete this.cooldownTimeout;
240
- }, this.coolDownDelay);
241
- }
242
- }
243
- cancelCooldownTimer() {
244
- if (this.cooldownTimeout) {
245
- window.clearTimeout(this.cooldownTimeout);
246
- }
247
- delete this.cooldownTimeout;
248
- }
249
- }
250
-
251
- // ../../node_modules/@spectrum-web-components/overlay/src/AbstractOverlay.dev.js
252
- var overlayTimer = new OverlayTimer;
253
- var noop = () => {
254
- return;
255
- };
256
- var guaranteedAllTransitionend = (el, action, cb) => {
257
- const abortController = new AbortController;
258
- const runningTransitions = /* @__PURE__ */ new Map;
259
- const cleanup = () => {
260
- abortController.abort();
261
- cb();
262
- };
263
- let guarantee2;
264
- let guarantee3;
265
- const guarantee1 = requestAnimationFrame(() => {
266
- guarantee2 = requestAnimationFrame(() => {
267
- guarantee3 = requestAnimationFrame(() => {
268
- cleanup();
269
- });
270
- });
271
- });
272
- const handleTransitionend = (event) => {
273
- if (event.target !== el) {
274
- return;
275
- }
276
- runningTransitions.set(event.propertyName, runningTransitions.get(event.propertyName) - 1);
277
- if (!runningTransitions.get(event.propertyName)) {
278
- runningTransitions.delete(event.propertyName);
279
- }
280
- if (runningTransitions.size === 0) {
281
- cleanup();
282
- }
283
- };
284
- const handleTransitionrun = (event) => {
285
- if (event.target !== el) {
286
- return;
287
- }
288
- if (!runningTransitions.has(event.propertyName)) {
289
- runningTransitions.set(event.propertyName, 0);
290
- }
291
- runningTransitions.set(event.propertyName, runningTransitions.get(event.propertyName) + 1);
292
- cancelAnimationFrame(guarantee1);
293
- cancelAnimationFrame(guarantee2);
294
- cancelAnimationFrame(guarantee3);
295
- };
296
- el.addEventListener("transitionrun", handleTransitionrun, {
297
- signal: abortController.signal
298
- });
299
- el.addEventListener("transitionend", handleTransitionend, {
300
- signal: abortController.signal
301
- });
302
- el.addEventListener("transitioncancel", handleTransitionend, {
303
- signal: abortController.signal
304
- });
305
- action();
306
- };
307
- function nextFrame() {
308
- return new Promise((res) => requestAnimationFrame(() => res()));
309
- }
310
-
311
- class AbstractOverlay extends SpectrumElement {
312
- constructor() {
313
- super(...arguments);
314
- this.dispose = noop;
315
- this.offset = 0;
316
- this.willPreventClose = false;
317
- }
318
- async applyFocus(_targetOpenState, _focusEl) {
319
- return;
320
- }
321
- get delayed() {
322
- return false;
323
- }
324
- set delayed(_delayed) {
325
- return;
326
- }
327
- get disabled() {
328
- return false;
329
- }
330
- set disabled(_disabled) {
331
- return;
332
- }
333
- get elementResolver() {
334
- return this._elementResolver;
335
- }
336
- set elementResolver(controller) {
337
- this._elementResolver = controller;
338
- }
339
- async ensureOnDOM(_targetOpenState) {
340
- return;
341
- }
342
- async makeTransition(_targetOpenState) {
343
- return null;
344
- }
345
- async manageDelay(_targetOpenState) {
346
- return;
347
- }
348
- async managePopoverOpen() {
349
- return;
350
- }
351
- managePosition() {
352
- return;
353
- }
354
- get open() {
355
- return false;
356
- }
357
- set open(_open) {
358
- return;
359
- }
360
- get placementController() {
361
- return this._placementController;
362
- }
363
- set placementController(controller) {
364
- this._placementController = controller;
365
- }
366
- requestSlottable() {}
367
- returnFocus() {
368
- return;
369
- }
370
- get state() {
371
- return "closed";
372
- }
373
- set state(_state) {
374
- return;
375
- }
376
- manuallyKeepOpen() {
377
- return;
378
- }
379
- static update() {
380
- const overlayUpdateEvent = new CustomEvent("sp-update-overlays", {
381
- bubbles: true,
382
- composed: true,
383
- cancelable: true
384
- });
385
- document.dispatchEvent(overlayUpdateEvent);
386
- }
387
- static async open(triggerOrContent, interactionOrOptions, content, optionsV1) {
388
- await import("./sp-overlay.dev-yztmtrs1.js");
389
- const v2 = arguments.length === 2;
390
- const overlayContent = content || triggerOrContent;
391
- const overlay = new this;
392
- let restored = false;
393
- overlay.dispose = () => {
394
- overlay.addEventListener("sp-closed", () => {
395
- if (!restored) {
396
- restoreContent();
397
- restored = true;
398
- }
399
- requestAnimationFrame(() => {
400
- overlay.remove();
401
- });
402
- });
403
- overlay.open = false;
404
- overlay.dispose = noop;
405
- };
406
- const restoreContent = reparentChildren([overlayContent], overlay, {
407
- position: "beforeend",
408
- prepareCallback: (el) => {
409
- const slot = el.slot;
410
- el.removeAttribute("slot");
411
- return () => {
412
- el.slot = slot;
413
- };
414
- }
415
- });
416
- const v1 = !v2 && overlayContent && optionsV1;
417
- if (v1) {
418
- if (true) {
419
- window.__swc.warn(overlay, `You are interacting with an ${overlay.localName} element via a deprecated imperative API. This API will be removed in a future version of the SWC library. Consider leveraging an ${overlay.localName} directly.`, "https://opensource.adobe.com/spectrum-web-components/components/overlay/", { level: "deprecation" });
420
- }
421
- const trigger = triggerOrContent;
422
- const interaction = interactionOrOptions;
423
- const options2 = optionsV1;
424
- AbstractOverlay.applyOptions(overlay, {
425
- ...options2,
426
- delayed: options2.delayed || overlayContent.hasAttribute("delayed"),
427
- trigger: options2.virtualTrigger || trigger,
428
- type: interaction === "modal" ? "modal" : interaction === "hover" ? "hint" : "auto"
429
- });
430
- trigger.insertAdjacentElement("afterend", overlay);
431
- await overlay.updateComplete;
432
- overlay.open = true;
433
- return overlay.dispose;
434
- }
435
- const options = interactionOrOptions;
436
- overlay.append(overlayContent);
437
- AbstractOverlay.applyOptions(overlay, {
438
- ...options,
439
- delayed: options.delayed || overlayContent.hasAttribute("delayed")
440
- });
441
- overlay.updateComplete.then(() => {
442
- overlay.open = true;
443
- });
444
- return overlay;
445
- }
446
- static applyOptions(overlay, options) {
447
- var _a, _b;
448
- overlay.delayed = !!options.delayed;
449
- overlay.receivesFocus = (_a = options.receivesFocus) != null ? _a : "auto";
450
- overlay.triggerElement = options.trigger || null;
451
- overlay.type = options.type || "modal";
452
- overlay.offset = (_b = options.offset) != null ? _b : 0;
453
- overlay.placement = options.placement;
454
- overlay.willPreventClose = !!options.notImmediatelyClosable;
455
- }
456
- disconnectedCallback() {
457
- super.disconnectedCallback();
458
- }
459
- }
460
- // ../../node_modules/@spectrum-web-components/shared/src/focus-visible.dev.js
461
- var hasFocusVisible = true;
462
- try {
463
- document.body.querySelector(":focus-visible");
464
- } catch (error) {
465
- if (true) {
466
- window.__swc.warn(undefined, `The :focus-visible polyfill is not supported in this browser.`, "https://github.com/WICG/focus-visible/pull/196", {
467
- issues: [error instanceof Error ? error.message : "Unknown error"]
468
- });
469
- }
470
- hasFocusVisible = false;
471
- import("./focus-visible-6eg70z18.js").then((m)=>__toESM(m.default,1));
472
- }
473
- var FocusVisiblePolyfillMixin = (SuperClass) => {
474
- var _a, _b;
475
- const coordinateWithPolyfill = (instance) => {
476
- if (instance.shadowRoot == null || instance.hasAttribute("data-js-focus-visible")) {
477
- return () => {};
478
- }
479
- if (self.applyFocusVisiblePolyfill) {
480
- self.applyFocusVisiblePolyfill(instance.shadowRoot);
481
- if (instance.manageAutoFocus) {
482
- instance.manageAutoFocus();
483
- }
484
- } else {
485
- const coordinationHandler = () => {
486
- if (self.applyFocusVisiblePolyfill && instance.shadowRoot) {
487
- self.applyFocusVisiblePolyfill(instance.shadowRoot);
488
- }
489
- if (instance.manageAutoFocus) {
490
- instance.manageAutoFocus();
491
- }
492
- };
493
- self.addEventListener("focus-visible-polyfill-ready", coordinationHandler, { once: true });
494
- return () => {
495
- self.removeEventListener("focus-visible-polyfill-ready", coordinationHandler);
496
- };
497
- }
498
- return () => {};
499
- };
500
- const $endPolyfillCoordination = Symbol("endPolyfillCoordination");
501
-
502
- class FocusVisibleCoordinator extends (_b = SuperClass, _a = $endPolyfillCoordination, _b) {
503
- constructor() {
504
- super(...arguments);
505
- this[_a] = null;
506
- }
507
- connectedCallback() {
508
- var _a2;
509
- (_a2 = super.connectedCallback) == null || _a2.call(this);
510
- if (!hasFocusVisible) {
511
- requestAnimationFrame(() => {
512
- if (this[$endPolyfillCoordination] == null) {
513
- this[$endPolyfillCoordination] = coordinateWithPolyfill(this);
514
- }
515
- });
516
- }
517
- }
518
- disconnectedCallback() {
519
- var _a2;
520
- (_a2 = super.disconnectedCallback) == null || _a2.call(this);
521
- if (!hasFocusVisible) {
522
- requestAnimationFrame(() => {
523
- if (this[$endPolyfillCoordination] != null) {
524
- this[$endPolyfillCoordination]();
525
- this[$endPolyfillCoordination] = null;
526
- }
527
- });
528
- }
529
- }
530
- }
531
- return FocusVisibleCoordinator;
532
- };
533
- // ../../node_modules/@spectrum-web-components/shared/src/focusable.dev.js
534
- var __defProp = Object.defineProperty;
535
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
536
- var __decorateClass = (decorators, target, key, kind) => {
537
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc(target, key) : target;
538
- for (var i = decorators.length - 1, decorator;i >= 0; i--)
539
- if (decorator = decorators[i])
540
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
541
- if (kind && result)
542
- __defProp(target, key, result);
543
- return result;
544
- };
545
- function nextFrame2() {
546
- return new Promise((res) => requestAnimationFrame(() => res()));
547
- }
548
-
549
- class Focusable extends FocusVisiblePolyfillMixin(SpectrumElement) {
550
- constructor() {
551
- super(...arguments);
552
- this.disabled = false;
553
- this.autofocus = false;
554
- this._tabIndex = 0;
555
- this.manipulatingTabindex = false;
556
- this.autofocusReady = Promise.resolve();
557
- }
558
- get tabIndex() {
559
- if (this.focusElement === this) {
560
- const tabindex = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : NaN;
561
- return !isNaN(tabindex) ? tabindex : -1;
562
- }
563
- const tabIndexAttribute = parseFloat(this.hasAttribute("tabindex") ? this.getAttribute("tabindex") || "0" : "0");
564
- if (this.disabled || tabIndexAttribute < 0) {
565
- return -1;
566
- }
567
- if (!this.focusElement) {
568
- return tabIndexAttribute;
569
- }
570
- return this._tabIndex;
571
- }
572
- set tabIndex(tabIndex) {
573
- var _a;
574
- if (this.manipulatingTabindex) {
575
- this.manipulatingTabindex = false;
576
- return;
577
- }
578
- if (this.focusElement === this) {
579
- if (this.disabled) {
580
- this._tabIndex = tabIndex;
581
- } else if (tabIndex !== this._tabIndex) {
582
- this._tabIndex = tabIndex;
583
- const tabindex = "" + tabIndex;
584
- this.manipulatingTabindex = true;
585
- this.setAttribute("tabindex", tabindex);
586
- }
587
- return;
588
- }
589
- if (tabIndex === -1) {
590
- this.addEventListener("pointerdown", this.onPointerdownManagementOfTabIndex);
591
- } else {
592
- this.manipulatingTabindex = true;
593
- this.removeEventListener("pointerdown", this.onPointerdownManagementOfTabIndex);
594
- }
595
- if (tabIndex === -1 || this.disabled) {
596
- this.manipulatingTabindex = true;
597
- this.setAttribute("tabindex", "-1");
598
- this.removeAttribute("focusable");
599
- if (this.selfManageFocusElement) {
600
- return;
601
- }
602
- if (tabIndex !== -1) {
603
- this._tabIndex = tabIndex;
604
- this.manageFocusElementTabindex(tabIndex);
605
- } else {
606
- (_a = this.focusElement) == null || _a.removeAttribute("tabindex");
607
- }
608
- return;
609
- }
610
- this.setAttribute("focusable", "");
611
- if (this.hasAttribute("tabindex")) {
612
- this.removeAttribute("tabindex");
613
- } else {
614
- this.manipulatingTabindex = false;
615
- }
616
- this._tabIndex = tabIndex;
617
- this.manageFocusElementTabindex(tabIndex);
618
- }
619
- onPointerdownManagementOfTabIndex() {
620
- if (this.tabIndex === -1) {
621
- setTimeout(() => {
622
- this.tabIndex = 0;
623
- this.focus({ preventScroll: true });
624
- this.tabIndex = -1;
625
- });
626
- }
627
- }
628
- async manageFocusElementTabindex(tabIndex) {
629
- if (!this.focusElement) {
630
- await this.updateComplete;
631
- }
632
- if (tabIndex === null) {
633
- this.focusElement.removeAttribute("tabindex");
634
- } else {
635
- if (this.focusElement !== this) {
636
- this.focusElement.tabIndex = tabIndex;
637
- }
638
- }
639
- }
640
- get focusElement() {
641
- throw new Error("Must implement focusElement getter!");
642
- }
643
- get selfManageFocusElement() {
644
- return false;
645
- }
646
- focus(options) {
647
- if (this.disabled || !this.focusElement) {
648
- return;
649
- }
650
- if (this.focusElement !== this) {
651
- this.focusElement.focus(options);
652
- } else {
653
- HTMLElement.prototype.focus.apply(this, [options]);
654
- }
655
- }
656
- blur() {
657
- const focusElement = this.focusElement || this;
658
- if (focusElement !== this) {
659
- focusElement.blur();
660
- } else {
661
- HTMLElement.prototype.blur.apply(this);
662
- }
663
- }
664
- click() {
665
- if (this.disabled) {
666
- return;
667
- }
668
- const focusElement = this.focusElement || this;
669
- if (focusElement !== this) {
670
- focusElement.click();
671
- } else {
672
- HTMLElement.prototype.click.apply(this);
673
- }
674
- }
675
- manageAutoFocus() {
676
- if (this.autofocus) {
677
- this.dispatchEvent(new KeyboardEvent("keydown", {
678
- code: "Tab"
679
- }));
680
- this.focusElement.focus();
681
- }
682
- }
683
- firstUpdated(changes) {
684
- super.firstUpdated(changes);
685
- if (!this.hasAttribute("tabindex") || this.getAttribute("tabindex") !== "-1") {
686
- this.setAttribute("focusable", "");
687
- }
688
- }
689
- update(changedProperties) {
690
- if (changedProperties.has("disabled")) {
691
- this.handleDisabledChanged(this.disabled, changedProperties.get("disabled"));
692
- }
693
- super.update(changedProperties);
694
- }
695
- updated(changedProperties) {
696
- super.updated(changedProperties);
697
- if (changedProperties.has("disabled") && this.disabled) {
698
- this.blur();
699
- }
700
- }
701
- async handleDisabledChanged(disabled, oldDisabled) {
702
- const canSetDisabled = () => this.focusElement !== this && typeof this.focusElement.disabled !== "undefined";
703
- if (disabled) {
704
- this.manipulatingTabindex = true;
705
- this.setAttribute("tabindex", "-1");
706
- await this.updateComplete;
707
- if (canSetDisabled()) {
708
- this.focusElement.disabled = true;
709
- } else {
710
- this.setAttribute("aria-disabled", "true");
711
- }
712
- } else if (oldDisabled) {
713
- this.manipulatingTabindex = true;
714
- if (this.focusElement === this) {
715
- this.setAttribute("tabindex", "" + this._tabIndex);
716
- } else {
717
- this.removeAttribute("tabindex");
718
- }
719
- await this.updateComplete;
720
- if (canSetDisabled()) {
721
- this.focusElement.disabled = false;
722
- } else {
723
- this.removeAttribute("aria-disabled");
724
- }
725
- }
726
- }
727
- async getUpdateComplete() {
728
- const complete = await super.getUpdateComplete();
729
- await this.autofocusReady;
730
- return complete;
731
- }
732
- connectedCallback() {
733
- super.connectedCallback();
734
- if (this.autofocus) {
735
- this.autofocusReady = (async () => {
736
- await nextFrame2();
737
- await nextFrame2();
738
- })();
739
- this.updateComplete.then(() => {
740
- this.manageAutoFocus();
741
- });
742
- }
743
- }
744
- }
745
- __decorateClass([
746
- property({ type: Boolean, reflect: true })
747
- ], Focusable.prototype, "disabled", 2);
748
- __decorateClass([
749
- property({ type: Boolean })
750
- ], Focusable.prototype, "autofocus", 2);
751
- __decorateClass([
752
- property({ type: Number })
753
- ], Focusable.prototype, "tabIndex", 1);
754
- // ../../node_modules/@spectrum-web-components/shared/src/like-anchor.dev.js
755
- var __defProp2 = Object.defineProperty;
756
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
757
- var __decorateClass2 = (decorators, target, key, kind) => {
758
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc2(target, key) : target;
759
- for (var i = decorators.length - 1, decorator;i >= 0; i--)
760
- if (decorator = decorators[i])
761
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
762
- if (kind && result)
763
- __defProp2(target, key, result);
764
- return result;
765
- };
766
- function LikeAnchor(constructor) {
767
-
768
- class LikeAnchorElement extends constructor {
769
- renderAnchor({
770
- id,
771
- className,
772
- ariaHidden,
773
- labelledby,
774
- tabindex,
775
- anchorContent = html`<slot></slot>`
776
- }) {
777
- return html`<a
778
- id=${id}
779
- class=${ifDefined(className)}
780
- href=${ifDefined(this.href)}
781
- download=${ifDefined(this.download)}
782
- target=${ifDefined(this.target)}
783
- aria-label=${ifDefined(this.label)}
784
- aria-labelledby=${ifDefined(labelledby)}
785
- aria-hidden=${ifDefined(ariaHidden ? "true" : undefined)}
786
- tabindex=${ifDefined(tabindex)}
787
- referrerpolicy=${ifDefined(this.referrerpolicy)}
788
- rel=${ifDefined(this.rel)}
789
- >${anchorContent}</a>`;
790
- }
791
- }
792
- __decorateClass2([
793
- property()
794
- ], LikeAnchorElement.prototype, "download", 2);
795
- __decorateClass2([
796
- property()
797
- ], LikeAnchorElement.prototype, "label", 2);
798
- __decorateClass2([
799
- property()
800
- ], LikeAnchorElement.prototype, "href", 2);
801
- __decorateClass2([
802
- property()
803
- ], LikeAnchorElement.prototype, "target", 2);
804
- __decorateClass2([
805
- property()
806
- ], LikeAnchorElement.prototype, "referrerpolicy", 2);
807
- __decorateClass2([
808
- property()
809
- ], LikeAnchorElement.prototype, "rel", 2);
810
- return LikeAnchorElement;
811
- }
812
- // ../../node_modules/@lit-labs/observers/development/mutation-controller.js
813
- class MutationController {
814
- constructor(host, { target, config, callback, skipInitial }) {
815
- this._targets = new Set;
816
- this._skipInitial = false;
817
- this._unobservedUpdate = false;
818
- this._host = host;
819
- if (target !== null) {
820
- this._targets.add(target ?? host);
821
- }
822
- this._config = config;
823
- this._skipInitial = skipInitial ?? this._skipInitial;
824
- this.callback = callback;
825
- if (!window.MutationObserver) {
826
- console.warn(`MutationController error: browser does not support MutationObserver.`);
827
- return;
828
- }
829
- this._observer = new MutationObserver((records) => {
830
- this.handleChanges(records);
831
- this._host.requestUpdate();
832
- });
833
- host.addController(this);
834
- }
835
- handleChanges(records) {
836
- this.value = this.callback?.(records, this._observer);
837
- }
838
- hostConnected() {
839
- for (const target of this._targets) {
840
- this.observe(target);
841
- }
842
- }
843
- hostDisconnected() {
844
- this.disconnect();
845
- }
846
- async hostUpdated() {
847
- const pendingRecords = this._observer.takeRecords();
848
- if (pendingRecords.length || !this._skipInitial && this._unobservedUpdate) {
849
- this.handleChanges(pendingRecords);
850
- }
851
- this._unobservedUpdate = false;
852
- }
853
- observe(target) {
854
- this._targets.add(target);
855
- this._observer.observe(target, this._config);
856
- this._unobservedUpdate = true;
857
- this._host.requestUpdate();
858
- }
859
- disconnect() {
860
- this._observer.disconnect();
861
- }
862
- }
863
-
864
- // ../../node_modules/@spectrum-web-components/shared/src/observe-slot-presence.dev.js
865
- var slotContentIsPresent = Symbol("slotContentIsPresent");
866
- function ObserveSlotPresence(constructor, lightDomSelector) {
867
- var _a, _b;
868
- const lightDomSelectors = Array.isArray(lightDomSelector) ? lightDomSelector : [lightDomSelector];
869
-
870
- class SlotPresenceObservingElement extends (_b = constructor, _a = slotContentIsPresent, _b) {
871
- constructor(...args) {
872
- super(...args);
873
- this[_a] = /* @__PURE__ */ new Map;
874
- this.managePresenceObservedSlot = () => {
875
- let changes = false;
876
- lightDomSelectors.forEach((selector) => {
877
- const nextValue = !!this.querySelector(`:scope > ${selector}`);
878
- const previousValue = this[slotContentIsPresent].get(selector) || false;
879
- changes = changes || previousValue !== nextValue;
880
- this[slotContentIsPresent].set(selector, !!this.querySelector(`:scope > ${selector}`));
881
- });
882
- if (changes) {
883
- this.updateComplete.then(() => {
884
- this.requestUpdate();
885
- });
886
- }
887
- };
888
- new MutationController(this, {
889
- config: {
890
- childList: true,
891
- subtree: true
892
- },
893
- callback: () => {
894
- this.managePresenceObservedSlot();
895
- }
896
- });
897
- this.managePresenceObservedSlot();
898
- }
899
- get slotContentIsPresent() {
900
- if (lightDomSelectors.length === 1) {
901
- return this[slotContentIsPresent].get(lightDomSelectors[0]) || false;
902
- } else {
903
- throw new Error("Multiple selectors provided to `ObserveSlotPresence` use `getSlotContentPresence(selector: string)` instead.");
904
- }
905
- }
906
- getSlotContentPresence(selector) {
907
- if (this[slotContentIsPresent].has(selector)) {
908
- return this[slotContentIsPresent].get(selector) || false;
909
- }
910
- throw new Error(`The provided selector \`${selector}\` is not being observed.`);
911
- }
912
- }
913
- return SlotPresenceObservingElement;
914
- }
915
- // ../../node_modules/@spectrum-web-components/shared/src/observe-slot-text.dev.js
916
- var __defProp3 = Object.defineProperty;
917
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
918
- var __decorateClass3 = (decorators, target, key, kind) => {
919
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc3(target, key) : target;
920
- for (var i = decorators.length - 1, decorator;i >= 0; i--)
921
- if (decorator = decorators[i])
922
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
923
- if (kind && result)
924
- __defProp3(target, key, result);
925
- return result;
926
- };
927
- var assignedNodesList = Symbol("assignedNodes");
928
- function ObserveSlotText(constructor, slotName, excludedSelectors = []) {
929
- var _a, _b;
930
- const notExcluded = (el) => (selector) => {
931
- return el.matches(selector);
932
- };
933
-
934
- class SlotTextObservingElement extends (_b = constructor, _a = assignedNodesList, _b) {
935
- constructor(...args) {
936
- super(...args);
937
- this.slotHasContent = false;
938
- new MutationController(this, {
939
- config: {
940
- characterData: true,
941
- subtree: true
942
- },
943
- callback: (mutationsList) => {
944
- for (const mutation of mutationsList) {
945
- if (mutation.type === "characterData") {
946
- this.manageTextObservedSlot();
947
- return;
948
- }
949
- }
950
- }
951
- });
952
- }
953
- manageTextObservedSlot() {
954
- if (!this[assignedNodesList]) {
955
- return;
956
- }
957
- const assignedNodes = [...this[assignedNodesList]].filter((currentNode) => {
958
- const node = currentNode;
959
- if (node.tagName) {
960
- return !excludedSelectors.some(notExcluded(node));
961
- }
962
- return node.textContent ? node.textContent.trim() : false;
963
- });
964
- this.slotHasContent = assignedNodes.length > 0;
965
- }
966
- update(changedProperties) {
967
- if (!this.hasUpdated) {
968
- const { childNodes } = this;
969
- const textNodes = [...childNodes].filter((currentNode) => {
970
- const node = currentNode;
971
- if (node.tagName) {
972
- const excluded = excludedSelectors.some(notExcluded(node));
973
- return !excluded ? slotName ? node.getAttribute("slot") === slotName : !node.hasAttribute("slot") : false;
974
- }
975
- return node.textContent ? node.textContent.trim() : false;
976
- });
977
- this.slotHasContent = textNodes.length > 0;
978
- }
979
- super.update(changedProperties);
980
- }
981
- firstUpdated(changedProperties) {
982
- super.firstUpdated(changedProperties);
983
- this.updateComplete.then(() => {
984
- this.manageTextObservedSlot();
985
- });
986
- }
987
- }
988
- __decorateClass3([
989
- property({ type: Boolean, attribute: false })
990
- ], SlotTextObservingElement.prototype, "slotHasContent", 2);
991
- __decorateClass3([
992
- queryAssignedNodes({
993
- slot: slotName,
994
- flatten: true
995
- })
996
- ], SlotTextObservingElement.prototype, _a, 2);
997
- return SlotTextObservingElement;
998
- }
999
- // ../../node_modules/@spectrum-web-components/shared/src/platform.dev.js
1000
- function testUserAgent(re) {
1001
- return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator.userAgent) : false;
1002
- }
1003
- function testPlatform(re) {
1004
- return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator.platform) : false;
1005
- }
1006
- function isMac() {
1007
- return testPlatform(/^Mac/);
1008
- }
1009
- function isIPhone() {
1010
- return testPlatform(/^iPhone/);
1011
- }
1012
- function isIPad() {
1013
- return testPlatform(/^iPad/) || isMac() && navigator.maxTouchPoints > 1;
1014
- }
1015
- function isIOS() {
1016
- return isIPhone() || isIPad();
1017
- }
1018
- function isWebKit() {
1019
- return testUserAgent(/AppleWebKit/) && !isChrome();
1020
- }
1021
- function isChrome() {
1022
- return testUserAgent(/Chrome/);
1023
- }
1024
- function isAndroid() {
1025
- return testUserAgent(/Android/);
1026
- }
1027
- // ../../node_modules/@spectrum-web-components/overlay/src/events.dev.js
1028
- class BeforetoggleClosedEvent extends Event {
1029
- constructor() {
1030
- super("beforetoggle", {
1031
- bubbles: false,
1032
- composed: false
1033
- });
1034
- this.currentState = "open";
1035
- this.newState = "closed";
1036
- }
1037
- }
1038
-
1039
- class BeforetoggleOpenEvent extends Event {
1040
- constructor() {
1041
- super("beforetoggle", {
1042
- bubbles: false,
1043
- composed: false
1044
- });
1045
- this.currentState = "closed";
1046
- this.newState = "open";
1047
- }
1048
- }
1049
-
1050
- class OverlayStateEvent extends Event {
1051
- constructor(type, overlay, {
1052
- publish,
1053
- interaction,
1054
- reason
1055
- }) {
1056
- super(type, {
1057
- bubbles: publish,
1058
- composed: publish
1059
- });
1060
- this.overlay = overlay;
1061
- this.detail = {
1062
- interaction,
1063
- reason
1064
- };
1065
- }
1066
- }
1067
-
1068
- // ../../node_modules/@spectrum-web-components/overlay/src/VirtualTrigger.dev.js
1069
- class VirtualTrigger {
1070
- constructor(x, y) {
1071
- this.x = 0;
1072
- this.y = 0;
1073
- this.x = x;
1074
- this.y = y;
1075
- }
1076
- updateBoundingClientRect(x, y) {
1077
- this.x = x;
1078
- this.y = y;
1079
- AbstractOverlay.update();
1080
- }
1081
- getBoundingClientRect() {
1082
- return {
1083
- width: 0,
1084
- height: 0,
1085
- top: this.y,
1086
- right: this.x,
1087
- y: this.y,
1088
- x: this.x,
1089
- bottom: this.y,
1090
- left: this.x,
1091
- toJSON() {
1092
- return;
1093
- }
1094
- };
1095
- }
1096
- }
1097
-
1098
- // ../../node_modules/@spectrum-web-components/overlay/src/OverlayNoPopover.dev.js
1099
- function OverlayNoPopover(constructor) {
1100
- class OverlayWithNoPopover extends constructor {
1101
- async managePopoverOpen() {
1102
- await this.managePosition();
1103
- }
1104
- async manageDelay(targetOpenState) {
1105
- if (targetOpenState === false || targetOpenState !== this.open) {
1106
- overlayTimer.close(this);
1107
- return;
1108
- }
1109
- if (this.delayed) {
1110
- const cancelled = await overlayTimer.openTimer(this);
1111
- if (cancelled) {
1112
- this.open = !targetOpenState;
1113
- }
1114
- }
1115
- }
1116
- async ensureOnDOM(_targetOpenState) {
1117
- document.body.offsetHeight;
1118
- }
1119
- async makeTransition(targetOpenState) {
1120
- if (this.open !== targetOpenState) {
1121
- return null;
1122
- }
1123
- let focusEl = null;
1124
- const start = (el, index) => () => {
1125
- if (targetOpenState !== this.open) {
1126
- return;
1127
- }
1128
- el.open = targetOpenState;
1129
- if (index === 0) {
1130
- const event = targetOpenState ? BeforetoggleOpenEvent : BeforetoggleClosedEvent;
1131
- this.dispatchEvent(new event);
1132
- }
1133
- if (targetOpenState !== true) {
1134
- return;
1135
- }
1136
- if (el.matches(userFocusableSelector)) {
1137
- focusEl = el;
1138
- }
1139
- focusEl = focusEl || firstFocusableIn(el);
1140
- if (focusEl) {
1141
- return;
1142
- }
1143
- const childSlots = el.querySelectorAll("slot");
1144
- childSlots.forEach((slot) => {
1145
- if (!focusEl) {
1146
- focusEl = firstFocusableSlottedIn(slot);
1147
- }
1148
- });
1149
- };
1150
- const finish = (el, index) => async () => {
1151
- if (this.open !== targetOpenState) {
1152
- return;
1153
- }
1154
- const eventName = targetOpenState ? "sp-opened" : "sp-closed";
1155
- el.dispatchEvent(new OverlayStateEvent(eventName, this, {
1156
- interaction: this.type
1157
- }));
1158
- if (index > 0) {
1159
- return;
1160
- }
1161
- const hasVirtualTrigger = this.triggerElement instanceof VirtualTrigger;
1162
- this.dispatchEvent(new OverlayStateEvent(eventName, this, {
1163
- interaction: this.type,
1164
- publish: hasVirtualTrigger
1165
- }));
1166
- if (this.triggerElement && !hasVirtualTrigger) {
1167
- this.triggerElement.dispatchEvent(new OverlayStateEvent(eventName, this, {
1168
- interaction: this.type,
1169
- publish: true
1170
- }));
1171
- }
1172
- this.state = targetOpenState ? "opened" : "closed";
1173
- this.returnFocus();
1174
- await nextFrame();
1175
- await nextFrame();
1176
- if (targetOpenState === this.open && targetOpenState === false) {
1177
- this.requestSlottable();
1178
- }
1179
- };
1180
- this.elements.forEach((el, index) => {
1181
- guaranteedAllTransitionend(el, start(el, index), finish(el, index));
1182
- });
1183
- return focusEl;
1184
- }
1185
- }
1186
- return OverlayWithNoPopover;
1187
- }
1188
-
1189
- // ../../node_modules/@spectrum-web-components/overlay/src/OverlayPopover.dev.js
1190
- var supportsOverlayAuto = CSS.supports("(overlay: auto)");
1191
- function isOpen(el) {
1192
- let popoverOpen = false;
1193
- try {
1194
- popoverOpen = el.matches(":popover-open");
1195
- } catch (error) {}
1196
- let open = false;
1197
- try {
1198
- open = el.matches(":open");
1199
- } catch (error) {}
1200
- return popoverOpen || open;
1201
- }
1202
- function OverlayPopover(constructor) {
1203
-
1204
- class OverlayWithPopover extends constructor {
1205
- async manageDelay(targetOpenState) {
1206
- if (targetOpenState === false || targetOpenState !== this.open) {
1207
- overlayTimer.close(this);
1208
- return;
1209
- }
1210
- if (this.delayed) {
1211
- const cancelled = await overlayTimer.openTimer(this);
1212
- if (cancelled) {
1213
- this.open = !targetOpenState;
1214
- }
1215
- }
1216
- }
1217
- async shouldHidePopover(targetOpenState) {
1218
- if (targetOpenState && this.open !== targetOpenState) {
1219
- return;
1220
- }
1221
- const update = async ({
1222
- newState
1223
- } = {}) => {
1224
- if (newState === "open") {
1225
- return;
1226
- }
1227
- await this.placementController.resetOverlayPosition();
1228
- };
1229
- if (!isOpen(this.dialogEl)) {
1230
- update();
1231
- return;
1232
- }
1233
- this.dialogEl.addEventListener("toggle", update, {
1234
- once: true
1235
- });
1236
- }
1237
- shouldShowPopover(targetOpenState) {
1238
- let popoverOpen = false;
1239
- try {
1240
- popoverOpen = this.dialogEl.matches(":popover-open");
1241
- } catch (error) {}
1242
- let open = false;
1243
- try {
1244
- open = this.dialogEl.matches(":open");
1245
- } catch (error) {}
1246
- if (targetOpenState && this.open === targetOpenState && !popoverOpen && !open && this.isConnected) {
1247
- this.dialogEl.showPopover();
1248
- this.managePosition();
1249
- }
1250
- }
1251
- async ensureOnDOM(targetOpenState) {
1252
- if (!supportsOverlayAuto) {
1253
- await this.shouldHidePopover(targetOpenState);
1254
- }
1255
- this.shouldShowPopover(targetOpenState);
1256
- await nextFrame();
1257
- }
1258
- async makeTransition(targetOpenState) {
1259
- if (this.open !== targetOpenState) {
1260
- return null;
1261
- }
1262
- let focusEl = null;
1263
- const start = (el, index) => () => {
1264
- el.open = targetOpenState;
1265
- if (index === 0) {
1266
- const event = targetOpenState ? BeforetoggleOpenEvent : BeforetoggleClosedEvent;
1267
- this.dispatchEvent(new event);
1268
- }
1269
- if (!targetOpenState) {
1270
- return;
1271
- }
1272
- if (el.matches(userFocusableSelector)) {
1273
- focusEl = el;
1274
- }
1275
- focusEl = focusEl || firstFocusableIn(el);
1276
- if (focusEl) {
1277
- return;
1278
- }
1279
- const childSlots = el.querySelectorAll("slot");
1280
- childSlots.forEach((slot) => {
1281
- if (!focusEl) {
1282
- focusEl = firstFocusableSlottedIn(slot);
1283
- }
1284
- });
1285
- };
1286
- const finish = (el, index) => async () => {
1287
- if (this.open !== targetOpenState) {
1288
- return;
1289
- }
1290
- const eventName = targetOpenState ? "sp-opened" : "sp-closed";
1291
- if (index > 0) {
1292
- el.dispatchEvent(new OverlayStateEvent(eventName, this, {
1293
- interaction: this.type,
1294
- publish: false
1295
- }));
1296
- return;
1297
- }
1298
- const reportChange = async () => {
1299
- if (this.open !== targetOpenState) {
1300
- return;
1301
- }
1302
- await nextFrame();
1303
- const hasVirtualTrigger = this.triggerElement instanceof VirtualTrigger;
1304
- this.dispatchEvent(new OverlayStateEvent(eventName, this, {
1305
- interaction: this.type,
1306
- publish: hasVirtualTrigger
1307
- }));
1308
- el.dispatchEvent(new OverlayStateEvent(eventName, this, {
1309
- interaction: this.type,
1310
- publish: false
1311
- }));
1312
- if (this.triggerElement && !hasVirtualTrigger) {
1313
- this.triggerElement.dispatchEvent(new OverlayStateEvent(eventName, this, {
1314
- interaction: this.type,
1315
- publish: true
1316
- }));
1317
- }
1318
- this.state = targetOpenState ? "opened" : "closed";
1319
- this.returnFocus();
1320
- await nextFrame();
1321
- await nextFrame();
1322
- if (targetOpenState === this.open && targetOpenState === false) {
1323
- this.requestSlottable();
1324
- }
1325
- };
1326
- if (this.open !== targetOpenState) {
1327
- return;
1328
- }
1329
- const open = isOpen(this.dialogEl);
1330
- if (targetOpenState !== true && open && this.isConnected) {
1331
- this.dialogEl.addEventListener("beforetoggle", () => {
1332
- reportChange();
1333
- }, { once: true });
1334
- this.dialogEl.hidePopover();
1335
- } else {
1336
- reportChange();
1337
- }
1338
- };
1339
- this.elements.forEach((el, index) => {
1340
- guaranteedAllTransitionend(el, start(el, index), finish(el, index));
1341
- });
1342
- return focusEl;
1343
- }
1344
- }
1345
- return OverlayWithPopover;
1346
- }
1347
-
1348
- // ../../node_modules/@spectrum-web-components/overlay/src/OverlayStack.dev.js
1349
- var supportsPopover = "showPopover" in document.createElement("div");
1350
-
1351
- class OverlayStack {
1352
- constructor() {
1353
- this.root = document.body;
1354
- this.stack = [];
1355
- this.originalBodyOverflow = "";
1356
- this.bodyScrollBlocked = false;
1357
- this.handleScroll = (event) => {
1358
- if (event.target !== document && event.target !== document.documentElement && event.target !== document.body) {
1359
- return;
1360
- }
1361
- this.stack.forEach((overlay) => {
1362
- if (overlay.open) {
1363
- if (overlay.type === "auto" && overlay.triggerElement instanceof HTMLElement && overlay.triggerElement.closest("sp-picker, sp-action-menu")) {
1364
- event.stopPropagation();
1365
- }
1366
- document.dispatchEvent(new CustomEvent("sp-update-overlays", {
1367
- bubbles: true,
1368
- composed: true,
1369
- cancelable: true
1370
- }));
1371
- }
1372
- });
1373
- };
1374
- this.handlePointerdown = (event) => {
1375
- if (!this.stack.length) {
1376
- return;
1377
- }
1378
- const pointerPath = event.composedPath();
1379
- const pageOverlays = this.stack.filter((o) => o.open && o.type === "page");
1380
- if (pageOverlays.length > 0 && !this.isEventInsideModal(pointerPath, pageOverlays)) {
1381
- event.preventDefault();
1382
- event.stopImmediatePropagation();
1383
- return;
1384
- }
1385
- this.pointerdownPath = pointerPath;
1386
- this.lastOverlay = this.stack[this.stack.length - 1];
1387
- };
1388
- this.handleClick = (event) => {
1389
- if (!this.stack.length) {
1390
- return;
1391
- }
1392
- const modalOverlays = this.getModalOverlays();
1393
- if (!modalOverlays.length) {
1394
- return;
1395
- }
1396
- const pageOverlays = modalOverlays.filter((o) => o.type === "page");
1397
- if (!pageOverlays.length) {
1398
- return;
1399
- }
1400
- const clickPath = event.composedPath();
1401
- if (!this.isEventInsideModal(clickPath, pageOverlays)) {
1402
- event.stopImmediatePropagation();
1403
- event.preventDefault();
1404
- }
1405
- };
1406
- this.handlePointerup = () => {
1407
- const composedPath = this.pointerdownPath;
1408
- this.pointerdownPath = undefined;
1409
- if (!this.stack.length) {
1410
- return;
1411
- }
1412
- if (!(composedPath == null ? undefined : composedPath.length)) {
1413
- return;
1414
- }
1415
- const lastOverlay = this.lastOverlay;
1416
- this.lastOverlay = undefined;
1417
- const lastIndex = this.stack.length - 1;
1418
- const hasModalOrPageOverlay = this.stack.some((overlay) => overlay.open && (overlay.type === "modal" || overlay.type === "page"));
1419
- if (hasModalOrPageOverlay) {
1420
- const clickedBackdrop = composedPath.some((el) => el instanceof HTMLDivElement && el.classList.contains("modal-backdrop"));
1421
- if (clickedBackdrop) {
1422
- const topOverlay = this.stack[this.stack.length - 1];
1423
- if ((topOverlay == null ? undefined : topOverlay.type) === "modal") {
1424
- this.closeOverlay(topOverlay);
1425
- }
1426
- return;
1427
- }
1428
- }
1429
- const nonAncestorOverlays = this.stack.filter((overlay, i) => {
1430
- const inStack = composedPath.find((el) => el === overlay || el === (overlay == null ? undefined : overlay.triggerElement) && (overlay == null ? undefined : overlay.type) === "hint" || i === lastIndex && overlay !== lastOverlay && overlay.triggerInteraction === "longpress");
1431
- return !inStack && !overlay.shouldPreventClose() && overlay.type !== "manual" && !(overlay.type === "modal" && lastOverlay !== overlay);
1432
- });
1433
- nonAncestorOverlays.reverse();
1434
- nonAncestorOverlays.forEach((overlay) => {
1435
- this.closeOverlay(overlay);
1436
- let parentToClose = overlay.parentOverlayToForceClose;
1437
- while (parentToClose) {
1438
- this.closeOverlay(parentToClose);
1439
- parentToClose = parentToClose.parentOverlayToForceClose;
1440
- }
1441
- });
1442
- };
1443
- this.handleBeforetoggle = (event) => {
1444
- const { target, newState: open } = event;
1445
- if (open === "open") {
1446
- return;
1447
- }
1448
- this.closeOverlay(target);
1449
- };
1450
- this.handleKeydown = (event) => {
1451
- if (event.code !== "Escape") {
1452
- return;
1453
- }
1454
- if (!this.stack.length) {
1455
- return;
1456
- }
1457
- const last = this.stack[this.stack.length - 1];
1458
- if ((last == null ? undefined : last.type) === "hint") {
1459
- event.preventDefault();
1460
- event.stopPropagation();
1461
- this.closeOverlay(last);
1462
- return;
1463
- }
1464
- if ((last == null ? undefined : last.type) === "page") {
1465
- event.preventDefault();
1466
- return;
1467
- }
1468
- if ((last == null ? undefined : last.type) === "manual") {
1469
- this.closeOverlay(last);
1470
- return;
1471
- }
1472
- if ((last == null ? undefined : last.type) === "modal") {
1473
- this.closeOverlay(last);
1474
- return;
1475
- }
1476
- if (supportsPopover) {
1477
- return;
1478
- }
1479
- if (!last) {
1480
- return;
1481
- }
1482
- this.closeOverlay(last);
1483
- };
1484
- this.bindEvents();
1485
- }
1486
- get document() {
1487
- return this.root.ownerDocument || document;
1488
- }
1489
- bindEvents() {
1490
- this.document.addEventListener("pointerdown", this.handlePointerdown, {
1491
- capture: true
1492
- });
1493
- this.document.addEventListener("pointerup", this.handlePointerup);
1494
- this.document.addEventListener("click", this.handleClick, {
1495
- capture: true
1496
- });
1497
- this.document.addEventListener("keydown", this.handleKeydown);
1498
- this.document.addEventListener("scroll", this.handleScroll, {
1499
- capture: true
1500
- });
1501
- }
1502
- closeOverlay(overlay) {
1503
- const overlayIndex = this.stack.indexOf(overlay);
1504
- if (overlayIndex > -1) {
1505
- this.stack.splice(overlayIndex, 1);
1506
- }
1507
- overlay.open = false;
1508
- this.manageBodyScroll();
1509
- }
1510
- manageBodyScroll() {
1511
- const shouldBlock = this.stack.some((overlay) => overlay.type === "modal" || overlay.type === "page");
1512
- if (shouldBlock && !this.bodyScrollBlocked) {
1513
- this.originalBodyOverflow = document.body.style.overflow || "";
1514
- document.body.style.overflow = "hidden";
1515
- this.bodyScrollBlocked = true;
1516
- } else if (!shouldBlock && this.bodyScrollBlocked) {
1517
- document.body.style.overflow = this.originalBodyOverflow;
1518
- this.bodyScrollBlocked = false;
1519
- }
1520
- }
1521
- getModalOverlays() {
1522
- return this.stack.filter((overlay) => overlay.open && (overlay.type === "modal" || overlay.type === "page"));
1523
- }
1524
- isEventInsideModal(eventPath, modalOverlays) {
1525
- for (const overlay of modalOverlays) {
1526
- if (eventPath.includes(overlay)) {
1527
- return true;
1528
- }
1529
- const dialogEl = overlay.dialogEl;
1530
- if (!dialogEl) {
1531
- continue;
1532
- }
1533
- if (eventPath.includes(dialogEl)) {
1534
- return true;
1535
- }
1536
- for (const element of eventPath) {
1537
- if (element instanceof Node && dialogEl.contains(element)) {
1538
- return true;
1539
- }
1540
- }
1541
- }
1542
- return false;
1543
- }
1544
- overlaysByTriggerElement(triggerElement) {
1545
- return this.stack.filter((overlay) => overlay.triggerElement === triggerElement);
1546
- }
1547
- add(overlay) {
1548
- if (this.stack.includes(overlay)) {
1549
- const overlayIndex = this.stack.indexOf(overlay);
1550
- if (overlayIndex > -1) {
1551
- this.stack.splice(overlayIndex, 1);
1552
- this.stack.push(overlay);
1553
- }
1554
- return;
1555
- }
1556
- if (overlay.type === "auto" || overlay.type === "modal" || overlay.type === "page") {
1557
- const queryPathEventName = "sp-overlay-query-path";
1558
- const queryPathEvent = new Event(queryPathEventName, {
1559
- composed: true,
1560
- bubbles: true
1561
- });
1562
- overlay.addEventListener(queryPathEventName, (event) => {
1563
- const path = event.composedPath();
1564
- this.stack.forEach((overlayEl) => {
1565
- const inPath = path.find((el) => el === overlayEl);
1566
- if (!inPath && overlayEl.type !== "manual" && overlayEl.type !== "modal") {
1567
- this.closeOverlay(overlayEl);
1568
- }
1569
- });
1570
- }, { once: true });
1571
- overlay.dispatchEvent(queryPathEvent);
1572
- } else if (overlay.type === "hint") {
1573
- const hasPrevious = this.stack.some((overlayEl) => {
1574
- return overlayEl.type !== "manual" && overlayEl.triggerElement && overlayEl.triggerElement === overlay.triggerElement;
1575
- });
1576
- if (hasPrevious) {
1577
- overlay.open = false;
1578
- return;
1579
- }
1580
- this.stack.forEach((overlayEl) => {
1581
- if (overlayEl.type === "hint") {
1582
- this.closeOverlay(overlayEl);
1583
- }
1584
- });
1585
- }
1586
- requestAnimationFrame(() => {
1587
- this.stack.push(overlay);
1588
- overlay.addEventListener("beforetoggle", this.handleBeforetoggle, {
1589
- once: true
1590
- });
1591
- this.manageBodyScroll();
1592
- });
1593
- }
1594
- remove(overlay) {
1595
- this.closeOverlay(overlay);
1596
- }
1597
- }
1598
- var overlayStack = new OverlayStack;
1599
-
1600
- // ../../node_modules/@floating-ui/core/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1601
- var min = Math.min;
1602
- var max = Math.max;
1603
- var oppositeSideMap = {
1604
- left: "right",
1605
- right: "left",
1606
- bottom: "top",
1607
- top: "bottom"
1608
- };
1609
- function clamp(start, value, end) {
1610
- return max(start, min(value, end));
1611
- }
1612
- function evaluate(value, param) {
1613
- return typeof value === "function" ? value(param) : value;
1614
- }
1615
- function getSide(placement) {
1616
- return placement.split("-")[0];
1617
- }
1618
- function getAlignment(placement) {
1619
- return placement.split("-")[1];
1620
- }
1621
- function getOppositeAxis(axis) {
1622
- return axis === "x" ? "y" : "x";
1623
- }
1624
- function getAxisLength(axis) {
1625
- return axis === "y" ? "height" : "width";
1626
- }
1627
- function getSideAxis(placement) {
1628
- const firstChar = placement[0];
1629
- return firstChar === "t" || firstChar === "b" ? "y" : "x";
1630
- }
1631
- function getAlignmentAxis(placement) {
1632
- return getOppositeAxis(getSideAxis(placement));
1633
- }
1634
- function getAlignmentSides(placement, rects, rtl) {
1635
- if (rtl === undefined) {
1636
- rtl = false;
1637
- }
1638
- const alignment = getAlignment(placement);
1639
- const alignmentAxis = getAlignmentAxis(placement);
1640
- const length = getAxisLength(alignmentAxis);
1641
- let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
1642
- if (rects.reference[length] > rects.floating[length]) {
1643
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
1644
- }
1645
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
1646
- }
1647
- function getExpandedPlacements(placement) {
1648
- const oppositePlacement = getOppositePlacement(placement);
1649
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
1650
- }
1651
- function getOppositeAlignmentPlacement(placement) {
1652
- return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
1653
- }
1654
- var lrPlacement = ["left", "right"];
1655
- var rlPlacement = ["right", "left"];
1656
- var tbPlacement = ["top", "bottom"];
1657
- var btPlacement = ["bottom", "top"];
1658
- function getSideList(side, isStart, rtl) {
1659
- switch (side) {
1660
- case "top":
1661
- case "bottom":
1662
- if (rtl)
1663
- return isStart ? rlPlacement : lrPlacement;
1664
- return isStart ? lrPlacement : rlPlacement;
1665
- case "left":
1666
- case "right":
1667
- return isStart ? tbPlacement : btPlacement;
1668
- default:
1669
- return [];
1670
- }
1671
- }
1672
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
1673
- const alignment = getAlignment(placement);
1674
- let list = getSideList(getSide(placement), direction === "start", rtl);
1675
- if (alignment) {
1676
- list = list.map((side) => side + "-" + alignment);
1677
- if (flipAlignment) {
1678
- list = list.concat(list.map(getOppositeAlignmentPlacement));
1679
- }
1680
- }
1681
- return list;
1682
- }
1683
- function getOppositePlacement(placement) {
1684
- const side = getSide(placement);
1685
- return oppositeSideMap[side] + placement.slice(side.length);
1686
- }
1687
- function expandPaddingObject(padding) {
1688
- return {
1689
- top: 0,
1690
- right: 0,
1691
- bottom: 0,
1692
- left: 0,
1693
- ...padding
1694
- };
1695
- }
1696
- function getPaddingObject(padding) {
1697
- return typeof padding !== "number" ? expandPaddingObject(padding) : {
1698
- top: padding,
1699
- right: padding,
1700
- bottom: padding,
1701
- left: padding
1702
- };
1703
- }
1704
- function rectToClientRect(rect) {
1705
- const {
1706
- x,
1707
- y,
1708
- width,
1709
- height
1710
- } = rect;
1711
- return {
1712
- width,
1713
- height,
1714
- top: y,
1715
- left: x,
1716
- right: x + width,
1717
- bottom: y + height,
1718
- x,
1719
- y
1720
- };
1721
- }
1722
-
1723
- // ../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1724
- function computeCoordsFromPlacement(_ref, placement, rtl) {
1725
- let {
1726
- reference,
1727
- floating
1728
- } = _ref;
1729
- const sideAxis = getSideAxis(placement);
1730
- const alignmentAxis = getAlignmentAxis(placement);
1731
- const alignLength = getAxisLength(alignmentAxis);
1732
- const side = getSide(placement);
1733
- const isVertical = sideAxis === "y";
1734
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
1735
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
1736
- const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
1737
- let coords;
1738
- switch (side) {
1739
- case "top":
1740
- coords = {
1741
- x: commonX,
1742
- y: reference.y - floating.height
1743
- };
1744
- break;
1745
- case "bottom":
1746
- coords = {
1747
- x: commonX,
1748
- y: reference.y + reference.height
1749
- };
1750
- break;
1751
- case "right":
1752
- coords = {
1753
- x: reference.x + reference.width,
1754
- y: commonY
1755
- };
1756
- break;
1757
- case "left":
1758
- coords = {
1759
- x: reference.x - floating.width,
1760
- y: commonY
1761
- };
1762
- break;
1763
- default:
1764
- coords = {
1765
- x: reference.x,
1766
- y: reference.y
1767
- };
1768
- }
1769
- switch (getAlignment(placement)) {
1770
- case "start":
1771
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
1772
- break;
1773
- case "end":
1774
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
1775
- break;
1776
- }
1777
- return coords;
1778
- }
1779
- async function detectOverflow(state2, options) {
1780
- var _await$platform$isEle;
1781
- if (options === undefined) {
1782
- options = {};
1783
- }
1784
- const {
1785
- x,
1786
- y,
1787
- platform,
1788
- rects,
1789
- elements,
1790
- strategy
1791
- } = state2;
1792
- const {
1793
- boundary = "clippingAncestors",
1794
- rootBoundary = "viewport",
1795
- elementContext = "floating",
1796
- altBoundary = false,
1797
- padding = 0
1798
- } = evaluate(options, state2);
1799
- const paddingObject = getPaddingObject(padding);
1800
- const altContext = elementContext === "floating" ? "reference" : "floating";
1801
- const element = elements[altBoundary ? altContext : elementContext];
1802
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
1803
- element: ((_await$platform$isEle = await (platform.isElement == null ? undefined : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform.getDocumentElement == null ? undefined : platform.getDocumentElement(elements.floating)),
1804
- boundary,
1805
- rootBoundary,
1806
- strategy
1807
- }));
1808
- const rect = elementContext === "floating" ? {
1809
- x,
1810
- y,
1811
- width: rects.floating.width,
1812
- height: rects.floating.height
1813
- } : rects.reference;
1814
- const offsetParent = await (platform.getOffsetParent == null ? undefined : platform.getOffsetParent(elements.floating));
1815
- const offsetScale = await (platform.isElement == null ? undefined : platform.isElement(offsetParent)) ? await (platform.getScale == null ? undefined : platform.getScale(offsetParent)) || {
1816
- x: 1,
1817
- y: 1
1818
- } : {
1819
- x: 1,
1820
- y: 1
1821
- };
1822
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
1823
- elements,
1824
- rect,
1825
- offsetParent,
1826
- strategy
1827
- }) : rect);
1828
- return {
1829
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
1830
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
1831
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
1832
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
1833
- };
1834
- }
1835
- var MAX_RESET_COUNT = 50;
1836
- var computePosition = async (reference, floating, config) => {
1837
- const {
1838
- placement = "bottom",
1839
- strategy = "absolute",
1840
- middleware = [],
1841
- platform
1842
- } = config;
1843
- const platformWithDetectOverflow = platform.detectOverflow ? platform : {
1844
- ...platform,
1845
- detectOverflow
1846
- };
1847
- const rtl = await (platform.isRTL == null ? undefined : platform.isRTL(floating));
1848
- let rects = await platform.getElementRects({
1849
- reference,
1850
- floating,
1851
- strategy
1852
- });
1853
- let {
1854
- x,
1855
- y
1856
- } = computeCoordsFromPlacement(rects, placement, rtl);
1857
- let statefulPlacement = placement;
1858
- let resetCount = 0;
1859
- const middlewareData = {};
1860
- for (let i = 0;i < middleware.length; i++) {
1861
- const currentMiddleware = middleware[i];
1862
- if (!currentMiddleware) {
1863
- continue;
1864
- }
1865
- const {
1866
- name,
1867
- fn
1868
- } = currentMiddleware;
1869
- const {
1870
- x: nextX,
1871
- y: nextY,
1872
- data,
1873
- reset
1874
- } = await fn({
1875
- x,
1876
- y,
1877
- initialPlacement: placement,
1878
- placement: statefulPlacement,
1879
- strategy,
1880
- middlewareData,
1881
- rects,
1882
- platform: platformWithDetectOverflow,
1883
- elements: {
1884
- reference,
1885
- floating
1886
- }
1887
- });
1888
- x = nextX != null ? nextX : x;
1889
- y = nextY != null ? nextY : y;
1890
- middlewareData[name] = {
1891
- ...middlewareData[name],
1892
- ...data
1893
- };
1894
- if (reset && resetCount < MAX_RESET_COUNT) {
1895
- resetCount++;
1896
- if (typeof reset === "object") {
1897
- if (reset.placement) {
1898
- statefulPlacement = reset.placement;
1899
- }
1900
- if (reset.rects) {
1901
- rects = reset.rects === true ? await platform.getElementRects({
1902
- reference,
1903
- floating,
1904
- strategy
1905
- }) : reset.rects;
1906
- }
1907
- ({
1908
- x,
1909
- y
1910
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
1911
- }
1912
- i = -1;
1913
- }
1914
- }
1915
- return {
1916
- x,
1917
- y,
1918
- placement: statefulPlacement,
1919
- strategy,
1920
- middlewareData
1921
- };
1922
- };
1923
- var arrow = (options) => ({
1924
- name: "arrow",
1925
- options,
1926
- async fn(state2) {
1927
- const {
1928
- x,
1929
- y,
1930
- placement,
1931
- rects,
1932
- platform,
1933
- elements,
1934
- middlewareData
1935
- } = state2;
1936
- const {
1937
- element,
1938
- padding = 0
1939
- } = evaluate(options, state2) || {};
1940
- if (element == null) {
1941
- return {};
1942
- }
1943
- const paddingObject = getPaddingObject(padding);
1944
- const coords = {
1945
- x,
1946
- y
1947
- };
1948
- const axis = getAlignmentAxis(placement);
1949
- const length = getAxisLength(axis);
1950
- const arrowDimensions = await platform.getDimensions(element);
1951
- const isYAxis = axis === "y";
1952
- const minProp = isYAxis ? "top" : "left";
1953
- const maxProp = isYAxis ? "bottom" : "right";
1954
- const clientProp = isYAxis ? "clientHeight" : "clientWidth";
1955
- const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
1956
- const startDiff = coords[axis] - rects.reference[axis];
1957
- const arrowOffsetParent = await (platform.getOffsetParent == null ? undefined : platform.getOffsetParent(element));
1958
- let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
1959
- if (!clientSize || !await (platform.isElement == null ? undefined : platform.isElement(arrowOffsetParent))) {
1960
- clientSize = elements.floating[clientProp] || rects.floating[length];
1961
- }
1962
- const centerToReference = endDiff / 2 - startDiff / 2;
1963
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
1964
- const minPadding = min(paddingObject[minProp], largestPossiblePadding);
1965
- const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
1966
- const min$1 = minPadding;
1967
- const max2 = clientSize - arrowDimensions[length] - maxPadding;
1968
- const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
1969
- const offset = clamp(min$1, center, max2);
1970
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
1971
- const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
1972
- return {
1973
- [axis]: coords[axis] + alignmentOffset,
1974
- data: {
1975
- [axis]: offset,
1976
- centerOffset: center - offset - alignmentOffset,
1977
- ...shouldAddOffset && {
1978
- alignmentOffset
1979
- }
1980
- },
1981
- reset: shouldAddOffset
1982
- };
1983
- }
1984
- });
1985
- var flip = function(options) {
1986
- if (options === undefined) {
1987
- options = {};
1988
- }
1989
- return {
1990
- name: "flip",
1991
- options,
1992
- async fn(state2) {
1993
- var _middlewareData$arrow, _middlewareData$flip;
1994
- const {
1995
- placement,
1996
- middlewareData,
1997
- rects,
1998
- initialPlacement,
1999
- platform,
2000
- elements
2001
- } = state2;
2002
- const {
2003
- mainAxis: checkMainAxis = true,
2004
- crossAxis: checkCrossAxis = true,
2005
- fallbackPlacements: specifiedFallbackPlacements,
2006
- fallbackStrategy = "bestFit",
2007
- fallbackAxisSideDirection = "none",
2008
- flipAlignment = true,
2009
- ...detectOverflowOptions
2010
- } = evaluate(options, state2);
2011
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
2012
- return {};
2013
- }
2014
- const side = getSide(placement);
2015
- const initialSideAxis = getSideAxis(initialPlacement);
2016
- const isBasePlacement = getSide(initialPlacement) === initialPlacement;
2017
- const rtl = await (platform.isRTL == null ? undefined : platform.isRTL(elements.floating));
2018
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
2019
- const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
2020
- if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
2021
- fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
2022
- }
2023
- const placements2 = [initialPlacement, ...fallbackPlacements];
2024
- const overflow = await platform.detectOverflow(state2, detectOverflowOptions);
2025
- const overflows = [];
2026
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? undefined : _middlewareData$flip.overflows) || [];
2027
- if (checkMainAxis) {
2028
- overflows.push(overflow[side]);
2029
- }
2030
- if (checkCrossAxis) {
2031
- const sides2 = getAlignmentSides(placement, rects, rtl);
2032
- overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
2033
- }
2034
- overflowsData = [...overflowsData, {
2035
- placement,
2036
- overflows
2037
- }];
2038
- if (!overflows.every((side2) => side2 <= 0)) {
2039
- var _middlewareData$flip2, _overflowsData$filter;
2040
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? undefined : _middlewareData$flip2.index) || 0) + 1;
2041
- const nextPlacement = placements2[nextIndex];
2042
- if (nextPlacement) {
2043
- const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
2044
- if (!ignoreCrossAxisOverflow || overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
2045
- return {
2046
- data: {
2047
- index: nextIndex,
2048
- overflows: overflowsData
2049
- },
2050
- reset: {
2051
- placement: nextPlacement
2052
- }
2053
- };
2054
- }
2055
- }
2056
- let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? undefined : _overflowsData$filter.placement;
2057
- if (!resetPlacement) {
2058
- switch (fallbackStrategy) {
2059
- case "bestFit": {
2060
- var _overflowsData$filter2;
2061
- const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
2062
- if (hasFallbackAxisSideDirection) {
2063
- const currentSideAxis = getSideAxis(d.placement);
2064
- return currentSideAxis === initialSideAxis || currentSideAxis === "y";
2065
- }
2066
- return true;
2067
- }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? undefined : _overflowsData$filter2[0];
2068
- if (placement2) {
2069
- resetPlacement = placement2;
2070
- }
2071
- break;
2072
- }
2073
- case "initialPlacement":
2074
- resetPlacement = initialPlacement;
2075
- break;
2076
- }
2077
- }
2078
- if (placement !== resetPlacement) {
2079
- return {
2080
- reset: {
2081
- placement: resetPlacement
2082
- }
2083
- };
2084
- }
2085
- }
2086
- return {};
2087
- }
2088
- };
2089
- };
2090
- var originSides = /* @__PURE__ */ new Set(["left", "top"]);
2091
- async function convertValueToCoords(state2, options) {
2092
- const {
2093
- placement,
2094
- platform,
2095
- elements
2096
- } = state2;
2097
- const rtl = await (platform.isRTL == null ? undefined : platform.isRTL(elements.floating));
2098
- const side = getSide(placement);
2099
- const alignment = getAlignment(placement);
2100
- const isVertical = getSideAxis(placement) === "y";
2101
- const mainAxisMulti = originSides.has(side) ? -1 : 1;
2102
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
2103
- const rawValue = evaluate(options, state2);
2104
- let {
2105
- mainAxis,
2106
- crossAxis,
2107
- alignmentAxis
2108
- } = typeof rawValue === "number" ? {
2109
- mainAxis: rawValue,
2110
- crossAxis: 0,
2111
- alignmentAxis: null
2112
- } : {
2113
- mainAxis: rawValue.mainAxis || 0,
2114
- crossAxis: rawValue.crossAxis || 0,
2115
- alignmentAxis: rawValue.alignmentAxis
2116
- };
2117
- if (alignment && typeof alignmentAxis === "number") {
2118
- crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
2119
- }
2120
- return isVertical ? {
2121
- x: crossAxis * crossAxisMulti,
2122
- y: mainAxis * mainAxisMulti
2123
- } : {
2124
- x: mainAxis * mainAxisMulti,
2125
- y: crossAxis * crossAxisMulti
2126
- };
2127
- }
2128
- var offset = function(options) {
2129
- if (options === undefined) {
2130
- options = 0;
2131
- }
2132
- return {
2133
- name: "offset",
2134
- options,
2135
- async fn(state2) {
2136
- var _middlewareData$offse, _middlewareData$arrow;
2137
- const {
2138
- x,
2139
- y,
2140
- placement,
2141
- middlewareData
2142
- } = state2;
2143
- const diffCoords = await convertValueToCoords(state2, options);
2144
- if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? undefined : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
2145
- return {};
2146
- }
2147
- return {
2148
- x: x + diffCoords.x,
2149
- y: y + diffCoords.y,
2150
- data: {
2151
- ...diffCoords,
2152
- placement
2153
- }
2154
- };
2155
- }
2156
- };
2157
- };
2158
- var shift = function(options) {
2159
- if (options === undefined) {
2160
- options = {};
2161
- }
2162
- return {
2163
- name: "shift",
2164
- options,
2165
- async fn(state2) {
2166
- const {
2167
- x,
2168
- y,
2169
- placement,
2170
- platform
2171
- } = state2;
2172
- const {
2173
- mainAxis: checkMainAxis = true,
2174
- crossAxis: checkCrossAxis = false,
2175
- limiter = {
2176
- fn: (_ref) => {
2177
- let {
2178
- x: x2,
2179
- y: y2
2180
- } = _ref;
2181
- return {
2182
- x: x2,
2183
- y: y2
2184
- };
2185
- }
2186
- },
2187
- ...detectOverflowOptions
2188
- } = evaluate(options, state2);
2189
- const coords = {
2190
- x,
2191
- y
2192
- };
2193
- const overflow = await platform.detectOverflow(state2, detectOverflowOptions);
2194
- const crossAxis = getSideAxis(getSide(placement));
2195
- const mainAxis = getOppositeAxis(crossAxis);
2196
- let mainAxisCoord = coords[mainAxis];
2197
- let crossAxisCoord = coords[crossAxis];
2198
- if (checkMainAxis) {
2199
- const minSide = mainAxis === "y" ? "top" : "left";
2200
- const maxSide = mainAxis === "y" ? "bottom" : "right";
2201
- const min2 = mainAxisCoord + overflow[minSide];
2202
- const max2 = mainAxisCoord - overflow[maxSide];
2203
- mainAxisCoord = clamp(min2, mainAxisCoord, max2);
2204
- }
2205
- if (checkCrossAxis) {
2206
- const minSide = crossAxis === "y" ? "top" : "left";
2207
- const maxSide = crossAxis === "y" ? "bottom" : "right";
2208
- const min2 = crossAxisCoord + overflow[minSide];
2209
- const max2 = crossAxisCoord - overflow[maxSide];
2210
- crossAxisCoord = clamp(min2, crossAxisCoord, max2);
2211
- }
2212
- const limitedCoords = limiter.fn({
2213
- ...state2,
2214
- [mainAxis]: mainAxisCoord,
2215
- [crossAxis]: crossAxisCoord
2216
- });
2217
- return {
2218
- ...limitedCoords,
2219
- data: {
2220
- x: limitedCoords.x - x,
2221
- y: limitedCoords.y - y,
2222
- enabled: {
2223
- [mainAxis]: checkMainAxis,
2224
- [crossAxis]: checkCrossAxis
2225
- }
2226
- }
2227
- };
2228
- }
2229
- };
2230
- };
2231
- var size = function(options) {
2232
- if (options === undefined) {
2233
- options = {};
2234
- }
2235
- return {
2236
- name: "size",
2237
- options,
2238
- async fn(state2) {
2239
- var _state$middlewareData, _state$middlewareData2;
2240
- const {
2241
- placement,
2242
- rects,
2243
- platform,
2244
- elements
2245
- } = state2;
2246
- const {
2247
- apply = () => {},
2248
- ...detectOverflowOptions
2249
- } = evaluate(options, state2);
2250
- const overflow = await platform.detectOverflow(state2, detectOverflowOptions);
2251
- const side = getSide(placement);
2252
- const alignment = getAlignment(placement);
2253
- const isYAxis = getSideAxis(placement) === "y";
2254
- const {
2255
- width,
2256
- height
2257
- } = rects.floating;
2258
- let heightSide;
2259
- let widthSide;
2260
- if (side === "top" || side === "bottom") {
2261
- heightSide = side;
2262
- widthSide = alignment === (await (platform.isRTL == null ? undefined : platform.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
2263
- } else {
2264
- widthSide = side;
2265
- heightSide = alignment === "end" ? "top" : "bottom";
2266
- }
2267
- const maximumClippingHeight = height - overflow.top - overflow.bottom;
2268
- const maximumClippingWidth = width - overflow.left - overflow.right;
2269
- const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
2270
- const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
2271
- const noShift = !state2.middlewareData.shift;
2272
- let availableHeight = overflowAvailableHeight;
2273
- let availableWidth = overflowAvailableWidth;
2274
- if ((_state$middlewareData = state2.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
2275
- availableWidth = maximumClippingWidth;
2276
- }
2277
- if ((_state$middlewareData2 = state2.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
2278
- availableHeight = maximumClippingHeight;
2279
- }
2280
- if (noShift && !alignment) {
2281
- const xMin = max(overflow.left, 0);
2282
- const xMax = max(overflow.right, 0);
2283
- const yMin = max(overflow.top, 0);
2284
- const yMax = max(overflow.bottom, 0);
2285
- if (isYAxis) {
2286
- availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
2287
- } else {
2288
- availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
2289
- }
2290
- }
2291
- await apply({
2292
- ...state2,
2293
- availableWidth,
2294
- availableHeight
2295
- });
2296
- const nextDimensions = await platform.getDimensions(elements.floating);
2297
- if (width !== nextDimensions.width || height !== nextDimensions.height) {
2298
- return {
2299
- reset: {
2300
- rects: true
2301
- }
2302
- };
2303
- }
2304
- return {};
2305
- }
2306
- };
2307
- };
2308
-
2309
- // ../../node_modules/@spectrum-web-components/overlay/node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
2310
- var min2 = Math.min;
2311
- var max2 = Math.max;
2312
- var round = Math.round;
2313
- var floor = Math.floor;
2314
- var createCoords = (v) => ({
2315
- x: v,
2316
- y: v
2317
- });
2318
-
2319
- // ../../node_modules/@spectrum-web-components/overlay/node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
2320
- function hasWindow() {
2321
- return typeof window !== "undefined";
2322
- }
2323
- function getNodeName(node) {
2324
- if (isNode(node)) {
2325
- return (node.nodeName || "").toLowerCase();
2326
- }
2327
- return "#document";
2328
- }
2329
- function getWindow(node) {
2330
- var _node$ownerDocument;
2331
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? undefined : _node$ownerDocument.defaultView) || window;
2332
- }
2333
- function getDocumentElement(node) {
2334
- var _ref;
2335
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? undefined : _ref.documentElement;
2336
- }
2337
- function isNode(value) {
2338
- if (!hasWindow()) {
2339
- return false;
2340
- }
2341
- return value instanceof Node || value instanceof getWindow(value).Node;
2342
- }
2343
- function isElement(value) {
2344
- if (!hasWindow()) {
2345
- return false;
2346
- }
2347
- return value instanceof Element || value instanceof getWindow(value).Element;
2348
- }
2349
- function isHTMLElement(value) {
2350
- if (!hasWindow()) {
2351
- return false;
2352
- }
2353
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
2354
- }
2355
- function isShadowRoot(value) {
2356
- if (!hasWindow() || typeof ShadowRoot === "undefined") {
2357
- return false;
2358
- }
2359
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
2360
- }
2361
- function isOverflowElement(element) {
2362
- const {
2363
- overflow,
2364
- overflowX,
2365
- overflowY,
2366
- display
2367
- } = getComputedStyle2(element);
2368
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
2369
- }
2370
- function isTableElement(element) {
2371
- return /^(table|td|th)$/.test(getNodeName(element));
2372
- }
2373
- function isTopLayer(element) {
2374
- try {
2375
- if (element.matches(":popover-open")) {
2376
- return true;
2377
- }
2378
- } catch (_e) {}
2379
- try {
2380
- return element.matches(":modal");
2381
- } catch (_e) {
2382
- return false;
2383
- }
2384
- }
2385
- var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
2386
- var containRe = /paint|layout|strict|content/;
2387
- var isNotNone = (value) => !!value && value !== "none";
2388
- var isWebKitValue;
2389
- function isContainingBlock(elementOrCss) {
2390
- const css2 = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
2391
- return isNotNone(css2.transform) || isNotNone(css2.translate) || isNotNone(css2.scale) || isNotNone(css2.rotate) || isNotNone(css2.perspective) || !isWebKit2() && (isNotNone(css2.backdropFilter) || isNotNone(css2.filter)) || willChangeRe.test(css2.willChange || "") || containRe.test(css2.contain || "");
2392
- }
2393
- function getContainingBlock(element) {
2394
- let currentNode = getParentNode(element);
2395
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
2396
- if (isContainingBlock(currentNode)) {
2397
- return currentNode;
2398
- } else if (isTopLayer(currentNode)) {
2399
- return null;
2400
- }
2401
- currentNode = getParentNode(currentNode);
2402
- }
2403
- return null;
2404
- }
2405
- function isWebKit2() {
2406
- if (isWebKitValue == null) {
2407
- isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
2408
- }
2409
- return isWebKitValue;
2410
- }
2411
- function isLastTraversableNode(node) {
2412
- return /^(html|body|#document)$/.test(getNodeName(node));
2413
- }
2414
- function getComputedStyle2(element) {
2415
- return getWindow(element).getComputedStyle(element);
2416
- }
2417
- function getNodeScroll(element) {
2418
- if (isElement(element)) {
2419
- return {
2420
- scrollLeft: element.scrollLeft,
2421
- scrollTop: element.scrollTop
2422
- };
2423
- }
2424
- return {
2425
- scrollLeft: element.scrollX,
2426
- scrollTop: element.scrollY
2427
- };
2428
- }
2429
- function getParentNode(node) {
2430
- if (getNodeName(node) === "html") {
2431
- return node;
2432
- }
2433
- const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
2434
- return isShadowRoot(result) ? result.host : result;
2435
- }
2436
- function getNearestOverflowAncestor(node) {
2437
- const parentNode = getParentNode(node);
2438
- if (isLastTraversableNode(parentNode)) {
2439
- return node.ownerDocument ? node.ownerDocument.body : node.body;
2440
- }
2441
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
2442
- return parentNode;
2443
- }
2444
- return getNearestOverflowAncestor(parentNode);
2445
- }
2446
- function getOverflowAncestors(node, list, traverseIframes) {
2447
- var _node$ownerDocument2;
2448
- if (list === undefined) {
2449
- list = [];
2450
- }
2451
- if (traverseIframes === undefined) {
2452
- traverseIframes = true;
2453
- }
2454
- const scrollableAncestor = getNearestOverflowAncestor(node);
2455
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? undefined : _node$ownerDocument2.body);
2456
- const win = getWindow(scrollableAncestor);
2457
- if (isBody) {
2458
- const frameElement = getFrameElement(win);
2459
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
2460
- } else {
2461
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
2462
- }
2463
- }
2464
- function getFrameElement(win) {
2465
- return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
2466
- }
2467
-
2468
- // ../../node_modules/@spectrum-web-components/overlay/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
2469
- function getCssDimensions(element) {
2470
- const css2 = getComputedStyle2(element);
2471
- let width = parseFloat(css2.width) || 0;
2472
- let height = parseFloat(css2.height) || 0;
2473
- const hasOffset = isHTMLElement(element);
2474
- const offsetWidth = hasOffset ? element.offsetWidth : width;
2475
- const offsetHeight = hasOffset ? element.offsetHeight : height;
2476
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
2477
- if (shouldFallback) {
2478
- width = offsetWidth;
2479
- height = offsetHeight;
2480
- }
2481
- return {
2482
- width,
2483
- height,
2484
- $: shouldFallback
2485
- };
2486
- }
2487
- function unwrapElement(element) {
2488
- return !isElement(element) ? element.contextElement : element;
2489
- }
2490
- function getScale(element) {
2491
- const domElement = unwrapElement(element);
2492
- if (!isHTMLElement(domElement)) {
2493
- return createCoords(1);
2494
- }
2495
- const rect = domElement.getBoundingClientRect();
2496
- const {
2497
- width,
2498
- height,
2499
- $
2500
- } = getCssDimensions(domElement);
2501
- let x = ($ ? round(rect.width) : rect.width) / width;
2502
- let y = ($ ? round(rect.height) : rect.height) / height;
2503
- if (!x || !Number.isFinite(x)) {
2504
- x = 1;
2505
- }
2506
- if (!y || !Number.isFinite(y)) {
2507
- y = 1;
2508
- }
2509
- return {
2510
- x,
2511
- y
2512
- };
2513
- }
2514
- var noOffsets = /* @__PURE__ */ createCoords(0);
2515
- function getVisualOffsets(element) {
2516
- const win = getWindow(element);
2517
- if (!isWebKit2() || !win.visualViewport) {
2518
- return noOffsets;
2519
- }
2520
- return {
2521
- x: win.visualViewport.offsetLeft,
2522
- y: win.visualViewport.offsetTop
2523
- };
2524
- }
2525
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
2526
- if (isFixed === undefined) {
2527
- isFixed = false;
2528
- }
2529
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
2530
- return false;
2531
- }
2532
- return isFixed;
2533
- }
2534
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
2535
- if (includeScale === undefined) {
2536
- includeScale = false;
2537
- }
2538
- if (isFixedStrategy === undefined) {
2539
- isFixedStrategy = false;
2540
- }
2541
- const clientRect = element.getBoundingClientRect();
2542
- const domElement = unwrapElement(element);
2543
- let scale = createCoords(1);
2544
- if (includeScale) {
2545
- if (offsetParent) {
2546
- if (isElement(offsetParent)) {
2547
- scale = getScale(offsetParent);
2548
- }
2549
- } else {
2550
- scale = getScale(element);
2551
- }
2552
- }
2553
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
2554
- let x = (clientRect.left + visualOffsets.x) / scale.x;
2555
- let y = (clientRect.top + visualOffsets.y) / scale.y;
2556
- let width = clientRect.width / scale.x;
2557
- let height = clientRect.height / scale.y;
2558
- if (domElement) {
2559
- const win = getWindow(domElement);
2560
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
2561
- let currentWin = win;
2562
- let currentIFrame = getFrameElement(currentWin);
2563
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
2564
- const iframeScale = getScale(currentIFrame);
2565
- const iframeRect = currentIFrame.getBoundingClientRect();
2566
- const css2 = getComputedStyle2(currentIFrame);
2567
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css2.paddingLeft)) * iframeScale.x;
2568
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css2.paddingTop)) * iframeScale.y;
2569
- x *= iframeScale.x;
2570
- y *= iframeScale.y;
2571
- width *= iframeScale.x;
2572
- height *= iframeScale.y;
2573
- x += left;
2574
- y += top;
2575
- currentWin = getWindow(currentIFrame);
2576
- currentIFrame = getFrameElement(currentWin);
2577
- }
2578
- }
2579
- return rectToClientRect({
2580
- width,
2581
- height,
2582
- x,
2583
- y
2584
- });
2585
- }
2586
- function getWindowScrollBarX(element, rect) {
2587
- const leftScroll = getNodeScroll(element).scrollLeft;
2588
- if (!rect) {
2589
- return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
2590
- }
2591
- return rect.left + leftScroll;
2592
- }
2593
- function getHTMLOffset(documentElement, scroll) {
2594
- const htmlRect = documentElement.getBoundingClientRect();
2595
- const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
2596
- const y = htmlRect.top + scroll.scrollTop;
2597
- return {
2598
- x,
2599
- y
2600
- };
2601
- }
2602
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
2603
- let {
2604
- elements,
2605
- rect,
2606
- offsetParent,
2607
- strategy
2608
- } = _ref;
2609
- const isFixed = strategy === "fixed";
2610
- const documentElement = getDocumentElement(offsetParent);
2611
- const topLayer = elements ? isTopLayer(elements.floating) : false;
2612
- if (offsetParent === documentElement || topLayer && isFixed) {
2613
- return rect;
2614
- }
2615
- let scroll = {
2616
- scrollLeft: 0,
2617
- scrollTop: 0
2618
- };
2619
- let scale = createCoords(1);
2620
- const offsets = createCoords(0);
2621
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
2622
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2623
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
2624
- scroll = getNodeScroll(offsetParent);
2625
- }
2626
- if (isHTMLElement(offsetParent)) {
2627
- const offsetRect = getBoundingClientRect(offsetParent);
2628
- scale = getScale(offsetParent);
2629
- offsets.x = offsetRect.x + offsetParent.clientLeft;
2630
- offsets.y = offsetRect.y + offsetParent.clientTop;
2631
- }
2632
- }
2633
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
2634
- return {
2635
- width: rect.width * scale.x,
2636
- height: rect.height * scale.y,
2637
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
2638
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
2639
- };
2640
- }
2641
- function getClientRects(element) {
2642
- return Array.from(element.getClientRects());
2643
- }
2644
- function getDocumentRect(element) {
2645
- const html2 = getDocumentElement(element);
2646
- const scroll = getNodeScroll(element);
2647
- const body = element.ownerDocument.body;
2648
- const width = max2(html2.scrollWidth, html2.clientWidth, body.scrollWidth, body.clientWidth);
2649
- const height = max2(html2.scrollHeight, html2.clientHeight, body.scrollHeight, body.clientHeight);
2650
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
2651
- const y = -scroll.scrollTop;
2652
- if (getComputedStyle2(body).direction === "rtl") {
2653
- x += max2(html2.clientWidth, body.clientWidth) - width;
2654
- }
2655
- return {
2656
- width,
2657
- height,
2658
- x,
2659
- y
2660
- };
2661
- }
2662
- var SCROLLBAR_MAX = 25;
2663
- function getViewportRect(element, strategy) {
2664
- const win = getWindow(element);
2665
- const html2 = getDocumentElement(element);
2666
- const visualViewport = win.visualViewport;
2667
- let width = html2.clientWidth;
2668
- let height = html2.clientHeight;
2669
- let x = 0;
2670
- let y = 0;
2671
- if (visualViewport) {
2672
- width = visualViewport.width;
2673
- height = visualViewport.height;
2674
- const visualViewportBased = isWebKit2();
2675
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
2676
- x = visualViewport.offsetLeft;
2677
- y = visualViewport.offsetTop;
2678
- }
2679
- }
2680
- const windowScrollbarX = getWindowScrollBarX(html2);
2681
- if (windowScrollbarX <= 0) {
2682
- const doc = html2.ownerDocument;
2683
- const body = doc.body;
2684
- const bodyStyles = getComputedStyle(body);
2685
- const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
2686
- const clippingStableScrollbarWidth = Math.abs(html2.clientWidth - body.clientWidth - bodyMarginInline);
2687
- if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
2688
- width -= clippingStableScrollbarWidth;
2689
- }
2690
- } else if (windowScrollbarX <= SCROLLBAR_MAX) {
2691
- width += windowScrollbarX;
2692
- }
2693
- return {
2694
- width,
2695
- height,
2696
- x,
2697
- y
2698
- };
2699
- }
2700
- var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
2701
- function getInnerBoundingClientRect(element, strategy) {
2702
- const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
2703
- const top = clientRect.top + element.clientTop;
2704
- const left = clientRect.left + element.clientLeft;
2705
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
2706
- const width = element.clientWidth * scale.x;
2707
- const height = element.clientHeight * scale.y;
2708
- const x = left * scale.x;
2709
- const y = top * scale.y;
2710
- return {
2711
- width,
2712
- height,
2713
- x,
2714
- y
2715
- };
2716
- }
2717
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
2718
- let rect;
2719
- if (clippingAncestor === "viewport") {
2720
- rect = getViewportRect(element, strategy);
2721
- } else if (clippingAncestor === "document") {
2722
- rect = getDocumentRect(getDocumentElement(element));
2723
- } else if (isElement(clippingAncestor)) {
2724
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
2725
- } else {
2726
- const visualOffsets = getVisualOffsets(element);
2727
- rect = {
2728
- x: clippingAncestor.x - visualOffsets.x,
2729
- y: clippingAncestor.y - visualOffsets.y,
2730
- width: clippingAncestor.width,
2731
- height: clippingAncestor.height
2732
- };
2733
- }
2734
- return rectToClientRect(rect);
2735
- }
2736
- function hasFixedPositionAncestor(element, stopNode) {
2737
- const parentNode = getParentNode(element);
2738
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
2739
- return false;
2740
- }
2741
- return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
2742
- }
2743
- function getClippingElementAncestors(element, cache) {
2744
- const cachedResult = cache.get(element);
2745
- if (cachedResult) {
2746
- return cachedResult;
2747
- }
2748
- let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
2749
- let currentContainingBlockComputedStyle = null;
2750
- const elementIsFixed = getComputedStyle2(element).position === "fixed";
2751
- let currentNode = elementIsFixed ? getParentNode(element) : element;
2752
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
2753
- const computedStyle = getComputedStyle2(currentNode);
2754
- const currentNodeIsContaining = isContainingBlock(currentNode);
2755
- if (!currentNodeIsContaining && computedStyle.position === "fixed") {
2756
- currentContainingBlockComputedStyle = null;
2757
- }
2758
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
2759
- if (shouldDropCurrentNode) {
2760
- result = result.filter((ancestor) => ancestor !== currentNode);
2761
- } else {
2762
- currentContainingBlockComputedStyle = computedStyle;
2763
- }
2764
- currentNode = getParentNode(currentNode);
2765
- }
2766
- cache.set(element, result);
2767
- return result;
2768
- }
2769
- function getClippingRect(_ref) {
2770
- let {
2771
- element,
2772
- boundary,
2773
- rootBoundary,
2774
- strategy
2775
- } = _ref;
2776
- const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
2777
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
2778
- const firstClippingAncestor = clippingAncestors[0];
2779
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
2780
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
2781
- accRect.top = max2(rect.top, accRect.top);
2782
- accRect.right = min2(rect.right, accRect.right);
2783
- accRect.bottom = min2(rect.bottom, accRect.bottom);
2784
- accRect.left = max2(rect.left, accRect.left);
2785
- return accRect;
2786
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
2787
- return {
2788
- width: clippingRect.right - clippingRect.left,
2789
- height: clippingRect.bottom - clippingRect.top,
2790
- x: clippingRect.left,
2791
- y: clippingRect.top
2792
- };
2793
- }
2794
- function getDimensions(element) {
2795
- const {
2796
- width,
2797
- height
2798
- } = getCssDimensions(element);
2799
- return {
2800
- width,
2801
- height
2802
- };
2803
- }
2804
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
2805
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
2806
- const documentElement = getDocumentElement(offsetParent);
2807
- const isFixed = strategy === "fixed";
2808
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
2809
- let scroll = {
2810
- scrollLeft: 0,
2811
- scrollTop: 0
2812
- };
2813
- const offsets = createCoords(0);
2814
- function setLeftRTLScrollbarOffset() {
2815
- offsets.x = getWindowScrollBarX(documentElement);
2816
- }
2817
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2818
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
2819
- scroll = getNodeScroll(offsetParent);
2820
- }
2821
- if (isOffsetParentAnElement) {
2822
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
2823
- offsets.x = offsetRect.x + offsetParent.clientLeft;
2824
- offsets.y = offsetRect.y + offsetParent.clientTop;
2825
- } else if (documentElement) {
2826
- setLeftRTLScrollbarOffset();
2827
- }
2828
- }
2829
- if (isFixed && !isOffsetParentAnElement && documentElement) {
2830
- setLeftRTLScrollbarOffset();
2831
- }
2832
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
2833
- const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
2834
- const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
2835
- return {
2836
- x,
2837
- y,
2838
- width: rect.width,
2839
- height: rect.height
2840
- };
2841
- }
2842
- function isStaticPositioned(element) {
2843
- return getComputedStyle2(element).position === "static";
2844
- }
2845
- function getTrueOffsetParent(element, polyfill) {
2846
- if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
2847
- return null;
2848
- }
2849
- if (polyfill) {
2850
- return polyfill(element);
2851
- }
2852
- let rawOffsetParent = element.offsetParent;
2853
- if (getDocumentElement(element) === rawOffsetParent) {
2854
- rawOffsetParent = rawOffsetParent.ownerDocument.body;
2855
- }
2856
- return rawOffsetParent;
2857
- }
2858
- function getOffsetParent(element, polyfill) {
2859
- const win = getWindow(element);
2860
- if (isTopLayer(element)) {
2861
- return win;
2862
- }
2863
- if (!isHTMLElement(element)) {
2864
- let svgOffsetParent = getParentNode(element);
2865
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
2866
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
2867
- return svgOffsetParent;
2868
- }
2869
- svgOffsetParent = getParentNode(svgOffsetParent);
2870
- }
2871
- return win;
2872
- }
2873
- let offsetParent = getTrueOffsetParent(element, polyfill);
2874
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
2875
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
2876
- }
2877
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
2878
- return win;
2879
- }
2880
- return offsetParent || getContainingBlock(element) || win;
2881
- }
2882
- var getElementRects = async function(data) {
2883
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
2884
- const getDimensionsFn = this.getDimensions;
2885
- const floatingDimensions = await getDimensionsFn(data.floating);
2886
- return {
2887
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
2888
- floating: {
2889
- x: 0,
2890
- y: 0,
2891
- width: floatingDimensions.width,
2892
- height: floatingDimensions.height
2893
- }
2894
- };
2895
- };
2896
- function isRTL(element) {
2897
- return getComputedStyle2(element).direction === "rtl";
2898
- }
2899
- var platform = {
2900
- convertOffsetParentRelativeRectToViewportRelativeRect,
2901
- getDocumentElement,
2902
- getClippingRect,
2903
- getOffsetParent,
2904
- getElementRects,
2905
- getClientRects,
2906
- getDimensions,
2907
- getScale,
2908
- isElement,
2909
- isRTL
2910
- };
2911
- function rectsAreEqual(a, b) {
2912
- return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
2913
- }
2914
- function observeMove(element, onMove) {
2915
- let io = null;
2916
- let timeoutId;
2917
- const root = getDocumentElement(element);
2918
- function cleanup() {
2919
- var _io;
2920
- clearTimeout(timeoutId);
2921
- (_io = io) == null || _io.disconnect();
2922
- io = null;
2923
- }
2924
- function refresh(skip, threshold) {
2925
- if (skip === undefined) {
2926
- skip = false;
2927
- }
2928
- if (threshold === undefined) {
2929
- threshold = 1;
2930
- }
2931
- cleanup();
2932
- const elementRectForRootMargin = element.getBoundingClientRect();
2933
- const {
2934
- left,
2935
- top,
2936
- width,
2937
- height
2938
- } = elementRectForRootMargin;
2939
- if (!skip) {
2940
- onMove();
2941
- }
2942
- if (!width || !height) {
2943
- return;
2944
- }
2945
- const insetTop = floor(top);
2946
- const insetRight = floor(root.clientWidth - (left + width));
2947
- const insetBottom = floor(root.clientHeight - (top + height));
2948
- const insetLeft = floor(left);
2949
- const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
2950
- const options = {
2951
- rootMargin,
2952
- threshold: max2(0, min2(1, threshold)) || 1
2953
- };
2954
- let isFirstUpdate = true;
2955
- function handleObserve(entries) {
2956
- const ratio = entries[0].intersectionRatio;
2957
- if (ratio !== threshold) {
2958
- if (!isFirstUpdate) {
2959
- return refresh();
2960
- }
2961
- if (!ratio) {
2962
- timeoutId = setTimeout(() => {
2963
- refresh(false, 0.0000001);
2964
- }, 1000);
2965
- } else {
2966
- refresh(false, ratio);
2967
- }
2968
- }
2969
- if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
2970
- refresh();
2971
- }
2972
- isFirstUpdate = false;
2973
- }
2974
- try {
2975
- io = new IntersectionObserver(handleObserve, {
2976
- ...options,
2977
- root: root.ownerDocument
2978
- });
2979
- } catch (_e) {
2980
- io = new IntersectionObserver(handleObserve, options);
2981
- }
2982
- io.observe(element);
2983
- }
2984
- refresh(true);
2985
- return cleanup;
2986
- }
2987
- function autoUpdate(reference, floating, update, options) {
2988
- if (options === undefined) {
2989
- options = {};
2990
- }
2991
- const {
2992
- ancestorScroll = true,
2993
- ancestorResize = true,
2994
- elementResize = typeof ResizeObserver === "function",
2995
- layoutShift = typeof IntersectionObserver === "function",
2996
- animationFrame = false
2997
- } = options;
2998
- const referenceEl = unwrapElement(reference);
2999
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
3000
- ancestors.forEach((ancestor) => {
3001
- ancestorScroll && ancestor.addEventListener("scroll", update, {
3002
- passive: true
3003
- });
3004
- ancestorResize && ancestor.addEventListener("resize", update);
3005
- });
3006
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
3007
- let reobserveFrame = -1;
3008
- let resizeObserver = null;
3009
- if (elementResize) {
3010
- resizeObserver = new ResizeObserver((_ref) => {
3011
- let [firstEntry] = _ref;
3012
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
3013
- resizeObserver.unobserve(floating);
3014
- cancelAnimationFrame(reobserveFrame);
3015
- reobserveFrame = requestAnimationFrame(() => {
3016
- var _resizeObserver;
3017
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
3018
- });
3019
- }
3020
- update();
3021
- });
3022
- if (referenceEl && !animationFrame) {
3023
- resizeObserver.observe(referenceEl);
3024
- }
3025
- resizeObserver.observe(floating);
3026
- }
3027
- let frameId;
3028
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
3029
- if (animationFrame) {
3030
- frameLoop();
3031
- }
3032
- function frameLoop() {
3033
- const nextRefRect = getBoundingClientRect(reference);
3034
- if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
3035
- update();
3036
- }
3037
- prevRefRect = nextRefRect;
3038
- frameId = requestAnimationFrame(frameLoop);
3039
- }
3040
- update();
3041
- return () => {
3042
- var _resizeObserver2;
3043
- ancestors.forEach((ancestor) => {
3044
- ancestorScroll && ancestor.removeEventListener("scroll", update);
3045
- ancestorResize && ancestor.removeEventListener("resize", update);
3046
- });
3047
- cleanupIo == null || cleanupIo();
3048
- (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
3049
- resizeObserver = null;
3050
- if (animationFrame) {
3051
- cancelAnimationFrame(frameId);
3052
- }
3053
- };
3054
- }
3055
- var offset2 = offset;
3056
- var shift2 = shift;
3057
- var flip2 = flip;
3058
- var size2 = size;
3059
- var arrow2 = arrow;
3060
- var computePosition2 = (reference, floating, options) => {
3061
- const cache = new Map;
3062
- const mergedOptions = {
3063
- platform,
3064
- ...options
3065
- };
3066
- const platformWithCache = {
3067
- ...mergedOptions.platform,
3068
- _c: cache
3069
- };
3070
- return computePosition(reference, floating, {
3071
- ...mergedOptions,
3072
- platform: platformWithCache
3073
- });
3074
- };
3075
-
3076
- // ../../node_modules/@spectrum-web-components/overlay/src/PlacementController.dev.js
3077
- function roundByDPR(num) {
3078
- if (typeof num === "undefined") {
3079
- return 0;
3080
- }
3081
- const dpr = window.devicePixelRatio || 1;
3082
- return Math.round(num * dpr) / dpr;
3083
- }
3084
- var REQUIRED_DISTANCE_TO_EDGE = 8;
3085
- var MIN_OVERLAY_HEIGHT = 100;
3086
- var getFallbackPlacements = (placement) => {
3087
- var _a;
3088
- const fallbacks = {
3089
- left: ["right", "bottom", "top"],
3090
- "left-start": ["right-start", "bottom", "top"],
3091
- "left-end": ["right-end", "bottom", "top"],
3092
- right: ["left", "bottom", "top"],
3093
- "right-start": ["left-start", "bottom", "top"],
3094
- "right-end": ["left-end", "bottom", "top"],
3095
- top: ["bottom", "left", "right"],
3096
- "top-start": ["bottom-start", "left", "right"],
3097
- "top-end": ["bottom-end", "left", "right"],
3098
- bottom: ["top", "left", "right"],
3099
- "bottom-start": ["top-start", "left", "right"],
3100
- "bottom-end": ["top-end", "left", "right"]
3101
- };
3102
- return (_a = fallbacks[placement]) != null ? _a : [placement];
3103
- };
3104
- var placementUpdatedSymbol = Symbol("placement updated");
3105
-
3106
- class PlacementController {
3107
- constructor(host) {
3108
- this.originalPlacements = /* @__PURE__ */ new WeakMap;
3109
- this.placementGeneration = 0;
3110
- this.allowPlacementUpdate = false;
3111
- this.closeForAncestorUpdate = () => {
3112
- if (!this.allowPlacementUpdate && this.options.type !== "modal" && this.cleanup) {
3113
- this.target.dispatchEvent(new Event("close", { bubbles: true }));
3114
- }
3115
- this.allowPlacementUpdate = false;
3116
- };
3117
- this.updatePlacement = () => {
3118
- this.computePlacement();
3119
- };
3120
- this.resetOverlayPosition = () => {
3121
- if (!this.target || !this.options) {
3122
- return;
3123
- }
3124
- this.clearOverlayPosition();
3125
- this.host.offsetHeight;
3126
- this.computePlacement();
3127
- };
3128
- this.host = host;
3129
- this.host.addController(this);
3130
- }
3131
- async placeOverlay(target = this.target, options = this.options) {
3132
- var _a;
3133
- (_a = this.cleanup) == null || _a.call(this);
3134
- this.cleanup = undefined;
3135
- this.target = target;
3136
- this.options = options;
3137
- if (!target || !options) {
3138
- return;
3139
- }
3140
- const cleanupAncestorResize = autoUpdate(options.trigger, target, this.closeForAncestorUpdate, {
3141
- ancestorResize: false,
3142
- elementResize: false,
3143
- layoutShift: false
3144
- });
3145
- const cleanupElementResize = autoUpdate(options.trigger, target, this.updatePlacement, {
3146
- ancestorScroll: false
3147
- });
3148
- const visualViewport = window.visualViewport;
3149
- let visualViewportRafId = 0;
3150
- let visualViewportPlacementCancelled = false;
3151
- const onVisualViewportChange = () => {
3152
- if (visualViewportPlacementCancelled || visualViewportRafId) {
3153
- return;
3154
- }
3155
- visualViewportRafId = requestAnimationFrame(() => {
3156
- visualViewportRafId = 0;
3157
- if (visualViewportPlacementCancelled) {
3158
- return;
3159
- }
3160
- this.updatePlacement();
3161
- });
3162
- };
3163
- if (visualViewport && isWebKit()) {
3164
- visualViewport.addEventListener("resize", onVisualViewportChange, {
3165
- passive: true
3166
- });
3167
- visualViewport.addEventListener("scroll", onVisualViewportChange, {
3168
- passive: true
3169
- });
3170
- }
3171
- this.cleanup = () => {
3172
- var _a2;
3173
- this.placementGeneration += 1;
3174
- visualViewportPlacementCancelled = true;
3175
- (_a2 = this.host.elements) == null || _a2.forEach((element) => {
3176
- element.addEventListener("sp-closed", () => {
3177
- const placement = this.originalPlacements.get(element);
3178
- if (placement) {
3179
- element.setAttribute("placement", placement);
3180
- }
3181
- this.originalPlacements.delete(element);
3182
- }, { once: true });
3183
- });
3184
- cleanupAncestorResize();
3185
- cleanupElementResize();
3186
- if (visualViewport && isWebKit()) {
3187
- visualViewport.removeEventListener("resize", onVisualViewportChange);
3188
- visualViewport.removeEventListener("scroll", onVisualViewportChange);
3189
- if (visualViewportRafId) {
3190
- cancelAnimationFrame(visualViewportRafId);
3191
- visualViewportRafId = 0;
3192
- }
3193
- }
3194
- };
3195
- }
3196
- async computePlacement() {
3197
- var _a, _b;
3198
- const { options, target } = this;
3199
- const genAtStart = this.placementGeneration;
3200
- const placementStillValid = () => this.host.open && this.placementGeneration === genAtStart && !!this.target && this.target === target;
3201
- await (document.fonts ? document.fonts.ready : Promise.resolve());
3202
- if (!placementStillValid()) {
3203
- return;
3204
- }
3205
- if (isWebKit()) {
3206
- await new Promise((resolve) => requestAnimationFrame(resolve));
3207
- }
3208
- if (!placementStillValid()) {
3209
- return;
3210
- }
3211
- const flipMiddleware = !(options.trigger instanceof HTMLElement) ? flip2({
3212
- padding: REQUIRED_DISTANCE_TO_EDGE,
3213
- fallbackPlacements: getFallbackPlacements(options.placement)
3214
- }) : flip2();
3215
- const [mainAxis = 0, crossAxis = 0] = Array.isArray(options == null ? undefined : options.offset) ? options.offset : [options.offset, 0];
3216
- const tipElement = (_a = this.host.elements.find((el) => el.tipElement)) == null ? undefined : _a.tipElement;
3217
- const middleware = [
3218
- offset2({
3219
- mainAxis,
3220
- crossAxis
3221
- }),
3222
- shift2({ padding: REQUIRED_DISTANCE_TO_EDGE }),
3223
- flipMiddleware,
3224
- size2({
3225
- padding: REQUIRED_DISTANCE_TO_EDGE,
3226
- apply: ({ availableWidth, availableHeight, rects: { floating } }) => {
3227
- const maxHeight = Math.max(MIN_OVERLAY_HEIGHT, Math.floor(availableHeight));
3228
- const actualHeight = floating.height;
3229
- this.initialHeight = !this.isConstrained ? actualHeight : this.initialHeight || actualHeight;
3230
- this.isConstrained = actualHeight < this.initialHeight || maxHeight <= actualHeight;
3231
- const appliedHeight = this.isConstrained ? `${maxHeight}px` : "";
3232
- Object.assign(target.style, {
3233
- maxWidth: `${Math.floor(availableWidth)}px`,
3234
- maxHeight: appliedHeight
3235
- });
3236
- }
3237
- }),
3238
- ...tipElement ? [
3239
- arrow2({
3240
- element: tipElement,
3241
- padding: options.tipPadding || REQUIRED_DISTANCE_TO_EDGE
3242
- })
3243
- ] : []
3244
- ];
3245
- const { x, y, placement, middlewareData } = await computePosition2(options.trigger, target, {
3246
- placement: options.placement,
3247
- middleware,
3248
- strategy: "fixed"
3249
- });
3250
- if (!placementStillValid()) {
3251
- return;
3252
- }
3253
- let translateX = x;
3254
- let translateY = y;
3255
- const visualViewport = window.visualViewport;
3256
- if (visualViewport && isWebKit()) {
3257
- translateX -= visualViewport.offsetLeft;
3258
- translateY -= visualViewport.offsetTop;
3259
- }
3260
- if (!placementStillValid()) {
3261
- return;
3262
- }
3263
- Object.assign(target.style, {
3264
- top: "0px",
3265
- left: "0px",
3266
- translate: `${roundByDPR(translateX)}px ${roundByDPR(translateY)}px`
3267
- });
3268
- target.setAttribute("actual-placement", placement);
3269
- (_b = this.host.elements) == null || _b.forEach((element) => {
3270
- if (!this.originalPlacements.has(element)) {
3271
- this.originalPlacements.set(element, element.getAttribute("placement"));
3272
- }
3273
- element.setAttribute("placement", placement);
3274
- });
3275
- if (!placementStillValid()) {
3276
- return;
3277
- }
3278
- if (tipElement && middlewareData.arrow) {
3279
- const { x: arrowX, y: arrowY } = middlewareData.arrow;
3280
- Object.assign(tipElement.style, {
3281
- top: placement.startsWith("right") || placement.startsWith("left") ? "0px" : "",
3282
- left: placement.startsWith("bottom") || placement.startsWith("top") ? "0px" : "",
3283
- translate: `${roundByDPR(arrowX)}px ${roundByDPR(arrowY)}px`
3284
- });
3285
- }
3286
- }
3287
- clearOverlayPosition() {
3288
- if (!this.target) {
3289
- return;
3290
- }
3291
- this.target.style.removeProperty("max-height");
3292
- this.target.style.removeProperty("max-width");
3293
- this.initialHeight = undefined;
3294
- this.isConstrained = false;
3295
- }
3296
- hostConnected() {
3297
- document.addEventListener("sp-update-overlays", this.resetOverlayPosition);
3298
- }
3299
- hostUpdated() {
3300
- var _a;
3301
- if (!this.host.open) {
3302
- (_a = this.cleanup) == null || _a.call(this);
3303
- this.cleanup = undefined;
3304
- }
3305
- }
3306
- hostDisconnected() {
3307
- var _a;
3308
- (_a = this.cleanup) == null || _a.call(this);
3309
- this.cleanup = undefined;
3310
- document.removeEventListener("sp-update-overlays", this.resetOverlayPosition);
3311
- }
3312
- }
3313
-
3314
- // ../../node_modules/@spectrum-web-components/base/src/condition-attribute-with-id.dev.js
3315
- function conditionAttributeWithoutId(el, attribute, ids) {
3316
- const ariaDescribedby = el.getAttribute(attribute);
3317
- let descriptors = ariaDescribedby ? ariaDescribedby.split(/\s+/) : [];
3318
- descriptors = descriptors.filter((descriptor) => !ids.find((id) => descriptor === id));
3319
- if (descriptors.length) {
3320
- el.setAttribute(attribute, descriptors.join(" "));
3321
- } else {
3322
- el.removeAttribute(attribute);
3323
- }
3324
- }
3325
- function conditionAttributeWithId(el, attribute, id) {
3326
- const ids = Array.isArray(id) ? id : [id];
3327
- const ariaDescribedby = el.getAttribute(attribute);
3328
- const descriptors = ariaDescribedby ? ariaDescribedby.split(/\s+/) : [];
3329
- const hadIds = ids.every((id2) => descriptors.indexOf(id2) > -1);
3330
- if (hadIds) {
3331
- return () => {
3332
- return;
3333
- };
3334
- }
3335
- descriptors.push(...ids);
3336
- el.setAttribute(attribute, descriptors.join(" "));
3337
- return () => conditionAttributeWithoutId(el, attribute, ids);
3338
- }
3339
-
3340
- // ../../node_modules/@spectrum-web-components/overlay/src/InteractionController.dev.js
3341
- var InteractionTypes = /* @__PURE__ */ ((InteractionTypes2) => {
3342
- InteractionTypes2["click"] = "click";
3343
- InteractionTypes2["hover"] = "hover";
3344
- InteractionTypes2["longpress"] = "longpress";
3345
- return InteractionTypes2;
3346
- })(InteractionTypes || {});
3347
- var lastInteractionType = Symbol("lastInteractionType");
3348
-
3349
- class InteractionController {
3350
- constructor(target, { overlay, isPersistent, handleOverlayReady }) {
3351
- this.target = target;
3352
- this.isLazilyOpen = false;
3353
- this.isPersistent = false;
3354
- this.isPersistent = !!isPersistent;
3355
- this.handleOverlayReady = handleOverlayReady;
3356
- if (this.isPersistent) {
3357
- this.init();
3358
- }
3359
- this.overlay = overlay;
3360
- }
3361
- get activelyOpening() {
3362
- return false;
3363
- }
3364
- get open() {
3365
- var _a, _b;
3366
- return (_b = (_a = this.overlay) == null ? undefined : _a.open) != null ? _b : this.isLazilyOpen;
3367
- }
3368
- set open(open) {
3369
- if (open === this.open) {
3370
- return;
3371
- }
3372
- this.isLazilyOpen = open;
3373
- if (this.overlay) {
3374
- this.overlay.open = open;
3375
- this.target[lastInteractionType] = this.type;
3376
- return;
3377
- }
3378
- if (!open) {
3379
- return;
3380
- }
3381
- customElements.whenDefined("sp-overlay").then(async () => {
3382
- const { Overlay } = await import("./Overlay.dev-723bv0df.js");
3383
- this.overlay = new Overlay;
3384
- this.overlay.open = true;
3385
- this.target[lastInteractionType] = this.type;
3386
- });
3387
- import("./sp-overlay.dev-yztmtrs1.js");
3388
- }
3389
- get overlay() {
3390
- return this._overlay;
3391
- }
3392
- set overlay(overlay) {
3393
- var _a;
3394
- if (!overlay) {
3395
- return;
3396
- }
3397
- if (this._overlay === overlay) {
3398
- return;
3399
- }
3400
- if (this._overlay) {
3401
- this._overlay.removeController(this);
3402
- }
3403
- this._overlay = overlay;
3404
- overlay.addController(this);
3405
- this.initOverlay();
3406
- this.prepareDescription(this.target);
3407
- (_a = this.handleOverlayReady) == null || _a.call(this, overlay);
3408
- }
3409
- clearOverlay() {
3410
- if (this._overlay) {
3411
- this._overlay.removeController(this);
3412
- }
3413
- this._overlay = undefined;
3414
- }
3415
- prepareDescription(_) {}
3416
- releaseDescription() {}
3417
- shouldCompleteOpen() {}
3418
- init() {}
3419
- initOverlay() {}
3420
- abort() {
3421
- var _a;
3422
- this.releaseDescription();
3423
- (_a = this.abortController) == null || _a.abort();
3424
- }
3425
- hostConnected() {
3426
- this.init();
3427
- }
3428
- hostDisconnected() {
3429
- if (!this.isPersistent) {
3430
- this.abort();
3431
- }
3432
- }
3433
- }
3434
-
3435
- // ../../node_modules/@spectrum-web-components/overlay/src/LongpressController.dev.js
3436
- var LONGPRESS_DURATION = 300;
3437
- var LONGPRESS_INSTRUCTIONS = {
3438
- touch: "Double tap and long press for additional options",
3439
- keyboard: "Press Space or Alt+Down Arrow for additional options",
3440
- mouse: "Click and hold for additional options"
3441
- };
3442
-
3443
- class LongpressController extends InteractionController {
3444
- constructor() {
3445
- super(...arguments);
3446
- this.type = InteractionTypes.longpress;
3447
- this.longpressState = null;
3448
- this.releaseDescription = noop;
3449
- this.handlePointerup = () => {
3450
- var _a;
3451
- clearTimeout(this.timeout);
3452
- if (!this.target) {
3453
- return;
3454
- }
3455
- this.longpressState = ((_a = this.overlay) == null ? undefined : _a.state) === "opening" ? "pressed" : null;
3456
- document.removeEventListener("pointerup", this.handlePointerup);
3457
- document.removeEventListener("pointercancel", this.handlePointerup);
3458
- };
3459
- }
3460
- get activelyOpening() {
3461
- return this.longpressState === "opening" || this.longpressState === "pressed";
3462
- }
3463
- handleLongpress() {
3464
- this.open = true;
3465
- this.longpressState = this.longpressState === "potential" ? "opening" : "pressed";
3466
- }
3467
- handlePointerdown(event) {
3468
- if (!this.target) {
3469
- return;
3470
- }
3471
- if (event.button !== 0) {
3472
- return;
3473
- }
3474
- this.longpressState = "potential";
3475
- document.addEventListener("pointerup", this.handlePointerup);
3476
- document.addEventListener("pointercancel", this.handlePointerup);
3477
- const triggerHandlesLongpress = "holdAffordance" in this.target;
3478
- if (triggerHandlesLongpress) {
3479
- return;
3480
- }
3481
- this.timeout = setTimeout(() => {
3482
- if (!this.target) {
3483
- return;
3484
- }
3485
- this.target.dispatchEvent(new CustomEvent("longpress", {
3486
- bubbles: true,
3487
- composed: true,
3488
- detail: {
3489
- source: "pointer"
3490
- }
3491
- }));
3492
- }, LONGPRESS_DURATION);
3493
- }
3494
- handleKeydown(event) {
3495
- const { code, altKey } = event;
3496
- if (altKey && code === "ArrowDown") {
3497
- event.stopImmediatePropagation();
3498
- }
3499
- }
3500
- handleKeyup(event) {
3501
- const { code, altKey } = event;
3502
- if (code === "Space" || altKey && code === "ArrowDown") {
3503
- if (!this.target) {
3504
- return;
3505
- }
3506
- event.stopPropagation();
3507
- this.target.dispatchEvent(new CustomEvent("longpress", {
3508
- bubbles: true,
3509
- composed: true,
3510
- detail: {
3511
- source: "keyboard"
3512
- }
3513
- }));
3514
- setTimeout(() => {
3515
- this.longpressState = null;
3516
- });
3517
- }
3518
- }
3519
- prepareDescription(trigger) {
3520
- if (this.releaseDescription !== noop || !this.overlay || !this.overlay.elements.length) {
3521
- return;
3522
- }
3523
- const overlay = this.overlay;
3524
- if (overlay.describeTrigger === "none") {
3525
- return;
3526
- }
3527
- const longpressDescription = document.createElement("div");
3528
- longpressDescription.id = `longpress-describedby-descriptor-${randomID()}`;
3529
- const messageType = isIOS() || isAndroid() ? "touch" : "keyboard";
3530
- longpressDescription.textContent = LONGPRESS_INSTRUCTIONS[messageType];
3531
- longpressDescription.slot = "longpress-describedby-descriptor";
3532
- const triggerParent = trigger.getRootNode();
3533
- const overlayParent = this.overlay.getRootNode();
3534
- if (triggerParent === overlayParent) {
3535
- this.overlay.append(longpressDescription);
3536
- } else {
3537
- longpressDescription.hidden = !("host" in triggerParent);
3538
- trigger.insertAdjacentElement("afterend", longpressDescription);
3539
- }
3540
- const releaseDescription = conditionAttributeWithId(trigger, "aria-describedby", [longpressDescription.id]);
3541
- this.releaseDescription = () => {
3542
- releaseDescription();
3543
- longpressDescription.remove();
3544
- this.releaseDescription = noop;
3545
- };
3546
- }
3547
- shouldCompleteOpen() {
3548
- this.longpressState = this.longpressState === "pressed" ? null : this.longpressState;
3549
- }
3550
- init() {
3551
- var _a;
3552
- (_a = this.abortController) == null || _a.abort();
3553
- this.abortController = new AbortController;
3554
- const { signal } = this.abortController;
3555
- this.target.addEventListener("longpress", () => this.handleLongpress(), {
3556
- signal
3557
- });
3558
- this.target.addEventListener("pointerdown", (event) => this.handlePointerdown(event), { signal });
3559
- this.prepareDescription(this.target);
3560
- if (this.target.holdAffordance) {
3561
- return;
3562
- }
3563
- this.target.addEventListener("keydown", (event) => this.handleKeydown(event), { signal });
3564
- this.target.addEventListener("keyup", (event) => this.handleKeyup(event), { signal });
3565
- }
3566
- }
3567
- // ../../node_modules/@spectrum-web-components/overlay/src/overlay.css.js
3568
- var o = css`
3569
- :host{pointer-events:none;--swc-overlay-animation-distance:var(--spectrum-spacing-100);display:contents}:host(:has(>sp-tooltip)){--swc-overlay-animation-distance:var(--spectrum-tooltip-animation-distance)}.dialog{box-sizing:border-box;--sp-overlay-open:true;background:0 0;border:0;max-width:calc(100vw - 16px);height:auto;max-height:calc(100dvh - 16px);margin:0;padding:0;display:flex;position:fixed;inset:0 auto auto 0;overflow:visible;opacity:1!important}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--mod-popover-filter:var(--spectrum-popover-filter)}:host(:not([open])) .dialog{--sp-overlay-open:false}.dialog::backdrop{display:none}.dialog:before{content:"";position:absolute;inset:-999em;pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(sp-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--swc-overlay-animation-distance);margin-top:var(--swc-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--swc-overlay-animation-distance);margin-left:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--swc-overlay-animation-distance);margin-top:calc(-1*var(--swc-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--swc-overlay-animation-distance);margin-left:var(--swc-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}.modal-backdrop{z-index:999998;pointer-events:auto;background:0 0;position:fixed;inset:0}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--mod-popover-filter:var(--spectrum-popover-filter)}}@supports (overlay:auto){.dialog{transition:all var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s)),translate 0s,display var(--mod-overlay-animation-duration,var(--spectrum-animation-duration-100,.13s));transition-behavior:allow-discrete;display:none}.dialog:popover-open{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--swc-overlay-z-index-base,1000) + var(--swc-overlay-open-count))}}
3570
- `;
3571
- var overlay_css_default = o;
3572
-
3573
- // ../../node_modules/@spectrum-web-components/overlay/src/slottable-request-event.dev.js
3574
- class SlottableRequestEvent extends Event {
3575
- constructor(name, data, key) {
3576
- var _a;
3577
- super("slottable-request", {
3578
- bubbles: false,
3579
- cancelable: true,
3580
- composed: false
3581
- });
3582
- this.name = name;
3583
- this.data = data;
3584
- this.slotName = key !== undefined ? `${name}.${key}` : name;
3585
- if ((_a = window.__swc) == null ? undefined : _a.warn) {
3586
- window.__swc.warn(undefined, `⚠️ WARNING ⚠️ : \`slottable-request\` events are experimental and there is no guarantees behind usage of them in an application!! Their shape and presence within the library could be changed at anytime.
3587
-
3588
- Learn more about the protocol these events are based on below:`, "https://github.com/webcomponents-cg/community-protocols/pull/45", {
3589
- level: "high",
3590
- type: "api"
3591
- });
3592
- }
3593
- }
3594
- }
3595
- var removeSlottableRequest = Symbol("remove-slottable-request");
3596
-
3597
- // ../../node_modules/@spectrum-web-components/overlay/src/ClickController.dev.js
3598
- class ClickController extends InteractionController {
3599
- constructor() {
3600
- super(...arguments);
3601
- this.type = InteractionTypes.click;
3602
- this.preventNextToggle = false;
3603
- }
3604
- handleClick() {
3605
- if (!this.preventNextToggle) {
3606
- this.open = !this.open;
3607
- }
3608
- this.preventNextToggle = false;
3609
- }
3610
- handlePointerdown() {
3611
- this.preventNextToggle = this.open;
3612
- }
3613
- init() {
3614
- var _a;
3615
- (_a = this.abortController) == null || _a.abort();
3616
- this.abortController = new AbortController;
3617
- const { signal } = this.abortController;
3618
- this.target.addEventListener("click", () => this.handleClick(), {
3619
- signal
3620
- });
3621
- this.target.addEventListener("pointerdown", () => this.handlePointerdown(), { signal });
3622
- }
3623
- }
3624
-
3625
- // ../../node_modules/@spectrum-web-components/overlay/src/HoverController.dev.js
3626
- class HoverController extends InteractionController {
3627
- constructor() {
3628
- super(...arguments);
3629
- this.type = InteractionTypes.hover;
3630
- this.elementIds = [];
3631
- this.targetFocused = false;
3632
- this.hovering = false;
3633
- this.overlayFocused = false;
3634
- }
3635
- handleKeyup(event) {
3636
- if (event.code === "Tab") {
3637
- this.open = true;
3638
- } else if (event.code === "Escape") {
3639
- if (this.open) {
3640
- event.preventDefault();
3641
- event.stopPropagation();
3642
- this.open = false;
3643
- if (this.target) {
3644
- this.target.focus();
3645
- }
3646
- }
3647
- }
3648
- }
3649
- handleTargetFocusin() {
3650
- if (!this.target.matches(":focus-visible")) {
3651
- return;
3652
- }
3653
- if (this.target[lastInteractionType] === InteractionTypes.click) {
3654
- return;
3655
- }
3656
- this.open = true;
3657
- this.targetFocused = true;
3658
- }
3659
- handleTargetFocusout() {
3660
- this.targetFocused = false;
3661
- if (this.hovering) {
3662
- return;
3663
- }
3664
- this.doFocusleave();
3665
- }
3666
- clearCloseTimeout() {
3667
- if (this.hoverTimeout) {
3668
- clearTimeout(this.hoverTimeout);
3669
- this.hoverTimeout = undefined;
3670
- }
3671
- }
3672
- handleTargetPointerenter() {
3673
- var _a;
3674
- this.clearCloseTimeout();
3675
- if ((_a = this.overlay) == null ? undefined : _a.disabled) {
3676
- return;
3677
- }
3678
- this.open = true;
3679
- this.hovering = true;
3680
- }
3681
- handleTargetPointerleave() {
3682
- this.doPointerleave();
3683
- }
3684
- handleHostPointerenter() {
3685
- this.clearCloseTimeout();
3686
- }
3687
- handleHostPointerleave() {
3688
- this.doPointerleave();
3689
- }
3690
- handleOverlayFocusin() {
3691
- this.overlayFocused = true;
3692
- this.clearCloseTimeout();
3693
- }
3694
- handleOverlayFocusout() {
3695
- this.overlayFocused = false;
3696
- if (this.hovering) {
3697
- return;
3698
- }
3699
- if (this.targetFocused && this.target.matches(":focus-visible")) {
3700
- return;
3701
- }
3702
- this.doFocusleave();
3703
- }
3704
- prepareDescription() {
3705
- if (!this.overlay || !this.overlay.elements.length) {
3706
- return;
3707
- }
3708
- const overlay = this.overlay;
3709
- if (overlay.describeTrigger === "none") {
3710
- return;
3711
- }
3712
- const triggerRoot = this.target.getRootNode();
3713
- const contentRoot = this.overlay.elements[0].getRootNode();
3714
- const overlayRoot = this.overlay.getRootNode();
3715
- if (triggerRoot === overlayRoot) {
3716
- this.prepareOverlayRelativeDescription();
3717
- } else if (triggerRoot === contentRoot) {
3718
- this.prepareContentRelativeDescription();
3719
- }
3720
- }
3721
- prepareOverlayRelativeDescription() {
3722
- if (!this.overlay) {
3723
- return;
3724
- }
3725
- const releaseDescription = conditionAttributeWithId(this.target, "aria-describedby", [this.overlay.id]);
3726
- this.releaseDescription = () => {
3727
- releaseDescription();
3728
- this.releaseDescription = noop;
3729
- };
3730
- }
3731
- prepareContentRelativeDescription() {
3732
- if (!this.overlay) {
3733
- return;
3734
- }
3735
- const overlay = this.overlay;
3736
- const elementIds = [];
3737
- const appliedIds = overlay.elements.map((el) => {
3738
- elementIds.push(el.id);
3739
- if (!el.id) {
3740
- el.id = `${overlay.tagName.toLowerCase()}-helper-${randomID()}`;
3741
- }
3742
- return el.id;
3743
- });
3744
- this.elementIds = elementIds;
3745
- const releaseDescription = conditionAttributeWithId(this.target, "aria-describedby", appliedIds);
3746
- this.releaseDescription = () => {
3747
- releaseDescription();
3748
- overlay.elements.map((el, index) => {
3749
- el.id = this.elementIds[index];
3750
- });
3751
- this.releaseDescription = noop;
3752
- };
3753
- }
3754
- scheduleClose() {
3755
- this.hoverTimeout = setTimeout(() => {
3756
- this.open = false;
3757
- }, 300);
3758
- }
3759
- doPointerleave() {
3760
- this.hovering = false;
3761
- const triggerElement = this.target;
3762
- if (this.targetFocused && triggerElement.matches(":focus-visible")) {
3763
- return;
3764
- }
3765
- if (this.overlayFocused) {
3766
- return;
3767
- }
3768
- this.scheduleClose();
3769
- }
3770
- doFocusleave() {
3771
- this.clearCloseTimeout();
3772
- if (!this.targetFocused && !this.overlayFocused && !this.hovering) {
3773
- this.scheduleClose();
3774
- }
3775
- }
3776
- init() {
3777
- var _a;
3778
- (_a = this.abortController) == null || _a.abort();
3779
- this.abortController = new AbortController;
3780
- const { signal } = this.abortController;
3781
- this.target.addEventListener("keyup", (event) => this.handleKeyup(event), {
3782
- signal
3783
- });
3784
- this.target.addEventListener("focusin", () => this.handleTargetFocusin(), {
3785
- signal
3786
- });
3787
- this.target.addEventListener("focusout", () => this.handleTargetFocusout(), { signal });
3788
- this.target.addEventListener("pointerenter", () => this.handleTargetPointerenter(), { signal });
3789
- this.target.addEventListener("pointerleave", () => this.handleTargetPointerleave(), { signal });
3790
- if (this.overlay) {
3791
- this.initOverlay();
3792
- }
3793
- }
3794
- initOverlay() {
3795
- if (!this.abortController || !this.overlay) {
3796
- return;
3797
- }
3798
- const { signal } = this.abortController;
3799
- this.overlay.addEventListener("pointerenter", () => this.handleHostPointerenter(), { signal });
3800
- this.overlay.addEventListener("pointerleave", () => this.handleHostPointerleave(), { signal });
3801
- this.overlay.addEventListener("focusin", () => this.handleOverlayFocusin(), { signal });
3802
- this.overlay.addEventListener("focusout", () => this.handleOverlayFocusout(), { signal });
3803
- this.overlay.addEventListener("keyup", (event) => this.handleKeyup(event), {
3804
- signal
3805
- });
3806
- }
3807
- }
3808
-
3809
- // ../../node_modules/@spectrum-web-components/overlay/src/strategies.dev.js
3810
- var strategies = {
3811
- click: ClickController,
3812
- longpress: LongpressController,
3813
- hover: HoverController
3814
- };
3815
-
3816
- // ../../node_modules/@spectrum-web-components/overlay/src/Overlay.dev.js
3817
- var __defProp4 = Object.defineProperty;
3818
- var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
3819
- var __decorateClass4 = (decorators, target, key, kind) => {
3820
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc4(target, key) : target;
3821
- for (var i = decorators.length - 1, decorator;i >= 0; i--)
3822
- if (decorator = decorators[i])
3823
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3824
- if (kind && result)
3825
- __defProp4(target, key, result);
3826
- return result;
3827
- };
3828
- var browserSupportsPopover = "showPopover" in document.createElement("div");
3829
- var ComputedOverlayBase = OverlayPopover(AbstractOverlay);
3830
- if (!browserSupportsPopover) {
3831
- ComputedOverlayBase = OverlayNoPopover(AbstractOverlay);
3832
- }
3833
- var _Overlay = class _Overlay2 extends ComputedOverlayBase {
3834
- constructor() {
3835
- super(...arguments);
3836
- this._delayed = false;
3837
- this._disabled = false;
3838
- this.offset = 0;
3839
- this._open = false;
3840
- this.lastRequestSlottableState = false;
3841
- this.receivesFocus = "auto";
3842
- this.allowOutsideClick = false;
3843
- this._state = "closed";
3844
- this.triggerElement = null;
3845
- this.describeTrigger = "auto";
3846
- this.type = "auto";
3847
- this.wasOpen = false;
3848
- this._focusTrap = null;
3849
- this.closeOnFocusOut = (event) => {
3850
- if (!event.relatedTarget) {
3851
- return;
3852
- }
3853
- const relationEvent = new Event("overlay-relation-query", {
3854
- bubbles: true,
3855
- composed: true
3856
- });
3857
- event.relatedTarget.addEventListener(relationEvent.type, (event2) => {
3858
- const path = event2.composedPath();
3859
- const isWithinOverlay = path.some((el) => el === this);
3860
- if (!isWithinOverlay) {
3861
- this.open = false;
3862
- }
3863
- });
3864
- event.relatedTarget.dispatchEvent(relationEvent);
3865
- };
3866
- this.closeOnCancelEvent = () => {
3867
- this.open = false;
3868
- };
3869
- }
3870
- get delayed() {
3871
- const lastElement = this.elements[this.elements.length - 1];
3872
- return (lastElement == null ? undefined : lastElement.hasAttribute("delayed")) || this._delayed;
3873
- }
3874
- set delayed(delayed) {
3875
- this._delayed = delayed;
3876
- }
3877
- get disabled() {
3878
- return this._disabled;
3879
- }
3880
- set disabled(disabled) {
3881
- var _a;
3882
- this._disabled = disabled;
3883
- if (disabled) {
3884
- (_a = this.strategy) == null || _a.abort();
3885
- this.wasOpen = this.open;
3886
- this.open = false;
3887
- } else {
3888
- this.bindEvents();
3889
- this.open = this.open || this.wasOpen;
3890
- this.wasOpen = false;
3891
- }
3892
- }
3893
- get hasNonVirtualTrigger() {
3894
- return !!this.triggerElement && !(this.triggerElement instanceof VirtualTrigger);
3895
- }
3896
- get placementController() {
3897
- if (!this._placementController) {
3898
- this._placementController = new PlacementController(this);
3899
- }
3900
- return this._placementController;
3901
- }
3902
- get open() {
3903
- return this._open;
3904
- }
3905
- set open(open) {
3906
- var _a;
3907
- if (open && this.disabled) {
3908
- return;
3909
- }
3910
- if (open === this.open) {
3911
- return;
3912
- }
3913
- if (((_a = this.strategy) == null ? undefined : _a.activelyOpening) && !open) {
3914
- return;
3915
- }
3916
- this._open = open;
3917
- if (this.open) {
3918
- _Overlay2.openCount += 1;
3919
- }
3920
- this.requestUpdate("open", !this.open);
3921
- if (this.open) {
3922
- this.requestSlottable();
3923
- }
3924
- }
3925
- get state() {
3926
- return this._state;
3927
- }
3928
- set state(state2) {
3929
- var _a;
3930
- if (state2 === this.state) {
3931
- return;
3932
- }
3933
- const oldState = this.state;
3934
- this._state = state2;
3935
- if (this.state === "opened" || this.state === "closed") {
3936
- (_a = this.strategy) == null || _a.shouldCompleteOpen();
3937
- }
3938
- this.requestUpdate("state", oldState);
3939
- }
3940
- get elementResolver() {
3941
- if (!this._elementResolver) {
3942
- this._elementResolver = new ElementResolutionController(this);
3943
- }
3944
- return this._elementResolver;
3945
- }
3946
- get popoverValue() {
3947
- const hasPopoverAttribute = "popover" in this;
3948
- if (!hasPopoverAttribute) {
3949
- return;
3950
- }
3951
- switch (this.type) {
3952
- case "modal":
3953
- return "manual";
3954
- case "page":
3955
- return "manual";
3956
- case "hint":
3957
- return "manual";
3958
- default:
3959
- return this.type;
3960
- }
3961
- }
3962
- get requiresPositioning() {
3963
- if (this.type === "page" || !this.open) {
3964
- return false;
3965
- }
3966
- if (!this.triggerElement || !this.placement && this.type !== "hint") {
3967
- return false;
3968
- }
3969
- return true;
3970
- }
3971
- get needsModalBackdrop() {
3972
- return this.open && (this.type === "modal" || this.type === "page");
3973
- }
3974
- managePosition() {
3975
- if (!this.requiresPositioning || !this.open) {
3976
- return;
3977
- }
3978
- const offset3 = this.offset || 0;
3979
- const trigger = this.triggerElement;
3980
- const placement = this.placement || "right";
3981
- const tipPadding = this.tipPadding;
3982
- this.placementController.placeOverlay(this.dialogEl, {
3983
- offset: offset3,
3984
- placement,
3985
- tipPadding,
3986
- trigger,
3987
- type: this.type
3988
- });
3989
- }
3990
- async managePopoverOpen() {
3991
- super.managePopoverOpen();
3992
- const targetOpenState = this.open;
3993
- if (this.open !== targetOpenState) {
3994
- return;
3995
- }
3996
- await this.manageDelay(targetOpenState);
3997
- if (this.open !== targetOpenState) {
3998
- return;
3999
- }
4000
- if (this.triggerInteraction === "longpress") {
4001
- await nextFrame();
4002
- }
4003
- await this.ensureOnDOM(targetOpenState);
4004
- if (this.open !== targetOpenState) {
4005
- return;
4006
- }
4007
- const focusEl = await this.makeTransition(targetOpenState);
4008
- if (this.open !== targetOpenState) {
4009
- return;
4010
- }
4011
- if (targetOpenState) {
4012
- const focusTrap = await import("./focus-trap.esm-ggawf1hy.js");
4013
- const initialFocus = this.receivesFocus === "false" ? false : focusEl || undefined;
4014
- this._focusTrap = focusTrap.createFocusTrap(this.dialogEl, {
4015
- initialFocus,
4016
- tabbableOptions: {
4017
- getShadowRoot: true
4018
- },
4019
- fallbackFocus: () => {
4020
- this.dialogEl.setAttribute("tabIndex", "-1");
4021
- return this.dialogEl;
4022
- },
4023
- escapeDeactivates: false,
4024
- allowOutsideClick: this.allowOutsideClick
4025
- });
4026
- if (this.type === "modal" || this.type === "page") {
4027
- this._focusTrap.activate();
4028
- }
4029
- }
4030
- await this.applyFocus(targetOpenState, focusEl);
4031
- }
4032
- async applyFocus(targetOpenState, focusEl) {
4033
- if (this.receivesFocus === "false" || this.type === "hint") {
4034
- return;
4035
- }
4036
- await nextFrame();
4037
- await nextFrame();
4038
- if (targetOpenState === this.open && !this.open) {
4039
- if (this.hasNonVirtualTrigger && this.contains(this.getRootNode().activeElement)) {
4040
- this.triggerElement.focus();
4041
- }
4042
- return;
4043
- }
4044
- focusEl == null || focusEl.focus();
4045
- }
4046
- returnFocus() {
4047
- var _a;
4048
- if (this.open || this.type === "hint") {
4049
- return;
4050
- }
4051
- const getAncestors = () => {
4052
- var _a2, _b;
4053
- const ancestors = [];
4054
- let currentNode = document.activeElement;
4055
- while ((_a2 = currentNode == null ? undefined : currentNode.shadowRoot) == null ? undefined : _a2.activeElement) {
4056
- currentNode = currentNode.shadowRoot.activeElement;
4057
- }
4058
- while (currentNode) {
4059
- const ancestor = currentNode.assignedSlot || currentNode.parentElement || ((_b = currentNode.getRootNode()) == null ? undefined : _b.host);
4060
- if (ancestor) {
4061
- ancestors.push(ancestor);
4062
- }
4063
- currentNode = ancestor;
4064
- }
4065
- return ancestors;
4066
- };
4067
- if (this.receivesFocus !== "false" && !!((_a = this.triggerElement) == null ? undefined : _a.focus) && (this.contains(this.getRootNode().activeElement) || getAncestors().includes(this) || document.activeElement === document.body)) {
4068
- this.triggerElement.focus();
4069
- }
4070
- }
4071
- async manageOpen(oldOpen) {
4072
- var _a;
4073
- if (!this.isConnected && this.open) {
4074
- return;
4075
- }
4076
- if (!this.hasUpdated) {
4077
- await this.updateComplete;
4078
- }
4079
- if (this.open) {
4080
- overlayStack.add(this);
4081
- if (this.willPreventClose) {
4082
- document.addEventListener("pointerup", () => {
4083
- this.dialogEl.classList.toggle("not-immediately-closable", false);
4084
- this.willPreventClose = false;
4085
- }, { once: true });
4086
- this.dialogEl.classList.toggle("not-immediately-closable", true);
4087
- }
4088
- } else {
4089
- if (oldOpen) {
4090
- (_a = this._focusTrap) == null || _a.deactivate();
4091
- this._focusTrap = null;
4092
- this.dispose();
4093
- }
4094
- overlayStack.remove(this);
4095
- }
4096
- if (this.open && this.state !== "opened") {
4097
- this.state = "opening";
4098
- } else if (!this.open && this.state !== "closed") {
4099
- this.state = "closing";
4100
- }
4101
- this.managePopoverOpen();
4102
- const listenerRoot = this.getRootNode();
4103
- if (this.type === "auto") {
4104
- if (this.open) {
4105
- listenerRoot.addEventListener("focusout", this.closeOnFocusOut, {
4106
- capture: true
4107
- });
4108
- } else {
4109
- listenerRoot.removeEventListener("focusout", this.closeOnFocusOut, {
4110
- capture: true
4111
- });
4112
- }
4113
- }
4114
- if (this.type === "modal" || this.type === "page") {
4115
- if (this.open) {
4116
- listenerRoot.addEventListener("cancel", this.closeOnCancelEvent, {
4117
- capture: true
4118
- });
4119
- } else {
4120
- listenerRoot.removeEventListener("cancel", this.closeOnCancelEvent, {
4121
- capture: true
4122
- });
4123
- }
4124
- }
4125
- }
4126
- bindEvents() {
4127
- var _a;
4128
- (_a = this.strategy) == null || _a.abort();
4129
- this.strategy = undefined;
4130
- if (!this.hasNonVirtualTrigger) {
4131
- return;
4132
- }
4133
- if (!this.triggerInteraction) {
4134
- return;
4135
- }
4136
- this.strategy = new strategies[this.triggerInteraction](this.triggerElement, {
4137
- overlay: this
4138
- });
4139
- }
4140
- handleBeforetoggle(event) {
4141
- if (event.newState !== "open") {
4142
- this.handleBrowserClose(event);
4143
- }
4144
- }
4145
- handleBrowserClose(event) {
4146
- var _a;
4147
- event.stopPropagation();
4148
- if (!((_a = this.strategy) == null ? undefined : _a.activelyOpening)) {
4149
- this.open = false;
4150
- return;
4151
- }
4152
- this.manuallyKeepOpen();
4153
- }
4154
- manuallyKeepOpen() {
4155
- this.open = true;
4156
- this.placementController.allowPlacementUpdate = true;
4157
- this.manageOpen(false);
4158
- }
4159
- handleSlotchange() {
4160
- var _a, _b;
4161
- if (!this.elements.length) {
4162
- (_a = this.strategy) == null || _a.releaseDescription();
4163
- } else if (this.hasNonVirtualTrigger) {
4164
- (_b = this.strategy) == null || _b.prepareDescription(this.triggerElement);
4165
- }
4166
- }
4167
- handleClose() {
4168
- this.open = false;
4169
- }
4170
- shouldPreventClose() {
4171
- const shouldPreventClose = this.willPreventClose;
4172
- this.willPreventClose = false;
4173
- return shouldPreventClose;
4174
- }
4175
- requestSlottable() {
4176
- if (this.lastRequestSlottableState === this.open) {
4177
- return;
4178
- }
4179
- if (!this.open) {
4180
- document.body.offsetHeight;
4181
- }
4182
- this.dispatchEvent(new SlottableRequestEvent("overlay-content", this.open ? {} : removeSlottableRequest));
4183
- this.lastRequestSlottableState = this.open;
4184
- }
4185
- willUpdate(changes) {
4186
- var _a;
4187
- if (!this.hasAttribute("id")) {
4188
- this.setAttribute("id", `${this.tagName.toLowerCase()}-${randomID()}`);
4189
- }
4190
- if (changes.has("allowOutsideClick") && this.allowOutsideClick) {
4191
- if (true) {
4192
- window.__swc.warn(this, `The "allow-outside-click" attribute on <${this.localName}> has been deprecated and will be removed in a future release. We do not recommend using this attribute for accessibility reasons. It allows clicks outside the overlay to close it, which can cause unexpected behavior and accessibility issues.`, "https://opensource.adobe.com/spectrum-web-components/components/overlay/", { level: "deprecation" });
4193
- }
4194
- }
4195
- if (changes.has("open") && (this.hasUpdated || this.open)) {
4196
- this.manageOpen(changes.get("open"));
4197
- }
4198
- if (changes.has("trigger")) {
4199
- const [id, interaction] = ((_a = this.trigger) == null ? undefined : _a.split("@")) || [];
4200
- this.elementResolver.selector = id ? `#${id}` : "";
4201
- this.triggerInteraction = interaction;
4202
- }
4203
- let oldTrigger = false;
4204
- if (changes.has(elementResolverUpdatedSymbol)) {
4205
- oldTrigger = this.triggerElement;
4206
- this.triggerElement = this.elementResolver.element;
4207
- }
4208
- if (changes.has("triggerElement")) {
4209
- oldTrigger = changes.get("triggerElement");
4210
- }
4211
- if (oldTrigger !== false) {
4212
- this.bindEvents();
4213
- }
4214
- }
4215
- updated(changes) {
4216
- super.updated(changes);
4217
- if (changes.has("placement")) {
4218
- if (this.placement) {
4219
- this.dialogEl.setAttribute("actual-placement", this.placement);
4220
- } else {
4221
- this.dialogEl.removeAttribute("actual-placement");
4222
- }
4223
- if (this.open && typeof changes.get("placement") !== "undefined") {
4224
- this.placementController.resetOverlayPosition();
4225
- }
4226
- }
4227
- if (changes.has("state") && this.state === "closed" && typeof changes.get("state") !== "undefined") {
4228
- this.placementController.clearOverlayPosition();
4229
- }
4230
- }
4231
- renderContent() {
4232
- return html`
4233
- <slot @slotchange=${this.handleSlotchange}></slot>
4234
- `;
4235
- }
4236
- get dialogStyleMap() {
4237
- return {
4238
- "--swc-overlay-open-count": _Overlay2.openCount.toString()
4239
- };
4240
- }
4241
- renderPopover() {
4242
- return html`
4243
- ${this.needsModalBackdrop ? html`
4244
- <div class="modal-backdrop"></div>
4245
- ` : nothing}
4246
- <div
4247
- class="dialog"
4248
- part="dialog"
4249
- role=${ifDefined(this.type === "modal" || this.type === "page" ? "dialog" : undefined)}
4250
- aria-modal=${ifDefined(this.type === "modal" || this.type === "page" ? "true" : undefined)}
4251
- placement=${ifDefined(this.requiresPositioning ? this.placement || "right" : undefined)}
4252
- popover=${ifDefined(this.popoverValue)}
4253
- style=${styleMap(this.dialogStyleMap)}
4254
- @beforetoggle=${this.handleBeforetoggle}
4255
- @close=${this.handleBrowserClose}
4256
- ?is-visible=${this.state !== "closed"}
4257
- >
4258
- ${this.renderContent()}
4259
- </div>
4260
- `;
4261
- }
4262
- render() {
4263
- return html`
4264
- ${this.renderPopover()}
4265
- <slot name="longpress-describedby-descriptor"></slot>
4266
- `;
4267
- }
4268
- connectedCallback() {
4269
- super.connectedCallback();
4270
- this.addEventListener("close", this.handleClose);
4271
- if (this.hasUpdated) {
4272
- this.bindEvents();
4273
- }
4274
- }
4275
- disconnectedCallback() {
4276
- var _a;
4277
- (_a = this.strategy) == null || _a.releaseDescription();
4278
- this.open = false;
4279
- this.removeEventListener("close", this.handleClose);
4280
- super.disconnectedCallback();
4281
- }
4282
- };
4283
- _Overlay.styles = [overlay_css_default];
4284
- _Overlay.openCount = 1;
4285
- __decorateClass4([
4286
- property({ type: Boolean })
4287
- ], _Overlay.prototype, "delayed", 1);
4288
- __decorateClass4([
4289
- query(".dialog")
4290
- ], _Overlay.prototype, "dialogEl", 2);
4291
- __decorateClass4([
4292
- property({ type: Boolean })
4293
- ], _Overlay.prototype, "disabled", 1);
4294
- __decorateClass4([
4295
- queryAssignedElements({
4296
- flatten: true,
4297
- selector: ':not([slot="longpress-describedby-descriptor"], slot)'
4298
- })
4299
- ], _Overlay.prototype, "elements", 2);
4300
- __decorateClass4([
4301
- property({ type: Number })
4302
- ], _Overlay.prototype, "offset", 2);
4303
- __decorateClass4([
4304
- property({ type: Boolean, reflect: true })
4305
- ], _Overlay.prototype, "open", 1);
4306
- __decorateClass4([
4307
- property()
4308
- ], _Overlay.prototype, "placement", 2);
4309
- __decorateClass4([
4310
- property({ attribute: "receives-focus" })
4311
- ], _Overlay.prototype, "receivesFocus", 2);
4312
- __decorateClass4([
4313
- property({ type: Boolean, attribute: "allow-outside-click" })
4314
- ], _Overlay.prototype, "allowOutsideClick", 2);
4315
- __decorateClass4([
4316
- query("slot")
4317
- ], _Overlay.prototype, "slotEl", 2);
4318
- __decorateClass4([
4319
- state()
4320
- ], _Overlay.prototype, "state", 1);
4321
- __decorateClass4([
4322
- property({ type: Number, attribute: "tip-padding" })
4323
- ], _Overlay.prototype, "tipPadding", 2);
4324
- __decorateClass4([
4325
- property()
4326
- ], _Overlay.prototype, "trigger", 2);
4327
- __decorateClass4([
4328
- property({ attribute: false })
4329
- ], _Overlay.prototype, "triggerElement", 2);
4330
- __decorateClass4([
4331
- property({ attribute: false })
4332
- ], _Overlay.prototype, "triggerInteraction", 2);
4333
- __decorateClass4([
4334
- property({ attribute: false })
4335
- ], _Overlay.prototype, "describeTrigger", 2);
4336
- __decorateClass4([
4337
- property()
4338
- ], _Overlay.prototype, "type", 2);
4339
- var Overlay = _Overlay;
4340
-
4341
- export { FocusVisiblePolyfillMixin, Focusable, LikeAnchor, MutationController, ObserveSlotPresence, ObserveSlotText, isIPhone, isIOS, isWebKit, isAndroid, randomID, conditionAttributeWithoutId, conditionAttributeWithId, elementResolverUpdatedSymbol, ElementResolutionController, LONGPRESS_INSTRUCTIONS, SlottableRequestEvent, Overlay };
4342
-
4343
- //# debugId=B4C0094FFD6AEF9A64756E2164756E21
4344
- //# sourceMappingURL=studio-mmv72a27.js.map