@jxsuite/studio 4.1.0 → 5.1.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 (612) 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-n6tfwnda.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-qwkm9zrf.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-vj72gqtq.js +20 -0
  15. package/dist/chunks/content-source-5mex4x1h.js +46 -0
  16. package/dist/chunks/convert-to-repeater-n64h8znc.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-234hjnqw.js +42 -0
  20. package/dist/chunks/extension-sections-3hpcambp.js +651 -0
  21. package/dist/chunks/file-ops-8yhd83xr.js +47 -0
  22. package/dist/chunks/files-hnxqxtsg.js +72 -0
  23. package/dist/chunks/format-host-779sfp2n.js +40 -0
  24. package/dist/chunks/fs-events-b88z7g4h.js +18 -0
  25. package/dist/chunks/git-panel-xwj8fpab.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-syr0f9sb.js +115 -0
  31. package/dist/chunks/{index-wcnt3r9g.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-ff81wthn.js +30 -0
  37. package/dist/chunks/layers-panel-pnnghw12.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-cqhhxhhe.js +33 -0
  41. package/dist/chunks/menu-9p2w46gj.js +15 -0
  42. package/dist/chunks/menu-q99sy9rf.js +285 -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-vx9bhp1d.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-5zt840sy.js +27 -0
  52. package/dist/chunks/quick-search-3748564r.js +45 -0
  53. package/dist/chunks/references-qvvxej7h.js +26 -0
  54. package/dist/chunks/right-panel-eccz92qt.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-kryvsw6j.js → studio-1k325pwf.js} +48 -48
  60. package/dist/chunks/{studio-b55y6ewx.js → studio-1knfqgy7.js} +58 -58
  61. package/dist/chunks/{studio-2b946z26.js → studio-1z1kcjv4.js} +3628 -6095
  62. package/dist/chunks/studio-3773086z.js +111 -0
  63. package/dist/chunks/{studio-4r1pv6zf.js → studio-38emantv.js} +22 -5
  64. package/dist/chunks/{studio-x813zp48.js → studio-3rz5md06.js} +30 -30
  65. package/dist/chunks/{studio-ynxwkrzd.js → studio-4wbb9ct0.js} +1953 -1785
  66. package/dist/chunks/studio-5te5tqng.js +81 -0
  67. package/dist/chunks/studio-5wt9nvhd.js +4763 -0
  68. package/dist/chunks/{studio-p4ngc046.js → studio-6ewqv390.js} +9 -9
  69. package/dist/chunks/{studio-9ab8gqsm.js → studio-6nzaktvy.js} +7 -7
  70. package/dist/chunks/studio-6xa21ej9.js +28 -0
  71. package/dist/chunks/{studio-5ehhackm.js → studio-727xh0e3.js} +19 -19
  72. package/dist/chunks/{studio-gcye7qka.js → studio-7e11jpa9.js} +21 -21
  73. package/dist/chunks/{studio-q7v10cg2.js → studio-7r42c6ca.js} +17 -7
  74. package/dist/chunks/studio-7xnmgv66.js +13615 -0
  75. package/dist/chunks/studio-8scdew0e.js +258 -0
  76. package/dist/chunks/{studio-fbf92ckf.js → studio-93zafjcm.js} +275 -163
  77. package/dist/chunks/{studio-dg7zyt5x.js → studio-98b3z07n.js} +1 -1
  78. package/dist/chunks/studio-a79k90n9.js +1162 -0
  79. package/dist/chunks/studio-aj37eer3.js +422 -0
  80. package/dist/chunks/studio-b0k5tqgp.js +2432 -0
  81. package/dist/chunks/studio-b4s9eykd.js +2811 -0
  82. package/dist/chunks/{studio-f3wqjtk5.js → studio-d0300636.js} +5076 -18
  83. package/dist/chunks/{studio-b9b6t1dg.js → studio-e1f24eff.js} +5664 -5666
  84. package/dist/chunks/studio-e1pgga3k.js +839 -0
  85. package/dist/chunks/{studio-g1wdche0.js → studio-esrxgwh6.js} +80 -80
  86. package/dist/chunks/{studio-q43a5y9h.js → studio-g3jevyjt.js} +16 -16
  87. package/dist/chunks/studio-gb13095a.js +2806 -0
  88. package/dist/chunks/{studio-3n4ndrzh.js → studio-h4nvnjvz.js} +303 -303
  89. package/dist/chunks/{studio-dm19q43r.js → studio-hhvs4sdg.js} +10 -10
  90. package/dist/chunks/{studio-x4qkdat5.js → studio-js8nv53n.js} +1749 -2481
  91. package/dist/chunks/{studio-qjy2z9bv.js → studio-jxp12rnj.js} +32 -137
  92. package/dist/chunks/{studio-trxrabqf.js → studio-k75n7vhp.js} +527 -283
  93. package/dist/chunks/{studio-q9jd1a60.js → studio-kcgff4r0.js} +15 -18
  94. package/dist/chunks/studio-kkqkcp3d.js +17668 -0
  95. package/dist/chunks/studio-mhhyamxf.js +763 -0
  96. package/dist/chunks/{studio-cft9r4r7.js → studio-nq5yf5mp.js} +22 -22
  97. package/dist/chunks/{studio-685s0ytq.js → studio-nqgawfks.js} +572 -572
  98. package/dist/chunks/studio-nzzpvzx9.js +185 -0
  99. package/dist/chunks/{studio-xrapxwwc.js → studio-p1dw8wfw.js} +55 -29
  100. package/dist/chunks/{studio-3bqpr0zh.js → studio-pxbgypmg.js} +299 -110
  101. package/dist/chunks/studio-q0a3yk4n.js +33 -0
  102. package/dist/chunks/{studio-wcy8trfx.js → studio-q3x06vmj.js} +23 -22
  103. package/dist/chunks/{studio-6yw4y3my.js → studio-qhhm6hbt.js} +8 -8
  104. package/dist/chunks/studio-qk4bfsq2.js +362 -0
  105. package/dist/chunks/{studio-msd847zn.js → studio-qk90fgqm.js} +361 -90
  106. package/dist/chunks/{studio-jkftxyvz.js → studio-r6nvacqs.js} +5861 -2154
  107. package/dist/chunks/{studio-53n8bp04.js → studio-r6xmmtfh.js} +1 -1
  108. package/dist/chunks/{studio-tvgyw9xw.js → studio-rnyf3f8e.js} +83 -250
  109. package/dist/chunks/studio-rs76k67r.js +12 -0
  110. package/dist/chunks/studio-sbjyc8bt.js +954 -0
  111. package/dist/chunks/{studio-1wagb550.js → studio-syg2tadj.js} +11 -11
  112. package/dist/chunks/{studio-t5wqwzdh.js → studio-tjjk7jvk.js} +1 -1
  113. package/dist/chunks/studio-tqgryxwg.js +1171 -0
  114. package/dist/chunks/studio-try13h8c.js +8448 -0
  115. package/dist/chunks/studio-vfq8qpjt.js +1219 -0
  116. package/dist/chunks/studio-vhv5tgxm.js +51 -0
  117. package/dist/chunks/{studio-ahn3pdgx.js → studio-vw7mzp6z.js} +52 -38
  118. package/dist/chunks/studio-wqpngpsk.js +174 -0
  119. package/dist/chunks/studio-wqz6dggm.js +1356 -0
  120. package/dist/chunks/{studio-92ab2jqe.js → studio-y9zedyjn.js} +14 -14
  121. package/dist/chunks/studio-yxa81f45.js +12 -0
  122. package/dist/chunks/studio-zdn2g6dt.js +148 -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-t55jdjbx.js +69 -0
  133. package/dist/chunks/{ws-client-6shc5rze.js → ws-client-ny4zc51r.js} +20 -22
  134. package/dist/iframe-entry.js +1873 -673
  135. package/dist/studio.js +52757 -36535
  136. package/dist/workers/editor.worker.js +1040 -1085
  137. package/dist/workers/json.worker.js +1946 -1991
  138. package/dist/workers/ts.worker.js +4960 -5005
  139. package/index.html +1 -0
  140. package/package.json +18 -52
  141. package/src/about/about-modal.ts +72 -123
  142. package/src/browse/library-commands.ts +20 -49
  143. package/src/browse/library-layouts.ts +87 -218
  144. package/src/browse/library-pane.ts +406 -438
  145. package/src/canvas/canvas-helpers.ts +0 -49
  146. package/src/canvas/canvas-live-render.ts +25 -2
  147. package/src/canvas/canvas-render.ts +666 -231
  148. package/src/canvas/canvas-surface.ts +0 -1
  149. package/src/canvas/canvas-utils.ts +333 -113
  150. package/src/canvas/dialog-path.ts +76 -0
  151. package/src/canvas/dialog-state.ts +67 -0
  152. package/src/canvas/diff-marks.ts +252 -0
  153. package/src/canvas/diff-toolbar.ts +349 -0
  154. package/src/canvas/diff-view.ts +123 -0
  155. package/src/canvas/edit-width-drag.ts +187 -0
  156. package/src/canvas/edit-width.ts +150 -0
  157. package/src/canvas/iframe-entry.ts +125 -8
  158. package/src/canvas/iframe-host.ts +271 -15
  159. package/src/canvas/iframe-interaction.ts +133 -13
  160. package/src/canvas/iframe-patch.ts +7 -1
  161. package/src/canvas/iframe-position.ts +5 -6
  162. package/src/canvas/iframe-protocol.ts +106 -5
  163. package/src/canvas/iframe-render.ts +373 -5
  164. package/src/canvas/iframe-slash.ts +2 -2
  165. package/src/canvas/iframe-subtree.ts +5 -8
  166. package/src/canvas/path-mapping.ts +25 -3
  167. package/src/canvas/popover-path.ts +106 -0
  168. package/src/canvas/popover-state.ts +155 -0
  169. package/src/canvas/surface-registry.ts +21 -10
  170. package/src/collab/presence-chips.ts +51 -73
  171. package/src/commands/app-commands.ts +10 -0
  172. package/src/commands/budget.ts +12 -0
  173. package/src/commands/command-args.ts +404 -6
  174. package/src/commands/defaults.ts +44 -14
  175. package/src/commands/live-context.ts +11 -5
  176. package/src/commands/reference.ts +12 -2
  177. package/src/commands/registry.ts +177 -10
  178. package/src/commands/run-reported.ts +120 -0
  179. package/src/content/entry-commands.ts +16 -23
  180. package/src/content/entry-editor.ts +144 -101
  181. package/src/editor/canvas-slash-bridge.ts +2 -2
  182. package/src/editor/context-menu.ts +49 -200
  183. package/src/editor/convert-to-component.ts +42 -82
  184. package/src/editor/convert-to-repeater.ts +132 -173
  185. package/src/editor/inline-edit.ts +11 -0
  186. package/src/editor/shortcuts.ts +76 -49
  187. package/src/editor/slash-menu.ts +150 -157
  188. package/src/files/components.ts +39 -0
  189. package/src/files/file-ops.ts +117 -11
  190. package/src/files/files.ts +944 -660
  191. package/src/files/json-layout.ts +474 -0
  192. package/src/files/serialize-document.ts +8 -1
  193. package/src/format/convert-file.ts +16 -10
  194. package/src/format/format-host.ts +50 -1
  195. package/src/github/github-auth.ts +71 -29
  196. package/src/github/github-publish.ts +57 -65
  197. package/src/grid/cell-editors.ts +46 -4
  198. package/src/grid/cell-popovers.ts +65 -62
  199. package/src/grid/grid-open.ts +86 -64
  200. package/src/grid/grid-panel.ts +390 -469
  201. package/src/grid/redirects-grid.ts +40 -44
  202. package/src/hosting/layout.ts +2 -0
  203. package/src/i18n/i18n-commands.ts +137 -62
  204. package/src/media/media-pane.ts +83 -133
  205. package/src/new-project/add-repo-modal.ts +125 -176
  206. package/src/new-project/import-tab.ts +181 -252
  207. package/src/new-project/location-fields.ts +93 -160
  208. package/src/new-project/new-project-modal.ts +376 -367
  209. package/src/packages/jxsuite-update.ts +76 -18
  210. package/src/packages/pull-package-sync.ts +5 -1
  211. package/src/panels/activity-panel.ts +137 -104
  212. package/src/panels/ai-chat/chat-markdown.ts +15 -13
  213. package/src/panels/ai-chat/chat-view.ts +307 -472
  214. package/src/panels/ai-chat/composer.ts +175 -163
  215. package/src/panels/ai-chat/sessions-view.ts +31 -62
  216. package/src/panels/ai-panel.ts +213 -185
  217. package/src/panels/block-action-bar.ts +444 -645
  218. package/src/panels/bottom-dock.ts +112 -47
  219. package/src/panels/chat-panel.ts +19 -14
  220. package/src/panels/data-explorer.ts +141 -102
  221. package/src/panels/data-grid.ts +183 -150
  222. package/src/panels/dnd.ts +75 -20
  223. package/src/panels/editors.ts +26 -19
  224. package/src/panels/elements-panel.ts +243 -186
  225. package/src/panels/empty-state.ts +26 -42
  226. package/src/panels/events-panel.ts +950 -729
  227. package/src/panels/formula-workspace.ts +434 -207
  228. package/src/panels/frontmatter-fields.ts +185 -153
  229. package/src/panels/frontmatter-panel.ts +411 -187
  230. package/src/panels/git-diff-open.ts +148 -0
  231. package/src/panels/git-panel.ts +679 -605
  232. package/src/panels/head-panel.ts +617 -435
  233. package/src/panels/i18n-panel.ts +148 -135
  234. package/src/panels/imports-panel.ts +388 -414
  235. package/src/panels/jump-bar.ts +175 -147
  236. package/src/panels/layers-panel.ts +785 -671
  237. package/src/panels/left-panel.ts +166 -94
  238. package/src/panels/navigator-panels.ts +1 -1
  239. package/src/panels/pane-context.ts +529 -677
  240. package/src/panels/pane-grid.ts +265 -241
  241. package/src/panels/panel-registry.ts +15 -4
  242. package/src/panels/problems-panel.ts +181 -99
  243. package/src/panels/properties-panel.ts +1525 -966
  244. package/src/panels/provenance.ts +31 -113
  245. package/src/panels/quick-search.ts +223 -184
  246. package/src/panels/right-panel.ts +135 -169
  247. package/src/panels/seo-modal.ts +346 -167
  248. package/src/panels/settings-menu.ts +114 -661
  249. package/src/panels/settings-pane.ts +102 -86
  250. package/src/panels/signals-panel.ts +1318 -1172
  251. package/src/panels/statement-editor.ts +556 -428
  252. package/src/panels/style-panel.ts +1367 -630
  253. package/src/panels/style-utils.ts +36 -32
  254. package/src/panels/stylebook-doc.ts +30 -73
  255. package/src/panels/stylebook-layers-panel.ts +202 -109
  256. package/src/panels/stylebook-panel.ts +124 -88
  257. package/src/panels/tab-strip.ts +386 -288
  258. package/src/platforms/cloud.ts +106 -16
  259. package/src/platforms/devserver.ts +13 -0
  260. package/src/publish/deploy-checklist.ts +124 -78
  261. package/src/publish/publish-commands.ts +4 -12
  262. package/src/publish/publish-panel.ts +134 -328
  263. package/src/services/a11y-report.ts +100 -43
  264. package/src/services/ai-command-tools.ts +538 -0
  265. package/src/services/ai-project-tools.ts +8 -2
  266. package/src/services/ai-session-store.ts +6 -0
  267. package/src/services/ai-system-prompt.ts +112 -24
  268. package/src/services/ai-tools.ts +36 -212
  269. package/src/services/ai-write-report.ts +174 -0
  270. package/src/services/document-assistant.ts +59 -8
  271. package/src/services/idle.ts +16 -14
  272. package/src/services/live-surfaces.ts +237 -0
  273. package/src/services/model-uri.ts +75 -0
  274. package/src/services/notify.ts +63 -6
  275. package/src/services/popover-report.ts +325 -0
  276. package/src/services/surface-registry.ts +56 -0
  277. package/src/services/tool-executor.ts +6 -0
  278. package/src/settings/contexts-section.ts +301 -299
  279. package/src/settings/contributed-section.ts +361 -222
  280. package/src/settings/css-vars-editor.ts +320 -325
  281. package/src/settings/defs-editor.ts +572 -535
  282. package/src/settings/dependencies-editor.ts +79 -107
  283. package/src/settings/extension-commands.ts +379 -0
  284. package/src/settings/extension-rows.ts +113 -0
  285. package/src/settings/extensions-section.ts +287 -0
  286. package/src/settings/general-settings.ts +130 -181
  287. package/src/settings/head-editor.ts +10 -305
  288. package/src/settings/locales-section.ts +146 -196
  289. package/src/settings/preferences-accounts.ts +1 -1
  290. package/src/settings/preferences-dialog.ts +350 -330
  291. package/src/settings/project-sections.ts +108 -181
  292. package/src/settings/schema-field-ui.ts +11 -399
  293. package/src/settings/section-registry.ts +8 -1
  294. package/src/settings/settings-document.ts +31 -29
  295. package/src/shell/tree.ts +42 -87
  296. package/src/shell.ts +48 -36
  297. package/src/studio.ts +104 -69
  298. package/src/style/token-ref.ts +0 -39
  299. package/src/surfaces/about.json +263 -0
  300. package/src/surfaces/about.ts +163 -0
  301. package/src/surfaces/add-repo.json +486 -0
  302. package/src/surfaces/add-repo.ts +236 -0
  303. package/src/surfaces/ai-chat.json +2185 -0
  304. package/src/surfaces/ai-chat.ts +549 -0
  305. package/src/surfaces/ai-credentials-form.json +332 -0
  306. package/src/surfaces/ai-credentials-form.ts +151 -0
  307. package/src/surfaces/ai-managed-connect.json +108 -0
  308. package/src/surfaces/ai-managed-connect.ts +123 -0
  309. package/src/surfaces/ai-model-picker.json +114 -0
  310. package/src/surfaces/ai-model-picker.ts +139 -0
  311. package/src/surfaces/block-action-bar.json +640 -0
  312. package/src/surfaces/block-action-bar.ts +368 -0
  313. package/src/surfaces/bottom-dock.json +154 -0
  314. package/src/surfaces/bottom-dock.ts +125 -0
  315. package/src/surfaces/canvas-stage.json +444 -0
  316. package/src/surfaces/canvas-stage.ts +253 -0
  317. package/src/surfaces/cf-account-picker.json +300 -0
  318. package/src/surfaces/cf-account-picker.ts +214 -0
  319. package/src/surfaces/commandbar.json +985 -0
  320. package/src/{panels/toolbar.ts → surfaces/commandbar.ts} +417 -391
  321. package/src/surfaces/convert-repeater.json +309 -0
  322. package/src/surfaces/convert-repeater.ts +276 -0
  323. package/src/surfaces/data-actions.json +157 -0
  324. package/src/surfaces/data-actions.ts +115 -0
  325. package/src/surfaces/dialog.json +289 -0
  326. package/src/surfaces/dialog.ts +343 -0
  327. package/src/surfaces/diff-toolbar.json +266 -0
  328. package/src/surfaces/diff-toolbar.ts +139 -0
  329. package/src/surfaces/doc-header.json +739 -0
  330. package/src/surfaces/doc-header.ts +223 -0
  331. package/src/surfaces/empty-state.json +152 -0
  332. package/src/surfaces/empty-state.ts +173 -0
  333. package/src/surfaces/entry-editor.json +281 -0
  334. package/src/surfaces/entry-editor.ts +191 -0
  335. package/src/surfaces/expression-editor.json +977 -0
  336. package/src/surfaces/expression-editor.ts +266 -0
  337. package/src/surfaces/files-panel.json +592 -0
  338. package/src/surfaces/files-panel.ts +301 -0
  339. package/src/surfaces/formula-palette.json +364 -0
  340. package/src/surfaces/formula-palette.ts +340 -0
  341. package/src/surfaces/git-panel.json +1822 -0
  342. package/src/surfaces/git-panel.ts +272 -0
  343. package/src/surfaces/github-auth.json +112 -0
  344. package/src/surfaces/github-auth.ts +139 -0
  345. package/src/surfaces/github-publish.json +206 -0
  346. package/src/surfaces/github-publish.ts +169 -0
  347. package/src/surfaces/grid-cell.json +218 -0
  348. package/src/surfaces/grid-cell.ts +120 -0
  349. package/src/surfaces/grid-open.json +147 -0
  350. package/src/surfaces/grid-open.ts +87 -0
  351. package/src/surfaces/grid-panel.json +706 -0
  352. package/src/surfaces/grid-panel.ts +206 -0
  353. package/src/surfaces/grid-replace.json +179 -0
  354. package/src/surfaces/grid-replace.ts +89 -0
  355. package/src/surfaces/grid-views.json +446 -0
  356. package/src/surfaces/grid-views.ts +172 -0
  357. package/src/surfaces/inspector-dock.json +187 -0
  358. package/src/surfaces/inspector-dock.ts +161 -0
  359. package/src/surfaces/jump-bar.json +243 -0
  360. package/src/surfaces/jump-bar.ts +129 -0
  361. package/src/surfaces/jxsuite-update.json +146 -0
  362. package/src/surfaces/jxsuite-update.ts +149 -0
  363. package/src/surfaces/library-pane.json +1509 -0
  364. package/src/surfaces/library-pane.ts +363 -0
  365. package/src/surfaces/logic-panel.json +1949 -0
  366. package/src/surfaces/logic-panel.ts +369 -0
  367. package/src/surfaces/logic-workspace.json +685 -0
  368. package/src/surfaces/logic-workspace.ts +238 -0
  369. package/src/surfaces/media-browser.json +303 -0
  370. package/src/surfaces/media-browser.ts +145 -0
  371. package/src/surfaces/media-field.json +163 -0
  372. package/src/surfaces/media-field.ts +116 -0
  373. package/src/surfaces/media-pane.json +513 -0
  374. package/src/surfaces/media-pane.ts +197 -0
  375. package/src/surfaces/menu.json +232 -0
  376. package/src/surfaces/menu.ts +375 -0
  377. package/src/surfaces/navigator-dock.json +113 -0
  378. package/src/surfaces/navigator-dock.ts +130 -0
  379. package/src/surfaces/new-project.json +1654 -0
  380. package/src/surfaces/new-project.ts +411 -0
  381. package/src/surfaces/palette.json +535 -0
  382. package/src/surfaces/pane-context.json +1497 -0
  383. package/src/surfaces/pane-context.ts +513 -0
  384. package/src/surfaces/pane-grid.json +188 -0
  385. package/src/surfaces/pane-grid.ts +250 -0
  386. package/src/surfaces/panel-activity.json +563 -0
  387. package/src/surfaces/panel-activity.ts +187 -0
  388. package/src/surfaces/panel-data.json +141 -0
  389. package/src/surfaces/panel-data.ts +156 -0
  390. package/src/surfaces/panel-deploy-checklist.json +283 -0
  391. package/src/surfaces/panel-deploy-checklist.ts +175 -0
  392. package/src/surfaces/panel-elements.json +367 -0
  393. package/src/surfaces/panel-elements.ts +175 -0
  394. package/src/surfaces/panel-i18n.json +569 -0
  395. package/src/surfaces/panel-i18n.ts +212 -0
  396. package/src/surfaces/panel-imports.json +780 -0
  397. package/src/surfaces/panel-imports.ts +209 -0
  398. package/src/surfaces/panel-outline.json +734 -0
  399. package/src/surfaces/panel-outline.ts +326 -0
  400. package/src/surfaces/panel-page.json +1017 -0
  401. package/src/surfaces/panel-page.ts +240 -0
  402. package/src/surfaces/panel-problems.json +497 -0
  403. package/src/surfaces/panel-problems.ts +157 -0
  404. package/src/surfaces/panel-signals.json +1973 -0
  405. package/src/surfaces/panel-signals.ts +436 -0
  406. package/src/surfaces/panel-stylebook-layers.json +317 -0
  407. package/src/surfaces/panel-stylebook-layers.ts +155 -0
  408. package/src/surfaces/preferences.json +850 -0
  409. package/src/surfaces/preferences.ts +332 -0
  410. package/src/surfaces/progress-modal.json +110 -0
  411. package/src/surfaces/progress-modal.ts +150 -0
  412. package/src/surfaces/properties-panel.json +1578 -0
  413. package/src/surfaces/properties-panel.ts +337 -0
  414. package/src/surfaces/publish.json +945 -0
  415. package/src/surfaces/publish.ts +392 -0
  416. package/src/surfaces/push-plan.json +110 -0
  417. package/src/surfaces/push-plan.ts +87 -0
  418. package/src/surfaces/rail.json +255 -0
  419. package/src/surfaces/rail.ts +206 -0
  420. package/src/surfaces/reference-field.json +191 -0
  421. package/src/surfaces/reference-field.ts +168 -0
  422. package/src/surfaces/schema-builder.json +1011 -0
  423. package/src/surfaces/schema-builder.ts +181 -0
  424. package/src/surfaces/schema-form.json +1013 -0
  425. package/src/surfaces/schema-form.ts +287 -0
  426. package/src/surfaces/secret-field.json +60 -0
  427. package/src/surfaces/secret-field.ts +146 -0
  428. package/src/surfaces/seo.json +932 -0
  429. package/src/surfaces/seo.ts +334 -0
  430. package/src/surfaces/settings-contexts.json +538 -0
  431. package/src/surfaces/settings-contexts.ts +196 -0
  432. package/src/surfaces/settings-contributed.json +489 -0
  433. package/src/surfaces/settings-contributed.ts +199 -0
  434. package/src/surfaces/settings-css-vars.json +820 -0
  435. package/src/surfaces/settings-css-vars.ts +199 -0
  436. package/src/surfaces/settings-defs.json +1363 -0
  437. package/src/surfaces/settings-defs.ts +232 -0
  438. package/src/surfaces/settings-deploy.json +108 -0
  439. package/src/surfaces/settings-deploy.ts +135 -0
  440. package/src/surfaces/settings-extensions.json +486 -0
  441. package/src/surfaces/settings-extensions.ts +201 -0
  442. package/src/surfaces/settings-head.json +779 -0
  443. package/src/surfaces/settings-head.ts +397 -0
  444. package/src/surfaces/settings-locales.json +420 -0
  445. package/src/surfaces/settings-locales.ts +137 -0
  446. package/src/surfaces/settings-overview.json +423 -0
  447. package/src/surfaces/settings-overview.ts +218 -0
  448. package/src/surfaces/settings-packages.json +549 -0
  449. package/src/surfaces/settings-packages.ts +158 -0
  450. package/src/surfaces/settings-pane.json +147 -0
  451. package/src/surfaces/settings-pane.ts +150 -0
  452. package/src/surfaces/settings-rawjson.json +104 -0
  453. package/src/surfaces/settings-rawjson.ts +107 -0
  454. package/src/surfaces/shell.json +99 -0
  455. package/src/surfaces/shell.ts +30 -0
  456. package/src/surfaces/slash-menu.json +180 -0
  457. package/src/surfaces/slash-menu.ts +272 -0
  458. package/src/surfaces/statements.json +607 -0
  459. package/src/surfaces/statements.ts +238 -0
  460. package/src/surfaces/statusbar.json +94 -0
  461. package/src/{panels → surfaces}/statusbar.ts +164 -90
  462. package/src/surfaces/style-panel.json +1643 -0
  463. package/src/surfaces/style-panel.ts +338 -0
  464. package/src/surfaces/stylebook-chrome.json +122 -0
  465. package/src/surfaces/stylebook-chrome.ts +122 -0
  466. package/src/surfaces/tab-strip.json +448 -0
  467. package/src/surfaces/tab-strip.ts +200 -0
  468. package/src/surfaces/target-line.json +419 -0
  469. package/src/surfaces/target-line.ts +349 -0
  470. package/src/surfaces/toasts.json +189 -0
  471. package/src/surfaces/welcome.json +571 -0
  472. package/src/surfaces/welcome.ts +338 -0
  473. package/src/tabs/project-config.ts +111 -21
  474. package/src/tabs/tab.ts +52 -1
  475. package/src/types.ts +22 -0
  476. package/src/ui/ai-credentials-form.ts +104 -100
  477. package/src/ui/ai-managed-connect.ts +54 -36
  478. package/src/ui/ai-model-picker.ts +75 -47
  479. package/src/ui/cf-account-picker.ts +76 -141
  480. package/src/ui/color-selector.ts +80 -301
  481. package/src/ui/dynamic-slot.ts +43 -283
  482. package/src/ui/expression-editor.ts +797 -576
  483. package/src/ui/field-input.ts +8 -181
  484. package/src/ui/form-controls.ts +838 -366
  485. package/src/ui/formula-chips.ts +80 -85
  486. package/src/ui/kit.ts +33 -0
  487. package/src/ui/layers.ts +296 -593
  488. package/src/ui/media-picker.ts +203 -284
  489. package/src/ui/panel-resize.ts +251 -64
  490. package/src/ui/popover-surface.ts +153 -0
  491. package/src/ui/progress-modal.ts +22 -60
  492. package/src/ui/regions.ts +13 -7
  493. package/src/ui/schema-form.ts +906 -440
  494. package/src/ui/surface.ts +122 -0
  495. package/src/ui/unit-selector.ts +15 -131
  496. package/src/ui/value-source.ts +14 -0
  497. package/src/ui/virtual-window.ts +88 -9
  498. package/src/utils/canvas-media.ts +72 -0
  499. package/src/utils/edit-display.ts +7 -2
  500. package/src/utils/element-selectors.ts +69 -0
  501. package/src/utils/link-target.ts +2 -2
  502. package/src/utils/studio-utils.ts +0 -10
  503. package/src/view.ts +15 -0
  504. package/src/workspace/pane-derive.ts +36 -14
  505. package/src/workspace/workspace.ts +75 -6
  506. package/styles/canvas.css +72 -467
  507. package/styles/forced-colors.css +48 -82
  508. package/styles/forced-colors.json +41 -0
  509. package/styles/inspector.css +2 -1301
  510. package/styles/overlays.css +96 -2823
  511. package/styles/panels.css +6 -1423
  512. package/styles/shell-frame.css +272 -0
  513. package/styles/shell-frame.json +227 -0
  514. package/styles/shell.css +0 -1568
  515. package/styles/tokens.css +65 -136
  516. package/styles/tokens.json +84 -0
  517. package/dist/chunks/Overlay.dev-etqjwyf9.js +0 -23
  518. package/dist/chunks/adapter-jkcyhgtr.js +0 -14
  519. package/dist/chunks/cf-account-picker-en86v7x7.js +0 -163
  520. package/dist/chunks/cf-settings-45fgyx8y.js +0 -21
  521. package/dist/chunks/components-zmx10t62.js +0 -21
  522. package/dist/chunks/content-source-48xg86wj.js +0 -49
  523. package/dist/chunks/convert-to-repeater-43tfn7cs.js +0 -268
  524. package/dist/chunks/editor-cptq5jp1.js +0 -37
  525. package/dist/chunks/entry-commands-e63f1xc0.js +0 -46
  526. package/dist/chunks/extension-sections-txv08xxg.js +0 -311
  527. package/dist/chunks/file-ops-wbh4hhsx.js +0 -48
  528. package/dist/chunks/files-3kfkwhk4.js +0 -93
  529. package/dist/chunks/flow-qbfgrpeh.js +0 -634
  530. package/dist/chunks/focus-trap.esm-9t2drp0g.js +0 -1025
  531. package/dist/chunks/focus-visible-6eg70z18.js +0 -167
  532. package/dist/chunks/format-host-w16q81tf.js +0 -43
  533. package/dist/chunks/fs-events-hrrg328g.js +0 -21
  534. package/dist/chunks/git-panel-532whr1y.js +0 -59
  535. package/dist/chunks/index-zqxmqxmh.js +0 -109
  536. package/dist/chunks/jx-validate-8er6gbxy.js +0 -19
  537. package/dist/chunks/layers-panel-07hm7g5j.js +0 -67
  538. package/dist/chunks/layers-q75tj2mf.js +0 -45
  539. package/dist/chunks/lit-html-j055mkh8.js +0 -22
  540. package/dist/chunks/monaco-buffer-dqw0xxpx.js +0 -25
  541. package/dist/chunks/notify-yjm79n4s.js +0 -30
  542. package/dist/chunks/parse-24d0gay3.js +0 -19
  543. package/dist/chunks/platform-ba1j1gbh.js +0 -16
  544. package/dist/chunks/publish-panel-v9st96ja.js +0 -29
  545. package/dist/chunks/quick-search-zccjp6gv.js +0 -66
  546. package/dist/chunks/references-3qx8fkyp.js +0 -29
  547. package/dist/chunks/right-panel-vm3b6kwy.js +0 -46
  548. package/dist/chunks/section-registry-sx1ykvkw.js +0 -30
  549. package/dist/chunks/sp-overlay.dev-qgvhnxf4.js +0 -18
  550. package/dist/chunks/sp-popover.dev-n2etmqdp.js +0 -9
  551. package/dist/chunks/sp-progress-circle.dev-hryhj0es.js +0 -15
  552. package/dist/chunks/sp-tooltip.dev-4sastdnw.js +0 -15
  553. package/dist/chunks/sp-tray.dev-tkbscm06.js +0 -199
  554. package/dist/chunks/studio-0a5qrh01.js +0 -3
  555. package/dist/chunks/studio-0bq6eh7v.js +0 -12
  556. package/dist/chunks/studio-18j3bmcz.js +0 -14
  557. package/dist/chunks/studio-1ngbejft.js +0 -181
  558. package/dist/chunks/studio-4b5z1x43.js +0 -424
  559. package/dist/chunks/studio-4n2b5gzb.js +0 -357
  560. package/dist/chunks/studio-4rzyrtjz.js +0 -426
  561. package/dist/chunks/studio-5fx3g9jg.js +0 -4325
  562. package/dist/chunks/studio-5myknm0a.js +0 -1903
  563. package/dist/chunks/studio-7afd21nw.js +0 -67
  564. package/dist/chunks/studio-7nte2hj4.js +0 -613
  565. package/dist/chunks/studio-8jpzqk5s.js +0 -128
  566. package/dist/chunks/studio-8q517dfr.js +0 -24
  567. package/dist/chunks/studio-950k0dx6.js +0 -6939
  568. package/dist/chunks/studio-9n4mrmnb.js +0 -184
  569. package/dist/chunks/studio-a0tswy0w.js +0 -58
  570. package/dist/chunks/studio-ahnzd9rg.js +0 -23
  571. package/dist/chunks/studio-bgxt93ga.js +0 -62
  572. package/dist/chunks/studio-cmb03bg5.js +0 -13890
  573. package/dist/chunks/studio-d1ks410h.js +0 -175
  574. package/dist/chunks/studio-ef49pnzx.js +0 -387
  575. package/dist/chunks/studio-eqq1w638.js +0 -113
  576. package/dist/chunks/studio-ew0djmhg.js +0 -341
  577. package/dist/chunks/studio-gfgb8pe6.js +0 -1652
  578. package/dist/chunks/studio-h4rxscfc.js +0 -10
  579. package/dist/chunks/studio-jc994dnr.js +0 -1066
  580. package/dist/chunks/studio-kyh9avvv.js +0 -28
  581. package/dist/chunks/studio-m3hwn7y1.js +0 -120
  582. package/dist/chunks/studio-mtfnaqs9.js +0 -659
  583. package/dist/chunks/studio-n6j9t10q.js +0 -318
  584. package/dist/chunks/studio-n8b9wqwy.js +0 -291
  585. package/dist/chunks/studio-qcy05dp8.js +0 -1743
  586. package/dist/chunks/studio-qq6jym04.js +0 -53
  587. package/dist/chunks/studio-rdx8jcxy.js +0 -83
  588. package/dist/chunks/studio-rn9ta2mz.js +0 -111
  589. package/dist/chunks/studio-t7qb9db8.js +0 -665
  590. package/dist/chunks/studio-tmc5emrw.js +0 -8
  591. package/dist/chunks/studio-z6nw2ek2.js +0 -18
  592. package/dist/chunks/studio-zczps70q.js +0 -378
  593. package/dist/chunks/studio-zqazsct2.js +0 -1823
  594. package/dist/chunks/workspace-fjx52ryv.js +0 -89
  595. package/src/panels/activity-bar.ts +0 -251
  596. package/src/panels/panel-scheduler.ts +0 -219
  597. package/src/panels/style-inputs.ts +0 -237
  598. package/src/panels/target-line.ts +0 -274
  599. package/src/panels/welcome-screen.ts +0 -346
  600. package/src/ui/button-group.ts +0 -102
  601. package/src/ui/choice-field.ts +0 -72
  602. package/src/ui/field-row.ts +0 -249
  603. package/src/ui/formula-palette.ts +0 -213
  604. package/src/ui/icons.ts +0 -52
  605. package/src/ui/jx-theme.ts +0 -130
  606. package/src/ui/spectrum.ts +0 -340
  607. package/src/ui/value-selector.ts +0 -174
  608. package/src/ui/widgets.ts +0 -172
  609. /package/dist/chunks/{javascript-s56a8dpk.css → javascript-4abzjcy9.css} +0 -0
  610. /package/dist/chunks/{jsonMode-zr9sw0c7.css → jsonMode-vvmpmk34.css} +0 -0
  611. /package/dist/chunks/{monaco-setup-pav68602.css → monaco-setup-8vbyqnhr.css} +0 -0
  612. /package/dist/chunks/{tsMode-ef187txx.css → tsMode-hnxxb73h.css} +0 -0
