hanap-labs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +190 -0
  3. package/dist/auto-import/index.js +40 -0
  4. package/dist/chunks/components-BlNF7xT6.js +3951 -0
  5. package/dist/chunks/composables-C9eE_X8p.js +1393 -0
  6. package/dist/chunks/helpers-QkG7gR6t.js +6 -0
  7. package/dist/chunks/usePopup-zCvtcQsc.js +943 -0
  8. package/dist/components/index.js +2 -0
  9. package/dist/composables/index.js +3 -0
  10. package/dist/helpers/index.js +2 -0
  11. package/dist/index.js +6 -0
  12. package/dist/toolkit.css +2 -0
  13. package/dist/types/auto-import/index.d.ts +31 -0
  14. package/dist/types/components/hl-avatar/HLAvatar.types.d.ts +6 -0
  15. package/dist/types/components/hl-avatar/index.d.ts +2 -0
  16. package/dist/types/components/hl-breadcrumb/HLBreadcrumb.types.d.ts +24 -0
  17. package/dist/types/components/hl-breadcrumb/index.d.ts +2 -0
  18. package/dist/types/components/hl-breadcrumb/useBreadcrumb.d.ts +7 -0
  19. package/dist/types/components/hl-button/HLButton.types.d.ts +19 -0
  20. package/dist/types/components/hl-button/index.d.ts +2 -0
  21. package/dist/types/components/hl-checkbox/HLCheckbox.types.d.ts +17 -0
  22. package/dist/types/components/hl-checkbox/index.d.ts +2 -0
  23. package/dist/types/components/hl-icon/HLIcon.registry.d.ts +2 -0
  24. package/dist/types/components/hl-icon/HLIcon.types.d.ts +10 -0
  25. package/dist/types/components/hl-icon/index.d.ts +3 -0
  26. package/dist/types/components/hl-input/HLInput.types.d.ts +30 -0
  27. package/dist/types/components/hl-input/index.d.ts +2 -0
  28. package/dist/types/components/hl-label/HLLabel.types.d.ts +11 -0
  29. package/dist/types/components/hl-label/index.d.ts +2 -0
  30. package/dist/types/components/hl-menu-action/HLMenuAction.types.d.ts +23 -0
  31. package/dist/types/components/hl-menu-action/index.d.ts +2 -0
  32. package/dist/types/components/hl-notify/index.d.ts +12 -0
  33. package/dist/types/components/hl-popup/index.d.ts +12 -0
  34. package/dist/types/components/hl-select/HLSelect.types.d.ts +31 -0
  35. package/dist/types/components/hl-select/index.d.ts +2 -0
  36. package/dist/types/components/hl-skeleton/HLSkeleton.types.d.ts +3 -0
  37. package/dist/types/components/hl-skeleton/index.d.ts +2 -0
  38. package/dist/types/components/hl-table/HLTable.types.d.ts +35 -0
  39. package/dist/types/components/hl-table/index.d.ts +2 -0
  40. package/dist/types/components/hl-tabs/HLTabs.types.d.ts +9 -0
  41. package/dist/types/components/hl-tabs/index.d.ts +2 -0
  42. package/dist/types/components/hl-textarea/HLTextarea.types.d.ts +17 -0
  43. package/dist/types/components/hl-textarea/index.d.ts +2 -0
  44. package/dist/types/components/index.d.ts +15 -0
  45. package/dist/types/composables/data/useMutation.d.ts +12 -0
  46. package/dist/types/composables/data/useQuery.d.ts +18 -0
  47. package/dist/types/composables/form/useForm.d.ts +22 -0
  48. package/dist/types/composables/index.d.ts +9 -0
  49. package/dist/types/composables/ui/useFloat.d.ts +29 -0
  50. package/dist/types/composables/ui/useNotify.d.ts +25 -0
  51. package/dist/types/composables/ui/usePopup.d.ts +25 -0
  52. package/dist/types/helpers/formatLabel.d.ts +1 -0
  53. package/dist/types/helpers/index.d.ts +1 -0
  54. package/dist/types/index.d.ts +6 -0
  55. package/dist/types/types/index.d.ts +1 -0
  56. package/dist/types/types/ui.types.d.ts +5 -0
  57. package/package.json +97 -0
