@path58/ui 2.0.0 → 2.2.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 (65) hide show
  1. package/dist/atoms/Alert/Alert.d.ts +39 -0
  2. package/dist/atoms/Alert/Alert.d.ts.map +1 -0
  3. package/dist/atoms/Alert/Alert.stories.d.ts +12 -0
  4. package/dist/atoms/Alert/Alert.stories.d.ts.map +1 -0
  5. package/dist/atoms/Alert/index.d.ts +3 -0
  6. package/dist/atoms/Alert/index.d.ts.map +1 -0
  7. package/dist/atoms/Banner/Banner.d.ts +48 -0
  8. package/dist/atoms/Banner/Banner.d.ts.map +1 -0
  9. package/dist/atoms/Banner/Banner.stories.d.ts +11 -0
  10. package/dist/atoms/Banner/Banner.stories.d.ts.map +1 -0
  11. package/dist/atoms/Banner/index.d.ts +3 -0
  12. package/dist/atoms/Banner/index.d.ts.map +1 -0
  13. package/dist/atoms/StatusPill/StatusPill.d.ts +47 -0
  14. package/dist/atoms/StatusPill/StatusPill.d.ts.map +1 -0
  15. package/dist/atoms/StatusPill/index.d.ts +3 -0
  16. package/dist/atoms/StatusPill/index.d.ts.map +1 -0
  17. package/dist/atoms/Toast/Toast.d.ts +49 -0
  18. package/dist/atoms/Toast/Toast.d.ts.map +1 -0
  19. package/dist/atoms/Toast/Toast.stories.d.ts +10 -0
  20. package/dist/atoms/Toast/Toast.stories.d.ts.map +1 -0
  21. package/dist/atoms/Toast/index.d.ts +3 -0
  22. package/dist/atoms/Toast/index.d.ts.map +1 -0
  23. package/dist/atoms/index.d.ts +4 -0
  24. package/dist/atoms/index.d.ts.map +1 -1
  25. package/dist/index.d.ts +15 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1974 -411
  28. package/dist/molecules/ConfirmDialog/ConfirmDialog.d.ts +43 -0
  29. package/dist/molecules/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
  30. package/dist/molecules/ConfirmDialog/ConfirmDialog.stories.d.ts +9 -0
  31. package/dist/molecules/ConfirmDialog/ConfirmDialog.stories.d.ts.map +1 -0
  32. package/dist/molecules/ConfirmDialog/index.d.ts +3 -0
  33. package/dist/molecules/ConfirmDialog/index.d.ts.map +1 -0
  34. package/dist/molecules/Modal/Modal.d.ts +39 -0
  35. package/dist/molecules/Modal/Modal.d.ts.map +1 -0
  36. package/dist/molecules/Modal/Modal.stories.d.ts +11 -0
  37. package/dist/molecules/Modal/Modal.stories.d.ts.map +1 -0
  38. package/dist/molecules/Modal/index.d.ts +3 -0
  39. package/dist/molecules/Modal/index.d.ts.map +1 -0
  40. package/dist/molecules/PromptDialog/PromptDialog.d.ts +46 -0
  41. package/dist/molecules/PromptDialog/PromptDialog.d.ts.map +1 -0
  42. package/dist/molecules/PromptDialog/PromptDialog.stories.d.ts +10 -0
  43. package/dist/molecules/PromptDialog/PromptDialog.stories.d.ts.map +1 -0
  44. package/dist/molecules/PromptDialog/index.d.ts +3 -0
  45. package/dist/molecules/PromptDialog/index.d.ts.map +1 -0
  46. package/dist/molecules/index.d.ts +3 -0
  47. package/dist/molecules/index.d.ts.map +1 -1
  48. package/dist/organisms/ToastProvider/ToastProvider.d.ts +53 -0
  49. package/dist/organisms/ToastProvider/ToastProvider.d.ts.map +1 -0
  50. package/dist/organisms/ToastProvider/index.d.ts +4 -0
  51. package/dist/organisms/ToastProvider/index.d.ts.map +1 -0
  52. package/dist/organisms/ToastProvider/useToast.d.ts +28 -0
  53. package/dist/organisms/ToastProvider/useToast.d.ts.map +1 -0
  54. package/dist/organisms/index.d.ts +1 -0
  55. package/dist/organisms/index.d.ts.map +1 -1
  56. package/dist/primitives/Dialog/Dialog.d.ts +63 -0
  57. package/dist/primitives/Dialog/Dialog.d.ts.map +1 -0
  58. package/dist/primitives/Dialog/Dialog.stories.d.ts +9 -0
  59. package/dist/primitives/Dialog/Dialog.stories.d.ts.map +1 -0
  60. package/dist/primitives/Dialog/index.d.ts +3 -0
  61. package/dist/primitives/Dialog/index.d.ts.map +1 -0
  62. package/dist/primitives/index.d.ts +1 -0
  63. package/dist/primitives/index.d.ts.map +1 -1
  64. package/dist/styles.css +1 -1
  65. package/package.json +17 -2