@@ -1,4325 +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-qgvhnxf4.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
- var _padding$top, _padding$right, _padding$bottom, _padding$left;
1689
- return {
1690
- top: (_padding$top = padding.top) != null ? _padding$top : 0,
1691
- right: (_padding$right = padding.right) != null ? _padding$right : 0,
1692
- bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
1693
- left: (_padding$left = padding.left) != null ? _padding$left : 0
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
- const alignment = getAlignment(placement);
1770
- if (alignment) {
1771
- coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
1772
- }
1773
- return coords;
1774
- }
1775
- async function detectOverflow(state2, options) {
1776
- var _await$platform$isEle;
1777
- if (options === undefined) {
1778
- options = {};
1779
- }
1780
- const {
1781
- x,
1782
- y,
1783
- platform,
1784
- rects,
1785
- elements,
1786
- strategy
1787
- } = state2;
1788
- const {
1789
- boundary = "clippingAncestors",
1790
- rootBoundary = "viewport",
1791
- elementContext = "floating",
1792
- altBoundary = false,
1793
- padding = 0
1794
- } = evaluate(options, state2);
1795
- const paddingObject = getPaddingObject(padding);
1796
- const altContext = elementContext === "floating" ? "reference" : "floating";
1797
- const element = elements[altBoundary ? altContext : elementContext];
1798
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
1799
- 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)),
1800
- boundary,
1801
- rootBoundary,
1802
- strategy
1803
- }));
1804
- const rect = elementContext === "floating" ? {
1805
- x,
1806
- y,
1807
- width: rects.floating.width,
1808
- height: rects.floating.height
1809
- } : rects.reference;
1810
- const offsetParent = await (platform.getOffsetParent == null ? undefined : platform.getOffsetParent(elements.floating));
1811
- const offsetScale = await (platform.isElement == null ? undefined : platform.isElement(offsetParent)) && await (platform.getScale == null ? undefined : platform.getScale(offsetParent)) || {
1812
- x: 1,
1813
- y: 1
1814
- };
1815
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
1816
- elements,
1817
- rect,
1818
- offsetParent,
1819
- strategy
1820
- }) : rect);
1821
- return {
1822
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
1823
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
1824
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
1825
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
1826
- };
1827
- }
1828
- var MAX_RESET_COUNT = 50;
1829
- var computePosition = async (reference, floating, config) => {
1830
- const {
1831
- placement = "bottom",
1832
- strategy = "absolute",
1833
- middleware = [],
1834
- platform
1835
- } = config;
1836
- const platformWithDetectOverflow = platform.detectOverflow ? platform : {
1837
- ...platform,
1838
- detectOverflow
1839
- };
1840
- const rtl = await (platform.isRTL == null ? undefined : platform.isRTL(floating));
1841
- let rects = await platform.getElementRects({
1842
- reference,
1843
- floating,
1844
- strategy
1845
- });
1846
- let {
1847
- x,
1848
- y
1849
- } = computeCoordsFromPlacement(rects, placement, rtl);
1850
- let statefulPlacement = placement;
1851
- let resetCount = 0;
1852
- const middlewareData = {};
1853
- for (let i = 0;i < middleware.length; i++) {
1854
- const currentMiddleware = middleware[i];
1855
- if (!currentMiddleware) {
1856
- continue;
1857
- }
1858
- const {
1859
- name,
1860
- fn
1861
- } = currentMiddleware;
1862
- const {
1863
- x: nextX,
1864
- y: nextY,
1865
- data,
1866
- reset
1867
- } = await fn({
1868
- x,
1869
- y,
1870
- initialPlacement: placement,
1871
- placement: statefulPlacement,
1872
- strategy,
1873
- middlewareData,
1874
- rects,
1875
- platform: platformWithDetectOverflow,
1876
- elements: {
1877
- reference,
1878
- floating
1879
- }
1880
- });
1881
- x = nextX != null ? nextX : x;
1882
- y = nextY != null ? nextY : y;
1883
- middlewareData[name] = {
1884
- ...middlewareData[name],
1885
- ...data
1886
- };
1887
- if (reset && resetCount < MAX_RESET_COUNT) {
1888
- resetCount++;
1889
- if (typeof reset === "object") {
1890
- if (reset.placement) {
1891
- statefulPlacement = reset.placement;
1892
- }
1893
- if (reset.rects) {
1894
- rects = reset.rects === true ? await platform.getElementRects({
1895
- reference,
1896
- floating,
1897
- strategy
1898
- }) : reset.rects;
1899
- }
1900
- ({
1901
- x,
1902
- y
1903
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
1904
- }
1905
- i = -1;
1906
- }
1907
- }
1908
- return {
1909
- x,
1910
- y,
1911
- placement: statefulPlacement,
1912
- strategy,
1913
- middlewareData
1914
- };
1915
- };
1916
- var arrow = (options) => ({
1917
- name: "arrow",
1918
- options,
1919
- async fn(state2) {
1920
- const {
1921
- x,
1922
- y,
1923
- placement,
1924
- rects,
1925
- platform,
1926
- elements,
1927
- middlewareData
1928
- } = state2;
1929
- const {
1930
- element,
1931
- padding = 0
1932
- } = evaluate(options, state2) || {};
1933
- if (element == null) {
1934
- return {};
1935
- }
1936
- const paddingObject = getPaddingObject(padding);
1937
- const coords = {
1938
- x,
1939
- y
1940
- };
1941
- const axis = getAlignmentAxis(placement);
1942
- const length = getAxisLength(axis);
1943
- const arrowDimensions = await platform.getDimensions(element);
1944
- const isYAxis = axis === "y";
1945
- const minProp = isYAxis ? "top" : "left";
1946
- const maxProp = isYAxis ? "bottom" : "right";
1947
- const clientProp = isYAxis ? "clientHeight" : "clientWidth";
1948
- const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
1949
- const startDiff = coords[axis] - rects.reference[axis];
1950
- const arrowOffsetParent = await (platform.getOffsetParent == null ? undefined : platform.getOffsetParent(element));
1951
- let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
1952
- if (!clientSize || !await (platform.isElement == null ? undefined : platform.isElement(arrowOffsetParent))) {
1953
- clientSize = elements.floating[clientProp] || rects.floating[length];
1954
- }
1955
- const centerToReference = endDiff / 2 - startDiff / 2;
1956
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
1957
- const minPadding = min(paddingObject[minProp], largestPossiblePadding);
1958
- const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
1959
- const max2 = clientSize - arrowDimensions[length] - maxPadding;
1960
- const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
1961
- const offset = clamp(minPadding, center, max2);
1962
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
1963
- const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max2 : 0;
1964
- return {
1965
- [axis]: coords[axis] + alignmentOffset,
1966
- data: {
1967
- [axis]: offset,
1968
- centerOffset: center - offset - alignmentOffset,
1969
- ...shouldAddOffset && {
1970
- alignmentOffset
1971
- }
1972
- },
1973
- reset: shouldAddOffset
1974
- };
1975
- }
1976
- });
1977
- var flip = function(options) {
1978
- if (options === undefined) {
1979
- options = {};
1980
- }
1981
- return {
1982
- name: "flip",
1983
- options,
1984
- async fn(state2) {
1985
- var _middlewareData$arrow, _middlewareData$flip;
1986
- const {
1987
- placement,
1988
- middlewareData,
1989
- rects,
1990
- initialPlacement,
1991
- platform,
1992
- elements
1993
- } = state2;
1994
- const {
1995
- mainAxis: checkMainAxis = true,
1996
- crossAxis: checkCrossAxis = true,
1997
- fallbackPlacements: specifiedFallbackPlacements,
1998
- fallbackStrategy = "bestFit",
1999
- fallbackAxisSideDirection = "none",
2000
- flipAlignment = true,
2001
- ...detectOverflowOptions
2002
- } = evaluate(options, state2);
2003
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
2004
- return {};
2005
- }
2006
- const side = getSide(placement);
2007
- const initialSideAxis = getSideAxis(initialPlacement);
2008
- const isBasePlacement = getSide(initialPlacement) === initialPlacement;
2009
- const rtl = await (platform.isRTL == null ? undefined : platform.isRTL(elements.floating));
2010
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
2011
- const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
2012
- if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
2013
- fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
2014
- }
2015
- const placements2 = [initialPlacement, ...fallbackPlacements];
2016
- const overflow = await platform.detectOverflow(state2, detectOverflowOptions);
2017
- const overflows = [];
2018
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? undefined : _middlewareData$flip.overflows) || [];
2019
- if (checkMainAxis) {
2020
- overflows.push(overflow[side]);
2021
- }
2022
- if (checkCrossAxis) {
2023
- const sides2 = getAlignmentSides(placement, rects, rtl);
2024
- overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
2025
- }
2026
- overflowsData = [...overflowsData, {
2027
- placement,
2028
- overflows
2029
- }];
2030
- if (!overflows.every((side2) => side2 <= 0)) {
2031
- var _middlewareData$flip2, _overflowsData$filter;
2032
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? undefined : _middlewareData$flip2.index) || 0) + 1;
2033
- const nextPlacement = placements2[nextIndex];
2034
- if (nextPlacement) {
2035
- const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
2036
- if (!ignoreCrossAxisOverflow || overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
2037
- return {
2038
- data: {
2039
- index: nextIndex,
2040
- overflows: overflowsData
2041
- },
2042
- reset: {
2043
- placement: nextPlacement
2044
- }
2045
- };
2046
- }
2047
- }
2048
- 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;
2049
- if (!resetPlacement) {
2050
- switch (fallbackStrategy) {
2051
- case "bestFit": {
2052
- var _overflowsData$filter2;
2053
- const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
2054
- if (hasFallbackAxisSideDirection) {
2055
- const currentSideAxis = getSideAxis(d.placement);
2056
- return currentSideAxis === initialSideAxis || currentSideAxis === "y";
2057
- }
2058
- return true;
2059
- }).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];
2060
- if (placement2) {
2061
- resetPlacement = placement2;
2062
- }
2063
- break;
2064
- }
2065
- case "initialPlacement":
2066
- resetPlacement = initialPlacement;
2067
- break;
2068
- }
2069
- }
2070
- if (placement !== resetPlacement) {
2071
- return {
2072
- reset: {
2073
- placement: resetPlacement
2074
- }
2075
- };
2076
- }
2077
- }
2078
- return {};
2079
- }
2080
- };
2081
- };
2082
- var originSides = /* @__PURE__ */ new Set(["left", "top"]);
2083
- async function convertValueToCoords(state2, options) {
2084
- const {
2085
- placement,
2086
- platform,
2087
- elements
2088
- } = state2;
2089
- const rtl = await (platform.isRTL == null ? undefined : platform.isRTL(elements.floating));
2090
- const side = getSide(placement);
2091
- const alignment = getAlignment(placement);
2092
- const isVertical = getSideAxis(placement) === "y";
2093
- const mainAxisMulti = originSides.has(side) ? -1 : 1;
2094
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
2095
- const rawValue = evaluate(options, state2);
2096
- let {
2097
- mainAxis,
2098
- crossAxis,
2099
- alignmentAxis
2100
- } = typeof rawValue === "number" ? {
2101
- mainAxis: rawValue,
2102
- crossAxis: 0,
2103
- alignmentAxis: null
2104
- } : {
2105
- mainAxis: rawValue.mainAxis || 0,
2106
- crossAxis: rawValue.crossAxis || 0,
2107
- alignmentAxis: rawValue.alignmentAxis
2108
- };
2109
- if (alignment && typeof alignmentAxis === "number") {
2110
- crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
2111
- }
2112
- return isVertical ? {
2113
- x: crossAxis * crossAxisMulti,
2114
- y: mainAxis * mainAxisMulti
2115
- } : {
2116
- x: mainAxis * mainAxisMulti,
2117
- y: crossAxis * crossAxisMulti
2118
- };
2119
- }
2120
- var offset = function(options) {
2121
- if (options === undefined) {
2122
- options = 0;
2123
- }
2124
- return {
2125
- name: "offset",
2126
- options,
2127
- async fn(state2) {
2128
- var _middlewareData$offse, _middlewareData$arrow;
2129
- const {
2130
- x,
2131
- y,
2132
- placement,
2133
- middlewareData
2134
- } = state2;
2135
- const diffCoords = await convertValueToCoords(state2, options);
2136
- if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? undefined : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
2137
- return {};
2138
- }
2139
- return {
2140
- x: x + diffCoords.x,
2141
- y: y + diffCoords.y,
2142
- data: {
2143
- ...diffCoords,
2144
- placement
2145
- }
2146
- };
2147
- }
2148
- };
2149
- };
2150
- var shift = function(options) {
2151
- if (options === undefined) {
2152
- options = {};
2153
- }
2154
- return {
2155
- name: "shift",
2156
- options,
2157
- async fn(state2) {
2158
- const {
2159
- x,
2160
- y,
2161
- placement,
2162
- platform
2163
- } = state2;
2164
- const {
2165
- mainAxis: checkMainAxis = true,
2166
- crossAxis: checkCrossAxis = false,
2167
- limiter = {
2168
- fn: (_ref) => {
2169
- let {
2170
- x: x2,
2171
- y: y2
2172
- } = _ref;
2173
- return {
2174
- x: x2,
2175
- y: y2
2176
- };
2177
- }
2178
- },
2179
- ...detectOverflowOptions
2180
- } = evaluate(options, state2);
2181
- const coords = {
2182
- x,
2183
- y
2184
- };
2185
- const overflow = await platform.detectOverflow(state2, detectOverflowOptions);
2186
- const crossAxis = getSideAxis(placement);
2187
- const mainAxis = getOppositeAxis(crossAxis);
2188
- let mainAxisCoord = coords[mainAxis];
2189
- let crossAxisCoord = coords[crossAxis];
2190
- const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
2191
- if (checkMainAxis) {
2192
- mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
2193
- }
2194
- if (checkCrossAxis) {
2195
- crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
2196
- }
2197
- const limitedCoords = limiter.fn({
2198
- ...state2,
2199
- [mainAxis]: mainAxisCoord,
2200
- [crossAxis]: crossAxisCoord
2201
- });
2202
- return {
2203
- ...limitedCoords,
2204
- data: {
2205
- x: limitedCoords.x - x,
2206
- y: limitedCoords.y - y,
2207
- enabled: {
2208
- [mainAxis]: checkMainAxis,
2209
- [crossAxis]: checkCrossAxis
2210
- }
2211
- }
2212
- };
2213
- }
2214
- };
2215
- };
2216
- var size = function(options) {
2217
- if (options === undefined) {
2218
- options = {};
2219
- }
2220
- return {
2221
- name: "size",
2222
- options,
2223
- async fn(state2) {
2224
- const {
2225
- placement,
2226
- rects,
2227
- platform,
2228
- elements
2229
- } = state2;
2230
- const {
2231
- apply = () => {},
2232
- ...detectOverflowOptions
2233
- } = evaluate(options, state2);
2234
- const overflow = await platform.detectOverflow(state2, detectOverflowOptions);
2235
- const side = getSide(placement);
2236
- const alignment = getAlignment(placement);
2237
- const isYAxis = getSideAxis(placement) === "y";
2238
- const {
2239
- width,
2240
- height
2241
- } = rects.floating;
2242
- let heightSide;
2243
- let widthSide;
2244
- if (side === "top" || side === "bottom") {
2245
- heightSide = side;
2246
- widthSide = alignment === (await (platform.isRTL == null ? undefined : platform.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
2247
- } else {
2248
- widthSide = side;
2249
- heightSide = alignment === "end" ? "top" : "bottom";
2250
- }
2251
- const maximumClippingHeight = height - overflow.top - overflow.bottom;
2252
- const maximumClippingWidth = width - overflow.left - overflow.right;
2253
- const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
2254
- const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
2255
- const shiftData = state2.middlewareData.shift;
2256
- const noShift = !shiftData;
2257
- let availableHeight = overflowAvailableHeight;
2258
- let availableWidth = overflowAvailableWidth;
2259
- if (shiftData != null && shiftData.enabled.x) {
2260
- availableWidth = maximumClippingWidth;
2261
- }
2262
- if (shiftData != null && shiftData.enabled.y) {
2263
- availableHeight = maximumClippingHeight;
2264
- }
2265
- if (noShift && !alignment) {
2266
- if (isYAxis) {
2267
- availableWidth = width - 2 * max(overflow.left, overflow.right);
2268
- } else {
2269
- availableHeight = height - 2 * max(overflow.top, overflow.bottom);
2270
- }
2271
- }
2272
- await apply({
2273
- ...state2,
2274
- availableWidth,
2275
- availableHeight
2276
- });
2277
- const nextDimensions = await platform.getDimensions(elements.floating);
2278
- if (width !== nextDimensions.width || height !== nextDimensions.height) {
2279
- return {
2280
- reset: {
2281
- rects: true
2282
- }
2283
- };
2284
- }
2285
- return {};
2286
- }
2287
- };
2288
- };
2289
-
2290
- // ../../node_modules/@spectrum-web-components/overlay/node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
2291
- var min2 = Math.min;
2292
- var max2 = Math.max;
2293
- var round = Math.round;
2294
- var floor = Math.floor;
2295
- var createCoords = (v) => ({
2296
- x: v,
2297
- y: v
2298
- });
2299
-
2300
- // ../../node_modules/@spectrum-web-components/overlay/node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
2301
- function hasWindow() {
2302
- return typeof window !== "undefined";
2303
- }
2304
- function getNodeName(node) {
2305
- if (isNode(node)) {
2306
- return (node.nodeName || "").toLowerCase();
2307
- }
2308
- return "#document";
2309
- }
2310
- function getWindow(node) {
2311
- var _node$ownerDocument;
2312
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? undefined : _node$ownerDocument.defaultView) || window;
2313
- }
2314
- function getDocumentElement(node) {
2315
- var _ref;
2316
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? undefined : _ref.documentElement;
2317
- }
2318
- function isNode(value) {
2319
- if (!hasWindow()) {
2320
- return false;
2321
- }
2322
- return value instanceof Node || value instanceof getWindow(value).Node;
2323
- }
2324
- function isElement(value) {
2325
- if (!hasWindow()) {
2326
- return false;
2327
- }
2328
- return value instanceof Element || value instanceof getWindow(value).Element;
2329
- }
2330
- function isHTMLElement(value) {
2331
- if (!hasWindow()) {
2332
- return false;
2333
- }
2334
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
2335
- }
2336
- function isShadowRoot(value) {
2337
- if (!hasWindow() || typeof ShadowRoot === "undefined") {
2338
- return false;
2339
- }
2340
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
2341
- }
2342
- function isOverflowElement(element) {
2343
- const {
2344
- overflow,
2345
- overflowX,
2346
- overflowY,
2347
- display
2348
- } = getComputedStyle2(element);
2349
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
2350
- }
2351
- function isTableElement(element) {
2352
- return /^(table|td|th)$/.test(getNodeName(element));
2353
- }
2354
- function isTopLayer(element) {
2355
- try {
2356
- if (element.matches(":popover-open")) {
2357
- return true;
2358
- }
2359
- } catch (_e) {}
2360
- try {
2361
- return element.matches(":modal");
2362
- } catch (_e) {
2363
- return false;
2364
- }
2365
- }
2366
- var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
2367
- var containRe = /paint|layout|strict|content/;
2368
- var isNotNone = (value) => !!value && value !== "none";
2369
- var isWebKitValue;
2370
- function isContainingBlock(elementOrCss) {
2371
- const css2 = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
2372
- 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 || "");
2373
- }
2374
- function getContainingBlock(element) {
2375
- let currentNode = getParentNode(element);
2376
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
2377
- if (isContainingBlock(currentNode)) {
2378
- return currentNode;
2379
- } else if (isTopLayer(currentNode)) {
2380
- return null;
2381
- }
2382
- currentNode = getParentNode(currentNode);
2383
- }
2384
- return null;
2385
- }
2386
- function isWebKit2() {
2387
- if (isWebKitValue == null) {
2388
- isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
2389
- }
2390
- return isWebKitValue;
2391
- }
2392
- function isLastTraversableNode(node) {
2393
- return /^(html|body|#document)$/.test(getNodeName(node));
2394
- }
2395
- function getComputedStyle2(element) {
2396
- return getWindow(element).getComputedStyle(element);
2397
- }
2398
- function getNodeScroll(element) {
2399
- if (isElement(element)) {
2400
- return {
2401
- scrollLeft: element.scrollLeft,
2402
- scrollTop: element.scrollTop
2403
- };
2404
- }
2405
- return {
2406
- scrollLeft: element.scrollX,
2407
- scrollTop: element.scrollY
2408
- };
2409
- }
2410
- function getParentNode(node) {
2411
- if (getNodeName(node) === "html") {
2412
- return node;
2413
- }
2414
- const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
2415
- return isShadowRoot(result) ? result.host : result;
2416
- }
2417
- function getNearestOverflowAncestor(node) {
2418
- const parentNode = getParentNode(node);
2419
- if (isLastTraversableNode(parentNode)) {
2420
- return (node.ownerDocument || node).body;
2421
- }
2422
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
2423
- return parentNode;
2424
- }
2425
- return getNearestOverflowAncestor(parentNode);
2426
- }
2427
- function getOverflowAncestors(node, list, traverseIframes) {
2428
- var _node$ownerDocument2;
2429
- if (list === undefined) {
2430
- list = [];
2431
- }
2432
- if (traverseIframes === undefined) {
2433
- traverseIframes = true;
2434
- }
2435
- const scrollableAncestor = getNearestOverflowAncestor(node);
2436
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? undefined : _node$ownerDocument2.body);
2437
- const win = getWindow(scrollableAncestor);
2438
- if (isBody) {
2439
- const frameElement = getFrameElement(win);
2440
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
2441
- } else {
2442
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
2443
- }
2444
- }
2445
- function getFrameElement(win) {
2446
- return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
2447
- }
2448
-
2449
- // ../../node_modules/@spectrum-web-components/overlay/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
2450
- function getCssDimensions(element) {
2451
- const css2 = getComputedStyle2(element);
2452
- let width = parseFloat(css2.width) || 0;
2453
- let height = parseFloat(css2.height) || 0;
2454
- const hasOffset = isHTMLElement(element);
2455
- const offsetWidth = hasOffset ? element.offsetWidth : width;
2456
- const offsetHeight = hasOffset ? element.offsetHeight : height;
2457
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
2458
- if (shouldFallback) {
2459
- width = offsetWidth;
2460
- height = offsetHeight;
2461
- }
2462
- return {
2463
- width,
2464
- height,
2465
- $: shouldFallback
2466
- };
2467
- }
2468
- function unwrapElement(element) {
2469
- return !isElement(element) ? element.contextElement : element;
2470
- }
2471
- function getScale(element) {
2472
- const domElement = unwrapElement(element);
2473
- if (!isHTMLElement(domElement)) {
2474
- return createCoords(1);
2475
- }
2476
- const rect = domElement.getBoundingClientRect();
2477
- const {
2478
- width,
2479
- height,
2480
- $
2481
- } = getCssDimensions(domElement);
2482
- let x = ($ ? round(rect.width) : rect.width) / width;
2483
- let y = ($ ? round(rect.height) : rect.height) / height;
2484
- if (!x || !Number.isFinite(x)) {
2485
- x = 1;
2486
- }
2487
- if (!y || !Number.isFinite(y)) {
2488
- y = 1;
2489
- }
2490
- return {
2491
- x,
2492
- y
2493
- };
2494
- }
2495
- var noOffsets = /* @__PURE__ */ createCoords(0);
2496
- function getVisualOffsets(element) {
2497
- const win = getWindow(element);
2498
- if (!isWebKit2() || !win.visualViewport) {
2499
- return noOffsets;
2500
- }
2501
- return {
2502
- x: win.visualViewport.offsetLeft,
2503
- y: win.visualViewport.offsetTop
2504
- };
2505
- }
2506
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
2507
- if (isFixed === undefined) {
2508
- isFixed = false;
2509
- }
2510
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
2511
- return false;
2512
- }
2513
- return isFixed;
2514
- }
2515
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
2516
- if (includeScale === undefined) {
2517
- includeScale = false;
2518
- }
2519
- if (isFixedStrategy === undefined) {
2520
- isFixedStrategy = false;
2521
- }
2522
- const clientRect = element.getBoundingClientRect();
2523
- const domElement = unwrapElement(element);
2524
- let scale = createCoords(1);
2525
- if (includeScale) {
2526
- if (offsetParent) {
2527
- if (isElement(offsetParent)) {
2528
- scale = getScale(offsetParent);
2529
- }
2530
- } else {
2531
- scale = getScale(element);
2532
- }
2533
- }
2534
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
2535
- let x = (clientRect.left + visualOffsets.x) / scale.x;
2536
- let y = (clientRect.top + visualOffsets.y) / scale.y;
2537
- let width = clientRect.width / scale.x;
2538
- let height = clientRect.height / scale.y;
2539
- if (domElement) {
2540
- const win = getWindow(domElement);
2541
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
2542
- let currentWin = win;
2543
- let currentIFrame = getFrameElement(currentWin);
2544
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
2545
- const iframeScale = getScale(currentIFrame);
2546
- const iframeRect = currentIFrame.getBoundingClientRect();
2547
- const css2 = getComputedStyle2(currentIFrame);
2548
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css2.paddingLeft)) * iframeScale.x;
2549
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css2.paddingTop)) * iframeScale.y;
2550
- x *= iframeScale.x;
2551
- y *= iframeScale.y;
2552
- width *= iframeScale.x;
2553
- height *= iframeScale.y;
2554
- x += left;
2555
- y += top;
2556
- currentWin = getWindow(currentIFrame);
2557
- currentIFrame = getFrameElement(currentWin);
2558
- }
2559
- }
2560
- return rectToClientRect({
2561
- width,
2562
- height,
2563
- x,
2564
- y
2565
- });
2566
- }
2567
- function getWindowScrollBarX(element, rect) {
2568
- const leftScroll = getNodeScroll(element).scrollLeft;
2569
- if (!rect) {
2570
- return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
2571
- }
2572
- return rect.left + leftScroll;
2573
- }
2574
- function getHTMLOffset(documentElement, scroll) {
2575
- const htmlRect = documentElement.getBoundingClientRect();
2576
- const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
2577
- const y = htmlRect.top + scroll.scrollTop;
2578
- return {
2579
- x,
2580
- y
2581
- };
2582
- }
2583
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
2584
- let {
2585
- elements,
2586
- rect,
2587
- offsetParent,
2588
- strategy
2589
- } = _ref;
2590
- const isFixed = strategy === "fixed";
2591
- const documentElement = getDocumentElement(offsetParent);
2592
- const topLayer = elements ? isTopLayer(elements.floating) : false;
2593
- if (offsetParent === documentElement || topLayer && isFixed) {
2594
- return rect;
2595
- }
2596
- let scroll = {
2597
- scrollLeft: 0,
2598
- scrollTop: 0
2599
- };
2600
- let scale = createCoords(1);
2601
- const offsets = createCoords(0);
2602
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
2603
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2604
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
2605
- scroll = getNodeScroll(offsetParent);
2606
- }
2607
- if (isHTMLElement(offsetParent)) {
2608
- const offsetRect = getBoundingClientRect(offsetParent);
2609
- scale = getScale(offsetParent);
2610
- offsets.x = offsetRect.x + offsetParent.clientLeft;
2611
- offsets.y = offsetRect.y + offsetParent.clientTop;
2612
- }
2613
- }
2614
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
2615
- return {
2616
- width: rect.width * scale.x,
2617
- height: rect.height * scale.y,
2618
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
2619
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
2620
- };
2621
- }
2622
- function getClientRects(element) {
2623
- return Array.from(element.getClientRects());
2624
- }
2625
- function getDocumentRect(element) {
2626
- const html2 = getDocumentElement(element);
2627
- const scroll = getNodeScroll(element);
2628
- const body = element.ownerDocument.body;
2629
- const width = max2(html2.scrollWidth, html2.clientWidth, body.scrollWidth, body.clientWidth);
2630
- const height = max2(html2.scrollHeight, html2.clientHeight, body.scrollHeight, body.clientHeight);
2631
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
2632
- const y = -scroll.scrollTop;
2633
- if (getComputedStyle2(body).direction === "rtl") {
2634
- x += max2(html2.clientWidth, body.clientWidth) - width;
2635
- }
2636
- return {
2637
- width,
2638
- height,
2639
- x,
2640
- y
2641
- };
2642
- }
2643
- var SCROLLBAR_MAX = 25;
2644
- function getViewportRect(element, strategy) {
2645
- const win = getWindow(element);
2646
- const html2 = getDocumentElement(element);
2647
- const visualViewport = win.visualViewport;
2648
- let width = html2.clientWidth;
2649
- let height = html2.clientHeight;
2650
- let x = 0;
2651
- let y = 0;
2652
- if (visualViewport) {
2653
- width = visualViewport.width;
2654
- height = visualViewport.height;
2655
- const visualViewportBased = isWebKit2();
2656
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
2657
- x = visualViewport.offsetLeft;
2658
- y = visualViewport.offsetTop;
2659
- }
2660
- }
2661
- const windowScrollbarX = getWindowScrollBarX(html2);
2662
- if (windowScrollbarX <= 0) {
2663
- const doc = html2.ownerDocument;
2664
- const body = doc.body;
2665
- const bodyStyles = getComputedStyle(body);
2666
- const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
2667
- const clippingStableScrollbarWidth = Math.abs(html2.clientWidth - body.clientWidth - bodyMarginInline);
2668
- if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
2669
- width -= clippingStableScrollbarWidth;
2670
- }
2671
- } else if (windowScrollbarX <= SCROLLBAR_MAX) {
2672
- width += windowScrollbarX;
2673
- }
2674
- return {
2675
- width,
2676
- height,
2677
- x,
2678
- y
2679
- };
2680
- }
2681
- var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
2682
- function getInnerBoundingClientRect(element, strategy) {
2683
- const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
2684
- const top = clientRect.top + element.clientTop;
2685
- const left = clientRect.left + element.clientLeft;
2686
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
2687
- const width = element.clientWidth * scale.x;
2688
- const height = element.clientHeight * scale.y;
2689
- const x = left * scale.x;
2690
- const y = top * scale.y;
2691
- return {
2692
- width,
2693
- height,
2694
- x,
2695
- y
2696
- };
2697
- }
2698
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
2699
- let rect;
2700
- if (clippingAncestor === "viewport") {
2701
- rect = getViewportRect(element, strategy);
2702
- } else if (clippingAncestor === "document") {
2703
- rect = getDocumentRect(getDocumentElement(element));
2704
- } else if (isElement(clippingAncestor)) {
2705
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
2706
- } else {
2707
- const visualOffsets = getVisualOffsets(element);
2708
- rect = {
2709
- x: clippingAncestor.x - visualOffsets.x,
2710
- y: clippingAncestor.y - visualOffsets.y,
2711
- width: clippingAncestor.width,
2712
- height: clippingAncestor.height
2713
- };
2714
- }
2715
- return rectToClientRect(rect);
2716
- }
2717
- function hasFixedPositionAncestor(element, stopNode) {
2718
- const parentNode = getParentNode(element);
2719
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
2720
- return false;
2721
- }
2722
- return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
2723
- }
2724
- function getClippingElementAncestors(element, cache) {
2725
- const cachedResult = cache.get(element);
2726
- if (cachedResult) {
2727
- return cachedResult;
2728
- }
2729
- let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
2730
- let currentContainingBlockComputedStyle = null;
2731
- const elementIsFixed = getComputedStyle2(element).position === "fixed";
2732
- let currentNode = elementIsFixed ? getParentNode(element) : element;
2733
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
2734
- const computedStyle = getComputedStyle2(currentNode);
2735
- const currentNodeIsContaining = isContainingBlock(currentNode);
2736
- if (!currentNodeIsContaining && computedStyle.position === "fixed") {
2737
- currentContainingBlockComputedStyle = null;
2738
- }
2739
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
2740
- if (shouldDropCurrentNode) {
2741
- result = result.filter((ancestor) => ancestor !== currentNode);
2742
- } else {
2743
- currentContainingBlockComputedStyle = computedStyle;
2744
- }
2745
- currentNode = getParentNode(currentNode);
2746
- }
2747
- cache.set(element, result);
2748
- return result;
2749
- }
2750
- function getClippingRect(_ref) {
2751
- let {
2752
- element,
2753
- boundary,
2754
- rootBoundary,
2755
- strategy
2756
- } = _ref;
2757
- const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
2758
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
2759
- const firstClippingAncestor = clippingAncestors[0];
2760
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
2761
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
2762
- accRect.top = max2(rect.top, accRect.top);
2763
- accRect.right = min2(rect.right, accRect.right);
2764
- accRect.bottom = min2(rect.bottom, accRect.bottom);
2765
- accRect.left = max2(rect.left, accRect.left);
2766
- return accRect;
2767
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
2768
- return {
2769
- width: clippingRect.right - clippingRect.left,
2770
- height: clippingRect.bottom - clippingRect.top,
2771
- x: clippingRect.left,
2772
- y: clippingRect.top
2773
- };
2774
- }
2775
- function getDimensions(element) {
2776
- const {
2777
- width,
2778
- height
2779
- } = getCssDimensions(element);
2780
- return {
2781
- width,
2782
- height
2783
- };
2784
- }
2785
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
2786
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
2787
- const documentElement = getDocumentElement(offsetParent);
2788
- const isFixed = strategy === "fixed";
2789
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
2790
- let scroll = {
2791
- scrollLeft: 0,
2792
- scrollTop: 0
2793
- };
2794
- const offsets = createCoords(0);
2795
- function setLeftRTLScrollbarOffset() {
2796
- offsets.x = getWindowScrollBarX(documentElement);
2797
- }
2798
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2799
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
2800
- scroll = getNodeScroll(offsetParent);
2801
- }
2802
- if (isOffsetParentAnElement) {
2803
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
2804
- offsets.x = offsetRect.x + offsetParent.clientLeft;
2805
- offsets.y = offsetRect.y + offsetParent.clientTop;
2806
- } else if (documentElement) {
2807
- setLeftRTLScrollbarOffset();
2808
- }
2809
- }
2810
- if (isFixed && !isOffsetParentAnElement && documentElement) {
2811
- setLeftRTLScrollbarOffset();
2812
- }
2813
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
2814
- const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
2815
- const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
2816
- return {
2817
- x,
2818
- y,
2819
- width: rect.width,
2820
- height: rect.height
2821
- };
2822
- }
2823
- function isStaticPositioned(element) {
2824
- return getComputedStyle2(element).position === "static";
2825
- }
2826
- function getTrueOffsetParent(element, polyfill) {
2827
- if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
2828
- return null;
2829
- }
2830
- if (polyfill) {
2831
- return polyfill(element);
2832
- }
2833
- let rawOffsetParent = element.offsetParent;
2834
- if (getDocumentElement(element) === rawOffsetParent) {
2835
- rawOffsetParent = rawOffsetParent.ownerDocument.body;
2836
- }
2837
- return rawOffsetParent;
2838
- }
2839
- function getOffsetParent(element, polyfill) {
2840
- const win = getWindow(element);
2841
- if (isTopLayer(element)) {
2842
- return win;
2843
- }
2844
- if (!isHTMLElement(element)) {
2845
- let svgOffsetParent = getParentNode(element);
2846
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
2847
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
2848
- return svgOffsetParent;
2849
- }
2850
- svgOffsetParent = getParentNode(svgOffsetParent);
2851
- }
2852
- return win;
2853
- }
2854
- let offsetParent = getTrueOffsetParent(element, polyfill);
2855
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
2856
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
2857
- }
2858
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
2859
- return win;
2860
- }
2861
- return offsetParent || getContainingBlock(element) || win;
2862
- }
2863
- var getElementRects = async function(data) {
2864
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
2865
- const getDimensionsFn = this.getDimensions;
2866
- const floatingDimensions = await getDimensionsFn(data.floating);
2867
- return {
2868
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
2869
- floating: {
2870
- x: 0,
2871
- y: 0,
2872
- width: floatingDimensions.width,
2873
- height: floatingDimensions.height
2874
- }
2875
- };
2876
- };
2877
- function isRTL(element) {
2878
- return getComputedStyle2(element).direction === "rtl";
2879
- }
2880
- var platform = {
2881
- convertOffsetParentRelativeRectToViewportRelativeRect,
2882
- getDocumentElement,
2883
- getClippingRect,
2884
- getOffsetParent,
2885
- getElementRects,
2886
- getClientRects,
2887
- getDimensions,
2888
- getScale,
2889
- isElement,
2890
- isRTL
2891
- };
2892
- function rectsAreEqual(a, b) {
2893
- return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
2894
- }
2895
- function observeMove(element, onMove) {
2896
- let io = null;
2897
- let timeoutId;
2898
- const root = getDocumentElement(element);
2899
- function cleanup() {
2900
- var _io;
2901
- clearTimeout(timeoutId);
2902
- (_io = io) == null || _io.disconnect();
2903
- io = null;
2904
- }
2905
- function refresh(skip, threshold) {
2906
- if (skip === undefined) {
2907
- skip = false;
2908
- }
2909
- if (threshold === undefined) {
2910
- threshold = 1;
2911
- }
2912
- cleanup();
2913
- const elementRectForRootMargin = element.getBoundingClientRect();
2914
- const {
2915
- left,
2916
- top,
2917
- width,
2918
- height
2919
- } = elementRectForRootMargin;
2920
- if (!skip) {
2921
- onMove();
2922
- }
2923
- if (!width || !height) {
2924
- return;
2925
- }
2926
- const insetTop = floor(top);
2927
- const insetRight = floor(root.clientWidth - (left + width));
2928
- const insetBottom = floor(root.clientHeight - (top + height));
2929
- const insetLeft = floor(left);
2930
- const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
2931
- const options = {
2932
- rootMargin,
2933
- threshold: max2(0, min2(1, threshold)) || 1
2934
- };
2935
- let isFirstUpdate = true;
2936
- function handleObserve(entries) {
2937
- const ratio = entries[0].intersectionRatio;
2938
- if (ratio !== threshold) {
2939
- if (!isFirstUpdate) {
2940
- return refresh();
2941
- }
2942
- if (!ratio) {
2943
- timeoutId = setTimeout(() => {
2944
- refresh(false, 0.0000001);
2945
- }, 1000);
2946
- } else {
2947
- refresh(false, ratio);
2948
- }
2949
- }
2950
- if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
2951
- refresh();
2952
- }
2953
- isFirstUpdate = false;
2954
- }
2955
- try {
2956
- io = new IntersectionObserver(handleObserve, {
2957
- ...options,
2958
- root: root.ownerDocument
2959
- });
2960
- } catch (_e) {
2961
- io = new IntersectionObserver(handleObserve, options);
2962
- }
2963
- io.observe(element);
2964
- }
2965
- refresh(true);
2966
- return cleanup;
2967
- }
2968
- function autoUpdate(reference, floating, update, options) {
2969
- if (options === undefined) {
2970
- options = {};
2971
- }
2972
- const {
2973
- ancestorScroll = true,
2974
- ancestorResize = true,
2975
- elementResize = typeof ResizeObserver === "function",
2976
- layoutShift = typeof IntersectionObserver === "function",
2977
- animationFrame = false
2978
- } = options;
2979
- const referenceEl = unwrapElement(reference);
2980
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
2981
- ancestors.forEach((ancestor) => {
2982
- ancestorScroll && ancestor.addEventListener("scroll", update, {
2983
- passive: true
2984
- });
2985
- ancestorResize && ancestor.addEventListener("resize", update);
2986
- });
2987
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
2988
- let reobserveFrame = -1;
2989
- let resizeObserver = null;
2990
- if (elementResize) {
2991
- resizeObserver = new ResizeObserver((_ref) => {
2992
- let [firstEntry] = _ref;
2993
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
2994
- resizeObserver.unobserve(floating);
2995
- cancelAnimationFrame(reobserveFrame);
2996
- reobserveFrame = requestAnimationFrame(() => {
2997
- var _resizeObserver;
2998
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
2999
- });
3000
- }
3001
- update();
3002
- });
3003
- if (referenceEl && !animationFrame) {
3004
- resizeObserver.observe(referenceEl);
3005
- }
3006
- resizeObserver.observe(floating);
3007
- }
3008
- let frameId;
3009
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
3010
- if (animationFrame) {
3011
- frameLoop();
3012
- }
3013
- function frameLoop() {
3014
- const nextRefRect = getBoundingClientRect(reference);
3015
- if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
3016
- update();
3017
- }
3018
- prevRefRect = nextRefRect;
3019
- frameId = requestAnimationFrame(frameLoop);
3020
- }
3021
- update();
3022
- return () => {
3023
- var _resizeObserver2;
3024
- ancestors.forEach((ancestor) => {
3025
- ancestorScroll && ancestor.removeEventListener("scroll", update);
3026
- ancestorResize && ancestor.removeEventListener("resize", update);
3027
- });
3028
- cleanupIo == null || cleanupIo();
3029
- (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
3030
- resizeObserver = null;
3031
- if (animationFrame) {
3032
- cancelAnimationFrame(frameId);
3033
- }
3034
- };
3035
- }
3036
- var offset2 = offset;
3037
- var shift2 = shift;
3038
- var flip2 = flip;
3039
- var size2 = size;
3040
- var arrow2 = arrow;
3041
- var computePosition2 = (reference, floating, options) => {
3042
- const cache = new Map;
3043
- const mergedOptions = {
3044
- platform,
3045
- ...options
3046
- };
3047
- const platformWithCache = {
3048
- ...mergedOptions.platform,
3049
- _c: cache
3050
- };
3051
- return computePosition(reference, floating, {
3052
- ...mergedOptions,
3053
- platform: platformWithCache
3054
- });
3055
- };
3056
-
3057
- // ../../node_modules/@spectrum-web-components/overlay/src/PlacementController.dev.js
3058
- function roundByDPR(num) {
3059
- if (typeof num === "undefined") {
3060
- return 0;
3061
- }
3062
- const dpr = window.devicePixelRatio || 1;
3063
- return Math.round(num * dpr) / dpr;
3064
- }
3065
- var REQUIRED_DISTANCE_TO_EDGE = 8;
3066
- var MIN_OVERLAY_HEIGHT = 100;
3067
- var getFallbackPlacements = (placement) => {
3068
- var _a;
3069
- const fallbacks = {
3070
- left: ["right", "bottom", "top"],
3071
- "left-start": ["right-start", "bottom", "top"],
3072
- "left-end": ["right-end", "bottom", "top"],
3073
- right: ["left", "bottom", "top"],
3074
- "right-start": ["left-start", "bottom", "top"],
3075
- "right-end": ["left-end", "bottom", "top"],
3076
- top: ["bottom", "left", "right"],
3077
- "top-start": ["bottom-start", "left", "right"],
3078
- "top-end": ["bottom-end", "left", "right"],
3079
- bottom: ["top", "left", "right"],
3080
- "bottom-start": ["top-start", "left", "right"],
3081
- "bottom-end": ["top-end", "left", "right"]
3082
- };
3083
- return (_a = fallbacks[placement]) != null ? _a : [placement];
3084
- };
3085
- var placementUpdatedSymbol = Symbol("placement updated");
3086
-
3087
- class PlacementController {
3088
- constructor(host) {
3089
- this.originalPlacements = /* @__PURE__ */ new WeakMap;
3090
- this.placementGeneration = 0;
3091
- this.allowPlacementUpdate = false;
3092
- this.closeForAncestorUpdate = () => {
3093
- if (!this.allowPlacementUpdate && this.options.type !== "modal" && this.cleanup) {
3094
- this.target.dispatchEvent(new Event("close", { bubbles: true }));
3095
- }
3096
- this.allowPlacementUpdate = false;
3097
- };
3098
- this.updatePlacement = () => {
3099
- this.computePlacement();
3100
- };
3101
- this.resetOverlayPosition = () => {
3102
- if (!this.target || !this.options) {
3103
- return;
3104
- }
3105
- this.clearOverlayPosition();
3106
- this.host.offsetHeight;
3107
- this.computePlacement();
3108
- };
3109
- this.host = host;
3110
- this.host.addController(this);
3111
- }
3112
- async placeOverlay(target = this.target, options = this.options) {
3113
- var _a;
3114
- (_a = this.cleanup) == null || _a.call(this);
3115
- this.cleanup = undefined;
3116
- this.target = target;
3117
- this.options = options;
3118
- if (!target || !options) {
3119
- return;
3120
- }
3121
- const cleanupAncestorResize = autoUpdate(options.trigger, target, this.closeForAncestorUpdate, {
3122
- ancestorResize: false,
3123
- elementResize: false,
3124
- layoutShift: false
3125
- });
3126
- const cleanupElementResize = autoUpdate(options.trigger, target, this.updatePlacement, {
3127
- ancestorScroll: false
3128
- });
3129
- const visualViewport = window.visualViewport;
3130
- let visualViewportRafId = 0;
3131
- let visualViewportPlacementCancelled = false;
3132
- const onVisualViewportChange = () => {
3133
- if (visualViewportPlacementCancelled || visualViewportRafId) {
3134
- return;
3135
- }
3136
- visualViewportRafId = requestAnimationFrame(() => {
3137
- visualViewportRafId = 0;
3138
- if (visualViewportPlacementCancelled) {
3139
- return;
3140
- }
3141
- this.updatePlacement();
3142
- });
3143
- };
3144
- if (visualViewport && isWebKit()) {
3145
- visualViewport.addEventListener("resize", onVisualViewportChange, {
3146
- passive: true
3147
- });
3148
- visualViewport.addEventListener("scroll", onVisualViewportChange, {
3149
- passive: true
3150
- });
3151
- }
3152
- this.cleanup = () => {
3153
- var _a2;
3154
- this.placementGeneration += 1;
3155
- visualViewportPlacementCancelled = true;
3156
- (_a2 = this.host.elements) == null || _a2.forEach((element) => {
3157
- element.addEventListener("sp-closed", () => {
3158
- const placement = this.originalPlacements.get(element);
3159
- if (placement) {
3160
- element.setAttribute("placement", placement);
3161
- }
3162
- this.originalPlacements.delete(element);
3163
- }, { once: true });
3164
- });
3165
- cleanupAncestorResize();
3166
- cleanupElementResize();
3167
- if (visualViewport && isWebKit()) {
3168
- visualViewport.removeEventListener("resize", onVisualViewportChange);
3169
- visualViewport.removeEventListener("scroll", onVisualViewportChange);
3170
- if (visualViewportRafId) {
3171
- cancelAnimationFrame(visualViewportRafId);
3172
- visualViewportRafId = 0;
3173
- }
3174
- }
3175
- };
3176
- }
3177
- async computePlacement() {
3178
- var _a, _b;
3179
- const { options, target } = this;
3180
- const genAtStart = this.placementGeneration;
3181
- const placementStillValid = () => this.host.open && this.placementGeneration === genAtStart && !!this.target && this.target === target;
3182
- await (document.fonts ? document.fonts.ready : Promise.resolve());
3183
- if (!placementStillValid()) {
3184
- return;
3185
- }
3186
- if (isWebKit()) {
3187
- await new Promise((resolve) => requestAnimationFrame(resolve));
3188
- }
3189
- if (!placementStillValid()) {
3190
- return;
3191
- }
3192
- const flipMiddleware = !(options.trigger instanceof HTMLElement) ? flip2({
3193
- padding: REQUIRED_DISTANCE_TO_EDGE,
3194
- fallbackPlacements: getFallbackPlacements(options.placement)
3195
- }) : flip2();
3196
- const [mainAxis = 0, crossAxis = 0] = Array.isArray(options == null ? undefined : options.offset) ? options.offset : [options.offset, 0];
3197
- const tipElement = (_a = this.host.elements.find((el) => el.tipElement)) == null ? undefined : _a.tipElement;
3198
- const middleware = [
3199
- offset2({
3200
- mainAxis,
3201
- crossAxis
3202
- }),
3203
- shift2({ padding: REQUIRED_DISTANCE_TO_EDGE }),
3204
- flipMiddleware,
3205
- size2({
3206
- padding: REQUIRED_DISTANCE_TO_EDGE,
3207
- apply: ({ availableWidth, availableHeight, rects: { floating } }) => {
3208
- const maxHeight = Math.max(MIN_OVERLAY_HEIGHT, Math.floor(availableHeight));
3209
- const actualHeight = floating.height;
3210
- this.initialHeight = !this.isConstrained ? actualHeight : this.initialHeight || actualHeight;
3211
- this.isConstrained = actualHeight < this.initialHeight || maxHeight <= actualHeight;
3212
- const appliedHeight = this.isConstrained ? `${maxHeight}px` : "";
3213
- Object.assign(target.style, {
3214
- maxWidth: `${Math.floor(availableWidth)}px`,
3215
- maxHeight: appliedHeight
3216
- });
3217
- }
3218
- }),
3219
- ...tipElement ? [
3220
- arrow2({
3221
- element: tipElement,
3222
- padding: options.tipPadding || REQUIRED_DISTANCE_TO_EDGE
3223
- })
3224
- ] : []
3225
- ];
3226
- const { x, y, placement, middlewareData } = await computePosition2(options.trigger, target, {
3227
- placement: options.placement,
3228
- middleware,
3229
- strategy: "fixed"
3230
- });
3231
- if (!placementStillValid()) {
3232
- return;
3233
- }
3234
- let translateX = x;
3235
- let translateY = y;
3236
- const visualViewport = window.visualViewport;
3237
- if (visualViewport && isWebKit()) {
3238
- translateX -= visualViewport.offsetLeft;
3239
- translateY -= visualViewport.offsetTop;
3240
- }
3241
- if (!placementStillValid()) {
3242
- return;
3243
- }
3244
- Object.assign(target.style, {
3245
- top: "0px",
3246
- left: "0px",
3247
- translate: `${roundByDPR(translateX)}px ${roundByDPR(translateY)}px`
3248
- });
3249
- target.setAttribute("actual-placement", placement);
3250
- (_b = this.host.elements) == null || _b.forEach((element) => {
3251
- if (!this.originalPlacements.has(element)) {
3252
- this.originalPlacements.set(element, element.getAttribute("placement"));
3253
- }
3254
- element.setAttribute("placement", placement);
3255
- });
3256
- if (!placementStillValid()) {
3257
- return;
3258
- }
3259
- if (tipElement && middlewareData.arrow) {
3260
- const { x: arrowX, y: arrowY } = middlewareData.arrow;
3261
- Object.assign(tipElement.style, {
3262
- top: placement.startsWith("right") || placement.startsWith("left") ? "0px" : "",
3263
- left: placement.startsWith("bottom") || placement.startsWith("top") ? "0px" : "",
3264
- translate: `${roundByDPR(arrowX)}px ${roundByDPR(arrowY)}px`
3265
- });
3266
- }
3267
- }
3268
- clearOverlayPosition() {
3269
- if (!this.target) {
3270
- return;
3271
- }
3272
- this.target.style.removeProperty("max-height");
3273
- this.target.style.removeProperty("max-width");
3274
- this.initialHeight = undefined;
3275
- this.isConstrained = false;
3276
- }
3277
- hostConnected() {
3278
- document.addEventListener("sp-update-overlays", this.resetOverlayPosition);
3279
- }
3280
- hostUpdated() {
3281
- var _a;
3282
- if (!this.host.open) {
3283
- (_a = this.cleanup) == null || _a.call(this);
3284
- this.cleanup = undefined;
3285
- }
3286
- }
3287
- hostDisconnected() {
3288
- var _a;
3289
- (_a = this.cleanup) == null || _a.call(this);
3290
- this.cleanup = undefined;
3291
- document.removeEventListener("sp-update-overlays", this.resetOverlayPosition);
3292
- }
3293
- }
3294
-
3295
- // ../../node_modules/@spectrum-web-components/base/src/condition-attribute-with-id.dev.js
3296
- function conditionAttributeWithoutId(el, attribute, ids) {
3297
- const ariaDescribedby = el.getAttribute(attribute);
3298
- let descriptors = ariaDescribedby ? ariaDescribedby.split(/\s+/) : [];
3299
- descriptors = descriptors.filter((descriptor) => !ids.find((id) => descriptor === id));
3300
- if (descriptors.length) {
3301
- el.setAttribute(attribute, descriptors.join(" "));
3302
- } else {
3303
- el.removeAttribute(attribute);
3304
- }
3305
- }
3306
- function conditionAttributeWithId(el, attribute, id) {
3307
- const ids = Array.isArray(id) ? id : [id];
3308
- const ariaDescribedby = el.getAttribute(attribute);
3309
- const descriptors = ariaDescribedby ? ariaDescribedby.split(/\s+/) : [];
3310
- const hadIds = ids.every((id2) => descriptors.indexOf(id2) > -1);
3311
- if (hadIds) {
3312
- return () => {
3313
- return;
3314
- };
3315
- }
3316
- descriptors.push(...ids);
3317
- el.setAttribute(attribute, descriptors.join(" "));
3318
- return () => conditionAttributeWithoutId(el, attribute, ids);
3319
- }
3320
-
3321
- // ../../node_modules/@spectrum-web-components/overlay/src/InteractionController.dev.js
3322
- var InteractionTypes = /* @__PURE__ */ ((InteractionTypes2) => {
3323
- InteractionTypes2["click"] = "click";
3324
- InteractionTypes2["hover"] = "hover";
3325
- InteractionTypes2["longpress"] = "longpress";
3326
- return InteractionTypes2;
3327
- })(InteractionTypes || {});
3328
- var lastInteractionType = Symbol("lastInteractionType");
3329
-
3330
- class InteractionController {
3331
- constructor(target, { overlay, isPersistent, handleOverlayReady }) {
3332
- this.target = target;
3333
- this.isLazilyOpen = false;
3334
- this.isPersistent = false;
3335
- this.isPersistent = !!isPersistent;
3336
- this.handleOverlayReady = handleOverlayReady;
3337
- if (this.isPersistent) {
3338
- this.init();
3339
- }
3340
- this.overlay = overlay;
3341
- }
3342
- get activelyOpening() {
3343
- return false;
3344
- }
3345
- get open() {
3346
- var _a, _b;
3347
- return (_b = (_a = this.overlay) == null ? undefined : _a.open) != null ? _b : this.isLazilyOpen;
3348
- }
3349
- set open(open) {
3350
- if (open === this.open) {
3351
- return;
3352
- }
3353
- this.isLazilyOpen = open;
3354
- if (this.overlay) {
3355
- this.overlay.open = open;
3356
- this.target[lastInteractionType] = this.type;
3357
- return;
3358
- }
3359
- if (!open) {
3360
- return;
3361
- }
3362
- customElements.whenDefined("sp-overlay").then(async () => {
3363
- const { Overlay } = await import("./Overlay.dev-etqjwyf9.js");
3364
- this.overlay = new Overlay;
3365
- this.overlay.open = true;
3366
- this.target[lastInteractionType] = this.type;
3367
- });
3368
- import("./sp-overlay.dev-qgvhnxf4.js");
3369
- }
3370
- get overlay() {
3371
- return this._overlay;
3372
- }
3373
- set overlay(overlay) {
3374
- var _a;
3375
- if (!overlay) {
3376
- return;
3377
- }
3378
- if (this._overlay === overlay) {
3379
- return;
3380
- }
3381
- if (this._overlay) {
3382
- this._overlay.removeController(this);
3383
- }
3384
- this._overlay = overlay;
3385
- overlay.addController(this);
3386
- this.initOverlay();
3387
- this.prepareDescription(this.target);
3388
- (_a = this.handleOverlayReady) == null || _a.call(this, overlay);
3389
- }
3390
- clearOverlay() {
3391
- if (this._overlay) {
3392
- this._overlay.removeController(this);
3393
- }
3394
- this._overlay = undefined;
3395
- }
3396
- prepareDescription(_) {}
3397
- releaseDescription() {}
3398
- shouldCompleteOpen() {}
3399
- init() {}
3400
- initOverlay() {}
3401
- abort() {
3402
- var _a;
3403
- this.releaseDescription();
3404
- (_a = this.abortController) == null || _a.abort();
3405
- }
3406
- hostConnected() {
3407
- this.init();
3408
- }
3409
- hostDisconnected() {
3410
- if (!this.isPersistent) {
3411
- this.abort();
3412
- }
3413
- }
3414
- }
3415
-
3416
- // ../../node_modules/@spectrum-web-components/overlay/src/LongpressController.dev.js
3417
- var LONGPRESS_DURATION = 300;
3418
- var LONGPRESS_INSTRUCTIONS = {
3419
- touch: "Double tap and long press for additional options",
3420
- keyboard: "Press Space or Alt+Down Arrow for additional options",
3421
- mouse: "Click and hold for additional options"
3422
- };
3423
-
3424
- class LongpressController extends InteractionController {
3425
- constructor() {
3426
- super(...arguments);
3427
- this.type = InteractionTypes.longpress;
3428
- this.longpressState = null;
3429
- this.releaseDescription = noop;
3430
- this.handlePointerup = () => {
3431
- var _a;
3432
- clearTimeout(this.timeout);
3433
- if (!this.target) {
3434
- return;
3435
- }
3436
- this.longpressState = ((_a = this.overlay) == null ? undefined : _a.state) === "opening" ? "pressed" : null;
3437
- document.removeEventListener("pointerup", this.handlePointerup);
3438
- document.removeEventListener("pointercancel", this.handlePointerup);
3439
- };
3440
- }
3441
- get activelyOpening() {
3442
- return this.longpressState === "opening" || this.longpressState === "pressed";
3443
- }
3444
- handleLongpress() {
3445
- this.open = true;
3446
- this.longpressState = this.longpressState === "potential" ? "opening" : "pressed";
3447
- }
3448
- handlePointerdown(event) {
3449
- if (!this.target) {
3450
- return;
3451
- }
3452
- if (event.button !== 0) {
3453
- return;
3454
- }
3455
- this.longpressState = "potential";
3456
- document.addEventListener("pointerup", this.handlePointerup);
3457
- document.addEventListener("pointercancel", this.handlePointerup);
3458
- const triggerHandlesLongpress = "holdAffordance" in this.target;
3459
- if (triggerHandlesLongpress) {
3460
- return;
3461
- }
3462
- this.timeout = setTimeout(() => {
3463
- if (!this.target) {
3464
- return;
3465
- }
3466
- this.target.dispatchEvent(new CustomEvent("longpress", {
3467
- bubbles: true,
3468
- composed: true,
3469
- detail: {
3470
- source: "pointer"
3471
- }
3472
- }));
3473
- }, LONGPRESS_DURATION);
3474
- }
3475
- handleKeydown(event) {
3476
- const { code, altKey } = event;
3477
- if (altKey && code === "ArrowDown") {
3478
- event.stopImmediatePropagation();
3479
- }
3480
- }
3481
- handleKeyup(event) {
3482
- const { code, altKey } = event;
3483
- if (code === "Space" || altKey && code === "ArrowDown") {
3484
- if (!this.target) {
3485
- return;
3486
- }
3487
- event.stopPropagation();
3488
- this.target.dispatchEvent(new CustomEvent("longpress", {
3489
- bubbles: true,
3490
- composed: true,
3491
- detail: {
3492
- source: "keyboard"
3493
- }
3494
- }));
3495
- setTimeout(() => {
3496
- this.longpressState = null;
3497
- });
3498
- }
3499
- }
3500
- prepareDescription(trigger) {
3501
- if (this.releaseDescription !== noop || !this.overlay || !this.overlay.elements.length) {
3502
- return;
3503
- }
3504
- const overlay = this.overlay;
3505
- if (overlay.describeTrigger === "none") {
3506
- return;
3507
- }
3508
- const longpressDescription = document.createElement("div");
3509
- longpressDescription.id = `longpress-describedby-descriptor-${randomID()}`;
3510
- const messageType = isIOS() || isAndroid() ? "touch" : "keyboard";
3511
- longpressDescription.textContent = LONGPRESS_INSTRUCTIONS[messageType];
3512
- longpressDescription.slot = "longpress-describedby-descriptor";
3513
- const triggerParent = trigger.getRootNode();
3514
- const overlayParent = this.overlay.getRootNode();
3515
- if (triggerParent === overlayParent) {
3516
- this.overlay.append(longpressDescription);
3517
- } else {
3518
- longpressDescription.hidden = !("host" in triggerParent);
3519
- trigger.insertAdjacentElement("afterend", longpressDescription);
3520
- }
3521
- const releaseDescription = conditionAttributeWithId(trigger, "aria-describedby", [longpressDescription.id]);
3522
- this.releaseDescription = () => {
3523
- releaseDescription();
3524
- longpressDescription.remove();
3525
- this.releaseDescription = noop;
3526
- };
3527
- }
3528
- shouldCompleteOpen() {
3529
- this.longpressState = this.longpressState === "pressed" ? null : this.longpressState;
3530
- }
3531
- init() {
3532
- var _a;
3533
- (_a = this.abortController) == null || _a.abort();
3534
- this.abortController = new AbortController;
3535
- const { signal } = this.abortController;
3536
- this.target.addEventListener("longpress", () => this.handleLongpress(), {
3537
- signal
3538
- });
3539
- this.target.addEventListener("pointerdown", (event) => this.handlePointerdown(event), { signal });
3540
- this.prepareDescription(this.target);
3541
- if (this.target.holdAffordance) {
3542
- return;
3543
- }
3544
- this.target.addEventListener("keydown", (event) => this.handleKeydown(event), { signal });
3545
- this.target.addEventListener("keyup", (event) => this.handleKeyup(event), { signal });
3546
- }
3547
- }
3548
- // ../../node_modules/@spectrum-web-components/overlay/src/overlay.css.js
3549
- var o = css`
3550
- :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))}}
3551
- `;
3552
- var overlay_css_default = o;
3553
-
3554
- // ../../node_modules/@spectrum-web-components/overlay/src/slottable-request-event.dev.js
3555
- class SlottableRequestEvent extends Event {
3556
- constructor(name, data, key) {
3557
- var _a;
3558
- super("slottable-request", {
3559
- bubbles: false,
3560
- cancelable: true,
3561
- composed: false
3562
- });
3563
- this.name = name;
3564
- this.data = data;
3565
- this.slotName = key !== undefined ? `${name}.${key}` : name;
3566
- if ((_a = window.__swc) == null ? undefined : _a.warn) {
3567
- 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.
3568
-
3569
- Learn more about the protocol these events are based on below:`, "https://github.com/webcomponents-cg/community-protocols/pull/45", {
3570
- level: "high",
3571
- type: "api"
3572
- });
3573
- }
3574
- }
3575
- }
3576
- var removeSlottableRequest = Symbol("remove-slottable-request");
3577
-
3578
- // ../../node_modules/@spectrum-web-components/overlay/src/ClickController.dev.js
3579
- class ClickController extends InteractionController {
3580
- constructor() {
3581
- super(...arguments);
3582
- this.type = InteractionTypes.click;
3583
- this.preventNextToggle = false;
3584
- }
3585
- handleClick() {
3586
- if (!this.preventNextToggle) {
3587
- this.open = !this.open;
3588
- }
3589
- this.preventNextToggle = false;
3590
- }
3591
- handlePointerdown() {
3592
- this.preventNextToggle = this.open;
3593
- }
3594
- init() {
3595
- var _a;
3596
- (_a = this.abortController) == null || _a.abort();
3597
- this.abortController = new AbortController;
3598
- const { signal } = this.abortController;
3599
- this.target.addEventListener("click", () => this.handleClick(), {
3600
- signal
3601
- });
3602
- this.target.addEventListener("pointerdown", () => this.handlePointerdown(), { signal });
3603
- }
3604
- }
3605
-
3606
- // ../../node_modules/@spectrum-web-components/overlay/src/HoverController.dev.js
3607
- class HoverController extends InteractionController {
3608
- constructor() {
3609
- super(...arguments);
3610
- this.type = InteractionTypes.hover;
3611
- this.elementIds = [];
3612
- this.targetFocused = false;
3613
- this.hovering = false;
3614
- this.overlayFocused = false;
3615
- }
3616
- handleKeyup(event) {
3617
- if (event.code === "Tab") {
3618
- this.open = true;
3619
- } else if (event.code === "Escape") {
3620
- if (this.open) {
3621
- event.preventDefault();
3622
- event.stopPropagation();
3623
- this.open = false;
3624
- if (this.target) {
3625
- this.target.focus();
3626
- }
3627
- }
3628
- }
3629
- }
3630
- handleTargetFocusin() {
3631
- if (!this.target.matches(":focus-visible")) {
3632
- return;
3633
- }
3634
- if (this.target[lastInteractionType] === InteractionTypes.click) {
3635
- return;
3636
- }
3637
- this.open = true;
3638
- this.targetFocused = true;
3639
- }
3640
- handleTargetFocusout() {
3641
- this.targetFocused = false;
3642
- if (this.hovering) {
3643
- return;
3644
- }
3645
- this.doFocusleave();
3646
- }
3647
- clearCloseTimeout() {
3648
- if (this.hoverTimeout) {
3649
- clearTimeout(this.hoverTimeout);
3650
- this.hoverTimeout = undefined;
3651
- }
3652
- }
3653
- handleTargetPointerenter() {
3654
- var _a;
3655
- this.clearCloseTimeout();
3656
- if ((_a = this.overlay) == null ? undefined : _a.disabled) {
3657
- return;
3658
- }
3659
- this.open = true;
3660
- this.hovering = true;
3661
- }
3662
- handleTargetPointerleave() {
3663
- this.doPointerleave();
3664
- }
3665
- handleHostPointerenter() {
3666
- this.clearCloseTimeout();
3667
- }
3668
- handleHostPointerleave() {
3669
- this.doPointerleave();
3670
- }
3671
- handleOverlayFocusin() {
3672
- this.overlayFocused = true;
3673
- this.clearCloseTimeout();
3674
- }
3675
- handleOverlayFocusout() {
3676
- this.overlayFocused = false;
3677
- if (this.hovering) {
3678
- return;
3679
- }
3680
- if (this.targetFocused && this.target.matches(":focus-visible")) {
3681
- return;
3682
- }
3683
- this.doFocusleave();
3684
- }
3685
- prepareDescription() {
3686
- if (!this.overlay || !this.overlay.elements.length) {
3687
- return;
3688
- }
3689
- const overlay = this.overlay;
3690
- if (overlay.describeTrigger === "none") {
3691
- return;
3692
- }
3693
- const triggerRoot = this.target.getRootNode();
3694
- const contentRoot = this.overlay.elements[0].getRootNode();
3695
- const overlayRoot = this.overlay.getRootNode();
3696
- if (triggerRoot === overlayRoot) {
3697
- this.prepareOverlayRelativeDescription();
3698
- } else if (triggerRoot === contentRoot) {
3699
- this.prepareContentRelativeDescription();
3700
- }
3701
- }
3702
- prepareOverlayRelativeDescription() {
3703
- if (!this.overlay) {
3704
- return;
3705
- }
3706
- const releaseDescription = conditionAttributeWithId(this.target, "aria-describedby", [this.overlay.id]);
3707
- this.releaseDescription = () => {
3708
- releaseDescription();
3709
- this.releaseDescription = noop;
3710
- };
3711
- }
3712
- prepareContentRelativeDescription() {
3713
- if (!this.overlay) {
3714
- return;
3715
- }
3716
- const overlay = this.overlay;
3717
- const elementIds = [];
3718
- const appliedIds = overlay.elements.map((el) => {
3719
- elementIds.push(el.id);
3720
- if (!el.id) {
3721
- el.id = `${overlay.tagName.toLowerCase()}-helper-${randomID()}`;
3722
- }
3723
- return el.id;
3724
- });
3725
- this.elementIds = elementIds;
3726
- const releaseDescription = conditionAttributeWithId(this.target, "aria-describedby", appliedIds);
3727
- this.releaseDescription = () => {
3728
- releaseDescription();
3729
- overlay.elements.map((el, index) => {
3730
- el.id = this.elementIds[index];
3731
- });
3732
- this.releaseDescription = noop;
3733
- };
3734
- }
3735
- scheduleClose() {
3736
- this.hoverTimeout = setTimeout(() => {
3737
- this.open = false;
3738
- }, 300);
3739
- }
3740
- doPointerleave() {
3741
- this.hovering = false;
3742
- const triggerElement = this.target;
3743
- if (this.targetFocused && triggerElement.matches(":focus-visible")) {
3744
- return;
3745
- }
3746
- if (this.overlayFocused) {
3747
- return;
3748
- }
3749
- this.scheduleClose();
3750
- }
3751
- doFocusleave() {
3752
- this.clearCloseTimeout();
3753
- if (!this.targetFocused && !this.overlayFocused && !this.hovering) {
3754
- this.scheduleClose();
3755
- }
3756
- }
3757
- init() {
3758
- var _a;
3759
- (_a = this.abortController) == null || _a.abort();
3760
- this.abortController = new AbortController;
3761
- const { signal } = this.abortController;
3762
- this.target.addEventListener("keyup", (event) => this.handleKeyup(event), {
3763
- signal
3764
- });
3765
- this.target.addEventListener("focusin", () => this.handleTargetFocusin(), {
3766
- signal
3767
- });
3768
- this.target.addEventListener("focusout", () => this.handleTargetFocusout(), { signal });
3769
- this.target.addEventListener("pointerenter", () => this.handleTargetPointerenter(), { signal });
3770
- this.target.addEventListener("pointerleave", () => this.handleTargetPointerleave(), { signal });
3771
- if (this.overlay) {
3772
- this.initOverlay();
3773
- }
3774
- }
3775
- initOverlay() {
3776
- if (!this.abortController || !this.overlay) {
3777
- return;
3778
- }
3779
- const { signal } = this.abortController;
3780
- this.overlay.addEventListener("pointerenter", () => this.handleHostPointerenter(), { signal });
3781
- this.overlay.addEventListener("pointerleave", () => this.handleHostPointerleave(), { signal });
3782
- this.overlay.addEventListener("focusin", () => this.handleOverlayFocusin(), { signal });
3783
- this.overlay.addEventListener("focusout", () => this.handleOverlayFocusout(), { signal });
3784
- this.overlay.addEventListener("keyup", (event) => this.handleKeyup(event), {
3785
- signal
3786
- });
3787
- }
3788
- }
3789
-
3790
- // ../../node_modules/@spectrum-web-components/overlay/src/strategies.dev.js
3791
- var strategies = {
3792
- click: ClickController,
3793
- longpress: LongpressController,
3794
- hover: HoverController
3795
- };
3796
-
3797
- // ../../node_modules/@spectrum-web-components/overlay/src/Overlay.dev.js
3798
- var __defProp4 = Object.defineProperty;
3799
- var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
3800
- var __decorateClass4 = (decorators, target, key, kind) => {
3801
- var result = kind > 1 ? undefined : kind ? __getOwnPropDesc4(target, key) : target;
3802
- for (var i = decorators.length - 1, decorator;i >= 0; i--)
3803
- if (decorator = decorators[i])
3804
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3805
- if (kind && result)
3806
- __defProp4(target, key, result);
3807
- return result;
3808
- };
3809
- var browserSupportsPopover = "showPopover" in document.createElement("div");
3810
- var ComputedOverlayBase = OverlayPopover(AbstractOverlay);
3811
- if (!browserSupportsPopover) {
3812
- ComputedOverlayBase = OverlayNoPopover(AbstractOverlay);
3813
- }
3814
- var _Overlay = class _Overlay2 extends ComputedOverlayBase {
3815
- constructor() {
3816
- super(...arguments);
3817
- this._delayed = false;
3818
- this._disabled = false;
3819
- this.offset = 0;
3820
- this._open = false;
3821
- this.lastRequestSlottableState = false;
3822
- this.receivesFocus = "auto";
3823
- this.allowOutsideClick = false;
3824
- this._state = "closed";
3825
- this.triggerElement = null;
3826
- this.describeTrigger = "auto";
3827
- this.type = "auto";
3828
- this.wasOpen = false;
3829
- this._focusTrap = null;
3830
- this.closeOnFocusOut = (event) => {
3831
- if (!event.relatedTarget) {
3832
- return;
3833
- }
3834
- const relationEvent = new Event("overlay-relation-query", {
3835
- bubbles: true,
3836
- composed: true
3837
- });
3838
- event.relatedTarget.addEventListener(relationEvent.type, (event2) => {
3839
- const path = event2.composedPath();
3840
- const isWithinOverlay = path.some((el) => el === this);
3841
- if (!isWithinOverlay) {
3842
- this.open = false;
3843
- }
3844
- });
3845
- event.relatedTarget.dispatchEvent(relationEvent);
3846
- };
3847
- this.closeOnCancelEvent = () => {
3848
- this.open = false;
3849
- };
3850
- }
3851
- get delayed() {
3852
- const lastElement = this.elements[this.elements.length - 1];
3853
- return (lastElement == null ? undefined : lastElement.hasAttribute("delayed")) || this._delayed;
3854
- }
3855
- set delayed(delayed) {
3856
- this._delayed = delayed;
3857
- }
3858
- get disabled() {
3859
- return this._disabled;
3860
- }
3861
- set disabled(disabled) {
3862
- var _a;
3863
- this._disabled = disabled;
3864
- if (disabled) {
3865
- (_a = this.strategy) == null || _a.abort();
3866
- this.wasOpen = this.open;
3867
- this.open = false;
3868
- } else {
3869
- this.bindEvents();
3870
- this.open = this.open || this.wasOpen;
3871
- this.wasOpen = false;
3872
- }
3873
- }
3874
- get hasNonVirtualTrigger() {
3875
- return !!this.triggerElement && !(this.triggerElement instanceof VirtualTrigger);
3876
- }
3877
- get placementController() {
3878
- if (!this._placementController) {
3879
- this._placementController = new PlacementController(this);
3880
- }
3881
- return this._placementController;
3882
- }
3883
- get open() {
3884
- return this._open;
3885
- }
3886
- set open(open) {
3887
- var _a;
3888
- if (open && this.disabled) {
3889
- return;
3890
- }
3891
- if (open === this.open) {
3892
- return;
3893
- }
3894
- if (((_a = this.strategy) == null ? undefined : _a.activelyOpening) && !open) {
3895
- return;
3896
- }
3897
- this._open = open;
3898
- if (this.open) {
3899
- _Overlay2.openCount += 1;
3900
- }
3901
- this.requestUpdate("open", !this.open);
3902
- if (this.open) {
3903
- this.requestSlottable();
3904
- }
3905
- }
3906
- get state() {
3907
- return this._state;
3908
- }
3909
- set state(state2) {
3910
- var _a;
3911
- if (state2 === this.state) {
3912
- return;
3913
- }
3914
- const oldState = this.state;
3915
- this._state = state2;
3916
- if (this.state === "opened" || this.state === "closed") {
3917
- (_a = this.strategy) == null || _a.shouldCompleteOpen();
3918
- }
3919
- this.requestUpdate("state", oldState);
3920
- }
3921
- get elementResolver() {
3922
- if (!this._elementResolver) {
3923
- this._elementResolver = new ElementResolutionController(this);
3924
- }
3925
- return this._elementResolver;
3926
- }
3927
- get popoverValue() {
3928
- const hasPopoverAttribute = "popover" in this;
3929
- if (!hasPopoverAttribute) {
3930
- return;
3931
- }
3932
- switch (this.type) {
3933
- case "modal":
3934
- return "manual";
3935
- case "page":
3936
- return "manual";
3937
- case "hint":
3938
- return "manual";
3939
- default:
3940
- return this.type;
3941
- }
3942
- }
3943
- get requiresPositioning() {
3944
- if (this.type === "page" || !this.open) {
3945
- return false;
3946
- }
3947
- if (!this.triggerElement || !this.placement && this.type !== "hint") {
3948
- return false;
3949
- }
3950
- return true;
3951
- }
3952
- get needsModalBackdrop() {
3953
- return this.open && (this.type === "modal" || this.type === "page");
3954
- }
3955
- managePosition() {
3956
- if (!this.requiresPositioning || !this.open) {
3957
- return;
3958
- }
3959
- const offset3 = this.offset || 0;
3960
- const trigger = this.triggerElement;
3961
- const placement = this.placement || "right";
3962
- const tipPadding = this.tipPadding;
3963
- this.placementController.placeOverlay(this.dialogEl, {
3964
- offset: offset3,
3965
- placement,
3966
- tipPadding,
3967
- trigger,
3968
- type: this.type
3969
- });
3970
- }
3971
- async managePopoverOpen() {
3972
- super.managePopoverOpen();
3973
- const targetOpenState = this.open;
3974
- if (this.open !== targetOpenState) {
3975
- return;
3976
- }
3977
- await this.manageDelay(targetOpenState);
3978
- if (this.open !== targetOpenState) {
3979
- return;
3980
- }
3981
- if (this.triggerInteraction === "longpress") {
3982
- await nextFrame();
3983
- }
3984
- await this.ensureOnDOM(targetOpenState);
3985
- if (this.open !== targetOpenState) {
3986
- return;
3987
- }
3988
- const focusEl = await this.makeTransition(targetOpenState);
3989
- if (this.open !== targetOpenState) {
3990
- return;
3991
- }
3992
- if (targetOpenState) {
3993
- const focusTrap = await import("./focus-trap.esm-9t2drp0g.js");
3994
- const initialFocus = this.receivesFocus === "false" ? false : focusEl || undefined;
3995
- this._focusTrap = focusTrap.createFocusTrap(this.dialogEl, {
3996
- initialFocus,
3997
- tabbableOptions: {
3998
- getShadowRoot: true
3999
- },
4000
- fallbackFocus: () => {
4001
- this.dialogEl.setAttribute("tabIndex", "-1");
4002
- return this.dialogEl;
4003
- },
4004
- escapeDeactivates: false,
4005
- allowOutsideClick: this.allowOutsideClick
4006
- });
4007
- if (this.type === "modal" || this.type === "page") {
4008
- this._focusTrap.activate();
4009
- }
4010
- }
4011
- await this.applyFocus(targetOpenState, focusEl);
4012
- }
4013
- async applyFocus(targetOpenState, focusEl) {
4014
- if (this.receivesFocus === "false" || this.type === "hint") {
4015
- return;
4016
- }
4017
- await nextFrame();
4018
- await nextFrame();
4019
- if (targetOpenState === this.open && !this.open) {
4020
- if (this.hasNonVirtualTrigger && this.contains(this.getRootNode().activeElement)) {
4021
- this.triggerElement.focus();
4022
- }
4023
- return;
4024
- }
4025
- focusEl == null || focusEl.focus();
4026
- }
4027
- returnFocus() {
4028
- var _a;
4029
- if (this.open || this.type === "hint") {
4030
- return;
4031
- }
4032
- const getAncestors = () => {
4033
- var _a2, _b;
4034
- const ancestors = [];
4035
- let currentNode = document.activeElement;
4036
- while ((_a2 = currentNode == null ? undefined : currentNode.shadowRoot) == null ? undefined : _a2.activeElement) {
4037
- currentNode = currentNode.shadowRoot.activeElement;
4038
- }
4039
- while (currentNode) {
4040
- const ancestor = currentNode.assignedSlot || currentNode.parentElement || ((_b = currentNode.getRootNode()) == null ? undefined : _b.host);
4041
- if (ancestor) {
4042
- ancestors.push(ancestor);
4043
- }
4044
- currentNode = ancestor;
4045
- }
4046
- return ancestors;
4047
- };
4048
- if (this.receivesFocus !== "false" && !!((_a = this.triggerElement) == null ? undefined : _a.focus) && (this.contains(this.getRootNode().activeElement) || getAncestors().includes(this) || document.activeElement === document.body)) {
4049
- this.triggerElement.focus();
4050
- }
4051
- }
4052
- async manageOpen(oldOpen) {
4053
- var _a;
4054
- if (!this.isConnected && this.open) {
4055
- return;
4056
- }
4057
- if (!this.hasUpdated) {
4058
- await this.updateComplete;
4059
- }
4060
- if (this.open) {
4061
- overlayStack.add(this);
4062
- if (this.willPreventClose) {
4063
- document.addEventListener("pointerup", () => {
4064
- this.dialogEl.classList.toggle("not-immediately-closable", false);
4065
- this.willPreventClose = false;
4066
- }, { once: true });
4067
- this.dialogEl.classList.toggle("not-immediately-closable", true);
4068
- }
4069
- } else {
4070
- if (oldOpen) {
4071
- (_a = this._focusTrap) == null || _a.deactivate();
4072
- this._focusTrap = null;
4073
- this.dispose();
4074
- }
4075
- overlayStack.remove(this);
4076
- }
4077
- if (this.open && this.state !== "opened") {
4078
- this.state = "opening";
4079
- } else if (!this.open && this.state !== "closed") {
4080
- this.state = "closing";
4081
- }
4082
- this.managePopoverOpen();
4083
- const listenerRoot = this.getRootNode();
4084
- if (this.type === "auto") {
4085
- if (this.open) {
4086
- listenerRoot.addEventListener("focusout", this.closeOnFocusOut, {
4087
- capture: true
4088
- });
4089
- } else {
4090
- listenerRoot.removeEventListener("focusout", this.closeOnFocusOut, {
4091
- capture: true
4092
- });
4093
- }
4094
- }
4095
- if (this.type === "modal" || this.type === "page") {
4096
- if (this.open) {
4097
- listenerRoot.addEventListener("cancel", this.closeOnCancelEvent, {
4098
- capture: true
4099
- });
4100
- } else {
4101
- listenerRoot.removeEventListener("cancel", this.closeOnCancelEvent, {
4102
- capture: true
4103
- });
4104
- }
4105
- }
4106
- }
4107
- bindEvents() {
4108
- var _a;
4109
- (_a = this.strategy) == null || _a.abort();
4110
- this.strategy = undefined;
4111
- if (!this.hasNonVirtualTrigger) {
4112
- return;
4113
- }
4114
- if (!this.triggerInteraction) {
4115
- return;
4116
- }
4117
- this.strategy = new strategies[this.triggerInteraction](this.triggerElement, {
4118
- overlay: this
4119
- });
4120
- }
4121
- handleBeforetoggle(event) {
4122
- if (event.newState !== "open") {
4123
- this.handleBrowserClose(event);
4124
- }
4125
- }
4126
- handleBrowserClose(event) {
4127
- var _a;
4128
- event.stopPropagation();
4129
- if (!((_a = this.strategy) == null ? undefined : _a.activelyOpening)) {
4130
- this.open = false;
4131
- return;
4132
- }
4133
- this.manuallyKeepOpen();
4134
- }
4135
- manuallyKeepOpen() {
4136
- this.open = true;
4137
- this.placementController.allowPlacementUpdate = true;
4138
- this.manageOpen(false);
4139
- }
4140
- handleSlotchange() {
4141
- var _a, _b;
4142
- if (!this.elements.length) {
4143
- (_a = this.strategy) == null || _a.releaseDescription();
4144
- } else if (this.hasNonVirtualTrigger) {
4145
- (_b = this.strategy) == null || _b.prepareDescription(this.triggerElement);
4146
- }
4147
- }
4148
- handleClose() {
4149
- this.open = false;
4150
- }
4151
- shouldPreventClose() {
4152
- const shouldPreventClose = this.willPreventClose;
4153
- this.willPreventClose = false;
4154
- return shouldPreventClose;
4155
- }
4156
- requestSlottable() {
4157
- if (this.lastRequestSlottableState === this.open) {
4158
- return;
4159
- }
4160
- if (!this.open) {
4161
- document.body.offsetHeight;
4162
- }
4163
- this.dispatchEvent(new SlottableRequestEvent("overlay-content", this.open ? {} : removeSlottableRequest));
4164
- this.lastRequestSlottableState = this.open;
4165
- }
4166
- willUpdate(changes) {
4167
- var _a;
4168
- if (!this.hasAttribute("id")) {
4169
- this.setAttribute("id", `${this.tagName.toLowerCase()}-${randomID()}`);
4170
- }
4171
- if (changes.has("allowOutsideClick") && this.allowOutsideClick) {
4172
- if (true) {
4173
- 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" });
4174
- }
4175
- }
4176
- if (changes.has("open") && (this.hasUpdated || this.open)) {
4177
- this.manageOpen(changes.get("open"));
4178
- }
4179
- if (changes.has("trigger")) {
4180
- const [id, interaction] = ((_a = this.trigger) == null ? undefined : _a.split("@")) || [];
4181
- this.elementResolver.selector = id ? `#${id}` : "";
4182
- this.triggerInteraction = interaction;
4183
- }
4184
- let oldTrigger = false;
4185
- if (changes.has(elementResolverUpdatedSymbol)) {
4186
- oldTrigger = this.triggerElement;
4187
- this.triggerElement = this.elementResolver.element;
4188
- }
4189
- if (changes.has("triggerElement")) {
4190
- oldTrigger = changes.get("triggerElement");
4191
- }
4192
- if (oldTrigger !== false) {
4193
- this.bindEvents();
4194
- }
4195
- }
4196
- updated(changes) {
4197
- super.updated(changes);
4198
- if (changes.has("placement")) {
4199
- if (this.placement) {
4200
- this.dialogEl.setAttribute("actual-placement", this.placement);
4201
- } else {
4202
- this.dialogEl.removeAttribute("actual-placement");
4203
- }
4204
- if (this.open && typeof changes.get("placement") !== "undefined") {
4205
- this.placementController.resetOverlayPosition();
4206
- }
4207
- }
4208
- if (changes.has("state") && this.state === "closed" && typeof changes.get("state") !== "undefined") {
4209
- this.placementController.clearOverlayPosition();
4210
- }
4211
- }
4212
- renderContent() {
4213
- return html`
4214
- <slot @slotchange=${this.handleSlotchange}></slot>
4215
- `;
4216
- }
4217
- get dialogStyleMap() {
4218
- return {
4219
- "--swc-overlay-open-count": _Overlay2.openCount.toString()
4220
- };
4221
- }
4222
- renderPopover() {
4223
- return html`
4224
- ${this.needsModalBackdrop ? html`
4225
- <div class="modal-backdrop"></div>
4226
- ` : nothing}
4227
- <div
4228
- class="dialog"
4229
- part="dialog"
4230
- role=${ifDefined(this.type === "modal" || this.type === "page" ? "dialog" : undefined)}
4231
- aria-modal=${ifDefined(this.type === "modal" || this.type === "page" ? "true" : undefined)}
4232
- placement=${ifDefined(this.requiresPositioning ? this.placement || "right" : undefined)}
4233
- popover=${ifDefined(this.popoverValue)}
4234
- style=${styleMap(this.dialogStyleMap)}
4235
- @beforetoggle=${this.handleBeforetoggle}
4236
- @close=${this.handleBrowserClose}
4237
- ?is-visible=${this.state !== "closed"}
4238
- >
4239
- ${this.renderContent()}
4240
- </div>
4241
- `;
4242
- }
4243
- render() {
4244
- return html`
4245
- ${this.renderPopover()}
4246
- <slot name="longpress-describedby-descriptor"></slot>
4247
- `;
4248
- }
4249
- connectedCallback() {
4250
- super.connectedCallback();
4251
- this.addEventListener("close", this.handleClose);
4252
- if (this.hasUpdated) {
4253
- this.bindEvents();
4254
- }
4255
- }
4256
- disconnectedCallback() {
4257
- var _a;
4258
- (_a = this.strategy) == null || _a.releaseDescription();
4259
- this.open = false;
4260
- this.removeEventListener("close", this.handleClose);
4261
- super.disconnectedCallback();
4262
- }
4263
- };
4264
- _Overlay.styles = [overlay_css_default];
4265
- _Overlay.openCount = 1;
4266
- __decorateClass4([
4267
- property({ type: Boolean })
4268
- ], _Overlay.prototype, "delayed", 1);
4269
- __decorateClass4([
4270
- query(".dialog")
4271
- ], _Overlay.prototype, "dialogEl", 2);
4272
- __decorateClass4([
4273
- property({ type: Boolean })
4274
- ], _Overlay.prototype, "disabled", 1);
4275
- __decorateClass4([
4276
- queryAssignedElements({
4277
- flatten: true,
4278
- selector: ':not([slot="longpress-describedby-descriptor"], slot)'
4279
- })
4280
- ], _Overlay.prototype, "elements", 2);
4281
- __decorateClass4([
4282
- property({ type: Number })
4283
- ], _Overlay.prototype, "offset", 2);
4284
- __decorateClass4([
4285
- property({ type: Boolean, reflect: true })
4286
- ], _Overlay.prototype, "open", 1);
4287
- __decorateClass4([
4288
- property()
4289
- ], _Overlay.prototype, "placement", 2);
4290
- __decorateClass4([
4291
- property({ attribute: "receives-focus" })
4292
- ], _Overlay.prototype, "receivesFocus", 2);
4293
- __decorateClass4([
4294
- property({ type: Boolean, attribute: "allow-outside-click" })
4295
- ], _Overlay.prototype, "allowOutsideClick", 2);
4296
- __decorateClass4([
4297
- query("slot")
4298
- ], _Overlay.prototype, "slotEl", 2);
4299
- __decorateClass4([
4300
- state()
4301
- ], _Overlay.prototype, "state", 1);
4302
- __decorateClass4([
4303
- property({ type: Number, attribute: "tip-padding" })
4304
- ], _Overlay.prototype, "tipPadding", 2);
4305
- __decorateClass4([
4306
- property()
4307
- ], _Overlay.prototype, "trigger", 2);
4308
- __decorateClass4([
4309
- property({ attribute: false })
4310
- ], _Overlay.prototype, "triggerElement", 2);
4311
- __decorateClass4([
4312
- property({ attribute: false })
4313
- ], _Overlay.prototype, "triggerInteraction", 2);
4314
- __decorateClass4([
4315
- property({ attribute: false })
4316
- ], _Overlay.prototype, "describeTrigger", 2);
4317
- __decorateClass4([
4318
- property()
4319
- ], _Overlay.prototype, "type", 2);
4320
- var Overlay = _Overlay;
4321
-
4322
- export { FocusVisiblePolyfillMixin, Focusable, LikeAnchor, MutationController, ObserveSlotPresence, ObserveSlotText, isIPhone, isIOS, isWebKit, isAndroid, randomID, conditionAttributeWithoutId, conditionAttributeWithId, elementResolverUpdatedSymbol, ElementResolutionController, LONGPRESS_INSTRUCTIONS, SlottableRequestEvent, Overlay };
4323
-
4324
- //# debugId=870A47F946E355DE64756E2164756E21
4325
- //# sourceMappingURL=studio-5fx3g9jg.js.map