@dcs-tech/ui 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/ChartImageMenu-CuuFnW9q.js +1481 -0
  2. package/dist/{ChartView-Cehrcr05.js → ChartView-nS4f4EU_.js} +514 -514
  3. package/dist/{SummaryChart-y27q_BBN.js → SummaryChart-CVg6i2mx.js} +2 -2
  4. package/dist/{SummaryImage-DDNEEu_K.js → SummaryImage-CoEFzMl6.js} +2 -2
  5. package/dist/{SummarySeeAll-0dX-_LFe.js → SummarySeeAll-C_OUs3kn.js} +5 -5
  6. package/dist/assets/fileTask.worker-FQSUtwcz.js +1 -0
  7. package/dist/columnValue-K98ElfJc.js +610 -0
  8. package/dist/exportContext-CJaIv8R-.js +166 -0
  9. package/dist/{exportEngine-DL-jEXFU.js → exportEngine-CDLYHH0d.js} +137 -133
  10. package/dist/fileActions-KSaVGnaE.js +144 -0
  11. package/dist/{geometry-CG2nOEnw.js → geometry-ChwYB45B.js} +433 -497
  12. package/dist/index.js +8572 -8435
  13. package/dist/{defaults-DL745PK1.js → labels-CnqqTrne.js} +3 -79
  14. package/dist/runFileTask-BClLQjmv.js +109 -0
  15. package/dist/scrollArea-DAlVT5U7.js +214 -0
  16. package/dist/style.css +1 -1
  17. package/dist/{summaryChartData-Djo73zb8.js → summaryChartData-pNvzaEHp.js} +1 -1
  18. package/dist/types/components/Charts/parts.d.ts +1 -1
  19. package/dist/types/components/Collapsible/index.d.ts +1 -1
  20. package/dist/types/components/DataTable/DataTable.d.ts +1 -1
  21. package/dist/types/components/DataTable/cards/cardFields.d.ts +2 -4
  22. package/dist/types/components/DataTable/columnValue.d.ts +19 -0
  23. package/dist/types/components/DataTable/export/exportCells.d.ts +13 -0
  24. package/dist/types/components/DataTable/export/exportEngine.d.ts +2 -0
  25. package/dist/types/components/DataTable/export/useTableExport.d.ts +2 -0
  26. package/dist/types/components/DataTable/host.d.ts +2 -0
  27. package/dist/types/components/DataTable/index.d.ts +1 -1
  28. package/dist/types/components/DataTable/labels.d.ts +2 -0
  29. package/dist/types/components/DataTable/types.d.ts +11 -0
  30. package/dist/types/components/DataTable/useTable.d.ts +4 -1
  31. package/dist/types/components/DataTable/vendor/index.d.ts +1 -1
  32. package/dist/types/components/EditableTable/EditableTableCell.d.ts +1 -1
  33. package/dist/types/components/FileEngine/FileEngineContext.d.ts +17 -0
  34. package/dist/types/components/FileEngine/FileEngineProvider.d.ts +12 -0
  35. package/dist/types/components/FileEngine/FileJobsTray.d.ts +10 -0
  36. package/dist/types/components/FileEngine/index.d.ts +8 -0
  37. package/dist/types/components/FileEngine/labels.d.ts +29 -0
  38. package/dist/types/components/Toast/ToastHost.d.ts +1 -0
  39. package/dist/types/components/UIProvider/UIFormatContext.d.ts +7 -0
  40. package/dist/types/components/UIProvider/UILabelsContext.d.ts +116 -0
  41. package/dist/types/components/UIProvider/UIProvider.d.ts +6 -1
  42. package/dist/types/components/UIProvider/index.d.ts +4 -0
  43. package/dist/types/core/logic/collapsible.logic.d.ts +6 -1
  44. package/dist/types/core/logic/datePicker.logic.d.ts +5 -0
  45. package/dist/types/core/logic/exportSafety.logic.d.ts +1 -0
  46. package/dist/types/core/logic/fileQueue.logic.d.ts +28 -0
  47. package/dist/types/core/logic/format.logic.d.ts +4 -0
  48. package/dist/types/core/logic/index.d.ts +4 -0
  49. package/dist/types/core/logic/tableDate.logic.d.ts +7 -0
  50. package/dist/types/core/logic/tableSummary.logic.d.ts +2 -2
  51. package/dist/types/core/types/collapsible.types.d.ts +4 -16
  52. package/dist/types/core/types/fileEngine.types.d.ts +65 -0
  53. package/dist/types/core/types/format.types.d.ts +15 -0
  54. package/dist/types/core/types/index.d.ts +2 -0
  55. package/dist/types/core/types/table.types.d.ts +1 -0
  56. package/dist/types/{components/DataTable/vendor → file}/fileActions.d.ts +17 -7
  57. package/dist/types/file/fileEngine.d.ts +48 -0
  58. package/dist/types/file/tasks/fileTask.worker.d.ts +1 -0
  59. package/dist/types/file/tasks/runFileTask.d.ts +6 -0
  60. package/dist/types/file/workerPool.d.ts +17 -0
  61. package/dist/types/index.d.ts +9 -2
  62. package/package.json +1 -1
  63. package/dist/ChartImageMenu-HILSfn5A.js +0 -1115
  64. package/dist/exportContext-CdpsOzE8.js +0 -235
  65. package/dist/scrollArea-CkPGDYH2.js +0 -210
@@ -1,31 +1,187 @@
1
1
  "use client";
2
- import { l as e, n as t, r as n } from "./defaults-DL745PK1.js";
3
- import { createContext as r, useContext as i, useMemo as a } from "react";
4
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
2
+ import { C as e, S as t, a as n, c as r, n as i, p as a, w as o } from "./columnValue-K98ElfJc.js";
3
+ import { createContext as s, useContext as c, useMemo as l } from "react";
4
+ import { Fragment as ee, jsx as u, jsxs as te } from "react/jsx-runtime";
5
+ // src/components/UIProvider/UILabelsContext.tsx
6
+ var ne = {
7
+ common: { loading: "Loading" },
8
+ dialog: {
9
+ ok: "OK",
10
+ cancel: "Cancel",
11
+ confirm: "Confirm",
12
+ close: "Close"
13
+ },
14
+ toast: { dismiss: "Dismiss" },
15
+ input: {
16
+ clear: "Clear",
17
+ showPassword: "Show password",
18
+ hidePassword: "Hide password"
19
+ },
20
+ select: {
21
+ clear: "Clear selection",
22
+ options: "Select options",
23
+ search: "Search...",
24
+ selectAll: "Select All",
25
+ deselectAll: "Deselect All",
26
+ noResults: "No results found",
27
+ noOptions: "No options available",
28
+ fixed: "Cannot be unchecked",
29
+ alwaysDisabled: "Always disabled",
30
+ maxReached: "Maximum selection reached",
31
+ dragToReorder: "Drag to reorder",
32
+ fixedPosition: "Fixed position (cannot be moved)"
33
+ },
34
+ suggest: {
35
+ placeholder: "Start typing to search...",
36
+ loading: "Loading...",
37
+ noResults: "No results found",
38
+ suggestions: "Suggestions",
39
+ otherGroup: "Other"
40
+ },
41
+ commandPalette: {
42
+ placeholder: "Search…",
43
+ empty: "No results found.",
44
+ name: "Command palette"
45
+ },
46
+ datePicker: {
47
+ clear: "Clear",
48
+ apply: "Search",
49
+ presetRanges: "Preset ranges",
50
+ previousMonth: "Previous month",
51
+ nextMonth: "Next month",
52
+ presets: {
53
+ today: "Today",
54
+ yesterday: "Yesterday",
55
+ last7: "Last 7 days",
56
+ last30: "Last 30 days",
57
+ thisWeek: "This Week",
58
+ lastWeek: "Last Week",
59
+ thisMonth: "This Month",
60
+ lastMonth: "Last Month",
61
+ thisQuarter: "This Quarter",
62
+ lastQuarter: "Last Quarter",
63
+ thisFY: "This FY",
64
+ lastFY: "Last FY",
65
+ ytd: "Year to date"
66
+ }
67
+ },
68
+ stepper: { completed: "Completed" },
69
+ tooltip: { moreInformation: "More information" },
70
+ colorScheme: { sample: "Label" },
71
+ editableTable: {
72
+ addRow: "Add row",
73
+ copyRow: "Copy row",
74
+ deleteRow: "Delete row"
75
+ },
76
+ sidebar: {
77
+ name: "Main",
78
+ closeNavigation: "Close navigation"
79
+ },
80
+ breadcrumbs: {
81
+ name: "Breadcrumb",
82
+ related: "Related pages",
83
+ hidden: (e) => `${e} hidden`
84
+ },
85
+ image: {
86
+ image: "Image",
87
+ images: "Images",
88
+ add: "Add",
89
+ preparing: "Preparing…",
90
+ remove: "Remove",
91
+ previous: "Previous image",
92
+ next: "Next image"
93
+ }
94
+ };
95
+ function re(e, t) {
96
+ if (!t) return e;
97
+ let n = { ...e };
98
+ for (let r of Object.keys(t)) {
99
+ let i = t[r];
100
+ i !== void 0 && (n[r] = i && typeof i == "object" && !Array.isArray(i) && e[r] && typeof e[r] == "object" ? re(e[r], i) : i);
101
+ }
102
+ return n;
103
+ }
104
+ var d = s(ne), ie = ({ labels: e, children: t }) => {
105
+ let n = c(d), r = l(() => re(n, e), [n, e]);
106
+ return /* @__PURE__ */ u(d.Provider, {
107
+ value: r,
108
+ children: t
109
+ });
110
+ };
111
+ ie.displayName = "LabelsProvider";
112
+ var ae = () => c(d), f = /* @__PURE__ */ new Map();
113
+ function p(e, t) {
114
+ let n = `${e ?? ""}|${JSON.stringify(t)}`, r = f.get(n);
115
+ if (!r) {
116
+ try {
117
+ r = new Intl.NumberFormat(e, t);
118
+ } catch {
119
+ r = new Intl.NumberFormat(void 0, {
120
+ ...t,
121
+ ...t.currency ? {
122
+ style: "decimal",
123
+ currency: void 0
124
+ } : {}
125
+ });
126
+ }
127
+ f.set(n, r);
128
+ }
129
+ return r;
130
+ }
131
+ var m = (e) => e === void 0 ? {} : {
132
+ minimumFractionDigits: e,
133
+ maximumFractionDigits: e
134
+ };
135
+ function h(e = {}) {
136
+ let { locale: n, currency: r } = e, i = e.dateFormat ?? "dd-mm-yyyy";
137
+ return {
138
+ locale: n,
139
+ currency: r,
140
+ dateFormat: i,
141
+ number: (e, t) => p(n, m(t)).format(e),
142
+ money: (e, t = 2) => p(n, r ? {
143
+ style: "currency",
144
+ currency: r,
145
+ ...m(t)
146
+ } : m(t)).format(e),
147
+ percent: (e, t = 0) => p(n, {
148
+ style: "percent",
149
+ ...m(t)
150
+ }).format(e),
151
+ day: (e) => t(o(e), i)
152
+ };
153
+ }
154
+ function oe(e, t) {
155
+ return {
156
+ locale: t.locale ?? e.locale,
157
+ currency: t.currency ?? e.currency,
158
+ dateFormat: t.dateFormat ?? e.dateFormat
159
+ };
160
+ }
5
161
  // src/core/logic/tooltip.logic.ts