@@ -0,0 +1,3951 @@
1
+ import { n as e, r as t, t as n } from "./usePopup-zCvtcQsc.js";
2
+ import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as d, createTextVNode as f, createVNode as p, customRef as m, defineComponent as h, getCurrentInstance as g, getCurrentScope as _, h as v, isRef as y, mergeModels as b, mergeProps as x, nextTick as S, normalizeClass as C, normalizeStyle as w, onBeforeUnmount as ee, onMounted as T, onScopeDispose as E, onUnmounted as te, openBlock as D, readonly as O, ref as k, render as A, renderList as j, renderSlot as M, resolveDynamicComponent as ne, shallowRef as re, toDisplayString as N, toRef as ie, toValue as P, unref as F, useId as I, useModel as L, useSlots as ae, vModelCheckbox as oe, vModelDynamic as se, vModelText as ce, watch as R, watchEffect as le, withCtx as z, withDirectives as ue, withModifiers as de } from "vue";
3
+ //#endregion
4
+ //#region src/components/hl-icon/HLIcon.registry.ts
5
+ var fe = /* @__PURE__ */ Object.assign({
6
+ "../../assets/icons/check.svg": "<svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\r\n <path fill-rule=\"evenodd\" d=\"M16.704 5.29a1 1 0 010 1.414l-7.2 7.2a1 1 0 01-1.414 0l-3.6-3.6a1 1 0 011.414-1.414l2.893 2.893 6.493-6.493a1 1 0 011.414 0z\" clip-rule=\"evenodd\" />\r\n</svg>",
7
+ "../../assets/icons/chevron-down.svg": "<svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n <path\n fill-rule=\"evenodd\"\n d=\"M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z\"\n clip-rule=\"evenodd\"\n />\n</svg>\n",
8
+ "../../assets/icons/chevron-left.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.75 19.5 8.25 12l7.5-7.5\" />\r\n</svg>\r\n",
9
+ "../../assets/icons/chevron-right.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m8.25 4.5 7.5 7.5-7.5 7.5\" />\r\n</svg>\r\n",
10
+ "../../assets/icons/chevron-up-down.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9\" />\r\n</svg>\r\n",
11
+ "../../assets/icons/chevron-up.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m4.5 15.75 7.5-7.5 7.5 7.5\" />\r\n</svg>\r\n",
12
+ "../../assets/icons/eye-off.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88\" />\r\n</svg>\r\n",
13
+ "../../assets/icons/eye.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z\" />\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z\" />\r\n</svg>\r\n",
14
+ "../../assets/icons/plus.svg": "<svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n <path\n fill-rule=\"evenodd\"\n d=\"M10 4.25a.75.75 0 01.75.75v4.25H15a.75.75 0 010 1.5h-4.25V15a.75.75 0 01-1.5 0v-4.25H5a.75.75 0 010-1.5h4.25V5a.75.75 0 01.75-.75z\"\n clip-rule=\"evenodd\"\n />\n</svg>\n",
15
+ "../../assets/icons/refresh.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" fill=\"currentColor\">\r\n <path d=\"M204-318q-22-38-33-78t-11-82q0-134 93-228t227-94h7l-64-64 56-56 160 160-160 160-56-56 64-64h-7q-100 0-170 70.5T240-478q0 26 6 51t18 49l-60 60ZM481-40 321-200l160-160 56 56-64 64h7q100 0 170-70.5T720-482q0-26-6-51t-18-49l60-60q22 38 33 78t11 82q0 134-93 228t-227 94h-7l64 64-56 56Z\" />\r\n</svg>",
16
+ "../../assets/icons/spinner.svg": "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <circle\r\n cx=\"12\"\r\n cy=\"12\"\r\n r=\"9\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"3\"\r\n opacity=\"0.2\"\r\n />\r\n <circle\r\n cx=\"12\"\r\n cy=\"12\"\r\n r=\"9\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"3\"\r\n stroke-linecap=\"round\"\r\n stroke-dasharray=\"42 14\"\r\n transform=\"rotate(-90 12 12)\"\r\n />\r\n</svg>\r\n",
17
+ "../../assets/icons/three-dots.svg": "<svg fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\r\n <circle cx=\"10\" cy=\"4\" r=\"2\" />\r\n <circle cx=\"10\" cy=\"10\" r=\"2\" />\r\n <circle cx=\"10\" cy=\"16\" r=\"2\" />\r\n</svg>",
18
+ "../../assets/icons/x-mark.svg": "<svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\">\n <path\n fill-rule=\"evenodd\"\n d=\"M4.22 4.22a.75.75 0 011.06 0L10 8.94l4.72-4.72a.75.75 0 111.06 1.06L11.06 10l4.72 4.72a.75.75 0 11-1.06 1.06L10 11.06l-4.72 4.72a.75.75 0 11-1.06-1.06L8.94 10 4.22 5.28a.75.75 0 010-1.06z\"\n clip-rule=\"evenodd\"\n />\n</svg>\n"
19
+ }), pe = /\/([^/]+)\.svg$/, me = {};
20
+ for (let [e, t] of Object.entries(fe)) {
21
+ let n = e.match(pe);
22
+ if (!n) continue;
23
+ let r = n[1];
24
+ me[r] = t;
25
+ }
26
+ var he = Object.freeze(Object.keys(me).sort((e, t) => e.localeCompare(t)));
27
+ function ge(e) {
28
+ return me[e];
29
+ }
30
+ //#endregion
31
+ //#region src/components/hl-icon/HLIcon.vue?vue&type=script&setup=true&lang.ts
32
+ var _e = [
33
+ "role",
34
+ "aria-label",
35
+ "aria-hidden"
36
+ ], B = ["title", "innerHTML"], ve = ["title"], ye = /* @__PURE__ */ h({
37
+ __name: "HLIcon",
38
+ props: {
39
+ name: {},
40
+ size: { default: 20 },
41
+ color: {},
42
+ title: { default: "" },
43
+ decorative: {
44
+ type: Boolean,
45
+ default: !0
46
+ },
47
+ ariaLabel: { default: "" }
48
+ },
49
+ setup(e) {
50
+ let t = o(() => typeof e.size == "number" ? `${e.size}px` : e.size);
51
+ function n(e) {
52
+ let t = e.trim();
53
+ return !(!t.startsWith("<svg") || !t.endsWith("</svg>") || /<script[\s>]/i.test(t) || /\son[a-z]+\s*=/i.test(t) || /javascript:/i.test(t));
54
+ }
55
+ let r = o(() => {
56
+ let t = ge(e.name);
57
+ if (t) return n(t) ? t : void 0;
58
+ }), i = o(() => e.ariaLabel || e.title || e.name), a = o(() => e.decorative), s = {
59
+ secondary: "text-secondary",
60
+ tertiary: "text-tertiary",
61
+ primary: "text-primary",
62
+ success: "text-success",
63
+ danger: "text-danger",
64
+ warning: "text-warning",
65
+ info: "text-info",
66
+ light: "text-light",
67
+ dark: "text-dark",
68
+ muted: "text-muted"
69
+ }, c = o(() => e.color ? s[e.color] : "");
70
+ return (n, o) => (D(), l("span", {
71
+ class: C(["hl-icon inline-flex items-center justify-center align-middle leading-none", c.value]),
72
+ style: w({
73
+ width: t.value,
74
+ height: t.value
75
+ }),
76
+ role: a.value ? void 0 : "img",
77
+ "aria-label": a.value ? void 0 : i.value,
78
+ "aria-hidden": a.value ? "true" : void 0
79
+ }, [r.value ? (D(), l("span", {
80
+ key: 0,
81
+ class: "hl-icon__svg inline-flex h-full w-full",
82
+ title: e.title || void 0,
83
+ innerHTML: r.value
84
+ }, null, 8, B)) : (D(), l("span", {
85
+ key: 1,
86
+ class: "inline-flex h-full w-full items-center justify-center rounded border border-solid border-danger text-[10px] text-danger",
87
+ title: `Icon '${e.name}' is not found`
88
+ }, " ? ", 8, ve))], 14, _e));
89
+ }
90
+ }), be = (e, t) => {
91
+ let n = e.__vccOpts || e;
92
+ for (let [e, r] of t) n[e] = r;
93
+ return n;
94
+ }, V = /* @__PURE__ */ be(ye, [["__scopeId", "data-v-cddb1332"]]), H = {
95
+ dashboardLabel: "Dashboard",
96
+ routeNameMap: {
97
+ "": "Dashboard",
98
+ user: "Users",
99
+ users: "Users",
100
+ business: "Businesses",
101
+ businesses: "Businesses",
102
+ reviews: "Reviews",
103
+ reports: "Reports",
104
+ settings: "Settings"
105
+ },
106
+ routeHrefMap: {
107
+ user: "/users",
108
+ business: "/businesses"
109
+ },
110
+ addLabelByParent: {
111
+ business: "Add Business",
112
+ businesses: "Add Business",
113
+ user: "Add User",
114
+ users: "Add User"
115
+ },
116
+ createLabelByRootSegment: {
117
+ user: "Add User",
118
+ business: "Add Business"
119
+ },
120
+ pathOverrides: { "/businesses/category": [
121
+ {
122
+ label: "Dashboard",
123
+ href: "/",
124
+ isActive: !1
125
+ },
126
+ {
127
+ label: "Categories",
128
+ href: "/businesses/categories",
129
+ isActive: !1
130
+ },
131
+ {
132
+ label: "Add Category",
133
+ isActive: !0
134
+ }
135
+ ] },
136
+ uuidPattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
137
+ }, xe = (e = {}) => ({
138
+ ...H,
139
+ ...e,
140
+ routeNameMap: {
141
+ ...H.routeNameMap,
142
+ ...e.routeNameMap
143
+ },
144
+ routeHrefMap: {
145
+ ...H.routeHrefMap,
146
+ ...e.routeHrefMap
147
+ },
148
+ addLabelByParent: {
149
+ ...H.addLabelByParent,
150
+ ...e.addLabelByParent
151
+ },
152
+ createLabelByRootSegment: {
153
+ ...H.createLabelByRootSegment,
154
+ ...e.createLabelByRootSegment
155
+ },
156
+ pathOverrides: {
157
+ ...H.pathOverrides,
158
+ ...e.pathOverrides
159
+ }
160
+ }), Se = (e) => {
161
+ let [t = ""] = e.split(/[?#]/u);
162
+ return t.length === 0 ? "/" : t.startsWith("/") ? t : `/${t}`;
163
+ }, Ce = (e) => e.length === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1), we = (e, t, n, r, i) => r !== null && r.length > 0 && t ? r : e === "new" ? i.addLabelByParent[n ?? ""] ?? "Add" : i.uuidPattern.test(e) && t ? "" : i.routeNameMap[e] ?? Ce(e);
164
+ function U(e, t = {}) {
165
+ let n = xe(t.staticData), r = t.dynamicLabel ?? o(() => null);
166
+ return o(() => {
167
+ let t = Se(e.value), i = t.split("/").filter(Boolean), a = i[0], o = n.pathOverrides[t];
168
+ if (o !== void 0) return o.map((e) => ({ ...e }));
169
+ if (i.length === 1 && a !== void 0 && n.createLabelByRootSegment[a] !== void 0) {
170
+ let e = n.routeNameMap[a] ?? Ce(a), t = n.routeHrefMap[a] ?? `/${a}`, r = n.createLabelByRootSegment[a];
171
+ return [
172
+ {
173
+ label: n.dashboardLabel,
174
+ href: "/",
175
+ isActive: !1
176
+ },
177
+ {
178
+ label: e,
179
+ href: t,
180
+ isActive: !1
181
+ },
182
+ {
183
+ label: r,
184
+ isActive: !0
185
+ }
186
+ ];
187
+ }
188
+ if (i.length === 0) return [{
189
+ label: n.dashboardLabel,
190
+ isActive: !0
191
+ }];
192
+ let s = [{
193
+ label: n.dashboardLabel,
194
+ href: "/",
195
+ isActive: !1
196
+ }], c = "";
197
+ return i.forEach((e, t) => {
198
+ let a = t === i.length - 1, o = t > 0 ? i[t - 1] : void 0;
199
+ c += `/${e}`;
200
+ let l = we(e, a, o, r.value, n), u = a ? void 0 : n.routeHrefMap[e] ?? c;
201
+ s.push({
202
+ label: l,
203
+ href: u,
204
+ isActive: a
205
+ });
206
+ }), s;
207
+ });
208
+ }
209
+ //#endregion
210
+ //#region src/components/hl-breadcrumb/HLBreadcrumb.vue?vue&type=script&setup=true&lang.ts
211
+ var Te = {
212
+ "aria-label": "Breadcrumb",
213
+ class: "hanaplabstoolkit-font"
214
+ }, Ee = { class: "flex items-center text-sm" }, De = {
215
+ key: 1,
216
+ class: "mx-1 text-muted",
217
+ "aria-hidden": "true"
218
+ }, Oe = ["href"], ke = /* @__PURE__ */ h({
219
+ __name: "HLBreadcrumb",
220
+ props: {
221
+ path: { default: "/" },
222
+ dynamicLabel: { default: null },
223
+ staticData: { default: () => ({}) },
224
+ separator: { default: "/" },
225
+ separatorType: { default: "text" },
226
+ separatorIconName: { default: "chevron-down" },
227
+ activeColor: {}
228
+ },
229
+ setup(e) {
230
+ let t = e, n = o(() => t.path), i = o(() => t.dynamicLabel), a = U(n, {
231
+ staticData: t.staticData,
232
+ dynamicLabel: i
233
+ }), d = {
234
+ secondary: "text-secondary",
235
+ tertiary: "text-tertiary",
236
+ primary: "text-primary",
237
+ success: "text-success",
238
+ danger: "text-danger",
239
+ warning: "text-warning",
240
+ info: "text-info",
241
+ light: "text-light",
242
+ dark: "text-dark",
243
+ muted: "text-muted"
244
+ }, f = o(() => t.activeColor ? d[t.activeColor] : "text-dark"), p = o(() => t.activeColor ? d[t.activeColor].replace("text-", "hover:text-") : "hover:text-dark");
245
+ return (t, n) => (D(), l("nav", Te, [u("ol", Ee, [(D(!0), l(r, null, j(F(a), (t, n) => (D(), l("li", {
246
+ key: `${n}-${t.label}-${t.href ?? ""}`,
247
+ class: "flex items-center"
248
+ }, [n > 0 ? (D(), l(r, { key: 0 }, [e.separatorType === "icon" ? (D(), s(V, {
249
+ key: 0,
250
+ name: e.separatorIconName,
251
+ size: "16px",
252
+ color: "muted",
253
+ class: "mx-1 -rotate-90",
254
+ decorative: ""
255
+ }, null, 8, ["name"])) : (D(), l("span", De, N(e.separator), 1))], 64)) : c("", !0), t.href ? (D(), l("a", {
256
+ key: 1,
257
+ href: t.href,
258
+ class: C(["text-dark no-underline transition-colors hover:no-underline", p.value])
259
+ }, N(t.label), 11, Oe)) : (D(), l("span", {
260
+ key: 2,
261
+ class: C(["font-semibold", t.isActive ? f.value : "text-dark"])
262
+ }, N(t.label), 3))]))), 128))])]));
263
+ }
264
+ }), Ae = ["src"], je = { key: 1 }, Me = /* @__PURE__ */ h({
265
+ __name: "HLAvatar",
266
+ props: {
267
+ text: { default: "?" },
268
+ image: { default: "" },
269
+ size: { default: "md" }
270
+ },
271
+ setup(e) {
272
+ let t = {
273
+ xs: "text-[10px]",
274
+ sm: "text-xs",
275
+ md: "text-sm",
276
+ lg: "text-base"
277
+ }, n = {
278
+ xs: 24,
279
+ sm: 36,
280
+ md: 40,
281
+ lg: 48
282
+ }, r = o(() => {
283
+ let t = e.image.trim();
284
+ return !t || t.startsWith("[") ? "" : t;
285
+ }), i = o(() => {
286
+ let { firstWord: t, lastWord: n } = d(e.text);
287
+ return t ? `${t.charAt(0).toUpperCase()}${n ? n.charAt(0).toUpperCase() : ""}` : "?";
288
+ }), a = o(() => {
289
+ let t = `${n[e.size]}px`;
290
+ return {
291
+ width: t,
292
+ height: t,
293
+ minWidth: t,
294
+ minHeight: t,
295
+ maxWidth: t,
296
+ maxHeight: t,
297
+ borderRadius: "9999px"
298
+ };
299
+ }), s = o(() => {
300
+ if (r.value) return {};
301
+ let t = e.text.trim();
302
+ if (!t || t === "?") return {};
303
+ let n = f(t);
304
+ return {
305
+ backgroundColor: `hsl(${n % 360} ${60 + n % 16}% ${20 + n % 12}%)`,
306
+ color: "#ffffff"
307
+ };
308
+ }), c = o(() => ({
309
+ ...a.value,
310
+ ...s.value
311
+ }));
312
+ function d(e) {
313
+ let t = e.trim().split(/\s+/).filter((e) => e.length > 0);
314
+ return t.length === 0 ? {
315
+ firstWord: "",
316
+ lastWord: ""
317
+ } : t.length === 1 ? {
318
+ firstWord: t[0],
319
+ lastWord: ""
320
+ } : {
321
+ firstWord: t[0],
322
+ lastWord: t[t.length - 1]
323
+ };
324
+ }
325
+ function f(e) {
326
+ let t = 0;
327
+ for (let n of e) t = (t << 5) - t + n.charCodeAt(0), t |= 0;
328
+ return Math.abs(t);
329
+ }
330
+ return (n, o) => (D(), l("div", {
331
+ class: "inline-flex shrink-0 items-center justify-center bg-tertiary/35 ring-1 ring-primary/20 hanaplabstoolkit-font",
332
+ style: w(a.value)
333
+ }, [u("div", {
334
+ class: C(["inline-flex size-full items-center justify-center overflow-hidden border border-solid border-gray-200 bg-primary/10 font-bold uppercase leading-none text-primary select-none", t[e.size]]),
335
+ style: w(c.value)
336
+ }, [r.value ? (D(), l("img", {
337
+ key: 0,
338
+ src: r.value,
339
+ alt: "Avatar image",
340
+ class: "size-full rounded-full object-cover"
341
+ }, null, 8, Ae)) : (D(), l("span", je, N(i.value), 1))], 6)], 4));
342
+ }
343
+ }), W = ["type", "disabled"], Ne = {
344
+ key: 1,
345
+ class: "inline-flex items-center justify-center",
346
+ "aria-hidden": "true"
347
+ }, G = "bg-transparent border border-solid", K = /* @__PURE__ */ h({
348
+ __name: "HLButton",
349
+ props: {
350
+ color: {},
351
+ size: { default: "md" },
352
+ variant: { default: "solid" },
353
+ rounded: {
354
+ type: Boolean,
355
+ default: !1
356
+ },
357
+ iconOnly: {
358
+ type: Boolean,
359
+ default: !1
360
+ },
361
+ label: {},
362
+ iconPosition: { default: "left" },
363
+ loading: {
364
+ type: Boolean,
365
+ default: !1
366
+ },
367
+ disabled: {
368
+ type: Boolean,
369
+ default: !1
370
+ },
371
+ type: { default: "button" },
372
+ noBorder: {
373
+ type: Boolean,
374
+ default: !1
375
+ }
376
+ },
377
+ emits: ["click"],
378
+ setup(e, { emit: t }) {
379
+ let n = {
380
+ secondary: "border-0 bg-secondary text-primary hover:bg-tertiary",
381
+ tertiary: "border-0 bg-tertiary text-primary hover:opacity-90",
382
+ primary: "border-0 bg-primary text-light hover:opacity-90",
383
+ success: "border-0 bg-success text-light hover:opacity-90",
384
+ danger: "border-0 bg-danger text-light hover:opacity-90",
385
+ warning: "border-0 bg-warning text-dark hover:opacity-90",
386
+ info: "border-0 bg-info text-light hover:opacity-90",
387
+ light: "border-0 bg-light text-dark hover:bg-secondary",
388
+ dark: "border-0 bg-dark text-light hover:opacity-90",
389
+ muted: "border-0 bg-muted text-light hover:opacity-90"
390
+ }, r = {
391
+ secondary: `${G} text-secondary border-secondary hover:bg-secondary hover:text-primary`,
392
+ tertiary: `${G} text-tertiary border-tertiary hover:bg-tertiary hover:text-primary`,
393
+ primary: `${G} text-primary border-primary hover:bg-primary hover:text-light`,
394
+ success: `${G} text-success border-success hover:bg-success hover:text-light`,
395
+ danger: `${G} text-danger border-danger hover:bg-danger hover:text-light`,
396
+ warning: `${G} text-warning border-warning hover:bg-warning hover:text-dark`,
397
+ info: `${G} text-info border-info hover:bg-info hover:text-light`,
398
+ light: `${G} text-dark border-light hover:bg-light hover:text-dark`,
399
+ dark: `${G} text-dark border-dark hover:bg-dark hover:text-light`,
400
+ muted: `${G} text-muted border-muted hover:bg-muted hover:text-light`
401
+ }, i = {
402
+ xs: "h-[var(--hanaplabstoolkit-size-xs)] px-2 text-xs",
403
+ sm: "h-[var(--hanaplabstoolkit-size-sm)] px-2.5 text-xs",
404
+ md: "h-[var(--hanaplabstoolkit-size-md)] px-3 text-base",
405
+ lg: "h-[var(--hanaplabstoolkit-size-lg)] px-4 text-base"
406
+ }, a = {
407
+ xs: "size-[var(--hanaplabstoolkit-size-xs)] text-xs",
408
+ sm: "size-[var(--hanaplabstoolkit-size-sm)] text-xs",
409
+ md: "size-[var(--hanaplabstoolkit-size-md)] text-base",
410
+ lg: "size-[var(--hanaplabstoolkit-size-lg)] text-base"
411
+ }, s = {
412
+ xs: "rounded-md",
413
+ sm: "rounded-md",
414
+ md: "rounded-lg",
415
+ lg: "rounded-xl"
416
+ }, u = t, d = o(() => e.color ? e.variant === "outline" ? r[e.color] : n[e.color] : e.variant === "outline" ? `${G} border-gray-200 text-dark hover:bg-gray-200` : "border border-solid border-gray-200 bg-transparent text-dark hover:bg-gray-200"), f = o(() => e.iconOnly ? a[e.size] : i[e.size]), m = o(() => e.rounded ? "rounded-full" : s[e.size]);
417
+ return (t, n) => (D(), l("button", x({
418
+ type: e.type,
419
+ class: "flex w-max items-center justify-center gap-2 hanaplabstoolkit-font font-medium hl-color-transition cursor-pointer hl-no-focus-ring disabled:cursor-not-allowed disabled:opacity-60"
420
+ }, t.$attrs, {
421
+ class: [
422
+ d.value,
423
+ e.noBorder && "border-0",
424
+ f.value,
425
+ m.value,
426
+ e.iconOnly && "!gap-0 !min-w-0"
427
+ ],
428
+ disabled: e.disabled || e.loading,
429
+ onClick: n[0] ||= de((e) => u("click"), ["stop"])
430
+ }), [t.$slots.icon && !e.loading ? (D(), l("span", {
431
+ key: 0,
432
+ class: C(["inline-flex items-center justify-center", e.iconPosition === "right" ? "order-2" : "order-1"])
433
+ }, [M(t.$slots, "icon")], 2)) : c("", !0), e.loading ? (D(), l("span", Ne, [p(V, {
434
+ name: "spinner",
435
+ size: 16,
436
+ class: "animate-spin"
437
+ })])) : e.iconOnly ? c("", !0) : (D(), l("span", {
438
+ key: 2,
439
+ class: C(["inline-flex items-center justify-center", e.iconPosition === "right" && t.$slots.icon ? "order-1" : "order-2"])
440
+ }, N(e.label), 3))], 16, W));
441
+ }
442
+ }), Pe = { class: "mb-1 hanaplabstoolkit-font" }, Fe = ["for"], Ie = ["id"], Le = {
443
+ key: 0,
444
+ class: "text-danger"
445
+ }, Re = /* @__PURE__ */ h({
446
+ __name: "HLLabel",
447
+ props: {
448
+ label: { default: "" },
449
+ description: { default: "" },
450
+ forId: { default: "" },
451
+ labelId: { default: "" },
452
+ required: {
453
+ type: Boolean,
454
+ default: !1
455
+ },
456
+ size: { default: "md" },
457
+ labelClass: { default: "" },
458
+ descriptionClass: { default: "" }
459
+ },
460
+ setup(e) {
461
+ let t = o(() => ({
462
+ xs: "text-xs",
463
+ sm: "text-sm",
464
+ md: "text-base",
465
+ lg: "text-lg"
466
+ })[e.size]), n = o(() => ({
467
+ xs: "text-[10px]",
468
+ sm: "text-xs",
469
+ md: "text-sm",
470
+ lg: "text-base"
471
+ })[e.size]);
472
+ return (r, i) => (D(), l("div", Pe, [u("label", {
473
+ for: e.forId || void 0,
474
+ class: C(["block text-dark font-medium", [t.value, e.labelClass]])
475
+ }, [u("span", { id: e.labelId || void 0 }, N(e.label), 9, Ie), e.required ? (D(), l("span", Le, "*")) : c("", !0)], 10, Fe), e.description ? (D(), l("p", {
476
+ key: 0,
477
+ class: C(["text-muted", [n.value, e.descriptionClass]])
478
+ }, N(e.description), 3)) : c("", !0)]));
479
+ }
480
+ }), ze = { class: "w-full select-none" }, Be = [
481
+ "aria-checked",
482
+ "aria-label",
483
+ "aria-labelledby",
484
+ "disabled"
485
+ ], q = {
486
+ key: 1,
487
+ class: "sr-only"
488
+ }, Ve = ["id", "disabled"], He = "bg-white border-gray-300", Ue = "bg-white border-gray-300 text-dark", J = /* @__PURE__ */ h({
489
+ __name: "HLCheckbox",
490
+ props: /* @__PURE__ */ b({
491
+ id: { default: "" },
492
+ label: { default: "" },
493
+ description: { default: "" },
494
+ labelClass: { default: "" },
495
+ descriptionClass: { default: "" },
496
+ ariaLabel: { default: "" },
497
+ disabled: {
498
+ type: Boolean,
499
+ default: !1
500
+ },
501
+ indeterminate: {
502
+ type: Boolean,
503
+ default: !1
504
+ },
505
+ size: { default: "md" },
506
+ labelSize: { default: "md" },
507
+ color: {},
508
+ noBorder: {
509
+ type: Boolean,
510
+ default: !1
511
+ }
512
+ }, {
513
+ modelValue: {
514
+ type: Boolean,
515
+ default: !1
516
+ },
517
+ modelModifiers: {}
518
+ }),
519
+ emits: ["update:modelValue"],
520
+ setup(e) {
521
+ let t = L(e, "modelValue"), n = I(), r = o(() => e.id || n), i = o(() => `${r.value}-label`), a = o(() => e.label.trim().length > 0), c = () => {
522
+ e.disabled || (t.value = !t.value);
523
+ }, d = {
524
+ xs: "w-3.5 h-3.5",
525
+ sm: "w-4 h-4",
526
+ md: "w-5 h-5",
527
+ lg: "w-6 h-6"
528
+ }, f = {
529
+ xs: "w-2.5 h-2.5",
530
+ sm: "w-3 h-3",
531
+ md: "w-3.5 h-3.5",
532
+ lg: "w-4 h-4"
533
+ }, m = {
534
+ xs: 10,
535
+ sm: 12,
536
+ md: 14,
537
+ lg: 16
538
+ }, h = {
539
+ primary: "bg-primary border-primary text-white",
540
+ secondary: "bg-secondary border-secondary text-white",
541
+ tertiary: "bg-tertiary border-tertiary text-dark",
542
+ success: "bg-success border-success text-white",
543
+ danger: "bg-danger border-danger text-white",
544
+ warning: "bg-warning border-warning text-dark",
545
+ info: "bg-info border-info text-white",
546
+ light: "bg-light border-light text-dark",
547
+ dark: "bg-dark border-dark text-white",
548
+ muted: "bg-muted border-muted text-white"
549
+ }, g = {
550
+ primary: "bg-light border-primary",
551
+ secondary: "bg-light border-secondary",
552
+ tertiary: "bg-light border-tertiary",
553
+ success: "bg-light border-success",
554
+ danger: "bg-light border-danger",
555
+ warning: "bg-light border-warning",
556
+ info: "bg-light border-info",
557
+ light: "bg-light border-muted",
558
+ dark: "bg-light border-dark",
559
+ muted: "bg-light border-muted"
560
+ }, _ = (e) => typeof e == "string" && Object.prototype.hasOwnProperty.call(h, e), v = o(() => d[e.size]), y = o(() => m[e.size]), b = o(() => e.indeterminate && !t.value), x = o(() => b.value ? "mixed" : t.value), S = o(() => b.value ? "bg-primary/20 border-primary text-primary" : _(e.color) ? t.value ? h[e.color] : g[e.color] : t.value ? Ue : He);
561
+ return (n, o) => (D(), l("div", ze, [u("button", {
562
+ type: "button",
563
+ role: "checkbox",
564
+ "aria-checked": x.value,
565
+ "aria-label": e.ariaLabel || void 0,
566
+ "aria-labelledby": a.value ? i.value : void 0,
567
+ disabled: e.disabled,
568
+ style: { "box-shadow": "none" },
569
+ class: C(["inline-flex w-full appearance-none border-0 !shadow-none items-start gap-3 rounded-md bg-transparent text-left hanaplabstoolkit-font transition-all duration-200 hl-no-focus-ring", e.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"]),
570
+ onClick: c
571
+ }, [u("span", { class: C(["mt-0.5 inline-flex shrink-0 items-center justify-center overflow-hidden rounded border border-solid border-gray-200 bg-white leading-none transition-colors duration-200", [
572
+ v.value,
573
+ S.value,
574
+ e.noBorder && "border-0"
575
+ ]]) }, [p(V, {
576
+ name: "check",
577
+ size: y.value,
578
+ color: e.color,
579
+ class: C(["transition-opacity duration-200", [f[e.size], t.value || b.value ? "opacity-100" : "opacity-0"]])
580
+ }, null, 8, [
581
+ "size",
582
+ "color",
583
+ "class"
584
+ ])], 2), e.label || e.description ? (D(), s(Re, {
585
+ key: 0,
586
+ class: "min-w-0",
587
+ label: e.label,
588
+ description: e.description,
589
+ "for-id": r.value,
590
+ "label-id": i.value,
591
+ size: e.labelSize,
592
+ "label-class": e.labelClass,
593
+ "description-class": e.descriptionClass
594
+ }, null, 8, [
595
+ "label",
596
+ "description",
597
+ "for-id",
598
+ "label-id",
599
+ "size",
600
+ "label-class",
601
+ "description-class"
602
+ ])) : (D(), l("span", q, "toggle checkbox"))], 10, Be), ue(u("input", {
603
+ id: r.value,
604
+ "onUpdate:modelValue": o[0] ||= (e) => t.value = e,
605
+ type: "checkbox",
606
+ class: "sr-only",
607
+ disabled: e.disabled
608
+ }, null, 8, Ve), [[oe, t.value]])]));
609
+ }
610
+ }), We = { class: "w-full space-y-2 hanaplabstoolkit-font" }, Ge = { class: "relative" }, Ke = {
611
+ key: 0,
612
+ class: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted"
613
+ }, qe = [
614
+ "id",
615
+ "type",
616
+ "placeholder",
617
+ "required",
618
+ "disabled",
619
+ "readonly",
620
+ "autocomplete",
621
+ "maxlength",
622
+ "minlength",
623
+ "pattern"
624
+ ], Je = {
625
+ key: 1,
626
+ class: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-muted"
627
+ }, Ye = ["aria-label"], Xe = {
628
+ key: 1,
629
+ class: "mt-1 space-y-1"
630
+ }, Ze = {
631
+ key: 0,
632
+ class: "text-xs text-danger"
633
+ }, Qe = /* @__PURE__ */ be(/* @__PURE__ */ h({
634
+ __name: "HLInput",
635
+ props: /* @__PURE__ */ b({
636
+ id: { default: "" },
637
+ type: { default: "text" },
638
+ placeholder: { default: "" },
639
+ label: { default: "" },
640
+ description: { default: "" },
641
+ required: {
642
+ type: Boolean,
643
+ default: !1
644
+ },
645
+ disabled: {
646
+ type: Boolean,
647
+ default: !1
648
+ },
649
+ readonly: {
650
+ type: Boolean,
651
+ default: !1
652
+ },
653
+ error: { default: "" },
654
+ errors: { default: () => [] },
655
+ autocomplete: { default: "off" },
656
+ maxlength: {},
657
+ minlength: {},
658
+ pattern: {},
659
+ showPasswordToggle: {
660
+ type: Boolean,
661
+ default: !1
662
+ },
663
+ labelClass: { default: "" },
664
+ labelSize: { default: "md" },
665
+ iconLeft: {
666
+ type: Boolean,
667
+ default: !1
668
+ },
669
+ inputClass: { default: "" },
670
+ size: { default: "md" },
671
+ color: {},
672
+ rounded: {
673
+ type: Boolean,
674
+ default: !1
675
+ },
676
+ loading: {
677
+ type: Boolean,
678
+ default: !1
679
+ },
680
+ noBorder: {
681
+ type: Boolean,
682
+ default: !1
683
+ }
684
+ }, {
685
+ modelValue: { default: "" },
686
+ modelModifiers: {}
687
+ }),
688
+ emits: /* @__PURE__ */ b([
689
+ "focus",
690
+ "blur",
691
+ "input",
692
+ "change"
693
+ ], ["update:modelValue"]),
694
+ setup(e, { emit: t }) {
695
+ let n = L(e, "modelValue"), i = t, a = I(), d = o(() => e.id || a), f = k(null), m = k(!1), h = o(() => e.type === "password"), g = o(() => e.type === "search"), _ = o(() => h.value && e.showPasswordToggle ? m.value ? "text" : "password" : e.type), v = () => {
696
+ m.value = !m.value;
697
+ }, y = o(() => g.value && String(n.value ?? "").length > 0), b = () => {
698
+ n.value = "", i("input"), i("change"), f.value?.focus();
699
+ }, x = o(() => e.error), S = o(() => {
700
+ let t = [];
701
+ for (let n of e.errors) t.includes(n) || t.push(n);
702
+ return t;
703
+ }), w = o(() => !!x.value || S.value.length > 0), ee = {
704
+ xs: "h-[var(--hanaplabstoolkit-size-xs)] px-2 text-xs",
705
+ sm: "h-[var(--hanaplabstoolkit-size-sm)] px-2.5 text-xs",
706
+ md: "h-[var(--hanaplabstoolkit-size-md)] px-3 text-sm",
707
+ lg: "h-[var(--hanaplabstoolkit-size-lg)] px-4 text-sm"
708
+ }, T = {
709
+ xs: "rounded-md",
710
+ sm: "rounded-md",
711
+ md: "rounded-md",
712
+ lg: "rounded-lg"
713
+ }, E = {
714
+ secondary: "border-secondary focus:border-secondary",
715
+ tertiary: "border-tertiary focus:border-tertiary",
716
+ primary: "border-primary focus:border-primary",
717
+ success: "border-success focus:border-success",
718
+ danger: "border-danger focus:border-danger",
719
+ warning: "border-warning focus:border-warning",
720
+ info: "border-info focus:border-info",
721
+ light: "border-muted focus:border-secondary",
722
+ dark: "border-dark focus:border-dark",
723
+ muted: "border-muted focus:border-muted"
724
+ }, te = o(() => ee[e.size]), O = o(() => e.rounded ? "rounded-full" : T[e.size]), A = o(() => e.color ? E[e.color] : "border-gray-200 focus:border-gray-200");
725
+ return (t, a) => (D(), l("div", We, [
726
+ e.label || e.description ? (D(), s(Re, {
727
+ key: 0,
728
+ label: e.label,
729
+ description: e.description,
730
+ "for-id": d.value,
731
+ required: e.required,
732
+ size: e.labelSize,
733
+ "label-class": e.labelClass
734
+ }, null, 8, [
735
+ "label",
736
+ "description",
737
+ "for-id",
738
+ "required",
739
+ "size",
740
+ "label-class"
741
+ ])) : c("", !0),
742
+ u("div", Ge, [
743
+ e.iconLeft ? (D(), l("div", Ke, [M(t.$slots, "icon", {}, void 0, !0)])) : c("", !0),
744
+ ue(u("input", {
745
+ ref_key: "inputRef",
746
+ ref: f,
747
+ id: d.value,
748
+ "onUpdate:modelValue": a[0] ||= (e) => n.value = e,
749
+ type: _.value,
750
+ placeholder: e.placeholder,
751
+ required: e.required,
752
+ disabled: e.disabled || e.loading,
753
+ readonly: e.readonly,
754
+ autocomplete: e.autocomplete,
755
+ maxlength: e.maxlength,
756
+ minlength: e.minlength,
757
+ pattern: e.pattern,
758
+ class: C(["block w-full appearance-none box-border border border-solid bg-transparent text-dark placeholder:text-muted leading-tight transition-colors duration-150 hl-no-focus-ring disabled:cursor-not-allowed disabled:opacity-60 hanaplabstoolkit-font", [
759
+ te.value,
760
+ O.value,
761
+ A.value,
762
+ e.inputClass,
763
+ {
764
+ "cursor-not-allowed": e.disabled || e.loading,
765
+ "pr-10": e.showPasswordToggle && h.value || e.loading || y.value,
766
+ "pl-10": e.iconLeft,
767
+ "border-danger focus:border-danger": w.value,
768
+ "border-0 focus:border-0": e.noBorder,
769
+ "hl-search-input": g.value
770
+ }
771
+ ]]),
772
+ onFocus: a[1] ||= (e) => i("focus"),
773
+ onBlur: a[2] ||= (e) => i("blur"),
774
+ onInput: a[3] ||= (e) => i("input"),
775
+ onChange: a[4] ||= (e) => i("change")
776
+ }, null, 42, qe), [[se, n.value]]),
777
+ e.loading ? (D(), l("div", Je, [p(V, {
778
+ name: "spinner",
779
+ size: 20,
780
+ class: "animate-spin",
781
+ color: e.color
782
+ }, null, 8, ["color"])])) : y.value ? (D(), l("button", {
783
+ key: 2,
784
+ type: "button",
785
+ class: "absolute inset-y-0 right-0 flex items-center pr-3 appearance-none border-0 bg-transparent p-0 text-muted hover:text-primary hl-no-focus-ring cursor-pointer",
786
+ "aria-label": "Clear search",
787
+ onClick: b
788
+ }, [p(V, {
789
+ name: "x-mark",
790
+ size: 16,
791
+ decorative: !0,
792
+ color: e.color
793
+ }, null, 8, ["color"])])) : e.showPasswordToggle && h.value ? (D(), l("button", {
794
+ key: 3,
795
+ type: "button",
796
+ class: "absolute inset-y-0 right-0 flex items-center pr-3 appearance-none border-0 bg-transparent p-0 text-muted hover:text-primary hl-no-focus-ring cursor-pointer",
797
+ "aria-label": m.value ? "Hide password" : "Show password",
798
+ onClick: v
799
+ }, [p(V, {
800
+ name: m.value ? "eye-off" : "eye",
801
+ size: 18,
802
+ decorative: !0,
803
+ color: e.color
804
+ }, null, 8, ["name", "color"])], 8, Ye)) : c("", !0)
805
+ ]),
806
+ w.value ? (D(), l("div", Xe, [x.value ? (D(), l("p", Ze, N(x.value), 1)) : c("", !0), (D(!0), l(r, null, j(S.value, (e) => (D(), l("p", {
807
+ key: e,
808
+ class: "text-xs text-danger"
809
+ }, N(e), 1))), 128))])) : c("", !0)
810
+ ]));
811
+ }
812
+ }), [["__scopeId", "data-v-5186dc0e"]]);
813
+ //#endregion
814
+ //#region node_modules/@vueuse/shared/dist/index.js
815
+ function $e(e, t) {
816
+ return _() ? (E(e, t), !0) : !1;
817
+ }
818
+ var et = typeof window < "u" && typeof document < "u";
819
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
820
+ var tt = Object.prototype.toString, nt = (e) => tt.call(e) === "[object Object]", rt = () => {};
821
+ function it(...e) {
822
+ if (e.length !== 1) return ie(...e);
823
+ let t = e[0];
824
+ return typeof t == "function" ? O(m(() => ({
825
+ get: t,
826
+ set: rt
827
+ }))) : k(t);
828
+ }
829
+ function at(e) {
830
+ return Array.isArray(e) ? e : [e];
831
+ }
832
+ function ot(e, t, n) {
833
+ return R(e, t, {
834
+ ...n,
835
+ immediate: !0
836
+ });
837
+ }
838
+ //#endregion
839
+ //#region node_modules/@vueuse/core/dist/index.js
840
+ var st = et ? window : void 0;
841
+ et && window.document, et && window.navigator, et && window.location;
842
+ function ct(e) {
843
+ let t = P(e);
844
+ return t?.$el ?? t;
845
+ }
846
+ function lt(...e) {
847
+ let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = o(() => {
848
+ let t = at(P(e[0])).filter((e) => e != null);
849
+ return t.every((e) => typeof e != "string") ? t : void 0;
850
+ });
851
+ return ot(() => [
852
+ n.value?.map((e) => ct(e)) ?? [st].filter((e) => e != null),
853
+ at(P(n.value ? e[1] : e[0])),
854
+ at(F(n.value ? e[2] : e[1])),
855
+ P(n.value ? e[3] : e[2])
856
+ ], ([e, n, r, i], a, o) => {
857
+ if (!e?.length || !n?.length || !r?.length) return;
858
+ let s = nt(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
859
+ o(() => {
860
+ c.forEach((e) => e());
861
+ });
862
+ }, { flush: "post" });
863
+ }
864
+ function ut() {
865
+ let e = re(!1), t = g();
866
+ return t && T(() => {
867
+ e.value = !0;
868
+ }, t), e;
869
+ }
870
+ /* @__NO_SIDE_EFFECTS__ */
871
+ function dt(e) {
872
+ let t = ut();
873
+ return o(() => (t.value, !!e()));
874
+ }
875
+ function ft(e, t, n = {}) {
876
+ let { window: r = st, ...i } = n, a, s = /* @__PURE__ */ dt(() => r && "ResizeObserver" in r), c = () => {
877
+ a &&= (a.disconnect(), void 0);
878
+ }, l = R(o(() => {
879
+ let t = P(e);
880
+ return Array.isArray(t) ? t.map((e) => ct(e)) : [ct(t)];
881
+ }), (e) => {
882
+ if (c(), s.value && r) {
883
+ a = new ResizeObserver(t);
884
+ for (let t of e) t && a.observe(t, i);
885
+ }
886
+ }, {
887
+ immediate: !0,
888
+ flush: "post"
889
+ }), u = () => {
890
+ c(), l();
891
+ };
892
+ return $e(u), {
893
+ isSupported: s,
894
+ stop: u
895
+ };
896
+ }
897
+ function pt(e = st, t) {
898
+ e && typeof e.requestAnimationFrame == "function" ? e.requestAnimationFrame(t) : t();
899
+ }
900
+ function mt(e = {}) {
901
+ let { window: t = st } = e, n = it(e?.element), r = it(e?.input ?? ""), i = e?.styleProp ?? "height", a = re(1), o = re(0);
902
+ function s() {
903
+ if (!n.value) return;
904
+ let t = "", r = e?.maxHeight;
905
+ n.value.style[i] = "1px", a.value = n.value?.scrollHeight;
906
+ let o = P(e?.styleTarget), s = r == null ? `${a.value}px` : `${Math.min(a.value, r)}px`;
907
+ o ? o.style[i] = s : t = s, n.value.style[i] = t;
908
+ }
909
+ return R([r, n], () => S(s), { immediate: !0 }), R(a, () => {
910
+ var t;
911
+ return e == null || (t = e.onResize) == null ? void 0 : t.call(e);
912
+ }), ft(n, ([{ contentRect: e }]) => {
913
+ o.value !== e.width && pt(t, () => {
914
+ o.value = e.width, s();
915
+ });
916
+ }), e?.watch && R(e.watch, s, {
917
+ immediate: !0,
918
+ deep: !0
919
+ }), {
920
+ textarea: n,
921
+ input: r,
922
+ triggerResize: s
923
+ };
924
+ }
925
+ //#endregion
926
+ //#region src/components/hl-menu-action/HLMenuAction.vue?vue&type=script&setup=true&lang.ts
927
+ var ht = { class: "relative inline-block hanaplabstoolkit-font" }, gt = /* @__PURE__ */ h({
928
+ __name: "HLMenuAction",
929
+ props: /* @__PURE__ */ b({
930
+ options: { default: () => [] },
931
+ disabled: {
932
+ type: Boolean,
933
+ default: !1
934
+ },
935
+ triggerAriaLabel: { default: "Open actions menu" },
936
+ closeOnSelect: {
937
+ type: Boolean,
938
+ default: !0
939
+ },
940
+ closeOnClickOutside: {
941
+ type: Boolean,
942
+ default: !0
943
+ },
944
+ closeOnEscape: {
945
+ type: Boolean,
946
+ default: !0
947
+ },
948
+ menuClass: { default: "" },
949
+ optionClass: { default: "" }
950
+ }, {
951
+ modelValue: {
952
+ type: Boolean,
953
+ default: !1
954
+ },
955
+ modelModifiers: {}
956
+ }),
957
+ emits: /* @__PURE__ */ b([
958
+ "select",
959
+ "open",
960
+ "close"
961
+ ], ["update:modelValue"]),
962
+ setup(e, { emit: n }) {
963
+ let i = {
964
+ primary: "text-primary",
965
+ secondary: "text-secondary",
966
+ tertiary: "text-tertiary",
967
+ success: "text-success",
968
+ danger: "text-danger",
969
+ warning: "text-warning",
970
+ info: "text-info",
971
+ light: "text-slate-700",
972
+ dark: "text-dark",
973
+ muted: "text-muted"
974
+ }, a = L(e, "modelValue"), u = n, { ACTION_REF: f, FLOATING_REF: m, ACTION_ID: h, FLOATING_ID: g, isVisible: _, show: v, hide: y, floatingStyles: b } = t({
975
+ placement: "bottom-end",
976
+ strategy: "fixed",
977
+ offset: 4
978
+ }), x = o(() => _.value ? "Close actions menu" : e.triggerAriaLabel), S = (e) => e ? i[e] : void 0, ee = () => {
979
+ _.value || (v(), u("open"));
980
+ }, T = () => {
981
+ _.value && (y(), u("close"));
982
+ }, E = () => {
983
+ e.disabled || (_.value ? T() : ee());
984
+ }, te = async (t) => {
985
+ t.disabled || t.loading || (u("select", t), t.callback && await t.callback(), e.closeOnSelect && T());
986
+ };
987
+ return R(a, (e) => {
988
+ e !== _.value && (e ? ee() : T());
989
+ }), R(_, (e) => {
990
+ a.value !== e && (a.value = e);
991
+ }), lt(window, "click", (t) => {
992
+ if (!e.closeOnClickOutside || !_.value) return;
993
+ let n = t.target;
994
+ if (!(n instanceof Node)) return;
995
+ let r = document.getElementById(h), i = document.getElementById(g);
996
+ r && i && !r.contains(n) && !i.contains(n) && T();
997
+ }), lt(window, "keydown", (t) => {
998
+ !e.closeOnEscape || !_.value || t.key === "Escape" && T();
999
+ }), (t, n) => (D(), l("div", ht, [p(K, {
1000
+ ref: F(f),
1001
+ label: "",
1002
+ type: "button",
1003
+ "icon-only": !0,
1004
+ "no-border": !0,
1005
+ class: "!size-8 !rounded-md !bg-transparent !text-slate-600 hover:!bg-gray-100 hover:!text-slate-800",
1006
+ disabled: e.disabled,
1007
+ "aria-label": x.value,
1008
+ "aria-expanded": F(_),
1009
+ "aria-haspopup": "menu",
1010
+ onClick: E
1011
+ }, {
1012
+ icon: z(() => [p(V, {
1013
+ name: "three-dots",
1014
+ class: "size-5",
1015
+ decorative: !0
1016
+ })]),
1017
+ _: 1
1018
+ }, 8, [
1019
+ "disabled",
1020
+ "aria-label",
1021
+ "aria-expanded"
1022
+ ]), F(_) ? (D(), l("div", {
1023
+ key: 0,
1024
+ ref: F(m),
1025
+ style: w(F(b)),
1026
+ class: C(["z-50 min-w-40 overflow-hidden rounded-md border border-gray-200 bg-white shadow-lg divide-y-reverse divide-gray-200 divide-y", e.menuClass]),
1027
+ role: "menu"
1028
+ }, [(D(!0), l(r, null, j(e.options, (t) => (D(), s(K, {
1029
+ key: t.value,
1030
+ label: t.label,
1031
+ type: "button",
1032
+ size: "xs",
1033
+ loading: !!t.loading,
1034
+ "no-border": !0,
1035
+ class: C(["!h-auto !w-full !min-h-0 !justify-start !rounded-none !border-b !border-gray-200 last:!border-b-0 !bg-transparent !px-4 !py-2 !text-left !text-sm !font-normal !text-slate-700 hover:!bg-gray-100", [S(t.color), e.optionClass]]),
1036
+ disabled: t.disabled || t.loading,
1037
+ role: "menuitem",
1038
+ onClick: (e) => te(t)
1039
+ }, d({ _: 2 }, [t.icon && !t.loading ? {
1040
+ name: "icon",
1041
+ fn: z(() => [p(V, {
1042
+ name: t.icon,
1043
+ class: "size-4",
1044
+ decorative: !0
1045
+ }, null, 8, ["name"])]),
1046
+ key: "0"
1047
+ } : void 0]), 1032, [
1048
+ "label",
1049
+ "loading",
1050
+ "class",
1051
+ "disabled",
1052
+ "onClick"
1053
+ ]))), 128))], 6)) : c("", !0)]));
1054
+ }
1055
+ }), _t = { class: "relative flex w-full items-start gap-3 overflow-hidden rounded-lg border border-dark/10 bg-light/95 px-4 py-3 shadow-lg backdrop-blur-sm" }, vt = { class: "shrink-0 pt-0.5" }, yt = { class: "min-w-0 flex-1" }, bt = { class: "mt-1 break-words text-sm leading-snug text-dark" }, xt = /* @__PURE__ */ h({
1056
+ __name: "HLToast",
1057
+ props: {
1058
+ type: {},
1059
+ title: { default: "" },
1060
+ message: {}
1061
+ },
1062
+ emits: ["close"],
1063
+ setup(e, { emit: t }) {
1064
+ let n = t, r = {
1065
+ success: {
1066
+ iconName: "check",
1067
+ accentClass: "bg-success",
1068
+ iconClass: "text-success",
1069
+ titleClass: "text-success",
1070
+ closeClass: "text-success hover:bg-success/10"
1071
+ },
1072
+ error: {
1073
+ iconName: "x-mark",
1074
+ accentClass: "bg-danger",
1075
+ iconClass: "text-danger",
1076
+ titleClass: "text-danger",
1077
+ closeClass: "text-danger hover:bg-danger/10"
1078
+ },
1079
+ info: {
1080
+ iconName: "eye",
1081
+ accentClass: "bg-info",
1082
+ iconClass: "text-info",
1083
+ titleClass: "text-info",
1084
+ closeClass: "text-info hover:bg-info/10"
1085
+ },
1086
+ warning: {
1087
+ iconName: "eye-off",
1088
+ accentClass: "bg-warning",
1089
+ iconClass: "text-warning",
1090
+ titleClass: "text-warning",
1091
+ closeClass: "text-warning hover:bg-warning/10"
1092
+ }
1093
+ }, i = o(() => r[e.type]), a = o(() => e.title.trim().length > 0 ? e.title : e.type === "success" ? "Success" : e.type === "error" ? "Error" : e.type === "info" ? "Info" : "Warning"), s = () => {
1094
+ n("close");
1095
+ };
1096
+ return (t, n) => (D(), l("div", _t, [
1097
+ u("span", { class: C(["absolute inset-y-0 left-0 w-1", i.value.accentClass]) }, null, 2),
1098
+ u("div", vt, [p(V, {
1099
+ name: i.value.iconName,
1100
+ class: C(["size-6", i.value.iconClass]),
1101
+ decorative: !0
1102
+ }, null, 8, ["name", "class"])]),
1103
+ u("div", yt, [u("p", { class: C(["truncate text-sm font-semibold leading-tight", i.value.titleClass]) }, N(a.value), 3), u("p", bt, N(e.message), 1)]),
1104
+ u("button", {
1105
+ type: "button",
1106
+ class: C(["inline-flex size-8 shrink-0 items-center justify-center rounded-full transition-colors", i.value.closeClass]),
1107
+ "aria-label": "close notification",
1108
+ onClick: s
1109
+ }, [p(V, {
1110
+ name: "x-mark",
1111
+ class: "size-4",
1112
+ decorative: !0
1113
+ })], 2)
1114
+ ]));
1115
+ }
1116
+ }), St = {
1117
+ key: 0,
1118
+ class: "pointer-events-none fixed inset-x-0 top-6 z-[9999] px-3 sm:px-0"
1119
+ }, Ct = { class: "mx-auto w-full max-w-xl" }, wt = { class: "pointer-events-auto" }, Tt = /* @__PURE__ */ h({
1120
+ __name: "HLGlobalNotify",
1121
+ setup(t) {
1122
+ let { notification: n, hide: r } = e();
1123
+ return (e, t) => (D(), s(i, { to: "body" }, [p(a, {
1124
+ "enter-active-class": "transition ease-out duration-200",
1125
+ "enter-from-class": "translate-y-2 opacity-0",
1126
+ "enter-to-class": "translate-y-0 opacity-100",
1127
+ "leave-active-class": "transition ease-in duration-150",
1128
+ "leave-from-class": "translate-y-0 opacity-100",
1129
+ "leave-to-class": "translate-y-2 opacity-0"
1130
+ }, {
1131
+ default: z(() => [F(n).visible ? (D(), l("div", St, [u("div", Ct, [u("div", wt, [p(xt, {
1132
+ type: F(n).type,
1133
+ title: F(n).title,
1134
+ message: F(n).message,
1135
+ onClose: F(r)
1136
+ }, null, 8, [
1137
+ "type",
1138
+ "title",
1139
+ "message",
1140
+ "onClose"
1141
+ ])])])])) : c("", !0)]),
1142
+ _: 1
1143
+ })]));
1144
+ }
1145
+ }), Et = {
1146
+ autoMount: !0,
1147
+ mountId: "hl-notify-host",
1148
+ componentName: "HLGlobalNotify"
1149
+ }, Dt = null, Ot = !1, kt = () => typeof window < "u" && typeof document < "u", At = (e, t) => {
1150
+ if (!kt() || Dt !== null) return;
1151
+ let n = document.getElementById(t.mountId), r = n ?? document.createElement("div");
1152
+ n === null ? (r.id = t.mountId, document.body.appendChild(r), Ot = !0) : Ot = !1;
1153
+ let i = p(Tt);
1154
+ i.appContext = e._context, A(i, r), Dt = r;
1155
+ }, jt = () => {
1156
+ Dt !== null && (A(null, Dt), Ot && Dt.parentNode !== null && Dt.parentNode.removeChild(Dt), Dt = null, Ot = !1);
1157
+ }, Mt = (e = {}) => {
1158
+ let t = {
1159
+ ...Et,
1160
+ ...e
1161
+ };
1162
+ return { install(e) {
1163
+ e.component(t.componentName, Tt), t.autoMount && At(e, t);
1164
+ } };
1165
+ }, Nt = {
1166
+ key: 0,
1167
+ class: "fixed inset-0 z-50 flex items-center justify-center"
1168
+ }, Pt = { class: "relative max-w-full pointer-events-auto" }, Ft = {
1169
+ key: 0,
1170
+ class: "w-full max-w-md rounded-lg bg-white p-6 shadow-xl ring-1 ring-black/5"
1171
+ }, It = {
1172
+ key: 0,
1173
+ class: "mb-2 text-lg font-semibold text-slate-900"
1174
+ }, Lt = { class: "mb-6 text-slate-600" }, Rt = { class: "flex justify-end gap-3" }, zt = ["disabled"], Bt = ["disabled"], Vt = /* @__PURE__ */ h({
1175
+ __name: "HLPopup",
1176
+ props: /* @__PURE__ */ b({
1177
+ backdropClass: { default: "bg-black/50 backdrop-blur-sm" },
1178
+ containerClass: { default: "" },
1179
+ closeOnBackdrop: {
1180
+ type: Boolean,
1181
+ default: !0
1182
+ },
1183
+ type: { default: "confirm" },
1184
+ component: {},
1185
+ componentProps: {},
1186
+ isLoading: {
1187
+ type: Boolean,
1188
+ default: !1
1189
+ }
1190
+ }, {
1191
+ modelValue: {
1192
+ type: Boolean,
1193
+ default: !1
1194
+ },
1195
+ modelModifiers: {}
1196
+ }),
1197
+ emits: /* @__PURE__ */ b(["close", "confirm"], ["update:modelValue"]),
1198
+ setup(e, { emit: t }) {
1199
+ let n = 0, r = null;
1200
+ function o() {
1201
+ typeof document > "u" || (n === 0 && (r = document.body.style.overflow, document.body.style.overflow = "hidden"), n += 1);
1202
+ }
1203
+ function d() {
1204
+ typeof document > "u" || n <= 0 || (--n, n === 0 && (document.body.style.overflow = r ?? "", r = null));
1205
+ }
1206
+ let m = L(e, "modelValue"), h = t, g = () => {
1207
+ !e.closeOnBackdrop || e.isLoading || (m.value = !1, h("close"));
1208
+ }, _ = () => {
1209
+ e.isLoading || (m.value = !1, h("close"));
1210
+ }, v = () => {
1211
+ e.isLoading || h("confirm");
1212
+ };
1213
+ return R(m, (e) => {
1214
+ if (e) {
1215
+ o();
1216
+ return;
1217
+ }
1218
+ d();
1219
+ }), te(() => {
1220
+ d();
1221
+ }), (t, n) => (D(), s(i, { to: "body" }, [p(a, {
1222
+ "enter-active-class": "transition duration-300 ease-out",
1223
+ "enter-from-class": "opacity-0",
1224
+ "enter-to-class": "opacity-100",
1225
+ "leave-active-class": "transition duration-200 ease-in",
1226
+ "leave-from-class": "opacity-100",
1227
+ "leave-to-class": "opacity-0"
1228
+ }, {
1229
+ default: z(() => [m.value ? (D(), l("div", Nt, [u("div", {
1230
+ class: C(["absolute inset-0", e.backdropClass]),
1231
+ onClick: g
1232
+ }, null, 2), p(a, {
1233
+ "enter-active-class": "transition duration-300 ease-out",
1234
+ "enter-from-class": "scale-95 opacity-0",
1235
+ "enter-to-class": "scale-100 opacity-100",
1236
+ "leave-active-class": "transition duration-200 ease-in",
1237
+ "leave-from-class": "scale-100 opacity-100",
1238
+ "leave-to-class": "scale-95 opacity-0"
1239
+ }, {
1240
+ default: z(() => [m.value ? (D(), l("div", {
1241
+ key: 0,
1242
+ class: C(["relative z-10 flex w-full items-start justify-center px-4 pointer-events-none", e.containerClass])
1243
+ }, [u("div", Pt, [e.type === "confirm" ? (D(), l("div", Ft, [
1244
+ e.componentProps?.title ? (D(), l("h3", It, N(e.componentProps.title), 1)) : c("", !0),
1245
+ u("p", Lt, N(e.componentProps?.message || "Are you sure?"), 1),
1246
+ u("div", Rt, [u("button", {
1247
+ class: "cursor-pointer text-sm font-medium text-slate-600 transition-colors hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-50",
1248
+ disabled: e.isLoading,
1249
+ onClick: _
1250
+ }, N(e.componentProps?.cancelText || "Cancel"), 9, zt), u("button", {
1251
+ class: "flex cursor-pointer items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-70",
1252
+ disabled: e.isLoading,
1253
+ onClick: v
1254
+ }, [e.isLoading ? (D(), s(V, {
1255
+ key: 0,
1256
+ name: "spinner",
1257
+ class: "size-4 animate-spin"
1258
+ })) : c("", !0), f(" " + N(e.componentProps?.confirmText || "OK"), 1)], 8, Bt)])
1259
+ ])) : e.component ? (D(), s(ne(e.component), x({
1260
+ key: 1,
1261
+ class: "inline-block",
1262
+ style: {
1263
+ margin: "0",
1264
+ width: "auto",
1265
+ "max-width": "100%"
1266
+ }
1267
+ }, e.componentProps, { onClose: _ }), null, 16)) : M(t.$slots, "default", { key: 2 })])], 2)) : c("", !0)]),
1268
+ _: 3
1269
+ })])) : c("", !0)]),
1270
+ _: 3
1271
+ })]));
1272
+ }
1273
+ }), Ht = /* @__PURE__ */ h({
1274
+ __name: "HLGlobalPopup",
1275
+ setup(e) {
1276
+ let { isVisible: t, type: r, component: i, props: a, isLoading: o, close: c, confirm: l } = n();
1277
+ return (e, n) => (D(), s(Vt, {
1278
+ "model-value": F(t),
1279
+ type: F(r),
1280
+ component: F(i) || void 0,
1281
+ "component-props": F(a),
1282
+ "is-loading": F(o),
1283
+ onClose: F(c),
1284
+ onConfirm: F(l)
1285
+ }, null, 8, [
1286
+ "model-value",
1287
+ "type",
1288
+ "component",
1289
+ "component-props",
1290
+ "is-loading",
1291
+ "onClose",
1292
+ "onConfirm"
1293
+ ]));
1294
+ }
1295
+ }), Ut = {
1296
+ autoMount: !0,
1297
+ mountId: "hl-popup-host",
1298
+ componentName: "HLGlobalPopup"
1299
+ }, Wt = null, Gt = !1, Kt = () => typeof window < "u" && typeof document < "u", qt = (e, t) => {
1300
+ if (!Kt() || Wt !== null) return;
1301
+ let n = document.getElementById(t.mountId), r = n ?? document.createElement("div");
1302
+ n === null ? (r.id = t.mountId, document.body.appendChild(r), Gt = !0) : Gt = !1;
1303
+ let i = p(Ht);
1304
+ i.appContext = e._context, A(i, r), Wt = r;
1305
+ }, Jt = () => {
1306
+ Wt !== null && (A(null, Wt), Gt && Wt.parentNode !== null && Wt.parentNode.removeChild(Wt), Wt = null, Gt = !1);
1307
+ }, Yt = (e = {}) => {
1308
+ let t = {
1309
+ ...Ut,
1310
+ ...e
1311
+ };
1312
+ return { install(e) {
1313
+ e.component(t.componentName, Ht), t.autoMount && qt(e, t);
1314
+ } };
1315
+ }, Xt = { class: "relative" }, Zt = [
1316
+ "id",
1317
+ "disabled",
1318
+ "aria-expanded",
1319
+ "aria-controls",
1320
+ "aria-labelledby"
1321
+ ], Qt = {
1322
+ key: 0,
1323
+ class: "inline-flex min-w-0 items-center gap-1 truncate"
1324
+ }, $t = {
1325
+ key: 0,
1326
+ class: "text-xs text-muted"
1327
+ }, en = {
1328
+ key: 1,
1329
+ class: "truncate"
1330
+ }, tn = [
1331
+ "id",
1332
+ "aria-labelledby",
1333
+ "aria-activedescendant"
1334
+ ], nn = { class: "border-0 p-2" }, rn = {
1335
+ key: 0,
1336
+ class: "my-1 border-t border-solid border-gray-100"
1337
+ }, an = [
1338
+ "id",
1339
+ "data-option-index",
1340
+ "aria-selected",
1341
+ "disabled",
1342
+ "onMouseenter",
1343
+ "onClick"
1344
+ ], on = { class: "inline-flex items-center gap-2" }, sn = { class: "min-w-0" }, cn = { class: "block truncate leading-5" }, ln = {
1345
+ key: 0,
1346
+ class: "block truncate text-xs text-muted"
1347
+ }, un = {
1348
+ key: 1,
1349
+ class: "px-3 py-2 text-sm text-muted"
1350
+ }, dn = {
1351
+ key: 1,
1352
+ class: "mt-1 space-y-1"
1353
+ }, fn = {
1354
+ key: 0,
1355
+ class: "text-xs text-danger"
1356
+ }, pn = /* @__PURE__ */ h({
1357
+ __name: "HLSelect",
1358
+ props: /* @__PURE__ */ b({
1359
+ id: { default: "" },
1360
+ label: { default: "" },
1361
+ description: { default: "" },
1362
+ required: {
1363
+ type: Boolean,
1364
+ default: !1
1365
+ },
1366
+ disabled: {
1367
+ type: Boolean,
1368
+ default: !1
1369
+ },
1370
+ error: { default: "" },
1371
+ errors: { default: () => [] },
1372
+ placeholder: { default: "Select an option" },
1373
+ options: { default: () => [] },
1374
+ labelClass: { default: "" },
1375
+ inputClass: { default: "" },
1376
+ optionClass: { default: "" },
1377
+ size: { default: "md" },
1378
+ color: {},
1379
+ maxMenuHeight: { default: 280 },
1380
+ multiple: {
1381
+ type: Boolean,
1382
+ default: !1
1383
+ },
1384
+ maxVisiblePills: { default: 1 },
1385
+ allowCreateWhenNoMatch: {
1386
+ type: Boolean,
1387
+ default: !1
1388
+ },
1389
+ noBorder: {
1390
+ type: Boolean,
1391
+ default: !1
1392
+ }
1393
+ }, {
1394
+ modelValue: { default: null },
1395
+ modelModifiers: {}
1396
+ }),
1397
+ emits: /* @__PURE__ */ b([
1398
+ "change",
1399
+ "create",
1400
+ "open",
1401
+ "close"
1402
+ ], ["update:modelValue"]),
1403
+ setup(e, { expose: n, emit: a }) {
1404
+ let d = L(e, "modelValue"), f = a, m = k(null), h = k(null), g = k(null), _ = k(null), v = k(""), y = k([]), b = k(0), x = k(-1), { ACTION_REF: E, FLOATING_REF: te, isVisible: O, hide: A, show: M, toggle: ne, floatingStyles: re, updatePosition: ie } = t({ placement: "bottom-start" }), P = I(), ae = o(() => e.id || P), oe = o(() => `${ae.value}-listbox`), se = o(() => `${ae.value}-label`), ce = {
1405
+ xs: "h-[var(--hanaplabstoolkit-size-xs)] px-2 text-xs",
1406
+ sm: "h-[var(--hanaplabstoolkit-size-sm)] px-2.5 text-xs",
1407
+ md: "h-[var(--hanaplabstoolkit-size-md)] px-3 text-sm",
1408
+ lg: "h-[var(--hanaplabstoolkit-size-lg)] px-4 text-sm"
1409
+ }, le = {
1410
+ primary: "border-primary focus:border-primary",
1411
+ secondary: "border-secondary focus:border-secondary",
1412
+ tertiary: "border-tertiary focus:border-tertiary",
1413
+ success: "border-success focus:border-success",
1414
+ danger: "border-danger focus:border-danger",
1415
+ warning: "border-warning focus:border-warning",
1416
+ info: "border-info focus:border-info",
1417
+ light: "border-muted focus:border-secondary",
1418
+ dark: "border-dark focus:border-dark",
1419
+ muted: "border-muted focus:border-muted"
1420
+ }, z = {
1421
+ primary: "text-primary",
1422
+ secondary: "text-secondary",
1423
+ tertiary: "text-tertiary",
1424
+ success: "text-success",
1425
+ danger: "text-danger",
1426
+ warning: "text-warning",
1427
+ info: "text-info",
1428
+ light: "text-dark",
1429
+ dark: "text-dark",
1430
+ muted: "text-muted"
1431
+ }, ue = {
1432
+ primary: "bg-primary border-primary text-white",
1433
+ secondary: "bg-secondary border-secondary text-white",
1434
+ tertiary: "bg-tertiary border-tertiary text-dark",
1435
+ success: "bg-success border-success text-white",
1436
+ danger: "bg-danger border-danger text-white",
1437
+ warning: "bg-warning border-warning text-dark",
1438
+ info: "bg-info border-info text-white",
1439
+ light: "bg-light border-light text-dark",
1440
+ dark: "bg-dark border-dark text-white",
1441
+ muted: "bg-muted border-muted text-white"
1442
+ }, fe = {
1443
+ primary: "--hanaplabstoolkit-primary",
1444
+ secondary: "--hanaplabstoolkit-muted",
1445
+ tertiary: "--hanaplabstoolkit-tertiary",
1446
+ success: "--hanaplabstoolkit-success",
1447
+ danger: "--hanaplabstoolkit-danger",
1448
+ warning: "--hanaplabstoolkit-warning",
1449
+ info: "--hanaplabstoolkit-info",
1450
+ light: "--hanaplabstoolkit-muted",
1451
+ dark: "--hanaplabstoolkit-dark",
1452
+ muted: "--hanaplabstoolkit-muted"
1453
+ };
1454
+ function pe(e) {
1455
+ return typeof e == "string" && Object.prototype.hasOwnProperty.call(le, e);
1456
+ }
1457
+ function me(e) {
1458
+ return e instanceof HTMLElement ? e : e && "$el" in e && e.$el instanceof HTMLElement ? e.$el : null;
1459
+ }
1460
+ function he(e) {
1461
+ h.value = me(e), E(e);
1462
+ }
1463
+ function ge(e) {
1464
+ g.value = me(e), te(e);
1465
+ }
1466
+ function _e(e) {
1467
+ let t = me(e);
1468
+ if (!t) {
1469
+ _.value = null;
1470
+ return;
1471
+ }
1472
+ if (t instanceof HTMLInputElement) {
1473
+ _.value = t;
1474
+ return;
1475
+ }
1476
+ _.value = t.querySelector("input");
1477
+ }
1478
+ function B(e) {
1479
+ return Object.prototype.toString.call(e) === "[object Object]";
1480
+ }
1481
+ function ve(e, t) {
1482
+ if (e === t) return !0;
1483
+ if (Array.isArray(e) && Array.isArray(t)) return e.length === t.length ? e.every((e, n) => ve(e, t[n])) : !1;
1484
+ if (B(e) && B(t)) {
1485
+ let n = Object.keys(e), r = Object.keys(t);
1486
+ return n.length === r.length ? n.every((n) => ve(e[n], t[n])) : !1;
1487
+ }
1488
+ return !1;
1489
+ }
1490
+ function ye(e, t) {
1491
+ return Object.keys(t).every((n) => {
1492
+ if (!(n in e)) return !1;
1493
+ let r = e[n], i = t[n];
1494
+ return B(r) && B(i) ? ye(r, i) : ve(r, i);
1495
+ });
1496
+ }
1497
+ function be(e, t) {
1498
+ return ve(e, t) ? !0 : B(e) && B(t) ? ye(t, e) : !1;
1499
+ }
1500
+ function H(e) {
1501
+ return Array.isArray(e) ? `[${e.map((e) => H(e)).join(",")}]` : B(e) ? `{${Object.keys(e).sort().map((t) => `${t}:${H(e[t])}`).join(",")}}` : String(e);
1502
+ }
1503
+ function xe(e, t) {
1504
+ return `${e.label}-${H(e.value)}-${t}`;
1505
+ }
1506
+ function Se(e) {
1507
+ return `${oe.value}-option-${e}`;
1508
+ }
1509
+ let Ce = o(() => {
1510
+ let t = /* @__PURE__ */ new Map();
1511
+ for (let n of [...e.options, ...y.value]) t.set(H(n.value), n);
1512
+ return Array.from(t.values());
1513
+ }), we = o(() => e.multiple ? Array.isArray(d.value) ? d.value : [] : d.value === null ? [] : [d.value]), U = o(() => Ce.value.filter((e) => we.value.some((t) => be(e.value, t)))), Te = o(() => Number.isFinite(e.maxVisiblePills) ? Math.max(0, Math.floor(e.maxVisiblePills)) : 1), Ee = o(() => e.multiple ? U.value.slice(0, Te.value) : []), De = o(() => e.multiple ? Math.max(0, U.value.length - Ee.value.length) : 0), Oe = o(() => we.value.length > 0), ke = o(() => !!e.error || e.errors.length > 0), Ae = o(() => e.multiple ? U.value.length === 0 ? e.placeholder : U.value.length === 1 ? U.value[0].label : `${U.value.length} selected` : U.value[0]?.label ?? e.placeholder), je = o(() => ce[e.size]), Me = o(() => {
1514
+ let e = v.value.trim().toLowerCase();
1515
+ return e ? Ce.value.filter((t) => t.label.toLowerCase().includes(e)) : Ce.value;
1516
+ }), W = o(() => {
1517
+ if (!e.multiple) return Me.value;
1518
+ let t = [], n = [];
1519
+ for (let e of Me.value) q(e) ? t.push(e) : n.push(e);
1520
+ return [...t, ...n];
1521
+ }), Ne = o(() => {
1522
+ if (!e.multiple) return -1;
1523
+ let t = W.value.filter((e) => q(e)).length;
1524
+ return t > 0 && t < W.value.length ? t : -1;
1525
+ }), G = o(() => ({
1526
+ ...re.value,
1527
+ width: b.value > 0 ? `${b.value}px` : void 0,
1528
+ maxHeight: `${e.maxMenuHeight}px`,
1529
+ zIndex: 60
1530
+ })), K = o(() => {
1531
+ let t = v.value.trim();
1532
+ return !e.allowCreateWhenNoMatch || !t || Me.value.length > 0 ? !1 : !Ce.value.some((e) => e.label.toLowerCase() === t.toLowerCase());
1533
+ }), Pe = o(() => {
1534
+ if (!(x.value < 0) && !(x.value >= W.value.length)) return Se(x.value);
1535
+ }), Fe = o(() => pe(e.color) ? le[e.color] : "border-gray-200 focus:border-gray-200"), Ie = o(() => pe(e.color) ? z[e.color] : "text-dark"), Le = o(() => pe(e.color) ? ue[e.color] : "border-dark bg-dark text-white"), ze = o(() => pe(e.color) ? ue[e.color] : "border-light bg-light text-dark"), Be = o(() => {
1536
+ if (!pe(e.color)) return {
1537
+ "--hl-select-option-hover-bg": "#f9fafb",
1538
+ "--hl-select-option-highlight-bg": "#f3f4f6"
1539
+ };
1540
+ let t = fe[e.color];
1541
+ return {
1542
+ "--hl-select-option-hover-bg": `color-mix(in srgb, var(${t}) 10%, white)`,
1543
+ "--hl-select-option-highlight-bg": `color-mix(in srgb, var(${t}) 16%, white)`
1544
+ };
1545
+ });
1546
+ function q(e) {
1547
+ return we.value.some((t) => be(e.value, t));
1548
+ }
1549
+ function Ve(e) {
1550
+ d.value = e, f("change", e);
1551
+ }
1552
+ function He() {
1553
+ let e = [];
1554
+ return W.value.forEach((t, n) => {
1555
+ t.disabled || e.push(n);
1556
+ }), e;
1557
+ }
1558
+ function Ue() {
1559
+ if (!g.value || x.value < 0) return;
1560
+ let e = `[data-option-index="${x.value}"]`, t = g.value.querySelector(e);
1561
+ t instanceof HTMLElement && t.scrollIntoView({ block: "nearest" });
1562
+ }
1563
+ function J(e) {
1564
+ x.value = e, S(() => {
1565
+ Ue();
1566
+ });
1567
+ }
1568
+ function We() {
1569
+ let e = He();
1570
+ if (e.length === 0) {
1571
+ J(-1);
1572
+ return;
1573
+ }
1574
+ let t = W.value.findIndex((e) => !e.disabled && q(e));
1575
+ J(t >= 0 ? t : e[0]);
1576
+ }
1577
+ function Ge(e) {
1578
+ let t = He();
1579
+ if (t.length === 0) {
1580
+ J(-1);
1581
+ return;
1582
+ }
1583
+ if (x.value < 0) {
1584
+ J(e === 1 ? t[0] : t[t.length - 1]);
1585
+ return;
1586
+ }
1587
+ let n = t.indexOf(x.value);
1588
+ if (n < 0) {
1589
+ J(e === 1 ? t[0] : t[t.length - 1]);
1590
+ return;
1591
+ }
1592
+ J(t[(n + e + t.length) % t.length]);
1593
+ }
1594
+ function Ke() {
1595
+ if (x.value < 0) return;
1596
+ let e = W.value[x.value];
1597
+ !e || e.disabled || qe(e);
1598
+ }
1599
+ function qe(t) {
1600
+ if (!(t.disabled || e.disabled)) {
1601
+ if (e.multiple) {
1602
+ let e = Array.isArray(d.value) ? [...d.value] : [];
1603
+ Ve(e.some((e) => be(t.value, e)) ? e.filter((e) => !be(t.value, e)) : [...e, t.value]);
1604
+ return;
1605
+ }
1606
+ Ve(t.value), A();
1607
+ }
1608
+ }
1609
+ function Je() {
1610
+ Ve(e.multiple ? [] : null), v.value = "", A();
1611
+ }
1612
+ function Ye(e) {
1613
+ return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
1614
+ }
1615
+ function Xe() {
1616
+ let t = v.value.trim();
1617
+ if (!t || !K.value) return;
1618
+ let n = {
1619
+ label: t,
1620
+ value: Ye(t) || t.toLowerCase()
1621
+ }, r = {
1622
+ label: t,
1623
+ value: n
1624
+ };
1625
+ if (y.value = [...y.value, r], f("create", n), e.multiple) {
1626
+ Ve([...Array.isArray(d.value) ? [...d.value] : [], n]), v.value = "";
1627
+ return;
1628
+ }
1629
+ Ve(n), v.value = "", A();
1630
+ }
1631
+ function Ze() {
1632
+ b.value = h.value?.offsetWidth ?? 0;
1633
+ }
1634
+ function $e() {
1635
+ e.disabled || ne();
1636
+ }
1637
+ function et(t) {
1638
+ if (!e.disabled) {
1639
+ if (t.key === "Escape") {
1640
+ A();
1641
+ return;
1642
+ }
1643
+ if (t.key === "ArrowDown") {
1644
+ if (t.preventDefault(), !O.value) {
1645
+ M();
1646
+ return;
1647
+ }
1648
+ Ge(1);
1649
+ return;
1650
+ }
1651
+ if (t.key === "ArrowUp") {
1652
+ if (t.preventDefault(), !O.value) {
1653
+ M();
1654
+ return;
1655
+ }
1656
+ Ge(-1);
1657
+ return;
1658
+ }
1659
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), ne());
1660
+ }
1661
+ }
1662
+ function tt(e) {
1663
+ if (e.key === "ArrowDown") {
1664
+ e.preventDefault(), Ge(1);
1665
+ return;
1666
+ }
1667
+ if (e.key === "ArrowUp") {
1668
+ e.preventDefault(), Ge(-1);
1669
+ return;
1670
+ }
1671
+ if (e.key === "Enter") {
1672
+ if (e.preventDefault(), x.value >= 0) {
1673
+ Ke();
1674
+ return;
1675
+ }
1676
+ K.value && Xe();
1677
+ return;
1678
+ }
1679
+ e.key === "Escape" && (e.preventDefault(), A());
1680
+ }
1681
+ function nt(e) {
1682
+ if (!O.value) return;
1683
+ let t = e.target;
1684
+ t instanceof Node && (g.value?.contains(t) ?? !1) && tt(e);
1685
+ }
1686
+ function rt(e) {
1687
+ W.value[e]?.disabled || J(e);
1688
+ }
1689
+ function it(e) {
1690
+ let t = e.target, n = m.value?.contains(t) ?? !1, r = g.value?.contains(t) ?? !1;
1691
+ !n && !r && A();
1692
+ }
1693
+ return n({ clearSelection: Je }), R(() => e.disabled, (e) => {
1694
+ e && A();
1695
+ }), R(O, async (e) => {
1696
+ if (e) {
1697
+ f("open"), await S(), Ze(), await ie(), We(), _.value?.focus({ preventScroll: !0 });
1698
+ return;
1699
+ }
1700
+ f("close"), v.value = "", x.value = -1;
1701
+ }), R(W, () => {
1702
+ if (O.value) {
1703
+ if (x.value < 0 || x.value >= W.value.length || W.value[x.value]?.disabled) {
1704
+ We();
1705
+ return;
1706
+ }
1707
+ S(() => {
1708
+ Ue();
1709
+ });
1710
+ }
1711
+ }), T(() => {
1712
+ Ze(), window.addEventListener("resize", Ze), document.addEventListener("pointerdown", it), document.addEventListener("keydown", nt, !0);
1713
+ }), ee(() => {
1714
+ window.removeEventListener("resize", Ze), document.removeEventListener("pointerdown", it), document.removeEventListener("keydown", nt, !0);
1715
+ }), (t, n) => (D(), l("div", {
1716
+ ref_key: "rootRef",
1717
+ ref: m,
1718
+ class: "w-full hanaplabstoolkit-font"
1719
+ }, [
1720
+ e.label || e.description ? (D(), s(Re, {
1721
+ key: 0,
1722
+ label: e.label,
1723
+ description: e.description,
1724
+ "label-id": e.label ? se.value : "",
1725
+ required: e.required,
1726
+ "label-class": e.labelClass
1727
+ }, null, 8, [
1728
+ "label",
1729
+ "description",
1730
+ "label-id",
1731
+ "required",
1732
+ "label-class"
1733
+ ])) : c("", !0),
1734
+ u("div", Xt, [
1735
+ u("button", {
1736
+ id: ae.value,
1737
+ ref: he,
1738
+ type: "button",
1739
+ class: C(["flex w-full items-center gap-2 border border-solid bg-transparent text-left leading-tight transition-colors duration-150 hl-no-focus-ring disabled:cursor-not-allowed disabled:opacity-60 rounded-md cursor-pointer", [
1740
+ je.value,
1741
+ e.inputClass,
1742
+ ke.value ? "border-danger focus:border-danger" : Fe.value,
1743
+ {
1744
+ "text-dark": Oe.value,
1745
+ "text-muted": !Oe.value,
1746
+ "pr-10": Oe.value,
1747
+ "pr-8": !Oe.value,
1748
+ "border-0 focus:border-0": e.noBorder
1749
+ }
1750
+ ]]),
1751
+ disabled: e.disabled,
1752
+ "aria-expanded": F(O),
1753
+ "aria-controls": oe.value,
1754
+ "aria-labelledby": e.label ? se.value : void 0,
1755
+ "aria-haspopup": "listbox",
1756
+ onClick: $e,
1757
+ onKeydown: et
1758
+ }, [e.multiple && U.value.length > 0 ? (D(), l("span", Qt, [(D(!0), l(r, null, j(Ee.value, (e, t) => (D(), l("span", {
1759
+ key: xe(e, t),
1760
+ class: C(["inline-flex max-w-[110px] truncate rounded border border-solid px-1.5 py-0.5 text-xs", ze.value])
1761
+ }, N(e.label), 3))), 128)), De.value > 0 ? (D(), l("span", $t, " +" + N(De.value) + " more ", 1)) : c("", !0)])) : (D(), l("span", en, N(Ae.value), 1))], 42, Zt),
1762
+ Oe.value && !e.disabled ? (D(), l("button", {
1763
+ key: 0,
1764
+ type: "button",
1765
+ class: "absolute inset-y-0 right-6 my-auto px-1 text-muted hover:text-dark appearance-none border-0 bg-transparent hl-no-focus-ring cursor-pointer",
1766
+ "aria-label": "Clear selection",
1767
+ onClick: de(Je, ["stop"])
1768
+ }, [p(V, {
1769
+ name: "x-mark",
1770
+ size: 14,
1771
+ decorative: !0
1772
+ })])) : c("", !0),
1773
+ u("span", { class: C(["pointer-events-none absolute inset-y-0 right-2 my-auto flex items-center text-muted transition-transform duration-150", { "rotate-180": F(O) }]) }, [p(V, {
1774
+ name: "chevron-up-down",
1775
+ size: 20,
1776
+ decorative: !0
1777
+ })], 2),
1778
+ (D(), s(i, { to: "body" }, [F(O) ? (D(), l("div", {
1779
+ key: 0,
1780
+ ref: ge,
1781
+ class: "overflow-hidden rounded-md bg-white border border-gray-200 border-solid shadow-none",
1782
+ style: w(G.value),
1783
+ id: oe.value,
1784
+ role: "listbox",
1785
+ "aria-labelledby": ae.value,
1786
+ "aria-activedescendant": Pe.value
1787
+ }, [u("div", nn, [p(Qe, {
1788
+ ref: _e,
1789
+ modelValue: v.value,
1790
+ "onUpdate:modelValue": n[0] ||= (e) => v.value = e,
1791
+ type: "search",
1792
+ placeholder: "Search...",
1793
+ disabled: e.disabled
1794
+ }, null, 8, ["modelValue", "disabled"])]), u("div", {
1795
+ class: "overflow-y-auto py-1",
1796
+ style: w({ maxHeight: `${e.maxMenuHeight}px` })
1797
+ }, [W.value.length > 0 ? (D(!0), l(r, { key: 0 }, j(W.value, (t, n) => (D(), l(r, { key: xe(t, n) }, [Ne.value >= 0 && n === Ne.value ? (D(), l("div", rn)) : c("", !0), u("button", {
1798
+ type: "button",
1799
+ id: Se(n),
1800
+ "data-option-index": n,
1801
+ class: C(["flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-sm transition-colors appearance-none border-0 bg-white hl-no-focus-ring", [
1802
+ e.optionClass,
1803
+ {
1804
+ "cursor-not-allowed text-muted": t.disabled,
1805
+ "cursor-pointer": !t.disabled,
1806
+ "text-dark": !t.disabled && !q(t),
1807
+ "font-medium": q(t),
1808
+ "hover:bg-[var(--hl-select-option-hover-bg)]": !t.disabled
1809
+ },
1810
+ !t.disabled && q(t) ? Ie.value : ""
1811
+ ]]),
1812
+ style: w([Be.value, !t.disabled && x.value === n ? { backgroundColor: "var(--hl-select-option-highlight-bg)" } : void 0]),
1813
+ "aria-selected": q(t),
1814
+ disabled: t.disabled,
1815
+ onMouseenter: (e) => rt(n),
1816
+ onClick: (e) => qe(t)
1817
+ }, [u("span", on, [e.multiple ? (D(), l("span", {
1818
+ key: 0,
1819
+ class: C(["inline-flex size-4 items-center justify-center rounded border border-solid text-[10px]", q(t) ? Le.value : "border-gray-300"])
1820
+ }, [q(t) ? (D(), s(V, {
1821
+ key: 0,
1822
+ name: "check",
1823
+ size: 10,
1824
+ decorative: !0
1825
+ })) : c("", !0)], 2)) : c("", !0), u("span", sn, [u("span", cn, N(t.label), 1), t.description ? (D(), l("span", ln, N(t.description), 1)) : c("", !0)])]), q(t) && !e.multiple ? (D(), l("span", {
1826
+ key: 0,
1827
+ class: C(["shrink-0 text-xs", Ie.value])
1828
+ }, [p(V, {
1829
+ name: "check",
1830
+ size: 14,
1831
+ decorative: !0
1832
+ })], 2)) : c("", !0)], 46, an)], 64))), 128)) : (D(), l("p", un, N(v.value.trim() ? "No matches found" : "No options available"), 1)), K.value ? (D(), l("button", {
1833
+ key: 2,
1834
+ type: "button",
1835
+ class: "mx-2 mb-2 flex w-[calc(100%-1rem)] items-center justify-between rounded-md border-0 bg-transparent px-3 py-2 text-left text-sm text-dark appearance-none hl-no-focus-ring",
1836
+ onClick: Xe
1837
+ }, [u("span", null, "Add \"" + N(v.value.trim()) + "\"", 1), p(V, {
1838
+ name: "plus",
1839
+ size: 14,
1840
+ decorative: !0
1841
+ })])) : c("", !0)], 4)], 12, tn)) : c("", !0)]))
1842
+ ]),
1843
+ ke.value ? (D(), l("div", dn, [e.error ? (D(), l("p", fn, N(e.error), 1)) : c("", !0), (D(!0), l(r, null, j(e.errors, (e) => (D(), l("p", {
1844
+ key: e,
1845
+ class: "text-xs text-danger"
1846
+ }, N(e), 1))), 128))])) : c("", !0)
1847
+ ], 512));
1848
+ }
1849
+ }), mn = /* @__PURE__ */ h({
1850
+ __name: "HLSkeleton",
1851
+ props: { class: { default: "" } },
1852
+ setup(e) {
1853
+ return (t, n) => (D(), l("div", { class: C(["animate-pulse rounded-lg bg-tertiary", e.class]) }, null, 2));
1854
+ }
1855
+ }), hn = { class: "space-y-3 rounded-xl border border-solid border-tertiary bg-light p-3 hanaplabstoolkit-font" }, gn = {
1856
+ key: 0,
1857
+ class: "flex flex-wrap items-center justify-between gap-3"
1858
+ }, _n = { class: "relative overflow-x-auto" }, vn = {
1859
+ class: "inline-flex min-w-full justify-start gap-2 rounded-xl border border-solid border-tertiary bg-secondary p-1",
1860
+ role: "tablist",
1861
+ "aria-label": "Tabs"
1862
+ }, yn = [
1863
+ "id",
1864
+ "aria-selected",
1865
+ "aria-controls",
1866
+ "disabled",
1867
+ "onClick"
1868
+ ], bn = ["id", "aria-labelledby"], xn = /* @__PURE__ */ h({
1869
+ __name: "HLTabs",
1870
+ props: /* @__PURE__ */ b({ items: { default: () => [] } }, {
1871
+ active: { default: "" },
1872
+ activeModifiers: {}
1873
+ }),
1874
+ emits: /* @__PURE__ */ b(["tabs:change"], ["update:active"]),
1875
+ setup(e, { emit: t }) {
1876
+ let n = L(e, "active"), i = t, a = o(() => e.items.filter((e) => !e.disabled)), d = o({
1877
+ get: () => n.value ?? "",
1878
+ set: (e) => {
1879
+ n.value !== e && (n.value = e, i("tabs:change", e));
1880
+ }
1881
+ }), p = I().replace(/:/g, ""), m = o(() => `hl-tabs-${p}`), h = o(() => _(d.value));
1882
+ le(() => {
1883
+ if (!a.value.length) {
1884
+ d.value = "";
1885
+ return;
1886
+ }
1887
+ a.value.some((e) => e.value === d.value) || (d.value = a.value[0].value);
1888
+ });
1889
+ function g(t) {
1890
+ let n = e.items.find((e) => e.value === t);
1891
+ !n || n.disabled || (d.value = t);
1892
+ }
1893
+ function _(e) {
1894
+ return `${m.value}-tab-${e}`;
1895
+ }
1896
+ function v(e) {
1897
+ return `${m.value}-panel-${e}`;
1898
+ }
1899
+ return (t, n) => (D(), l("div", hn, [
1900
+ t.$slots.header ? (D(), l("div", gn, [M(t.$slots, "header")])) : c("", !0),
1901
+ u("div", _n, [u("div", vn, [(D(!0), l(r, null, j(e.items, (e) => (D(), l("button", {
1902
+ id: _(e.value),
1903
+ key: e.value,
1904
+ type: "button",
1905
+ role: "tab",
1906
+ class: C(["relative inline-flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-semibold hl-color-transition hl-no-focus-ring", e.disabled ? "cursor-not-allowed opacity-50" : d.value === e.value ? "bg-primary text-light" : "cursor-pointer text-muted hover:bg-tertiary hover:text-dark"]),
1907
+ "aria-selected": d.value === e.value,
1908
+ "aria-controls": v(e.value),
1909
+ disabled: e.disabled,
1910
+ onClick: (t) => g(e.value)
1911
+ }, [
1912
+ u("span", { class: C(["size-2 rounded-full", d.value === e.value ? "bg-light" : "bg-muted"]) }, null, 2),
1913
+ e.icon ? (D(), s(V, {
1914
+ key: 0,
1915
+ name: e.icon,
1916
+ class: "size-4",
1917
+ decorative: !0
1918
+ }, null, 8, ["name"])) : c("", !0),
1919
+ f(" " + N(e.label), 1)
1920
+ ], 10, yn))), 128))])]),
1921
+ d.value ? (D(), l("div", {
1922
+ key: 1,
1923
+ id: v(d.value),
1924
+ role: "tabpanel",
1925
+ "aria-labelledby": h.value,
1926
+ class: "px-1"
1927
+ }, [M(t.$slots, "default", { active: d.value })], 8, bn)) : c("", !0)
1928
+ ]));
1929
+ }
1930
+ });
1931
+ //#endregion
1932
+ //#region node_modules/@tanstack/table-core/build/lib/index.mjs
1933
+ function Sn() {
1934
+ return {
1935
+ accessor: (e, t) => typeof e == "function" ? {
1936
+ ...t,
1937
+ accessorFn: e
1938
+ } : {
1939
+ ...t,
1940
+ accessorKey: e
1941
+ },
1942
+ display: (e) => e,
1943
+ group: (e) => e
1944
+ };
1945
+ }
1946
+ function Cn(e, t) {
1947
+ return typeof e == "function" ? e(t) : e;
1948
+ }
1949
+ function Y(e, t) {
1950
+ return (n) => {
1951
+ t.setState((t) => ({
1952
+ ...t,
1953
+ [e]: Cn(n, t[e])
1954
+ }));
1955
+ };
1956
+ }
1957
+ function wn(e) {
1958
+ return e instanceof Function;
1959
+ }
1960
+ function Tn(e) {
1961
+ return Array.isArray(e) && e.every((e) => typeof e == "number");
1962
+ }
1963
+ function En(e, t) {
1964
+ let n = [], r = (e) => {
1965
+ e.forEach((e) => {
1966
+ n.push(e);
1967
+ let i = t(e);
1968
+ i != null && i.length && r(i);
1969
+ });
1970
+ };
1971
+ return r(e), n;
1972
+ }
1973
+ function X(e, t, n) {
1974
+ let r = [], i;
1975
+ return (a) => {
1976
+ let o;
1977
+ n.key && n.debug && (o = Date.now());
1978
+ let s = e(a);
1979
+ if (!(s.length !== r.length || s.some((e, t) => r[t] !== e))) return i;
1980
+ r = s;
1981
+ let c;
1982
+ if (n.key && n.debug && (c = Date.now()), i = t(...s), n == null || n.onChange == null || n.onChange(i), n.key && n.debug && n != null && n.debug()) {
1983
+ let e = Math.round((Date.now() - o) * 100) / 100, t = Math.round((Date.now() - c) * 100) / 100, r = t / 16, i = (e, t) => {
1984
+ for (e = String(e); e.length < t;) e = " " + e;
1985
+ return e;
1986
+ };
1987
+ console.info(`%c⏱ ${i(t, 5)} /${i(e, 5)} ms`, `
1988
+ font-size: .6rem;
1989
+ font-weight: bold;
1990
+ color: hsl(${Math.max(0, Math.min(120 - 120 * r, 120))}deg 100% 31%);`, n?.key);
1991
+ }
1992
+ return i;
1993
+ };
1994
+ }
1995
+ function Z(e, t, n, r) {
1996
+ return {
1997
+ debug: () => e?.debugAll ?? e[t],
1998
+ key: process.env.NODE_ENV === "development" && n,
1999
+ onChange: r
2000
+ };
2001
+ }
2002
+ function Dn(e, t, n, r) {
2003
+ let i = {
2004
+ id: `${t.id}_${n.id}`,
2005
+ row: t,
2006
+ column: n,
2007
+ getValue: () => t.getValue(r),
2008
+ renderValue: () => i.getValue() ?? e.options.renderFallbackValue,
2009
+ getContext: X(() => [
2010
+ e,
2011
+ n,
2012
+ t,
2013
+ i
2014
+ ], (e, t, n, r) => ({
2015
+ table: e,
2016
+ column: t,
2017
+ row: n,
2018
+ cell: r,
2019
+ getValue: r.getValue,
2020
+ renderValue: r.renderValue
2021
+ }), Z(e.options, "debugCells", "cell.getContext"))
2022
+ };
2023
+ return e._features.forEach((r) => {
2024
+ r.createCell == null || r.createCell(i, n, t, e);
2025
+ }, {}), i;
2026
+ }
2027
+ function On(e, t, n, r) {
2028
+ let i = {
2029
+ ...e._getDefaultColumnDef(),
2030
+ ...t
2031
+ }, a = i.accessorKey, o = i.id ?? (a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) ?? (typeof i.header == "string" ? i.header : void 0), s;
2032
+ if (i.accessorFn ? s = i.accessorFn : a && (s = a.includes(".") ? (e) => {
2033
+ let t = e;
2034
+ for (let e of a.split(".")) t = t?.[e], process.env.NODE_ENV !== "production" && t === void 0 && console.warn(`"${e}" in deeply nested key "${a}" returned undefined.`);
2035
+ return t;
2036
+ } : (e) => e[i.accessorKey]), !o) throw process.env.NODE_ENV === "production" ? Error() : Error(i.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header");
2037
+ let c = {
2038
+ id: `${String(o)}`,
2039
+ accessorFn: s,
2040
+ parent: r,
2041
+ depth: n,
2042
+ columnDef: i,
2043
+ columns: [],
2044
+ getFlatColumns: X(() => [!0], () => [c, ...c.columns?.flatMap((e) => e.getFlatColumns())], Z(e.options, "debugColumns", "column.getFlatColumns")),
2045
+ getLeafColumns: X(() => [e._getOrderColumnsFn()], (e) => {
2046
+ var t;
2047
+ return (t = c.columns) != null && t.length ? e(c.columns.flatMap((e) => e.getLeafColumns())) : [c];
2048
+ }, Z(e.options, "debugColumns", "column.getLeafColumns"))
2049
+ };
2050
+ for (let t of e._features) t.createColumn == null || t.createColumn(c, e);
2051
+ return c;
2052
+ }
2053
+ var Q = "debugHeaders";
2054
+ function kn(e, t, n) {
2055
+ let r = {
2056
+ id: n.id ?? t.id,
2057
+ column: t,
2058
+ index: n.index,
2059
+ isPlaceholder: !!n.isPlaceholder,
2060
+ placeholderId: n.placeholderId,
2061
+ depth: n.depth,
2062
+ subHeaders: [],
2063
+ colSpan: 0,
2064
+ rowSpan: 0,
2065
+ headerGroup: null,
2066
+ getLeafHeaders: () => {
2067
+ let e = [], t = (n) => {
2068
+ n.subHeaders && n.subHeaders.length && n.subHeaders.map(t), e.push(n);
2069
+ };
2070
+ return t(r), e;
2071
+ },
2072
+ getContext: () => ({
2073
+ table: e,
2074
+ header: r,
2075
+ column: t
2076
+ })
2077
+ };
2078
+ return e._features.forEach((t) => {
2079
+ t.createHeader == null || t.createHeader(r, e);
2080
+ }), r;
2081
+ }
2082
+ var An = { createTable: (e) => {
2083
+ e.getHeaderGroups = X(() => [
2084
+ e.getAllColumns(),
2085
+ e.getVisibleLeafColumns(),
2086
+ e.getState().columnPinning.left,
2087
+ e.getState().columnPinning.right
2088
+ ], (t, n, r, i) => {
2089
+ let a = r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], o = i?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], s = n.filter((e) => !(r != null && r.includes(e.id)) && !(i != null && i.includes(e.id)));
2090
+ return jn(t, [
2091
+ ...a,
2092
+ ...s,
2093
+ ...o
2094
+ ], e);
2095
+ }, Z(e.options, Q, "getHeaderGroups")), e.getCenterHeaderGroups = X(() => [
2096
+ e.getAllColumns(),
2097
+ e.getVisibleLeafColumns(),
2098
+ e.getState().columnPinning.left,
2099
+ e.getState().columnPinning.right
2100
+ ], (t, n, r, i) => (n = n.filter((e) => !(r != null && r.includes(e.id)) && !(i != null && i.includes(e.id))), jn(t, n, e, "center")), Z(e.options, Q, "getCenterHeaderGroups")), e.getLeftHeaderGroups = X(() => [
2101
+ e.getAllColumns(),
2102
+ e.getVisibleLeafColumns(),
2103
+ e.getState().columnPinning.left
2104
+ ], (t, n, r) => jn(t, r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], e, "left"), Z(e.options, Q, "getLeftHeaderGroups")), e.getRightHeaderGroups = X(() => [
2105
+ e.getAllColumns(),
2106
+ e.getVisibleLeafColumns(),
2107
+ e.getState().columnPinning.right
2108
+ ], (t, n, r) => jn(t, r?.map((e) => n.find((t) => t.id === e)).filter(Boolean) ?? [], e, "right"), Z(e.options, Q, "getRightHeaderGroups")), e.getFooterGroups = X(() => [e.getHeaderGroups()], (e) => [...e].reverse(), Z(e.options, Q, "getFooterGroups")), e.getLeftFooterGroups = X(() => [e.getLeftHeaderGroups()], (e) => [...e].reverse(), Z(e.options, Q, "getLeftFooterGroups")), e.getCenterFooterGroups = X(() => [e.getCenterHeaderGroups()], (e) => [...e].reverse(), Z(e.options, Q, "getCenterFooterGroups")), e.getRightFooterGroups = X(() => [e.getRightHeaderGroups()], (e) => [...e].reverse(), Z(e.options, Q, "getRightFooterGroups")), e.getFlatHeaders = X(() => [e.getHeaderGroups()], (e) => e.map((e) => e.headers).flat(), Z(e.options, Q, "getFlatHeaders")), e.getLeftFlatHeaders = X(() => [e.getLeftHeaderGroups()], (e) => e.map((e) => e.headers).flat(), Z(e.options, Q, "getLeftFlatHeaders")), e.getCenterFlatHeaders = X(() => [e.getCenterHeaderGroups()], (e) => e.map((e) => e.headers).flat(), Z(e.options, Q, "getCenterFlatHeaders")), e.getRightFlatHeaders = X(() => [e.getRightHeaderGroups()], (e) => e.map((e) => e.headers).flat(), Z(e.options, Q, "getRightFlatHeaders")), e.getCenterLeafHeaders = X(() => [e.getCenterFlatHeaders()], (e) => e.filter((e) => {
2109
+ var t;
2110
+ return !((t = e.subHeaders) != null && t.length);
2111
+ }), Z(e.options, Q, "getCenterLeafHeaders")), e.getLeftLeafHeaders = X(() => [e.getLeftFlatHeaders()], (e) => e.filter((e) => {
2112
+ var t;
2113
+ return !((t = e.subHeaders) != null && t.length);
2114
+ }), Z(e.options, Q, "getLeftLeafHeaders")), e.getRightLeafHeaders = X(() => [e.getRightFlatHeaders()], (e) => e.filter((e) => {
2115
+ var t;
2116
+ return !((t = e.subHeaders) != null && t.length);
2117
+ }), Z(e.options, Q, "getRightLeafHeaders")), e.getLeafHeaders = X(() => [
2118
+ e.getLeftHeaderGroups(),
2119
+ e.getCenterHeaderGroups(),
2120
+ e.getRightHeaderGroups()
2121
+ ], (e, t, n) => [
2122
+ ...e[0]?.headers ?? [],
2123
+ ...t[0]?.headers ?? [],
2124
+ ...n[0]?.headers ?? []
2125
+ ].map((e) => e.getLeafHeaders()).flat(), Z(e.options, Q, "getLeafHeaders"));
2126
+ } };
2127
+ function jn(e, t, n, r) {
2128
+ let i = 0, a = function(e, t) {
2129
+ t === void 0 && (t = 1), i = Math.max(i, t), e.filter((e) => e.getIsVisible()).forEach((e) => {
2130
+ var n;
2131
+ (n = e.columns) != null && n.length && a(e.columns, t + 1);
2132
+ }, 0);
2133
+ };
2134
+ a(e);
2135
+ let o = [], s = (e, t) => {
2136
+ let i = {
2137
+ depth: t,
2138
+ id: [r, `${t}`].filter(Boolean).join("_"),
2139
+ headers: []
2140
+ }, a = [];
2141
+ e.forEach((e) => {
2142
+ let o = [...a].reverse()[0], s = e.column.depth === i.depth, c, l = !1;
2143
+ if (s && e.column.parent ? c = e.column.parent : (c = e.column, l = !0), o && o?.column === c) o.subHeaders.push(e);
2144
+ else {
2145
+ let i = kn(n, c, {
2146
+ id: [
2147
+ r,
2148
+ t,
2149
+ c.id,
2150
+ e?.id
2151
+ ].filter(Boolean).join("_"),
2152
+ isPlaceholder: l,
2153
+ placeholderId: l ? `${a.filter((e) => e.column === c).length}` : void 0,
2154
+ depth: t,
2155
+ index: a.length
2156
+ });
2157
+ i.subHeaders.push(e), a.push(i);
2158
+ }
2159
+ i.headers.push(e), e.headerGroup = i;
2160
+ }), o.push(i), t > 0 && s(a, t - 1);
2161
+ };
2162
+ s(t.map((e, t) => kn(n, e, {
2163
+ depth: i,
2164
+ index: t
2165
+ })), i - 1), o.reverse();
2166
+ let c = (e) => e.filter((e) => e.column.getIsVisible()).map((e) => {
2167
+ let t = 0, n = 0, r = [0];
2168
+ e.subHeaders && e.subHeaders.length ? (r = [], c(e.subHeaders).forEach((e) => {
2169
+ let { colSpan: n, rowSpan: i } = e;
2170
+ t += n, r.push(i);
2171
+ })) : t = 1;
2172
+ let i = Math.min(...r);
2173
+ return n += i, e.colSpan = t, e.rowSpan = n, {
2174
+ colSpan: t,
2175
+ rowSpan: n
2176
+ };
2177
+ });
2178
+ return c(o[0]?.headers ?? []), o;
2179
+ }
2180
+ var Mn = (e, t, n, r, i, a, o) => {
2181
+ let s = {
2182
+ id: t,
2183
+ index: r,
2184
+ original: n,
2185
+ depth: i,
2186
+ parentId: o,
2187
+ _valuesCache: {},
2188
+ _uniqueValuesCache: {},
2189
+ getValue: (t) => {
2190
+ if (s._valuesCache.hasOwnProperty(t)) return s._valuesCache[t];
2191
+ let n = e.getColumn(t);
2192
+ if (n != null && n.accessorFn) return s._valuesCache[t] = n.accessorFn(s.original, r), s._valuesCache[t];
2193
+ },
2194
+ getUniqueValues: (t) => {
2195
+ if (s._uniqueValuesCache.hasOwnProperty(t)) return s._uniqueValuesCache[t];
2196
+ let n = e.getColumn(t);
2197
+ if (n != null && n.accessorFn) return n.columnDef.getUniqueValues ? (s._uniqueValuesCache[t] = n.columnDef.getUniqueValues(s.original, r), s._uniqueValuesCache[t]) : (s._uniqueValuesCache[t] = [s.getValue(t)], s._uniqueValuesCache[t]);
2198
+ },
2199
+ renderValue: (t) => s.getValue(t) ?? e.options.renderFallbackValue,
2200
+ subRows: a ?? [],
2201
+ getLeafRows: () => En(s.subRows, (e) => e.subRows),
2202
+ getParentRow: () => s.parentId ? e.getRow(s.parentId, !0) : void 0,
2203
+ getParentRows: () => {
2204
+ let e = [], t = s;
2205
+ for (;;) {
2206
+ let n = t.getParentRow();
2207
+ if (!n) break;
2208
+ e.push(n), t = n;
2209
+ }
2210
+ return e.reverse();
2211
+ },
2212
+ getAllCells: X(() => [e.getAllLeafColumns()], (t) => t.map((t) => Dn(e, s, t, t.id)), Z(e.options, "debugRows", "getAllCells")),
2213
+ _getAllCellsByColumnId: X(() => [s.getAllCells()], (e) => e.reduce((e, t) => (e[t.column.id] = t, e), {}), Z(e.options, "debugRows", "getAllCellsByColumnId"))
2214
+ };
2215
+ for (let t = 0; t < e._features.length; t++) {
2216
+ let n = e._features[t];
2217
+ n == null || n.createRow == null || n.createRow(s, e);
2218
+ }
2219
+ return s;
2220
+ }, Nn = { createColumn: (e, t) => {
2221
+ e._getFacetedRowModel = t.options.getFacetedRowModel && t.options.getFacetedRowModel(t, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : t.getPreFilteredRowModel(), e._getFacetedUniqueValues = t.options.getFacetedUniqueValues && t.options.getFacetedUniqueValues(t, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = t.options.getFacetedMinMaxValues && t.options.getFacetedMinMaxValues(t, e.id), e.getFacetedMinMaxValues = () => {
2222
+ if (e._getFacetedMinMaxValues) return e._getFacetedMinMaxValues();
2223
+ };
2224
+ } }, Pn = (e, t, n) => {
2225
+ var r, i;
2226
+ let a = n == null || (r = n.toString()) == null ? void 0 : r.toLowerCase();
2227
+ return !!(!((i = e.getValue(t)) == null || (i = i.toString()) == null || (i = i.toLowerCase()) == null) && i.includes(a));
2228
+ };
2229
+ Pn.autoRemove = (e) => $(e);
2230
+ var Fn = (e, t, n) => {
2231
+ var r;
2232
+ return !!(!((r = e.getValue(t)) == null || (r = r.toString()) == null) && r.includes(n));
2233
+ };
2234
+ Fn.autoRemove = (e) => $(e);
2235
+ var In = (e, t, n) => {
2236
+ var r;
2237
+ return ((r = e.getValue(t)) == null || (r = r.toString()) == null ? void 0 : r.toLowerCase()) === n?.toLowerCase();
2238
+ };
2239
+ In.autoRemove = (e) => $(e);
2240
+ var Ln = (e, t, n) => e.getValue(t)?.includes(n);
2241
+ Ln.autoRemove = (e) => $(e);
2242
+ var Rn = (e, t, n) => !n.some((n) => {
2243
+ var r;
2244
+ return !((r = e.getValue(t)) != null && r.includes(n));
2245
+ });
2246
+ Rn.autoRemove = (e) => $(e) || !(e != null && e.length);
2247
+ var zn = (e, t, n) => n.some((n) => e.getValue(t)?.includes(n));
2248
+ zn.autoRemove = (e) => $(e) || !(e != null && e.length);
2249
+ var Bn = (e, t, n) => e.getValue(t) === n;
2250
+ Bn.autoRemove = (e) => $(e);
2251
+ var Vn = (e, t, n) => e.getValue(t) == n;
2252
+ Vn.autoRemove = (e) => $(e);
2253
+ var Hn = (e, t, n) => {
2254
+ let [r, i] = n, a = e.getValue(t);
2255
+ return a >= r && a <= i;
2256
+ };
2257
+ Hn.resolveFilterValue = (e) => {
2258
+ let [t, n] = e, r = typeof t == "number" ? t : parseFloat(t), i = typeof n == "number" ? n : parseFloat(n), a = t === null || Number.isNaN(r) ? -Infinity : r, o = n === null || Number.isNaN(i) ? Infinity : i;
2259
+ if (a > o) {
2260
+ let e = a;
2261
+ a = o, o = e;
2262
+ }
2263
+ return [a, o];
2264
+ }, Hn.autoRemove = (e) => $(e) || $(e[0]) && $(e[1]);
2265
+ var Un = {
2266
+ includesString: Pn,
2267
+ includesStringSensitive: Fn,
2268
+ equalsString: In,
2269
+ arrIncludes: Ln,
2270
+ arrIncludesAll: Rn,
2271
+ arrIncludesSome: zn,
2272
+ equals: Bn,
2273
+ weakEquals: Vn,
2274
+ inNumberRange: Hn
2275
+ };
2276
+ function $(e) {
2277
+ return e == null || e === "";
2278
+ }
2279
+ var Wn = {
2280
+ getDefaultColumnDef: () => ({ filterFn: "auto" }),
2281
+ getInitialState: (e) => ({
2282
+ columnFilters: [],
2283
+ ...e
2284
+ }),
2285
+ getDefaultOptions: (e) => ({
2286
+ onColumnFiltersChange: Y("columnFilters", e),
2287
+ filterFromLeafRows: !1,
2288
+ maxLeafRowFilterDepth: 100
2289
+ }),
2290
+ createColumn: (e, t) => {
2291
+ e.getAutoFilterFn = () => {
2292
+ let n = t.getCoreRowModel().flatRows[0]?.getValue(e.id);
2293
+ return typeof n == "string" ? Un.includesString : typeof n == "number" ? Un.inNumberRange : typeof n == "boolean" || typeof n == "object" && n ? Un.equals : Array.isArray(n) ? Un.arrIncludes : Un.weakEquals;
2294
+ }, e.getFilterFn = () => wn(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : t.options.filterFns?.[e.columnDef.filterFn] ?? Un[e.columnDef.filterFn], e.getCanFilter = () => (e.columnDef.enableColumnFilter ?? !0) && (t.options.enableColumnFilters ?? !0) && (t.options.enableFilters ?? !0) && !!e.accessorFn, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
2295
+ var n;
2296
+ return (n = t.getState().columnFilters) == null || (n = n.find((t) => t.id === e.id)) == null ? void 0 : n.value;
2297
+ }, e.getFilterIndex = () => t.getState().columnFilters?.findIndex((t) => t.id === e.id) ?? -1, e.setFilterValue = (n) => {
2298
+ t.setColumnFilters((t) => {
2299
+ let r = e.getFilterFn(), i = t?.find((t) => t.id === e.id), a = Cn(n, i ? i.value : void 0);
2300
+ if (Gn(r, a, e)) return t?.filter((t) => t.id !== e.id) ?? [];
2301
+ let o = {
2302
+ id: e.id,
2303
+ value: a
2304
+ };
2305
+ return i ? t?.map((t) => t.id === e.id ? o : t) ?? [] : t != null && t.length ? [...t, o] : [o];
2306
+ });
2307
+ };
2308
+ },
2309
+ createRow: (e, t) => {
2310
+ e.columnFilters = {}, e.columnFiltersMeta = {};
2311
+ },
2312
+ createTable: (e) => {
2313
+ e.setColumnFilters = (t) => {
2314
+ let n = e.getAllLeafColumns();
2315
+ e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange((e) => Cn(t, e)?.filter((e) => {
2316
+ let t = n.find((t) => t.id === e.id);
2317
+ return !(t && Gn(t.getFilterFn(), e.value, t));
2318
+ }));
2319
+ }, e.resetColumnFilters = (t) => {
2320
+ e.setColumnFilters(t ? [] : e.initialState?.columnFilters ?? []);
2321
+ }, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
2322
+ }
2323
+ };
2324
+ function Gn(e, t, n) {
2325
+ return (e && e.autoRemove ? e.autoRemove(t, n) : !1) || t === void 0 || typeof t == "string" && !t;
2326
+ }
2327
+ var Kn = {
2328
+ sum: (e, t, n) => n.reduce((t, n) => {
2329
+ let r = n.getValue(e);
2330
+ return t + (typeof r == "number" ? r : 0);
2331
+ }, 0),
2332
+ min: (e, t, n) => {
2333
+ let r;
2334
+ return n.forEach((t) => {
2335
+ let n = t.getValue(e);
2336
+ n != null && (r > n || r === void 0 && n >= n) && (r = n);
2337
+ }), r;
2338
+ },
2339
+ max: (e, t, n) => {
2340
+ let r;
2341
+ return n.forEach((t) => {
2342
+ let n = t.getValue(e);
2343
+ n != null && (r < n || r === void 0 && n >= n) && (r = n);
2344
+ }), r;
2345
+ },
2346
+ extent: (e, t, n) => {
2347
+ let r, i;
2348
+ return n.forEach((t) => {
2349
+ let n = t.getValue(e);
2350
+ n != null && (r === void 0 ? n >= n && (r = i = n) : (r > n && (r = n), i < n && (i = n)));
2351
+ }), [r, i];
2352
+ },
2353
+ mean: (e, t) => {
2354
+ let n = 0, r = 0;
2355
+ if (t.forEach((t) => {
2356
+ let i = t.getValue(e);
2357
+ i != null && (i = +i) >= i && (++n, r += i);
2358
+ }), n) return r / n;
2359
+ },
2360
+ median: (e, t) => {
2361
+ if (!t.length) return;
2362
+ let n = t.map((t) => t.getValue(e));
2363
+ if (!Tn(n)) return;
2364
+ if (n.length === 1) return n[0];
2365
+ let r = Math.floor(n.length / 2), i = n.sort((e, t) => e - t);
2366
+ return n.length % 2 == 0 ? (i[r - 1] + i[r]) / 2 : i[r];
2367
+ },
2368
+ unique: (e, t) => Array.from(new Set(t.map((t) => t.getValue(e))).values()),
2369
+ uniqueCount: (e, t) => new Set(t.map((t) => t.getValue(e))).size,
2370
+ count: (e, t) => t.length
2371
+ }, qn = {
2372
+ getDefaultColumnDef: () => ({
2373
+ aggregatedCell: (e) => {
2374
+ var t;
2375
+ return ((t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) ?? null;
2376
+ },
2377
+ aggregationFn: "auto"
2378
+ }),
2379
+ getInitialState: (e) => ({
2380
+ grouping: [],
2381
+ ...e
2382
+ }),
2383
+ getDefaultOptions: (e) => ({
2384
+ onGroupingChange: Y("grouping", e),
2385
+ groupedColumnMode: "reorder"
2386
+ }),
2387
+ createColumn: (e, t) => {
2388
+ e.toggleGrouping = () => {
2389
+ t.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((t) => t !== e.id) : [...t ?? [], e.id]);
2390
+ }, e.getCanGroup = () => (e.columnDef.enableGrouping ?? !0) && (t.options.enableGrouping ?? !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue), e.getIsGrouped = () => t.getState().grouping?.includes(e.id), e.getGroupedIndex = () => t.getState().grouping?.indexOf(e.id), e.getToggleGroupingHandler = () => {
2391
+ let t = e.getCanGroup();
2392
+ return () => {
2393
+ t && e.toggleGrouping();
2394
+ };
2395
+ }, e.getAutoAggregationFn = () => {
2396
+ let n = t.getCoreRowModel().flatRows[0]?.getValue(e.id);
2397
+ if (typeof n == "number") return Kn.sum;
2398
+ if (Object.prototype.toString.call(n) === "[object Date]") return Kn.extent;
2399
+ }, e.getAggregationFn = () => {
2400
+ if (!e) throw Error();
2401
+ return wn(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : t.options.aggregationFns?.[e.columnDef.aggregationFn] ?? Kn[e.columnDef.aggregationFn];
2402
+ };
2403
+ },
2404
+ createTable: (e) => {
2405
+ e.setGrouping = (t) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(t), e.resetGrouping = (t) => {
2406
+ e.setGrouping(t ? [] : e.initialState?.grouping ?? []);
2407
+ }, e.getPreGroupedRowModel = () => e.getFilteredRowModel(), e.getGroupedRowModel = () => (!e._getGroupedRowModel && e.options.getGroupedRowModel && (e._getGroupedRowModel = e.options.getGroupedRowModel(e)), e.options.manualGrouping || !e._getGroupedRowModel ? e.getPreGroupedRowModel() : e._getGroupedRowModel());
2408
+ },
2409
+ createRow: (e, t) => {
2410
+ e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (n) => {
2411
+ if (e._groupingValuesCache.hasOwnProperty(n)) return e._groupingValuesCache[n];
2412
+ let r = t.getColumn(n);
2413
+ return r != null && r.columnDef.getGroupingValue ? (e._groupingValuesCache[n] = r.columnDef.getGroupingValue(e.original), e._groupingValuesCache[n]) : e.getValue(n);
2414
+ }, e._groupingValuesCache = {};
2415
+ },
2416
+ createCell: (e, t, n, r) => {
2417
+ e.getIsGrouped = () => t.getIsGrouped() && t.id === n.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && t.getIsGrouped(), e.getIsAggregated = () => {
2418
+ var t;
2419
+ return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((t = n.subRows) != null && t.length);
2420
+ };
2421
+ }
2422
+ };
2423
+ function Jn(e, t, n) {
2424
+ if (!(t != null && t.length) || !n) return e;
2425
+ let r = e.filter((e) => !t.includes(e.id));
2426
+ return n === "remove" ? r : [...t.map((t) => e.find((e) => e.id === t)).filter(Boolean), ...r];
2427
+ }
2428
+ var Yn = {
2429
+ getInitialState: (e) => ({
2430
+ columnOrder: [],
2431
+ ...e
2432
+ }),
2433
+ getDefaultOptions: (e) => ({ onColumnOrderChange: Y("columnOrder", e) }),
2434
+ createColumn: (e, t) => {
2435
+ e.getIndex = X((e) => [or(t, e)], (t) => t.findIndex((t) => t.id === e.id), Z(t.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (n) => or(t, n)[0]?.id === e.id, e.getIsLastColumn = (n) => {
2436
+ let r = or(t, n);
2437
+ return r[r.length - 1]?.id === e.id;
2438
+ };
2439
+ },
2440
+ createTable: (e) => {
2441
+ e.setColumnOrder = (t) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(t), e.resetColumnOrder = (t) => {
2442
+ e.setColumnOrder(t ? [] : e.initialState.columnOrder ?? []);
2443
+ }, e._getOrderColumnsFn = X(() => [
2444
+ e.getState().columnOrder,
2445
+ e.getState().grouping,
2446
+ e.options.groupedColumnMode
2447
+ ], (e, t, n) => (r) => {
2448
+ let i = [];
2449
+ if (!(e != null && e.length)) i = r;
2450
+ else {
2451
+ let t = [...e], n = [...r];
2452
+ for (; n.length && t.length;) {
2453
+ let e = t.shift(), r = n.findIndex((t) => t.id === e);
2454
+ r > -1 && i.push(n.splice(r, 1)[0]);
2455
+ }
2456
+ i = [...i, ...n];
2457
+ }
2458
+ return Jn(i, t, n);
2459
+ }, Z(e.options, "debugTable", "_getOrderColumnsFn"));
2460
+ }
2461
+ }, Xn = () => ({
2462
+ left: [],
2463
+ right: []
2464
+ }), Zn = {
2465
+ getInitialState: (e) => ({
2466
+ columnPinning: Xn(),
2467
+ ...e
2468
+ }),
2469
+ getDefaultOptions: (e) => ({ onColumnPinningChange: Y("columnPinning", e) }),
2470
+ createColumn: (e, t) => {
2471
+ e.pin = (n) => {
2472
+ let r = e.getLeafColumns().map((e) => e.id).filter(Boolean);
2473
+ t.setColumnPinning((e) => n === "right" ? {
2474
+ left: (e?.left ?? []).filter((e) => !(r != null && r.includes(e))),
2475
+ right: [...(e?.right ?? []).filter((e) => !(r != null && r.includes(e))), ...r]
2476
+ } : n === "left" ? {
2477
+ left: [...(e?.left ?? []).filter((e) => !(r != null && r.includes(e))), ...r],
2478
+ right: (e?.right ?? []).filter((e) => !(r != null && r.includes(e)))
2479
+ } : {
2480
+ left: (e?.left ?? []).filter((e) => !(r != null && r.includes(e))),
2481
+ right: (e?.right ?? []).filter((e) => !(r != null && r.includes(e)))
2482
+ });
2483
+ }, e.getCanPin = () => e.getLeafColumns().some((e) => (e.columnDef.enablePinning ?? !0) && (t.options.enableColumnPinning ?? t.options.enablePinning ?? !0)), e.getIsPinned = () => {
2484
+ let n = e.getLeafColumns().map((e) => e.id), { left: r, right: i } = t.getState().columnPinning, a = n.some((e) => r?.includes(e)), o = n.some((e) => i?.includes(e));
2485
+ return a ? "left" : o ? "right" : !1;
2486
+ }, e.getPinnedIndex = () => {
2487
+ var n;
2488
+ let r = e.getIsPinned();
2489
+ return r ? ((n = t.getState().columnPinning) == null || (n = n[r]) == null ? void 0 : n.indexOf(e.id)) ?? -1 : 0;
2490
+ };
2491
+ },
2492
+ createRow: (e, t) => {
2493
+ e.getCenterVisibleCells = X(() => [
2494
+ e._getAllVisibleCells(),
2495
+ t.getState().columnPinning.left,
2496
+ t.getState().columnPinning.right
2497
+ ], (e, t, n) => {
2498
+ let r = [...t ?? [], ...n ?? []];
2499
+ return e.filter((e) => !r.includes(e.column.id));
2500
+ }, Z(t.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = X(() => [e._getAllVisibleCells(), t.getState().columnPinning.left], (e, t) => (t ?? []).map((t) => e.find((e) => e.column.id === t)).filter(Boolean).map((e) => ({
2501
+ ...e,
2502
+ position: "left"
2503
+ })), Z(t.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = X(() => [e._getAllVisibleCells(), t.getState().columnPinning.right], (e, t) => (t ?? []).map((t) => e.find((e) => e.column.id === t)).filter(Boolean).map((e) => ({
2504
+ ...e,
2505
+ position: "right"
2506
+ })), Z(t.options, "debugRows", "getRightVisibleCells"));
2507
+ },
2508
+ createTable: (e) => {
2509
+ e.setColumnPinning = (t) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(t), e.resetColumnPinning = (t) => e.setColumnPinning(t ? Xn() : e.initialState?.columnPinning ?? Xn()), e.getIsSomeColumnsPinned = (t) => {
2510
+ let n = e.getState().columnPinning;
2511
+ return t ? !!n[t]?.length : !!(n.left?.length || n.right?.length);
2512
+ }, e.getLeftLeafColumns = X(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (e, t) => (t ?? []).map((t) => e.find((e) => e.id === t)).filter(Boolean), Z(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = X(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (e, t) => (t ?? []).map((t) => e.find((e) => e.id === t)).filter(Boolean), Z(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = X(() => [
2513
+ e.getAllLeafColumns(),
2514
+ e.getState().columnPinning.left,
2515
+ e.getState().columnPinning.right
2516
+ ], (e, t, n) => {
2517
+ let r = [...t ?? [], ...n ?? []];
2518
+ return e.filter((e) => !r.includes(e.id));
2519
+ }, Z(e.options, "debugColumns", "getCenterLeafColumns"));
2520
+ }
2521
+ };
2522
+ function Qn(e) {
2523
+ return e || (typeof document < "u" ? document : null);
2524
+ }
2525
+ var $n = {
2526
+ size: 150,
2527
+ minSize: 20,
2528
+ maxSize: 2 ** 53 - 1
2529
+ }, er = () => ({
2530
+ startOffset: null,
2531
+ startSize: null,
2532
+ deltaOffset: null,
2533
+ deltaPercentage: null,
2534
+ isResizingColumn: !1,
2535
+ columnSizingStart: []
2536
+ }), tr = {
2537
+ getDefaultColumnDef: () => $n,
2538
+ getInitialState: (e) => ({
2539
+ columnSizing: {},
2540
+ columnSizingInfo: er(),
2541
+ ...e
2542
+ }),
2543
+ getDefaultOptions: (e) => ({
2544
+ columnResizeMode: "onEnd",
2545
+ columnResizeDirection: "ltr",
2546
+ onColumnSizingChange: Y("columnSizing", e),
2547
+ onColumnSizingInfoChange: Y("columnSizingInfo", e)
2548
+ }),
2549
+ createColumn: (e, t) => {
2550
+ e.getSize = () => {
2551
+ let n = t.getState().columnSizing[e.id];
2552
+ return Math.min(Math.max(e.columnDef.minSize ?? $n.minSize, n ?? e.columnDef.size ?? $n.size), e.columnDef.maxSize ?? $n.maxSize);
2553
+ }, e.getStart = X((e) => [
2554
+ e,
2555
+ or(t, e),
2556
+ t.getState().columnSizing
2557
+ ], (t, n) => n.slice(0, e.getIndex(t)).reduce((e, t) => e + t.getSize(), 0), Z(t.options, "debugColumns", "getStart")), e.getAfter = X((e) => [
2558
+ e,
2559
+ or(t, e),
2560
+ t.getState().columnSizing
2561
+ ], (t, n) => n.slice(e.getIndex(t) + 1).reduce((e, t) => e + t.getSize(), 0), Z(t.options, "debugColumns", "getAfter")), e.resetSize = () => {
2562
+ t.setColumnSizing((t) => {
2563
+ let { [e.id]: n, ...r } = t;
2564
+ return r;
2565
+ });
2566
+ }, e.getCanResize = () => (e.columnDef.enableResizing ?? !0) && (t.options.enableColumnResizing ?? !0), e.getIsResizing = () => t.getState().columnSizingInfo.isResizingColumn === e.id;
2567
+ },
2568
+ createHeader: (e, t) => {
2569
+ e.getSize = () => {
2570
+ let t = 0, n = (e) => {
2571
+ e.subHeaders.length ? e.subHeaders.forEach(n) : t += e.column.getSize() ?? 0;
2572
+ };
2573
+ return n(e), t;
2574
+ }, e.getStart = () => {
2575
+ if (e.index > 0) {
2576
+ let t = e.headerGroup.headers[e.index - 1];
2577
+ return t.getStart() + t.getSize();
2578
+ }
2579
+ return 0;
2580
+ }, e.getResizeHandler = (n) => {
2581
+ let r = t.getColumn(e.column.id), i = r?.getCanResize();
2582
+ return (a) => {
2583
+ if (!r || !i || (a.persist == null || a.persist(), ir(a) && a.touches && a.touches.length > 1)) return;
2584
+ let o = e.getSize(), s = e ? e.getLeafHeaders().map((e) => [e.column.id, e.column.getSize()]) : [[r.id, r.getSize()]], c = ir(a) ? Math.round(a.touches[0].clientX) : a.clientX, l = {}, u = (e, n) => {
2585
+ typeof n == "number" && (t.setColumnSizingInfo((e) => {
2586
+ let r = t.options.columnResizeDirection === "rtl" ? -1 : 1, i = (n - (e?.startOffset ?? 0)) * r, a = Math.max(i / (e?.startSize ?? 0), -.999999);
2587
+ return e.columnSizingStart.forEach((e) => {
2588
+ let [t, n] = e;
2589
+ l[t] = Math.round(Math.max(n + n * a, 0) * 100) / 100;
2590
+ }), {
2591
+ ...e,
2592
+ deltaOffset: i,
2593
+ deltaPercentage: a
2594
+ };
2595
+ }), (t.options.columnResizeMode === "onChange" || e === "end") && t.setColumnSizing((e) => ({
2596
+ ...e,
2597
+ ...l
2598
+ })));
2599
+ }, d = (e) => u("move", e), f = (e) => {
2600
+ u("end", e), t.setColumnSizingInfo((e) => ({
2601
+ ...e,
2602
+ isResizingColumn: !1,
2603
+ startOffset: null,
2604
+ startSize: null,
2605
+ deltaOffset: null,
2606
+ deltaPercentage: null,
2607
+ columnSizingStart: []
2608
+ }));
2609
+ }, p = Qn(n), m = {
2610
+ moveHandler: (e) => d(e.clientX),
2611
+ upHandler: (e) => {
2612
+ p?.removeEventListener("mousemove", m.moveHandler), p?.removeEventListener("mouseup", m.upHandler), f(e.clientX);
2613
+ }
2614
+ }, h = {
2615
+ moveHandler: (e) => (e.cancelable && (e.preventDefault(), e.stopPropagation()), d(e.touches[0].clientX), !1),
2616
+ upHandler: (e) => {
2617
+ p?.removeEventListener("touchmove", h.moveHandler), p?.removeEventListener("touchend", h.upHandler), e.cancelable && (e.preventDefault(), e.stopPropagation()), f(e.touches[0]?.clientX);
2618
+ }
2619
+ }, g = rr() ? { passive: !1 } : !1;
2620
+ ir(a) ? (p?.addEventListener("touchmove", h.moveHandler, g), p?.addEventListener("touchend", h.upHandler, g)) : (p?.addEventListener("mousemove", m.moveHandler, g), p?.addEventListener("mouseup", m.upHandler, g)), t.setColumnSizingInfo((e) => ({
2621
+ ...e,
2622
+ startOffset: c,
2623
+ startSize: o,
2624
+ deltaOffset: 0,
2625
+ deltaPercentage: 0,
2626
+ columnSizingStart: s,
2627
+ isResizingColumn: r.id
2628
+ }));
2629
+ };
2630
+ };
2631
+ },
2632
+ createTable: (e) => {
2633
+ e.setColumnSizing = (t) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(t), e.setColumnSizingInfo = (t) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(t), e.resetColumnSizing = (t) => {
2634
+ e.setColumnSizing(t ? {} : e.initialState.columnSizing ?? {});
2635
+ }, e.resetHeaderSizeInfo = (t) => {
2636
+ e.setColumnSizingInfo(t ? er() : e.initialState.columnSizingInfo ?? er());
2637
+ }, e.getTotalSize = () => e.getHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0, e.getLeftTotalSize = () => e.getLeftHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0, e.getCenterTotalSize = () => e.getCenterHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0, e.getRightTotalSize = () => e.getRightHeaderGroups()[0]?.headers.reduce((e, t) => e + t.getSize(), 0) ?? 0;
2638
+ }
2639
+ }, nr = null;
2640
+ function rr() {
2641
+ if (typeof nr == "boolean") return nr;
2642
+ let e = !1;
2643
+ try {
2644
+ let t = { get passive() {
2645
+ return e = !0, !1;
2646
+ } }, n = () => {};
2647
+ window.addEventListener("test", n, t), window.removeEventListener("test", n);
2648
+ } catch {
2649
+ e = !1;
2650
+ }
2651
+ return nr = e, nr;
2652
+ }
2653
+ function ir(e) {
2654
+ return e.type === "touchstart";
2655
+ }
2656
+ var ar = {
2657
+ getInitialState: (e) => ({
2658
+ columnVisibility: {},
2659
+ ...e
2660
+ }),
2661
+ getDefaultOptions: (e) => ({ onColumnVisibilityChange: Y("columnVisibility", e) }),
2662
+ createColumn: (e, t) => {
2663
+ e.toggleVisibility = (n) => {
2664
+ e.getCanHide() && t.setColumnVisibility((t) => ({
2665
+ ...t,
2666
+ [e.id]: n ?? !e.getIsVisible()
2667
+ }));
2668
+ }, e.getIsVisible = () => {
2669
+ let n = e.columns;
2670
+ return (n.length ? n.some((e) => e.getIsVisible()) : t.getState().columnVisibility?.[e.id]) ?? !0;
2671
+ }, e.getCanHide = () => (e.columnDef.enableHiding ?? !0) && (t.options.enableHiding ?? !0), e.getToggleVisibilityHandler = () => (t) => {
2672
+ e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
2673
+ };
2674
+ },
2675
+ createRow: (e, t) => {
2676
+ e._getAllVisibleCells = X(() => [e.getAllCells(), t.getState().columnVisibility], (e) => e.filter((e) => e.column.getIsVisible()), Z(t.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = X(() => [
2677
+ e.getLeftVisibleCells(),
2678
+ e.getCenterVisibleCells(),
2679
+ e.getRightVisibleCells()
2680
+ ], (e, t, n) => [
2681
+ ...e,
2682
+ ...t,
2683
+ ...n
2684
+ ], Z(t.options, "debugRows", "getVisibleCells"));
2685
+ },
2686
+ createTable: (e) => {
2687
+ let t = (t, n) => X(() => [n(), n().filter((e) => e.getIsVisible()).map((e) => e.id).join("_")], (e) => e.filter((e) => e.getIsVisible == null ? void 0 : e.getIsVisible()), Z(e.options, "debugColumns", t));
2688
+ e.getVisibleFlatColumns = t("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = t("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = t("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = t("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = t("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
2689
+ e.setColumnVisibility(t ? {} : e.initialState.columnVisibility ?? {});
2690
+ }, e.toggleAllColumnsVisible = (t) => {
2691
+ t ??= !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((e, n) => ({
2692
+ ...e,
2693
+ [n.id]: t || !(n.getCanHide != null && n.getCanHide())
2694
+ }), {}));
2695
+ }, e.getIsAllColumnsVisible = () => !e.getAllLeafColumns().some((e) => !(e.getIsVisible != null && e.getIsVisible())), e.getIsSomeColumnsVisible = () => e.getAllLeafColumns().some((e) => e.getIsVisible == null ? void 0 : e.getIsVisible()), e.getToggleAllColumnsVisibilityHandler = () => (t) => {
2696
+ e.toggleAllColumnsVisible(t.target?.checked);
2697
+ };
2698
+ }
2699
+ };
2700
+ function or(e, t) {
2701
+ return t ? t === "center" ? e.getCenterVisibleLeafColumns() : t === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
2702
+ }
2703
+ var sr = { createTable: (e) => {
2704
+ e._getGlobalFacetedRowModel = e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__"), e.getGlobalFacetedRowModel = () => e.options.manualFiltering || !e._getGlobalFacetedRowModel ? e.getPreFilteredRowModel() : e._getGlobalFacetedRowModel(), e._getGlobalFacetedUniqueValues = e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__"), e.getGlobalFacetedUniqueValues = () => e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getGlobalFacetedMinMaxValues = e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__"), e.getGlobalFacetedMinMaxValues = () => {
2705
+ if (e._getGlobalFacetedMinMaxValues) return e._getGlobalFacetedMinMaxValues();
2706
+ };
2707
+ } }, cr = {
2708
+ getInitialState: (e) => ({
2709
+ globalFilter: void 0,
2710
+ ...e
2711
+ }),
2712
+ getDefaultOptions: (e) => ({
2713
+ onGlobalFilterChange: Y("globalFilter", e),
2714
+ globalFilterFn: "auto",
2715
+ getColumnCanGlobalFilter: (t) => {
2716
+ var n;
2717
+ let r = (n = e.getCoreRowModel().flatRows[0]) == null || (n = n._getAllCellsByColumnId()[t.id]) == null ? void 0 : n.getValue();
2718
+ return typeof r == "string" || typeof r == "number";
2719
+ }
2720
+ }),
2721
+ createColumn: (e, t) => {
2722
+ e.getCanGlobalFilter = () => (e.columnDef.enableGlobalFilter ?? !0) && (t.options.enableGlobalFilter ?? !0) && (t.options.enableFilters ?? !0) && ((t.options.getColumnCanGlobalFilter == null ? void 0 : t.options.getColumnCanGlobalFilter(e)) ?? !0) && !!e.accessorFn;
2723
+ },
2724
+ createTable: (e) => {
2725
+ e.getGlobalAutoFilterFn = () => Un.includesString, e.getGlobalFilterFn = () => {
2726
+ let { globalFilterFn: t } = e.options;
2727
+ return wn(t) ? t : t === "auto" ? e.getGlobalAutoFilterFn() : e.options.filterFns?.[t] ?? Un[t];
2728
+ }, e.setGlobalFilter = (t) => {
2729
+ e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(t);
2730
+ }, e.resetGlobalFilter = (t) => {
2731
+ e.setGlobalFilter(t ? void 0 : e.initialState.globalFilter);
2732
+ };
2733
+ }
2734
+ }, lr = {
2735
+ getInitialState: (e) => ({
2736
+ expanded: {},
2737
+ ...e
2738
+ }),
2739
+ getDefaultOptions: (e) => ({
2740
+ onExpandedChange: Y("expanded", e),
2741
+ paginateExpandedRows: !0
2742
+ }),
2743
+ createTable: (e) => {
2744
+ let t = !1, n = !1;
2745
+ e._autoResetExpanded = () => {
2746
+ if (!t) {
2747
+ e._queue(() => {
2748
+ t = !0;
2749
+ });
2750
+ return;
2751
+ }
2752
+ if (e.options.autoResetAll ?? e.options.autoResetExpanded ?? !e.options.manualExpanding) {
2753
+ if (n) return;
2754
+ n = !0, e._queue(() => {
2755
+ e.resetExpanded(), n = !1;
2756
+ });
2757
+ }
2758
+ }, e.setExpanded = (t) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(t), e.toggleAllRowsExpanded = (t) => {
2759
+ t ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
2760
+ }, e.resetExpanded = (t) => {
2761
+ e.setExpanded(t ? {} : e.initialState?.expanded ?? {});
2762
+ }, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((e) => e.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (t) => {
2763
+ t.persist == null || t.persist(), e.toggleAllRowsExpanded();
2764
+ }, e.getIsSomeRowsExpanded = () => {
2765
+ let t = e.getState().expanded;
2766
+ return t === !0 || Object.values(t).some(Boolean);
2767
+ }, e.getIsAllRowsExpanded = () => {
2768
+ let t = e.getState().expanded;
2769
+ return typeof t == "boolean" ? t === !0 : !(!Object.keys(t).length || e.getRowModel().flatRows.some((e) => !e.getIsExpanded()));
2770
+ }, e.getExpandedDepth = () => {
2771
+ let t = 0;
2772
+ return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((e) => {
2773
+ let n = e.split(".");
2774
+ t = Math.max(t, n.length);
2775
+ }), t;
2776
+ }, e.getPreExpandedRowModel = () => e.getSortedRowModel(), e.getExpandedRowModel = () => (!e._getExpandedRowModel && e.options.getExpandedRowModel && (e._getExpandedRowModel = e.options.getExpandedRowModel(e)), e.options.manualExpanding || !e._getExpandedRowModel ? e.getPreExpandedRowModel() : e._getExpandedRowModel());
2777
+ },
2778
+ createRow: (e, t) => {
2779
+ e.toggleExpanded = (n) => {
2780
+ t.setExpanded((r) => {
2781
+ let i = r === !0 ? !0 : !!(r != null && r[e.id]), a = {};
2782
+ if (r === !0 ? Object.keys(t.getRowModel().rowsById).forEach((e) => {
2783
+ a[e] = !0;
2784
+ }) : a = r, n ??= !i, !i && n) return {
2785
+ ...a,
2786
+ [e.id]: !0
2787
+ };
2788
+ if (i && !n) {
2789
+ let { [e.id]: t, ...n } = a;
2790
+ return n;
2791
+ }
2792
+ return r;
2793
+ });
2794
+ }, e.getIsExpanded = () => {
2795
+ let n = t.getState().expanded;
2796
+ return !!((t.options.getIsRowExpanded == null ? void 0 : t.options.getIsRowExpanded(e)) ?? (n === !0 || n?.[e.id]));
2797
+ }, e.getCanExpand = () => {
2798
+ var n;
2799
+ return (t.options.getRowCanExpand == null ? void 0 : t.options.getRowCanExpand(e)) ?? ((t.options.enableExpanding ?? !0) && !!((n = e.subRows) != null && n.length));
2800
+ }, e.getIsAllParentsExpanded = () => {
2801
+ let n = !0, r = e;
2802
+ for (; n && r.parentId;) r = t.getRow(r.parentId, !0), n = r.getIsExpanded();
2803
+ return n;
2804
+ }, e.getToggleExpandedHandler = () => {
2805
+ let t = e.getCanExpand();
2806
+ return () => {
2807
+ t && e.toggleExpanded();
2808
+ };
2809
+ };
2810
+ }
2811
+ }, ur = 0, dr = 10, fr = () => ({
2812
+ pageIndex: ur,
2813
+ pageSize: dr
2814
+ }), pr = {
2815
+ getInitialState: (e) => ({
2816
+ ...e,
2817
+ pagination: {
2818
+ ...fr(),
2819
+ ...e?.pagination
2820
+ }
2821
+ }),
2822
+ getDefaultOptions: (e) => ({ onPaginationChange: Y("pagination", e) }),
2823
+ createTable: (e) => {
2824
+ let t = !1, n = !1;
2825
+ e._autoResetPageIndex = () => {
2826
+ if (!t) {
2827
+ e._queue(() => {
2828
+ t = !0;
2829
+ });
2830
+ return;
2831
+ }
2832
+ if (e.options.autoResetAll ?? e.options.autoResetPageIndex ?? !e.options.manualPagination) {
2833
+ if (n) return;
2834
+ n = !0, e._queue(() => {
2835
+ e.resetPageIndex(), n = !1;
2836
+ });
2837
+ }
2838
+ }, e.setPagination = (t) => e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange((e) => Cn(t, e)), e.resetPagination = (t) => {
2839
+ e.setPagination(t ? fr() : e.initialState.pagination ?? fr());
2840
+ }, e.setPageIndex = (t) => {
2841
+ e.setPagination((n) => {
2842
+ let r = Cn(t, n.pageIndex), i = e.options.pageCount === void 0 || e.options.pageCount === -1 ? 2 ** 53 - 1 : e.options.pageCount - 1;
2843
+ return r = Math.max(0, Math.min(r, i)), {
2844
+ ...n,
2845
+ pageIndex: r
2846
+ };
2847
+ });
2848
+ }, e.resetPageIndex = (t) => {
2849
+ var n;
2850
+ e.setPageIndex(t ? ur : ((n = e.initialState) == null || (n = n.pagination) == null ? void 0 : n.pageIndex) ?? ur);
2851
+ }, e.resetPageSize = (t) => {
2852
+ var n;
2853
+ e.setPageSize(t ? dr : ((n = e.initialState) == null || (n = n.pagination) == null ? void 0 : n.pageSize) ?? dr);
2854
+ }, e.setPageSize = (t) => {
2855
+ e.setPagination((e) => {
2856
+ let n = Math.max(1, Cn(t, e.pageSize)), r = e.pageSize * e.pageIndex, i = Math.floor(r / n);
2857
+ return {
2858
+ ...e,
2859
+ pageIndex: i,
2860
+ pageSize: n
2861
+ };
2862
+ });
2863
+ }, e.setPageCount = (t) => e.setPagination((n) => {
2864
+ let r = Cn(t, e.options.pageCount ?? -1);
2865
+ return typeof r == "number" && (r = Math.max(-1, r)), {
2866
+ ...n,
2867
+ pageCount: r
2868
+ };
2869
+ }), e.getPageOptions = X(() => [e.getPageCount()], (e) => {
2870
+ let t = [];
2871
+ return e && e > 0 && (t = [...Array(e)].fill(null).map((e, t) => t)), t;
2872
+ }, Z(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
2873
+ let { pageIndex: t } = e.getState().pagination, n = e.getPageCount();
2874
+ return n === -1 ? !0 : n === 0 ? !1 : t < n - 1;
2875
+ }, e.previousPage = () => e.setPageIndex((e) => e - 1), e.nextPage = () => e.setPageIndex((e) => e + 1), e.firstPage = () => e.setPageIndex(0), e.lastPage = () => e.setPageIndex(e.getPageCount() - 1), e.getPrePaginationRowModel = () => e.getExpandedRowModel(), e.getPaginationRowModel = () => (!e._getPaginationRowModel && e.options.getPaginationRowModel && (e._getPaginationRowModel = e.options.getPaginationRowModel(e)), e.options.manualPagination || !e._getPaginationRowModel ? e.getPrePaginationRowModel() : e._getPaginationRowModel()), e.getPageCount = () => e.options.pageCount ?? Math.ceil(e.getRowCount() / e.getState().pagination.pageSize), e.getRowCount = () => e.options.rowCount ?? e.getPrePaginationRowModel().rows.length;
2876
+ }
2877
+ }, mr = () => ({
2878
+ top: [],
2879
+ bottom: []
2880
+ }), hr = {
2881
+ getInitialState: (e) => ({
2882
+ rowPinning: mr(),
2883
+ ...e
2884
+ }),
2885
+ getDefaultOptions: (e) => ({ onRowPinningChange: Y("rowPinning", e) }),
2886
+ createRow: (e, t) => {
2887
+ e.pin = (n, r, i) => {
2888
+ let a = r ? e.getLeafRows().map((e) => {
2889
+ let { id: t } = e;
2890
+ return t;
2891
+ }) : [], o = i ? e.getParentRows().map((e) => {
2892
+ let { id: t } = e;
2893
+ return t;
2894
+ }) : [], s = new Set([
2895
+ ...o,
2896
+ e.id,
2897
+ ...a
2898
+ ]);
2899
+ t.setRowPinning((e) => n === "bottom" ? {
2900
+ top: (e?.top ?? []).filter((e) => !(s != null && s.has(e))),
2901
+ bottom: [...(e?.bottom ?? []).filter((e) => !(s != null && s.has(e))), ...Array.from(s)]
2902
+ } : n === "top" ? {
2903
+ top: [...(e?.top ?? []).filter((e) => !(s != null && s.has(e))), ...Array.from(s)],
2904
+ bottom: (e?.bottom ?? []).filter((e) => !(s != null && s.has(e)))
2905
+ } : {
2906
+ top: (e?.top ?? []).filter((e) => !(s != null && s.has(e))),
2907
+ bottom: (e?.bottom ?? []).filter((e) => !(s != null && s.has(e)))
2908
+ });
2909
+ }, e.getCanPin = () => {
2910
+ let { enableRowPinning: n, enablePinning: r } = t.options;
2911
+ return typeof n == "function" ? n(e) : n ?? r ?? !0;
2912
+ }, e.getIsPinned = () => {
2913
+ let n = [e.id], { top: r, bottom: i } = t.getState().rowPinning, a = n.some((e) => r?.includes(e)), o = n.some((e) => i?.includes(e));
2914
+ return a ? "top" : o ? "bottom" : !1;
2915
+ }, e.getPinnedIndex = () => {
2916
+ let n = e.getIsPinned();
2917
+ return n ? ((n === "top" ? t.getTopRows() : t.getBottomRows())?.map((e) => {
2918
+ let { id: t } = e;
2919
+ return t;
2920
+ }))?.indexOf(e.id) ?? -1 : -1;
2921
+ };
2922
+ },
2923
+ createTable: (e) => {
2924
+ e.setRowPinning = (t) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(t), e.resetRowPinning = (t) => e.setRowPinning(t ? mr() : e.initialState?.rowPinning ?? mr()), e.getIsSomeRowsPinned = (t) => {
2925
+ let n = e.getState().rowPinning;
2926
+ return t ? !!n[t]?.length : !!(n.top?.length || n.bottom?.length);
2927
+ }, e._getPinnedRows = (t, n, r) => (e.options.keepPinnedRows ?? !0 ? (n ?? []).map((t) => {
2928
+ let n = e.getRow(t, !0);
2929
+ return n.getIsAllParentsExpanded() ? n : null;
2930
+ }) : (n ?? []).map((e) => t.find((t) => t.id === e))).filter(Boolean).map((e) => ({
2931
+ ...e,
2932
+ position: r
2933
+ })), e.getTopRows = X(() => [e.getRowModel().rows, e.getState().rowPinning.top], (t, n) => e._getPinnedRows(t, n, "top"), Z(e.options, "debugRows", "getTopRows")), e.getBottomRows = X(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (t, n) => e._getPinnedRows(t, n, "bottom"), Z(e.options, "debugRows", "getBottomRows")), e.getCenterRows = X(() => [
2934
+ e.getRowModel().rows,
2935
+ e.getState().rowPinning.top,
2936
+ e.getState().rowPinning.bottom
2937
+ ], (e, t, n) => {
2938
+ let r = new Set([...t ?? [], ...n ?? []]);
2939
+ return e.filter((e) => !r.has(e.id));
2940
+ }, Z(e.options, "debugRows", "getCenterRows"));
2941
+ }
2942
+ }, gr = {
2943
+ getInitialState: (e) => ({
2944
+ rowSelection: {},
2945
+ ...e
2946
+ }),
2947
+ getDefaultOptions: (e) => ({
2948
+ onRowSelectionChange: Y("rowSelection", e),
2949
+ enableRowSelection: !0,
2950
+ enableMultiRowSelection: !0,
2951
+ enableSubRowSelection: !0
2952
+ }),
2953
+ createTable: (e) => {
2954
+ e.setRowSelection = (t) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(t), e.resetRowSelection = (t) => e.setRowSelection(t ? {} : e.initialState.rowSelection ?? {}), e.toggleAllRowsSelected = (t) => {
2955
+ e.setRowSelection((n) => {
2956
+ t = t === void 0 ? !e.getIsAllRowsSelected() : t;
2957
+ let r = { ...n }, i = e.getPreGroupedRowModel().flatRows;
2958
+ return t ? i.forEach((e) => {
2959
+ e.getCanSelect() && (r[e.id] = !0);
2960
+ }) : i.forEach((e) => {
2961
+ delete r[e.id];
2962
+ }), r;
2963
+ });
2964
+ }, e.toggleAllPageRowsSelected = (t) => e.setRowSelection((n) => {
2965
+ let r = t === void 0 ? !e.getIsAllPageRowsSelected() : t, i = { ...n };
2966
+ return e.getRowModel().rows.forEach((t) => {
2967
+ _r(i, t.id, r, !0, e);
2968
+ }), i;
2969
+ }), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = X(() => [e.getState().rowSelection, e.getCoreRowModel()], (t, n) => Object.keys(t).length ? vr(e, n) : {
2970
+ rows: [],
2971
+ flatRows: [],
2972
+ rowsById: {}
2973
+ }, Z(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = X(() => [e.getState().rowSelection, e.getFilteredRowModel()], (t, n) => Object.keys(t).length ? vr(e, n) : {
2974
+ rows: [],
2975
+ flatRows: [],
2976
+ rowsById: {}
2977
+ }, Z(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = X(() => [e.getState().rowSelection, e.getSortedRowModel()], (t, n) => Object.keys(t).length ? vr(e, n) : {
2978
+ rows: [],
2979
+ flatRows: [],
2980
+ rowsById: {}
2981
+ }, Z(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
2982
+ let t = e.getFilteredRowModel().flatRows, { rowSelection: n } = e.getState(), r = !!(t.length && Object.keys(n).length);
2983
+ return r && t.some((e) => e.getCanSelect() && !n[e.id]) && (r = !1), r;
2984
+ }, e.getIsAllPageRowsSelected = () => {
2985
+ let t = e.getPaginationRowModel().flatRows.filter((e) => e.getCanSelect()), { rowSelection: n } = e.getState(), r = !!t.length;
2986
+ return r && t.some((e) => !n[e.id]) && (r = !1), r;
2987
+ }, e.getIsSomeRowsSelected = () => {
2988
+ let t = Object.keys(e.getState().rowSelection ?? {}).length;
2989
+ return t > 0 && t < e.getFilteredRowModel().flatRows.length;
2990
+ }, e.getIsSomePageRowsSelected = () => {
2991
+ let t = e.getPaginationRowModel().flatRows;
2992
+ return e.getIsAllPageRowsSelected() ? !1 : t.filter((e) => e.getCanSelect()).some((e) => e.getIsSelected() || e.getIsSomeSelected());
2993
+ }, e.getToggleAllRowsSelectedHandler = () => (t) => {
2994
+ e.toggleAllRowsSelected(t.target.checked);
2995
+ }, e.getToggleAllPageRowsSelectedHandler = () => (t) => {
2996
+ e.toggleAllPageRowsSelected(t.target.checked);
2997
+ };
2998
+ },
2999
+ createRow: (e, t) => {
3000
+ e.toggleSelected = (n, r) => {
3001
+ let i = e.getIsSelected();
3002
+ t.setRowSelection((a) => {
3003
+ if (n = n === void 0 ? !i : n, e.getCanSelect() && i === n) return a;
3004
+ let o = { ...a };
3005
+ return _r(o, e.id, n, r?.selectChildren ?? !0, t), o;
3006
+ });
3007
+ }, e.getIsSelected = () => {
3008
+ let { rowSelection: n } = t.getState();
3009
+ return yr(e, n);
3010
+ }, e.getIsSomeSelected = () => {
3011
+ let { rowSelection: n } = t.getState();
3012
+ return br(e, n) === "some";
3013
+ }, e.getIsAllSubRowsSelected = () => {
3014
+ let { rowSelection: n } = t.getState();
3015
+ return br(e, n) === "all";
3016
+ }, e.getCanSelect = () => typeof t.options.enableRowSelection == "function" ? t.options.enableRowSelection(e) : t.options.enableRowSelection ?? !0, e.getCanSelectSubRows = () => typeof t.options.enableSubRowSelection == "function" ? t.options.enableSubRowSelection(e) : t.options.enableSubRowSelection ?? !0, e.getCanMultiSelect = () => typeof t.options.enableMultiRowSelection == "function" ? t.options.enableMultiRowSelection(e) : t.options.enableMultiRowSelection ?? !0, e.getToggleSelectedHandler = () => {
3017
+ let t = e.getCanSelect();
3018
+ return (n) => {
3019
+ t && e.toggleSelected(n.target?.checked);
3020
+ };
3021
+ };
3022
+ }
3023
+ }, _r = (e, t, n, r, i) => {
3024
+ var a;
3025
+ let o = i.getRow(t, !0);
3026
+ n ? (o.getCanMultiSelect() || Object.keys(e).forEach((t) => delete e[t]), o.getCanSelect() && (e[t] = !0)) : delete e[t], r && (a = o.subRows) != null && a.length && o.getCanSelectSubRows() && o.subRows.forEach((t) => _r(e, t.id, n, r, i));
3027
+ };
3028
+ function vr(e, t) {
3029
+ let n = e.getState().rowSelection, r = [], i = {}, a = function(e, t) {
3030
+ return e.map((e) => {
3031
+ var t;
3032
+ let o = yr(e, n);
3033
+ if (o && (r.push(e), i[e.id] = e), (t = e.subRows) != null && t.length && (e = {
3034
+ ...e,
3035
+ subRows: a(e.subRows)
3036
+ }), o) return e;
3037
+ }).filter(Boolean);
3038
+ };
3039
+ return {
3040
+ rows: a(t.rows),
3041
+ flatRows: r,
3042
+ rowsById: i
3043
+ };
3044
+ }
3045
+ function yr(e, t) {
3046
+ return t[e.id] ?? !1;
3047
+ }
3048
+ function br(e, t, n) {
3049
+ var r;
3050
+ if (!((r = e.subRows) != null && r.length)) return !1;
3051
+ let i = !0, a = !1;
3052
+ return e.subRows.forEach((e) => {
3053
+ if (!(a && !i) && (e.getCanSelect() && (yr(e, t) ? a = !0 : i = !1), e.subRows && e.subRows.length)) {
3054
+ let n = br(e, t);
3055
+ n === "all" ? a = !0 : (n === "some" && (a = !0), i = !1);
3056
+ }
3057
+ }), i ? "all" : a ? "some" : !1;
3058
+ }
3059
+ var xr = /([0-9]+)/gm, Sr = (e, t, n) => Ar(kr(e.getValue(n)).toLowerCase(), kr(t.getValue(n)).toLowerCase()), Cr = (e, t, n) => Ar(kr(e.getValue(n)), kr(t.getValue(n))), wr = (e, t, n) => Or(kr(e.getValue(n)).toLowerCase(), kr(t.getValue(n)).toLowerCase()), Tr = (e, t, n) => Or(kr(e.getValue(n)), kr(t.getValue(n))), Er = (e, t, n) => {
3060
+ let r = e.getValue(n), i = t.getValue(n);
3061
+ return r > i ? 1 : r < i ? -1 : 0;
3062
+ }, Dr = (e, t, n) => Or(e.getValue(n), t.getValue(n));
3063
+ function Or(e, t) {
3064
+ return e === t ? 0 : e > t ? 1 : -1;
3065
+ }
3066
+ function kr(e) {
3067
+ return typeof e == "number" ? isNaN(e) || e === Infinity || e === -Infinity ? "" : String(e) : typeof e == "string" ? e : "";
3068
+ }
3069
+ function Ar(e, t) {
3070
+ let n = e.split(xr).filter(Boolean), r = t.split(xr).filter(Boolean);
3071
+ for (; n.length && r.length;) {
3072
+ let e = n.shift(), t = r.shift(), i = parseInt(e, 10), a = parseInt(t, 10), o = [i, a].sort();
3073
+ if (isNaN(o[0])) {
3074
+ if (e > t) return 1;
3075
+ if (t > e) return -1;
3076
+ continue;
3077
+ }
3078
+ if (isNaN(o[1])) return isNaN(i) ? -1 : 1;
3079
+ if (i > a) return 1;
3080
+ if (a > i) return -1;
3081
+ }
3082
+ return n.length - r.length;
3083
+ }
3084
+ var jr = {
3085
+ alphanumeric: Sr,
3086
+ alphanumericCaseSensitive: Cr,
3087
+ text: wr,
3088
+ textCaseSensitive: Tr,
3089
+ datetime: Er,
3090
+ basic: Dr
3091
+ }, Mr = [
3092
+ An,
3093
+ ar,
3094
+ Yn,
3095
+ Zn,
3096
+ Nn,
3097
+ Wn,
3098
+ sr,
3099
+ cr,
3100
+ {
3101
+ getInitialState: (e) => ({
3102
+ sorting: [],
3103
+ ...e
3104
+ }),
3105
+ getDefaultColumnDef: () => ({
3106
+ sortingFn: "auto",
3107
+ sortUndefined: 1
3108
+ }),
3109
+ getDefaultOptions: (e) => ({
3110
+ onSortingChange: Y("sorting", e),
3111
+ isMultiSortEvent: (e) => e.shiftKey
3112
+ }),
3113
+ createColumn: (e, t) => {
3114
+ e.getAutoSortingFn = () => {
3115
+ let n = t.getFilteredRowModel().flatRows.slice(10), r = !1;
3116
+ for (let t of n) {
3117
+ let n = t?.getValue(e.id);
3118
+ if (Object.prototype.toString.call(n) === "[object Date]") return jr.datetime;
3119
+ if (typeof n == "string" && (r = !0, n.split(xr).length > 1)) return jr.alphanumeric;
3120
+ }
3121
+ return r ? jr.text : jr.basic;
3122
+ }, e.getAutoSortDir = () => typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id) == "string" ? "asc" : "desc", e.getSortingFn = () => {
3123
+ if (!e) throw Error();
3124
+ return wn(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : t.options.sortingFns?.[e.columnDef.sortingFn] ?? jr[e.columnDef.sortingFn];
3125
+ }, e.toggleSorting = (n, r) => {
3126
+ let i = e.getNextSortingOrder(), a = n != null;
3127
+ t.setSorting((o) => {
3128
+ let s = o?.find((t) => t.id === e.id), c = o?.findIndex((t) => t.id === e.id), l = [], u, d = a ? n : i === "desc";
3129
+ return u = o != null && o.length && e.getCanMultiSort() && r ? s ? "toggle" : "add" : o != null && o.length && c !== o.length - 1 ? "replace" : s ? "toggle" : "replace", u === "toggle" && (a || i || (u = "remove")), u === "add" ? (l = [...o, {
3130
+ id: e.id,
3131
+ desc: d
3132
+ }], l.splice(0, l.length - (t.options.maxMultiSortColCount ?? 2 ** 53 - 1))) : l = u === "toggle" ? o.map((t) => t.id === e.id ? {
3133
+ ...t,
3134
+ desc: d
3135
+ } : t) : u === "remove" ? o.filter((t) => t.id !== e.id) : [{
3136
+ id: e.id,
3137
+ desc: d
3138
+ }], l;
3139
+ });
3140
+ }, e.getFirstSortDir = () => e.columnDef.sortDescFirst ?? t.options.sortDescFirst ?? e.getAutoSortDir() === "desc" ? "desc" : "asc", e.getNextSortingOrder = (n) => {
3141
+ let r = e.getFirstSortDir(), i = e.getIsSorted();
3142
+ return i ? i !== r && (t.options.enableSortingRemoval ?? !0) && (!n || (t.options.enableMultiRemove ?? !0)) ? !1 : i === "desc" ? "asc" : "desc" : r;
3143
+ }, e.getCanSort = () => (e.columnDef.enableSorting ?? !0) && (t.options.enableSorting ?? !0) && !!e.accessorFn, e.getCanMultiSort = () => e.columnDef.enableMultiSort ?? t.options.enableMultiSort ?? !!e.accessorFn, e.getIsSorted = () => {
3144
+ let n = t.getState().sorting?.find((t) => t.id === e.id);
3145
+ return n ? n.desc ? "desc" : "asc" : !1;
3146
+ }, e.getSortIndex = () => t.getState().sorting?.findIndex((t) => t.id === e.id) ?? -1, e.clearSorting = () => {
3147
+ t.setSorting((t) => t != null && t.length ? t.filter((t) => t.id !== e.id) : []);
3148
+ }, e.getToggleSortingHandler = () => {
3149
+ let n = e.getCanSort();
3150
+ return (r) => {
3151
+ n && (r.persist == null || r.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? t.options.isMultiSortEvent == null ? void 0 : t.options.isMultiSortEvent(r) : !1));
3152
+ };
3153
+ };
3154
+ },
3155
+ createTable: (e) => {
3156
+ e.setSorting = (t) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(t), e.resetSorting = (t) => {
3157
+ e.setSorting(t ? [] : e.initialState?.sorting ?? []);
3158
+ }, e.getPreSortedRowModel = () => e.getGroupedRowModel(), e.getSortedRowModel = () => (!e._getSortedRowModel && e.options.getSortedRowModel && (e._getSortedRowModel = e.options.getSortedRowModel(e)), e.options.manualSorting || !e._getSortedRowModel ? e.getPreSortedRowModel() : e._getSortedRowModel());
3159
+ }
3160
+ },
3161
+ qn,
3162
+ lr,
3163
+ pr,
3164
+ hr,
3165
+ gr,
3166
+ tr
3167
+ ];
3168
+ function Nr(e) {
3169
+ process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
3170
+ let t = [...Mr, ...e._features ?? []], n = { _features: t }, r = n._features.reduce((e, t) => Object.assign(e, t.getDefaultOptions == null ? void 0 : t.getDefaultOptions(n)), {}), i = (e) => n.options.mergeOptions ? n.options.mergeOptions(r, e) : {
3171
+ ...r,
3172
+ ...e
3173
+ }, a = { ...e.initialState ?? {} };
3174
+ n._features.forEach((e) => {
3175
+ a = (e.getInitialState == null ? void 0 : e.getInitialState(a)) ?? a;
3176
+ });
3177
+ let o = [], s = !1, c = {
3178
+ _features: t,
3179
+ options: {
3180
+ ...r,
3181
+ ...e
3182
+ },
3183
+ initialState: a,
3184
+ _queue: (e) => {
3185
+ o.push(e), s || (s = !0, Promise.resolve().then(() => {
3186
+ for (; o.length;) o.shift()();
3187
+ s = !1;
3188
+ }).catch((e) => setTimeout(() => {
3189
+ throw e;
3190
+ })));
3191
+ },
3192
+ reset: () => {
3193
+ n.setState(n.initialState);
3194
+ },
3195
+ setOptions: (e) => {
3196
+ n.options = i(Cn(e, n.options));
3197
+ },
3198
+ getState: () => n.options.state,
3199
+ setState: (e) => {
3200
+ n.options.onStateChange == null || n.options.onStateChange(e);
3201
+ },
3202
+ _getRowId: (e, t, r) => (n.options.getRowId == null ? void 0 : n.options.getRowId(e, t, r)) ?? `${r ? [r.id, t].join(".") : t}`,
3203
+ getCoreRowModel: () => (n._getCoreRowModel ||= n.options.getCoreRowModel(n), n._getCoreRowModel()),
3204
+ getRowModel: () => n.getPaginationRowModel(),
3205
+ getRow: (e, t) => {
3206
+ let r = (t ? n.getPrePaginationRowModel() : n.getRowModel()).rowsById[e];
3207
+ if (!r && (r = n.getCoreRowModel().rowsById[e], !r)) throw process.env.NODE_ENV === "production" ? Error() : Error(`getRow could not find row with ID: ${e}`);
3208
+ return r;
3209
+ },
3210
+ _getDefaultColumnDef: X(() => [n.options.defaultColumn], (e) => (e ??= {}, {
3211
+ header: (e) => {
3212
+ let t = e.header.column.columnDef;
3213
+ return t.accessorKey ? t.accessorKey : t.accessorFn ? t.id : null;
3214
+ },
3215
+ cell: (e) => {
3216
+ var t;
3217
+ return ((t = e.renderValue()) == null || t.toString == null ? void 0 : t.toString()) ?? null;
3218
+ },
3219
+ ...n._features.reduce((e, t) => Object.assign(e, t.getDefaultColumnDef == null ? void 0 : t.getDefaultColumnDef()), {}),
3220
+ ...e
3221
+ }), Z(e, "debugColumns", "_getDefaultColumnDef")),
3222
+ _getColumnDefs: () => n.options.columns,
3223
+ getAllColumns: X(() => [n._getColumnDefs()], (e) => {
3224
+ let t = function(e, r, i) {
3225
+ return i === void 0 && (i = 0), e.map((e) => {
3226
+ let a = On(n, e, i, r), o = e;
3227
+ return a.columns = o.columns ? t(o.columns, a, i + 1) : [], a;
3228
+ });
3229
+ };
3230
+ return t(e);
3231
+ }, Z(e, "debugColumns", "getAllColumns")),
3232
+ getAllFlatColumns: X(() => [n.getAllColumns()], (e) => e.flatMap((e) => e.getFlatColumns()), Z(e, "debugColumns", "getAllFlatColumns")),
3233
+ _getAllFlatColumnsById: X(() => [n.getAllFlatColumns()], (e) => e.reduce((e, t) => (e[t.id] = t, e), {}), Z(e, "debugColumns", "getAllFlatColumnsById")),
3234
+ getAllLeafColumns: X(() => [n.getAllColumns(), n._getOrderColumnsFn()], (e, t) => t(e.flatMap((e) => e.getLeafColumns())), Z(e, "debugColumns", "getAllLeafColumns")),
3235
+ getColumn: (e) => {
3236
+ let t = n._getAllFlatColumnsById()[e];
3237
+ return process.env.NODE_ENV !== "production" && !t && console.error(`[Table] Column with id '${e}' does not exist.`), t;
3238
+ }
3239
+ };
3240
+ Object.assign(n, c);
3241
+ for (let e = 0; e < n._features.length; e++) {
3242
+ let t = n._features[e];
3243
+ t == null || t.createTable == null || t.createTable(n);
3244
+ }
3245
+ return n;
3246
+ }
3247
+ function Pr() {
3248
+ return (e) => X(() => [e.options.data], (t) => {
3249
+ let n = {
3250
+ rows: [],
3251
+ flatRows: [],
3252
+ rowsById: {}
3253
+ }, r = function(t, i, a) {
3254
+ i === void 0 && (i = 0);
3255
+ let o = [];
3256
+ for (let c = 0; c < t.length; c++) {
3257
+ let l = Mn(e, e._getRowId(t[c], c, a), t[c], c, i, void 0, a?.id);
3258
+ if (n.flatRows.push(l), n.rowsById[l.id] = l, o.push(l), e.options.getSubRows) {
3259
+ var s;
3260
+ l.originalSubRows = e.options.getSubRows(t[c], c), (s = l.originalSubRows) != null && s.length && (l.subRows = r(l.originalSubRows, i + 1, l));
3261
+ }
3262
+ }
3263
+ return o;
3264
+ };
3265
+ return n.rows = r(t), n;
3266
+ }, Z(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
3267
+ }
3268
+ function Fr(e) {
3269
+ let t = [], n = (e) => {
3270
+ var r;
3271
+ t.push(e), (r = e.subRows) != null && r.length && e.getIsExpanded() && e.subRows.forEach(n);
3272
+ };
3273
+ return e.rows.forEach(n), {
3274
+ rows: t,
3275
+ flatRows: e.flatRows,
3276
+ rowsById: e.rowsById
3277
+ };
3278
+ }
3279
+ function Ir(e) {
3280
+ return (e) => X(() => [
3281
+ e.getState().pagination,
3282
+ e.getPrePaginationRowModel(),
3283
+ e.options.paginateExpandedRows ? void 0 : e.getState().expanded
3284
+ ], (t, n) => {
3285
+ if (!n.rows.length) return n;
3286
+ let { pageSize: r, pageIndex: i } = t, { rows: a, flatRows: o, rowsById: s } = n, c = r * i, l = c + r;
3287
+ a = a.slice(c, l);
3288
+ let u;
3289
+ u = e.options.paginateExpandedRows ? {
3290
+ rows: a,
3291
+ flatRows: o,
3292
+ rowsById: s
3293
+ } : Fr({
3294
+ rows: a,
3295
+ flatRows: o,
3296
+ rowsById: s
3297
+ }), u.flatRows = [];
3298
+ let d = (e) => {
3299
+ u.flatRows.push(e), e.subRows.length && e.subRows.forEach(d);
3300
+ };
3301
+ return u.rows.forEach(d), u;
3302
+ }, Z(e.options, "debugTable", "getPaginationRowModel"));
3303
+ }
3304
+ function Lr() {
3305
+ return (e) => X(() => [e.getState().sorting, e.getPreSortedRowModel()], (t, n) => {
3306
+ if (!n.rows.length || !(t != null && t.length)) return n;
3307
+ let r = e.getState().sorting, i = [], a = r.filter((t) => e.getColumn(t.id)?.getCanSort()), o = {};
3308
+ a.forEach((t) => {
3309
+ let n = e.getColumn(t.id);
3310
+ n && (o[t.id] = {
3311
+ sortUndefined: n.columnDef.sortUndefined,
3312
+ invertSorting: n.columnDef.invertSorting,
3313
+ sortingFn: n.getSortingFn()
3314
+ });
3315
+ });
3316
+ let s = (e) => {
3317
+ let t = e.map((e) => ({ ...e }));
3318
+ return t.sort((e, t) => {
3319
+ for (let n = 0; n < a.length; n += 1) {
3320
+ let r = a[n], i = o[r.id], s = i.sortUndefined, c = r?.desc ?? !1, l = 0;
3321
+ if (s) {
3322
+ let n = e.getValue(r.id), i = t.getValue(r.id), a = n === void 0, o = i === void 0;
3323
+ if (a || o) {
3324
+ if (s === "first") return a ? -1 : 1;
3325
+ if (s === "last") return a ? 1 : -1;
3326
+ l = a && o ? 0 : a ? s : -s;
3327
+ }
3328
+ }
3329
+ if (l === 0 && (l = i.sortingFn(e, t, r.id)), l !== 0) return c && (l *= -1), i.invertSorting && (l *= -1), l;
3330
+ }
3331
+ return e.index - t.index;
3332
+ }), t.forEach((e) => {
3333
+ var t;
3334
+ i.push(e), (t = e.subRows) != null && t.length && (e.subRows = s(e.subRows));
3335
+ }), t;
3336
+ };
3337
+ return {
3338
+ rows: s(n.rows),
3339
+ flatRows: i,
3340
+ rowsById: n.rowsById
3341
+ };
3342
+ }, Z(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
3343
+ }
3344
+ //#endregion
3345
+ //#region node_modules/@tanstack/vue-table/build/lib/index.mjs
3346
+ function Rr() {
3347
+ return !0;
3348
+ }
3349
+ var zr = Symbol("merge-proxy"), Br = {
3350
+ get(e, t, n) {
3351
+ return t === zr ? n : e.get(t);
3352
+ },
3353
+ has(e, t) {
3354
+ return e.has(t);
3355
+ },
3356
+ set: Rr,
3357
+ deleteProperty: Rr,
3358
+ getOwnPropertyDescriptor(e, t) {
3359
+ return {
3360
+ configurable: !0,
3361
+ enumerable: !0,
3362
+ get() {
3363
+ return e.get(t);
3364
+ },
3365
+ set: Rr,
3366
+ deleteProperty: Rr
3367
+ };
3368
+ },
3369
+ ownKeys(e) {
3370
+ return e.keys();
3371
+ }
3372
+ };
3373
+ function Vr(e) {
3374
+ return "value" in e ? e.value : e;
3375
+ }
3376
+ function Hr() {
3377
+ var e = [...arguments];
3378
+ return new Proxy({
3379
+ get(t) {
3380
+ for (let n = e.length - 1; n >= 0; n--) {
3381
+ let r = Vr(e[n])[t];
3382
+ if (r !== void 0) return r;
3383
+ }
3384
+ },
3385
+ has(t) {
3386
+ for (let n = e.length - 1; n >= 0; n--) if (t in Vr(e[n])) return !0;
3387
+ return !1;
3388
+ },
3389
+ keys() {
3390
+ let t = [];
3391
+ for (let n = 0; n < e.length; n++) t.push(...Object.keys(Vr(e[n])));
3392
+ return [...Array.from(new Set(t))];
3393
+ }
3394
+ }, Br);
3395
+ }
3396
+ var Ur = h({
3397
+ props: ["render", "props"],
3398
+ setup: (e) => () => typeof e.render == "function" || typeof e.render == "object" ? v(e.render, e.props) : e.render
3399
+ });
3400
+ function Wr(e) {
3401
+ return Hr(e, { data: F(e.data) });
3402
+ }
3403
+ function Gr(e) {
3404
+ let t = y(e.data), n = Nr(Hr({
3405
+ state: {},
3406
+ onStateChange: () => {},
3407
+ renderFallbackValue: null,
3408
+ mergeOptions(e, n) {
3409
+ return t ? {
3410
+ ...e,
3411
+ ...n
3412
+ } : Hr(e, n);
3413
+ }
3414
+ }, t ? Wr(e) : e));
3415
+ if (t) {
3416
+ let t = re(e.data);
3417
+ R(t, () => {
3418
+ n.setState((e) => ({
3419
+ ...e,
3420
+ data: t.value
3421
+ }));
3422
+ }, { immediate: !0 });
3423
+ }
3424
+ let r = k(n.initialState);
3425
+ return le(() => {
3426
+ n.setOptions((n) => {
3427
+ let i = new Proxy({}, { get: (e, t) => r.value[t] });
3428
+ return Hr(n, t ? Wr(e) : e, {
3429
+ state: Hr(i, e.state ?? {}),
3430
+ onStateChange: (t) => {
3431
+ t instanceof Function ? r.value = t(r.value) : r.value = t, e.onStateChange == null || e.onStateChange(t);
3432
+ }
3433
+ });
3434
+ });
3435
+ }), n;
3436
+ }
3437
+ //#endregion
3438
+ //#region src/components/hl-table/HLTable.vue?vue&type=script&setup=true&lang.ts
3439
+ var Kr = { class: "flex flex-col gap-4 hanaplabstoolkit-font" }, qr = {
3440
+ key: 0,
3441
+ class: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between"
3442
+ }, Jr = {
3443
+ key: 0,
3444
+ class: "flex flex-1 flex-wrap items-center gap-2"
3445
+ }, Yr = {
3446
+ key: 0,
3447
+ class: "hidden flex-none text-sm text-muted sm:block"
3448
+ }, Xr = {
3449
+ key: 1,
3450
+ class: "hidden flex-none text-sm text-primary sm:block"
3451
+ }, Zr = { class: "overflow-hidden rounded-md border border-solid border-gray-200 bg-white" }, Qr = { class: "overflow-x-auto" }, $r = { class: "w-full table-auto text-left text-sm" }, ei = { class: "border-b border-solid border-gray-200 bg-gray-50 text-xs font-medium uppercase tracking-wider text-muted" }, ti = {
3452
+ key: 0,
3453
+ class: "w-10 whitespace-nowrap px-3 py-3 text-center"
3454
+ }, ni = ["onClick"], ri = {
3455
+ key: 1,
3456
+ class: "inline-flex min-w-4 justify-center"
3457
+ }, ii = { class: "divide-y divide-gray-200" }, ai = {
3458
+ key: 0,
3459
+ class: "w-10 whitespace-nowrap px-3 py-3 text-center"
3460
+ }, oi = {
3461
+ key: 0,
3462
+ class: "w-10 whitespace-nowrap px-3 py-3 text-center"
3463
+ }, si = { key: 2 }, ci = ["colspan"], li = {
3464
+ key: 1,
3465
+ class: "flex flex-col items-center justify-end gap-2 sm:flex-row"
3466
+ }, ui = { class: "flex items-center gap-1.5" }, di = {
3467
+ key: 1,
3468
+ class: "inline-flex size-9 items-center justify-center text-sm text-muted"
3469
+ }, fi = 5, pi = /* @__PURE__ */ h({
3470
+ __name: "HLTable",
3471
+ props: /* @__PURE__ */ b({
3472
+ columns: {},
3473
+ data: {},
3474
+ total: {},
3475
+ initializing: {
3476
+ type: Boolean,
3477
+ default: !1
3478
+ },
3479
+ fetching: {
3480
+ type: Boolean,
3481
+ default: !1
3482
+ },
3483
+ searchable: {
3484
+ type: Boolean,
3485
+ default: !0
3486
+ },
3487
+ refreshable: {
3488
+ type: Boolean,
3489
+ default: !0
3490
+ },
3491
+ selectable: {
3492
+ type: Boolean,
3493
+ default: !0
3494
+ },
3495
+ rowKey: { default: "id" },
3496
+ pageSize: { default: 10 },
3497
+ pageCount: {},
3498
+ currentPage: {},
3499
+ searchPlaceholder: { default: "Search..." }
3500
+ }, {
3501
+ selectedRows: { default: () => [] },
3502
+ selectedRowsModifiers: {}
3503
+ }),
3504
+ emits: /* @__PURE__ */ b([
3505
+ "page:change",
3506
+ "sort:change",
3507
+ "refresh",
3508
+ "search"
3509
+ ], ["update:selectedRows"]),
3510
+ setup(e, { expose: t, emit: n }) {
3511
+ let i = L(e, "selectedRows"), a = n, d = ae(), f = k([]), m = k({}), h = k(""), g = k(!1);
3512
+ function _(e) {
3513
+ return Object.prototype.hasOwnProperty.call(e, "key");
3514
+ }
3515
+ function v(e) {
3516
+ return typeof e == "boolean" ? e ? "Yes" : "No" : e == null || e === "" ? "-" : String(e);
3517
+ }
3518
+ function y(e) {
3519
+ let t = Sn();
3520
+ return e.map((e) => {
3521
+ if (!_(e)) return e;
3522
+ let n = { alignment: e.alignment };
3523
+ return e.key === "actions" ? t.display({
3524
+ id: "actions",
3525
+ header: e.label,
3526
+ meta: n,
3527
+ enableSorting: !1
3528
+ }) : t.accessor((t) => t[e.key], {
3529
+ id: String(e.key),
3530
+ header: e.label,
3531
+ cell: (e) => v(e.getValue()),
3532
+ meta: n,
3533
+ enableSorting: e.sortable === !0
3534
+ });
3535
+ });
3536
+ }
3537
+ let b = o(() => y(e.columns)), x = o(() => e.selectable ? [Sn().display({
3538
+ id: "select",
3539
+ header: () => "",
3540
+ cell: () => "",
3541
+ enableSorting: !1
3542
+ }), ...b.value] : b.value), S = o(() => {
3543
+ let t = e.columns.filter(_).find((e) => e.key !== "actions" && e.sortable === !0);
3544
+ return t ? String(t.key) : null;
3545
+ });
3546
+ S.value && f.value.length === 0 && (f.value = [{
3547
+ id: S.value,
3548
+ desc: !0
3549
+ }]);
3550
+ let w = Gr({
3551
+ get data() {
3552
+ return e.data;
3553
+ },
3554
+ get columns() {
3555
+ return x.value;
3556
+ },
3557
+ state: {
3558
+ get sorting() {
3559
+ return f.value;
3560
+ },
3561
+ get rowSelection() {
3562
+ return m.value;
3563
+ }
3564
+ },
3565
+ onSortingChange: (e) => {
3566
+ f.value = typeof e == "function" ? e(f.value) : e;
3567
+ },
3568
+ onRowSelectionChange: (e) => {
3569
+ m.value = typeof e == "function" ? e(m.value) : e;
3570
+ },
3571
+ getRowId: (t, n) => {
3572
+ let r = t[e.rowKey];
3573
+ return String(typeof r == "string" || typeof r == "number" ? r : n);
3574
+ },
3575
+ getCoreRowModel: Pr(),
3576
+ getSortedRowModel: Lr(),
3577
+ getPaginationRowModel: Ir(),
3578
+ manualPagination: e.pageCount !== void 0,
3579
+ pageCount: e.pageCount,
3580
+ enableRowSelection: e.selectable,
3581
+ initialState: {
3582
+ sorting: f.value,
3583
+ pagination: { pageSize: e.pageSize }
3584
+ }
3585
+ }), ee = o(() => e.initializing || e.fetching), T = o(() => e.pageCount !== void 0), E = o(() => e.currentPage === void 0 ? w.getState().pagination.pageIndex + 1 : e.currentPage), te = o(() => e.pageCount === void 0 ? w.getPageCount() : e.pageCount), O = o(() => Object.keys(m.value).filter((e) => m.value[e] === !0)), A = o(() => {
3586
+ let e = w.getRowModel().rows;
3587
+ return e.length > 0 && e.every((e) => e.getIsSelected());
3588
+ }), ne = o(() => {
3589
+ let e = w.getRowModel().rows;
3590
+ return e.length === 0 ? !1 : e.some((e) => e.getIsSelected()) && !A.value;
3591
+ }), re = o(() => w.getFlatHeaders().filter((e) => e.id !== "select").length + +!!e.selectable), ie = o(() => {
3592
+ let e = te.value, t = E.value;
3593
+ return e <= 7 ? Array.from({ length: e }, (e, t) => t + 1) : t <= 4 ? [
3594
+ 1,
3595
+ 2,
3596
+ 3,
3597
+ 4,
3598
+ 5,
3599
+ "ellipsis",
3600
+ e
3601
+ ] : t >= e - 3 ? [
3602
+ 1,
3603
+ "ellipsis",
3604
+ e - 4,
3605
+ e - 3,
3606
+ e - 2,
3607
+ e - 1,
3608
+ e
3609
+ ] : [
3610
+ 1,
3611
+ "ellipsis",
3612
+ t - 1,
3613
+ t,
3614
+ t + 1,
3615
+ "ellipsis",
3616
+ e
3617
+ ];
3618
+ });
3619
+ function P(e) {
3620
+ return e ?? {};
3621
+ }
3622
+ function I(e) {
3623
+ return e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left";
3624
+ }
3625
+ function oe(e) {
3626
+ return e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-start";
3627
+ }
3628
+ function se(e) {
3629
+ return e === "center" ? "mx-auto w-3/4" : e === "right" ? "ml-auto w-3/4" : "w-full";
3630
+ }
3631
+ R(ee, (e, t) => {
3632
+ t && !e && g.value && (g.value = !1);
3633
+ }), R(m, () => {
3634
+ i.value = O.value;
3635
+ }, { deep: !0 }), R(i, (e) => {
3636
+ let t = O.value;
3637
+ if (e.length === t.length && e.every((e) => t.includes(e))) return;
3638
+ let n = {};
3639
+ e.forEach((e) => {
3640
+ n[e] = !0;
3641
+ }), m.value = n;
3642
+ });
3643
+ function ce(e) {
3644
+ let t = f.value.find((t) => t.id === e), n = t ? !t.desc : !1;
3645
+ f.value = [{
3646
+ id: e,
3647
+ desc: n
3648
+ }], a("sort:change", {
3649
+ columnKey: e,
3650
+ direction: n ? "desc" : "asc"
3651
+ });
3652
+ }
3653
+ function le() {
3654
+ g.value = !0, a("refresh");
3655
+ }
3656
+ function ue() {
3657
+ a("search", h.value);
3658
+ }
3659
+ function de() {
3660
+ if (T.value) {
3661
+ a("page:change", Math.max(1, E.value - 1));
3662
+ return;
3663
+ }
3664
+ w.previousPage();
3665
+ }
3666
+ function fe() {
3667
+ if (T.value) {
3668
+ a("page:change", Math.min(te.value, E.value + 1));
3669
+ return;
3670
+ }
3671
+ w.nextPage();
3672
+ }
3673
+ function pe(e) {
3674
+ if (T.value) {
3675
+ a("page:change", e);
3676
+ return;
3677
+ }
3678
+ w.setPageIndex(e - 1);
3679
+ }
3680
+ function me() {
3681
+ if (A.value) {
3682
+ w.resetRowSelection();
3683
+ return;
3684
+ }
3685
+ w.toggleAllPageRowsSelected(!0);
3686
+ }
3687
+ function he(e) {
3688
+ e.toggleSelected();
3689
+ }
3690
+ return t({
3691
+ clearSelection: () => {
3692
+ w.resetRowSelection();
3693
+ },
3694
+ getSelectedRows: () => O.value,
3695
+ stopRefreshing: () => {
3696
+ g.value = !1;
3697
+ }
3698
+ }), (t, n) => (D(), l("div", Kr, [
3699
+ e.searchable || e.refreshable || F(d).filters ? (D(), l("div", qr, [F(d).filters ? (D(), l("div", Jr, [M(t.$slots, "filters")])) : c("", !0), u("div", { class: C(["flex items-center gap-2", { "w-full sm:w-auto": !F(d).filters }]) }, [
3700
+ e.searchable && !(e.selectable && O.value.length > 0) ? (D(), l("p", Yr, N(e.total) + " result" + N(e.total === 1 ? "" : "s"), 1)) : c("", !0),
3701
+ e.selectable && O.value.length > 0 ? (D(), l("p", Xr, N(O.value.length) + " selected ", 1)) : c("", !0),
3702
+ e.selectable && O.value.length > 0 ? M(t.$slots, "bulk-actions", { key: 2 }) : c("", !0),
3703
+ e.searchable ? (D(), s(Qe, {
3704
+ key: 3,
3705
+ modelValue: h.value,
3706
+ "onUpdate:modelValue": n[0] ||= (e) => h.value = e,
3707
+ type: "search",
3708
+ placeholder: e.searchPlaceholder,
3709
+ size: "md",
3710
+ class: "w-full max-w-sm sm:w-72",
3711
+ "input-class": "rounded-md border-gray-200 bg-transparent text-dark",
3712
+ onInput: ue
3713
+ }, null, 8, ["modelValue", "placeholder"])) : c("", !0),
3714
+ e.refreshable ? (D(), s(K, {
3715
+ key: 4,
3716
+ label: "",
3717
+ type: "button",
3718
+ variant: "outline",
3719
+ class: "shrink-0 min-w-0 !w-[var(--hanaplabstoolkit-size-md)] !h-[var(--hanaplabstoolkit-size-md)] !p-0 !gap-0 hover:text-primary",
3720
+ disabled: g.value || ee.value,
3721
+ "aria-label": "Refresh",
3722
+ onClick: le
3723
+ }, {
3724
+ icon: z(() => [p(V, {
3725
+ name: "refresh",
3726
+ size: 20,
3727
+ decorative: !0,
3728
+ color: "muted",
3729
+ class: C({ "animate-spin": g.value })
3730
+ }, null, 8, ["class"])]),
3731
+ _: 1
3732
+ }, 8, ["disabled"])) : c("", !0)
3733
+ ], 2)])) : c("", !0),
3734
+ u("div", Zr, [u("div", Qr, [u("table", $r, [u("thead", ei, [u("tr", null, [e.selectable ? (D(), l("th", ti, [p(J, {
3735
+ "model-value": A.value,
3736
+ indeterminate: ne.value,
3737
+ "aria-label": "Toggle all rows",
3738
+ size: "md",
3739
+ class: "mx-auto max-w-max",
3740
+ "onUpdate:modelValue": me
3741
+ }, null, 8, ["model-value", "indeterminate"])])) : c("", !0), (D(!0), l(r, null, j(F(w).getFlatHeaders().filter((e) => e.id !== "select"), (e) => (D(), l("th", {
3742
+ key: e.id,
3743
+ class: C(["whitespace-nowrap px-4 py-3", [I(P(e.column.columnDef.meta).alignment), { "cursor-pointer select-none hover:text-primary": e.column.getCanSort() }]]),
3744
+ onClick: (t) => e.column.getCanSort() ? ce(e.id) : void 0
3745
+ }, [u("div", { class: C(["flex w-full items-center gap-1.5", oe(P(e.column.columnDef.meta).alignment)]) }, [e.isPlaceholder ? c("", !0) : (D(), s(F(Ur), {
3746
+ key: 0,
3747
+ render: e.column.columnDef.header,
3748
+ props: e.getContext()
3749
+ }, null, 8, ["render", "props"])), e.column.getCanSort() ? (D(), l("span", ri, [p(V, {
3750
+ name: e.column.getIsSorted() === "asc" ? "chevron-up" : e.column.getIsSorted() === "desc" ? "chevron-down" : "chevron-up-down",
3751
+ size: 14,
3752
+ decorative: !0
3753
+ }, null, 8, ["name"])])) : c("", !0)], 2)], 10, ni))), 128))])]), u("tbody", ii, [e.initializing ? (D(), l(r, { key: 0 }, j(fi, (t) => u("tr", {
3754
+ key: `skeleton-row-${t}`,
3755
+ class: "animate-pulse"
3756
+ }, [e.selectable ? (D(), l("td", ai, [...n[1] ||= [u("div", { class: "mx-auto size-5 rounded border border-solid border-gray-200 bg-gray-100" }, null, -1)]])) : c("", !0), (D(!0), l(r, null, j(F(w).getAllColumns().filter((e) => e.id !== "select"), (e) => (D(), l("td", {
3757
+ key: `${t}-${e.id}`,
3758
+ class: C(["whitespace-nowrap px-4 py-3", I(P(e.columnDef.meta).alignment)])
3759
+ }, [u("div", { class: C(["h-4 rounded bg-gray-100", se(P(e.columnDef.meta).alignment)]) }, null, 2)], 2))), 128))])), 64)) : (D(!0), l(r, { key: 1 }, j(F(w).getRowModel().rows, (n) => (D(), l("tr", {
3760
+ key: n.id,
3761
+ class: C(["hover:bg-gray-50", { "bg-primary/5": n.getIsSelected() }])
3762
+ }, [e.selectable ? (D(), l("td", oi, [p(J, {
3763
+ "model-value": n.getIsSelected(),
3764
+ "aria-label": "Toggle row",
3765
+ size: "md",
3766
+ class: "mx-auto max-w-max",
3767
+ "onUpdate:modelValue": (e) => he(n)
3768
+ }, null, 8, ["model-value", "onUpdate:modelValue"])])) : c("", !0), (D(!0), l(r, null, j(n.getVisibleCells().filter((e) => e.column.id !== "select"), (e) => (D(), l("td", {
3769
+ key: e.id,
3770
+ class: C(["whitespace-nowrap px-4 py-3 text-dark", I(P(e.column.columnDef.meta).alignment)])
3771
+ }, [u("div", { class: C(["flex w-full items-center gap-1.5", oe(P(e.column.columnDef.meta).alignment)]) }, [F(d)[e.column.id] ? M(t.$slots, e.column.id, {
3772
+ key: 0,
3773
+ row: n.original,
3774
+ rowId: n.id,
3775
+ columnId: e.column.id,
3776
+ value: e.getValue()
3777
+ }) : (D(), l(r, { key: 1 }, [e.column.columnDef.cell ? (D(), s(F(Ur), {
3778
+ key: 0,
3779
+ render: e.column.columnDef.cell,
3780
+ props: e.getContext()
3781
+ }, null, 8, ["render", "props"])) : c("", !0)], 64))], 2)], 2))), 128))], 2))), 128)), !e.initializing && F(w).getRowModel().rows.length === 0 ? (D(), l("tr", si, [u("td", {
3782
+ colspan: re.value,
3783
+ class: "px-4 py-12 text-center text-muted"
3784
+ }, [...n[2] ||= [u("div", { class: "flex flex-col items-center gap-1" }, [u("p", { class: "text-sm font-medium" }, "No results found"), u("p", { class: "text-xs" }, "Try adjusting your search terms")], -1)]], 8, ci)])) : c("", !0)])])])]),
3785
+ e.pageCount !== void 0 || te.value > 1 ? (D(), l("div", li, [u("div", ui, [
3786
+ p(K, {
3787
+ label: "",
3788
+ type: "button",
3789
+ size: "sm",
3790
+ variant: "outline",
3791
+ rounded: !1,
3792
+ "icon-only": !0,
3793
+ class: "!size-[var(--hanaplabstoolkit-size-sm)] !min-w-0 !p-0 hover:!bg-gray-100",
3794
+ disabled: T.value ? E.value <= 1 : !F(w).getCanPreviousPage(),
3795
+ "aria-label": "Previous page",
3796
+ onClick: de
3797
+ }, {
3798
+ icon: z(() => [p(V, {
3799
+ name: "chevron-left",
3800
+ size: 14,
3801
+ decorative: !0
3802
+ })]),
3803
+ _: 1
3804
+ }, 8, ["disabled"]),
3805
+ (D(!0), l(r, null, j(ie.value, (e, t) => (D(), l(r, { key: `${e}-${t}` }, [e === "ellipsis" ? (D(), l("span", di, " ... ")) : (D(), s(K, {
3806
+ key: 0,
3807
+ label: String(e),
3808
+ type: "button",
3809
+ size: "sm",
3810
+ variant: e === E.value ? "solid" : "outline",
3811
+ color: e === E.value ? "primary" : void 0,
3812
+ rounded: !1,
3813
+ class: C(["!size-[var(--hanaplabstoolkit-size-sm)] !min-w-0 !p-0 !font-medium", e === E.value ? "" : "hover:!bg-gray-100"]),
3814
+ onClick: (t) => pe(e)
3815
+ }, null, 8, [
3816
+ "label",
3817
+ "variant",
3818
+ "color",
3819
+ "class",
3820
+ "onClick"
3821
+ ]))], 64))), 128)),
3822
+ p(K, {
3823
+ label: "",
3824
+ type: "button",
3825
+ size: "sm",
3826
+ variant: "outline",
3827
+ rounded: !1,
3828
+ "icon-only": !0,
3829
+ class: "!size-[var(--hanaplabstoolkit-size-sm)] !min-w-0 !p-0 hover:!bg-gray-100",
3830
+ disabled: T.value ? E.value >= te.value : !F(w).getCanNextPage(),
3831
+ "aria-label": "Next page",
3832
+ onClick: fe
3833
+ }, {
3834
+ icon: z(() => [p(V, {
3835
+ name: "chevron-right",
3836
+ size: 14,
3837
+ decorative: !0
3838
+ })]),
3839
+ _: 1
3840
+ }, 8, ["disabled"])
3841
+ ])])) : c("", !0)
3842
+ ]));
3843
+ }
3844
+ }), mi = { class: "w-full" }, hi = { class: "relative" }, gi = [
3845
+ "id",
3846
+ "placeholder",
3847
+ "required",
3848
+ "disabled",
3849
+ "readonly",
3850
+ "rows",
3851
+ "maxlength",
3852
+ "minlength"
3853
+ ], _i = {
3854
+ key: 1,
3855
+ class: "mt-1 space-y-1"
3856
+ }, vi = {
3857
+ key: 0,
3858
+ class: "text-xs text-danger"
3859
+ }, yi = /* @__PURE__ */ be(/* @__PURE__ */ h({
3860
+ __name: "HLTextarea",
3861
+ props: /* @__PURE__ */ b({
3862
+ id: { default: "" },
3863
+ placeholder: { default: "" },
3864
+ label: { default: "" },
3865
+ description: { default: "" },
3866
+ required: {
3867
+ type: Boolean,
3868
+ default: !1
3869
+ },
3870
+ disabled: {
3871
+ type: Boolean,
3872
+ default: !1
3873
+ },
3874
+ readonly: {
3875
+ type: Boolean,
3876
+ default: !1
3877
+ },
3878
+ error: { default: "" },
3879
+ errors: { default: () => [] },
3880
+ rows: { default: 4 },
3881
+ maxlength: {},
3882
+ minlength: {},
3883
+ labelClass: { default: "" },
3884
+ inputClass: { default: "" },
3885
+ noBorder: {
3886
+ type: Boolean,
3887
+ default: !1
3888
+ }
3889
+ }, {
3890
+ modelValue: { default: "" },
3891
+ modelModifiers: {}
3892
+ }),
3893
+ emits: /* @__PURE__ */ b([
3894
+ "focus",
3895
+ "blur",
3896
+ "input"
3897
+ ], ["update:modelValue"]),
3898
+ setup(e, { emit: t }) {
3899
+ let n = L(e, "modelValue"), i = mt({
3900
+ input: n,
3901
+ styleProp: "minHeight"
3902
+ }), a = t;
3903
+ function d(e) {
3904
+ let t = I();
3905
+ return { inputId: o(() => e || t) };
3906
+ }
3907
+ let { inputId: f } = d(e.id), p = o(() => !!e.error || e.errors.length > 0);
3908
+ return (t, o) => (D(), l("div", mi, [
3909
+ e.label || e.description ? (D(), s(Re, {
3910
+ key: 0,
3911
+ label: e.label,
3912
+ description: e.description,
3913
+ "for-id": F(f),
3914
+ required: e.required,
3915
+ "label-class": e.labelClass
3916
+ }, null, 8, [
3917
+ "label",
3918
+ "description",
3919
+ "for-id",
3920
+ "required",
3921
+ "label-class"
3922
+ ])) : c("", !0),
3923
+ u("div", hi, [ue(u("textarea", {
3924
+ id: F(f),
3925
+ ref: F(i).textarea,
3926
+ "onUpdate:modelValue": o[0] ||= (e) => n.value = e,
3927
+ placeholder: e.placeholder,
3928
+ required: e.required,
3929
+ disabled: e.disabled,
3930
+ readonly: e.readonly,
3931
+ rows: e.rows,
3932
+ maxlength: e.maxlength,
3933
+ minlength: e.minlength,
3934
+ class: C(["block w-full appearance-none box-border border border-solid border-gray-200 bg-transparent text-dark placeholder:text-muted leading-tight transition-colors duration-150 hl-no-focus-ring disabled:cursor-not-allowed disabled:opacity-60 py-2.5 px-3 text-sm rounded-md resize-none hanaplabstoolkit-font", [e.inputClass, {
3935
+ "cursor-not-allowed": e.disabled,
3936
+ "border-danger focus:border-danger": p.value,
3937
+ "border-0 focus:border-0": e.noBorder
3938
+ }]]),
3939
+ onFocus: o[1] ||= (e) => a("focus"),
3940
+ onBlur: o[2] ||= (e) => a("blur"),
3941
+ onInput: o[3] ||= (e) => a("input")
3942
+ }, null, 42, gi), [[ce, n.value]])]),
3943
+ p.value ? (D(), l("div", _i, [e.error ? (D(), l("p", vi, N(e.error), 1)) : c("", !0), e.errors.length ? (D(!0), l(r, { key: 1 }, j(e.errors, (e) => (D(), l("p", {
3944
+ key: e,
3945
+ class: "text-xs text-danger"
3946
+ }, N(e), 1))), 128)) : c("", !0)])) : c("", !0)
3947
+ ]));
3948
+ }
3949
+ }), [["__scopeId", "data-v-a5005dfc"]]);
3950
+ //#endregion
3951
+ export { ge as C, he as S, Re as _, pn as a, ke as b, Ht as c, jt as d, Tt as f, J as g, Qe as h, mn as i, Vt as l, gt as m, pi as n, Yt as o, xt as p, xn as r, Jt as s, yi as t, Mt as u, K as v, V as x, Me as y };