@smwb/ui-solid 1.0.0 → 2.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 (213) hide show
  1. package/README.md +115 -0
  2. package/dist/assets/styles/less/components/appBar/appBar.entry.css +1 -1
  3. package/dist/assets/styles/less/components/avatar/avatar.entry.css +1 -1
  4. package/dist/assets/styles/less/components/badge/badge.entry.css +1 -1
  5. package/dist/assets/styles/less/components/breadcrumbs/breadcrumbs.entry.css +1 -1
  6. package/dist/assets/styles/less/components/button/button.entry.css +1 -1
  7. package/dist/assets/styles/less/components/buttonGroup/buttonGroup.entry.css +1 -1
  8. package/dist/assets/styles/less/components/dagView/dagView.entry.css +1 -1
  9. package/dist/assets/styles/less/components/meter/meter.entry.css +1 -1
  10. package/dist/assets/styles/less/components/screenDivider/screenDivider.entry.css +1 -1
  11. package/dist/assets/styles/less/components/sheet/sheet.entry.css +1 -1
  12. package/dist/assets/styles/less/components/statusDot/statusDot.entry.css +1 -1
  13. package/dist/assets/styles/less/components/tabGroups/tabGroups.entry.css +1 -1
  14. package/dist/assets/styles/less/components/tabs/tab/tab.entry.css +1 -1
  15. package/dist/assets/styles/less/components/toggle/toggle.entry.css +1 -1
  16. package/dist/assets/styles/less/components/treeView/treeView.entry.css +1 -1
  17. package/dist/assets/styles/less/tokens.entry.css +1 -1
  18. package/dist/components/dataDisplay/avatar/avatar.d.ts +5 -2
  19. package/dist/components/dataDisplay/avatar/avatar.js +9 -9
  20. package/dist/components/dataDisplay/avatar/avatar.js.map +1 -1
  21. package/dist/components/dataDisplay/badge/badge.d.ts +2 -1
  22. package/dist/components/dataDisplay/badge/badge.js.map +1 -1
  23. package/dist/components/dataDisplay/chart/chart.d.ts +16 -8
  24. package/dist/components/dataDisplay/chart/chartFull.d.ts +14 -0
  25. package/dist/components/dataDisplay/chart/core.d.ts +19 -0
  26. package/dist/components/dataDisplay/chart/index.d.ts +1 -1
  27. package/dist/components/dataDisplay/dagView/dagView.d.ts +4 -0
  28. package/dist/components/dataDisplay/dagView/dagView.js +124 -123
  29. package/dist/components/dataDisplay/dagView/dagView.js.map +1 -1
  30. package/dist/components/dataDisplay/dagView/index.d.ts +1 -1
  31. package/dist/components/dataDisplay/meter/index.d.ts +1 -1
  32. package/dist/components/dataDisplay/meter/meter.d.ts +14 -0
  33. package/dist/components/dataDisplay/meter/meter.js +32 -30
  34. package/dist/components/dataDisplay/meter/meter.js.map +1 -1
  35. package/dist/components/dataDisplay/statusDot/index.d.ts +1 -1
  36. package/dist/components/dataDisplay/statusDot/statusDot.d.ts +10 -1
  37. package/dist/components/dataDisplay/statusDot/statusDot.js +20 -11
  38. package/dist/components/dataDisplay/statusDot/statusDot.js.map +1 -1
  39. package/dist/components/dataDisplay/treeView/treeView.d.ts +18 -2
  40. package/dist/components/dataDisplay/treeView/treeView.js +140 -121
  41. package/dist/components/dataDisplay/treeView/treeView.js.map +1 -1
  42. package/dist/components/inputs/button/button.d.ts +7 -0
  43. package/dist/components/inputs/button/button.js +57 -51
  44. package/dist/components/inputs/button/button.js.map +1 -1
  45. package/dist/components/inputs/toggle/toggle.d.ts +6 -0
  46. package/dist/components/inputs/toggle/toggle.js +23 -23
  47. package/dist/components/inputs/toggle/toggle.js.map +1 -1
  48. package/dist/components/layout/appLayout/appLayout.d.ts +6 -1
  49. package/dist/components/layout/appLayout/appLayout.js +49 -42
  50. package/dist/components/layout/appLayout/appLayout.js.map +1 -1
  51. package/dist/components/layout/screenDivider/screenDivider.d.ts +12 -0
  52. package/dist/components/layout/screenDivider/screenDivider.js +87 -46
  53. package/dist/components/layout/screenDivider/screenDivider.js.map +1 -1
  54. package/dist/components/layout/sheet/sheet.d.ts +11 -0
  55. package/dist/components/layout/sheet/sheet.js +122 -102
  56. package/dist/components/layout/sheet/sheet.js.map +1 -1
  57. package/dist/components/layout/tabGroups/index.d.ts +1 -1
  58. package/dist/components/layout/tabGroups/tabGroups.d.ts +44 -1
  59. package/dist/components/layout/tabGroups/tabGroups.js +500 -460
  60. package/dist/components/layout/tabGroups/tabGroups.js.map +1 -1
  61. package/dist/components/layout/tabGroups/tabGroupsFocus.d.ts +16 -0
  62. package/dist/components/layout/tabGroups/tabGroupsFocus.js +102 -70
  63. package/dist/components/layout/tabGroups/tabGroupsFocus.js.map +1 -1
  64. package/dist/components/navigation/appBar/appBar.d.ts +12 -0
  65. package/dist/components/navigation/appBar/appBar.js.map +1 -1
  66. package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +9 -0
  67. package/dist/components/navigation/breadcrumbs/breadcrumbs.js +47 -31
  68. package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
  69. package/dist/components/navigation/tabs/tab/tab.js +71 -68
  70. package/dist/components/navigation/tabs/tab/tab.js.map +1 -1
  71. package/dist/components/navigation/tabs/tabs.d.ts +15 -1
  72. package/dist/components/navigation/tabs/tabs.js +19 -16
  73. package/dist/components/navigation/tabs/tabs.js.map +1 -1
  74. package/dist/components/navigation/tabs/tabsContext.d.ts +2 -0
  75. package/dist/components/navigation/tabs/tabsContext.js.map +1 -1
  76. package/dist/headless/components/dataDisplay/avatar/avatar.js +9 -9
  77. package/dist/headless/components/dataDisplay/avatar/avatar.js.map +1 -1
  78. package/dist/headless/components/dataDisplay/badge/badge.js.map +1 -1
  79. package/dist/headless/components/dataDisplay/dagView/dagView.js +133 -132
  80. package/dist/headless/components/dataDisplay/dagView/dagView.js.map +1 -1
  81. package/dist/headless/components/dataDisplay/meter/meter.js +32 -30
  82. package/dist/headless/components/dataDisplay/meter/meter.js.map +1 -1
  83. package/dist/headless/components/dataDisplay/statusDot/statusDot.js +19 -10
  84. package/dist/headless/components/dataDisplay/statusDot/statusDot.js.map +1 -1
  85. package/dist/headless/components/dataDisplay/treeView/treeView.js +139 -120
  86. package/dist/headless/components/dataDisplay/treeView/treeView.js.map +1 -1
  87. package/dist/headless/components/inputs/button/button.js +57 -51
  88. package/dist/headless/components/inputs/button/button.js.map +1 -1
  89. package/dist/headless/components/inputs/toggle/toggle.js +23 -23
  90. package/dist/headless/components/inputs/toggle/toggle.js.map +1 -1
  91. package/dist/headless/components/layout/appLayout/appLayout.js +52 -45
  92. package/dist/headless/components/layout/appLayout/appLayout.js.map +1 -1
  93. package/dist/headless/components/layout/screenDivider/screenDivider.js +88 -47
  94. package/dist/headless/components/layout/screenDivider/screenDivider.js.map +1 -1
  95. package/dist/headless/components/layout/sheet/sheet.js +124 -104
  96. package/dist/headless/components/layout/sheet/sheet.js.map +1 -1
  97. package/dist/headless/components/layout/tabGroups/tabGroups.js +500 -460
  98. package/dist/headless/components/layout/tabGroups/tabGroups.js.map +1 -1
  99. package/dist/headless/components/layout/tabGroups/tabGroupsFocus.js +102 -70
  100. package/dist/headless/components/layout/tabGroups/tabGroupsFocus.js.map +1 -1
  101. package/dist/headless/components/navigation/appBar/appBar.js.map +1 -1
  102. package/dist/headless/components/navigation/breadcrumbs/breadcrumbs.js +46 -30
  103. package/dist/headless/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
  104. package/dist/headless/components/navigation/tabs/tab/tab.js +70 -67
  105. package/dist/headless/components/navigation/tabs/tab/tab.js.map +1 -1
  106. package/dist/headless/components/navigation/tabs/tabs.js +19 -16
  107. package/dist/headless/components/navigation/tabs/tabs.js.map +1 -1
  108. package/dist/headless/components/navigation/tabs/tabsContext.js.map +1 -1
  109. package/dist/headless/primitives/publishHeaderOffset.js +19 -0
  110. package/dist/headless/primitives/publishHeaderOffset.js.map +1 -0
  111. package/dist/headless/source/components/dataDisplay/avatar/avatar.jsx +1 -0
  112. package/dist/headless/source/components/dataDisplay/avatar/avatar.jsx.map +1 -1
  113. package/dist/headless/source/components/dataDisplay/badge/badge.jsx.map +1 -1
  114. package/dist/headless/source/components/dataDisplay/chart/chart.jsx +14 -12
  115. package/dist/headless/source/components/dataDisplay/chart/chart.jsx.map +1 -1
  116. package/dist/headless/source/components/dataDisplay/chart/chartFull.js +12 -0
  117. package/dist/headless/source/components/dataDisplay/chart/chartFull.js.map +7 -0
  118. package/dist/headless/source/components/dataDisplay/chart/core.js +11 -0
  119. package/dist/headless/source/components/dataDisplay/chart/core.js.map +7 -0
  120. package/dist/headless/source/components/dataDisplay/chart/index.js +1 -1
  121. package/dist/headless/source/components/dataDisplay/chart/index.js.map +1 -1
  122. package/dist/headless/source/components/dataDisplay/dagView/dagView.jsx +2 -1
  123. package/dist/headless/source/components/dataDisplay/dagView/dagView.jsx.map +1 -1
  124. package/dist/headless/source/components/dataDisplay/dagView/index.js.map +2 -2
  125. package/dist/headless/source/components/dataDisplay/meter/index.js.map +1 -1
  126. package/dist/headless/source/components/dataDisplay/meter/meter.jsx +14 -2
  127. package/dist/headless/source/components/dataDisplay/meter/meter.jsx.map +1 -1
  128. package/dist/headless/source/components/dataDisplay/statusDot/index.js.map +1 -1
  129. package/dist/headless/source/components/dataDisplay/statusDot/statusDot.jsx +13 -1
  130. package/dist/headless/source/components/dataDisplay/statusDot/statusDot.jsx.map +1 -1
  131. package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx +16 -3
  132. package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
  133. package/dist/headless/source/components/inputs/button/button.jsx +26 -1
  134. package/dist/headless/source/components/inputs/button/button.jsx.map +1 -1
  135. package/dist/headless/source/components/inputs/toggle/toggle.jsx +9 -2
  136. package/dist/headless/source/components/inputs/toggle/toggle.jsx.map +1 -1
  137. package/dist/headless/source/components/layout/appLayout/appLayout.jsx +14 -2
  138. package/dist/headless/source/components/layout/appLayout/appLayout.jsx.map +1 -1
  139. package/dist/headless/source/components/layout/screenDivider/screenDivider.jsx +102 -18
  140. package/dist/headless/source/components/layout/screenDivider/screenDivider.jsx.map +1 -1
  141. package/dist/headless/source/components/layout/sheet/sheet.jsx +14 -1
  142. package/dist/headless/source/components/layout/sheet/sheet.jsx.map +1 -1
  143. package/dist/headless/source/components/layout/tabGroups/index.js.map +1 -1
  144. package/dist/headless/source/components/layout/tabGroups/tabGroups.jsx +55 -1
  145. package/dist/headless/source/components/layout/tabGroups/tabGroups.jsx.map +1 -1
  146. package/dist/headless/source/components/layout/tabGroups/tabGroupsFocus.js +42 -0
  147. package/dist/headless/source/components/layout/tabGroups/tabGroupsFocus.js.map +2 -2
  148. package/dist/headless/source/components/navigation/appBar/appBar.jsx.map +1 -1
  149. package/dist/headless/source/components/navigation/breadcrumbs/breadcrumbs.jsx +39 -4
  150. package/dist/headless/source/components/navigation/breadcrumbs/breadcrumbs.jsx.map +1 -1
  151. package/dist/headless/source/components/navigation/tabs/tab/tab.jsx +7 -1
  152. package/dist/headless/source/components/navigation/tabs/tab/tab.jsx.map +1 -1
  153. package/dist/headless/source/components/navigation/tabs/tabs.jsx +5 -1
  154. package/dist/headless/source/components/navigation/tabs/tabs.jsx.map +1 -1
  155. package/dist/headless/source/components/navigation/tabs/tabsContext.js.map +2 -2
  156. package/dist/headless/source/index.js +8 -1
  157. package/dist/headless/source/index.js.map +2 -2
  158. package/dist/headless/source/primitives/publishHeaderOffset.js +34 -0
  159. package/dist/headless/source/primitives/publishHeaderOffset.js.map +7 -0
  160. package/dist/index.d.ts +5 -5
  161. package/dist/primitives/publishHeaderOffset.d.ts +7 -0
  162. package/dist/primitives/publishHeaderOffset.js +19 -0
  163. package/dist/primitives/publishHeaderOffset.js.map +1 -0
  164. package/dist/source/components/dataDisplay/avatar/avatar.jsx +1 -0
  165. package/dist/source/components/dataDisplay/avatar/avatar.jsx.map +1 -1
  166. package/dist/source/components/dataDisplay/badge/badge.jsx.map +1 -1
  167. package/dist/source/components/dataDisplay/chart/chart.jsx +14 -12
  168. package/dist/source/components/dataDisplay/chart/chart.jsx.map +1 -1
  169. package/dist/source/components/dataDisplay/chart/chartFull.js +12 -0
  170. package/dist/source/components/dataDisplay/chart/chartFull.js.map +7 -0
  171. package/dist/source/components/dataDisplay/chart/core.js +11 -0
  172. package/dist/source/components/dataDisplay/chart/core.js.map +7 -0
  173. package/dist/source/components/dataDisplay/chart/index.js +1 -1
  174. package/dist/source/components/dataDisplay/chart/index.js.map +1 -1
  175. package/dist/source/components/dataDisplay/dagView/dagView.jsx +2 -1
  176. package/dist/source/components/dataDisplay/dagView/dagView.jsx.map +1 -1
  177. package/dist/source/components/dataDisplay/dagView/index.js.map +2 -2
  178. package/dist/source/components/dataDisplay/meter/index.js.map +1 -1
  179. package/dist/source/components/dataDisplay/meter/meter.jsx +14 -2
  180. package/dist/source/components/dataDisplay/meter/meter.jsx.map +1 -1
  181. package/dist/source/components/dataDisplay/statusDot/index.js.map +1 -1
  182. package/dist/source/components/dataDisplay/statusDot/statusDot.jsx +13 -1
  183. package/dist/source/components/dataDisplay/statusDot/statusDot.jsx.map +1 -1
  184. package/dist/source/components/dataDisplay/treeView/treeView.jsx +16 -3
  185. package/dist/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
  186. package/dist/source/components/inputs/button/button.jsx +26 -1
  187. package/dist/source/components/inputs/button/button.jsx.map +1 -1
  188. package/dist/source/components/inputs/toggle/toggle.jsx +9 -2
  189. package/dist/source/components/inputs/toggle/toggle.jsx.map +1 -1
  190. package/dist/source/components/layout/appLayout/appLayout.jsx +14 -2
  191. package/dist/source/components/layout/appLayout/appLayout.jsx.map +1 -1
  192. package/dist/source/components/layout/screenDivider/screenDivider.jsx +102 -18
  193. package/dist/source/components/layout/screenDivider/screenDivider.jsx.map +1 -1
  194. package/dist/source/components/layout/sheet/sheet.jsx +14 -1
  195. package/dist/source/components/layout/sheet/sheet.jsx.map +1 -1
  196. package/dist/source/components/layout/tabGroups/index.js.map +1 -1
  197. package/dist/source/components/layout/tabGroups/tabGroups.jsx +55 -1
  198. package/dist/source/components/layout/tabGroups/tabGroups.jsx.map +1 -1
  199. package/dist/source/components/layout/tabGroups/tabGroupsFocus.js +42 -0
  200. package/dist/source/components/layout/tabGroups/tabGroupsFocus.js.map +2 -2
  201. package/dist/source/components/navigation/appBar/appBar.jsx.map +1 -1
  202. package/dist/source/components/navigation/breadcrumbs/breadcrumbs.jsx +39 -4
  203. package/dist/source/components/navigation/breadcrumbs/breadcrumbs.jsx.map +1 -1
  204. package/dist/source/components/navigation/tabs/tab/tab.jsx +7 -1
  205. package/dist/source/components/navigation/tabs/tab/tab.jsx.map +1 -1
  206. package/dist/source/components/navigation/tabs/tabs.jsx +5 -1
  207. package/dist/source/components/navigation/tabs/tabs.jsx.map +1 -1
  208. package/dist/source/components/navigation/tabs/tabsContext.js.map +2 -2
  209. package/dist/source/index.js +8 -1
  210. package/dist/source/index.js.map +2 -2
  211. package/dist/source/primitives/publishHeaderOffset.js +34 -0
  212. package/dist/source/primitives/publishHeaderOffset.js.map +7 -0
  213. package/package.json +9 -3