package/dist/index.js CHANGED
@@ -1,200 +1,359 @@
1
- import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
- import { X as j, ChevronRight as M, Folder as A, Search as H, Tag as T } from "lucide-react";
3
- import y, { useState as C, useEffect as x, useRef as _ } from "react";
4
- const P = ({
5
- variant: t = "primary",
1
+ import { jsxs as E, jsx as l, Fragment as me } from "react/jsx-runtime";
2
+ import L, { useRef as Te, useEffect as j, useId as Z, useState as A, useContext as st, createContext as ct, useCallback as pe, useMemo as lt } from "react";
3
+ import { X as H, Info as Ce, XCircle as Ne, AlertTriangle as Se, CheckCircle2 as Oe, ChevronRight as ut, Folder as dt, Search as ft, Tag as vt } from "lucide-react";
4
+ import { createPortal as Le } from "react-dom";
5
+ const M = ({
6
+ variant: a = "primary",
6
7
  size: e = "md",
7
- icon: a,
8
+ icon: t,
8
9
  iconPosition: r = "left",
9
- children: n,
10
- className: s = "",
11
- ...c
10
+ children: i,
11
+ className: o = "",
12
+ ...n
12
13
  }) => {
13
- const l = "path58-button", i = `path58-button--${t}`, u = `path58-button--${e}`, m = a ? `path58-button--with-icon path58-button--icon-${r}` : "";
14
- return /* @__PURE__ */ h(
14
+ const d = "path58-button", s = `path58-button--${a}`, f = `path58-button--${e}`, h = t ? `path58-button--with-icon path58-button--icon-${r}` : "";
15
+ return /* @__PURE__ */ E(
15
16
  "button",
16
17
  {
17
- className: `${l} ${i} ${u} ${m} ${s}`.trim(),
18
- ...c,
18
+ className: `${d} ${s} ${f} ${h} ${o}`.trim(),
19
+ ...n,
19
20
  children: [
20
- a && r === "left" && /* @__PURE__ */ o("span", { className: "path58-button-icon", children: a }),
21
- n && /* @__PURE__ */ o("span", { className: "path58-button-text", children: n }),
22
- a && r === "right" && /* @__PURE__ */ o("span", { className: "path58-button-icon", children: a })
21
+ t && r === "left" && /* @__PURE__ */ l("span", { className: "path58-button-icon", children: t }),
22
+ i && /* @__PURE__ */ l("span", { className: "path58-button-text", children: i }),
23
+ t && r === "right" && /* @__PURE__ */ l("span", { className: "path58-button-icon", children: t })
23
24
  ]
24
25
  }
25
26
  );
26
- }, D = ({
27
- variant: t = "default",
27
+ }, Me = ({
28
+ variant: a = "default",
28
29
  error: e = !1,
29
- className: a = "",
30
+ className: t = "",
30
31
  ...r
31
32
  }) => {
32
- const n = "path58-input", s = `path58-input--${t}`;
33
- return /* @__PURE__ */ o(
33
+ const i = "path58-input", o = `path58-input--${a}`;
34
+ return /* @__PURE__ */ l(
34
35
  "input",
35
36
  {
36
- className: `${n} ${s} ${e ? "path58-input--error" : ""} ${a}`.trim(),
37
+ className: `${i} ${o} ${e ? "path58-input--error" : ""} ${t}`.trim(),
37
38
  ...r
38
39
  }
39
40
  );
40
- }, F = ({
41
- variant: t = "default",
41
+ }, pt = ({
42
+ variant: a = "default",
42
43
  active: e = !1,
43
- categoryColor: a,
44
+ categoryColor: t,
44
45
  children: r,
45
- className: n = "",
46
- style: s,
47
- ...c
46
+ className: i = "",
47
+ style: o,
48
+ ...n
48
49
  }) => {
49
- const l = "path58-badge", i = `path58-badge--${t}`, u = e ? "path58-badge--active" : "", m = t === "tag" && a ? {
50
- borderColor: e ? a : `${a}80`,
51
- color: e ? "var(--p58-bg)" : a,
52
- backgroundColor: e ? a : "transparent",
53
- ...s
54
- } : s;
55
- return /* @__PURE__ */ o(
50
+ const d = "path58-badge", s = `path58-badge--${a}`, f = e ? "path58-badge--active" : "", h = a === "tag" && t ? {
51
+ borderColor: e ? t : `${t}80`,
52
+ color: e ? "var(--p58-bg)" : t,
53
+ backgroundColor: e ? t : "transparent",
54
+ ...o
55
+ } : o;
56
+ return /* @__PURE__ */ l(
56
57
  "span",
57
58
  {
58
- className: `${l} ${i} ${u} ${n}`.trim(),
59
- style: m,
60
- ...c,
59
+ className: `${d} ${s} ${f} ${i}`.trim(),
60
+ style: h,
61
+ ...n,
61
62
  children: r
62
63
  }
63
64
  );
64
- }, R = ({
65
- children: t,
65
+ }, ht = ({
66
+ children: a,
66
67
  variant: e = "default",
67
- size: a = 16,
68
+ size: t = 16,
68
69
  className: r = ""
69
70
  }) => {
70
- const n = `path58-icon--${e}`, s = typeof a == "number" ? { width: a, height: a } : {};
71
- return /* @__PURE__ */ o(
71
+ const i = `path58-icon--${e}`, o = typeof t == "number" ? { width: t, height: t } : {};
72
+ return /* @__PURE__ */ l(
72
73
  "span",
73
74
  {
74
- className: `path58-icon ${n} ${r}`.trim(),
75
- style: s,
76
- children: t
75
+ className: `path58-icon ${i} ${r}`.trim(),
76
+ style: o,
77
+ children: a
77
78
  }
78
79
  );
79
- }, W = ({
80
- children: t,
80
+ }, bt = ({
81
+ children: a,
81
82
  variant: e = "default",
82
- size: a = "md",
83
+ size: t = "md",
83
84
  className: r = ""
84
85
  }) => {
85
- const n = "path58-icon-container", s = `path58-icon-container--${e}`, c = `path58-icon-container--${a}`;
86
- return /* @__PURE__ */ o(
86
+ const i = "path58-icon-container", o = `path58-icon-container--${e}`, n = `path58-icon-container--${t}`;
87
+ return /* @__PURE__ */ l(
87
88
  "div",
88
89
  {
89
- className: `${n} ${s} ${c} ${r}`.trim(),
90
- children: t
90
+ className: `${i} ${o} ${n} ${r}`.trim(),
91
+ children: a
91
92
  }
92
93
  );
93
- }, N = ({
94
- variant: t = "default",
94
+ }, ke = ({
95
+ variant: a = "default",
95
96
  icon: e,
96
- children: a,
97
+ children: t,
97
98
  as: r = "span",
98
- className: n = "",
99
- ...s
99
+ className: i = "",
100
+ ...o
100
101
  }) => {
101
- const c = "path58-label", l = `path58-label--${t}`;
102
- return /* @__PURE__ */ h(
102
+ const n = "path58-label", d = `path58-label--${a}`;
103
+ return /* @__PURE__ */ E(
103
104
  r,
104
105
  {
105
- className: `${c} ${l} ${e ? "path58-label--with-icon" : ""} ${n}`.trim(),
106
- ...s,
106
+ className: `${n} ${d} ${e ? "path58-label--with-icon" : ""} ${i}`.trim(),
107
+ ...o,
107
108
  children: [
108
- e && /* @__PURE__ */ o("span", { className: "path58-label-icon", children: e }),
109
- /* @__PURE__ */ o("span", { className: "path58-label-text", children: a })
109
+ e && /* @__PURE__ */ l("span", { className: "path58-label-icon", children: e }),
110
+ /* @__PURE__ */ l("span", { className: "path58-label-text", children: t })
110
111
  ]
111
112
  }
112
113
  );
113
- }, S = ({
114
- variant: t = "default",
114
+ }, Ee = ({
115
+ variant: a = "default",
115
116
  children: e,
116
- className: a = "",
117
+ className: t = "",
117
118
  ...r
118
119
  }) => {
119
- const n = "path58-container", s = `path58-container--${t}`;
120
- return /* @__PURE__ */ o(
120
+ const i = "path58-container", o = `path58-container--${a}`;
121
+ return /* @__PURE__ */ l(
121
122
  "div",
122
123
  {
123
- className: `${n} ${s} ${a}`.trim(),
124
+ className: `${i} ${o} ${t}`.trim(),
124
125
  ...r,
125
126
  children: e
126
127
  }
127
128
  );
128
- }, k = ({
129
- variant: t = "vertical",
129
+ }, Be = ({
130
+ variant: a = "vertical",
130
131
  children: e,
131
- className: a = "",
132
+ className: t = "",
132
133
  ...r
133
134
  }) => {
134
- const n = "path58-list path58-scrollbar", s = `path58-list--${t}`;
135
- return /* @__PURE__ */ o(
135
+ const i = "path58-list path58-scrollbar", o = `path58-list--${a}`;
136
+ return /* @__PURE__ */ l(
136
137
  "div",
137
138
  {
138
- className: `${n} ${s} ${a}`.trim(),
139
+ className: `${i} ${o} ${t}`.trim(),
139
140
  ...r,
140
141
  children: e
141
142
  }
142
143
  );
143
- }, U = ({
144
- selected: t = !1,
144
+ }, mt = ({
145
+ selected: a = !1,
145
146
  children: e,
146
- as: a = "button",
147
+ as: t = "button",
147
148
  className: r = "",
148
- ...n
149
+ ...i
149
150
  }) => {
150
- const s = "path58-list-item", c = t ? "path58-list-item--selected" : "", { onClick: l, disabled: i, ...u } = n, m = a === "button" ? { onClick: l, disabled: i, ...u } : { onClick: l, ...u };
151
- return /* @__PURE__ */ o(
152
- a,
151
+ const o = "path58-list-item", n = a ? "path58-list-item--selected" : "", { onClick: d, disabled: s, ...f } = i, h = t === "button" ? { onClick: d, disabled: s, ...f } : { onClick: d, ...f };
152
+ return /* @__PURE__ */ l(
153
+ t,
153
154
  {
154
- className: `${s} ${c} ${r}`.trim(),
155
- ...m,
155
+ className: `${o} ${n} ${r}`.trim(),
156
+ ...h,
156
157
  children: e
157
158
  }
158
159
  );
159
- }, B = ({
160
- value: t,
160
+ }, gt = ({
161
+ id: a,
162
+ message: e,
163
+ variant: t = "default",
164
+ duration: r = 5e3,
165
+ action: i,
166
+ onDismiss: o
167
+ }) => {
168
+ const n = Te(null), d = () => {
169
+ r < 0 || (s(), n.current = window.setTimeout(() => o(a), r));
170
+ }, s = () => {
171
+ n.current !== null && (window.clearTimeout(n.current), n.current = null);
172
+ };
173
+ j(() => (d(), s), [r, a, o]);
174
+ const f = t === "danger", h = f ? "alert" : "status", v = f ? "assertive" : "polite", b = () => {
175
+ i == null || i.onClick(), o(a);
176
+ };
177
+ return /* @__PURE__ */ E(
178
+ "div",
179
+ {
180
+ role: h,
181
+ "aria-live": v,
182
+ className: `path58-toast path58-toast--${t}`,
183
+ onMouseEnter: s,
184
+ onMouseLeave: d,
185
+ onFocus: s,
186
+ onBlur: d,
187
+ "data-path58-primitive": "toast",
188
+ children: [
189
+ /* @__PURE__ */ l("div", { className: "path58-toast__message", children: e }),
190
+ i ? /* @__PURE__ */ l(
191
+ M,
192
+ {
193
+ variant: "ghost",
194
+ size: "sm",
195
+ onClick: b,
196
+ className: "path58-toast__action",
197
+ children: i.label
198
+ }
199
+ ) : null,
200
+ /* @__PURE__ */ l(
201
+ "button",
202
+ {
203
+ type: "button",
204
+ className: "path58-toast__dismiss",
205
+ "aria-label": "Dismiss notification",
206
+ onClick: () => o(a),
207
+ children: /* @__PURE__ */ l(H, { size: 16, "aria-hidden": "true" })
208
+ }
209
+ )
210
+ ]
211
+ }
212
+ );
213
+ }, yt = {
214
+ success: /* @__PURE__ */ l(Oe, { size: 20, "aria-hidden": "true" }),
215
+ warning: /* @__PURE__ */ l(Se, { size: 20, "aria-hidden": "true" }),
216
+ danger: /* @__PURE__ */ l(Ne, { size: 20, "aria-hidden": "true" }),
217
+ info: /* @__PURE__ */ l(Ce, { size: 20, "aria-hidden": "true" })
218
+ }, wt = {
219
+ success: "Success notification",
220
+ warning: "Warning notification",
221
+ danger: "Error notification",
222
+ info: "Information notification"
223
+ }, Ua = ({
224
+ variant: a,
225
+ title: e,
226
+ message: t,
227
+ dismissible: r = !1,
228
+ onDismiss: i,
229
+ action: o,
230
+ icon: n,
231
+ position: d = "inline",
232
+ className: s = ""
233
+ }) => {
234
+ const f = a === "danger", h = n === null ? null : n ?? yt[a];
235
+ return /* @__PURE__ */ E(
236
+ "div",
237
+ {
238
+ role: f ? "alert" : "region",
239
+ "aria-label": f ? void 0 : wt[a],
240
+ className: `path58-banner path58-banner--${a} path58-banner--${d} ${s}`.trim(),
241
+ "data-path58-primitive": "banner",
242
+ children: [
243
+ h !== null ? /* @__PURE__ */ l("span", { className: "path58-banner__icon", "aria-hidden": "true", children: h }) : null,
244
+ /* @__PURE__ */ E("div", { className: "path58-banner__content", children: [
245
+ e ? /* @__PURE__ */ l("div", { className: "path58-banner__title", children: e }) : null,
246
+ /* @__PURE__ */ l("div", { className: "path58-banner__message", children: t })
247
+ ] }),
248
+ o ? /* @__PURE__ */ l(
249
+ M,
250
+ {
251
+ variant: "ghost",
252
+ size: "sm",
253
+ onClick: o.onClick,
254
+ className: "path58-banner__action",
255
+ children: o.label
256
+ }
257
+ ) : null,
258
+ r ? /* @__PURE__ */ l(
259
+ "button",
260
+ {
261
+ type: "button",
262
+ className: "path58-banner__dismiss",
263
+ "aria-label": "Dismiss",
264
+ onClick: i,
265
+ children: /* @__PURE__ */ l(H, { size: 18, "aria-hidden": "true" })
266
+ }
267
+ ) : null
268
+ ]
269
+ }
270
+ );
271
+ }, Tt = {
272
+ success: /* @__PURE__ */ l(Oe, { size: 18, "aria-hidden": "true" }),
273
+ warning: /* @__PURE__ */ l(Se, { size: 18, "aria-hidden": "true" }),
274
+ danger: /* @__PURE__ */ l(Ne, { size: 18, "aria-hidden": "true" }),
275
+ info: /* @__PURE__ */ l(Ce, { size: 18, "aria-hidden": "true" })
276
+ }, Ct = {
277
+ success: /* @__PURE__ */ l(Oe, { size: 14, "aria-hidden": "true" }),
278
+ warning: /* @__PURE__ */ l(Se, { size: 14, "aria-hidden": "true" }),
279
+ danger: /* @__PURE__ */ l(Ne, { size: 14, "aria-hidden": "true" }),
280
+ info: /* @__PURE__ */ l(Ce, { size: 14, "aria-hidden": "true" })
281
+ }, Wa = ({
282
+ variant: a,
283
+ title: e,
284
+ message: t,
285
+ dismissible: r = !1,
286
+ onDismiss: i,
287
+ icon: o,
288
+ size: n = "md",
289
+ className: d = ""
290
+ }) => {
291
+ const s = a === "danger", f = s ? "alert" : "status", h = s ? "assertive" : "polite", b = o === null ? null : o ?? (n === "sm" ? Ct : Tt)[a];
292
+ return /* @__PURE__ */ E(
293
+ "div",
294
+ {
295
+ role: f,
296
+ "aria-live": h,
297
+ className: `path58-alert path58-alert--${a} path58-alert--${n} ${d}`.trim(),
298
+ "data-path58-primitive": "alert",
299
+ children: [
300
+ b !== null ? /* @__PURE__ */ l("span", { className: "path58-alert__icon", "aria-hidden": "true", children: b }) : null,
301
+ /* @__PURE__ */ E("div", { className: "path58-alert__content", children: [
302
+ e ? /* @__PURE__ */ l("div", { className: "path58-alert__title", children: e }) : null,
303
+ /* @__PURE__ */ l("div", { className: "path58-alert__message", children: t })
304
+ ] }),
305
+ r ? /* @__PURE__ */ l(
306
+ "button",
307
+ {
308
+ type: "button",
309
+ className: "path58-alert__dismiss",
310
+ "aria-label": "Dismiss",
311
+ onClick: i,
312
+ children: /* @__PURE__ */ l(H, { size: n === "sm" ? 12 : 16, "aria-hidden": "true" })
313
+ }
314
+ ) : null
315
+ ]
316
+ }
317
+ );
318
+ }, Nt = ({
319
+ value: a,
161
320
  onChange: e,
162
- placeholder: a = "Search...",
321
+ placeholder: t = "Search...",
163
322
  showClear: r = !0,
164
- className: n = "",
165
- ...s
166
- }) => /* @__PURE__ */ h("div", { className: `path58-search-input ${n}`.trim(), children: [
167
- /* @__PURE__ */ o(
168
- D,
323
+ className: i = "",
324
+ ...o
325
+ }) => /* @__PURE__ */ E("div", { className: `path58-search-input ${i}`.trim(), children: [
326
+ /* @__PURE__ */ l(
327
+ Me,
169
328
  {
170
329
  type: "text",
171
330
  variant: "search",
172
- value: t,
173
- onChange: (c) => e(c.target.value),
174
- placeholder: a,
175
- ...s
331
+ value: a,
332
+ onChange: (n) => e(n.target.value),
333
+ placeholder: t,
334
+ ...o
176
335
  }
177
336
  ),
178
- r && t && /* @__PURE__ */ o(
179
- P,
337
+ r && a && /* @__PURE__ */ l(
338
+ M,
180
339
  {
181
340
  variant: "ghost",
182
341
  size: "sm",
183
- icon: /* @__PURE__ */ o(j, { size: 14 }),
342
+ icon: /* @__PURE__ */ l(H, { size: 14 }),
184
343
  onClick: () => e(""),
185
344
  className: "path58-search-input-clear",
186
345
  title: "Clear search"
187
346
  }
188
347
  )
189
- ] }), q = ({
190
- tag: t,
348
+ ] }), St = ({
349
+ tag: a,
191
350
  selected: e = !1,
192
- categoryColor: a,
351
+ categoryColor: t,
193
352
  onClick: r,
194
- className: n = ""
353
+ className: i = ""
195
354
  }) => {
196
- const c = ((i) => {
197
- const u = /* @__PURE__ */ new Set([
355
+ const n = ((s) => {
356
+ const f = /* @__PURE__ */ new Set([
198
357
  "cro",
199
358
  "ceo",
200
359
  "cfo",
@@ -227,71 +386,71 @@ const P = ({
227
386
  "kpi",
228
387
  "okr",
229
388
  "roi"
230
- ]), m = /* @__PURE__ */ new Set(["saas", "paas", "iaas"]);
231
- return i.split(/[\s-]+/).map((p) => {
232
- const d = p.toLowerCase();
233
- return m.has(d) ? d.charAt(0).toUpperCase() + d.slice(1) : u.has(d) ? d.toUpperCase() : p.charAt(0).toUpperCase() + p.slice(1).toLowerCase();
389
+ ]), h = /* @__PURE__ */ new Set(["saas", "paas", "iaas"]);
390
+ return s.split(/[\s-]+/).map((v) => {
391
+ const b = v.toLowerCase();
392
+ return h.has(b) ? b.charAt(0).toUpperCase() + b.slice(1) : f.has(b) ? b.toUpperCase() : v.charAt(0).toUpperCase() + v.slice(1).toLowerCase();
234
393
  }).join(" ");
235
- })(t);
236
- return /* @__PURE__ */ o(
237
- F,
394
+ })(a);
395
+ return /* @__PURE__ */ l(
396
+ pt,
238
397
  {
239
398
  variant: "tag",
240
399
  active: e,
241
- categoryColor: a || "var(--p58-accent-fg)",
400
+ categoryColor: t || "var(--p58-accent-fg)",
242
401
  onClick: r,
243
- className: n,
244
- children: c
402
+ className: i,
403
+ children: n
245
404
  }
246
405
  );
247
- }, ht = ({
248
- icon: t,
406
+ }, Ha = ({
407
+ icon: a,
249
408
  iconVariant: e = "default",
250
- label: a,
409
+ label: t,
251
410
  value: r,
252
- onClick: n,
253
- variant: s = "default",
254
- className: c = ""
411
+ onClick: i,
412
+ variant: o = "default",
413
+ className: n = ""
255
414
  }) => {
256
- const l = `path58-info-card--${s}`;
257
- return /* @__PURE__ */ h(
258
- S,
415
+ const d = `path58-info-card--${o}`;
416
+ return /* @__PURE__ */ E(
417
+ Ee,
259
418
  {
260
419
  variant: "card",
261
- className: `path58-info-card ${l} ${n ? "path58-info-card--clickable" : ""} ${c}`.trim(),
262
- onClick: n,
263
- style: { cursor: n ? "pointer" : "default" },
420
+ className: `path58-info-card ${d} ${i ? "path58-info-card--clickable" : ""} ${n}`.trim(),
421
+ onClick: i,
422
+ style: { cursor: i ? "pointer" : "default" },
264
423
  children: [
265
- /* @__PURE__ */ o(W, { variant: e, size: "md", children: t }),
266
- /* @__PURE__ */ h("div", { className: "path58-info-card-content", children: [
267
- /* @__PURE__ */ o(N, { variant: "card", children: a }),
268
- /* @__PURE__ */ o("div", { className: "path58-info-card-value", children: r })
424
+ /* @__PURE__ */ l(bt, { variant: e, size: "md", children: a }),
425
+ /* @__PURE__ */ E("div", { className: "path58-info-card-content", children: [
426
+ /* @__PURE__ */ l(ke, { variant: "card", children: t }),
427
+ /* @__PURE__ */ l("div", { className: "path58-info-card-value", children: r })
269
428
  ] })
270
429
  ]
271
430
  }
272
431
  );
273
- }, G = ({
274
- name: t,
432
+ }, Ot = ({
433
+ name: a,
275
434
  count: e,
276
- expanded: a,
435
+ expanded: t,
277
436
  onClick: r,
278
- className: n = ""
279
- }) => /* @__PURE__ */ h(
437
+ className: i = ""
438
+ }) => /* @__PURE__ */ E(
280
439
  "button",
281
440
  {
282
- className: `path58-category-header ${n}`.trim(),
441
+ className: `path58-category-header ${i}`.trim(),
283
442
  onClick: r,
284
443
  children: [
285
- /* @__PURE__ */ o(
286
- M,
444
+ /* @__PURE__ */ l(
445
+ ut,
287
446
  {
288
447
  size: 16,
289
- className: a ? "path58-category-chevron path58-category-chevron--expanded" : "path58-category-chevron"
448
+ className: t ? "path58-category-chevron path58-category-chevron--expanded" : "path58-category-chevron"
290
449
  }
291
450
  ),
292
- /* @__PURE__ */ o(A, { size: 16 }),
293
- /* @__PURE__ */ o("span", { className: "path58-category-name", children: t.toUpperCase() }),
294
- /* @__PURE__ */ h("span", { className: "path58-category-count", children: [
451
+ /* @__PURE__ */ l(dt, { size: 16 }),
452
+ /* @__PURE__ */ l("span", { className: "path58-category-name", children: a.toUpperCase() }),
453
+ /* @__PURE__ */ E("span", { className: "path58-category-count", children: [
295
454
  "(",
296
455
  e,
297
456
  ")"
@@ -299,194 +458,1524 @@ const P = ({
299
458
  ]
300
459
  }
301
460
  );
302
- var L = {
461
+ var Ke = {
303
462
  color: void 0,
304
463
  size: void 0,
305
464
  className: void 0,
306
465
  style: void 0,
307
466
  attr: void 0
308
- }, z = y.createContext && /* @__PURE__ */ y.createContext(L), V = ["attr", "size", "title"];
309
- function K(t, e) {
310
- if (t == null) return {};
311
- var a, r, n = X(t, e);
467
+ }, Ie = L.createContext && /* @__PURE__ */ L.createContext(Ke), kt = ["attr", "size", "title"];
468
+ function Et(a, e) {
469
+ if (a == null) return {};
470
+ var t, r, i = Ft(a, e);
312
471
  if (Object.getOwnPropertySymbols) {
313
- var s = Object.getOwnPropertySymbols(t);
314
- for (r = 0; r < s.length; r++) a = s[r], e.indexOf(a) === -1 && {}.propertyIsEnumerable.call(t, a) && (n[a] = t[a]);
472
+ var o = Object.getOwnPropertySymbols(a);
473
+ for (r = 0; r < o.length; r++) t = o[r], e.indexOf(t) === -1 && {}.propertyIsEnumerable.call(a, t) && (i[t] = a[t]);
315
474
  }
316
- return n;
475
+ return i;
317
476
  }
318
- function X(t, e) {
319
- if (t == null) return {};
320
- var a = {};
321
- for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
477
+ function Ft(a, e) {
478
+ if (a == null) return {};
479
+ var t = {};
480
+ for (var r in a) if ({}.hasOwnProperty.call(a, r)) {
322
481
  if (e.indexOf(r) !== -1) continue;
323
- a[r] = t[r];
482
+ t[r] = a[r];
324
483
  }
325
- return a;
484
+ return t;
326
485
  }
327
- function w() {
328
- return w = Object.assign ? Object.assign.bind() : function(t) {
486
+ function ae() {
487
+ return ae = Object.assign ? Object.assign.bind() : function(a) {
329
488
  for (var e = 1; e < arguments.length; e++) {
330
- var a = arguments[e];
331
- for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
489
+ var t = arguments[e];
490
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (a[r] = t[r]);
332
491
  }
333
- return t;
334
- }, w.apply(null, arguments);
492
+ return a;
493
+ }, ae.apply(null, arguments);
335
494
  }
336
- function O(t, e) {
337
- var a = Object.keys(t);
495
+ function xe(a, e) {
496
+ var t = Object.keys(a);
338
497
  if (Object.getOwnPropertySymbols) {
339
- var r = Object.getOwnPropertySymbols(t);
340
- e && (r = r.filter(function(n) {
341
- return Object.getOwnPropertyDescriptor(t, n).enumerable;
342
- })), a.push.apply(a, r);
498
+ var r = Object.getOwnPropertySymbols(a);
499
+ e && (r = r.filter(function(i) {
500
+ return Object.getOwnPropertyDescriptor(a, i).enumerable;
501
+ })), t.push.apply(t, r);
343
502
  }
344
- return a;
503
+ return t;
345
504
  }
346
- function $(t) {
505
+ function re(a) {
347
506
  for (var e = 1; e < arguments.length; e++) {
348
- var a = arguments[e] != null ? arguments[e] : {};
349
- e % 2 ? O(Object(a), !0).forEach(function(r) {
350
- Y(t, r, a[r]);
351
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : O(Object(a)).forEach(function(r) {
352
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
507
+ var t = arguments[e] != null ? arguments[e] : {};
508
+ e % 2 ? xe(Object(t), !0).forEach(function(r) {
509
+ Dt(a, r, t[r]);
510
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : xe(Object(t)).forEach(function(r) {
511
+ Object.defineProperty(a, r, Object.getOwnPropertyDescriptor(t, r));
353
512
  });
354
513
  }
355
- return t;
514
+ return a;
356
515
  }
357
- function Y(t, e, a) {
358
- return (e = Z(e)) in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
516
+ function Dt(a, e, t) {
517
+ return (e = _t(e)) in a ? Object.defineProperty(a, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[e] = t, a;
359
518
  }
360
- function Z(t) {
361
- var e = J(t, "string");
519
+ function _t(a) {
520
+ var e = Pt(a, "string");
362
521
  return typeof e == "symbol" ? e : e + "";
363
522
  }
364
- function J(t, e) {
365
- if (typeof t != "object" || !t) return t;
366
- var a = t[Symbol.toPrimitive];
367
- if (a !== void 0) {
368
- var r = a.call(t, e);
523
+ function Pt(a, e) {
524
+ if (typeof a != "object" || !a) return a;
525
+ var t = a[Symbol.toPrimitive];
526
+ if (t !== void 0) {
527
+ var r = t.call(a, e);
369
528
  if (typeof r != "object") return r;
370
529
  throw new TypeError("@@toPrimitive must return a primitive value.");
371
530
  }
372
- return (e === "string" ? String : Number)(t);
531
+ return (e === "string" ? String : Number)(a);
373
532
  }
374
- function E(t) {
375
- return t && t.map((e, a) => /* @__PURE__ */ y.createElement(e.tag, $({
376
- key: a
377
- }, e.attr), E(e.child)));
533
+ function qe(a) {
534
+ return a && a.map((e, t) => /* @__PURE__ */ L.createElement(e.tag, re({
535
+ key: t
536
+ }, e.attr), qe(e.child)));
378
537
  }
379
- function I(t) {
380
- return (e) => /* @__PURE__ */ y.createElement(Q, w({
381
- attr: $({}, t.attr)
382
- }, e), E(t.child));
538
+ function Ue(a) {
539
+ return (e) => /* @__PURE__ */ L.createElement(It, ae({
540
+ attr: re({}, a.attr)
541
+ }, e), qe(a.child));
383
542
  }
384
- function Q(t) {
385
- var e = (a) => {
543
+ function It(a) {
544
+ var e = (t) => {
386
545
  var {
387
546
  attr: r,
388
- size: n,
389
- title: s
390
- } = t, c = K(t, V), l = n || a.size || "1em", i;
391
- return a.className && (i = a.className), t.className && (i = (i ? i + " " : "") + t.className), /* @__PURE__ */ y.createElement("svg", w({
547
+ size: i,
548
+ title: o
549
+ } = a, n = Et(a, kt), d = i || t.size || "1em", s;
550
+ return t.className && (s = t.className), a.className && (s = (s ? s + " " : "") + a.className), /* @__PURE__ */ L.createElement("svg", ae({
392
551
  stroke: "currentColor",
393
552
  fill: "currentColor",
394
553
  strokeWidth: "0"
395
- }, a.attr, r, c, {
396
- className: i,
397
- style: $($({
398
- color: t.color || a.color
399
- }, a.style), t.style),
400
- height: l,
401
- width: l,
554
+ }, t.attr, r, n, {
555
+ className: s,
556
+ style: re(re({
557
+ color: a.color || t.color
558
+ }, t.style), a.style),
559
+ height: d,
560
+ width: d,
402
561
  xmlns: "http://www.w3.org/2000/svg"
403
- }), s && /* @__PURE__ */ y.createElement("title", null, s), t.children);
562
+ }), o && /* @__PURE__ */ L.createElement("title", null, o), a.children);
404
563
  };
405
- return z !== void 0 ? /* @__PURE__ */ y.createElement(z.Consumer, null, (a) => e(a)) : e(L);
564
+ return Ie !== void 0 ? /* @__PURE__ */ L.createElement(Ie.Consumer, null, (t) => e(t)) : e(Ke);
406
565
  }
407
- function tt(t) {
408
- return I({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M0 32l34.9 395.8L191.5 480l157.6-52.2L384 32H0zm308.2 127.9H124.4l4.1 49.4h175.6l-13.6 148.4-97.9 27v.3h-1.1l-98.7-27.3-6-75.8h47.7L138 320l53.5 14.5 53.7-14.5 6-62.2H84.3L71.5 112.2h241.1l-4.4 47.7z" }, child: [] }] })(t);
566
+ function xt(a) {
567
+ return Ue({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M0 32l34.9 395.8L191.5 480l157.6-52.2L384 32H0zm308.2 127.9H124.4l4.1 49.4h175.6l-13.6 148.4-97.9 27v.3h-1.1l-98.7-27.3-6-75.8h47.7L138 320l53.5 14.5 53.7-14.5 6-62.2H84.3L71.5 112.2h241.1l-4.4 47.7z" }, child: [] }] })(a);
409
568
  }
410
- function et(t) {
411
- return I({ attr: { role: "img", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z" }, child: [] }] })(t);
569
+ function At(a) {
570
+ return Ue({ attr: { role: "img", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z" }, child: [] }] })(a);
412
571
  }
413
- const at = ({
414
- name: t,
572
+ const Rt = ({
573
+ name: a,
415
574
  type: e,
416
- selected: a = !1,
575
+ selected: t = !1,
417
576
  onClick: r,
418
- className: n = ""
577
+ className: i = ""
419
578
  }) => {
420
- const s = e === "html" ? "html" : "tsx", c = e === "html" ? tt : et;
421
- return /* @__PURE__ */ h(
422
- U,
579
+ const o = e === "html" ? "html" : "tsx", n = e === "html" ? xt : At;
580
+ return /* @__PURE__ */ E(
581
+ mt,
423
582
  {
424
- selected: a,
583
+ selected: t,
425
584
  onClick: r,
426
- className: `path58-file-item ${n}`.trim(),
585
+ className: `path58-file-item ${i}`.trim(),
427
586
  children: [
428
- /* @__PURE__ */ o(R, { variant: s, children: /* @__PURE__ */ o(c, { size: 16 }) }),
429
- /* @__PURE__ */ o("span", { className: "path58-file-name", children: t })
587
+ /* @__PURE__ */ l(ht, { variant: o, children: /* @__PURE__ */ l(n, { size: 16 }) }),
588
+ /* @__PURE__ */ l("span", { className: "path58-file-name", children: a })
430
589
  ]
431
590
  }
432
591
  );
433
- }, mt = ({
434
- value: t,
592
+ };
593
+ function jt(a) {
594
+ return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
595
+ }
596
+ function We(a) {
597
+ if (a.__esModule) return a;
598
+ var e = a.default;
599
+ if (typeof e == "function") {
600
+ var t = function r() {
601
+ return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
602
+ };
603
+ t.prototype = e.prototype;
604
+ } else t = {};
605
+ return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(a).forEach(function(r) {
606
+ var i = Object.getOwnPropertyDescriptor(a, r);
607
+ Object.defineProperty(t, r, i.get ? i : {
608
+ enumerable: !0,
609
+ get: function() {
610
+ return a[r];
611
+ }
612
+ });
613
+ }), t;
614
+ }
615
+ var Fe = { exports: {} };
616
+ /*!
617
+ * tabbable 6.4.0
618
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
619
+ */
620
+ var He = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], ne = /* @__PURE__ */ He.join(","), Ge = typeof Element > "u", q = Ge ? function() {
621
+ } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, ie = !Ge && Element.prototype.getRootNode ? function(a) {
622
+ var e;
623
+ return a == null || (e = a.getRootNode) === null || e === void 0 ? void 0 : e.call(a);
624
+ } : function(a) {
625
+ return a == null ? void 0 : a.ownerDocument;
626
+ }, oe = function(e, t) {
627
+ var r;
628
+ t === void 0 && (t = !0);
629
+ var i = e == null || (r = e.getAttribute) === null || r === void 0 ? void 0 : r.call(e, "inert"), o = i === "" || i === "true", n = o || t && e && // closest does not exist on shadow roots, so we fall back to a manual
630
+ // lookup upward, in case it is not defined.
631
+ (typeof e.closest == "function" ? e.closest("[inert]") : oe(e.parentNode));
632
+ return n;
633
+ }, $t = function(e) {
634
+ var t, r = e == null || (t = e.getAttribute) === null || t === void 0 ? void 0 : t.call(e, "contenteditable");
635
+ return r === "" || r === "true";
636
+ }, Ve = function(e, t, r) {
637
+ if (oe(e))
638
+ return [];
639
+ var i = Array.prototype.slice.apply(e.querySelectorAll(ne));
640
+ return t && q.call(e, ne) && i.unshift(e), i = i.filter(r), i;
641
+ }, se = function(e, t, r) {
642
+ for (var i = [], o = Array.from(e); o.length; ) {
643
+ var n = o.shift();
644
+ if (!oe(n, !1))
645
+ if (n.tagName === "SLOT") {
646
+ var d = n.assignedElements(), s = d.length ? d : n.children, f = se(s, !0, r);
647
+ r.flatten ? i.push.apply(i, f) : i.push({
648
+ scopeParent: n,
649
+ candidates: f
650
+ });
651
+ } else {
652
+ var h = q.call(n, ne);
653
+ h && r.filter(n) && (t || !e.includes(n)) && i.push(n);
654
+ var v = n.shadowRoot || // check for an undisclosed shadow
655
+ typeof r.getShadowRoot == "function" && r.getShadowRoot(n), b = !oe(v, !1) && (!r.shadowRootFilter || r.shadowRootFilter(n));
656
+ if (v && b) {
657
+ var k = se(v === !0 ? n.children : v.children, !0, r);
658
+ r.flatten ? i.push.apply(i, k) : i.push({
659
+ scopeParent: n,
660
+ candidates: k
661
+ });
662
+ } else
663
+ o.unshift.apply(o, n.children);
664
+ }
665
+ }
666
+ return i;
667
+ }, Ye = function(e) {
668
+ return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
669
+ }, z = function(e) {
670
+ if (!e)
671
+ throw new Error("No node provided");
672
+ return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || $t(e)) && !Ye(e) ? 0 : e.tabIndex;
673
+ }, zt = function(e, t) {
674
+ var r = z(e);
675
+ return r < 0 && t && !Ye(e) ? 0 : r;
676
+ }, Lt = function(e, t) {
677
+ return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
678
+ }, Xe = function(e) {
679
+ return e.tagName === "INPUT";
680
+ }, Mt = function(e) {
681
+ return Xe(e) && e.type === "hidden";
682
+ }, Bt = function(e) {
683
+ var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(r) {
684
+ return r.tagName === "SUMMARY";
685
+ });
686
+ return t;
687
+ }, Kt = function(e, t) {
688
+ for (var r = 0; r < e.length; r++)
689
+ if (e[r].checked && e[r].form === t)
690
+ return e[r];
691
+ }, qt = function(e) {
692
+ if (!e.name)
693
+ return !0;
694
+ var t = e.form || ie(e), r = function(d) {
695
+ return t.querySelectorAll('input[type="radio"][name="' + d + '"]');
696
+ }, i;
697
+ if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
698
+ i = r(window.CSS.escape(e.name));
699
+ else
700
+ try {
701
+ i = r(e.name);
702
+ } catch (n) {
703
+ return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", n.message), !1;
704
+ }
705
+ var o = Kt(i, e.form);
706
+ return !o || o === e;
707
+ }, Ut = function(e) {
708
+ return Xe(e) && e.type === "radio";
709
+ }, Wt = function(e) {
710
+ return Ut(e) && !qt(e);
711
+ }, Ht = function(e) {
712
+ var t, r = e && ie(e), i = (t = r) === null || t === void 0 ? void 0 : t.host, o = !1;
713
+ if (r && r !== e) {
714
+ var n, d, s;
715
+ for (o = !!((n = i) !== null && n !== void 0 && (d = n.ownerDocument) !== null && d !== void 0 && d.contains(i) || e != null && (s = e.ownerDocument) !== null && s !== void 0 && s.contains(e)); !o && i; ) {
716
+ var f, h, v;
717
+ r = ie(i), i = (f = r) === null || f === void 0 ? void 0 : f.host, o = !!((h = i) !== null && h !== void 0 && (v = h.ownerDocument) !== null && v !== void 0 && v.contains(i));
718
+ }
719
+ }
720
+ return o;
721
+ }, Ae = function(e) {
722
+ var t = e.getBoundingClientRect(), r = t.width, i = t.height;
723
+ return r === 0 && i === 0;
724
+ }, Gt = function(e, t) {
725
+ var r = t.displayCheck, i = t.getShadowRoot;
726
+ if (r === "full-native" && "checkVisibility" in e) {
727
+ var o = e.checkVisibility({
728
+ // Checking opacity might be desirable for some use cases, but natively,
729
+ // opacity zero elements _are_ focusable and tabbable.
730
+ checkOpacity: !1,
731
+ opacityProperty: !1,
732
+ contentVisibilityAuto: !0,
733
+ visibilityProperty: !0,
734
+ // This is an alias for `visibilityProperty`. Contemporary browsers
735
+ // support both. However, this alias has wider browser support (Chrome
736
+ // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
737
+ // we include it anyway.
738
+ checkVisibilityCSS: !0
739
+ });
740
+ return !o;
741
+ }
742
+ if (getComputedStyle(e).visibility === "hidden")
743
+ return !0;
744
+ var n = q.call(e, "details>summary:first-of-type"), d = n ? e.parentElement : e;
745
+ if (q.call(d, "details:not([open]) *"))
746
+ return !0;
747
+ if (!r || r === "full" || // full-native can run this branch when it falls through in case
748
+ // Element#checkVisibility is unsupported
749
+ r === "full-native" || r === "legacy-full") {
750
+ if (typeof i == "function") {
751
+ for (var s = e; e; ) {
752
+ var f = e.parentElement, h = ie(e);
753
+ if (f && !f.shadowRoot && i(f) === !0)
754
+ return Ae(e);
755
+ e.assignedSlot ? e = e.assignedSlot : !f && h !== e.ownerDocument ? e = h.host : e = f;
756
+ }
757
+ e = s;
758
+ }
759
+ if (Ht(e))
760
+ return !e.getClientRects().length;
761
+ if (r !== "legacy-full")
762
+ return !0;
763
+ } else if (r === "non-zero-area")
764
+ return Ae(e);
765
+ return !1;
766
+ }, Vt = function(e) {
767
+ if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))
768
+ for (var t = e.parentElement; t; ) {
769
+ if (t.tagName === "FIELDSET" && t.disabled) {
770
+ for (var r = 0; r < t.children.length; r++) {
771
+ var i = t.children.item(r);
772
+ if (i.tagName === "LEGEND")
773
+ return q.call(t, "fieldset[disabled] *") ? !0 : !i.contains(e);
774
+ }
775
+ return !0;
776
+ }
777
+ t = t.parentElement;
778
+ }
779
+ return !1;
780
+ }, ce = function(e, t) {
781
+ return !(t.disabled || Mt(t) || Gt(t, e) || // For a details element with a summary, the summary element gets the focus
782
+ Bt(t) || Vt(t));
783
+ }, ge = function(e, t) {
784
+ return !(Wt(t) || z(t) < 0 || !ce(e, t));
785
+ }, Yt = function(e) {
786
+ var t = parseInt(e.getAttribute("tabindex"), 10);
787
+ return !!(isNaN(t) || t >= 0);
788
+ }, Ze = function(e) {
789
+ var t = [], r = [];
790
+ return e.forEach(function(i, o) {
791
+ var n = !!i.scopeParent, d = n ? i.scopeParent : i, s = zt(d, n), f = n ? Ze(i.candidates) : d;
792
+ s === 0 ? n ? t.push.apply(t, f) : t.push(d) : r.push({
793
+ documentOrder: o,
794
+ tabIndex: s,
795
+ item: i,
796
+ isScope: n,
797
+ content: f
798
+ });
799
+ }), r.sort(Lt).reduce(function(i, o) {
800
+ return o.isScope ? i.push.apply(i, o.content) : i.push(o.content), i;
801
+ }, []).concat(t);
802
+ }, Qe = function(e, t) {
803
+ t = t || {};
804
+ var r;
805
+ return t.getShadowRoot ? r = se([e], t.includeContainer, {
806
+ filter: ge.bind(null, t),
807
+ flatten: !1,
808
+ getShadowRoot: t.getShadowRoot,
809
+ shadowRootFilter: Yt
810
+ }) : r = Ve(e, t.includeContainer, ge.bind(null, t)), Ze(r);
811
+ }, Je = function(e, t) {
812
+ t = t || {};
813
+ var r;
814
+ return t.getShadowRoot ? r = se([e], t.includeContainer, {
815
+ filter: ce.bind(null, t),
816
+ flatten: !0,
817
+ getShadowRoot: t.getShadowRoot
818
+ }) : r = Ve(e, t.includeContainer, ce.bind(null, t)), r;
819
+ }, K = function(e, t) {
820
+ if (t = t || {}, !e)
821
+ throw new Error("No node provided");
822
+ return q.call(e, ne) === !1 ? !1 : ge(t, e);
823
+ }, Xt = /* @__PURE__ */ He.concat("iframe:not([inert]):not([inert] *)").join(","), te = function(e, t) {
824
+ if (t = t || {}, !e)
825
+ throw new Error("No node provided");
826
+ return q.call(e, Xt) === !1 ? !1 : ce(t, e);
827
+ };
828
+ const Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
829
+ __proto__: null,
830
+ focusable: Je,
831
+ getTabIndex: z,
832
+ isFocusable: te,
833
+ isTabbable: K,
834
+ tabbable: Qe
835
+ }, Symbol.toStringTag, { value: "Module" }));
836
+ /*!
837
+ * focus-trap 7.8.0
838
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
839
+ */
840
+ function ye(a, e) {
841
+ (e == null || e > a.length) && (e = a.length);
842
+ for (var t = 0, r = Array(e); t < e; t++) r[t] = a[t];
843
+ return r;
844
+ }
845
+ function Qt(a) {
846
+ if (Array.isArray(a)) return ye(a);
847
+ }
848
+ function Re(a, e) {
849
+ var t = typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
850
+ if (!t) {
851
+ if (Array.isArray(a) || (t = et(a)) || e) {
852
+ t && (a = t);
853
+ var r = 0, i = function() {
854
+ };
855
+ return {
856
+ s: i,
857
+ n: function() {
858
+ return r >= a.length ? {
859
+ done: !0
860
+ } : {
861
+ done: !1,
862
+ value: a[r++]
863
+ };
864
+ },
865
+ e: function(s) {
866
+ throw s;
867
+ },
868
+ f: i
869
+ };
870
+ }
871
+ throw new TypeError(`Invalid attempt to iterate non-iterable instance.
872
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
873
+ }
874
+ var o, n = !0, d = !1;
875
+ return {
876
+ s: function() {
877
+ t = t.call(a);
878
+ },
879
+ n: function() {
880
+ var s = t.next();
881
+ return n = s.done, s;
882
+ },
883
+ e: function(s) {
884
+ d = !0, o = s;
885
+ },
886
+ f: function() {
887
+ try {
888
+ n || t.return == null || t.return();
889
+ } finally {
890
+ if (d) throw o;
891
+ }
892
+ }
893
+ };
894
+ }
895
+ function Jt(a, e, t) {
896
+ return (e = na(e)) in a ? Object.defineProperty(a, e, {
897
+ value: t,
898
+ enumerable: !0,
899
+ configurable: !0,
900
+ writable: !0
901
+ }) : a[e] = t, a;
902
+ }
903
+ function ea(a) {
904
+ if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
905
+ }
906
+ function ta() {
907
+ throw new TypeError(`Invalid attempt to spread non-iterable instance.
908
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
909
+ }
910
+ function je(a, e) {
911
+ var t = Object.keys(a);
912
+ if (Object.getOwnPropertySymbols) {
913
+ var r = Object.getOwnPropertySymbols(a);
914
+ e && (r = r.filter(function(i) {
915
+ return Object.getOwnPropertyDescriptor(a, i).enumerable;
916
+ })), t.push.apply(t, r);
917
+ }
918
+ return t;
919
+ }
920
+ function $e(a) {
921
+ for (var e = 1; e < arguments.length; e++) {
922
+ var t = arguments[e] != null ? arguments[e] : {};
923
+ e % 2 ? je(Object(t), !0).forEach(function(r) {
924
+ Jt(a, r, t[r]);
925
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : je(Object(t)).forEach(function(r) {
926
+ Object.defineProperty(a, r, Object.getOwnPropertyDescriptor(t, r));
927
+ });
928
+ }
929
+ return a;
930
+ }
931
+ function aa(a) {
932
+ return Qt(a) || ea(a) || et(a) || ta();
933
+ }
934
+ function ra(a, e) {
935
+ if (typeof a != "object" || !a) return a;
936
+ var t = a[Symbol.toPrimitive];
937
+ if (t !== void 0) {
938
+ var r = t.call(a, e);
939
+ if (typeof r != "object") return r;
940
+ throw new TypeError("@@toPrimitive must return a primitive value.");
941
+ }
942
+ return (e === "string" ? String : Number)(a);
943
+ }
944
+ function na(a) {
945
+ var e = ra(a, "string");
946
+ return typeof e == "symbol" ? e : e + "";
947
+ }
948
+ function et(a, e) {
949
+ if (a) {
950
+ if (typeof a == "string") return ye(a, e);
951
+ var t = {}.toString.call(a).slice(8, -1);
952
+ return t === "Object" && a.constructor && (t = a.constructor.name), t === "Map" || t === "Set" ? Array.from(a) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? ye(a, e) : void 0;
953
+ }
954
+ }
955
+ var R = {
956
+ // Returns the trap from the top of the stack.
957
+ getActiveTrap: function(e) {
958
+ return (e == null ? void 0 : e.length) > 0 ? e[e.length - 1] : null;
959
+ },
960
+ // Pauses the currently active trap, then adds a new trap to the stack.
961
+ activateTrap: function(e, t) {
962
+ var r = R.getActiveTrap(e);
963
+ t !== r && R.pauseTrap(e);
964
+ var i = e.indexOf(t);
965
+ i === -1 || e.splice(i, 1), e.push(t);
966
+ },
967
+ // Removes the trap from the top of the stack, then unpauses the next trap down.
968
+ deactivateTrap: function(e, t) {
969
+ var r = e.indexOf(t);
970
+ r !== -1 && e.splice(r, 1), R.unpauseTrap(e);
971
+ },
972
+ // Pauses the trap at the top of the stack.
973
+ pauseTrap: function(e) {
974
+ var t = R.getActiveTrap(e);
975
+ t == null || t._setPausedState(!0);
976
+ },
977
+ // Unpauses the trap at the top of the stack.
978
+ unpauseTrap: function(e) {
979
+ var t = R.getActiveTrap(e);
980
+ t && !t._isManuallyPaused() && t._setPausedState(!1);
981
+ }
982
+ }, ia = function(e) {
983
+ return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
984
+ }, oa = function(e) {
985
+ return (e == null ? void 0 : e.key) === "Escape" || (e == null ? void 0 : e.key) === "Esc" || (e == null ? void 0 : e.keyCode) === 27;
986
+ }, Q = function(e) {
987
+ return (e == null ? void 0 : e.key) === "Tab" || (e == null ? void 0 : e.keyCode) === 9;
988
+ }, sa = function(e) {
989
+ return Q(e) && !e.shiftKey;
990
+ }, ca = function(e) {
991
+ return Q(e) && e.shiftKey;
992
+ }, ze = function(e) {
993
+ return setTimeout(e, 0);
994
+ }, Y = function(e) {
995
+ for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
996
+ r[i - 1] = arguments[i];
997
+ return typeof e == "function" ? e.apply(void 0, r) : e;
998
+ }, ee = function(e) {
999
+ return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
1000
+ }, la = [], ua = function(e, t) {
1001
+ var r = (t == null ? void 0 : t.document) || document, i = (t == null ? void 0 : t.trapStack) || la, o = $e({
1002
+ returnFocusOnDeactivate: !0,
1003
+ escapeDeactivates: !0,
1004
+ delayInitialFocus: !0,
1005
+ isolateSubtrees: !1,
1006
+ isKeyForward: sa,
1007
+ isKeyBackward: ca
1008
+ }, t), n = {
1009
+ // containers given to createFocusTrap()
1010
+ /** @type {Array<HTMLElement>} */
1011
+ containers: [],
1012
+ // list of objects identifying tabbable nodes in `containers` in the trap
1013
+ // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
1014
+ // is active, but the trap should never get to a state where there isn't at least one group
1015
+ // with at least one tabbable node in it (that would lead to an error condition that would
1016
+ // result in an error being thrown)
1017
+ /** @type {Array<{
1018
+ * container: HTMLElement,
1019
+ * tabbableNodes: Array<HTMLElement>, // empty if none
1020
+ * focusableNodes: Array<HTMLElement>, // empty if none
1021
+ * posTabIndexesFound: boolean,
1022
+ * firstTabbableNode: HTMLElement|undefined,
1023
+ * lastTabbableNode: HTMLElement|undefined,
1024
+ * firstDomTabbableNode: HTMLElement|undefined,
1025
+ * lastDomTabbableNode: HTMLElement|undefined,
1026
+ * nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
1027
+ * }>}
1028
+ */
1029
+ containerGroups: [],
1030
+ // same order/length as `containers` list
1031
+ // references to objects in `containerGroups`, but only those that actually have
1032
+ // tabbable nodes in them
1033
+ // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
1034
+ // the same length
1035
+ tabbableGroups: [],
1036
+ // references to nodes that are siblings to the ancestors of this trap's containers.
1037
+ /** @type {Set<HTMLElement>} */
1038
+ adjacentElements: /* @__PURE__ */ new Set(),
1039
+ // references to nodes that were inert or aria-hidden before the trap was activated.
1040
+ /** @type {Set<HTMLElement>} */
1041
+ alreadySilent: /* @__PURE__ */ new Set(),
1042
+ nodeFocusedBeforeActivation: null,
1043
+ mostRecentlyFocusedNode: null,
1044
+ active: !1,
1045
+ paused: !1,
1046
+ manuallyPaused: !1,
1047
+ // timer ID for when delayInitialFocus is true and initial focus in this trap
1048
+ // has been delayed during activation
1049
+ delayInitialFocusTimer: void 0,
1050
+ // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
1051
+ recentNavEvent: void 0
1052
+ }, d, s = function(c, u, p) {
1053
+ return c && c[u] !== void 0 ? c[u] : o[p || u];
1054
+ }, f = function(c, u) {
1055
+ var p = typeof (u == null ? void 0 : u.composedPath) == "function" ? u.composedPath() : void 0;
1056
+ return n.containerGroups.findIndex(function(T) {
1057
+ var g = T.container, N = T.tabbableNodes;
1058
+ return g.contains(c) || // fall back to explicit tabbable search which will take into consideration any
1059
+ // web components if the `tabbableOptions.getShadowRoot` option was used for
1060
+ // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
1061
+ // look inside web components even if open)
1062
+ (p == null ? void 0 : p.includes(g)) || N.find(function(m) {
1063
+ return m === c;
1064
+ });
1065
+ });
1066
+ }, h = function(c) {
1067
+ var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, p = u.hasFallback, T = p === void 0 ? !1 : p, g = u.params, N = g === void 0 ? [] : g, m = o[c];
1068
+ if (typeof m == "function" && (m = m.apply(void 0, aa(N))), m === !0 && (m = void 0), !m) {
1069
+ if (m === void 0 || m === !1)
1070
+ return m;
1071
+ throw new Error("`".concat(c, "` was specified but was not a node, or did not return a node"));
1072
+ }
1073
+ var S = m;
1074
+ if (typeof m == "string") {
1075
+ try {
1076
+ S = r.querySelector(m);
1077
+ } catch (O) {
1078
+ throw new Error("`".concat(c, '` appears to be an invalid selector; error="').concat(O.message, '"'));
1079
+ }
1080
+ if (!S && !T)
1081
+ throw new Error("`".concat(c, "` as selector refers to no known node"));
1082
+ }
1083
+ return S;
1084
+ }, v = function() {
1085
+ var c = h("initialFocus", {
1086
+ hasFallback: !0
1087
+ });
1088
+ if (c === !1)
1089
+ return !1;
1090
+ if (c === void 0 || c && !te(c, o.tabbableOptions))
1091
+ if (f(r.activeElement) >= 0)
1092
+ c = r.activeElement;
1093
+ else {
1094
+ var u = n.tabbableGroups[0], p = u && u.firstTabbableNode;
1095
+ c = p || h("fallbackFocus");
1096
+ }
1097
+ else c === null && (c = h("fallbackFocus"));
1098
+ if (!c)
1099
+ throw new Error("Your focus-trap needs to have at least one focusable element");
1100
+ return c;
1101
+ }, b = function() {
1102
+ if (n.containerGroups = n.containers.map(function(c) {
1103
+ var u = Qe(c, o.tabbableOptions), p = Je(c, o.tabbableOptions), T = u.length > 0 ? u[0] : void 0, g = u.length > 0 ? u[u.length - 1] : void 0, N = p.find(function(O) {
1104
+ return K(O);
1105
+ }), m = p.slice().reverse().find(function(O) {
1106
+ return K(O);
1107
+ }), S = !!u.find(function(O) {
1108
+ return z(O) > 0;
1109
+ });
1110
+ return {
1111
+ container: c,
1112
+ tabbableNodes: u,
1113
+ focusableNodes: p,
1114
+ /** True if at least one node with positive `tabindex` was found in this container. */
1115
+ posTabIndexesFound: S,
1116
+ /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
1117
+ firstTabbableNode: T,
1118
+ /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
1119
+ lastTabbableNode: g,
1120
+ // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
1121
+ // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
1122
+ // because that API doesn't work with Shadow DOM as well as it should (@see
1123
+ // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
1124
+ // to address an edge case related to positive tabindex support, this seems like a much easier,
1125
+ // "close enough most of the time" alternative for positive tabindexes which should generally
1126
+ // be avoided anyway...
1127
+ /** First tabbable node in container, __DOM__ order; `undefined` if none. */
1128
+ firstDomTabbableNode: N,
1129
+ /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
1130
+ lastDomTabbableNode: m,
1131
+ /**
1132
+ * Finds the __tabbable__ node that follows the given node in the specified direction,
1133
+ * in this container, if any.
1134
+ * @param {HTMLElement} node
1135
+ * @param {boolean} [forward] True if going in forward tab order; false if going
1136
+ * in reverse.
1137
+ * @returns {HTMLElement|undefined} The next tabbable node, if any.
1138
+ */
1139
+ nextTabbableNode: function(_) {
1140
+ var x = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, I = u.indexOf(_);
1141
+ return I < 0 ? x ? p.slice(p.indexOf(_) + 1).find(function(B) {
1142
+ return K(B);
1143
+ }) : p.slice(0, p.indexOf(_)).reverse().find(function(B) {
1144
+ return K(B);
1145
+ }) : u[I + (x ? 1 : -1)];
1146
+ }
1147
+ };
1148
+ }), n.tabbableGroups = n.containerGroups.filter(function(c) {
1149
+ return c.tabbableNodes.length > 0;
1150
+ }), n.tabbableGroups.length <= 0 && !h("fallbackFocus"))
1151
+ throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
1152
+ if (n.containerGroups.find(function(c) {
1153
+ return c.posTabIndexesFound;
1154
+ }) && n.containerGroups.length > 1)
1155
+ throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
1156
+ }, k = function(c) {
1157
+ var u = c.activeElement;
1158
+ if (u)
1159
+ return u.shadowRoot && u.shadowRoot.activeElement !== null ? k(u.shadowRoot) : u;
1160
+ }, y = function(c) {
1161
+ if (c !== !1 && c !== k(document)) {
1162
+ if (!c || !c.focus) {
1163
+ y(v());
1164
+ return;
1165
+ }
1166
+ c.focus({
1167
+ preventScroll: !!o.preventScroll
1168
+ }), n.mostRecentlyFocusedNode = c, ia(c) && c.select();
1169
+ }
1170
+ }, w = function(c) {
1171
+ var u = h("setReturnFocus", {
1172
+ params: [c]
1173
+ });
1174
+ return u || (u === !1 ? !1 : c);
1175
+ }, C = function(c) {
1176
+ var u = c.target, p = c.event, T = c.isBackward, g = T === void 0 ? !1 : T;
1177
+ u = u || ee(p), b();
1178
+ var N = null;
1179
+ if (n.tabbableGroups.length > 0) {
1180
+ var m = f(u, p), S = m >= 0 ? n.containerGroups[m] : void 0;
1181
+ if (m < 0)
1182
+ g ? N = n.tabbableGroups[n.tabbableGroups.length - 1].lastTabbableNode : N = n.tabbableGroups[0].firstTabbableNode;
1183
+ else if (g) {
1184
+ var O = n.tabbableGroups.findIndex(function(fe) {
1185
+ var ve = fe.firstTabbableNode;
1186
+ return u === ve;
1187
+ });
1188
+ if (O < 0 && (S.container === u || te(u, o.tabbableOptions) && !K(u, o.tabbableOptions) && !S.nextTabbableNode(u, !1)) && (O = m), O >= 0) {
1189
+ var _ = O === 0 ? n.tabbableGroups.length - 1 : O - 1, x = n.tabbableGroups[_];
1190
+ N = z(u) >= 0 ? x.lastTabbableNode : x.lastDomTabbableNode;
1191
+ } else Q(p) || (N = S.nextTabbableNode(u, !1));
1192
+ } else {
1193
+ var I = n.tabbableGroups.findIndex(function(fe) {
1194
+ var ve = fe.lastTabbableNode;
1195
+ return u === ve;
1196
+ });
1197
+ if (I < 0 && (S.container === u || te(u, o.tabbableOptions) && !K(u, o.tabbableOptions) && !S.nextTabbableNode(u)) && (I = m), I >= 0) {
1198
+ var B = I === n.tabbableGroups.length - 1 ? 0 : I + 1, $ = n.tabbableGroups[B];
1199
+ N = z(u) >= 0 ? $.firstTabbableNode : $.firstDomTabbableNode;
1200
+ } else Q(p) || (N = S.nextTabbableNode(u));
1201
+ }
1202
+ } else
1203
+ N = h("fallbackFocus");
1204
+ return N;
1205
+ }, D = function(c) {
1206
+ var u = ee(c);
1207
+ if (!(f(u, c) >= 0)) {
1208
+ if (Y(o.clickOutsideDeactivates, c)) {
1209
+ d.deactivate({
1210
+ // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
1211
+ // which will result in the outside click setting focus to the node
1212
+ // that was clicked (and if not focusable, to "nothing"); by setting
1213
+ // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
1214
+ // on activation (or the configured `setReturnFocus` node), whether the
1215
+ // outside click was on a focusable node or not
1216
+ returnFocus: o.returnFocusOnDeactivate
1217
+ });
1218
+ return;
1219
+ }
1220
+ Y(o.allowOutsideClick, c) || c.preventDefault();
1221
+ }
1222
+ }, U = function(c) {
1223
+ var u = ee(c), p = f(u, c) >= 0;
1224
+ if (p || u instanceof Document)
1225
+ p && (n.mostRecentlyFocusedNode = u);
1226
+ else {
1227
+ c.stopImmediatePropagation();
1228
+ var T, g = !0;
1229
+ if (n.mostRecentlyFocusedNode)
1230
+ if (z(n.mostRecentlyFocusedNode) > 0) {
1231
+ var N = f(n.mostRecentlyFocusedNode), m = n.containerGroups[N].tabbableNodes;
1232
+ if (m.length > 0) {
1233
+ var S = m.findIndex(function(O) {
1234
+ return O === n.mostRecentlyFocusedNode;
1235
+ });
1236
+ S >= 0 && (o.isKeyForward(n.recentNavEvent) ? S + 1 < m.length && (T = m[S + 1], g = !1) : S - 1 >= 0 && (T = m[S - 1], g = !1));
1237
+ }
1238
+ } else
1239
+ n.containerGroups.some(function(O) {
1240
+ return O.tabbableNodes.some(function(_) {
1241
+ return z(_) > 0;
1242
+ });
1243
+ }) || (g = !1);
1244
+ else
1245
+ g = !1;
1246
+ g && (T = C({
1247
+ // move FROM the MRU node, not event-related node (which will be the node that is
1248
+ // outside the trap causing the focus escape we're trying to fix)
1249
+ target: n.mostRecentlyFocusedNode,
1250
+ isBackward: o.isKeyBackward(n.recentNavEvent)
1251
+ })), y(T || n.mostRecentlyFocusedNode || v());
1252
+ }
1253
+ n.recentNavEvent = void 0;
1254
+ }, J = function(c) {
1255
+ var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
1256
+ n.recentNavEvent = c;
1257
+ var p = C({
1258
+ event: c,
1259
+ isBackward: u
1260
+ });
1261
+ p && (Q(c) && c.preventDefault(), y(p));
1262
+ }, G = function(c) {
1263
+ (o.isKeyForward(c) || o.isKeyBackward(c)) && J(c, o.isKeyBackward(c));
1264
+ }, ue = function(c) {
1265
+ oa(c) && Y(o.escapeDeactivates, c) !== !1 && (c.preventDefault(), d.deactivate());
1266
+ }, P = function(c) {
1267
+ var u = ee(c);
1268
+ f(u, c) >= 0 || Y(o.clickOutsideDeactivates, c) || Y(o.allowOutsideClick, c) || (c.preventDefault(), c.stopImmediatePropagation());
1269
+ }, _e = function() {
1270
+ if (n.active)
1271
+ return R.activateTrap(i, d), n.delayInitialFocusTimer = o.delayInitialFocus ? ze(function() {
1272
+ y(v());
1273
+ }) : y(v()), r.addEventListener("focusin", U, !0), r.addEventListener("mousedown", D, {
1274
+ capture: !0,
1275
+ passive: !1
1276
+ }), r.addEventListener("touchstart", D, {
1277
+ capture: !0,
1278
+ passive: !1
1279
+ }), r.addEventListener("click", P, {
1280
+ capture: !0,
1281
+ passive: !1
1282
+ }), r.addEventListener("keydown", G, {
1283
+ capture: !0,
1284
+ passive: !1
1285
+ }), r.addEventListener("keydown", ue), d;
1286
+ }, it = function(c) {
1287
+ n.active && !n.paused && d._setSubtreeIsolation(!1), n.adjacentElements.clear(), n.alreadySilent.clear();
1288
+ var u = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), T = Re(c), g;
1289
+ try {
1290
+ for (T.s(); !(g = T.n()).done; ) {
1291
+ var N = g.value;
1292
+ u.add(N);
1293
+ for (var m = typeof ShadowRoot < "u" && N.getRootNode() instanceof ShadowRoot, S = N; S; ) {
1294
+ u.add(S);
1295
+ var O = S.parentElement, _ = [];
1296
+ O ? _ = O.children : !O && m && (_ = S.getRootNode().children, O = S.getRootNode().host, m = typeof ShadowRoot < "u" && O.getRootNode() instanceof ShadowRoot);
1297
+ var x = Re(_), I;
1298
+ try {
1299
+ for (x.s(); !(I = x.n()).done; ) {
1300
+ var B = I.value;
1301
+ p.add(B);
1302
+ }
1303
+ } catch ($) {
1304
+ x.e($);
1305
+ } finally {
1306
+ x.f();
1307
+ }
1308
+ S = O;
1309
+ }
1310
+ }
1311
+ } catch ($) {
1312
+ T.e($);
1313
+ } finally {
1314
+ T.f();
1315
+ }
1316
+ u.forEach(function($) {
1317
+ p.delete($);
1318
+ }), n.adjacentElements = p;
1319
+ }, Pe = function() {
1320
+ if (n.active)
1321
+ return r.removeEventListener("focusin", U, !0), r.removeEventListener("mousedown", D, !0), r.removeEventListener("touchstart", D, !0), r.removeEventListener("click", P, !0), r.removeEventListener("keydown", G, !0), r.removeEventListener("keydown", ue), d;
1322
+ }, ot = function(c) {
1323
+ var u = c.some(function(p) {
1324
+ var T = Array.from(p.removedNodes);
1325
+ return T.some(function(g) {
1326
+ return g === n.mostRecentlyFocusedNode;
1327
+ });
1328
+ });
1329
+ u && y(v());
1330
+ }, de = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(ot) : void 0, V = function() {
1331
+ de && (de.disconnect(), n.active && !n.paused && n.containers.map(function(c) {
1332
+ de.observe(c, {
1333
+ subtree: !0,
1334
+ childList: !0
1335
+ });
1336
+ }));
1337
+ };
1338
+ return d = {
1339
+ get active() {
1340
+ return n.active;
1341
+ },
1342
+ get paused() {
1343
+ return n.paused;
1344
+ },
1345
+ activate: function(c) {
1346
+ if (n.active)
1347
+ return this;
1348
+ var u = s(c, "onActivate"), p = s(c, "onPostActivate"), T = s(c, "checkCanFocusTrap"), g = R.getActiveTrap(i), N = !1;
1349
+ if (g && !g.paused) {
1350
+ var m;
1351
+ (m = g._setSubtreeIsolation) === null || m === void 0 || m.call(g, !1), N = !0;
1352
+ }
1353
+ try {
1354
+ T || b(), n.active = !0, n.paused = !1, n.nodeFocusedBeforeActivation = k(r), u == null || u();
1355
+ var S = function() {
1356
+ T && b(), _e(), V(), o.isolateSubtrees && d._setSubtreeIsolation(!0), p == null || p();
1357
+ };
1358
+ if (T)
1359
+ return T(n.containers.concat()).then(S, S), this;
1360
+ S();
1361
+ } catch (_) {
1362
+ if (g === R.getActiveTrap(i) && N) {
1363
+ var O;
1364
+ (O = g._setSubtreeIsolation) === null || O === void 0 || O.call(g, !0);
1365
+ }
1366
+ throw _;
1367
+ }
1368
+ return this;
1369
+ },
1370
+ deactivate: function(c) {
1371
+ if (!n.active)
1372
+ return this;
1373
+ var u = $e({
1374
+ onDeactivate: o.onDeactivate,
1375
+ onPostDeactivate: o.onPostDeactivate,
1376
+ checkCanReturnFocus: o.checkCanReturnFocus
1377
+ }, c);
1378
+ clearTimeout(n.delayInitialFocusTimer), n.delayInitialFocusTimer = void 0, n.paused || d._setSubtreeIsolation(!1), n.alreadySilent.clear(), Pe(), n.active = !1, n.paused = !1, V(), R.deactivateTrap(i, d);
1379
+ var p = s(u, "onDeactivate"), T = s(u, "onPostDeactivate"), g = s(u, "checkCanReturnFocus"), N = s(u, "returnFocus", "returnFocusOnDeactivate");
1380
+ p == null || p();
1381
+ var m = function() {
1382
+ ze(function() {
1383
+ N && y(w(n.nodeFocusedBeforeActivation)), T == null || T();
1384
+ });
1385
+ };
1386
+ return N && g ? (g(w(n.nodeFocusedBeforeActivation)).then(m, m), this) : (m(), this);
1387
+ },
1388
+ pause: function(c) {
1389
+ return n.active ? (n.manuallyPaused = !0, this._setPausedState(!0, c)) : this;
1390
+ },
1391
+ unpause: function(c) {
1392
+ return n.active ? (n.manuallyPaused = !1, i[i.length - 1] !== this ? this : this._setPausedState(!1, c)) : this;
1393
+ },
1394
+ updateContainerElements: function(c) {
1395
+ var u = [].concat(c).filter(Boolean);
1396
+ return n.containers = u.map(function(p) {
1397
+ return typeof p == "string" ? r.querySelector(p) : p;
1398
+ }), o.isolateSubtrees && it(n.containers), n.active && (b(), o.isolateSubtrees && !n.paused && d._setSubtreeIsolation(!0)), V(), this;
1399
+ }
1400
+ }, Object.defineProperties(d, {
1401
+ _isManuallyPaused: {
1402
+ value: function() {
1403
+ return n.manuallyPaused;
1404
+ }
1405
+ },
1406
+ _setPausedState: {
1407
+ value: function(c, u) {
1408
+ if (n.paused === c)
1409
+ return this;
1410
+ if (n.paused = c, c) {
1411
+ var p = s(u, "onPause"), T = s(u, "onPostPause");
1412
+ p == null || p(), Pe(), V(), d._setSubtreeIsolation(!1), T == null || T();
1413
+ } else {
1414
+ var g = s(u, "onUnpause"), N = s(u, "onPostUnpause");
1415
+ g == null || g(), d._setSubtreeIsolation(!0), b(), _e(), V(), N == null || N();
1416
+ }
1417
+ return this;
1418
+ }
1419
+ },
1420
+ _setSubtreeIsolation: {
1421
+ value: function(c) {
1422
+ o.isolateSubtrees && n.adjacentElements.forEach(function(u) {
1423
+ var p;
1424
+ if (c)
1425
+ switch (o.isolateSubtrees) {
1426
+ case "aria-hidden":
1427
+ (u.ariaHidden === "true" || ((p = u.getAttribute("aria-hidden")) === null || p === void 0 ? void 0 : p.toLowerCase()) === "true") && n.alreadySilent.add(u), u.setAttribute("aria-hidden", "true");
1428
+ break;
1429
+ default:
1430
+ (u.inert || u.hasAttribute("inert")) && n.alreadySilent.add(u), u.setAttribute("inert", !0);
1431
+ break;
1432
+ }
1433
+ else if (!n.alreadySilent.has(u)) switch (o.isolateSubtrees) {
1434
+ case "aria-hidden":
1435
+ u.removeAttribute("aria-hidden");
1436
+ break;
1437
+ default:
1438
+ u.removeAttribute("inert");
1439
+ break;
1440
+ }
1441
+ });
1442
+ }
1443
+ }
1444
+ }), d.updateContainerElements(e), d;
1445
+ };
1446
+ const da = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1447
+ __proto__: null,
1448
+ createFocusTrap: ua
1449
+ }, Symbol.toStringTag, { value: "Module" })), fa = /* @__PURE__ */ We(da), va = /* @__PURE__ */ We(Zt);
1450
+ function W(a) {
1451
+ "@babel/helpers - typeof";
1452
+ return W = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1453
+ return typeof e;
1454
+ } : function(e) {
1455
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1456
+ }, W(a);
1457
+ }
1458
+ var he, be;
1459
+ function pa(a, e) {
1460
+ if (!(a instanceof e)) throw new TypeError("Cannot call a class as a function");
1461
+ }
1462
+ function ha(a, e) {
1463
+ for (var t = 0; t < e.length; t++) {
1464
+ var r = e[t];
1465
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(a, at(r.key), r);
1466
+ }
1467
+ }
1468
+ function ba(a, e, t) {
1469
+ return e && ha(a.prototype, e), Object.defineProperty(a, "prototype", { writable: !1 }), a;
1470
+ }
1471
+ function ma(a, e, t) {
1472
+ return e = le(e), ga(a, tt() ? Reflect.construct(e, t || [], le(a).constructor) : e.apply(a, t));
1473
+ }
1474
+ function ga(a, e) {
1475
+ if (e && (W(e) == "object" || typeof e == "function")) return e;
1476
+ if (e !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
1477
+ return ya(a);
1478
+ }
1479
+ function ya(a) {
1480
+ if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1481
+ return a;
1482
+ }
1483
+ function tt() {
1484
+ try {
1485
+ var a = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
1486
+ }));
1487
+ } catch {
1488
+ }
1489
+ return (tt = function() {
1490
+ return !!a;
1491
+ })();
1492
+ }
1493
+ function le(a) {
1494
+ return le = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
1495
+ return e.__proto__ || Object.getPrototypeOf(e);
1496
+ }, le(a);
1497
+ }
1498
+ function wa(a, e) {
1499
+ if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
1500
+ a.prototype = Object.create(e && e.prototype, { constructor: { value: a, writable: !0, configurable: !0 } }), Object.defineProperty(a, "prototype", { writable: !1 }), e && we(a, e);
1501
+ }
1502
+ function we(a, e) {
1503
+ return we = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
1504
+ return t.__proto__ = r, t;
1505
+ }, we(a, e);
1506
+ }
1507
+ function Ta(a, e, t) {
1508
+ return (e = at(e)) in a ? Object.defineProperty(a, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[e] = t, a;
1509
+ }
1510
+ function at(a) {
1511
+ var e = Ca(a, "string");
1512
+ return W(e) == "symbol" ? e : e + "";
1513
+ }
1514
+ function Ca(a, e) {
1515
+ if (W(a) != "object" || !a) return a;
1516
+ var t = a[Symbol.toPrimitive];
1517
+ if (t !== void 0) {
1518
+ var r = t.call(a, e);
1519
+ if (W(r) != "object") return r;
1520
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1521
+ }
1522
+ return (e === "string" ? String : Number)(a);
1523
+ }
1524
+ var X = L, Na = fa, Sa = Na.createFocusTrap, Oa = va, ka = Oa.isFocusable, Ea = parseInt((he = (be = /^(\d+)\./.exec(X.version)) === null || be === void 0 ? void 0 : be[1]) !== null && he !== void 0 ? he : 0, 10), De = /* @__PURE__ */ function(a) {
1525
+ function e(t) {
1526
+ var r;
1527
+ pa(this, e), r = ma(this, e, [t]), Ta(r, "getNodeForOption", function(n) {
1528
+ var d, s = (d = this.internalOptions[n]) !== null && d !== void 0 ? d : this.originalOptions[n];
1529
+ if (typeof s == "function") {
1530
+ for (var f = arguments.length, h = new Array(f > 1 ? f - 1 : 0), v = 1; v < f; v++)
1531
+ h[v - 1] = arguments[v];
1532
+ s = s.apply(void 0, h);
1533
+ }
1534
+ if (s === !0 && (s = void 0), !s) {
1535
+ if (s === void 0 || s === !1)
1536
+ return s;
1537
+ throw new Error("`".concat(n, "` was specified but was not a node, or did not return a node"));
1538
+ }
1539
+ var b = s;
1540
+ if (typeof s == "string") {
1541
+ var k;
1542
+ if (b = (k = this.getDocument()) === null || k === void 0 ? void 0 : k.querySelector(s), !b)
1543
+ throw new Error("`".concat(n, "` as selector refers to no known node"));
1544
+ }
1545
+ return b;
1546
+ }), r.handleDeactivate = r.handleDeactivate.bind(r), r.handlePostDeactivate = r.handlePostDeactivate.bind(r), r.handleClickOutsideDeactivates = r.handleClickOutsideDeactivates.bind(r), r.internalOptions = {
1547
+ // We need to hijack the returnFocusOnDeactivate option,
1548
+ // because React can move focus into the element before we arrived at
1549
+ // this lifecycle hook (e.g. with autoFocus inputs). So the component
1550
+ // captures the previouslyFocusedElement in componentWillMount,
1551
+ // then (optionally) returns focus to it in componentWillUnmount.
1552
+ returnFocusOnDeactivate: !1,
1553
+ // the rest of these are also related to deactivation of the trap, and we
1554
+ // need to use them and control them as well
1555
+ checkCanReturnFocus: null,
1556
+ onDeactivate: r.handleDeactivate,
1557
+ onPostDeactivate: r.handlePostDeactivate,
1558
+ // we need to special-case this setting as well so that we can know if we should
1559
+ // NOT return focus if the trap gets auto-deactivated as the result of an
1560
+ // outside click (otherwise, we'll always think we should return focus because
1561
+ // of how we manage that flag internally here)
1562
+ clickOutsideDeactivates: r.handleClickOutsideDeactivates
1563
+ }, r.originalOptions = {
1564
+ // because of the above `internalOptions`, we maintain our own flag for
1565
+ // this option, and default it to `true` because that's focus-trap's default
1566
+ returnFocusOnDeactivate: !0,
1567
+ // because of the above `internalOptions`, we keep these separate since
1568
+ // they're part of the deactivation process which we configure (internally) to
1569
+ // be shared between focus-trap and focus-trap-react
1570
+ onDeactivate: null,
1571
+ onPostDeactivate: null,
1572
+ checkCanReturnFocus: null,
1573
+ // the user's setting, defaulted to false since focus-trap defaults this to false
1574
+ clickOutsideDeactivates: !1
1575
+ };
1576
+ var i = t.focusTrapOptions;
1577
+ for (var o in i)
1578
+ if (Object.prototype.hasOwnProperty.call(i, o)) {
1579
+ if (o === "returnFocusOnDeactivate" || o === "onDeactivate" || o === "onPostDeactivate" || o === "checkCanReturnFocus" || o === "clickOutsideDeactivates") {
1580
+ r.originalOptions[o] = i[o];
1581
+ continue;
1582
+ }
1583
+ r.internalOptions[o] = i[o];
1584
+ }
1585
+ return r.outsideClick = null, r.focusTrapElements = t.containerElements || [], r.updatePreviousElement(), r;
1586
+ }
1587
+ return wa(e, a), ba(e, [{
1588
+ key: "getDocument",
1589
+ value: function() {
1590
+ return this.props.focusTrapOptions.document || (typeof document < "u" ? document : void 0);
1591
+ }
1592
+ }, {
1593
+ key: "getReturnFocusNode",
1594
+ value: function() {
1595
+ var r = this.getNodeForOption("setReturnFocus", this.previouslyFocusedElement);
1596
+ return r || (r === !1 ? !1 : this.previouslyFocusedElement);
1597
+ }
1598
+ /** Update the previously focused element with the currently focused element. */
1599
+ }, {
1600
+ key: "updatePreviousElement",
1601
+ value: function() {
1602
+ var r = this.getDocument();
1603
+ r && (this.previouslyFocusedElement = r.activeElement);
1604
+ }
1605
+ }, {
1606
+ key: "deactivateTrap",
1607
+ value: function() {
1608
+ !this.focusTrap || !this.focusTrap.active || this.focusTrap.deactivate({
1609
+ // NOTE: we never let the trap return the focus since we do that ourselves
1610
+ returnFocus: !1,
1611
+ // we'll call this in our own post deactivate handler so make sure the trap doesn't
1612
+ // do it prematurely
1613
+ checkCanReturnFocus: null,
1614
+ // let it call the user's original deactivate handler, if any, instead of
1615
+ // our own which calls back into this function
1616
+ onDeactivate: this.originalOptions.onDeactivate
1617
+ // NOTE: for post deactivate, don't specify anything so that it calls the
1618
+ // onPostDeactivate handler specified on `this.internalOptions`
1619
+ // which will always be our own `handlePostDeactivate()` handler, which
1620
+ // will finish things off by calling the user's provided onPostDeactivate
1621
+ // handler, if any, at the right time
1622
+ // onPostDeactivate: NOTHING
1623
+ });
1624
+ }
1625
+ }, {
1626
+ key: "handleClickOutsideDeactivates",
1627
+ value: function(r) {
1628
+ var i = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null, r) : this.originalOptions.clickOutsideDeactivates;
1629
+ return i && (this.outsideClick = {
1630
+ target: r.target,
1631
+ allowDeactivation: i
1632
+ }), i;
1633
+ }
1634
+ }, {
1635
+ key: "handleDeactivate",
1636
+ value: function() {
1637
+ this.originalOptions.onDeactivate && this.originalOptions.onDeactivate.call(null), this.deactivateTrap();
1638
+ }
1639
+ }, {
1640
+ key: "handlePostDeactivate",
1641
+ value: function() {
1642
+ var r = this, i = function() {
1643
+ var n = r.getReturnFocusNode(), d = !!// did the consumer allow it?
1644
+ (r.originalOptions.returnFocusOnDeactivate && // can we actually focus the node?
1645
+ n !== null && n !== void 0 && n.focus && // was there an outside click that allowed deactivation?
1646
+ (!r.outsideClick || // did the consumer allow deactivation when the outside node was clicked?
1647
+ r.outsideClick.allowDeactivation && // is the outside node NOT focusable (implying that it did NOT receive focus
1648
+ // as a result of the click-through) -- in which case do NOT restore focus
1649
+ // to `returnFocusNode` because focus should remain on the outside node
1650
+ !ka(r.outsideClick.target, r.internalOptions.tabbableOptions))), s = r.internalOptions.preventScroll, f = s === void 0 ? !1 : s;
1651
+ d && n.focus({
1652
+ preventScroll: f
1653
+ }), r.originalOptions.onPostDeactivate && r.originalOptions.onPostDeactivate.call(null), r.outsideClick = null;
1654
+ };
1655
+ this.originalOptions.checkCanReturnFocus ? this.originalOptions.checkCanReturnFocus.call(null, this.getReturnFocusNode()).then(i, i) : i();
1656
+ }
1657
+ }, {
1658
+ key: "setupFocusTrap",
1659
+ value: function() {
1660
+ if (this.focusTrap)
1661
+ this.props.active && !this.focusTrap.active && (this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
1662
+ else {
1663
+ var r = this.focusTrapElements.some(Boolean);
1664
+ r && (this.focusTrap = this.props._createFocusTrap(this.focusTrapElements, this.internalOptions), this.props.active && this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
1665
+ }
1666
+ }
1667
+ }, {
1668
+ key: "componentDidMount",
1669
+ value: function() {
1670
+ this.props.active && this.setupFocusTrap();
1671
+ }
1672
+ }, {
1673
+ key: "componentDidUpdate",
1674
+ value: function(r) {
1675
+ if (this.focusTrap) {
1676
+ r.containerElements !== this.props.containerElements && this.focusTrap.updateContainerElements(this.props.containerElements);
1677
+ var i = !r.active && this.props.active, o = r.active && !this.props.active, n = !r.paused && this.props.paused, d = r.paused && !this.props.paused;
1678
+ if (i && (this.updatePreviousElement(), this.focusTrap.activate()), o) {
1679
+ this.deactivateTrap();
1680
+ return;
1681
+ }
1682
+ n && this.focusTrap.pause(), d && this.focusTrap.unpause();
1683
+ } else
1684
+ r.containerElements !== this.props.containerElements && (this.focusTrapElements = this.props.containerElements), this.props.active && (this.updatePreviousElement(), this.setupFocusTrap());
1685
+ }
1686
+ }, {
1687
+ key: "componentWillUnmount",
1688
+ value: function() {
1689
+ this.deactivateTrap();
1690
+ }
1691
+ }, {
1692
+ key: "render",
1693
+ value: function() {
1694
+ var r = this, i = this.props.children ? X.Children.only(this.props.children) : void 0;
1695
+ if (i) {
1696
+ if (i.type && i.type === X.Fragment)
1697
+ throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");
1698
+ var o = function(s) {
1699
+ var f = r.props.containerElements;
1700
+ i && (Ea >= 19 ? typeof i.props.ref == "function" ? i.props.ref(s) : i.props.ref && (i.props.ref.current = s) : typeof i.ref == "function" ? i.ref(s) : i.ref && (i.ref.current = s)), r.focusTrapElements = f || [s];
1701
+ }, n = X.cloneElement(i, {
1702
+ ref: o
1703
+ });
1704
+ return n;
1705
+ }
1706
+ return null;
1707
+ }
1708
+ }]);
1709
+ }(X.Component);
1710
+ De.defaultProps = {
1711
+ active: !0,
1712
+ paused: !1,
1713
+ focusTrapOptions: {},
1714
+ _createFocusTrap: Sa
1715
+ };
1716
+ Fe.exports = De;
1717
+ Fe.exports.FocusTrap = De;
1718
+ var Fa = Fe.exports;
1719
+ const Da = /* @__PURE__ */ jt(Fa), _a = ({
1720
+ open: a,
1721
+ onClose: e,
1722
+ children: t,
1723
+ "aria-labelledby": r,
1724
+ "aria-describedby": i,
1725
+ initialFocus: o,
1726
+ closeOnEscape: n = !0,
1727
+ closeOnBackdropClick: d = !0,
1728
+ lockScroll: s = !0,
1729
+ portalRoot: f,
1730
+ className: h = ""
1731
+ }) => {
1732
+ const v = Te(null);
1733
+ if (j(() => {
1734
+ if (a)
1735
+ return v.current = document.activeElement, () => {
1736
+ const w = v.current;
1737
+ setTimeout(() => {
1738
+ var C;
1739
+ return (C = w == null ? void 0 : w.focus) == null ? void 0 : C.call(w);
1740
+ }, 0);
1741
+ };
1742
+ }, [a]), j(() => {
1743
+ if (!a || !s) return;
1744
+ const w = document.body.style.overflow;
1745
+ return document.body.style.overflow = "hidden", () => {
1746
+ document.body.style.overflow = w;
1747
+ };
1748
+ }, [a, s]), j(() => {
1749
+ }, [a, r]), !a) return null;
1750
+ const b = f ?? document.body, k = (w) => {
1751
+ d && w.target === w.currentTarget && e();
1752
+ }, y = /* @__PURE__ */ l(
1753
+ "div",
1754
+ {
1755
+ className: `path58-dialog-backdrop ${h}`.trim(),
1756
+ onClick: k,
1757
+ "data-path58-primitive": "dialog",
1758
+ children: /* @__PURE__ */ l(
1759
+ Da,
1760
+ {
1761
+ active: a,
1762
+ focusTrapOptions: {
1763
+ escapeDeactivates: n,
1764
+ clickOutsideDeactivates: !1,
1765
+ initialFocus: (o == null ? void 0 : o.current) ?? void 0,
1766
+ onDeactivate: n ? e : void 0
1767
+ },
1768
+ children: /* @__PURE__ */ l(
1769
+ "div",
1770
+ {
1771
+ role: "dialog",
1772
+ "aria-modal": "true",
1773
+ "aria-labelledby": r,
1774
+ "aria-describedby": i,
1775
+ className: "path58-dialog-surface",
1776
+ children: t
1777
+ }
1778
+ )
1779
+ }
1780
+ )
1781
+ }
1782
+ );
1783
+ return Le(y, b);
1784
+ }, rt = ({
1785
+ header: a,
1786
+ children: e,
1787
+ footer: t,
1788
+ size: r = "md",
1789
+ dismissible: i = !0,
1790
+ onClose: o,
1791
+ className: n = "",
1792
+ ...d
1793
+ }) => /* @__PURE__ */ l(_a, { onClose: o, className: n, ...d, children: /* @__PURE__ */ E("div", { className: `path58-modal path58-modal--${r}`, children: [
1794
+ a || i ? /* @__PURE__ */ E("header", { className: "path58-modal__header", children: [
1795
+ /* @__PURE__ */ l("div", { className: "path58-modal__header-content", children: a }),
1796
+ i ? /* @__PURE__ */ l(
1797
+ "button",
1798
+ {
1799
+ type: "button",
1800
+ className: "path58-modal__dismiss",
1801
+ "aria-label": "Close",
1802
+ onClick: o,
1803
+ children: /* @__PURE__ */ l(H, { size: 18, "aria-hidden": "true" })
1804
+ }
1805
+ ) : null
1806
+ ] }) : null,
1807
+ /* @__PURE__ */ l("div", { className: "path58-modal__body", children: e }),
1808
+ t ? /* @__PURE__ */ l("footer", { className: "path58-modal__footer", children: t }) : null
1809
+ ] }) }), Ga = ({
1810
+ open: a,
1811
+ onConfirm: e,
1812
+ onCancel: t,
1813
+ title: r,
1814
+ message: i,
1815
+ confirmLabel: o = "Confirm",
1816
+ cancelLabel: n = "Cancel",
1817
+ variant: d = "default",
1818
+ loading: s = !1
1819
+ }) => {
1820
+ const f = Z(), h = Z();
1821
+ return /* @__PURE__ */ l(
1822
+ rt,
1823
+ {
1824
+ open: a,
1825
+ onClose: t,
1826
+ "aria-labelledby": f,
1827
+ "aria-describedby": h,
1828
+ size: "sm",
1829
+ dismissible: !1,
1830
+ header: /* @__PURE__ */ l("span", { id: f, children: r }),
1831
+ footer: /* @__PURE__ */ E(me, { children: [
1832
+ /* @__PURE__ */ l(M, { variant: "secondary", onClick: t, disabled: s, children: n }),
1833
+ /* @__PURE__ */ l(
1834
+ M,
1835
+ {
1836
+ variant: d === "danger" ? "danger" : "primary",
1837
+ onClick: e,
1838
+ disabled: s,
1839
+ children: s ? /* @__PURE__ */ E(me, { children: [
1840
+ /* @__PURE__ */ l(
1841
+ "span",
1842
+ {
1843
+ className: "path58-confirm-dialog__spinner",
1844
+ role: "status",
1845
+ "aria-label": "Loading"
1846
+ }
1847
+ ),
1848
+ o
1849
+ ] }) : o
1850
+ }
1851
+ )
1852
+ ] }),
1853
+ children: /* @__PURE__ */ l("div", { id: h, className: "path58-confirm-dialog__message", children: i })
1854
+ }
1855
+ );
1856
+ }, Va = ({
1857
+ open: a,
1858
+ onConfirm: e,
1859
+ onCancel: t,
1860
+ title: r,
1861
+ label: i,
1862
+ placeholder: o,
1863
+ defaultValue: n = "",
1864
+ confirmLabel: d = "Save",
1865
+ cancelLabel: s = "Cancel",
1866
+ required: f = !1,
1867
+ inputType: h = "text",
1868
+ validator: v
1869
+ }) => {
1870
+ const b = Z(), k = Z(), y = Z(), [w, C] = A(n), [D, U] = A(void 0);
1871
+ j(() => {
1872
+ a && (C(n), U(void 0));
1873
+ }, [a, n]);
1874
+ const J = (P) => {
1875
+ if (f && P.trim() === "") return "This field is required.";
1876
+ if (v) return v(P);
1877
+ }, G = () => {
1878
+ const P = J(w);
1879
+ if (P) {
1880
+ U(P);
1881
+ return;
1882
+ }
1883
+ e(w);
1884
+ };
1885
+ return /* @__PURE__ */ l(
1886
+ rt,
1887
+ {
1888
+ open: a,
1889
+ onClose: t,
1890
+ "aria-labelledby": b,
1891
+ size: "sm",
1892
+ dismissible: !1,
1893
+ header: /* @__PURE__ */ l("span", { id: b, children: r }),
1894
+ footer: /* @__PURE__ */ E(me, { children: [
1895
+ /* @__PURE__ */ l(M, { variant: "secondary", onClick: t, children: s }),
1896
+ /* @__PURE__ */ l(M, { variant: "primary", onClick: G, children: d })
1897
+ ] }),
1898
+ children: /* @__PURE__ */ E("div", { className: "path58-prompt-dialog__field", children: [
1899
+ /* @__PURE__ */ l("label", { htmlFor: k, className: "path58-prompt-dialog__label", children: i }),
1900
+ /* @__PURE__ */ l(
1901
+ Me,
1902
+ {
1903
+ id: k,
1904
+ type: h,
1905
+ autoFocus: !0,
1906
+ value: w,
1907
+ placeholder: o,
1908
+ required: f,
1909
+ error: D !== void 0,
1910
+ "aria-describedby": D ? y : void 0,
1911
+ onChange: (P) => C(P.target.value),
1912
+ onBlur: () => U(J(w)),
1913
+ onKeyDown: (P) => {
1914
+ P.key === "Enter" && (P.preventDefault(), G());
1915
+ }
1916
+ }
1917
+ ),
1918
+ D ? /* @__PURE__ */ l("div", { id: y, className: "path58-prompt-dialog__error", role: "alert", children: D }) : null
1919
+ ] })
1920
+ }
1921
+ );
1922
+ }, Ya = ({
1923
+ value: a,
435
1924
  onChange: e,
436
- placeholder: a = "Search artifacts...",
1925
+ placeholder: t = "Search artifacts...",
437
1926
  label: r = "Search",
438
- className: n = ""
439
- }) => /* @__PURE__ */ h(S, { variant: "section", className: `path58-search-section ${n}`.trim(), children: [
440
- /* @__PURE__ */ o(N, { variant: "section", icon: /* @__PURE__ */ o(H, { size: 14 }), children: r }),
441
- /* @__PURE__ */ o("div", { className: "path58-search-input-wrapper", children: /* @__PURE__ */ o(
442
- B,
1927
+ className: i = ""
1928
+ }) => /* @__PURE__ */ E(Ee, { variant: "section", className: `path58-search-section ${i}`.trim(), children: [
1929
+ /* @__PURE__ */ l(ke, { variant: "section", icon: /* @__PURE__ */ l(ft, { size: 14 }), children: r }),
1930
+ /* @__PURE__ */ l("div", { className: "path58-search-input-wrapper", children: /* @__PURE__ */ l(
1931
+ Nt,
443
1932
  {
444
- value: t,
1933
+ value: a,
445
1934
  onChange: e,
446
- placeholder: a
1935
+ placeholder: t
447
1936
  }
448
1937
  ) })
449
- ] }), ft = ({
450
- allTags: t,
1938
+ ] }), Xa = ({
1939
+ allTags: a,
451
1940
  selectedTags: e,
452
- onToggleTag: a,
1941
+ onToggleTag: t,
453
1942
  className: r = ""
454
1943
  }) => {
455
- const [n, s] = C(/* @__PURE__ */ new Map()), [c, l] = C(/* @__PURE__ */ new Map());
456
- x(() => {
1944
+ const [i, o] = A(/* @__PURE__ */ new Map()), [n, d] = A(/* @__PURE__ */ new Map());
1945
+ j(() => {
457
1946
  (async () => {
458
1947
  try {
459
- const d = await fetch("/api/tags");
460
- if (d.ok) {
461
- const f = await d.json();
462
- if (f.tags && f.categories) {
463
- const g = /* @__PURE__ */ new Map();
464
- f.tags.forEach((b) => {
465
- typeof b == "object" && b.name && b.category && g.set(b.name, b.category);
1948
+ const b = await fetch("/api/tags");
1949
+ if (b.ok) {
1950
+ const k = await b.json();
1951
+ if (k.tags && k.categories) {
1952
+ const y = /* @__PURE__ */ new Map();
1953
+ k.tags.forEach((C) => {
1954
+ typeof C == "object" && C.name && C.category && y.set(C.name, C.category);
466
1955
  });
467
- const v = /* @__PURE__ */ new Map();
468
- f.categories.forEach((b) => {
469
- v.set(b.id, { name: b.name, color: b.color });
470
- }), s(g), l(v);
1956
+ const w = /* @__PURE__ */ new Map();
1957
+ k.categories.forEach((C) => {
1958
+ w.set(C.id, { name: C.name, color: C.color });
1959
+ }), o(y), d(w);
471
1960
  }
472
1961
  }
473
1962
  } catch {
474
1963
  }
475
1964
  })();
476
1965
  }, []);
477
- const i = (p) => {
478
- if (n.has(p))
479
- return n.get(p) || null;
480
- for (const [d, f] of n.entries())
481
- if (d.toLowerCase() === p.toLowerCase())
482
- return f;
1966
+ const s = (v) => {
1967
+ if (i.has(v))
1968
+ return i.get(v) || null;
1969
+ for (const [b, k] of i.entries())
1970
+ if (b.toLowerCase() === v.toLowerCase())
1971
+ return k;
483
1972
  return null;
484
- }, u = (p) => {
485
- if (!p) return "var(--p58-accent-fg)";
486
- const d = c.get(p);
487
- return (d == null ? void 0 : d.color) || "var(--p58-accent-fg)";
488
- }, m = (p) => {
489
- const d = /* @__PURE__ */ new Set([
1973
+ }, f = (v) => {
1974
+ if (!v) return "var(--p58-accent-fg)";
1975
+ const b = n.get(v);
1976
+ return (b == null ? void 0 : b.color) || "var(--p58-accent-fg)";
1977
+ }, h = (v) => {
1978
+ const b = /* @__PURE__ */ new Set([
490
1979
  "cro",
491
1980
  "ceo",
492
1981
  "cfo",
@@ -519,135 +2008,199 @@ const at = ({
519
2008
  "kpi",
520
2009
  "okr",
521
2010
  "roi"
522
- ]), f = /* @__PURE__ */ new Set(["saas", "paas", "iaas"]);
523
- return p.split(/[\s-]+/).map((g) => {
524
- const v = g.toLowerCase();
525
- return f.has(v) ? v.charAt(0).toUpperCase() + v.slice(1) : d.has(v) ? v.toUpperCase() : g.charAt(0).toUpperCase() + g.slice(1).toLowerCase();
2011
+ ]), k = /* @__PURE__ */ new Set(["saas", "paas", "iaas"]);
2012
+ return v.split(/[\s-]+/).map((y) => {
2013
+ const w = y.toLowerCase();
2014
+ return k.has(w) ? w.charAt(0).toUpperCase() + w.slice(1) : b.has(w) ? w.toUpperCase() : y.charAt(0).toUpperCase() + y.slice(1).toLowerCase();
526
2015
  }).join(" ");
527
2016
  };
528
- return t.length === 0 ? null : /* @__PURE__ */ h(S, { variant: "section", className: `path58-tag-filter path58-scrollbar ${r}`.trim(), children: [
529
- /* @__PURE__ */ h("div", { className: "path58-tag-filter-header", children: [
530
- /* @__PURE__ */ o(N, { variant: "section", icon: /* @__PURE__ */ o(T, { size: 14 }), children: "Filter by tags:" }),
531
- e.size > 0 && /* @__PURE__ */ o(
532
- P,
2017
+ return a.length === 0 ? null : /* @__PURE__ */ E(Ee, { variant: "section", className: `path58-tag-filter path58-scrollbar ${r}`.trim(), children: [
2018
+ /* @__PURE__ */ E("div", { className: "path58-tag-filter-header", children: [
2019
+ /* @__PURE__ */ l(ke, { variant: "section", icon: /* @__PURE__ */ l(vt, { size: 14 }), children: "Filter by tags:" }),
2020
+ e.size > 0 && /* @__PURE__ */ l(
2021
+ M,
533
2022
  {
534
2023
  variant: "ghost",
535
2024
  size: "sm",
536
- icon: /* @__PURE__ */ o(j, { size: 12 }),
2025
+ icon: /* @__PURE__ */ l(H, { size: 12 }),
537
2026
  onClick: () => {
538
- e.forEach((p) => a(p));
2027
+ e.forEach((v) => t(v));
539
2028
  },
540
2029
  className: "path58-tag-filter-clear",
541
2030
  children: "Clear"
542
2031
  }
543
2032
  )
544
2033
  ] }),
545
- /* @__PURE__ */ o(k, { variant: "wrap", className: "path58-tag-filter-list", children: t.map((p) => {
546
- const d = i(p), f = u(d), g = m(p), v = e.has(g);
547
- return /* @__PURE__ */ o(
548
- q,
2034
+ /* @__PURE__ */ l(Be, { variant: "wrap", className: "path58-tag-filter-list", children: a.map((v) => {
2035
+ const b = s(v), k = f(b), y = h(v), w = e.has(y);
2036
+ return /* @__PURE__ */ l(
2037
+ St,
549
2038
  {
550
- tag: p,
551
- selected: v,
552
- categoryColor: f,
553
- onClick: () => a(g)
2039
+ tag: v,
2040
+ selected: w,
2041
+ categoryColor: k,
2042
+ onClick: () => t(y)
554
2043
  },
555
- p
2044
+ v
556
2045
  );
557
2046
  }) }),
558
- t.length > 8 && /* @__PURE__ */ o("div", { className: "path58-tag-filter-scroll-hint", children: /* @__PURE__ */ o("span", { children: "Scroll for more tags" }) })
2047
+ a.length > 8 && /* @__PURE__ */ l("div", { className: "path58-tag-filter-scroll-hint", children: /* @__PURE__ */ l("span", { children: "Scroll for more tags" }) })
559
2048
  ] });
560
- }, rt = ({
561
- category: t,
2049
+ }, Pa = ({
2050
+ category: a,
562
2051
  artifacts: e,
563
- selectedFile: a,
2052
+ selectedFile: t,
564
2053
  onSelectFile: r,
565
- expanded: n,
566
- onToggle: s,
567
- className: c = ""
568
- }) => /* @__PURE__ */ h("div", { className: `path58-category-group ${c}`.trim(), "data-category": t, children: [
569
- /* @__PURE__ */ o(
570
- G,
2054
+ expanded: i,
2055
+ onToggle: o,
2056
+ className: n = ""
2057
+ }) => /* @__PURE__ */ E("div", { className: `path58-category-group ${n}`.trim(), "data-category": a, children: [
2058
+ /* @__PURE__ */ l(
2059
+ Ot,
571
2060
  {
572
- name: t,
2061
+ name: a,
573
2062
  count: e.length,
574
- expanded: n,
575
- onClick: s
2063
+ expanded: i,
2064
+ onClick: o
576
2065
  }
577
2066
  ),
578
- n && /* @__PURE__ */ o("div", { className: "path58-category-file-list", children: e.map((l) => /* @__PURE__ */ o(
579
- at,
2067
+ i && /* @__PURE__ */ l("div", { className: "path58-category-file-list", children: e.map((d) => /* @__PURE__ */ l(
2068
+ Rt,
580
2069
  {
581
- name: l.displayName,
582
- type: l.type,
583
- selected: a === l.path,
584
- onClick: () => r(l.path)
2070
+ name: d.displayName,
2071
+ type: d.type,
2072
+ selected: t === d.path,
2073
+ onClick: () => r(d.path)
585
2074
  },
586
- l.path
2075
+ d.path
587
2076
  )) })
588
- ] }), vt = ({
589
- artifacts: t,
2077
+ ] }), Za = ({
2078
+ artifacts: a,
590
2079
  selectedFile: e,
591
- onSelectFile: a,
2080
+ onSelectFile: t,
592
2081
  categoryToExpand: r,
593
- className: n = ""
2082
+ className: i = ""
594
2083
  }) => {
595
- const [s, c] = C(/* @__PURE__ */ new Set());
596
- x(() => {
597
- if (r && !s.has(r)) {
598
- const i = new Set(s);
599
- i.add(r), c(i);
600
- }
601
- }, [r, s]);
602
- const l = (i) => {
603
- const u = new Set(s);
604
- u.has(i) ? u.delete(i) : u.add(i), c(u);
2084
+ const [o, n] = A(/* @__PURE__ */ new Set());
2085
+ j(() => {
2086
+ if (r && !o.has(r)) {
2087
+ const s = new Set(o);
2088
+ s.add(r), n(s);
2089
+ }
2090
+ }, [r, o]);
2091
+ const d = (s) => {
2092
+ const f = new Set(o);
2093
+ f.has(s) ? f.delete(s) : f.add(s), n(f);
605
2094
  };
606
- return /* @__PURE__ */ o(k, { variant: "vertical", className: `path58-artifact-list ${n}`.trim(), children: Object.entries(t).map(([i, u]) => /* @__PURE__ */ o(
607
- rt,
2095
+ return /* @__PURE__ */ l(Be, { variant: "vertical", className: `path58-artifact-list ${i}`.trim(), children: Object.entries(a).map(([s, f]) => /* @__PURE__ */ l(
2096
+ Pa,
608
2097
  {
609
- category: i,
610
- artifacts: u,
2098
+ category: s,
2099
+ artifacts: f,
611
2100
  selectedFile: e,
612
- onSelectFile: a,
613
- expanded: s.has(i),
614
- onToggle: () => l(i)
2101
+ onSelectFile: t,
2102
+ expanded: o.has(s),
2103
+ onToggle: () => d(s)
615
2104
  },
616
- i
2105
+ s
617
2106
  )) });
618
- }, nt = ({
619
- name: t,
2107
+ }, Qa = () => {
2108
+ const a = st(nt);
2109
+ if (a) return a;
2110
+ const e = () => "";
2111
+ return { toast: Object.assign(e, {
2112
+ success: e,
2113
+ warning: e,
2114
+ danger: e,
2115
+ info: e
2116
+ }), dismiss: () => {
2117
+ }, dismissAll: () => {
2118
+ } };
2119
+ }, nt = ct(null);
2120
+ let Ia = 0;
2121
+ const xa = () => `path58-toast-${++Ia}`, Ja = ({
2122
+ children: a,
2123
+ position: e = "top-right",
2124
+ maxVisible: t = 3,
2125
+ defaultDuration: r = 5e3,
2126
+ portalRoot: i
2127
+ }) => {
2128
+ const [o, n] = A([]), [d, s] = A(null);
2129
+ j(() => {
2130
+ s(i ?? document.body);
2131
+ }, [i]);
2132
+ const f = pe((y) => {
2133
+ n((w) => w.filter((C) => C.id !== y));
2134
+ }, []), h = pe(() => {
2135
+ n([]);
2136
+ }, []), v = pe(
2137
+ (y) => {
2138
+ const w = xa();
2139
+ return n((C) => [{ id: w, duration: r, ...y }, ...C].slice(0, t)), w;
2140
+ },
2141
+ [r, t]
2142
+ ), b = lt(() => ({ toast: Object.assign((C) => v(C), {
2143
+ success: (C, D) => v({ ...D ?? {}, message: C, variant: "success" }),
2144
+ warning: (C, D) => v({ ...D ?? {}, message: C, variant: "warning" }),
2145
+ danger: (C, D) => v({ ...D ?? {}, message: C, variant: "danger" }),
2146
+ info: (C, D) => v({ ...D ?? {}, message: C, variant: "info" })
2147
+ }), dismiss: f, dismissAll: h }), [v, f, h]), k = /* @__PURE__ */ l(
2148
+ "div",
2149
+ {
2150
+ className: `path58-toast-stack path58-toast-stack--${e}`,
2151
+ "aria-live": "off",
2152
+ "data-path58-primitive": "toast-stack",
2153
+ children: o.map((y) => /* @__PURE__ */ l(
2154
+ gt,
2155
+ {
2156
+ id: y.id,
2157
+ message: y.message,
2158
+ variant: y.variant,
2159
+ duration: y.duration,
2160
+ action: y.action,
2161
+ onDismiss: f
2162
+ },
2163
+ y.id
2164
+ ))
2165
+ }
2166
+ );
2167
+ return /* @__PURE__ */ E(nt.Provider, { value: b, children: [
2168
+ a,
2169
+ d ? Le(k, d) : null
2170
+ ] });
2171
+ }, Aa = ({
2172
+ name: a,
620
2173
  size: e = 16,
621
- stroke: a = 1.75,
2174
+ stroke: t = 1.75,
622
2175
  className: r = "",
623
- style: n = {}
2176
+ style: i = {}
624
2177
  }) => {
625
- const s = _(null);
626
- return x(() => {
627
- if (window.lucide && s.current) {
628
- s.current.innerHTML = "";
629
- const c = document.createElement("i");
630
- c.setAttribute("data-lucide", t), s.current.appendChild(c), window.lucide.createIcons({
631
- attrs: { width: e, height: e, "stroke-width": a }
2178
+ const o = Te(null);
2179
+ return j(() => {
2180
+ if (window.lucide && o.current) {
2181
+ o.current.innerHTML = "";
2182
+ const n = document.createElement("i");
2183
+ n.setAttribute("data-lucide", a), o.current.appendChild(n), window.lucide.createIcons({
2184
+ attrs: { width: e, height: e, "stroke-width": t }
632
2185
  });
633
2186
  }
634
- }, [t, e, a]), /* @__PURE__ */ o(
2187
+ }, [a, e, t]), /* @__PURE__ */ l(
635
2188
  "span",
636
2189
  {
637
- ref: s,
2190
+ ref: o,
638
2191
  className: r,
639
- style: { display: "inline-flex", lineHeight: 0, ...n }
2192
+ style: { display: "inline-flex", lineHeight: 0, ...i }
640
2193
  }
641
2194
  );
642
- }, st = {
2195
+ }, Ra = {
643
2196
  sm: { padding: "4px 10px", fontSize: 12 },
644
2197
  md: { padding: "8px 14px", fontSize: 13 },
645
2198
  lg: { padding: "10px 18px", fontSize: 14 }
646
- }, ot = (t, e, a) => {
647
- switch (t) {
2199
+ }, ja = (a, e, t) => {
2200
+ switch (a) {
648
2201
  case "primary":
649
2202
  return {
650
- background: a ? "var(--p58-teal-press)" : e ? "var(--p58-teal-hover)" : "var(--p58-teal)",
2203
+ background: t ? "var(--p58-teal-press)" : e ? "var(--p58-teal-hover)" : "var(--p58-teal)",
651
2204
  color: "var(--p58-on-accent)",
652
2205
  border: "1px solid var(--p58-teal-press)"
653
2206
  };
@@ -670,74 +2223,74 @@ const at = ({
670
2223
  border: "1px solid color-mix(in srgb, var(--p58-danger) 30%, transparent)"
671
2224
  };
672
2225
  }
673
- }, gt = ({
674
- variant: t = "primary",
2226
+ }, er = ({
2227
+ variant: a = "primary",
675
2228
  size: e = "md",
676
- icon: a,
2229
+ icon: t,
677
2230
  children: r,
678
- onClick: n,
679
- disabled: s = !1,
680
- style: c = {}
2231
+ onClick: i,
2232
+ disabled: o = !1,
2233
+ style: n = {}
681
2234
  }) => {
682
- const [l, i] = C(!1), [u, m] = C(!1);
683
- return /* @__PURE__ */ h(
2235
+ const [d, s] = A(!1), [f, h] = A(!1);
2236
+ return /* @__PURE__ */ E(
684
2237
  "button",
685
2238
  {
686
- onClick: s ? void 0 : n,
687
- onMouseEnter: () => i(!0),
2239
+ onClick: o ? void 0 : i,
2240
+ onMouseEnter: () => s(!0),
688
2241
  onMouseLeave: () => {
689
- i(!1), m(!1);
2242
+ s(!1), h(!1);
690
2243
  },
691
- onMouseDown: () => m(!0),
692
- onMouseUp: () => m(!1),
2244
+ onMouseDown: () => h(!0),
2245
+ onMouseUp: () => h(!1),
693
2246
  style: {
694
2247
  fontFamily: "var(--p58-font-ui)",
695
2248
  fontWeight: 500,
696
2249
  borderRadius: "var(--p58-radius-md)",
697
- cursor: s ? "not-allowed" : "pointer",
2250
+ cursor: o ? "not-allowed" : "pointer",
698
2251
  display: "inline-flex",
699
2252
  alignItems: "center",
700
2253
  gap: 8,
701
- opacity: s ? 0.4 : 1,
2254
+ opacity: o ? 0.4 : 1,
702
2255
  boxShadow: "var(--p58-shadow-inset)",
703
2256
  transition: "background var(--p58-duration-fast)",
704
2257
  outline: "none",
705
- ...st[e],
706
- ...ot(t, l, u),
707
- ...c
2258
+ ...Ra[e],
2259
+ ...ja(a, d, f),
2260
+ ...n
708
2261
  },
709
2262
  children: [
710
- a && /* @__PURE__ */ o(nt, { name: a, size: 14 }),
2263
+ t && /* @__PURE__ */ l(Aa, { name: t, size: 14 }),
711
2264
  r
712
2265
  ]
713
2266
  }
714
2267
  );
715
- }, ct = "var(--p58-shadow-inset)", it = "0 2px 8px color-mix(in srgb, var(--p58-bg) 35%, transparent), var(--p58-shadow-inset)", bt = ({
716
- children: t,
2268
+ }, $a = "var(--p58-shadow-inset)", za = "0 2px 8px color-mix(in srgb, var(--p58-bg) 35%, transparent), var(--p58-shadow-inset)", tr = ({
2269
+ children: a,
717
2270
  hover: e = !1,
718
- onClick: a,
2271
+ onClick: t,
719
2272
  style: r = {}
720
2273
  }) => {
721
- const [n, s] = C(!1);
722
- return /* @__PURE__ */ o(
2274
+ const [i, o] = A(!1);
2275
+ return /* @__PURE__ */ l(
723
2276
  "div",
724
2277
  {
725
- onClick: a,
726
- onMouseEnter: () => s(!0),
727
- onMouseLeave: () => s(!1),
2278
+ onClick: t,
2279
+ onMouseEnter: () => o(!0),
2280
+ onMouseLeave: () => o(!1),
728
2281
  style: {
729
2282
  background: "var(--p58-surface)",
730
2283
  border: "1px solid var(--p58-border)",
731
2284
  borderRadius: "var(--p58-radius-lg)",
732
- boxShadow: e && n ? it : ct,
733
- cursor: a ? "pointer" : "default",
2285
+ boxShadow: e && i ? za : $a,
2286
+ cursor: t ? "pointer" : "default",
734
2287
  transition: "box-shadow var(--p58-duration-base)",
735
2288
  ...r
736
2289
  },
737
- children: t
2290
+ children: a
738
2291
  }
739
2292
  );
740
- }, lt = ({ children: t, style: e = {} }) => /* @__PURE__ */ o(
2293
+ }, La = ({ children: a, style: e = {} }) => /* @__PURE__ */ l(
741
2294
  "span",
742
2295
  {
743
2296
  style: {
@@ -748,17 +2301,17 @@ const at = ({
748
2301
  letterSpacing: "var(--p58-tracking-caps)",
749
2302
  ...e
750
2303
  },
751
- children: t
2304
+ children: a
752
2305
  }
753
- ), yt = ({
754
- label: t,
2306
+ ), ar = ({
2307
+ label: a,
755
2308
  value: e,
756
- unit: a,
2309
+ unit: t,
757
2310
  delta: r,
758
- deltaTone: n = "up"
759
- }) => /* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
760
- /* @__PURE__ */ o(lt, { children: t }),
761
- /* @__PURE__ */ h(
2311
+ deltaTone: i = "up"
2312
+ }) => /* @__PURE__ */ E("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
2313
+ /* @__PURE__ */ l(La, { children: a }),
2314
+ /* @__PURE__ */ E(
762
2315
  "div",
763
2316
  {
764
2317
  style: {
@@ -772,7 +2325,7 @@ const at = ({
772
2325
  },
773
2326
  children: [
774
2327
  e,
775
- a && /* @__PURE__ */ o(
2328
+ t && /* @__PURE__ */ l(
776
2329
  "span",
777
2330
  {
778
2331
  style: {
@@ -780,22 +2333,22 @@ const at = ({
780
2333
  color: "var(--p58-fg-3)",
781
2334
  marginLeft: 2
782
2335
  },
783
- children: a
2336
+ children: t
784
2337
  }
785
2338
  )
786
2339
  ]
787
2340
  }
788
2341
  ),
789
- r && /* @__PURE__ */ h(
2342
+ r && /* @__PURE__ */ E(
790
2343
  "span",
791
2344
  {
792
2345
  style: {
793
2346
  fontFamily: "var(--p58-font-mono)",
794
2347
  fontSize: "var(--p58-text-xs)",
795
- color: n === "up" ? "var(--p58-success)" : "var(--p58-danger)"
2348
+ color: i === "up" ? "var(--p58-success)" : "var(--p58-danger)"
796
2349
  },
797
2350
  children: [
798
- n === "up" ? "↑" : "↓",
2351
+ i === "up" ? "↑" : "↓",
799
2352
  " ",
800
2353
  r
801
2354
  ]
@@ -803,27 +2356,37 @@ const at = ({
803
2356
  )
804
2357
  ] });
805
2358
  export {
806
- vt as ArtifactList,
807
- F as Badge,
808
- P as Button,
809
- rt as CategoryGroup,
810
- G as CategoryHeader,
811
- S as Container,
812
- at as FileItem,
813
- R as Icon,
814
- W as IconContainer,
815
- ht as InfoCard,
816
- D as Input,
817
- N as Label,
818
- k as List,
819
- U as ListItem,
820
- gt as P58Button,
821
- bt as P58Card,
822
- lt as P58Eyebrow,
823
- nt as P58Icon,
824
- yt as P58Metric,
825
- B as SearchInput,
826
- mt as SearchSection,
827
- q as TagBadge,
828
- ft as TagFilterList
2359
+ Wa as Alert,
2360
+ Za as ArtifactList,
2361
+ pt as Badge,
2362
+ Ua as Banner,
2363
+ M as Button,
2364
+ Pa as CategoryGroup,
2365
+ Ot as CategoryHeader,
2366
+ Ga as ConfirmDialog,
2367
+ Ee as Container,
2368
+ _a as Dialog,
2369
+ Rt as FileItem,
2370
+ ht as Icon,
2371
+ bt as IconContainer,
2372
+ Ha as InfoCard,
2373
+ Me as Input,
2374
+ ke as Label,
2375
+ Be as List,
2376
+ mt as ListItem,
2377
+ rt as Modal,
2378
+ er as P58Button,
2379
+ tr as P58Card,
2380
+ La as P58Eyebrow,
2381
+ Aa as P58Icon,
2382
+ ar as P58Metric,
2383
+ Va as PromptDialog,
2384
+ Nt as SearchInput,
2385
+ Ya as SearchSection,
2386
+ St as TagBadge,
2387
+ Xa as TagFilterList,
2388
+ gt as Toast,
2389
+ nt as ToastContext,
2390
+ Ja as ToastProvider,
2391
+ Qa as useToast
829
2392
  };