@choosemycompany/ui 0.3.0 → 0.9.1

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