@@ -1,96 +1,96 @@
1
- import { isServer as $, use as Ct, spread as dr, mergeProps as re, insert as _, createComponent as w, effect as j, className as _t, setAttribute as v, setStyleProperty as gt, addEventListener as Z, memo as fr, template as M, delegateEvents as gr } from "solid-js/web";
1
+ import { isServer as H, use as Rt, spread as wr, mergeProps as ae, insert as O, createComponent as S, effect as J, className as Lt, setAttribute as E, setStyleProperty as vt, addEventListener as I, memo as yr, template as R, delegateEvents as Sr } from "solid-js/web";
2
2
  import '../../../assets/styles/less/components/tabGroups/tabGroups.entry.css';import '../../../assets/styles/less/tokens.entry.css';/* empty css */
3
3
  /* empty css */
4
- import { splitProps as pr, createUniqueId as mr, createMemo as m, createComputed as br, createSignal as N, createEffect as xt, on as hr, onCleanup as pt, onMount as vr, children as wr, mapArray as Ot, createRenderEffect as yr, Show as st, For as oe } from "solid-js";
5
- import mt from "clsx";
6
- import { Tabs as Sr } from "../../navigation/tabs/tabs.js";
7
- import { Tab as Er } from "../../navigation/tabs/tab/tab.js";
8
- import { Menu as Ar } from "../../navigation/menu/menu.js";
9
- import { MenuItem as X } from "../../navigation/menu/menuItem.js";
10
- import { mergeRefs as Tr } from "../../../primitives/mergeRefs.js";
11
- import { mergeStyle as Dr } from "../../../primitives/mergeStyle.js";
12
- import { createControllableState as Cr } from "../../../primitives/createControllableState.js";
13
- import { callHandler as Q } from "../../../primitives/callHandler.js";
14
- import { matchesKeyboardShortcut as Rt } from "../../../utils/keyboardShortcut.js";
15
- import { throttle as _r } from "../../../utils/throttle.js";
16
- import { TAB_GROUPS_LABELS as xr, createTabGroupsLayout as Or, computeTabGroupsGrid as Rr, getGroups as k, groupBodyArea as ne, setActiveGroup as Mr, moveTab as K, gridTemplateRows as Lr, gridTemplateColumns as Pr, moveTabInDirection as Nr, selectTab as kr, groupHeaderArea as Fr, dropZoneAt as Gr, findGroupOfTab as bt, removeTab as zr, adjacentGroup as $r, separatorArea as Kr, describeTabGroupsChange as Br, resizeSplit as se } from "./tabGroupsLayout.js";
17
- import { ownerRootOf as ae, frameExitTarget as Hr, ownGroupIdOf as ie, deepActiveElement as ht, containsDeep as ce, tabMove as Ur, lastStopOf as qr, focusFromEnd as Vr } from "./tabGroupsFocus.js";
18
- import { Icon as Wr } from "../../base/icon/icon.js";
19
- var Yr = /* @__PURE__ */ M("<button type=button class=smwb-tab-groups__actions-trigger aria-haspopup=menu>"), jr = /* @__PURE__ */ M("<div>"), Zr = /* @__PURE__ */ M("<span class=smwb-tab-groups__panel-end tabindex=-1 aria-hidden=true>"), Xr = /* @__PURE__ */ M('<div class="smwb-tab-panel smwb-tab-groups__panel"role=tabpanel tabindex=0>'), Qr = /* @__PURE__ */ M("<div role=separator tabindex=0 aria-valuemin=0 aria-valuemax=100>"), Jr = /* @__PURE__ */ M("<div class=smwb-tab-groups__empty>"), Ir = /* @__PURE__ */ M("<span class=smwb-tab-groups__focus-guard tabindex=0>"), to = /* @__PURE__ */ M("<div><div class=smwb-tab-groups__status role=status data-testid=tab-groups-status>"), eo = /* @__PURE__ */ M("<div aria-hidden=true>");
20
- const ro = ["Alt+Shift+ArrowLeft", "Alt+Shift+ArrowRight", "Alt+Shift+ArrowUp", "Alt+Shift+ArrowDown", "Control+Shift+ArrowLeft", "Meta+Shift+ArrowLeft", "Control+Shift+ArrowRight", "Meta+Shift+ArrowRight"].join(" "), oo = [["left", ["Alt", "Shift", "ArrowLeft"]], ["right", ["Alt", "Shift", "ArrowRight"]], ["top", ["Alt", "Shift", "ArrowUp"]], ["bottom", ["Alt", "Shift", "ArrowDown"]]], no = '[role^="menuitem"]:not([aria-disabled="true"])';
21
- function Mt(f) {
22
- let c = f ?? null;
4
+ import { splitProps as Er, createUniqueId as Ar, createMemo as m, createComputed as ce, createSignal as N, createEffect as Ft, on as Tr, onCleanup as wt, onMount as Dr, children as ue, mapArray as Gt, createRenderEffect as Cr, Show as tt, For as le } from "solid-js";
5
+ import yt from "clsx";
6
+ import { Tabs as _r } from "../../navigation/tabs/tabs.js";
7
+ import { Tab as xr } from "../../navigation/tabs/tab/tab.js";
8
+ import { Menu as Or } from "../../navigation/menu/menu.js";
9
+ import { MenuItem as et } from "../../navigation/menu/menuItem.js";
10
+ import { mergeRefs as Mr } from "../../../primitives/mergeRefs.js";
11
+ import { mergeStyle as Rr } from "../../../primitives/mergeStyle.js";
12
+ import { createControllableState as Lr } from "../../../primitives/createControllableState.js";
13
+ import { callHandler as rt } from "../../../primitives/callHandler.js";
14
+ import { matchesKeyboardShortcut as Pt } from "../../../utils/keyboardShortcut.js";
15
+ import { throttle as Fr } from "../../../utils/throttle.js";
16
+ import { TAB_GROUPS_LABELS as Gr, createTabGroupsLayout as Pr, computeTabGroupsGrid as kr, getGroups as $, groupBodyArea as de, setActiveGroup as Nr, moveTab as q, gridTemplateRows as $r, gridTemplateColumns as zr, moveTabInDirection as Kr, selectTab as Br, groupHeaderArea as Hr, dropZoneAt as qr, findGroupOfTab as St, removeTab as Ur, adjacentGroup as Vr, separatorArea as Wr, describeTabGroupsChange as Yr, resizeSplit as fe } from "./tabGroupsLayout.js";
17
+ import { ownerRootOf as ge, slotFocusOf as jr, frameExitTarget as Zr, ownGroupIdOf as pe, deepActiveElement as lt, containsDeep as me, tabMove as Xr, lastStopOf as Qr, focusFromEnd as Jr, slotFocusHeir as Ir } from "./tabGroupsFocus.js";
18
+ import { Icon as to } from "../../base/icon/icon.js";
19
+ var eo = /* @__PURE__ */ R("<div class=smwb-tab-groups__strip-actions>"), ro = /* @__PURE__ */ R("<button type=button class=smwb-tab-groups__actions-trigger aria-haspopup=menu>"), oo = /* @__PURE__ */ R("<div>"), no = /* @__PURE__ */ R("<span class=smwb-tab-groups__panel-end tabindex=-1 aria-hidden=true>"), so = /* @__PURE__ */ R('<div class="smwb-tab-panel smwb-tab-groups__panel"role=tabpanel tabindex=0>'), io = /* @__PURE__ */ R("<div role=separator tabindex=0 aria-valuemin=0 aria-valuemax=100>"), ao = /* @__PURE__ */ R("<div class=smwb-tab-groups__empty>"), co = /* @__PURE__ */ R("<span class=smwb-tab-groups__focus-guard tabindex=0>"), uo = /* @__PURE__ */ R("<div><div class=smwb-tab-groups__status role=status data-testid=tab-groups-status>"), lo = /* @__PURE__ */ R("<div aria-hidden=true>");
20
+ const fo = ["Alt+Shift+ArrowLeft", "Alt+Shift+ArrowRight", "Alt+Shift+ArrowUp", "Alt+Shift+ArrowDown", "Control+Shift+ArrowLeft", "Meta+Shift+ArrowLeft", "Control+Shift+ArrowRight", "Meta+Shift+ArrowRight"].join(" "), go = [["left", ["Alt", "Shift", "ArrowLeft"]], ["right", ["Alt", "Shift", "ArrowRight"]], ["top", ["Alt", "Shift", "ArrowUp"]], ["bottom", ["Alt", "Shift", "ArrowDown"]]], po = (l) => l != null && typeof l != "boolean" && l !== "", mo = '[role^="menuitem"]:not([aria-disabled="true"])';
21
+ function kt(l) {
22
+ let c = l ?? null;
23
23
  for (; c; ) {
24
- const T = c.getAttribute("data-group-id");
25
- if (T !== null) return T;
24
+ const _ = c.getAttribute("data-group-id");
25
+ if (_ !== null) return _;
26
26
  c = c.parentElement;
27
27
  }
28
28
  return null;
29
29
  }
30
- function ue(f) {
31
- return f.closest(".smwb-tab-item") ?? f;
30
+ function be(l) {
31
+ return l.closest(".smwb-tab-item") ?? l;
32
32
  }
33
- function le(f) {
34
- if (!f) return null;
35
- const c = f.closest('[role="tab"]');
36
- return c || (f.closest(".smwb-tab-item")?.querySelector('[role="tab"]') ?? null);
33
+ function he(l) {
34
+ if (!l) return null;
35
+ const c = l.closest('[role="tab"]');
36
+ return c || (l.closest(".smwb-tab-item")?.querySelector('[role="tab"]') ?? null);
37
37
  }
38
- function at(f, c) {
39
- if (f.type !== "group") {
40
- if (f.id === c) return f;
41
- for (const T of f.children) {
42
- const E = at(T, c);
43
- if (E) return E;
38
+ function dt(l, c) {
39
+ if (l.type !== "group") {
40
+ if (l.id === c) return l;
41
+ for (const _ of l.children) {
42
+ const D = dt(_, c);
43
+ if (D) return D;
44
44
  }
45
45
  }
46
46
  }
47
- function fe(f) {
48
- return f.type === "group" ? [f.id] : f.children.flatMap(fe);
47
+ function we(l) {
48
+ return l.type === "group" ? [l.id] : l.children.flatMap(we);
49
49
  }
50
- function de(f) {
51
- const c = [], T = (E) => {
52
- if (E.type === "group") {
53
- c.push(`h:${E.id}`, `p:${E.id}`);
50
+ function ve(l) {
51
+ const c = [], _ = (D) => {
52
+ if (D.type === "group") {
53
+ c.push(`h:${D.id}`, `p:${D.id}`);
54
54
  return;
55
55
  }
56
- E.children.forEach((D, A) => {
57
- T(D), A < E.children.length - 1 && c.push(`s:${E.id}:${A}`);
56
+ D.children.forEach((x, C) => {
57
+ _(x), C < D.children.length - 1 && c.push(`s:${D.id}:${C}`);
58
58
  });
59
59
  };
60
- return T(f), c;
60
+ return _(l), c;
61
61
  }
62
- function so(f, c, T) {
63
- const E = new Set(c);
64
- T.forEach((d) => {
65
- !E.has(d) && d.parentNode === f && d.remove();
62
+ function bo(l, c, _) {
63
+ const D = new Set(c);
64
+ _.forEach((d) => {
65
+ !D.has(d) && d.parentNode === l && d.remove();
66
66
  });
67
- const D = Array.from(f.children), A = /* @__PURE__ */ new Map();
68
- D.forEach((d, l) => A.set(d, l));
69
- const B = f.ownerDocument.activeElement, L = B === null ? -1 : c.findIndex((d) => d.contains(B)), H = L < 0 ? void 0 : A.get(c[L]), x = [];
70
- c.forEach((d, l) => {
71
- const y = A.get(d);
72
- y !== void 0 && (H !== void 0 && l !== L && l < L != y < H || x.push(y));
67
+ const x = Array.from(l.children), C = /* @__PURE__ */ new Map();
68
+ x.forEach((d, u) => C.set(d, u));
69
+ const U = l.ownerDocument.activeElement, P = U === null ? -1 : c.findIndex((d) => d.contains(U)), V = P < 0 ? void 0 : C.get(c[P]), L = [];
70
+ c.forEach((d, u) => {
71
+ const A = C.get(d);
72
+ A !== void 0 && (V !== void 0 && u !== P && u < P != A < V || L.push(A));
73
73
  });
74
- const O = x.map(() => 1), J = x.map(() => -1);
75
- let U = -1;
76
- x.forEach((d, l) => {
77
- for (let y = 0; y < l; y++)
78
- x[y] < d && O[y] + 1 > O[l] && (O[l] = O[y] + 1, J[l] = y);
79
- (U < 0 || O[l] > O[U]) && (U = l);
74
+ const F = L.map(() => 1), ot = L.map(() => -1);
75
+ let W = -1;
76
+ L.forEach((d, u) => {
77
+ for (let A = 0; A < u; A++)
78
+ L[A] < d && F[A] + 1 > F[u] && (F[u] = F[A] + 1, ot[u] = A);
79
+ (W < 0 || F[u] > F[W]) && (W = u);
80
80
  });
81
- const F = /* @__PURE__ */ new Set();
82
- for (let d = U; d >= 0; d = J[d]) F.add(x[d]);
83
- let it = F.size > 0 ? D[Math.max(...F)].nextSibling : f.firstChild;
81
+ const z = /* @__PURE__ */ new Set();
82
+ for (let d = W; d >= 0; d = ot[d]) z.add(L[d]);
83
+ let ft = z.size > 0 ? x[Math.max(...z)].nextSibling : l.firstChild;
84
84
  for (let d = c.length - 1; d >= 0; d--) {
85
- const l = c[d], y = A.get(l);
86
- (y === void 0 || !F.has(y)) && f.insertBefore(l, it), it = l;
85
+ const u = c[d], A = C.get(u);
86
+ (A === void 0 || !z.has(A)) && l.insertBefore(u, ft), ft = u;
87
87
  }
88
88
  }
89
- function Lt(f) {
90
- return k(f).map((c) => c.active).filter((c) => c !== null);
89
+ function Nt(l) {
90
+ return $(l).map((c) => c.active).filter((c) => c !== null);
91
91
  }
92
- function Do(f) {
93
- const [c, T] = pr(f, [
92
+ function Po(l) {
93
+ const [c, _] = Er(l, [
94
94
  "class",
95
95
  "style",
96
96
  "id",
@@ -106,7 +106,9 @@ function Do(f) {
106
106
  "minGroupSize",
107
107
  "keyboardStep",
108
108
  "groupActions",
109
+ "stripActions",
109
110
  "dense",
111
+ "fit",
110
112
  "labels",
111
113
  // Wrapped so that the caller's handler still runs, first.
112
114
  "onDragStart",
@@ -115,62 +117,62 @@ function Do(f) {
115
117
  "onDragEnd",
116
118
  "onFocusIn",
117
119
  "onKeyDown"
118
- ]), E = mr(), D = () => c.id ?? E, A = (t) => encodeURIComponent(t), B = (t) => `${D()}-tab-${A(t)}`, L = (t) => `${D()}-panel-${A(t)}`, H = (t) => `${D()}-menu-${A(t)}`, x = (t) => `${D()}-header-${A(t)}`, O = (t, e) => `${D()}-separator-${A(t)}-${e}`, J = () => `${D()}-status`, U = () => c.minGroupSize ?? 120, F = () => c.keyboardStep ?? 5, it = () => c.groupActions !== !1, d = m(() => ({
119
- ...xr,
120
+ ]), D = Ar(), x = () => c.id ?? D, C = (t) => encodeURIComponent(t), U = (t) => `${x()}-tab-${C(t)}`, P = (t) => `${x()}-panel-${C(t)}`, V = (t) => `${x()}-menu-${C(t)}`, L = (t) => `${x()}-header-${C(t)}`, F = (t, e) => `${x()}-separator-${C(t)}-${e}`, ot = () => `${x()}-status`, W = () => c.minGroupSize ?? 120, z = () => c.keyboardStep ?? 5, ft = () => c.groupActions !== !1, d = m(() => ({
121
+ ...Gr,
120
122
  ...c.labels
121
- })), [l, y] = Cr({
123
+ })), [u, A] = Lr({
122
124
  value: () => c.layout,
123
- defaultValue: c.defaultLayout ?? Or()
125
+ defaultValue: c.defaultLayout ?? Pr()
124
126
  });
125
- let b = l();
126
- br(() => {
127
- b = l();
127
+ let v = u();
128
+ ce(() => {
129
+ v = u();
128
130
  });
129
- const R = m(() => Rr(l())), G = m(() => k(l())), ge = m(() => G().length), pe = m(() => G().length > 1), me = m(() => new Set(Lt(l()))), vt = m(() => {
131
+ const G = m(() => kr(u())), K = m(() => $(u())), $t = m(() => K().length), ye = m(() => K().length > 1), Se = m(() => new Set(Nt(u()))), Et = m(() => {
130
132
  const t = /* @__PURE__ */ new Map();
131
- return k(l()).forEach((e) => e.tabs.forEach((r) => t.set(r, e.id))), t;
132
- }), S = (t, e) => k(t).find((r) => r.id === e), Pt = (t) => G().findIndex((e) => e.id === t), q = m(() => {
133
- const t = G();
133
+ return $(u()).forEach((e) => e.tabs.forEach((r) => t.set(r, e.id))), t;
134
+ }), T = (t, e) => $(t).find((r) => r.id === e), At = (t) => K().findIndex((e) => e.id === t), Y = m(() => {
135
+ const t = K();
134
136
  return t.length === 1 && (t[0]?.tabs.length ?? 0) === 0;
135
- }), be = m(() => G().map((t) => t.id)), he = m(() => de(l().root).filter((t) => t.startsWith("s:"))), ve = m((t) => {
136
- const e = vt(), r = t.filter((n) => e.has(n)), o = new Set(r);
137
- return G().forEach((n) => n.tabs.forEach((s) => {
137
+ }), Ee = m(() => K().map((t) => t.id)), Ae = m(() => ve(u().root).filter((t) => t.startsWith("s:"))), Te = m((t) => {
138
+ const e = Et(), r = t.filter((n) => e.has(n)), o = new Set(r);
139
+ return K().forEach((n) => n.tabs.forEach((s) => {
138
140
  o.has(s) || (o.add(s), r.push(s));
139
141
  })), r.length === t.length && r.every((n, s) => n === t[s]) ? t : r;
140
- }, []), we = m(() => {
141
- if (q()) return;
142
- const t = l();
143
- return [...de(t.root).flatMap((e) => {
144
- if (e.startsWith("h:")) return [x(e.slice(2))];
145
- if (e.startsWith("p:")) return (S(t, e.slice(2))?.tabs ?? []).map(L);
142
+ }, []), De = m(() => {
143
+ if (Y()) return;
144
+ const t = u();
145
+ return [...ve(t.root).flatMap((e) => {
146
+ if (e.startsWith("h:")) return [L(e.slice(2))];
147
+ if (e.startsWith("p:")) return (T(t, e.slice(2))?.tabs ?? []).map(P);
146
148
  const r = e.lastIndexOf(":");
147
- return [O(e.slice(2, r), Number(e.slice(r + 1)))];
148
- }), J()].join(" ");
149
- }), [ye, Se] = N(new Set(Lt(l())));
150
- $ || xt(() => {
151
- const t = l(), e = /* @__PURE__ */ new Set();
152
- k(t).forEach((o) => o.tabs.forEach((n) => e.add(n)));
153
- const r = Lt(t);
154
- Se((o) => {
149
+ return [F(e.slice(2, r), Number(e.slice(r + 1)))];
150
+ }), ot()].join(" ");
151
+ }), [Ce, _e] = N(new Set(Nt(u())));
152
+ H || Ft(() => {
153
+ const t = u(), e = /* @__PURE__ */ new Set();
154
+ $(t).forEach((o) => o.tabs.forEach((n) => e.add(n)));
155
+ const r = Nt(t);
156
+ _e((o) => {
155
157
  const n = /* @__PURE__ */ new Set();
156
158
  let s = !1;
157
- return o.forEach((a) => {
158
- e.has(a) ? n.add(a) : s = !0;
159
- }), r.forEach((a) => {
160
- n.has(a) || (n.add(a), s = !0);
159
+ return o.forEach((i) => {
160
+ e.has(i) ? n.add(i) : s = !0;
161
+ }), r.forEach((i) => {
162
+ n.has(i) || (n.add(i), s = !0);
161
163
  }), s || n.size !== o.size ? n : o;
162
164
  });
163
165
  });
164
- const [Ee, Ae] = N(""), [ct, ut] = N(null), [Te, Nt] = N(!1), [De, I] = N(null), [Ce, tt] = N(null), [kt, Ft] = N(null);
165
- let h, lt, wt = null;
166
- const yt = /* @__PURE__ */ new WeakMap();
167
- let Gt = 0, St = !1, dt = !1, et = null, Et = !1;
168
- const _e = (t, e) => {
169
- const r = Br(e, t, Re, d());
170
- r !== "" && Ae((o) => o.replace(/\u00a0+$/, "") === r ? `${r} ` : r);
171
- }, zt = (t, e, r) => {
172
- const o = bt(e, t);
173
- o && (wt = {
166
+ const [xe, Oe] = N(""), [gt, pt] = N(null), [Me, zt] = N(!1), [Re, nt] = N(null), [Le, st] = N(null), [Kt, Bt] = N(null);
167
+ let b, mt, Tt = null;
168
+ const Dt = /* @__PURE__ */ new WeakMap();
169
+ let Ht = 0, Ct = !1, bt = !1, j = null, _t = !1, M = null;
170
+ const Fe = (t, e) => {
171
+ const r = Yr(e, t, $e, d());
172
+ r !== "" && Oe((o) => o.replace(/\u00a0+$/, "") === r ? `${r} ` : r);
173
+ }, qt = (t, e, r) => {
174
+ const o = St(e, t);
175
+ o && (Tt = {
174
176
  tab: t,
175
177
  group: o.id,
176
178
  index: o.tabs.indexOf(t),
@@ -178,276 +180,286 @@ function Do(f) {
178
180
  gone: r
179
181
  },
180
182
  after: e,
181
- base: l(),
182
- from: h ? ht(h.ownerDocument) : null
183
+ base: u(),
184
+ from: b ? lt(b.ownerDocument) : null
183
185
  });
184
- }, xe = (t, e) => {
186
+ }, Ge = (t, e) => {
185
187
  if (e === t.base) return !0;
186
- const r = yt.get(e), o = yt.get(t.after);
188
+ const r = Dt.get(e), o = Dt.get(t.after);
187
189
  return r !== void 0 && o !== void 0 && r < o;
188
- }, $t = () => {
189
- const t = wt, e = l();
190
- if (!t || xe(t, e)) return;
191
- const r = h?.ownerDocument, o = bt(e, t.tab), n = o?.id === t.group && o.tabs.indexOf(t.tab) === t.index && (t.gone === void 0 || !S(e, t.gone)), s = n ? r?.getElementById(B(t.tab)) : null;
192
- if (n && (!s || Mt(s) !== t.group) || (wt = null, !s || !h || !r)) return;
193
- const a = ht(r);
194
- a !== s && (a !== null && a !== r.body && a !== t.from && !ce(h, a) || s.focus());
195
- }, V = (t, e) => {
196
- t !== b && (b = t, Gt += 1, yt.set(t, Gt), y(() => t), c.onLayoutChange?.(t, e), _e(t, e), $t(), c.layout !== void 0 && !St && (St = !0, queueMicrotask(Oe)));
197
- }, Oe = () => {
198
- St = !1, !(c.layout === void 0 || b === l()) && (b = l());
190
+ }, Ut = () => {
191
+ const t = Tt, e = u();
192
+ if (!t || Ge(t, e)) return;
193
+ const r = b?.ownerDocument, o = St(e, t.tab), n = o?.id === t.group && o.tabs.indexOf(t.tab) === t.index && (t.gone === void 0 || !T(e, t.gone)), s = n ? r?.getElementById(U(t.tab)) : null;
194
+ if (n && (!s || kt(s) !== t.group) || (Tt = null, !s || !b || !r)) return;
195
+ const i = lt(r);
196
+ i !== s && (i !== null && i !== r.body && i !== t.from && !me(b, i) || s.focus());
197
+ }, Pe = () => {
198
+ const t = M;
199
+ if (!t || !b || t.element.isConnected) return;
200
+ M = null;
201
+ const e = b.ownerDocument, r = lt(e);
202
+ r !== null && r !== e.body || Ir(b, t, u().activeGroup)?.focus();
203
+ }, ke = () => {
204
+ M && !M.element.isConnected && (M = null);
205
+ }, Z = (t, e) => {
206
+ t !== v && (v = t, Ht += 1, Dt.set(t, Ht), A(() => t), c.onLayoutChange?.(t, e), Fe(t, e), Ut(), c.layout !== void 0 && !Ct && (Ct = !0, queueMicrotask(Ne)));
207
+ }, Ne = () => {
208
+ Ct = !1, !(c.layout === void 0 || v === u()) && (v = u());
199
209
  };
200
- $ || xt(hr(l, () => {
201
- $t();
210
+ H || (ce(() => {
211
+ u(), ke();
212
+ }), Ft(Tr(u, () => {
213
+ Ut(), Pe();
202
214
  }, {
203
215
  defer: !0
204
- }));
205
- const Re = (t) => {
216
+ })));
217
+ const $e = (t) => {
206
218
  const e = c.getTab(t);
207
219
  return e ? e.title !== void 0 ? e.title : typeof e.label == "string" ? e.label : t : t;
208
- }, P = (t, e, r, o, n = {}) => {
220
+ }, k = (t, e, r, o, n = {}) => {
209
221
  if (t === e) return;
210
- const s = bt(t, r)?.id, a = s !== void 0 ? S(t, s) : void 0;
211
- if (!s || !a) return;
212
- const i = !k(t).some((p) => p.id === o), u = k(e).some((p) => p.id === s), g = n.edge !== void 0 && !u ? {
222
+ const s = St(t, r)?.id, i = s !== void 0 ? T(t, s) : void 0;
223
+ if (!s || !i) return;
224
+ const a = !$(t).some((w) => w.id === o), g = $(e).some((w) => w.id === s), p = n.edge !== void 0 && !g ? {
213
225
  type: "split",
214
226
  tab: r,
215
227
  from: o,
216
228
  to: s,
217
229
  edge: n.edge,
218
- sourceClosed: i
230
+ sourceClosed: a
219
231
  } : {
220
232
  type: "move",
221
233
  tab: r,
222
234
  from: o,
223
235
  to: s,
224
- index: a.tabs.indexOf(r),
225
- sourceClosed: i
236
+ index: i.tabs.indexOf(r),
237
+ sourceClosed: a
226
238
  };
227
- n.focus && zt(r, t), V(t, g);
228
- }, Me = (t) => (e, r) => {
239
+ n.focus && qt(r, t), Z(t, p);
240
+ }, ze = (t) => (e, r) => {
229
241
  if (e.type === "drop") return;
230
- const o = b, n = S(o, t), s = n?.tabs[r];
231
- !n || s === void 0 || V(kr(o, s), {
242
+ const o = v, n = T(o, t), s = n?.tabs[r];
243
+ !n || s === void 0 || Z(Br(o, s), {
232
244
  type: "select",
233
245
  tab: s,
234
246
  group: t
235
247
  });
236
- }, Le = (t) => (e, r) => {
237
- const o = b, n = S(o, t), s = n?.tabs[e];
238
- !n || s === void 0 || P(K(o, s, {
248
+ }, Ke = (t) => (e, r) => {
249
+ const o = v, n = T(o, t), s = n?.tabs[e];
250
+ !n || s === void 0 || k(q(o, s, {
239
251
  group: t,
240
252
  index: r
241
253
  }), o, s, t, {
242
- focus: Y?.hadFocus ?? !1
254
+ focus: Q?.hadFocus ?? !1
243
255
  });
244
- }, Pe = (t, e, r) => {
245
- const o = b, n = bt(o, t);
256
+ }, Be = (t, e, r) => {
257
+ const o = v, n = St(o, t);
246
258
  if (!n || c.onTabClose?.(t, e, r) === !1) return;
247
- const s = zr(o, t);
259
+ const s = Ur(o, t);
248
260
  if (s === o) return;
249
- const a = !k(s).some((C) => C.id === n.id), i = h, u = i ? ht(i.ownerDocument) : null, g = r === "actions" || i !== void 0 && ie(i, u) === n.id, p = a && g ? $r(o, n.id) : void 0;
250
- if (p !== void 0) {
251
- const C = S(s, p)?.active;
252
- C && zt(C, s, n.id);
261
+ const i = !$(s).some((h) => h.id === n.id), a = b, g = a ? lt(a.ownerDocument) : null, p = r === "actions" || a !== void 0 && pe(a, g) === n.id, w = i && p ? Vr(o, n.id) : void 0;
262
+ if (w !== void 0) {
263
+ const h = T(s, w)?.active;
264
+ h && qt(h, s, n.id);
253
265
  }
254
- V(s, {
266
+ Z(s, {
255
267
  type: "close",
256
268
  tab: t,
257
269
  group: n.id,
258
- groupClosed: a
270
+ groupClosed: i
259
271
  });
260
- }, Ne = (t) => (e) => {
272
+ }, He = (t) => (e) => {
261
273
  if (e.defaultPrevented || e.repeat || e.isComposing) return;
262
274
  const r = e.target;
263
275
  if (!(r instanceof Element)) return;
264
276
  const o = r.closest('[role="tab"]');
265
- if (!o || Mt(o) !== t || o.getAttribute("aria-disabled") === "true") return;
277
+ if (!o || kt(o) !== t || o.getAttribute("aria-disabled") === "true") return;
266
278
  const n = o.getAttribute("data-tab-id");
267
279
  if (!n) return;
268
- const s = b, a = S(s, t);
269
- if (!a) return;
270
- for (const [p, C] of oo) {
271
- if (!Rt(e, C)) continue;
272
- const nt = Nr(s, n, p);
273
- if (nt === s) return;
274
- e.preventDefault(), P(nt, s, n, t, {
275
- edge: p,
280
+ const s = v, i = T(s, t);
281
+ if (!i) return;
282
+ for (const [w, h] of go) {
283
+ if (!Pt(e, h)) continue;
284
+ const f = Kr(s, n, w);
285
+ if (f === s) return;
286
+ e.preventDefault(), k(f, s, n, t, {
287
+ edge: w,
276
288
  focus: !0
277
289
  });
278
290
  return;
279
291
  }
280
- const i = Rt(e, ["Mod", "Shift", "ArrowLeft"]) ? -1 : Rt(e, ["Mod", "Shift", "ArrowRight"]) ? 1 : 0;
281
- if (i === 0) return;
282
- const u = a.tabs.indexOf(n), g = u + i;
283
- u < 0 || g < 0 || g >= a.tabs.length || (e.preventDefault(), P(K(s, n, {
292
+ const a = Pt(e, ["Mod", "Shift", "ArrowLeft"]) ? -1 : Pt(e, ["Mod", "Shift", "ArrowRight"]) ? 1 : 0;
293
+ if (a === 0) return;
294
+ const g = i.tabs.indexOf(n), p = g + a;
295
+ g < 0 || p < 0 || p >= i.tabs.length || (e.preventDefault(), k(q(s, n, {
284
296
  group: t,
285
- index: g
297
+ index: p
286
298
  }), s, n, t, {
287
299
  focus: !0
288
300
  }));
289
- }, ke = (t) => {
290
- h?.ownerDocument?.getElementById(H(t))?.querySelector(no)?.focus({
301
+ }, qe = (t) => {
302
+ b?.ownerDocument?.getElementById(V(t))?.querySelector(mo)?.focus({
291
303
  preventScroll: !0
292
304
  });
293
- }, Kt = (t, e) => {
294
- ut(t), e && ke(t);
295
- }, Fe = (t, e) => {
296
- if (ct() === t) {
297
- ut(null);
305
+ }, Vt = (t, e) => {
306
+ pt(t), e && qe(t);
307
+ }, Ue = (t, e) => {
308
+ if (gt() === t) {
309
+ pt(null);
298
310
  return;
299
311
  }
300
- Kt(t, e.detail === 0);
301
- }, Ge = (t, e) => {
302
- e.defaultPrevented || e.repeat || e.key !== "ArrowDown" || (e.preventDefault(), Kt(t, !0));
303
- }, Bt = (t) => {
304
- const e = S(l(), t);
312
+ Vt(t, e.detail === 0);
313
+ }, Ve = (t, e) => {
314
+ e.defaultPrevented || e.repeat || e.key !== "ArrowDown" || (e.preventDefault(), Vt(t, !0));
315
+ }, Wt = (t) => {
316
+ const e = T(u(), t);
305
317
  return !!(e && e.active !== null && e.tabs.length >= 2);
306
- }, Ht = (t, e) => G()[Pt(t) + e]?.id, Ut = (t, e) => {
307
- const r = S(l(), t);
308
- return !!(r && r.active !== null && Ht(t, e) !== void 0);
309
- }, qt = (t, e) => {
310
- const r = S(l(), t);
318
+ }, Yt = (t, e) => K()[At(t) + e]?.id, jt = (t, e) => {
319
+ const r = T(u(), t);
320
+ return !!(r && r.active !== null && Yt(t, e) !== void 0);
321
+ }, Zt = (t, e) => {
322
+ const r = T(u(), t);
311
323
  if (!r || r.active === null) return !1;
312
324
  const o = r.tabs.indexOf(r.active) + e;
313
325
  return o >= 0 && o < r.tabs.length;
314
- }, W = (t, e) => {
315
- ut(null);
316
- const r = b, o = S(r, t), n = o?.active;
326
+ }, X = (t, e) => {
327
+ pt(null);
328
+ const r = v, o = T(r, t), n = o?.active;
317
329
  if (!o || !n) return;
318
330
  if (e === "splitRight" || e === "splitDown") {
319
- const i = e === "splitRight" ? "right" : "bottom";
320
- P(K(r, n, {
331
+ const a = e === "splitRight" ? "right" : "bottom";
332
+ k(q(r, n, {
321
333
  group: t,
322
- edge: i
334
+ edge: a
323
335
  }), r, n, t, {
324
- edge: i,
336
+ edge: a,
325
337
  focus: !0
326
338
  });
327
339
  return;
328
340
  }
329
341
  if (e === "previous" || e === "next") {
330
- const i = Ht(t, e === "previous" ? -1 : 1);
331
- if (!i) return;
332
- P(K(r, n, {
333
- group: i
342
+ const a = Yt(t, e === "previous" ? -1 : 1);
343
+ if (!a) return;
344
+ k(q(r, n, {
345
+ group: a
334
346
  }), r, n, t, {
335
347
  focus: !0
336
348
  });
337
349
  return;
338
350
  }
339
- const s = o.tabs.indexOf(n), a = s + (e === "left" ? -1 : 1);
340
- s < 0 || a < 0 || a >= o.tabs.length || P(K(r, n, {
351
+ const s = o.tabs.indexOf(n), i = s + (e === "left" ? -1 : 1);
352
+ s < 0 || i < 0 || i >= o.tabs.length || k(q(r, n, {
341
353
  group: t,
342
- index: a
354
+ index: i
343
355
  }), r, n, t, {
344
356
  focus: !0
345
357
  });
346
- }, ze = (t) => {
347
- const e = l(), r = at(e.root, t);
358
+ }, We = (t) => {
359
+ const e = u(), r = dt(e.root, t);
348
360
  if (!r) return 0;
349
- const o = new Set(fe(r)), n = R().groups.filter((g) => o.has(g.id));
361
+ const o = new Set(we(r)), n = G().groups.filter((p) => o.has(p.id));
350
362
  if (n.length === 0) return 0;
351
- const s = r.direction === "row" ? R().columns : R().rows;
352
- let a = Number.POSITIVE_INFINITY, i = Number.NEGATIVE_INFINITY;
353
- n.forEach((g) => {
354
- const p = r.direction === "row" ? g.column : g.row;
355
- a = Math.min(a, p[0]), i = Math.max(i, p[1]);
363
+ const s = r.direction === "row" ? G().columns : G().rows;
364
+ let i = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY;
365
+ n.forEach((p) => {
366
+ const w = r.direction === "row" ? p.column : p.row;
367
+ i = Math.min(i, w[0]), a = Math.max(a, w[1]);
356
368
  });
357
- let u = 0;
358
- for (let g = a; g < i; g += 1) u += s[g] ?? 0;
359
- return u;
360
- }, Vt = (t) => {
361
- const e = h?.getBoundingClientRect(), r = at(l().root, t);
362
- return !e || !r ? 0 : (r.direction === "row" ? e.width : e.height) * ze(t) / 100;
363
- }, Wt = (t) => t > 0 ? U() / t * 100 : 0, Yt = (t, e) => {
364
- const r = at(t.root, e);
369
+ let g = 0;
370
+ for (let p = i; p < a; p += 1) g += s[p] ?? 0;
371
+ return g;
372
+ }, Xt = (t) => {
373
+ const e = b?.getBoundingClientRect(), r = dt(u().root, t);
374
+ return !e || !r ? 0 : (r.direction === "row" ? e.width : e.height) * We(t) / 100;
375
+ }, Qt = (t) => t > 0 ? W() / t * 100 : 0, Jt = (t, e) => {
376
+ const r = dt(t.root, e);
365
377
  return {
366
378
  type: "resize",
367
379
  split: e,
368
380
  sizes: r ? [...r.sizes] : []
369
381
  };
370
- }, $e = (t, e, r, o) => {
371
- const n = b, s = se(n, t, e, r, o);
372
- s !== n && V(s, Yt(s, t));
373
- }, Ke = (t, e, r) => (o) => {
382
+ }, Ye = (t, e, r, o) => {
383
+ const n = v, s = fe(n, t, e, r, o);
384
+ s !== n && Z(s, Jt(s, t));
385
+ }, je = (t, e, r) => (o) => {
374
386
  if (o.defaultPrevented) return;
375
- const n = r === "vertical", s = o.key === (n ? "ArrowLeft" : "ArrowUp"), a = o.key === (n ? "ArrowRight" : "ArrowDown"), i = o.key === "Home" || o.key === "End";
376
- if (!s && !a && !i) return;
387
+ const n = r === "vertical", s = o.key === (n ? "ArrowLeft" : "ArrowUp"), i = o.key === (n ? "ArrowRight" : "ArrowDown"), a = o.key === "Home" || o.key === "End";
388
+ if (!s && !i && !a) return;
377
389
  o.preventDefault();
378
- const u = i ? o.key === "Home" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY : s ? -F() : F();
379
- $e(t, e, u, Wt(Vt(t)));
390
+ const g = a ? o.key === "Home" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY : s ? -z() : z();
391
+ Ye(t, e, g, Qt(Xt(t)));
380
392
  };
381
- let rt = null;
382
- const At = (t, e) => e === "vertical" ? t.clientX : t.clientY, jt = (t) => {
383
- const e = rt;
393
+ let it = null;
394
+ const xt = (t, e) => e === "vertical" ? t.clientX : t.clientY, It = (t) => {
395
+ const e = it;
384
396
  if (!e) return;
385
- const r = t - e.start, o = e.extentPx > 0 ? r / e.extentPx * 100 : 0, n = se(e.layout, e.split, e.index, o, e.min);
386
- n !== b && V(n, Yt(n, e.split));
387
- }, Tt = _r(jt, 1e3 / 60);
388
- pt(() => Tt.cancel()), $ || xt(() => {
389
- const t = kt();
397
+ const r = t - e.start, o = e.extentPx > 0 ? r / e.extentPx * 100 : 0, n = fe(e.layout, e.split, e.index, o, e.min);
398
+ n !== v && Z(n, Jt(n, e.split));
399
+ }, Ot = Fr(It, 1e3 / 60);
400
+ wt(() => Ot.cancel()), H || Ft(() => {
401
+ const t = Kt();
390
402
  if (!t) return;
391
403
  const e = document.body, r = e.style.cursor;
392
- e.style.cursor = t.orientation === "vertical" ? "col-resize" : "row-resize", pt(() => {
404
+ e.style.cursor = t.orientation === "vertical" ? "col-resize" : "row-resize", wt(() => {
393
405
  e.style.cursor = r;
394
406
  });
395
407
  });
396
- const Be = (t, e, r, o) => (n) => {
397
- if ($ || n.pointerType === "mouse" && n.button !== 0) return;
398
- const s = Vt(e);
399
- rt = {
408
+ const Ze = (t, e, r, o) => (n) => {
409
+ if (H || n.pointerType === "mouse" && n.button !== 0) return;
410
+ const s = Xt(e);
411
+ it = {
400
412
  key: t,
401
413
  split: e,
402
414
  index: r,
403
415
  orientation: o,
404
416
  pointerId: n.pointerId,
405
- start: At(n, o),
417
+ start: xt(n, o),
406
418
  extentPx: s,
407
- min: Wt(s),
408
- layout: b
409
- }, Ft({
419
+ min: Qt(s),
420
+ layout: v
421
+ }, Bt({
410
422
  key: t,
411
423
  orientation: o
412
424
  });
413
- const a = n.currentTarget;
414
- if (typeof a.setPointerCapture == "function")
425
+ const i = n.currentTarget;
426
+ if (typeof i.setPointerCapture == "function")
415
427
  try {
416
- a.setPointerCapture(n.pointerId);
428
+ i.setPointerCapture(n.pointerId);
417
429
  } catch {
418
430
  }
419
- }, He = (t) => (e) => {
420
- const r = rt;
421
- !r || r.pointerId !== e.pointerId || Tt(At(e, t));
422
- }, Zt = (t) => (e) => {
423
- const r = rt;
424
- !r || r.pointerId !== e.pointerId || (Tt.cancel(), jt(At(e, t)), rt = null, Ft(null), e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
431
+ }, Xe = (t) => (e) => {
432
+ const r = it;
433
+ !r || r.pointerId !== e.pointerId || Ot(xt(e, t));
434
+ }, te = (t) => (e) => {
435
+ const r = it;
436
+ !r || r.pointerId !== e.pointerId || (Ot.cancel(), It(xt(e, t)), it = null, Bt(null), e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId));
425
437
  };
426
- let Y = null, ft = null, z;
427
- pt(() => {
428
- z !== void 0 && cancelAnimationFrame(z);
438
+ let Q = null, ht = null, B;
439
+ wt(() => {
440
+ B !== void 0 && cancelAnimationFrame(B);
429
441
  });
430
- const ot = (t) => {
431
- ft !== t && (ft?.classList.remove("smwb-tab-item--drop-target"), ft = t, t?.classList.add("smwb-tab-item--drop-target"));
432
- }, Dt = () => {
433
- const t = Y?.group;
434
- Array.from(h?.querySelectorAll(":scope > .smwb-tab-groups__header") ?? []).find((r) => r.getAttribute("data-group-id") === t)?.querySelectorAll(".smwb-tab-item--drop-target").forEach((r) => {
435
- r !== ft && r.classList.remove("smwb-tab-item--drop-target");
442
+ const at = (t) => {
443
+ ht !== t && (ht?.classList.remove("smwb-tab-item--drop-target"), ht = t, t?.classList.add("smwb-tab-item--drop-target"));
444
+ }, Mt = () => {
445
+ const t = Q?.group;
446
+ Array.from(b?.querySelectorAll(":scope > .smwb-tab-groups__header") ?? []).find((r) => r.getAttribute("data-group-id") === t)?.querySelectorAll(".smwb-tab-item--drop-target").forEach((r) => {
447
+ r !== ht && r.classList.remove("smwb-tab-item--drop-target");
436
448
  });
437
- }, Xt = () => {
438
- Y = null, z !== void 0 && (cancelAnimationFrame(z), z = void 0), ot(null), I(null), tt(null), Nt(!1);
439
- }, Qt = (t) => {
440
- if (!h || !t || t.closest(".smwb-tab-groups") !== h) return null;
449
+ }, ee = () => {
450
+ Q = null, B !== void 0 && (cancelAnimationFrame(B), B = void 0), at(null), nt(null), st(null), zt(!1);
451
+ }, re = (t) => {
452
+ if (!b || !t || t.closest(".smwb-tab-groups") !== b) return null;
441
453
  const e = t.closest(".smwb-tab-groups__header");
442
454
  if (e) {
443
455
  const n = e.getAttribute("data-group-id");
444
456
  if (!n) return null;
445
- const s = le(t), a = s?.getAttribute("data-tab-id"), i = S(b, n)?.tabs ?? [], u = a ? i.indexOf(a) : -1;
457
+ const s = he(t), i = s?.getAttribute("data-tab-id"), a = T(v, n)?.tabs ?? [], g = i ? a.indexOf(i) : -1;
446
458
  return {
447
459
  kind: "row",
448
460
  group: n,
449
- index: u >= 0 ? u : null,
450
- item: u >= 0 && s ? ue(s) : null
461
+ index: g >= 0 ? g : null,
462
+ item: g >= 0 && s ? be(s) : null
451
463
  };
452
464
  }
453
465
  const r = t.closest(".smwb-tab-groups__drop-target");
@@ -458,57 +470,57 @@ function Do(f) {
458
470
  group: o,
459
471
  element: r
460
472
  } : null;
461
- }, Jt = (t, e) => {
473
+ }, oe = (t, e) => {
462
474
  const r = t.getBoundingClientRect();
463
- return Gr(e.clientX - r.left, e.clientY - r.top, r.width, r.height);
464
- }, It = (t, e, r) => t !== e ? !0 : r === "center" ? !1 : (S(b, e)?.tabs.length ?? 0) >= 2, Ue = (t) => {
465
- if (Q(c.onDragStart, t), $) return;
475
+ return qr(e.clientX - r.left, e.clientY - r.top, r.width, r.height);
476
+ }, ne = (t, e, r) => t !== e ? !0 : r === "center" ? !1 : (T(v, e)?.tabs.length ?? 0) >= 2, Qe = (t) => {
477
+ if (rt(c.onDragStart, t), H) return;
466
478
  const e = t.target;
467
- if (!(e instanceof Element) || !h || e.closest(".smwb-tab-groups") !== h) return;
468
- const r = le(e), o = r?.getAttribute("data-tab-id");
479
+ if (!(e instanceof Element) || !b || e.closest(".smwb-tab-groups") !== b) return;
480
+ const r = he(e), o = r?.getAttribute("data-tab-id");
469
481
  if (!r || !o || r.getAttribute("aria-disabled") === "true") return;
470
- const n = Mt(r);
482
+ const n = kt(r);
471
483
  if (!n) return;
472
- const s = h.ownerDocument, a = s.activeElement;
473
- Y = {
484
+ const s = b.ownerDocument, i = s.activeElement;
485
+ Q = {
474
486
  tab: o,
475
487
  group: n,
476
- hadFocus: !!(a && a !== s.body && ue(r).contains(a))
488
+ hadFocus: !!(i && i !== s.body && be(r).contains(i))
477
489
  };
478
- const i = s.defaultView;
479
- i && (z = i.requestAnimationFrame(() => {
480
- z = void 0, Nt(!0);
490
+ const a = s.defaultView;
491
+ a && (B = a.requestAnimationFrame(() => {
492
+ B = void 0, zt(!0);
481
493
  }));
482
- }, qe = (t) => {
483
- Q(c.onDragOver, t);
484
- const e = Y;
494
+ }, Je = (t) => {
495
+ rt(c.onDragOver, t);
496
+ const e = Q;
485
497
  if (!e) return;
486
- const r = Qt(t.target);
498
+ const r = re(t.target);
487
499
  if (!r) {
488
- ot(null), Dt(), I(null), tt(null);
500
+ at(null), Mt(), nt(null), st(null);
489
501
  return;
490
502
  }
491
503
  if (r.kind === "row") {
492
504
  if (r.group === e.group) {
493
- ot(null), r.item?.classList.add("smwb-tab-item--drop-target");
505
+ at(null), r.item?.classList.add("smwb-tab-item--drop-target");
494
506
  return;
495
507
  }
496
- Dt(), t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), I(null), tt(null), ot(r.item);
508
+ Mt(), t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), nt(null), st(null), at(r.item);
497
509
  return;
498
510
  }
499
- ot(null), Dt();
500
- const o = Jt(r.element, t);
501
- if (!It(e.group, r.group, o)) {
502
- I(null), tt(null);
511
+ at(null), Mt();
512
+ const o = oe(r.element, t);
513
+ if (!ne(e.group, r.group, o)) {
514
+ nt(null), st(null);
503
515
  return;
504
516
  }
505
- t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), I(r.group), tt(o);
506
- }, Ve = (t) => {
507
- Q(c.onDrop, t);
508
- const e = Y;
517
+ t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), nt(r.group), st(o);
518
+ }, Ie = (t) => {
519
+ rt(c.onDrop, t);
520
+ const e = Q;
509
521
  if (!e) return;
510
- const r = t.defaultPrevented ? null : Qt(t.target), o = r && r.kind === "body" ? Jt(r.element, t) : null;
511
- if (Xt(), !r) return;
522
+ const r = t.defaultPrevented ? null : re(t.target), o = r && r.kind === "body" ? oe(r.element, t) : null;
523
+ if (ee(), !r) return;
512
524
  if (r.kind === "row") {
513
525
  if (r.group === e.group) return;
514
526
  const s = r.index === null ? {
@@ -517,33 +529,33 @@ function Do(f) {
517
529
  group: r.group,
518
530
  index: r.index
519
531
  };
520
- P(K(b, e.tab, s), b, e.tab, e.group, {
532
+ k(q(v, e.tab, s), v, e.tab, e.group, {
521
533
  focus: e.hadFocus
522
534
  });
523
535
  return;
524
536
  }
525
- if (!o || !It(e.group, r.group, o)) return;
537
+ if (!o || !ne(e.group, r.group, o)) return;
526
538
  const n = o === "center" ? {
527
539
  group: r.group
528
540
  } : {
529
541
  group: r.group,
530
542
  edge: o
531
543
  };
532
- P(K(b, e.tab, n), b, e.tab, e.group, {
544
+ k(q(v, e.tab, n), v, e.tab, e.group, {
533
545
  edge: o === "center" ? void 0 : o,
534
546
  focus: e.hadFocus
535
547
  });
536
- }, We = (t) => {
537
- Q(c.onDragEnd, t), Xt();
538
- }, Ye = (t) => {
539
- Q(c.onFocusIn, t);
540
- const e = h, r = t.target;
548
+ }, tr = (t) => {
549
+ rt(c.onDragEnd, t), ee();
550
+ }, er = (t) => {
551
+ rt(c.onFocusIn, t);
552
+ const e = b, r = t.target;
541
553
  if (!e || !(r instanceof HTMLElement)) return;
542
- const o = et;
543
- if (et = ae(r) === e ? r : null, o instanceof HTMLElement && o.localName === "iframe" && o !== r && !Et) {
544
- const s = Hr(e, o, r);
545
- if (s !== null && s === lt) {
546
- dt = !0, s !== r && s.focus({
554
+ const o = j;
555
+ if (j = ge(r) === e ? r : null, M = j === null ? null : jr(e, r), o instanceof HTMLElement && o.localName === "iframe" && o !== r && !_t) {
556
+ const s = Zr(e, o, r);
557
+ if (s !== null && s === mt) {
558
+ bt = !0, s !== r && s.focus({
547
559
  preventScroll: !0
548
560
  });
549
561
  return;
@@ -553,74 +565,81 @@ function Do(f) {
553
565
  return;
554
566
  }
555
567
  }
556
- if (r === lt) {
557
- Ze();
568
+ if (r === mt) {
569
+ or();
558
570
  return;
559
571
  }
560
- const n = ie(e, r);
561
- !n || b.activeGroup === n || V(Mr(b, n), {
572
+ const n = pe(e, r);
573
+ !n || v.activeGroup === n || Z(Nr(v, n), {
562
574
  type: "activate",
563
575
  group: n
564
576
  });
565
- }, je = (t) => {
566
- if (Q(c.onKeyDown, t), t.defaultPrevented || t.key !== "Tab" || t.altKey || t.ctrlKey || t.metaKey || t.isComposing) return;
567
- const e = h, r = e ? ht(e.ownerDocument) : null;
568
- if (!e || !r || !ce(e, r)) return;
569
- const o = Ur(e, r, t.shiftKey ? -1 : 1);
570
- o && (o.element === lt && (dt = !0), et = null, o.prevent ? (t.preventDefault(), o.element.focus()) : o.element.focus({
577
+ }, rr = (t) => {
578
+ if (rt(c.onKeyDown, t), t.defaultPrevented || t.key !== "Tab" || t.altKey || t.ctrlKey || t.metaKey || t.isComposing) return;
579
+ const e = b, r = e ? lt(e.ownerDocument) : null;
580
+ if (!e || !r || !me(e, r)) return;
581
+ const o = Xr(e, r, t.shiftKey ? -1 : 1);
582
+ o && (o.element === mt && (bt = !0), j = null, o.prevent ? (t.preventDefault(), o.element.focus()) : o.element.focus({
571
583
  preventScroll: !0
572
584
  }));
573
585
  };
574
- vr(() => {
575
- const t = h, e = t?.ownerDocument.defaultView;
586
+ Dr(() => {
587
+ const t = b, e = t?.ownerDocument.defaultView;
576
588
  if (!t || !e) return;
577
589
  let r;
578
590
  const o = () => {
579
- Et = !0, e.clearTimeout(r), r = e.setTimeout(() => {
580
- Et = !1;
591
+ _t = !0, e.clearTimeout(r), r = e.setTimeout(() => {
592
+ _t = !1;
581
593
  }, 0);
582
- }, n = (a) => {
583
- a.relatedTarget instanceof Node && !t.contains(a.relatedTarget) && (et = null);
594
+ }, n = (i) => {
595
+ if (i.relatedTarget instanceof Node && !t.contains(i.relatedTarget)) {
596
+ j = null, M = null;
597
+ return;
598
+ }
599
+ const a = M;
600
+ i.relatedTarget === null && a?.element === i.target && queueMicrotask(() => {
601
+ M === a && a.element.isConnected && (M = null);
602
+ });
584
603
  }, s = () => {
585
- const a = t.ownerDocument.activeElement;
586
- a instanceof e.HTMLIFrameElement && ae(a) === t && (et = a);
604
+ const i = t.ownerDocument.activeElement;
605
+ i instanceof e.HTMLIFrameElement && ge(i) === t && (j = i);
587
606
  };
588
- t.addEventListener("pointerdown", o, !0), t.addEventListener("focusout", n), e.addEventListener("blur", s), pt(() => {
607
+ t.addEventListener("pointerdown", o, !0), t.addEventListener("focusout", n), e.addEventListener("blur", s), wt(() => {
589
608
  e.clearTimeout(r), t.removeEventListener("pointerdown", o, !0), t.removeEventListener("focusout", n), e.removeEventListener("blur", s);
590
609
  });
591
610
  });
592
- const Ze = () => {
593
- if (dt || !h) return;
594
- const t = qr(h);
595
- t && Vr(t);
596
- }, Xe = () => Dr(c.style, {
597
- "grid-template-columns": Pr(R()),
598
- "grid-template-rows": Lr(R())
599
- }), Qe = (t) => {
600
- const e = R().groups.find((r) => r.id === t);
601
- return e ? Fr(e) : "auto";
602
- }, Je = (t) => {
603
- const e = vt().get(t), r = e === void 0 ? void 0 : R().groups.find((o) => o.id === e);
604
- return r ? ne(r) : "auto";
605
- }, Ie = (t, e) => R().separators.find((r) => r.split === t && r.index === e), tr = (t, e) => {
606
- const r = at(l().root, t);
611
+ const or = () => {
612
+ if (bt || !b) return;
613
+ const t = Qr(b);
614
+ t && Jr(t);
615
+ }, nr = () => Rr(c.style, {
616
+ "grid-template-columns": zr(G()),
617
+ "grid-template-rows": $r(G())
618
+ }), sr = (t) => {
619
+ const e = G().groups.find((r) => r.id === t);
620
+ return e ? Hr(e) : "auto";
621
+ }, ir = (t) => {
622
+ const e = Et().get(t), r = e === void 0 ? void 0 : G().groups.find((o) => o.id === e);
623
+ return r ? de(r) : "auto";
624
+ }, ar = (t, e) => G().separators.find((r) => r.split === t && r.index === e), cr = (t, e) => {
625
+ const r = dt(u().root, t);
607
626
  if (!r) return 0;
608
627
  const o = r.sizes[e] ?? 0, n = o + (r.sizes[e + 1] ?? 0);
609
628
  return n > 0 ? Math.round(o / n * 100) : 0;
610
- }, er = (t) => {
611
- const e = De() === t ? Ce() : null;
629
+ }, ur = (t) => {
630
+ const e = Re() === t ? Le() : null;
612
631
  return e ? `smwb-tab-groups__drop-target--${e}` : void 0;
613
- }, rr = wr(() => c.empty), or = (t, e) => {
632
+ }, lr = ue(() => c.empty), dr = (t, e) => {
614
633
  const r = () => c.getTab(e), o = m(() => r()?.closable !== !1), n = m(() => {
615
- const a = r(), i = {};
616
- return a?.disabled && (i.disabled = !0), a?.closeLabel !== void 0 && (i.closeLabel = a.closeLabel), a?.actions !== void 0 && (i.actions = a.actions), i;
617
- }), s = m(() => r()?.disabled ? void 0 : ro);
618
- return w(Er, re(n, {
634
+ const i = r(), a = {};
635
+ return i?.disabled && (a.disabled = !0), i?.closeLabel !== void 0 && (a.closeLabel = i.closeLabel), i?.actions !== void 0 && (a.actions = i.actions), c.fit === !0 && i?.title !== void 0 && (a.title = i.title), a;
636
+ }), s = m(() => r()?.disabled ? void 0 : fo);
637
+ return S(xr, ae(n, {
619
638
  get id() {
620
- return B(e);
639
+ return U(e);
621
640
  },
622
641
  get "aria-controls"() {
623
- return L(e);
642
+ return P(e);
624
643
  },
625
644
  "data-tab-id": e,
626
645
  get "aria-keyshortcuts"() {
@@ -635,120 +654,141 @@ function Do(f) {
635
654
  get closable() {
636
655
  return o();
637
656
  },
638
- onClose: (a, i) => Pe(e, a, i)
657
+ onClose: (i, a) => Be(e, i, a)
639
658
  }));
640
- }, nr = (t) => {
641
- const [e, r] = N(null), o = () => S(l(), t), n = () => o()?.tabs ?? [], s = () => {
642
- const a = o()?.active;
643
- if (a == null) return 0;
644
- const i = n().indexOf(a);
645
- return i < 0 ? 0 : i;
646
- };
659
+ }, fr = (t) => {
660
+ const [e, r] = N(null), o = () => T(u(), t), n = () => o()?.tabs ?? [], s = () => {
661
+ const h = o()?.active;
662
+ if (h == null) return 0;
663
+ const f = n().indexOf(h);
664
+ return f < 0 ? 0 : f;
665
+ }, i = m(() => At(t)), a = m(() => u().activeGroup === t), g = {
666
+ get index() {
667
+ return i();
668
+ },
669
+ get count() {
670
+ return $t();
671
+ },
672
+ get active() {
673
+ return a();
674
+ }
675
+ }, p = ue(() => c.stripActions?.(g)), w = () => p.toArray().some(po);
647
676
  return (() => {
648
- var a = jr();
649
- return Z(a, "keydown", Ne(t), !0), v(a, "data-group-id", t), _(a, w(Sr, {
677
+ var h = oo();
678
+ return I(h, "keydown", He(t), !0), E(h, "data-group-id", t), O(h, S(_r, {
650
679
  class: "smwb-tab-groups__tabs",
651
680
  get value() {
652
681
  return s();
653
682
  },
654
683
  get onChange() {
655
- return Me(t);
684
+ return ze(t);
656
685
  },
657
686
  get onReorder() {
658
- return Le(t);
687
+ return Ke(t);
659
688
  },
660
689
  get "aria-label"() {
661
- return d().group(Pt(t) + 1, ge());
690
+ return d().group(At(t) + 1, $t());
662
691
  },
663
692
  scrollable: !0,
664
693
  overflowMenu: !0,
665
694
  get dense() {
666
695
  return c.dense === !0;
667
696
  },
697
+ get fit() {
698
+ return c.fit === !0;
699
+ },
668
700
  get children() {
669
- return w(oe, {
701
+ return S(le, {
670
702
  get each() {
671
703
  return n();
672
704
  },
673
- children: (i) => or(t, i)
705
+ children: (f) => dr(t, f)
674
706
  });
675
707
  }
676
- }), null), _(a, w(st, {
708
+ }), null), O(h, S(tt, {
709
+ get when() {
710
+ return w();
711
+ },
712
+ get children() {
713
+ var f = eo();
714
+ return O(f, p), f;
715
+ }
716
+ }), null), O(h, S(tt, {
677
717
  get when() {
678
- return it();
718
+ return ft();
679
719
  },
680
720
  get children() {
681
721
  return [(() => {
682
- var i = Yr();
683
- return i.$$keydown = (u) => Ge(t, u), i.$$click = (u) => Fe(t, u), Ct((u) => r(() => u), i), _(i, w(Wr, {
722
+ var f = ro();
723
+ return f.$$keydown = (y) => Ve(t, y), f.$$click = (y) => Ue(t, y), Rt((y) => r(() => y), f), O(f, S(to, {
684
724
  name: "more_vert",
685
725
  size: 20
686
- })), j((u) => {
687
- var g = d().groupActions, p = ct() === t, C = ct() === t ? H(t) : void 0;
688
- return g !== u.e && v(i, "aria-label", u.e = g), p !== u.t && v(i, "aria-expanded", u.t = p), C !== u.a && v(i, "aria-controls", u.a = C), u;
726
+ })), J((y) => {
727
+ var ct = d().groupActions, ut = gt() === t, ie = gt() === t ? V(t) : void 0;
728
+ return ct !== y.e && E(f, "aria-label", y.e = ct), ut !== y.t && E(f, "aria-expanded", y.t = ut), ie !== y.a && E(f, "aria-controls", y.a = ie), y;
689
729
  }, {
690
730
  e: void 0,
691
731
  t: void 0,
692
732
  a: void 0
693
- }), i;
694
- })(), w(Ar, {
733
+ }), f;
734
+ })(), S(Or, {
695
735
  get id() {
696
- return H(t);
736
+ return V(t);
697
737
  },
698
738
  get anchorElement() {
699
739
  return e();
700
740
  },
701
741
  get isOpen() {
702
- return ct() === t;
742
+ return gt() === t;
703
743
  },
704
- onClose: () => ut(null),
744
+ onClose: () => pt(null),
705
745
  placement: "bottom-end",
706
746
  get children() {
707
- return [w(X, {
747
+ return [S(et, {
708
748
  get disabled() {
709
- return !Bt(t);
749
+ return !Wt(t);
710
750
  },
711
- onClick: () => W(t, "splitRight"),
751
+ onClick: () => X(t, "splitRight"),
712
752
  get children() {
713
753
  return d().splitRight;
714
754
  }
715
- }), w(X, {
755
+ }), S(et, {
716
756
  get disabled() {
717
- return !Bt(t);
757
+ return !Wt(t);
718
758
  },
719
- onClick: () => W(t, "splitDown"),
759
+ onClick: () => X(t, "splitDown"),
720
760
  get children() {
721
761
  return d().splitDown;
722
762
  }
723
- }), w(X, {
763
+ }), S(et, {
724
764
  get disabled() {
725
- return !Ut(t, -1);
765
+ return !jt(t, -1);
726
766
  },
727
- onClick: () => W(t, "previous"),
767
+ onClick: () => X(t, "previous"),
728
768
  get children() {
729
769
  return d().moveToPreviousGroup;
730
770
  }
731
- }), w(X, {
771
+ }), S(et, {
732
772
  get disabled() {
733
- return !Ut(t, 1);
773
+ return !jt(t, 1);
734
774
  },
735
- onClick: () => W(t, "next"),
775
+ onClick: () => X(t, "next"),
736
776
  get children() {
737
777
  return d().moveToNextGroup;
738
778
  }
739
- }), w(X, {
779
+ }), S(et, {
740
780
  get disabled() {
741
- return !qt(t, -1);
781
+ return !Zt(t, -1);
742
782
  },
743
- onClick: () => W(t, "left"),
783
+ onClick: () => X(t, "left"),
744
784
  get children() {
745
785
  return d().moveLeft;
746
786
  }
747
- }), w(X, {
787
+ }), S(et, {
748
788
  get disabled() {
749
- return !qt(t, 1);
789
+ return !Zt(t, 1);
750
790
  },
751
- onClick: () => W(t, "right"),
791
+ onClick: () => X(t, "right"),
752
792
  get children() {
753
793
  return d().moveRight;
754
794
  }
@@ -756,31 +796,31 @@ function Do(f) {
756
796
  }
757
797
  })];
758
798
  }
759
- }), null), j((i) => {
760
- var u = mt("smwb-tab-groups__header", {
761
- "smwb-tab-groups__header--active": l().activeGroup === t
762
- }), g = x(t), p = Qe(t);
763
- return u !== i.e && _t(a, i.e = u), g !== i.t && v(a, "id", i.t = g), p !== i.a && gt(a, "grid-area", i.a = p), i;
799
+ }), null), J((f) => {
800
+ var y = yt("smwb-tab-groups__header", {
801
+ "smwb-tab-groups__header--active": u().activeGroup === t
802
+ }), ct = L(t), ut = sr(t);
803
+ return y !== f.e && Lt(h, f.e = y), ct !== f.t && E(h, "id", f.t = ct), ut !== f.a && vt(h, "grid-area", f.a = ut), f;
764
804
  }, {
765
805
  e: void 0,
766
806
  t: void 0,
767
807
  a: void 0
768
- }), a;
808
+ }), h;
769
809
  })();
770
- }, sr = (t) => {
771
- const e = m(() => ye().has(t)), r = m(() => me().has(t)), o = m(() => vt().get(t) ?? "");
810
+ }, gr = (t) => {
811
+ const e = m(() => Ce().has(t)), r = m(() => Se().has(t)), o = m(() => Et().get(t) ?? "");
772
812
  return (() => {
773
- var n = Xr();
774
- return v(n, "data-tab-id", t), _(n, w(st, {
813
+ var n = so();
814
+ return E(n, "data-tab-id", t), O(n, S(tt, {
775
815
  get when() {
776
816
  return e();
777
817
  },
778
818
  get children() {
779
- return [fr(() => c.renderPanel(t)), Zr()];
819
+ return [yr(() => c.renderPanel(t)), no()];
780
820
  }
781
- })), j((s) => {
782
- var a = L(t), i = B(t), u = r() ? void 0 : !0, g = o(), p = Je(t);
783
- return a !== s.e && v(n, "id", s.e = a), i !== s.t && v(n, "aria-labelledby", s.t = i), u !== s.a && (n.hidden = s.a = u), g !== s.o && v(n, "data-group-id", s.o = g), p !== s.i && gt(n, "grid-area", s.i = p), s;
821
+ })), J((s) => {
822
+ var i = P(t), a = U(t), g = r() ? void 0 : !0, p = o(), w = ir(t);
823
+ return i !== s.e && E(n, "id", s.e = i), a !== s.t && E(n, "aria-labelledby", s.t = a), g !== s.a && (n.hidden = s.a = g), p !== s.o && E(n, "data-group-id", s.o = p), w !== s.i && vt(n, "grid-area", s.i = w), s;
784
824
  }, {
785
825
  e: void 0,
786
826
  t: void 0,
@@ -789,18 +829,18 @@ function Do(f) {
789
829
  i: void 0
790
830
  }), n;
791
831
  })();
792
- }, ar = (t, e, r) => {
793
- const o = () => Ie(e, r), n = () => o()?.orientation ?? "vertical", s = () => {
794
- const a = o();
795
- return a ? Kr(a) : "auto";
832
+ }, pr = (t, e, r) => {
833
+ const o = () => ar(e, r), n = () => o()?.orientation ?? "vertical", s = () => {
834
+ const i = o();
835
+ return i ? Wr(i) : "auto";
796
836
  };
797
837
  return (() => {
798
- var a = Qr();
799
- return Z(a, "pointercancel", Zt(n())), Z(a, "pointerup", Zt(n()), !0), Z(a, "pointermove", He(n()), !0), Z(a, "pointerdown", Be(t, e, r, n()), !0), Z(a, "keydown", Ke(e, r, n()), !0), v(a, "data-split-id", e), v(a, "data-index", r), j((i) => {
800
- var u = mt("smwb-tab-groups__separator", `smwb-tab-groups__separator--${n()}`, {
801
- "smwb-tab-groups__separator--dragging": kt()?.key === t
802
- }), g = O(e, r), p = n(), C = tr(e, r), nt = d().resize, ee = s();
803
- return u !== i.e && _t(a, i.e = u), g !== i.t && v(a, "id", i.t = g), p !== i.a && v(a, "aria-orientation", i.a = p), C !== i.o && v(a, "aria-valuenow", i.o = C), nt !== i.i && v(a, "aria-label", i.i = nt), ee !== i.n && gt(a, "grid-area", i.n = ee), i;
838
+ var i = io();
839
+ return I(i, "pointercancel", te(n())), I(i, "pointerup", te(n()), !0), I(i, "pointermove", Xe(n()), !0), I(i, "pointerdown", Ze(t, e, r, n()), !0), I(i, "keydown", je(e, r, n()), !0), E(i, "data-split-id", e), E(i, "data-index", r), J((a) => {
840
+ var g = yt("smwb-tab-groups__separator", `smwb-tab-groups__separator--${n()}`, {
841
+ "smwb-tab-groups__separator--dragging": Kt()?.key === t
842
+ }), p = F(e, r), w = n(), h = cr(e, r), f = d().resize, y = s();
843
+ return g !== a.e && Lt(i, a.e = g), p !== a.t && E(i, "id", a.t = p), w !== a.a && E(i, "aria-orientation", a.a = w), h !== a.o && E(i, "aria-valuenow", a.o = h), f !== a.i && E(i, "aria-label", a.i = f), y !== a.n && vt(i, "grid-area", a.n = y), a;
804
844
  }, {
805
845
  e: void 0,
806
846
  t: void 0,
@@ -808,65 +848,65 @@ function Do(f) {
808
848
  o: void 0,
809
849
  i: void 0,
810
850
  n: void 0
811
- }), a;
851
+ }), i;
812
852
  })();
813
- }, ir = (t) => {
853
+ }, mr = (t) => {
814
854
  const e = t.lastIndexOf(":");
815
- return ar(t, t.slice(2, e), Number(t.slice(e + 1)));
816
- }, cr = m(Ot(() => q() ? [] : be(), nr)), ur = m(Ot(() => q() ? [] : he(), ir)), lr = m(Ot(() => q() ? [] : ve(), sr)), te = m(() => [...cr(), ...ur(), ...lr()]);
855
+ return pr(t, t.slice(2, e), Number(t.slice(e + 1)));
856
+ }, br = m(Gt(() => Y() ? [] : Ee(), fr)), hr = m(Gt(() => Y() ? [] : Ae(), mr)), vr = m(Gt(() => Y() ? [] : Te(), gr)), se = m(() => [...br(), ...hr(), ...vr()]);
817
857
  return (() => {
818
- var t = to(), e = t.firstChild, r = Tr(c.ref, (o) => {
819
- h = o, !$ && yr((n) => {
820
- const s = te();
821
- return so(o, s, n), s;
858
+ var t = uo(), e = t.firstChild, r = Mr(c.ref, (o) => {
859
+ b = o, !H && Cr((n) => {
860
+ const s = se();
861
+ return bo(o, s, n), s;
822
862
  }, []);
823
863
  });
824
- return typeof r == "function" && Ct(r, t), dr(t, re(T, {
864
+ return typeof r == "function" && Rt(r, t), wr(t, ae(_, {
825
865
  get id() {
826
- return D();
866
+ return x();
827
867
  },
828
868
  get class() {
829
- return mt("smwb-tab-groups", {
830
- "smwb-tab-groups--split": pe()
869
+ return yt("smwb-tab-groups", {
870
+ "smwb-tab-groups--split": ye()
831
871
  }, c.class);
832
872
  },
833
873
  get style() {
834
- return Xe();
874
+ return nr();
835
875
  },
836
876
  get "data-testid"() {
837
877
  return c["data-testid"] ?? "tab-groups";
838
878
  },
839
879
  get "aria-owns"() {
840
- return we();
880
+ return De();
841
881
  },
842
- onKeyDown: je,
843
- onDragStart: Ue,
844
- onDragOver: qe,
845
- onDrop: Ve,
846
- onDragEnd: We,
847
- onFocusIn: Ye
848
- }), !1, !0), _(t, () => $ ? te() : void 0, e), _(t, w(st, {
882
+ onKeyDown: rr,
883
+ onDragStart: Qe,
884
+ onDragOver: Je,
885
+ onDrop: Ie,
886
+ onDragEnd: tr,
887
+ onFocusIn: er
888
+ }), !1, !0), O(t, () => H ? se() : void 0, e), O(t, S(tt, {
849
889
  get when() {
850
- return q();
890
+ return Y();
851
891
  },
852
892
  get children() {
853
- var o = Jr();
854
- return _(o, rr), o;
893
+ var o = ao();
894
+ return O(o, lr), o;
855
895
  }
856
- }), e), _(t, w(st, {
896
+ }), e), O(t, S(tt, {
857
897
  get when() {
858
- return Te();
898
+ return Me();
859
899
  },
860
900
  get children() {
861
- return w(oe, {
901
+ return S(le, {
862
902
  get each() {
863
- return R().groups;
903
+ return G().groups;
864
904
  },
865
905
  children: (o) => (() => {
866
- var n = eo();
867
- return j((s) => {
868
- var a = mt("smwb-tab-groups__drop-target", er(o.id)), i = o.id, u = ne(o);
869
- return a !== s.e && _t(n, s.e = a), i !== s.t && v(n, "data-group-id", s.t = i), u !== s.a && gt(n, "grid-area", s.a = u), s;
906
+ var n = lo();
907
+ return J((s) => {
908
+ var i = yt("smwb-tab-groups__drop-target", ur(o.id)), a = o.id, g = de(o);
909
+ return i !== s.e && Lt(n, s.e = i), a !== s.t && E(n, "data-group-id", s.t = a), g !== s.a && vt(n, "grid-area", s.a = g), s;
870
910
  }, {
871
911
  e: void 0,
872
912
  t: void 0,
@@ -875,21 +915,21 @@ function Do(f) {
875
915
  })()
876
916
  });
877
917
  }
878
- }), e), _(t, w(st, {
918
+ }), e), O(t, S(tt, {
879
919
  get when() {
880
- return !q();
920
+ return !Y();
881
921
  },
882
922
  get children() {
883
- var o = Ir();
923
+ var o = co();
884
924
  return o.addEventListener("blur", () => {
885
- dt = !1;
886
- }), Ct((n) => lt = n, o), o;
925
+ bt = !1;
926
+ }), Rt((n) => mt = n, o), o;
887
927
  }
888
- }), e), v(e, "aria-atomic", !0), _(e, Ee), j(() => v(e, "id", J())), t;
928
+ }), e), E(e, "aria-atomic", !0), O(e, xe), J(() => E(e, "id", ot())), t;
889
929
  })();
890
930
  }
891
- gr(["keydown", "click", "pointerdown", "pointermove", "pointerup"]);
931
+ Sr(["keydown", "click", "pointerdown", "pointermove", "pointerup"]);
892
932
  export {
893
- Do as TabGroups
933
+ Po as TabGroups
894
934
  };
895
935
  //# sourceMappingURL=tabGroups.js.map