6
- function l(e) {
162
+ function se(e) {
7
163
  if (e == null || e === !1 || e === "") return null;
8
164
  let t = typeof e == "object" && !Array.isArray(e) && !("$$typeof" in e) && "content" in e ? e : { content: e };
9
165
  return t.disabled || t.content === null || t.content === void 0 || t.content === "" ? null : t;
10
166
  }
11
- function ee(e) {
167
+ function ce(e) {
12
168
  return e.openedBy !== "pointer" || e.anchorTo === "element" ? !1 : e.anchorTo === "pointer" || e.anchorWidth > e.tooltipWidth;
13
169
  }
14
- var te = {
170
+ var le = {
15
171
  top: "bottom",
16
172
  bottom: "top",
17
173
  left: "right",
18
174
  right: "left"
19
175
  };
20
- function ne(e) {
176
+ function ue(e) {
21
177
  let t = e === "top" || e === "bottom" ? ["right", "left"] : ["bottom", "top"];
22
178
  return [
23
179
  e,
24
- te[e],
180
+ le[e],
25
181
  ...t
26
182
  ];
27
183
  }
28
- function re(e, { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 }) {
184
+ function de(e, { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 }) {
29
185
  switch (e) {
30
186
  case "top": return t.top - i - n.height >= a;
31
187
  case "bottom": return t.top + t.height + i + n.height <= r.height - a;
@@ -34,9 +190,9 @@ function re(e, { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 })
34
190
  default: return !1;
35
191
  }
36
192
  }
37
- var ie = (e, t, n) => Math.min(Math.max(e, t), n);
38
- function ae(e) {
39
- let { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 } = e, o = ne(e.placement).find((t) => re(t, e)) || e.placement, s, c;
193
+ var fe = (e, t, n) => Math.min(Math.max(e, t), n);
194
+ function pe(e) {
195
+ let { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 } = e, o = ue(e.placement).find((t) => de(t, e)) || e.placement, s, c;
40
196
  switch (o) {
41
197
  case "bottom":
42
198
  s = t.top + t.height + i, c = t.left + t.width / 2 - n.width / 2;
@@ -51,22 +207,44 @@ function ae(e) {
51
207
  }
52
208
  return {
53
209
  placement: o,
54
- left: ie(c, a, Math.max(a, r.width - n.width - a)),
55
- top: ie(s, a, Math.max(a, r.height - n.height - a))
210
+ left: fe(c, a, Math.max(a, r.width - n.width - a)),
211
+ top: fe(s, a, Math.max(a, r.height - n.height - a))
56
212
  };
57
213
  }
58
214
  // src/components/UIProvider/UIPortalContext.ts
59
- var oe = r(null), se = () => i(oe) || (typeof document > "u" ? null : document.body), ce = {
215
+ var me = s(null), he = () => c(me) || (typeof document > "u" ? null : document.body), g = s({}), ge = ({ children: e, locale: t, currency: n, dateFormat: r }) => {
216
+ let i = c(g), a = l(() => oe(i, {
217
+ locale: t,
218
+ currency: n,
219
+ dateFormat: r
220
+ }), [
221
+ i,
222
+ t,
223
+ n,
224
+ r
225
+ ]);
226
+ return /* @__PURE__ */ u(g.Provider, {
227
+ value: a,
228
+ children: e
229
+ });
230
+ };
231
+ ge.displayName = "FormatProvider";
232
+ function _e() {
233
+ let e = c(g);
234
+ return l(() => h(e), [e]);
235
+ }
236
+ // src/components/DataTable/types.ts
237
+ var ve = {
60
238
  title: 1,
61
239
  subtitle: 1,
62
240
  badge: 1,
63
241
  details: 4,
64
242
  more: 40
65
- }, le = {
243
+ }, ye = {
66
244
  title: 1,
67
245
  subtitle: 2,
68
246
  badge: 1
69
- }, ue = ["top", "bottom"], u = {
247
+ }, be = ["top", "bottom"], _ = {
70
248
  value: ["number", "numberTrend"],
71
249
  ratio: [
72
250
  "bar",
@@ -91,18 +269,18 @@ var oe = r(null), se = () => i(oe) || (typeof document > "u" ? null : document.b
91
269
  "calendar"
92
270
  ],
93
271
  funnel: ["funnel"]
94
- }, de = [
272
+ }, xe = [
95
273
  "auto",
96
274
  "quarter",
97
275
  "half",
98
276
  "full"
99
- ], fe = [
277
+ ], Se = [
100
278
  "top5",
101
279
  "top10",
102
280
  "least5",
103
281
  "least10",
104
282
  "all"
105
- ], pe = {
283
+ ], Ce = {
106
284
  month: [
107
285
  3,
108
286
  6,
@@ -116,7 +294,7 @@ var oe = r(null), se = () => i(oe) || (typeof document > "u" ? null : document.b
116
294
  182,
117
295
  365
118
296
  ]
119
- }, me = {
297
+ }, we = {
120
298
  month: {
121
299
  min: 1,
122
300
  max: 60
@@ -125,263 +303,13 @@ var oe = r(null), se = () => i(oe) || (typeof document > "u" ? null : document.b
125
303
  min: 7,
126
304
  max: 400
127
305
  }
128
- }, he = 6, ge = 24;
129
- function d(e) {
306
+ }, Te = 6, Ee = 24;
307
+ function v(e) {
130
308
  return "logic" in e && "conditions" in e;
131
309
  }
132
- // src/components/DataTable/filters/filterEngine.ts
133
- var _e = [
134
- "contains",
135
- "not_contains",
136
- "starts_with",
137
- "ends_with",
138
- "equals",
139
- "not_equals",
140
- "regex",
141
- "is_empty",
142
- "is_not_empty"
143
- ], ve = [
144
- "equals",
145
- "not_equals",
146
- "gt",
147
- "gte",
148
- "lt",
149
- "lte",
150
- "between",
151
- "not_between",
152
- "is_empty",
153
- "is_not_empty"
154
- ], ye = [
155
- "in_range",
156
- "not_in_range",
157
- "equals",
158
- "before",
159
- "after",
160
- "is_empty",
161
- "is_not_empty"
162
- ], be = [
163
- "is_true",
164
- "is_false",
165
- "is_empty",
166
- "is_not_empty"
167
- ], xe = [
168
- "is",
169
- "is_not",
170
- "is_any_of",
171
- "is_not_any_of",
172
- "is_empty",
173
- "is_not_empty"
174
- ], Se = [
175
- "includes",
176
- "not_includes",
177
- "includes_any",
178
- "includes_all",
179
- "includes_only",
180
- "is_empty",
181
- "is_not_empty",
182
- "length_equals",
183
- "length_gt",
184
- "length_gte",
185
- "length_lt",
186
- "length_lte",
187
- "length_between",
188
- "length_not_between"
189
- ];
190
- function f(e) {
191
- switch (e) {
192
- case "number": return ve;
193
- case "date": return ye;
194
- case "boolean": return be;
195
- case "select": return xe;
196
- case "array": return Se;
197
- default: return _e;
198
- }
199
- }
200
- var Ce = {
201
- date: ["not_equals"],
202
- select: ["contains", "equals"],
203
- array: ["contains", "equals"]
204
- };
205
- function we(e) {
206
- let t = Ce[e];
207
- return t ? [...f(e), ...t] : f(e);
208
- }
209
- var Te = [
210
- "is",
211
- "is_not",
212
- "is_any_of",
213
- "is_not_any_of",
214
- "includes_any",
215
- "includes_all",
216
- "includes_only"
217
- ];
218
- function p(t, n = e) {
219
- let r = n[`op_${t}`];
220
- return typeof r == "string" ? r : t;
221
- }
222
- function Ee(t, n = e) {
223
- return f(t).map((e) => ({
224
- value: e,
225
- label: p(e, n)
226
- }));
227
- }
228
- var De = (e) => String(e).padStart(2, "0");
229
- function m(e) {
230
- if (e == null || e === "") return null;
231
- if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e.trim())) return e.trim();
232
- let t = e instanceof Date ? e : new Date(e);
233
- return Number.isNaN(t.getTime()) ? null : `${t.getFullYear()}-${De(t.getMonth() + 1)}-${De(t.getDate())}`;
234
- }
235
- function Oe(e, t, n) {
236
- let r = m(t?.from), i = m(t?.to);
237
- if (!r && !i) return !0;
238
- let a = m(e);
239
- if (!a) return !1;
240
- let o = (!r || a >= r) && (!i || a <= i);
241
- return n ? o : !o;
242
- }
243
- function h(e, t, r) {
244
- if (!t.enabled || !t.column || !t.operator) return !0;
245
- let i = r?.find((e) => e.key === t.column), a = n(e, t.column), o = i?.filterAccessor ? i.filterAccessor(a) : a, s = t.value, c = i?.type === "number";
246
- switch (t.operator) {
247
- case "is_empty": return Array.isArray(o) ? o.length === 0 : o == null || String(o).trim() === "";
248
- case "is_not_empty": return Array.isArray(o) ? o.length > 0 : o != null && String(o).trim() !== "";
249
- case "contains": return String(o ?? "").toLowerCase().includes(String(s ?? "").toLowerCase());
250
- case "not_contains": return !String(o ?? "").toLowerCase().includes(String(s ?? "").toLowerCase());
251
- case "starts_with": return String(o ?? "").toLowerCase().startsWith(String(s ?? "").toLowerCase());
252
- case "ends_with": return String(o ?? "").toLowerCase().endsWith(String(s ?? "").toLowerCase());
253
- case "equals": return c || typeof o == "number" ? Number(o) === Number(s) : String(o ?? "").toLowerCase() === String(s ?? "").toLowerCase();
254
- case "not_equals": return c || typeof o == "number" ? Number(o) !== Number(s) : String(o ?? "").toLowerCase() !== String(s ?? "").toLowerCase();
255
- case "regex": try {
256
- return new RegExp(s, "i").test(String(o ?? ""));
257
- } catch {
258
- return !0;
259
- }
260
- case "gt": return Number(o) > Number(s);
261
- case "gte": return Number(o) >= Number(s);
262
- case "lt": return Number(o) < Number(s);
263
- case "lte": return Number(o) <= Number(s);
264
- case "between": {
265
- let e = Number(o), t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
266
- return e >= t && e <= n;
267
- }
268
- case "not_between": {
269
- let e = Number(o), t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
270
- return e < t || e > n;
271
- }
272
- case "in_range": return Oe(o, s, !0);
273
- case "not_in_range": return Oe(o, s, !1);
274
- case "before": return new Date(o) < new Date(s);
275
- case "after": return new Date(o) > new Date(s);
276
- case "is_true": return !!o;
277
- case "is_false": return !o;
278
- case "is": return String(o ?? "").toLowerCase() === String(s ?? "").toLowerCase();
279
- case "is_not": return String(o ?? "").toLowerCase() !== String(s ?? "").toLowerCase();
280
- case "is_any_of": return (Array.isArray(s) ? s : [s]).some((e) => String(o ?? "").toLowerCase() === String(e ?? "").toLowerCase());
281
- case "is_not_any_of": return !(Array.isArray(s) ? s : [s]).some((e) => String(o ?? "").toLowerCase() === String(e ?? "").toLowerCase());
282
- case "includes": {
283
- let e = Array.isArray(o) ? o : [], t = String(s ?? "").toLowerCase(), n = i?.filterOptions;
284
- return e.some((e) => {
285
- if (String(e).toLowerCase().includes(t)) return !0;
286
- if (n) {
287
- let r = n.find((t) => String(t.value) === String(e))?.label;
288
- if (r && r.toLowerCase().includes(t)) return !0;
289
- }
290
- return !1;
291
- });
292
- }
293
- case "not_includes": {
294
- let e = Array.isArray(o) ? o : [], t = String(s ?? "").toLowerCase(), n = i?.filterOptions;
295
- return !e.some((e) => {
296
- if (String(e).toLowerCase().includes(t)) return !0;
297
- if (n) {
298
- let r = n.find((t) => String(t.value) === String(e))?.label;
299
- if (r && r.toLowerCase().includes(t)) return !0;
300
- }
301
- return !1;
302
- });
303
- }
304
- case "includes_any": {
305
- let e = Array.isArray(o) ? o : [];
306
- return (Array.isArray(s) ? s : [s]).some((t) => e.some((e) => String(e).toLowerCase() === String(t).toLowerCase()));
307
- }
308
- case "includes_all": {
309
- let e = Array.isArray(o) ? o : [];
310
- return (Array.isArray(s) ? s : [s]).every((t) => e.some((e) => String(e).toLowerCase() === String(t).toLowerCase()));
311
- }
312
- case "includes_only": {
313
- let e = Array.isArray(o) ? o : [], t = Array.isArray(s) ? s : [s];
314
- return e.length === t.length && t.every((t) => e.some((e) => String(e).toLowerCase() === String(t).toLowerCase())) && e.every((e) => t.some((t) => String(e).toLowerCase() === String(t).toLowerCase()));
315
- }
316
- case "length_equals": return (Array.isArray(o) ? o.length : 0) === Number(s);
317
- case "length_gt": return (Array.isArray(o) ? o.length : 0) > Number(s);
318
- case "length_gte": return (Array.isArray(o) ? o.length : 0) >= Number(s);
319
- case "length_lt": return (Array.isArray(o) ? o.length : 0) < Number(s);
320
- case "length_lte": return (Array.isArray(o) ? o.length : 0) <= Number(s);
321
- case "length_between": {
322
- let e = Array.isArray(o) ? o.length : 0, t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
323
- return e >= t && e <= n;
324
- }
325
- case "length_not_between": {
326
- let e = Array.isArray(o) ? o.length : 0, t = Number(s?.from ?? s?.[0]), n = Number(s?.to ?? s?.[1]);
327
- return e < t || e > n;
328
- }
329
- default: return !0;
330
- }
331
- }
332
- function g(e, t, n) {
333
- if (!t.conditions || t.conditions.length === 0) return !0;
334
- let r;
335
- return r = t.logic === "AND" ? t.conditions.every((t) => d(t) ? g(e, t, n) : h(e, t, n)) : t.conditions.some((t) => d(t) ? g(e, t, n) : h(e, t, n)), t.negated ? !r : r;
336
- }
337
- function ke(t, n, r = e) {
338
- let i = [];
339
- function a(e) {
340
- for (let t of e) if (d(t)) a(t.conditions);
341
- else if (t.enabled && t.column && t.operator) {
342
- let e = n.find((e) => e.key === t.column), a = f(e?.type || "string").includes(t.operator);
343
- i.push({
344
- id: t.id,
345
- column: t.column,
346
- columnLabel: e?.header || t.column,
347
- operator: t.operator,
348
- operatorLabel: a ? p(t.operator, r) : t.operator,
349
- value: t.value,
350
- displayValue: je(t.value, t.operator, e?.filterOptions, r)
351
- });
352
- }
353
- }
354
- return a(t.conditions), i;
355
- }
356
- function Ae(e, t) {
357
- if (!t) return String(e ?? "");
358
- let n = t.find((t) => String(t.value) === String(e));
359
- return n ? n.label : String(e ?? "");
360
- }
361
- function je(e, t, n, r) {
362
- if (t === "is_empty" || t === "is_not_empty") return "";
363
- if (t === "is_true") return r.filterTrue;
364
- if (t === "is_false") return r.filterFalse;
365
- if (t === "between" || t === "not_between") return `${e?.from ?? e?.[0] ?? ""} - ${e?.to ?? e?.[1] ?? ""}`;
366
- if (t === "in_range" || t === "not_in_range") {
367
- let t = e?.from ?? "", n = e?.to ?? "";
368
- return t && n ? r.filterRangeBoth(String(t), String(n)) : t ? r.filterRangeFrom(String(t)) : n ? r.filterRangeUntil(String(n)) : "";
369
- }
370
- return (t === "is_any_of" || t === "is_not_any_of" || t === "includes_any" || t === "includes_all" || t === "includes_only") && Array.isArray(e) ? e.map((e) => Ae(e, n)).join(", ") : e == null ? "" : Ae(e, n);
371
- }
372
- function Me(e, t) {
373
- let n = e.conditions.filter((e) => d(e) ? !0 : e.id !== t).map((e) => d(e) ? Me(e, t) : e).filter((e) => !d(e) || e.conditions.length > 0);
374
- return {
375
- ...e,
376
- conditions: n
377
- };
378
- }
379
- function Ne(e) {
380
- return e.conditions.some((e) => d(e) ? Ne(e) : e.enabled && e.column && e.operator);
381
- }
382
310
  // src/components/DataTable/grouping/groupModel.ts
383
- var Pe = 3, _ = (e) => JSON.stringify(e.map((e) => [e.key, e.value]));
384
- function Fe(e, t) {
311
+ var De = 3, Oe = (e) => JSON.stringify(e.map((e) => [e.key, e.value]));
312
+ function ke(e, t) {
385
313
  let n = e.grouping, r = typeof n == "object" && n ? n : {};
386
314
  return {
387
315
  enabled: n !== !1 && t.allowed && (!t.serverMode || t.hasGroupsSource),
@@ -389,43 +317,49 @@ function Fe(e, t) {
389
317
  defaultLevels: r.defaultGroupBy ?? []
390
318
  };
391
319
  }
392
- function Ie(e, t) {
393
- return e.filter((e) => e.authorized !== !1 && v(e, t));
320
+ function Ae(e, t) {
321
+ return e.filter((e) => e.authorized !== !1 && je(e, t));
394
322
  }
395
- function v(e, t) {
323
+ function je(e, t) {
396
324
  return e.groupable ?? (!t && (e.type === "select" || e.type === "boolean"));
397
325
  }
398
- function Le(e, t, n) {
326
+ function Me(e, t, n) {
399
327
  let r = [];
400
328
  for (let n of e ?? []) t.includes(n) && !r.includes(n) && r.push(n);
401
329
  return r.slice(0, n);
402
330
  }
403
- function y(e, t) {
404
- let r = n(t, e.key);
405
- if (e.filterAccessor && (r = e.filterAccessor(r)), r == null || r === "") return null;
406
- if (Array.isArray(r)) {
407
- let e = r.filter((e) => e != null && e !== "").map(String).sort();
331
+ function y(t, i) {
332
+ let a = n(t, i);
333
+ if (t.groupValue) {
334
+ let e = t.groupValue(a, i);
335
+ return e === void 0 || e === "" ? null : e;
336
+ }
337
+ let o = a;
338
+ if (t.filterAccessor && (o = t.filterAccessor(o)), o == null || o === "") return null;
339
+ if (Array.isArray(o)) {
340
+ let e = o.filter((e) => e != null && e !== "").map(String).sort();
408
341
  return e.length ? e.join("|") : null;
409
342
  }
410
- return r instanceof Date ? r.toISOString().slice(0, 10) : e.type === "date" ? String(r).slice(0, 10) : typeof r == "boolean" || typeof r == "number" ? r : String(r);
343
+ return t.type === "date" || o instanceof Date ? e(r(t, a, i)) : typeof o == "boolean" || typeof o == "number" ? o : String(o);
411
344
  }
412
- function b(e, t, n, r) {
413
- if (t == null) return r || n.groupEmpty;
414
- if (r) return r;
415
- if (typeof t == "boolean") return t ? n.yes : n.no;
416
- if (e?.type === "boolean" && (t === "true" || t === "false")) return t === "true" ? n.yes : n.no;
417
- let i = (t) => e?.filterOptions?.find((e) => String(e.value) === t)?.label ?? t;
418
- return e?.type === "array" && typeof t == "string" ? t.split("|").map(i).join(", ") : i(String(t));
345
+ function b(e, n, r, i) {
346
+ if (n == null) return i || r.groupEmpty;
347
+ if (i) return i;
348
+ if (typeof n == "boolean") return n ? r.yes : r.no;
349
+ if (e?.type === "date" && typeof n == "string") return t(n, e.dateFormat ?? "dd-mm-yyyy");
350
+ if (e?.type === "boolean" && (n === "true" || n === "false")) return n === "true" ? r.yes : r.no;
351
+ let a = (t) => e?.filterOptions?.find((e) => String(e.value) === t)?.label ?? t;
352
+ return e?.type === "array" && typeof n == "string" ? n.split("|").map(a).join(", ") : a(String(n));
419
353
  }
420
354
  var x = typeof Intl < "u" ? new Intl.Collator(void 0, {
421
355
  numeric: !0,
422
356
  sensitivity: "base"
423
- }) : null, Re = (e, t) => x ? x.compare(e, t) : e.localeCompare(t);
424
- function ze(e, t) {
357
+ }) : null, Ne = (e, t) => x ? x.compare(e, t) : e.localeCompare(t);
358
+ function Pe(e, t) {
425
359
  return [...e].sort((e, n) => {
426
360
  if (e.value === null && n.value !== null) return 1;
427
361
  if (n.value === null && e.value !== null) return -1;
428
- let r = typeof e.value == "number" && typeof n.value == "number" ? e.value - n.value : Re(e.label, n.label);
362
+ let r = typeof e.value == "number" && typeof n.value == "number" ? e.value - n.value : Ne(e.label, n.label);
429
363
  return t ? -r : r;
430
364
  });
431
365
  }
@@ -439,14 +373,14 @@ function S(e, t, n, r) {
439
373
  rows: []
440
374
  }), a.rows.push(t);
441
375
  }
442
- return ze(Array.from(s.values()).map((e) => {
376
+ return Pe(Array.from(s.values()).map((e) => {
443
377
  let t = [...o, {
444
378
  key: i.key,
445
379
  field: i.field || i.key,
446
380
  value: e.value
447
381
  }];
448
382
  return {
449
- key: _(t),
383
+ key: Oe(t),
450
384
  path: t,
451
385
  depth: o.length,
452
386
  columnKey: i.key,
@@ -461,11 +395,11 @@ function S(e, t, n, r) {
461
395
  };
462
396
  }), r.sortedDesc?.(i.key) === !0);
463
397
  }
464
- function Be(e, t = []) {
465
- for (let n of e ?? []) t.push(n.key), Be(n.children, t);
398
+ function C(e, t = []) {
399
+ for (let n of e ?? []) t.push(n.key), C(n.children, t);
466
400
  return t;
467
401
  }
468
- function Ve(e, t) {
402
+ function Fe(e, t) {
469
403
  let n = [], r = (e) => {
470
404
  for (let i of e) {
471
405
  let e = t.expanded.has(i.key);
@@ -524,8 +458,8 @@ function Ve(e, t) {
524
458
  };
525
459
  return r(e), n;
526
460
  }
527
- var He = (e) => e.kind === "group" ? e.node.depth : e.kind === "row" ? e.depth : e.node.depth + 1;
528
- function Ue(e, t, n) {
461
+ var Ie = (e) => e.kind === "group" ? e.node.depth : e.kind === "row" ? e.depth : e.node.depth + 1;
462
+ function Le(e, t, n) {
529
463
  let r = t * n, i = e.slice(r, r + n), a = i[0];
530
464
  if (!a || r === 0) return i;
531
465
  let o = [];
@@ -533,14 +467,14 @@ function Ue(e, t, n) {
533
467
  let n = e[t];
534
468
  n.kind === "group" && (o.length = n.node.depth, o.push(n));
535
469
  }
536
- let s = He(a);
470
+ let s = Ie(a);
537
471
  return [...o.slice(0, s).map((e) => ({
538
472
  ...e,
539
473
  key: `${e.key}:cont`,
540
474
  continued: !0
541
475
  })), ...i];
542
476
  }
543
- function We(e, t, n, r) {
477
+ function Re(e, t, n, r) {
544
478
  return r === null ? {
545
479
  id: e,
546
480
  column: t,
@@ -573,14 +507,14 @@ function We(e, t, n, r) {
573
507
  enabled: !0
574
508
  };
575
509
  }
576
- function Ge(e) {
510
+ function ze(e) {
577
511
  return [...e.type === "boolean" ? ["is_true", "is_false"] : e.type === "array" ? ["includes"] : e.type === "select" ? ["is"] : ["equals"], "is_empty"];
578
512
  }
579
- function Ke(e, t) {
580
- return e.map((e, n) => We(`group:${n}:${e.key}`, e.key, t.find((t) => t.key === e.key), e.value));
513
+ function Be(e, t) {
514
+ return e.map((e, n) => Re(`group:${n}:${e.key}`, e.key, t.find((t) => t.key === e.key), e.value));
581
515
  }
582
- function qe(e, t, n) {
583
- let r = Ke(t, n);
516
+ function Ve(e, t, n) {
517
+ let r = Be(t, n);
584
518
  return r.length ? e.logic === "AND" && !e.negated ? {
585
519
  ...e,
586
520
  conditions: [...e.conditions, ...r]
@@ -591,29 +525,29 @@ function qe(e, t, n) {
591
525
  } : e;
592
526
  }
593
527
  // src/components/DataTable/summary/summaryModel.ts
594
- var Je = "summary:", C = (e) => `${Je}${e}`, Ye = (e) => e.kind === "breakdown" || e.kind === "trend" || e.kind === "funnel";
595
- function Xe(e) {
596
- return e.kind === "value" ? e.trend ? u.value : ["number"] : e.kind === "trend" ? [
528
+ var He = "summary:", w = (e) => `${He}${e}`, Ue = (e) => e.kind === "breakdown" || e.kind === "trend" || e.kind === "funnel";
529
+ function We(e) {
530
+ return e.kind === "value" ? e.trend ? _.value : ["number"] : e.kind === "trend" ? [
597
531
  ...e.period === "day" ? ["calendar"] : [],
598
532
  "columns",
599
533
  "line",
600
534
  "area",
601
535
  ...e.split ? ["grouped", "stacked"] : []
602
- ] : u[e.kind];
536
+ ] : _[e.kind];
603
537
  }
604
- function w(e) {
605
- let t = Xe(e), n = "chart" in e ? e.chart : void 0;
538
+ function T(e) {
539
+ let t = We(e), n = "chart" in e ? e.chart : void 0;
606
540
  return n && t.includes(n) ? n : t[0];
607
541
  }
608
- function Ze(e) {
542
+ function Ge(e) {
609
543
  return e.kind === "value" ? [e.value, ...e.sub ? [e.sub.value] : []] : e.kind === "ratio" ? [
610
544
  e.value,
611
545
  e.total,
612
546
  ...e.sub ? [e.sub.value] : []
613
547
  ] : [];
614
548
  }
615
- var Qe = 9;
616
- function $e(e) {
549
+ var Ke = 9;
550
+ function qe(e) {
617
551
  if (e === "all") return { from: "all" };
618
552
  let t = /^(top|least)(\d+)$/.exec(e);
619
553
  return {
@@ -621,15 +555,15 @@ function $e(e) {
621
555
  count: Number(t[2])
622
556
  };
623
557
  }
624
- function T(e, t = 9) {
625
- return e.show ? $e(e.show) : w(e) === "bars" ? { from: "all" } : {
558
+ function E(e, t = 9) {
559
+ return e.show ? qe(e.show) : T(e) === "bars" ? { from: "all" } : {
626
560
  from: "top",
627
561
  count: t
628
562
  };
629
563
  }
630
- var et = (e) => e.label ?? (e.value === null ? "" : String(e.value));
631
- function tt(e, t) {
632
- let n = [...e].sort((e, t) => t.count - e.count || et(e).localeCompare(et(t)));
564
+ var Je = (e) => e.label ?? (e.value === null ? "" : String(e.value));
565
+ function Ye(e, t) {
566
+ let n = [...e].sort((e, t) => t.count - e.count || Je(e).localeCompare(Je(t)));
633
567
  return t.from === "all" || t.count >= n.length ? {
634
568
  buckets: t.from === "least" ? n.reverse() : n,
635
569
  others: 0,
@@ -640,23 +574,23 @@ function tt(e, t) {
640
574
  values: e.length
641
575
  };
642
576
  }
643
- var nt = (e) => !!e.within && w(e) === "treemap", E = (e) => !!e.split && (w(e) === "grouped" || w(e) === "stacked"), rt = (e) => !!e.trend && w(e) === "numberTrend";
644
- function it(e, t) {
577
+ var Xe = (e) => !!e.within && T(e) === "treemap", D = (e) => !!e.split && (T(e) === "grouped" || T(e) === "stacked"), Ze = (e) => !!e.trend && T(e) === "numberTrend";
578
+ function Qe(e, t) {
645
579
  switch (e.kind) {
646
- case "trend": return `${e.id}.${e.period === "day" ? "d" : "m"}${e.count}${E(e) ? `.s${e.split}` : ""}`;
580
+ case "trend": return `${e.id}.${e.period === "day" ? "d" : "m"}${e.count}${D(e) ? `.s${e.split}` : ""}`;
647
581
  case "funnel": return `${e.id}.f`;
648
582
  case "value": return `${e.id}.t${e.trend?.period === "day" ? "d" : "m"}${e.trend?.count ?? 0}`;
649
583
  case "breakdown": {
650
- let n = T(e, t);
651
- return `${e.id}.${n.from === "all" ? "all" : `${n.from}${n.count}`}${nt(e) ? `.w${e.within}` : ""}`;
584
+ let n = E(e, t);
585
+ return `${e.id}.${n.from === "all" ? "all" : `${n.from}${n.count}`}${Xe(e) ? `.w${e.within}` : ""}`;
652
586
  }
653
587
  }
654
588
  }
655
- function at(e, t) {
656
- let n = Array.from(new Set(e.flatMap((e) => Ze(e).map((e) => e.id)))), r = (e) => t.find((t) => t.key === e)?.field || e, i = /* @__PURE__ */ new Map();
589
+ function $e(e, t) {
590
+ let n = Array.from(new Set(e.flatMap((e) => Ge(e).map((e) => e.id)))), r = (e) => t.find((t) => t.key === e)?.field || e, i = /* @__PURE__ */ new Map();
657
591
  for (let t of e) {
658
- if (t.kind === "ratio" || t.kind === "value" && !rt(t)) continue;
659
- let e = it(t);
592
+ if (t.kind === "ratio" || t.kind === "value" && !Ze(t)) continue;
593
+ let e = Qe(t);
660
594
  if (!i.has(e)) switch (t.kind) {
661
595
  case "value":
662
596
  i.set(e, {
@@ -675,8 +609,8 @@ function at(e, t) {
675
609
  id: t.id,
676
610
  kind: "breakdown",
677
611
  field: r(t.column),
678
- part: T(t),
679
- ...nt(t) ? { within: r(t.within) } : {}
612
+ part: E(t),
613
+ ...Xe(t) ? { within: r(t.within) } : {}
680
614
  });
681
615
  break;
682
616
  case "trend":
@@ -687,7 +621,7 @@ function at(e, t) {
687
621
  field: r(t.column),
688
622
  period: t.period,
689
623
  count: t.count,
690
- ...E(t) ? { split: r(t.split) } : {}
624
+ ...D(t) ? { split: r(t.split) } : {}
691
625
  });
692
626
  break;
693
627
  case "funnel": i.set(e, {
@@ -703,34 +637,34 @@ function at(e, t) {
703
637
  cards: Array.from(i.values())
704
638
  };
705
639
  }
706
- function ot(e, t) {
640
+ function et(e, t) {
707
641
  if (e.logic !== "AND" || e.negated) return;
708
- let n = C(t);
709
- return e.conditions.find((e) => !d(e) && e.id === n && e.enabled);
642
+ let n = w(t);
643
+ return e.conditions.find((e) => !v(e) && e.id === n && e.enabled);
710
644
  }
711
- function st(e, t) {
712
- let n = ot(e, t);
645
+ function tt(e, t) {
646
+ let n = et(e, t);
713
647
  return n ? {
714
648
  ...e,
715
649
  conditions: e.conditions.filter((e) => e !== n)
716
650
  } : e;
717
651
  }
718
- function ct(e, n, r) {
719
- let i = C(n), a = e.logic === "AND" && !e.negated ? e : {
720
- id: t(),
652
+ function nt(e, t, n) {
653
+ let r = w(t), i = e.logic === "AND" && !e.negated ? e : {
654
+ id: a(),
721
655
  logic: "AND",
722
656
  conditions: e.conditions.length ? [e] : []
723
- }, o = a.conditions.filter((e) => d(e) || e.id !== i);
657
+ }, o = i.conditions.filter((e) => v(e) || e.id !== r);
724
658
  return {
725
- ...a,
726
- conditions: r ? [...o, r] : o
659
+ ...i,
660
+ conditions: n ? [...o, n] : o
727
661
  };
728
662
  }
729
- function lt(e, t, n) {
730
- return We(C(e.id), e.column, t, n);
663
+ function rt(e, t, n) {
664
+ return Re(w(e.id), e.column, t, n);
731
665
  }
732
- function ut(e, t) {
733
- let n = C(e.id);
666
+ function it(e, t) {
667
+ let n = w(e.id);
734
668
  if (t.length > 7) return {
735
669
  id: n,
736
670
  column: e.column,
@@ -753,16 +687,16 @@ function ut(e, t) {
753
687
  enabled: !0
754
688
  };
755
689
  }
756
- function dt(e, t) {
690
+ function at(e, t) {
757
691
  let n = e.steps.find((e) => e.id === t);
758
692
  return n?.condition ? {
759
- id: C(e.id),
693
+ id: w(e.id),
760
694
  ...n.condition,
761
695
  enabled: !0
762
696
  } : null;
763
697
  }
764
- var D = (e) => e === null ? "" : String(e), ft = "\0others";
765
- function pt(e, t) {
698
+ var O = (e) => e === null ? "" : String(e), ot = "\0others";
699
+ function st(e, t) {
766
700
  if (!t) return null;
767
701
  if (e.kind === "trend") {
768
702
  let n = t.value?.from;
@@ -770,13 +704,13 @@ function pt(e, t) {
770
704
  }
771
705
  return e.kind === "funnel" ? e.steps.find((e) => !!e.condition && e.condition.column === t.column && e.condition.operator === t.operator && JSON.stringify(e.condition.value) === JSON.stringify(t.value))?.id ?? null : t.operator === "is_empty" ? "" : t.operator === "is_true" ? "true" : t.operator === "is_false" ? "false" : String(t.value);
772
706
  }
773
- function O(e, t) {
707
+ function k(e, t) {
774
708
  return e.compute ? e.compute(t) : t.length;
775
709
  }
776
- function k(e, t) {
710
+ function A(e, t) {
777
711
  let n = /* @__PURE__ */ new Map();
778
712
  for (let r of e) {
779
- let e = y(t, r), i = D(e), a = n.get(i);
713
+ let e = y(t, r), i = O(e), a = n.get(i);
780
714
  a ? a.count++ : n.set(i, {
781
715
  value: e,
782
716
  count: 1
@@ -784,63 +718,63 @@ function k(e, t) {
784
718
  }
785
719
  return Array.from(n.values());
786
720
  }
787
- function mt(e, t, n, r) {
721
+ function ct(e, t, n, r) {
788
722
  return {
789
723
  ...e,
790
724
  buckets: e.buckets.map((e) => ({
791
725
  ...e,
792
- children: k(t.filter((t) => D(y(n, t)) === D(e.value)), r)
726
+ children: A(t.filter((t) => O(y(n, t)) === O(e.value)), r)
793
727
  }))
794
728
  };
795
729
  }
796
- function ht(e, t = /* @__PURE__ */ new Date()) {
730
+ function lt(e, t = /* @__PURE__ */ new Date()) {
797
731
  return Array.from({ length: e }, (n, r) => {
798
732
  let i = new Date(t.getFullYear(), t.getMonth() - (e - 1 - r), 1);
799
733
  return `${i.getFullYear()}-${String(i.getMonth() + 1).padStart(2, "0")}`;
800
734
  });
801
735
  }
802
- function A(e, t = /* @__PURE__ */ new Date()) {
736
+ function ut(e, t = /* @__PURE__ */ new Date()) {
803
737
  let n = (e) => String(e).padStart(2, "0");
804
738
  return Array.from({ length: e }, (r, i) => {
805
739
  let a = new Date(t.getFullYear(), t.getMonth(), t.getDate() - (e - 1 - i));
806
740
  return `${a.getFullYear()}-${n(a.getMonth() + 1)}-${n(a.getDate())}`;
807
741
  });
808
742
  }
809
- function gt(e, t, r, i) {
810
- let a = new Map(r.map((e) => [e, []]));
811
- for (let r of e) {
812
- let e = m(n(r, t.key)), o = e === null ? null : i === "month" ? e.slice(0, 7) : e;
813
- o !== null && a.get(o)?.push(r);
743
+ function dt(t, n, r, a) {
744
+ let o = new Map(r.map((e) => [e, []]));
745
+ for (let r of t) {
746
+ let t = e(i(n, r)), s = t === null ? null : a === "month" ? t.slice(0, 7) : t;
747
+ s !== null && o.get(s)?.push(r);
814
748
  }
815
- return a;
749
+ return o;
816
750
  }
817
- function _t(e, t, n, r, i, a) {
818
- let o = n === "month" ? ht(r, i) : A(r, i), s = gt(e, t, o, n);
751
+ function ft(e, t, n, r, i, a) {
752
+ let o = n === "month" ? lt(r, i) : ut(r, i), s = dt(e, t, o, n);
819
753
  return o.map((e) => {
820
754
  let t = s.get(e);
821
755
  return {
822
756
  period: e,
823
757
  count: t.length,
824
- ...a ? { split: k(t, a) } : {}
758
+ ...a ? { split: A(t, a) } : {}
825
759
  };
826
760
  });
827
761
  }
828
- function vt(e, t, n, r, i, a) {
829
- let o = r === "month" ? ht(2 * i, a) : A(2 * i, a), s = gt(e, n, o, r), c = o.slice(0, i).flatMap((e) => s.get(e));
762
+ function pt(e, t, n, r, i, a) {
763
+ let o = r === "month" ? lt(2 * i, a) : ut(2 * i, a), s = dt(e, n, o, r), c = o.slice(0, i).flatMap((e) => s.get(e));
830
764
  return {
831
765
  points: o.slice(i).map((e) => ({
832
766
  period: e,
833
- count: O(t, s.get(e))
767
+ count: k(t, s.get(e))
834
768
  })),
835
- previous: O(t, c)
769
+ previous: k(t, c)
836
770
  };
837
771
  }
838
- function yt(e, t, n, r, i, a) {
772
+ function mt(e, t, n, r, i, a) {
839
773
  let o = n.buckets.map((e) => ({
840
774
  ...e,
841
- key: D(e.value),
775
+ key: O(e.value),
842
776
  label: b(t, e.value, r, e.label)
843
- })), s = T(e, i).from === "least";
777
+ })), s = E(e, i).from === "least";
844
778
  o.sort((e, t) => (s ? e.count - t.count : t.count - e.count) || e.label.localeCompare(t.label));
845
779
  let c = o.map((t, n) => ({
846
780
  key: t.key,
@@ -849,13 +783,13 @@ function yt(e, t, n, r, i, a) {
849
783
  count: t.count,
850
784
  slot: e.slots?.[t.key] ?? n + 1,
851
785
  ...t.children ? { children: [...t.children].sort((e, t) => t.count - e.count).map((e) => ({
852
- key: D(e.value),
786
+ key: O(e.value),
853
787
  label: b(a, e.value, r, e.label),
854
788
  count: e.count
855
789
  })) } : {}
856
790
  }));
857
791
  return n.others > 0 && c.push({
858
- key: ft,
792
+ key: ot,
859
793
  value: null,
860
794
  label: r.others,
861
795
  count: n.others,
@@ -863,18 +797,18 @@ function yt(e, t, n, r, i, a) {
863
797
  others: !0
864
798
  }), c;
865
799
  }
866
- var bt = (e, t) => {
800
+ var ht = (e, t) => {
867
801
  try {
868
802
  return new Intl.DateTimeFormat(e, t);
869
803
  } catch {
870
804
  return new Intl.DateTimeFormat(void 0, t);
871
805
  }
872
806
  };
873
- function xt(e, t, n) {
874
- let r = bt(n, t === "month" ? { month: "short" } : {
807
+ function gt(e, t, n) {
808
+ let r = ht(n, t === "month" ? { month: "short" } : {
875
809
  day: "numeric",
876
810
  month: "short"
877
- }), i = bt(n, t === "month" ? {
811
+ }), i = ht(n, t === "month" ? {
878
812
  month: "long",
879
813
  year: "numeric"
880
814
  } : { dateStyle: "medium" });
@@ -888,11 +822,11 @@ function xt(e, t, n) {
888
822
  };
889
823
  });
890
824
  }
891
- function St(e, t, n, r) {
825
+ function _t(e, t, n, r) {
892
826
  let i = /* @__PURE__ */ new Map(), a = t.map((e) => {
893
827
  let t = {};
894
828
  for (let a of e.split ?? []) {
895
- let e = D(a.value);
829
+ let e = O(a.value);
896
830
  t[e] = (t[e] ?? 0) + a.count;
897
831
  let o = i.get(e) ?? {
898
832
  value: a.value,
@@ -916,13 +850,13 @@ var j = (e, t) => t > 0 ? e / t * 100 : 0;
916
850
  function M(e) {
917
851
  return e > 0 && e < 1 ? "<1%" : e > 99 && e < 100 ? ">99%" : `${Math.round(e)}%`;
918
852
  }
919
- function Ct(e, t) {
853
+ function vt(e, t) {
920
854
  return e.text ? e.text(t) : `${e.label}: ${t}`;
921
855
  }
922
- function wt(e, t) {
856
+ function yt(e, t) {
923
857
  return e.flatMap((e) => e.kind === "value" && e.value !== null ? [`${e.card.title} ${t(e.value)}`] : e.kind === "ratio" && e.value !== null && e.total !== null ? [`${e.card.title} ${M(j(e.value, e.total))}`] : []).join(" · ");
924
858
  }
925
- function Tt(e, t, n) {
859
+ function bt(e, t, n) {
926
860
  let r = {}, i = [];
927
861
  for (let a of e) {
928
862
  if (a.kind === "value" && a.value !== null && (r[a.card.title] = a.value), a.kind === "ratio" && a.value !== null && a.total !== null && (r[a.card.title] = `${n(a.value)} / ${n(a.total)} (${M(j(a.value, a.total))})`), (a.kind === "value" || a.kind === "ratio") && a.sub && a.sub.value !== null && (r[a.sub.line.label] = a.sub.value), a.kind === "breakdown" && a.buckets && i.push({
@@ -961,7 +895,7 @@ function Tt(e, t, n) {
961
895
  };
962
896
  }
963
897
  // src/components/Charts/palette.ts
964
- var Et = 10, N = {
898
+ var xt = 10, N = {
965
899
  light: {
966
900
  1: "#2a78d6",
967
901
  2: "#eb6834",
@@ -998,7 +932,7 @@ var Et = 10, N = {
998
932
  info: "#6b95ea",
999
933
  neutral: "#737380"
1000
934
  }
1001
- }, Dt = {
935
+ }, St = {
1002
936
  light: {
1003
937
  lightness: [
1004
938
  .46,
@@ -1032,7 +966,7 @@ var Et = 10, N = {
1032
966
  background: "#1f1f1f"
1033
967
  }
1034
968
  };
1035
- function Ot(e, t, n) {
969
+ function Ct(e, t, n) {
1036
970
  let r = n * Math.PI / 180, i = t * Math.cos(r), a = t * Math.sin(r), o = (e + .3963377774 * i + .2158037573 * a) ** 3, s = (e - .1055613458 * i - .0638541728 * a) ** 3, c = (e - .0894841775 * i - 1.291485548 * a) ** 3;
1037
971
  return [
1038
972
  4.0767416621 * o - 3.3077115913 * s + .2309699292 * c,
@@ -1040,10 +974,10 @@ function Ot(e, t, n) {
1040
974
  -.0041960863 * o - .7034186147 * s + 1.707614701 * c
1041
975
  ];
1042
976
  }
1043
- var kt = (e) => `#${e.map((e) => {
977
+ var wt = (e) => `#${e.map((e) => {
1044
978
  let t = Math.min(1, Math.max(0, e)), n = t <= .0031308 ? 12.92 * t : 1.055 * t ** (1 / 2.4) - .055;
1045
979
  return Math.round(n * 255).toString(16).padStart(2, "0");
1046
- }).join("")}`, At = (e, t, n) => kt(Ot(e, t, n));
980
+ }).join("")}`, Tt = (e, t, n) => wt(Ct(e, t, n));
1047
981
  function P(e) {
1048
982
  let t = (t) => {
1049
983
  let n = parseInt(e.slice(t, t + 2), 16) / 255;
@@ -1059,15 +993,15 @@ function P(e) {
1059
993
  .0259040371 * a + .7827717662 * o - .808675766 * s
1060
994
  ];
1061
995
  }
1062
- var F = (e, t) => Math.hypot(e[0] - t[0], e[1] - t[1], e[2] - t[2]), jt = {};
1063
- function Mt(e) {
1064
- let t = jt[e];
996
+ var F = (e, t) => Math.hypot(e[0] - t[0], e[1] - t[1], e[2] - t[2]), Et = {};
997
+ function Dt(e) {
998
+ let t = Et[e];
1065
999
  if (t) return t;
1066
- let n = Dt[e], r = [];
1000
+ let n = St[e], r = [];
1067
1001
  for (let e of n.lightness) for (let t of n.chroma) for (let i = 0; i < 360; i += n.hueStep) {
1068
- let n = Ot(e, t, i);
1002
+ let n = Ct(e, t, i);
1069
1003
  if (n.some((e) => e < -5e-4 || e > 1.0005)) continue;
1070
- let a = kt(n);
1004
+ let a = wt(n);
1071
1005
  r.push({
1072
1006
  hex: a,
1073
1007
  lab: P(a)
@@ -1082,9 +1016,9 @@ function Mt(e) {
1082
1016
  candidates: r,
1083
1017
  nearest: r.map((e) => Math.min(...a.map((t) => F(t, e.lab))))
1084
1018
  };
1085
- return jt[e] = o, o;
1019
+ return Et[e] = o, o;
1086
1020
  }
1087
- function Nt(e) {
1021
+ function Ot(e) {
1088
1022
  let t = -1;
1089
1023
  for (let n = 0; n < e.candidates.length; n++) (t < 0 || e.nearest[n] > e.nearest[t]) && (t = n);
1090
1024
  if (t < 0 || e.nearest[t] <= 0) {
@@ -1096,15 +1030,15 @@ function Nt(e) {
1096
1030
  for (let t = 0; t < e.candidates.length; t++) e.nearest[t] = Math.min(e.nearest[t], F(n.lab, e.candidates[t].lab));
1097
1031
  }
1098
1032
  function I(e, t) {
1099
- let n = Mt(t);
1100
- for (; n.colours.length <= e;) Nt(n);
1033
+ let n = Dt(t);
1034
+ for (; n.colours.length <= e;) Ot(n);
1101
1035
  return n.colours[e];
1102
1036
  }
1103
- var Pt = (e, t) => typeof e == "number" ? I(e - 1, t) : N[t][e];
1104
- function Ft(e) {
1037
+ var kt = (e, t) => typeof e == "number" ? I(e - 1, t) : N[t][e];
1038
+ function At(e) {
1105
1039
  return typeof e != "number" || e <= 10 ? `var(--chart-series-${e})` : `var(--chart-scheme-light, ${I(e - 1, "light")}) var(--chart-scheme-dark, ${I(e - 1, "dark")})`;
1106
1040
  }
1107
- var It = {
1041
+ var jt = {
1108
1042
  bands: [{
1109
1043
  below: 20,
1110
1044
  color: "negative"
@@ -1113,11 +1047,11 @@ var It = {
1113
1047
  color: "warning"
1114
1048
  }],
1115
1049
  above: "positive"
1116
- }, Lt = (e) => typeof e == "object" && !!e;
1117
- function Rt(e, t) {
1118
- return Lt(e) ? e.bands.find((e) => t < e.below)?.color ?? e.above : e;
1050
+ }, Mt = (e) => typeof e == "object" && !!e;
1051
+ function Nt(e, t) {
1052
+ return Mt(e) ? e.bands.find((e) => t < e.below)?.color ?? e.above : e;
1119
1053
  }
1120
- var zt = (e) => typeof e == "string" && e.startsWith("#"), Bt = (e) => zt(e) ? e : Ft(e), L = (e, t) => zt(e) ? e : Pt(e, t), Vt = {
1054
+ var Pt = (e) => typeof e == "string" && e.startsWith("#"), Ft = (e) => Pt(e) ? e : At(e), L = (e, t) => Pt(e) ? e : kt(e, t), It = {
1121
1055
  light: [
1122
1056
  "#e8eff9",
1123
1057
  "#bcd3f2",
@@ -1132,11 +1066,11 @@ var zt = (e) => typeof e == "string" && e.startsWith("#"), Bt = (e) => zt(e) ? e
1132
1066
  "#4f8bd6",
1133
1067
  "#82baff"
1134
1068
  ]
1135
- }, Ht = (e) => `var(--chart-heat-${Math.max(0, Math.min(Vt.light.length - 1, e))})`, R = {
1069
+ }, Lt = (e) => `var(--chart-heat-${Math.max(0, Math.min(It.light.length - 1, e))})`, R = {
1136
1070
  dark: "#0f0f0f",
1137
1071
  light: "#ffffff"
1138
1072
  };
1139
- function Ut(e) {
1073
+ function Rt(e) {
1140
1074
  let t = (t) => {
1141
1075
  let n = parseInt(e.slice(t, t + 2), 16) / 255;
1142
1076
  return n <= .04045 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4;
@@ -1144,14 +1078,14 @@ function Ut(e) {
1144
1078
  return .2126 * t(1) + .7152 * t(3) + .0722 * t(5);
1145
1079
  }
1146
1080
  function z(e) {
1147
- let t = Ut(e);
1081
+ let t = Rt(e);
1148
1082
  return (t + .05) / .05 > 1.05 / (t + .05) ? R.dark : R.light;
1149
1083
  }
1150
- function Wt(e) {
1084
+ function zt(e) {
1151
1085
  return `var(--chart-scheme-light, ${z(L(e, "light"))}) var(--chart-scheme-dark, ${z(L(e, "dark"))})`;
1152
1086
  }
1153
1087
  // src/components/Charts/labels.ts
1154
- var Gt = {
1088
+ var Bt = {
1155
1089
  legend: "Legend",
1156
1090
  total: "Total",
1157
1091
  empty: "No records",
@@ -1196,10 +1130,10 @@ var Gt = {
1196
1130
  funnelOfFirst: "Of the first step",
1197
1131
  funnelDrop: "Drop from the step before"
1198
1132
  }, B = (e, t = !1) => `chart-root ${e}${t ? " chart-compact" : ""}`;
1199
- function Kt({ title: e, children: t }) {
1200
- return e == null || e === "" ? /* @__PURE__ */ s(o, { children: t }) : /* @__PURE__ */ c("figure", {
1133
+ function Vt({ title: e, children: t }) {
1134
+ return e == null || e === "" ? /* @__PURE__ */ u(ee, { children: t }) : /* @__PURE__ */ te("figure", {
1201
1135
  className: B("chart-titled"),
1202
- children: [/* @__PURE__ */ s("figcaption", {
1136
+ children: [/* @__PURE__ */ u("figcaption", {
1203
1137
  className: "chart-title",
1204
1138
  children: e
1205
1139
  }), t]
@@ -1208,34 +1142,36 @@ function Kt({ title: e, children: t }) {
1208
1142
  function V(e) {
1209
1143
  return e > 0 && e < .1 ? "<0.1%" : e < 100 && e > 99.9 ? ">99.9%" : `${e.toFixed(1)}%`;
1210
1144
  }
1211
- var qt = (e) => e === 0 ? V(0) : `${e > 0 ? "−" : "+"}${V(Math.abs(e))}`;
1212
- function Jt({ locale: e = "en-IN", format: t, labels: n }) {
1145
+ var Ht = (e) => e === 0 ? V(0) : `${e > 0 ? "−" : "+"}${V(Math.abs(e))}`;
1146
+ function Ut({ locale: e, format: t, labels: n }) {
1147
+ let r = _e().locale, i = e ?? r, a = l(() => {
1148
+ if (t) return t;
1149
+ let e;
1150
+ try {
1151
+ e = new Intl.NumberFormat(i);
1152
+ } catch {
1153
+ e = new Intl.NumberFormat();
1154
+ }
1155
+ return (t) => e.format(t);
1156
+ }, [i, t]), o = ae().charts;
1213
1157
  return {
1214
- nf: a(() => {
1215
- if (t) return t;
1216
- let n;
1217
- try {
1218
- n = new Intl.NumberFormat(e);
1219
- } catch {
1220
- n = new Intl.NumberFormat();
1221
- }
1222
- return (e) => n.format(e);
1223
- }, [e, t]),
1224
- L: a(() => ({
1225
- ...Gt,
1158
+ nf: a,
1159
+ L: l(() => ({
1160
+ ...Bt,
1161
+ ...o,
1226
1162
  ...n
1227
- }), [n])
1163
+ }), [o, n])
1228
1164
  };
1229
1165
  }
1230
- function Yt({ ariaLabel: e, text: t, compact: n }) {
1231
- return /* @__PURE__ */ s("div", {
1166
+ function Wt({ ariaLabel: e, text: t, compact: n }) {
1167
+ return /* @__PURE__ */ u("div", {
1232
1168
  className: B("chart-empty", n),
1233
1169
  role: "img",
1234
1170
  "aria-label": `${e}: ${t}`,
1235
1171
  children: t
1236
1172
  });
1237
1173
  }
1238
- function Xt(e, t, n, r = {}) {
1174
+ function Gt(e, t, n, r = {}) {
1239
1175
  if (n <= 0) return null;
1240
1176
  let i = {
1241
1177
  ArrowLeft: -1,
@@ -1246,15 +1182,15 @@ function Xt(e, t, n, r = {}) {
1246
1182
  };
1247
1183
  return e === "Home" ? 0 : e === "End" ? n - 1 : !(e in i) || i[e] === 0 ? null : t === null ? i[e] > 0 ? 0 : n - 1 : Math.max(0, Math.min(n - 1, t + i[e]));
1248
1184
  }
1249
- function Zt(e, t, n, r = {}, i = () => !0) {
1250
- let a = Xt(e, t, n, r);
1185
+ function Kt(e, t, n, r = {}, i = () => !0) {
1186
+ let a = Gt(e, t, n, r);
1251
1187
  if (a === null || i(a)) return a;
1252
1188
  let o = e === "Home" ? !0 : e === "End" ? !1 : t === null ? a === 0 : a > t;
1253
1189
  for (let e = a; e >= 0 && e < n; e += o ? 1 : -1) if (i(e)) return e;
1254
1190
  return t !== null && i(t) ? t : null;
1255
1191
  }
1256
- function Qt({ text: e }) {
1257
- return /* @__PURE__ */ s("span", {
1192
+ function qt({ text: e }) {
1193
+ return /* @__PURE__ */ u("span", {
1258
1194
  className: "chart-sr-only",
1259
1195
  "aria-live": "polite",
1260
1196
  children: e
@@ -1292,7 +1228,7 @@ function U(e) {
1292
1228
  case "number": return e.points?.length ? ["numberTrend", "number"] : ["number"];
1293
1229
  }
1294
1230
  }
1295
- function $t(e, t, n) {
1231
+ function Jt(e, t, n) {
1296
1232
  let r = U(e).filter((e) => !n || n.includes(e)), i = r.length ? r : U(e);
1297
1233
  return t && i.includes(t) ? t : i[0];
1298
1234
  }
@@ -1300,7 +1236,7 @@ var W = (e) => [{
1300
1236
  key: "n",
1301
1237
  label: e,
1302
1238
  slot: 1
1303
- }], en = (e, t) => ({
1239
+ }], Yt = (e, t) => ({
1304
1240
  ...e.key === void 0 ? {} : { key: e.key },
1305
1241
  label: e.label,
1306
1242
  ...e.fullLabel === void 0 ? {} : { fullLabel: e.fullLabel },
@@ -1309,15 +1245,15 @@ var W = (e) => [{
1309
1245
  ...e.href ? { href: e.href } : {},
1310
1246
  ...e.slot === void 0 ? {} : { slot: e.slot }
1311
1247
  }), G = (e, t) => e.slot ?? t + 1;
1312
- function tn(e, t, n, r) {
1313
- let i = $t(e, t, r);
1248
+ function Xt(e, t, n, r) {
1249
+ let i = Jt(e, t, r);
1314
1250
  switch (e.type) {
1315
1251
  case "values": {
1316
1252
  let t = H(e.series) ? e.series : W(n.count);
1317
1253
  if (i === "bars") return {
1318
1254
  kind: "bars",
1319
1255
  series: t,
1320
- data: e.values.map((t) => en(t, H(e.series)))
1256
+ data: e.values.map((t) => Yt(t, H(e.series)))
1321
1257
  };
1322
1258
  if (i === "treemap") return {
1323
1259
  kind: "treemap",
@@ -1355,7 +1291,7 @@ function tn(e, t, n, r) {
1355
1291
  count: e.count ?? Object.values(e.counts ?? {}).reduce((e, t) => e + t, 0)
1356
1292
  }))
1357
1293
  };
1358
- let t = H(e.series), r = t ? e.series : W(n.count), a = e.points.map((e) => en(e, t));
1294
+ let t = H(e.series), r = t ? e.series : W(n.count), a = e.points.map((e) => Yt(e, t));
1359
1295
  if (i === "line" || i === "area") return {
1360
1296
  kind: "line",
1361
1297
  area: i === "area",
@@ -1390,7 +1326,7 @@ function tn(e, t, n, r) {
1390
1326
  key: "value",
1391
1327
  label: e.label,
1392
1328
  value: e.value,
1393
- slot: Rt(e.color ?? 1, t)
1329
+ slot: Nt(e.color ?? 1, t)
1394
1330
  }, {
1395
1331
  key: "rest",
1396
1332
  label: n.rest,
@@ -1437,13 +1373,13 @@ function tn(e, t, n, r) {
1437
1373
  }
1438
1374
  }
1439
1375
  // src/components/Charts/geometry.ts
1440
- var nn = (e) => e.key ?? e.label, rn = (e, t) => t.reduce((t, n) => t + (e.values[n.key] ?? 0), 0), an = 2 * Math.PI * 40, on = 1.2;
1441
- function sn(e) {
1376
+ var Zt = (e) => e.key ?? e.label, Qt = (e, t) => t.reduce((t, n) => t + (e.values[n.key] ?? 0), 0), $t = 2 * Math.PI * 40, en = 1.2;
1377
+ function tn(e) {
1442
1378
  let t = e.reduce((e, t) => e + t.value, 0);
1443
1379
  if (!t) return [];
1444
- let n = e.filter((e) => e.value > 0).length > 1 ? on : 0, r = 0, i = [];
1380
+ let n = e.filter((e) => e.value > 0).length > 1 ? en : 0, r = 0, i = [];
1445
1381
  for (let a of e) {
1446
- let e = a.value / t * an;
1382
+ let e = a.value / t * $t;
1447
1383
  a.value > 0 && i.push({
1448
1384
  slice: a,
1449
1385
  start: r,
@@ -1453,13 +1389,13 @@ function sn(e) {
1453
1389
  return i;
1454
1390
  }
1455
1391
  var K = (e, t) => t ? e / t * 100 : 0;
1456
- function cn(e) {
1392
+ function nn(e) {
1457
1393
  if (e <= 5) return 5;
1458
1394
  let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
1459
1395
  return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * t;
1460
1396
  }
1461
- function ln(e) {
1462
- let t = cn(Math.max(1, ...e));
1397
+ function rn(e) {
1398
+ let t = nn(Math.max(1, ...e));
1463
1399
  return {
1464
1400
  max: t,
1465
1401
  ticks: [
@@ -1469,8 +1405,8 @@ function ln(e) {
1469
1405
  ]
1470
1406
  };
1471
1407
  }
1472
- var un = (e) => Math.max(1, ...e), dn = (e, t) => t <= 12 || e % Math.ceil(t / 12) === 0, fn = (e, t, n = "stacked") => n === "grouped" ? e.flatMap((e) => t.map((t) => e.values[t.key] ?? 0)) : e.map((e) => rn(e, t));
1473
- function pn(e, t, n = 2) {
1408
+ var an = (e) => Math.max(1, ...e), on = (e, t) => t <= 12 || e % Math.ceil(t / 12) === 0, sn = (e, t, n = "stacked") => n === "grouped" ? e.flatMap((e) => t.map((t) => e.values[t.key] ?? 0)) : e.map((e) => Qt(e, t));
1409
+ function cn(e, t, n = 2) {
1474
1410
  if (e <= 0) return [];
1475
1411
  let r = Math.max(0, (t - n * (e - 1)) / e);
1476
1412
  return Array.from({ length: e }, (e, t) => ({
@@ -1479,26 +1415,26 @@ function pn(e, t, n = 2) {
1479
1415
  }));
1480
1416
  }
1481
1417
  var q = (e, t, n) => t <= 1 ? n / 2 : e / (t - 1) * n;
1482
- function mn(e, t, n, r) {
1418
+ function ln(e, t, n, r) {
1483
1419
  return e.map((i, a) => ({
1484
1420
  x: q(a, e.length, t),
1485
1421
  y: n - Math.max(0, i) / (r || 1) * n
1486
1422
  }));
1487
1423
  }
1488
- var J = (e) => Math.round(e * 100) / 100, hn = (e) => e.map((e, t) => `${t ? "L" : "M"}${J(e.x)} ${J(e.y)}`).join(" ");
1489
- function gn(e, t) {
1490
- return e.length ? `${hn(e)} L${J(e[e.length - 1].x)} ${J(t)} L${J(e[0].x)} ${J(t)} Z` : "";
1424
+ var J = (e) => Math.round(e * 100) / 100, un = (e) => e.map((e, t) => `${t ? "L" : "M"}${J(e.x)} ${J(e.y)}`).join(" ");
1425
+ function dn(e, t) {
1426
+ return e.length ? `${un(e)} L${J(e[e.length - 1].x)} ${J(t)} L${J(e[0].x)} ${J(t)} Z` : "";
1491
1427
  }
1492
- function _n(e, t, n) {
1428
+ function fn(e, t, n) {
1493
1429
  return n <= 1 || t <= 0 ? 0 : Math.max(0, Math.min(n - 1, Math.round(e / t * (n - 1))));
1494
1430
  }
1495
- function vn(e, t = 6) {
1431
+ function pn(e, t = 6) {
1496
1432
  if (e <= 0) return [];
1497
1433
  if (e <= t) return Array.from({ length: e }, (e, t) => t);
1498
1434
  let n = (e - 1) / (t - 1);
1499
1435
  return Array.from(new Set(Array.from({ length: t }, (e, t) => Math.round(t * n))));
1500
1436
  }
1501
- function yn(e, t, n) {
1437
+ function mn(e, t, n) {
1502
1438
  if (!e.length) return [];
1503
1439
  let r = Math.min(...e), i = Math.max(...e);
1504
1440
  return e.map((a, o) => ({
@@ -1506,7 +1442,7 @@ function yn(e, t, n) {
1506
1442
  y: i === r ? n / 2 : n - (a - r) / (i - r) * n
1507
1443
  }));
1508
1444
  }
1509
- function bn(e, t) {
1445
+ function hn(e, t) {
1510
1446
  let n = e - t;
1511
1447
  return {
1512
1448
  direction: n > 0 ? "up" : n < 0 ? "down" : "same",
@@ -1514,7 +1450,7 @@ function bn(e, t) {
1514
1450
  percent: t ? n / t * 100 : n ? null : 0
1515
1451
  };
1516
1452
  }
1517
- function xn(e, t) {
1453
+ function gn(e, t) {
1518
1454
  return e === "same" || t === "none" ? "neutral" : e === t ? "positive" : "negative";
1519
1455
  }
1520
1456
  function Y(e, t, n, r) {
@@ -1524,7 +1460,7 @@ function Y(e, t, n, r) {
1524
1460
  };
1525
1461
  }
1526
1462
  var X = (e) => Math.round(e * 1e4) / 1e4;
1527
- function Sn(e, t, n, r, i) {
1463
+ function _n(e, t, n, r, i) {
1528
1464
  if (i - r >= 2 * Math.PI - 1e-9) {
1529
1465
  let i = Y(e, t, n, r + Math.PI), a = Y(e, t, n, r + 2 * Math.PI - 1e-4), o = Y(e, t, n, r);
1530
1466
  return `M${X(o.x)} ${X(o.y)} A${n} ${n} 0 0 1 ${X(i.x)} ${X(i.y)} A${n} ${n} 0 0 1 ${X(a.x)} ${X(a.y)}`;
@@ -1532,26 +1468,26 @@ function Sn(e, t, n, r, i) {
1532
1468
  let a = Y(e, t, n, r), o = Y(e, t, n, i);
1533
1469
  return `M${X(a.x)} ${X(a.y)} A${n} ${n} 0 ${+(i - r > Math.PI)} 1 ${X(o.x)} ${X(o.y)}`;
1534
1470
  }
1535
- function Cn(e, t, n, r, i) {
1471
+ function vn(e, t, n, r, i) {
1536
1472
  if (i - r >= 2 * Math.PI - 1e-9) return `M${X(e)} ${X(t - n)} A${n} ${n} 0 1 1 ${X(e)} ${X(t + n)} A${n} ${n} 0 1 1 ${X(e)} ${X(t - n)} Z`;
1537
1473
  let a = Y(e, t, n, r), o = Y(e, t, n, i);
1538
1474
  return `M${X(e)} ${X(t)} L${X(a.x)} ${X(a.y)} A${n} ${n} 0 ${+(i - r > Math.PI)} 1 ${X(o.x)} ${X(o.y)} Z`;
1539
1475
  }
1540
- var wn = 864e5;
1476
+ var yn = 864e5;
1541
1477
  function Z(e) {
1542
1478
  let [t, n, r] = e.split("-").map(Number);
1543
1479
  return Date.UTC(t, n - 1, r);
1544
1480
  }
1545
- var Tn = (e) => new Date(e).toISOString().slice(0, 10), En = (e) => (new Date(Z(e)).getUTCDay() + 6) % 7;
1546
- function Dn(e, t) {
1547
- let n = Z(e), r = Math.min(371, Math.max(0, Math.round((Z(t) - n) / wn) + 1));
1548
- return Array.from({ length: r }, (e, t) => Tn(n + t * wn));
1481
+ var bn = (e) => new Date(e).toISOString().slice(0, 10), xn = (e) => (new Date(Z(e)).getUTCDay() + 6) % 7;
1482
+ function Sn(e, t) {
1483
+ let n = Z(e), r = Math.min(371, Math.max(0, Math.round((Z(t) - n) / yn) + 1));
1484
+ return Array.from({ length: r }, (e, t) => bn(n + t * yn));
1549
1485
  }
1550
- var On = 371;
1551
- function kn(e, t) {
1486
+ var Cn = 371;
1487
+ function wn(e, t) {
1552
1488
  return e <= 0 || t <= 0 ? 0 : Math.min(4, Math.max(1, Math.ceil(e / t * 4)));
1553
1489
  }
1554
- function An(e) {
1490
+ function Tn(e) {
1555
1491
  if (!e.length) return {
1556
1492
  cells: [],
1557
1493
  weeks: 0,
@@ -1559,14 +1495,14 @@ function An(e) {
1559
1495
  max: 0,
1560
1496
  total: 0
1561
1497
  };
1562
- let t = [...e].sort((e, t) => e.day.localeCompare(t.day)), n = new Map(t.map((e) => [e.day, e.count])), r = Dn(t[0].day, t[t.length - 1].day), i = En(r[0]), a = Math.max(0, ...r.map((e) => n.get(e) ?? 0)), o = r.map((e, t) => {
1498
+ let t = [...e].sort((e, t) => e.day.localeCompare(t.day)), n = new Map(t.map((e) => [e.day, e.count])), r = Sn(t[0].day, t[t.length - 1].day), i = xn(r[0]), a = Math.max(0, ...r.map((e) => n.get(e) ?? 0)), o = r.map((e, t) => {
1563
1499
  let r = n.get(e) ?? 0;
1564
1500
  return {
1565
1501
  day: e,
1566
1502
  count: r,
1567
1503
  week: Math.floor((t + i) / 7),
1568
1504
  weekday: (t + i) % 7,
1569
- level: kn(r, a)
1505
+ level: wn(r, a)
1570
1506
  };
1571
1507
  }), s = o.filter((e) => e.day.endsWith("-01")).map((e) => ({
1572
1508
  month: e.day.slice(0, 7),
@@ -1587,9 +1523,9 @@ var Q = {
1587
1523
  min: 4,
1588
1524
  max: 16,
1589
1525
  compactMax: 12
1590
- }, jn = 8;
1591
- function Mn(e, t, n = Q.max, r = 1) {
1592
- let i = Math.floor(n * r), a = jn * r;
1526
+ }, En = 8;
1527
+ function Dn(e, t, n = Q.max, r = 1) {
1528
+ let i = Math.floor(n * r), a = En * r;
1593
1529
  if (!e || t <= 0) return {
1594
1530
  cell: i,
1595
1531
  gap: 2,
@@ -1601,7 +1537,7 @@ function Mn(e, t, n = Q.max, r = 1) {
1601
1537
  cell: r,
1602
1538
  gap: n
1603
1539
  };
1604
- }, s = o(e - Nn(r));
1540
+ }, s = o(e - On(r));
1605
1541
  if (s.cell >= a) return {
1606
1542
  cell: Math.min(i, s.cell),
1607
1543
  gap: s.gap,
@@ -1614,12 +1550,12 @@ function Mn(e, t, n = Q.max, r = 1) {
1614
1550
  weekdays: !1
1615
1551
  };
1616
1552
  }
1617
- var Nn = (e = 1) => Math.round(28 * e), Pn = (e = 1) => 26 * e;
1618
- function Fn(e, t, n = 1) {
1553
+ var On = (e = 1) => Math.round(28 * e), kn = (e = 1) => 26 * e;
1554
+ function An(e, t, n = 1) {
1619
1555
  let r = [];
1620
1556
  for (let i of e) {
1621
1557
  let e = r[r.length - 1];
1622
- (!e || (i.week - e.week) * t >= Pn(n)) && r.push(i);
1558
+ (!e || (i.week - e.week) * t >= kn(n)) && r.push(i);
1623
1559
  }
1624
1560
  return r;
1625
1561
  }
@@ -1681,14 +1617,14 @@ function $(e, t) {
1681
1617
  }
1682
1618
  return l.length && c(l), n;
1683
1619
  }
1684
- var In = {
1620
+ var jn = {
1685
1621
  w: 44,
1686
1622
  h: 28
1687
1623
  };
1688
- function Ln(e, t, n, r = 1) {
1624
+ function Mn(e, t, n, r = 1) {
1689
1625
  let i = {
1690
- w: In.w * r,
1691
- h: In.h * r
1626
+ w: jn.w * r,
1627
+ h: jn.h * r
1692
1628
  }, a = 16 * r, o = (e) => e.w >= i.w && e.h >= i.h, s = [], c = $(e.map((e) => e.value), {
1693
1629
  x: 0,
1694
1630
  y: 0,
@@ -1731,8 +1667,8 @@ function Ln(e, t, n, r = 1) {
1731
1667
  });
1732
1668
  }), s;
1733
1669
  }
1734
- var Rn = (e) => Math.max(.55, 1 - e * .09);
1735
- function zn(e) {
1670
+ var Nn = (e) => Math.max(.55, 1 - e * .09);
1671
+ function Pn(e) {
1736
1672
  let t = Math.max(0, ...e.map((e) => e.value)), n = e[0]?.value ?? 0;
1737
1673
  return e.map((r, i) => {
1738
1674
  let a = i > 0 ? e[i - 1].value : 0;
@@ -1744,7 +1680,7 @@ function zn(e) {
1744
1680
  };
1745
1681
  });
1746
1682
  }
1747
- var Bn = {
1683
+ var Fn = {
1748
1684
  half: {
1749
1685
  width: 120,
1750
1686
  height: 68,
@@ -1764,16 +1700,16 @@ var Bn = {
1764
1700
  to: 2 * Math.PI
1765
1701
  }
1766
1702
  };
1767
- function Vn(e, t) {
1768
- let n = Bn[e], r = Math.max(0, Math.min(100, t)) / 100;
1703
+ function In(e, t) {
1704
+ let n = Fn[e], r = Math.max(0, Math.min(100, t)) / 100;
1769
1705
  return {
1770
1706
  a0: n.from,
1771
1707
  a1: n.to,
1772
1708
  end: n.from + (n.to - n.from) * r
1773
1709
  };
1774
1710
  }
1775
- var Hn = .62, Un = 8;
1776
- function Wn(e, t = 48, n = 50) {
1711
+ var Ln = .62, Rn = 8;
1712
+ function zn(e, t = 48, n = 50) {
1777
1713
  let r = e.reduce((e, t) => e + t.value, 0);
1778
1714
  if (!r) return [];
1779
1715
  let i = 0, a = [];
@@ -1782,7 +1718,7 @@ function Wn(e, t = 48, n = 50) {
1782
1718
  let e = K(o.value, r), s = i + o.value / r * 2 * Math.PI, c = e < 8 ? null : e >= 100 ? {
1783
1719
  x: n,
1784
1720
  y: n
1785
- } : Y(n, n, t * Hn, (i + s) / 2);
1721
+ } : Y(n, n, t * Ln, (i + s) / 2);
1786
1722
  a.push({
1787
1723
  slice: o,
1788
1724
  a0: i,
@@ -1793,4 +1729,4 @@ function Wn(e, t = 48, n = 50) {
1793
1729
  }
1794
1730
  return a;
1795
1731
  }
1796
- export { Dt as $, S as $t, Wn as A, d as An, dt as At, $t as B, St as Bt, sn as C, ge as Cn, T as Ct, hn as D, me as Dn, _t as Dt, pn as E, pe as En, O as Et, yn as F, ne as Fn, M as Ft, Qt as G, C as Gt, W as H, Ct as Ht, $ as I, ee as In, xt as It, V as J, ut as Jt, Kt as K, Tt as Kt, Ln as L, pt as Lt, Y as M, se as Mn, wt as Mt, K as N, ae as Nn, ot as Nt, mn as O, he as On, k as Ot, dn as P, l as Pn, tt as Pt, Gt as Q, Be as Qt, bn as R, ct as Rt, xn as S, u as Sn, lt as St, Vn as T, ue as Tn, w as Tt, tn as U, it as Ut, U as V, E as Vt, Yt as W, Xe as Wt, Zt as X, st as Xt, qt as Y, mt as Yt, Jt as Z, Pe as Zt, fn as _, Ne as _n, Pt as _t, Un as a, v as an, I as at, Z as b, ce as bn, Je as bt, vn as c, Fe as cn, Ht as ct, An as d, Te as dn, Lt as dt, Ve as en, Vt as et, Fn as f, we as fn, Rt as ft, ln as g, Ee as gn, Ft as gt, Rn as h, ke as hn, At as ht, Bn as i, Le as in, Et as it, q as j, oe as jn, Ye as jt, _n as k, de as kn, vt as kt, un as l, Ge as ln, P as lt, Nn as m, g as mn, F as mt, On as n, b as nn, It as nt, Sn as o, Ue as on, Bt as ot, Pn as p, h as pn, Ut as pt, B as q, at as qt, an as r, Ie as rn, N as rt, gn as s, _ as sn, L as st, Q as t, Ke as tn, R as tt, Mn as u, qe as un, z as ut, nn as v, p as vn, Wt as vt, zn as w, fe as wn, yt as wt, Dn as x, le as xn, Qe as xt, rn as y, Me as yn, ft as yt, Cn as z, j as zt };
1732
+ export { St as $, S as $t, zn as A, h as An, at as At, Jt as B, _t as Bt, tn as C, _e as Cn, E as Ct, un as D, se as Dn, ft as Dt, cn as E, pe as En, k as Et, mn as F, M as Ft, qt as G, w as Gt, W as H, vt as Ht, $ as I, gt as It, V as J, it as Jt, Vt as K, bt as Kt, Mn as L, st as Lt, Y as M, ie as Mn, yt as Mt, K as N, ae as Nn, et as Nt, ln as O, ue as On, A as Ot, on as P, Ye as Pt, Bt as Q, C as Qt, hn as R, nt as Rt, gn as S, ge as Sn, rt as St, In as T, he as Tn, T as Tt, Xt as U, Qe as Ut, U as V, D as Vt, Wt as W, We as Wt, Kt as X, tt as Xt, Ht as Y, ct as Yt, Ut as Z, De as Zt, sn as _, Ce as _n, kt as _t, Rn as a, je as an, I as at, Z as b, xe as bn, He as bt, pn as c, ke as cn, Lt as ct, Tn as d, ve as dn, Mt as dt, Fe as en, It as et, An as f, ye as fn, Nt as ft, rn as g, be as gn, At as gt, Nn as h, Se as hn, Tt as ht, Fn as i, Me as in, xt as it, q as j, ne as jn, Ue as jt, fn as k, ce as kn, pt as kt, an as l, ze as ln, P as lt, On as m, Ee as mn, F as mt, Cn as n, b as nn, jt as nt, _n as o, Le as on, Ft as ot, kn as p, _ as pn, Rt as pt, B as q, $e as qt, $t as r, Ae as rn, N as rt, dn as s, Oe as sn, L as st, Q as t, Be as tn, R as tt, Dn as u, Ve as un, z as ut, Zt as v, we as vn, zt as vt, Pn as w, me as wn, mt as wt, Sn as x, v as xn, Ke as xt, Qt as y, Te as yn, ot as yt, vn as z, j as zt };