@dcs-tech/ui 0.9.0 → 0.10.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 (97) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/README.md +40 -5
  3. package/dist/{ChartImageMenu-DDVNJNc6.js → ChartImageMenu-3OfqNFyt.js} +557 -546
  4. package/dist/{ChartView-CW3m4Z_1.js → ChartView-n4G5_2ro.js} +35 -31
  5. package/dist/{SummaryChart-CxRjK_HU.js → SummaryChart-i6fOdrDM.js} +2 -2
  6. package/dist/{SummaryImage-Crf1R-3a.js → SummaryImage-CCt5ozD9.js} +2 -2
  7. package/dist/{SummarySeeAll-BRHOMQRA.js → SummarySeeAll-BY8knsRe.js} +5 -5
  8. package/dist/{columnValue-DwUqueZ6.js → columnValue-74XDBcVF.js} +219 -192
  9. package/dist/{exportContext-BKFnNQ0q.js → exportContext-C52ZuHd8.js} +2 -2
  10. package/dist/{exportEngine-BFZD6djX.js → exportEngine-BmDly7iw.js} +1 -1
  11. package/dist/{geometry-yZmKN662.js → geometry-DG134nYI.js} +379 -273
  12. package/dist/index.js +12456 -9277
  13. package/dist/{labels-CnqqTrne.js → labels-BPItSeRU.js} +2 -0
  14. package/dist/scrollArea-D84Cwm4o.js +310 -0
  15. package/dist/style.css +1 -1
  16. package/dist/{summaryChartData-CARqGRUl.js → summaryChartData-BiQYJbYZ.js} +8 -2
  17. package/dist/types/components/Alert/Alert.d.ts +16 -0
  18. package/dist/types/components/Alert/index.d.ts +2 -0
  19. package/dist/types/components/Card/Card.d.ts +4 -3
  20. package/dist/types/components/Card/index.d.ts +1 -1
  21. package/dist/types/components/Charts/Funnel.d.ts +2 -1
  22. package/dist/types/components/Charts/chartImage.d.ts +1 -0
  23. package/dist/types/components/ChipInput/ChipTags.d.ts +3 -0
  24. package/dist/types/components/CommandPalette/CommandPaletteTrigger.d.ts +9 -0
  25. package/dist/types/components/CommandPalette/index.d.ts +2 -0
  26. package/dist/types/components/DataTable/TablePagination.d.ts +1 -1
  27. package/dist/types/components/DataTable/TableToolbar.d.ts +2 -1
  28. package/dist/types/components/DataTable/TableView.d.ts +1 -0
  29. package/dist/types/components/DataTable/cards/cardFields.d.ts +1 -0
  30. package/dist/types/components/DataTable/defaults.d.ts +4 -0
  31. package/dist/types/components/DataTable/index.d.ts +1 -1
  32. package/dist/types/components/DataTable/labels.d.ts +2 -0
  33. package/dist/types/components/DataTable/types.d.ts +18 -2
  34. package/dist/types/components/DataTable/ui-local/TableReorderList.d.ts +13 -0
  35. package/dist/types/components/DataTable/ui.d.ts +2 -1
  36. package/dist/types/components/DataTable/useTable.d.ts +1 -0
  37. package/dist/types/components/DatePicker/PeriodGrid.d.ts +13 -0
  38. package/dist/types/components/DatePicker/PeriodPicker.d.ts +19 -0
  39. package/dist/types/components/DatePicker/index.d.ts +1 -1
  40. package/dist/types/components/Dialog/dialogSlots.d.ts +9 -0
  41. package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +8 -0
  42. package/dist/types/components/FieldWrapper/index.d.ts +1 -1
  43. package/dist/types/components/Fields/index.d.ts +1 -1
  44. package/dist/types/components/Image/ImageEditor.d.ts +21 -0
  45. package/dist/types/components/Image/ImagePicker.d.ts +10 -1
  46. package/dist/types/components/Image/imageRender.d.ts +33 -0
  47. package/dist/types/components/Image/index.d.ts +3 -1
  48. package/dist/types/components/Image/prepareImage.d.ts +4 -3
  49. package/dist/types/components/Link/Link.d.ts +22 -0
  50. package/dist/types/components/Link/index.d.ts +2 -0
  51. package/dist/types/components/NavList/NavList.d.ts +13 -0
  52. package/dist/types/components/NavList/index.d.ts +2 -0
  53. package/dist/types/components/PageProgress/PageProgress.d.ts +10 -0
  54. package/dist/types/components/PageProgress/index.d.ts +2 -0
  55. package/dist/types/components/Pagination/Pagination.d.ts +19 -0
  56. package/dist/types/components/Pagination/index.d.ts +2 -0
  57. package/dist/types/components/Popover/Popover.d.ts +1 -1
  58. package/dist/types/components/Popover/floatingPosition.d.ts +4 -0
  59. package/dist/types/components/ReorderList/ReorderGroup.d.ts +16 -0
  60. package/dist/types/components/ReorderList/ReorderList.d.ts +55 -0
  61. package/dist/types/components/ReorderList/crossListDrag.d.ts +61 -0
  62. package/dist/types/components/ReorderList/index.d.ts +5 -0
  63. package/dist/types/components/ReorderList/useReorderDrag.d.ts +28 -0
  64. package/dist/types/components/Tooltip/useTooltip.d.ts +4 -0
  65. package/dist/types/components/UIProvider/UILabelsContext.d.ts +86 -0
  66. package/dist/types/core/hooks/index.d.ts +1 -0
  67. package/dist/types/core/hooks/useMeasuredState.d.ts +1 -0
  68. package/dist/types/core/logic/alert.logic.d.ts +3 -0
  69. package/dist/types/core/logic/commandPalette.logic.d.ts +2 -0
  70. package/dist/types/core/logic/datePicker.logic.d.ts +12 -0
  71. package/dist/types/core/logic/fieldWrapper.logic.d.ts +6 -1
  72. package/dist/types/core/logic/imageEditor.logic.d.ts +132 -0
  73. package/dist/types/core/logic/imageTransform.logic.d.ts +57 -0
  74. package/dist/types/core/logic/index.d.ts +9 -0
  75. package/dist/types/core/logic/inertProps.d.ts +3 -0
  76. package/dist/types/core/logic/pageProgress.logic.d.ts +3 -0
  77. package/dist/types/core/logic/pagination.logic.d.ts +7 -0
  78. package/dist/types/core/logic/periodPicker.logic.d.ts +86 -0
  79. package/dist/types/core/logic/reorder.logic.d.ts +49 -0
  80. package/dist/types/core/types/chipinput.types.d.ts +3 -1
  81. package/dist/types/core/types/collapsible.types.d.ts +3 -0
  82. package/dist/types/core/types/datePicker.types.d.ts +7 -0
  83. package/dist/types/core/types/field.types.d.ts +6 -3
  84. package/dist/types/core/types/fieldWrapper.types.d.ts +2 -0
  85. package/dist/types/core/types/fields.types.d.ts +6 -1
  86. package/dist/types/core/types/form.types.d.ts +1 -0
  87. package/dist/types/core/types/format.types.d.ts +2 -0
  88. package/dist/types/core/types/input.types.d.ts +2 -0
  89. package/dist/types/core/types/navigation.types.d.ts +1 -0
  90. package/dist/types/core/types/select.types.d.ts +2 -6
  91. package/dist/types/core/types/suggest.types.d.ts +2 -0
  92. package/dist/types/index.d.ts +24 -6
  93. package/package.json +1 -1
  94. package/dist/scrollArea-DbYFqbIH.js +0 -269
  95. package/dist/types/components/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +0 -4
  96. package/dist/types/components/DataTable/ui-local/DragAndDropList/index.d.ts +0 -3
  97. package/dist/types/components/DataTable/ui-local/DragAndDropList/types.d.ts +0 -70
@@ -1,7 +1,7 @@
1
1
  "use client";
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-DwUqueZ6.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";
2
+ import { B as e, D as t, O as n, a as r, c as i, g as a, k as o, n as s } from "./columnValue-74XDBcVF.js";
3
+ import { createContext as c, useContext as l, useMemo as u } from "react";
4
+ import { Fragment as ee, jsx as d, jsxs as te } from "react/jsx-runtime";
5
5
  // src/components/UIProvider/UILabelsContext.tsx
6
6
  var ne = {
7
7
  common: { loading: "Loading" },
@@ -18,6 +18,7 @@ var ne = {
18
18
  fixErrors: "Please fix the validation errors before submitting",
19
19
  submitFailed: "An error occurred while submitting the form"
20
20
  },
21
+ chipInput: { removeTag: "Remove" },
21
22
  input: {
22
23
  clear: "Clear",
23
24
  showPassword: "Show password",
@@ -35,7 +36,9 @@ var ne = {
35
36
  alwaysDisabled: "Always disabled",
36
37
  maxReached: "Maximum selection reached",
37
38
  dragToReorder: "Drag to reorder",
38
- fixedPosition: "Fixed position (cannot be moved)"
39
+ fixedPosition: "Fixed position (cannot be moved)",
40
+ selectedOptions: "Selected options",
41
+ reorderInstructions: "On a selected option, Alt and the up or down arrow move it one place."
39
42
  },
40
43
  suggest: {
41
44
  placeholder: "Start typing to search...",
@@ -47,14 +50,27 @@ var ne = {
47
50
  commandPalette: {
48
51
  placeholder: "Search…",
49
52
  empty: "No results found.",
50
- name: "Command palette"
53
+ name: "Command palette",
54
+ trigger: "Search…"
51
55
  },
52
56
  datePicker: {
53
57
  clear: "Clear",
54
- apply: "Search",
58
+ apply: "Apply",
55
59
  presetRanges: "Preset ranges",
56
60
  previousMonth: "Previous month",
57
61
  nextMonth: "Next month",
62
+ previousYear: "Previous year",
63
+ nextYear: "Next year",
64
+ previousYears: "Previous years",
65
+ nextYears: "Next years",
66
+ month: "Month",
67
+ year: "Year",
68
+ from: "From",
69
+ to: "To",
70
+ rangeTo: "to",
71
+ selected: "Selected:",
72
+ chooseMonth: "Pick a month.",
73
+ chooseYear: "Pick a year.",
58
74
  presets: {
59
75
  today: "Today",
60
76
  yesterday: "Yesterday",
@@ -91,14 +107,74 @@ var ne = {
91
107
  related: "Related pages",
92
108
  hidden: (e) => `${e} hidden`
93
109
  },
110
+ alert: { dismiss: "Dismiss" },
111
+ navList: { name: "Section" },
112
+ pageProgress: { name: "Page loading" },
113
+ pagination: {
114
+ name: "Pagination",
115
+ first: "First page",
116
+ previous: "Previous page",
117
+ next: "Next page",
118
+ last: "Last page",
119
+ page: (e) => `Page ${e}`,
120
+ pageOf: (e, t) => `Page ${e} of ${t}`,
121
+ range: (e, t, n) => `${e}–${t} of ${n}`,
122
+ noRows: "No rows",
123
+ perPage: "/ page",
124
+ rowsPerPage: "Rows per page"
125
+ },
126
+ link: { opensInNewTab: "opens in a new tab" },
127
+ reorder: {
128
+ item: "Item",
129
+ handle: (e) => `Reorder ${e}`,
130
+ instructions: "Press Space or Enter to pick up. While holding, use the arrow keys to move, Space or Enter to drop, Escape to cancel.",
131
+ pickedUp: (e, t, n) => `${e} picked up, position ${t} of ${n}.`,
132
+ moved: (e, t, n) => `${e} moved to position ${t} of ${n}.`,
133
+ dropped: (e, t, n) => `${e} dropped at position ${t} of ${n}.`,
134
+ cancelled: (e, t, n) => `Cancelled. ${e} is back at position ${t} of ${n}.`,
135
+ movedToList: (e, t, n, r) => `${e} moved to ${t}, position ${n} of ${r}.`,
136
+ droppedInList: (e, t, n, r) => `${e} dropped in ${t}, position ${n} of ${r}.`
137
+ },
94
138
  image: {
95
139
  image: "Image",
96
140
  images: "Images",
97
141
  add: "Add",
142
+ replace: "Replace",
143
+ drop: "Drop images here, or click to choose",
98
144
  preparing: "Preparing…",
99
145
  remove: "Remove",
100
146
  previous: "Previous image",
101
147
  next: "Next image"
148
+ },
149
+ imageEditor: {
150
+ title: "Edit image",
151
+ apply: "Apply",
152
+ cancel: "Cancel",
153
+ tools: "Image tools",
154
+ zoom: "Zoom",
155
+ pan: "Move image",
156
+ rotateLeft: "Rotate left",
157
+ rotateRight: "Rotate right",
158
+ straighten: "Straighten",
159
+ flipHorizontal: "Flip horizontally",
160
+ flipVertical: "Flip vertically",
161
+ reset: "Reset",
162
+ ratios: "Crop shape",
163
+ free: "Free",
164
+ imageAlt: "The image being edited",
165
+ cropBox: "Crop area",
166
+ hintMove: "Arrow keys move the crop area.",
167
+ hintResize: "Shift and arrow keys resize it.",
168
+ hintPan: "Alt and arrow keys move the image.",
169
+ hintZoom: "Plus and minus zoom.",
170
+ status: (e, t) => `Output ${e} by ${t} pixels`,
171
+ loading: "Loading image…",
172
+ failedCors: "This image's server does not allow it to be edited here. Download it and choose the file instead.",
173
+ failedLoad: "This image could not be loaded. Check the address, or choose a file instead.",
174
+ failedRead: "This image could not be read. Use a JPG, PNG or WebP photo.",
175
+ failedRender: "This image could not be saved. Try again, or try a smaller image.",
176
+ imageTooSmall: (e, t) => `This image is too small. It needs to be at least ${e} × ${t} pixels.`,
177
+ cropTooSmall: (e, t) => `The crop area is too small. It needs to be at least ${e} × ${t} pixels.`
102
178
  }
103
179
  };
104
180
  function re(e, t) {
@@ -110,17 +186,17 @@ function re(e, t) {
110
186
  }
111
187
  return n;
112
188
  }
113
- var d = s(ne), ie = ({ labels: e, children: t }) => {
114
- let n = c(d), r = l(() => re(n, e), [n, e]);
115
- return /* @__PURE__ */ u(d.Provider, {
189
+ var f = c(ne), ie = ({ labels: e, children: t }) => {
190
+ let n = l(f), r = u(() => re(n, e), [n, e]);
191
+ return /* @__PURE__ */ d(f.Provider, {
116
192
  value: r,
117
193
  children: t
118
194
  });
119
195
  };
120
196
  ie.displayName = "LabelsProvider";
121
- var ae = () => c(d), f = /* @__PURE__ */ new Map();
122
- function p(e, t) {
123
- let n = `${e ?? ""}|${JSON.stringify(t)}`, r = f.get(n);
197
+ var p = () => l(f), m = /* @__PURE__ */ new Map();
198
+ function h(e, t) {
199
+ let n = `${e ?? ""}|${JSON.stringify(t)}`, r = m.get(n);
124
200
  if (!r) {
125
201
  try {
126
202
  r = new Intl.NumberFormat(e, t);
@@ -133,34 +209,64 @@ function p(e, t) {
133
209
  } : {}
134
210
  });
135
211
  }
136
- f.set(n, r);
212
+ m.set(n, r);
137
213
  }
138
214
  return r;
139
215
  }
140
- var m = (e) => e === void 0 ? {} : {
216
+ var ae = /* @__PURE__ */ new Map();
217
+ function oe(e, t) {
218
+ let n = `${e ?? ""}|${JSON.stringify(t)}`, r = ae.get(n);
219
+ if (!r) {
220
+ try {
221
+ r = new Intl.DateTimeFormat(e, t);
222
+ } catch {
223
+ r = new Intl.DateTimeFormat(void 0, t);
224
+ }
225
+ ae.set(n, r);
226
+ }
227
+ return r;
228
+ }
229
+ var se = {
230
+ day: "numeric",
231
+ month: "short",
232
+ year: "numeric"
233
+ }, ce = {
234
+ hour: "numeric",
235
+ minute: "2-digit"
236
+ }, g = (e) => e === void 0 ? {} : {
141
237
  minimumFractionDigits: e,
142
238
  maximumFractionDigits: e
143
239
  };
144
- function h(e = {}) {
145
- let { locale: n, currency: r } = e, i = e.dateFormat ?? "dd-mm-yyyy";
240
+ function le(n = {}) {
241
+ let { locale: r, currency: i } = n, a = n.dateFormat ?? "dd-mm-yyyy";
146
242
  return {
147
- locale: n,
148
- currency: r,
149
- dateFormat: i,
150
- number: (e, t) => p(n, m(t)).format(e),
151
- money: (e, t = 2) => p(n, r ? {
243
+ locale: r,
244
+ currency: i,
245
+ dateFormat: a,
246
+ number: (e, t) => h(r, g(t)).format(e),
247
+ money: (e, t = 2) => h(r, i ? {
152
248
  style: "currency",
153
- currency: r,
154
- ...m(t)
155
- } : m(t)).format(e),
156
- percent: (e, t = 0) => p(n, {
249
+ currency: i,
250
+ ...g(t)
251
+ } : g(t)).format(e),
252
+ percent: (e, t = 0) => h(r, {
157
253
  style: "percent",
158
- ...m(t)
254
+ ...g(t)
159
255
  }).format(e),
160
- day: (e) => t(o(e), i)
256
+ day: (e) => t(o(e), a),
257
+ dateTime: (t) => {
258
+ let n = o(t);
259
+ if (!n) return "";
260
+ let i = e(n.slice(0, 10), a);
261
+ return n.length > 10 ? `${i} ${oe(r, ce).format(/* @__PURE__ */ new Date(`${n}:00`))}` : i;
262
+ },
263
+ shortDate: (e) => {
264
+ let t = o(e);
265
+ return t ? oe(r, se).format(/* @__PURE__ */ new Date(`${t.slice(0, 10)}T00:00:00`)) : "";
266
+ }
161
267
  };
162
268
  }
163
- function oe(e, t) {
269
+ function ue(e, t) {
164
270
  return {
165
271
  locale: t.locale ?? e.locale,
166
272
  currency: t.currency ?? e.currency,
@@ -168,29 +274,29 @@ function oe(e, t) {
168
274
  };
169
275
  }
170
276
  // src/core/logic/tooltip.logic.ts
171
- function se(e) {
277
+ function de(e) {
172
278
  if (e == null || e === !1 || e === "") return null;
173
279
  let t = typeof e == "object" && !Array.isArray(e) && !("$$typeof" in e) && "content" in e ? e : { content: e };
174
280
  return t.disabled || t.content === null || t.content === void 0 || t.content === "" ? null : t;
175
281
  }
176
- function ce(e) {
282
+ function fe(e) {
177
283
  return e.openedBy !== "pointer" || e.anchorTo === "element" ? !1 : e.anchorTo === "pointer" || e.anchorWidth > e.tooltipWidth;
178
284
  }
179
- var le = {
285
+ var pe = {
180
286
  top: "bottom",
181
287
  bottom: "top",
182
288
  left: "right",
183
289
  right: "left"
184
290
  };
185
- function ue(e) {
291
+ function me(e) {
186
292
  let t = e === "top" || e === "bottom" ? ["right", "left"] : ["bottom", "top"];
187
293
  return [
188
294
  e,
189
- le[e],
295
+ pe[e],
190
296
  ...t
191
297
  ];
192
298
  }
193
- function de(e, { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 }) {
299
+ function he(e, { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 }) {
194
300
  switch (e) {
195
301
  case "top": return t.top - i - n.height >= a;
196
302
  case "bottom": return t.top + t.height + i + n.height <= r.height - a;
@@ -199,9 +305,9 @@ function de(e, { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 })
199
305
  default: return !1;
200
306
  }
201
307
  }
202
- var fe = (e, t, n) => Math.min(Math.max(e, t), n);
203
- function pe(e) {
204
- 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;
308
+ var ge = (e, t, n) => Math.min(Math.max(e, t), n);
309
+ function _e(e) {
310
+ let { anchor: t, tooltip: n, viewport: r, offset: i, margin: a = 8 } = e, o = me(e.placement).find((t) => he(t, e)) || e.placement, s, c;
205
311
  switch (o) {
206
312
  case "bottom":
207
313
  s = t.top + t.height + i, c = t.left + t.width / 2 - n.width / 2;
@@ -216,13 +322,13 @@ function pe(e) {
216
322
  }
217
323
  return {
218
324
  placement: o,
219
- left: fe(c, a, Math.max(a, r.width - n.width - a)),
220
- top: fe(s, a, Math.max(a, r.height - n.height - a))
325
+ left: ge(c, a, Math.max(a, r.width - n.width - a)),
326
+ top: ge(s, a, Math.max(a, r.height - n.height - a))
221
327
  };
222
328
  }
223
329
  // src/components/UIProvider/UIPortalContext.ts
224
- var me = s(null), he = () => c(me) || (typeof document > "u" ? null : document.body), g = s({}), ge = ({ children: e, locale: t, currency: n, dateFormat: r }) => {
225
- let i = c(g), a = l(() => oe(i, {
330
+ var ve = c(null), ye = () => l(ve) || (typeof document > "u" ? null : document.body), _ = c({}), be = ({ children: e, locale: t, currency: n, dateFormat: r }) => {
331
+ let i = l(_), a = u(() => ue(i, {
226
332
  locale: t,
227
333
  currency: n,
228
334
  dateFormat: r
@@ -232,28 +338,28 @@ var me = s(null), he = () => c(me) || (typeof document > "u" ? null : document.b
232
338
  n,
233
339
  r
234
340
  ]);
235
- return /* @__PURE__ */ u(g.Provider, {
341
+ return /* @__PURE__ */ d(_.Provider, {
236
342
  value: a,
237
343
  children: e
238
344
  });
239
345
  };
240
- ge.displayName = "FormatProvider";
241
- function _e() {
242
- let e = c(g);
243
- return l(() => h(e), [e]);
346
+ be.displayName = "FormatProvider";
347
+ function xe() {
348
+ let e = l(_);
349
+ return u(() => le(e), [e]);
244
350
  }
245
351
  // src/components/DataTable/types.ts
246
- var ve = {
352
+ var Se = {
247
353
  title: 1,
248
354
  subtitle: 1,
249
355
  badge: 1,
250
356
  details: 4,
251
357
  more: 40
252
- }, ye = {
358
+ }, Ce = {
253
359
  title: 1,
254
360
  subtitle: 2,
255
361
  badge: 1
256
- }, be = ["top", "bottom"], _ = {
362
+ }, we = ["top", "bottom"], v = {
257
363
  value: ["number", "numberTrend"],
258
364
  ratio: [
259
365
  "bar",
@@ -277,19 +383,19 @@ var ve = {
277
383
  "stacked",
278
384
  "calendar"
279
385
  ],
280
- funnel: ["funnel"]
281
- }, xe = [
386
+ funnel: ["funnel", "bars"]
387
+ }, Te = [
282
388
  "auto",
283
389
  "quarter",
284
390
  "half",
285
391
  "full"
286
- ], Se = [
392
+ ], Ee = [
287
393
  "top5",
288
394
  "top10",
289
395
  "least5",
290
396
  "least10",
291
397
  "all"
292
- ], Ce = {
398
+ ], De = {
293
399
  month: [
294
400
  3,
295
401
  6,
@@ -303,7 +409,7 @@ var ve = {
303
409
  182,
304
410
  365
305
411
  ]
306
- }, we = {
412
+ }, Oe = {
307
413
  month: {
308
414
  min: 1,
309
415
  max: 60
@@ -312,13 +418,13 @@ var ve = {
312
418
  min: 7,
313
419
  max: 400
314
420
  }
315
- }, Te = 6, Ee = 24;
316
- function v(e) {
421
+ }, ke = 6, Ae = 24;
422
+ function y(e) {
317
423
  return "logic" in e && "conditions" in e;
318
424
  }
319
425
  // src/components/DataTable/grouping/groupModel.ts
320
- var De = 3, Oe = (e) => JSON.stringify(e.map((e) => [e.key, e.value]));
321
- function ke(e, t) {
426
+ var je = 3, Me = (e) => JSON.stringify(e.map((e) => [e.key, e.value]));
427
+ function Ne(e, t) {
322
428
  let n = e.grouping, r = typeof n == "object" && n ? n : {};
323
429
  return {
324
430
  enabled: n !== !1 && t.allowed && (!t.serverMode || t.hasGroupsSource),
@@ -326,32 +432,32 @@ function ke(e, t) {
326
432
  defaultLevels: r.defaultGroupBy ?? []
327
433
  };
328
434
  }
329
- function Ae(e, t) {
330
- return e.filter((e) => e.authorized !== !1 && je(e, t));
435
+ function Pe(e, t) {
436
+ return e.filter((e) => e.authorized !== !1 && b(e, t));
331
437
  }
332
- function je(e, t) {
438
+ function b(e, t) {
333
439
  return e.groupable ?? (!t && (e.type === "select" || e.type === "boolean"));
334
440
  }
335
- function Me(e, t, n) {
441
+ function Fe(e, t, n) {
336
442
  let r = [];
337
443
  for (let n of e ?? []) t.includes(n) && !r.includes(n) && r.push(n);
338
444
  return r.slice(0, n);
339
445
  }
340
- function y(t, i) {
341
- let a = n(t, i);
342
- if (t.groupValue) {
343
- let e = t.groupValue(a, i);
344
- return e === void 0 || e === "" ? null : e;
446
+ function x(e, t) {
447
+ let a = r(e, t);
448
+ if (e.groupValue) {
449
+ let n = e.groupValue(a, t);
450
+ return n === void 0 || n === "" ? null : n;
345
451
  }
346
452
  let o = a;
347
- if (t.filterAccessor && (o = t.filterAccessor(o)), o == null || o === "") return null;
453
+ if (e.filterAccessor && (o = e.filterAccessor(o)), o == null || o === "") return null;
348
454
  if (Array.isArray(o)) {
349
455
  let e = o.filter((e) => e != null && e !== "").map(String).sort();
350
456
  return e.length ? e.join("|") : null;
351
457
  }
352
- return t.type === "date" || o instanceof Date ? e(r(t, a, i)) : typeof o == "boolean" || typeof o == "number" ? o : String(o);
458
+ return e.type === "date" || o instanceof Date ? n(i(e, a, t)) : typeof o == "boolean" || typeof o == "number" ? o : String(o);
353
459
  }
354
- function b(e, n, r, i) {
460
+ function S(e, n, r, i) {
355
461
  if (n == null) return i || r.groupEmpty;
356
462
  if (i) return i;
357
463
  if (typeof n == "boolean") return n ? r.yes : r.no;
@@ -360,55 +466,55 @@ function b(e, n, r, i) {
360
466
  let a = (t) => e?.filterOptions?.find((e) => String(e.value) === t)?.label ?? t;
361
467
  return e?.type === "array" && typeof n == "string" ? n.split("|").map(a).join(", ") : a(String(n));
362
468
  }
363
- var x = typeof Intl < "u" ? new Intl.Collator(void 0, {
469
+ var Ie = typeof Intl < "u" ? new Intl.Collator(void 0, {
364
470
  numeric: !0,
365
471
  sensitivity: "base"
366
- }) : null, Ne = (e, t) => x ? x.compare(e, t) : e.localeCompare(t);
367
- function Pe(e, t) {
472
+ }) : null, Le = (e, t) => Ie ? Ie.compare(e, t) : e.localeCompare(t);
473
+ function Re(e, t) {
368
474
  return [...e].sort((e, n) => {
369
475
  if (e.value === null && n.value !== null) return 1;
370
476
  if (n.value === null && e.value !== null) return -1;
371
- let r = typeof e.value == "number" && typeof n.value == "number" ? e.value - n.value : Ne(e.label, n.label);
477
+ let r = typeof e.value == "number" && typeof n.value == "number" ? e.value - n.value : Le(e.label, n.label);
372
478
  return t ? -r : r;
373
479
  });
374
480
  }
375
- function S(e, t, n, r) {
481
+ function ze(e, t, n, r) {
376
482
  if (!t.length) return [];
377
483
  let [i, ...a] = t, o = r.parent ?? [], s = /* @__PURE__ */ new Map();
378
484
  for (let t of e) {
379
- let e = y(i, n(t)), r = JSON.stringify(e), a = s.get(r);
485
+ let e = x(i, n(t)), r = JSON.stringify(e), a = s.get(r);
380
486
  a || s.set(r, a = {
381
487
  value: e,
382
488
  rows: []
383
489
  }), a.rows.push(t);
384
490
  }
385
- return Pe(Array.from(s.values()).map((e) => {
491
+ return Re(Array.from(s.values()).map((e) => {
386
492
  let t = [...o, {
387
493
  key: i.key,
388
494
  field: i.field || i.key,
389
495
  value: e.value
390
496
  }];
391
497
  return {
392
- key: Oe(t),
498
+ key: Me(t),
393
499
  path: t,
394
500
  depth: o.length,
395
501
  columnKey: i.key,
396
502
  value: e.value,
397
- label: b(i, e.value, r.labels),
503
+ label: S(i, e.value, r.labels),
398
504
  count: e.rows.length,
399
505
  rows: e.rows,
400
- children: a.length ? S(e.rows, a, n, {
506
+ children: a.length ? ze(e.rows, a, n, {
401
507
  ...r,
402
508
  parent: t
403
509
  }) : void 0
404
510
  };
405
511
  }), r.sortedDesc?.(i.key) === !0);
406
512
  }
407
- function C(e, t = []) {
408
- for (let n of e ?? []) t.push(n.key), C(n.children, t);
513
+ function Be(e, t = []) {
514
+ for (let n of e ?? []) t.push(n.key), Be(n.children, t);
409
515
  return t;
410
516
  }
411
- function Fe(e, t) {
517
+ function Ve(e, t) {
412
518
  let n = [], r = (e) => {
413
519
  for (let i of e) {
414
520
  let e = t.expanded.has(i.key);
@@ -467,8 +573,8 @@ function Fe(e, t) {
467
573
  };
468
574
  return r(e), n;
469
575
  }
470
- var Ie = (e) => e.kind === "group" ? e.node.depth : e.kind === "row" ? e.depth : e.node.depth + 1;
471
- function Le(e, t, n) {
576
+ var He = (e) => e.kind === "group" ? e.node.depth : e.kind === "row" ? e.depth : e.node.depth + 1;
577
+ function Ue(e, t, n) {
472
578
  let r = t * n, i = e.slice(r, r + n), a = i[0];
473
579
  if (!a || r === 0) return i;
474
580
  let o = [];
@@ -476,14 +582,14 @@ function Le(e, t, n) {
476
582
  let n = e[t];
477
583
  n.kind === "group" && (o.length = n.node.depth, o.push(n));
478
584
  }
479
- let s = Ie(a);
585
+ let s = He(a);
480
586
  return [...o.slice(0, s).map((e) => ({
481
587
  ...e,
482
588
  key: `${e.key}:cont`,
483
589
  continued: !0
484
590
  })), ...i];
485
591
  }
486
- function Re(e, t, n, r) {
592
+ function We(e, t, n, r) {
487
593
  return r === null ? {
488
594
  id: e,
489
595
  column: t,
@@ -516,14 +622,14 @@ function Re(e, t, n, r) {
516
622
  enabled: !0
517
623
  };
518
624
  }
519
- function ze(e) {
625
+ function Ge(e) {
520
626
  return [...e.type === "boolean" ? ["is_true", "is_false"] : e.type === "array" ? ["includes"] : e.type === "select" ? ["is"] : ["equals"], "is_empty"];
521
627
  }
522
- function Be(e, t) {
523
- return e.map((e, n) => Re(`group:${n}:${e.key}`, e.key, t.find((t) => t.key === e.key), e.value));
628
+ function Ke(e, t) {
629
+ return e.map((e, n) => We(`group:${n}:${e.key}`, e.key, t.find((t) => t.key === e.key), e.value));
524
630
  }
525
- function Ve(e, t, n) {
526
- let r = Be(t, n);
631
+ function qe(e, t, n) {
632
+ let r = Ke(t, n);
527
633
  return r.length ? e.logic === "AND" && !e.negated ? {
528
634
  ...e,
529
635
  conditions: [...e.conditions, ...r]
@@ -534,29 +640,29 @@ function Ve(e, t, n) {
534
640
  } : e;
535
641
  }
536
642
  // src/components/DataTable/summary/summaryModel.ts
537
- var He = "summary:", w = (e) => `${He}${e}`, Ue = (e) => e.kind === "breakdown" || e.kind === "trend" || e.kind === "funnel";
538
- function We(e) {
539
- return e.kind === "value" ? e.trend ? _.value : ["number"] : e.kind === "trend" ? [
643
+ var Je = "summary:", C = (e) => `${Je}${e}`, Ye = (e) => e.kind === "breakdown" || e.kind === "trend" || e.kind === "funnel";
644
+ function Xe(e) {
645
+ return e.kind === "value" ? e.trend ? v.value : ["number"] : e.kind === "trend" ? [
540
646
  ...e.period === "day" ? ["calendar"] : [],
541
647
  "columns",
542
648
  "line",
543
649
  "area",
544
650
  ...e.split ? ["grouped", "stacked"] : []
545
- ] : _[e.kind];
651
+ ] : v[e.kind];
546
652
  }
547
- function T(e) {
548
- let t = We(e), n = "chart" in e ? e.chart : void 0;
653
+ function w(e) {
654
+ let t = Xe(e), n = "chart" in e ? e.chart : void 0;
549
655
  return n && t.includes(n) ? n : t[0];
550
656
  }
551
- function Ge(e) {
657
+ function Ze(e) {
552
658
  return e.kind === "value" ? [e.value, ...e.sub ? [e.sub.value] : []] : e.kind === "ratio" ? [
553
659
  e.value,
554
660
  e.total,
555
661
  ...e.sub ? [e.sub.value] : []
556
662
  ] : [];
557
663
  }
558
- var Ke = 9;
559
- function qe(e) {
664
+ var Qe = 9;
665
+ function $e(e) {
560
666
  if (e === "all") return { from: "all" };
561
667
  let t = /^(top|least)(\d+)$/.exec(e);
562
668
  return {
@@ -564,15 +670,15 @@ function qe(e) {
564
670
  count: Number(t[2])
565
671
  };
566
672
  }
567
- function E(e, t = 9) {
568
- return e.show ? qe(e.show) : T(e) === "bars" ? { from: "all" } : {
673
+ function T(e, t = 9) {
674
+ return e.show ? $e(e.show) : w(e) === "bars" ? { from: "all" } : {
569
675
  from: "top",
570
676
  count: t
571
677
  };
572
678
  }
573
- var Je = (e) => e.label ?? (e.value === null ? "" : String(e.value));
574
- function Ye(e, t) {
575
- let n = [...e].sort((e, t) => t.count - e.count || Je(e).localeCompare(Je(t)));
679
+ var et = (e) => e.label ?? (e.value === null ? "" : String(e.value));
680
+ function tt(e, t) {
681
+ let n = [...e].sort((e, t) => t.count - e.count || et(e).localeCompare(et(t)));
576
682
  return t.from === "all" || t.count >= n.length ? {
577
683
  buckets: t.from === "least" ? n.reverse() : n,
578
684
  others: 0,
@@ -583,23 +689,23 @@ function Ye(e, t) {
583
689
  values: e.length
584
690
  };
585
691
  }
586
- 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";
587
- function Qe(e, t) {
692
+ 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";
693
+ function it(e, t) {
588
694
  switch (e.kind) {
589
- case "trend": return `${e.id}.${e.period === "day" ? "d" : "m"}${e.count}${D(e) ? `.s${e.split}` : ""}`;
695
+ case "trend": return `${e.id}.${e.period === "day" ? "d" : "m"}${e.count}${E(e) ? `.s${e.split}` : ""}`;
590
696
  case "funnel": return `${e.id}.f`;
591
697
  case "value": return `${e.id}.t${e.trend?.period === "day" ? "d" : "m"}${e.trend?.count ?? 0}`;
592
698
  case "breakdown": {
593
- let n = E(e, t);
594
- return `${e.id}.${n.from === "all" ? "all" : `${n.from}${n.count}`}${Xe(e) ? `.w${e.within}` : ""}`;
699
+ let n = T(e, t);
700
+ return `${e.id}.${n.from === "all" ? "all" : `${n.from}${n.count}`}${nt(e) ? `.w${e.within}` : ""}`;
595
701
  }
596
702
  }
597
703
  }
598
- function $e(e, t) {
599
- 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();
704
+ function at(e, t) {
705
+ 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();
600
706
  for (let t of e) {
601
- if (t.kind === "ratio" || t.kind === "value" && !Ze(t)) continue;
602
- let e = Qe(t);
707
+ if (t.kind === "ratio" || t.kind === "value" && !rt(t)) continue;
708
+ let e = it(t);
603
709
  if (!i.has(e)) switch (t.kind) {
604
710
  case "value":
605
711
  i.set(e, {
@@ -618,8 +724,8 @@ function $e(e, t) {
618
724
  id: t.id,
619
725
  kind: "breakdown",
620
726
  field: r(t.column),
621
- part: E(t),
622
- ...Xe(t) ? { within: r(t.within) } : {}
727
+ part: T(t),
728
+ ...nt(t) ? { within: r(t.within) } : {}
623
729
  });
624
730
  break;
625
731
  case "trend":
@@ -630,7 +736,7 @@ function $e(e, t) {
630
736
  field: r(t.column),
631
737
  period: t.period,
632
738
  count: t.count,
633
- ...D(t) ? { split: r(t.split) } : {}
739
+ ...E(t) ? { split: r(t.split) } : {}
634
740
  });
635
741
  break;
636
742
  case "funnel": i.set(e, {
@@ -646,34 +752,34 @@ function $e(e, t) {
646
752
  cards: Array.from(i.values())
647
753
  };
648
754
  }
649
- function et(e, t) {
755
+ function ot(e, t) {
650
756
  if (e.logic !== "AND" || e.negated) return;
651
- let n = w(t);
652
- return e.conditions.find((e) => !v(e) && e.id === n && e.enabled);
757
+ let n = C(t);
758
+ return e.conditions.find((e) => !y(e) && e.id === n && e.enabled);
653
759
  }
654
- function tt(e, t) {
655
- let n = et(e, t);
760
+ function st(e, t) {
761
+ let n = ot(e, t);
656
762
  return n ? {
657
763
  ...e,
658
764
  conditions: e.conditions.filter((e) => e !== n)
659
765
  } : e;
660
766
  }
661
- function nt(e, t, n) {
662
- let r = w(t), i = e.logic === "AND" && !e.negated ? e : {
767
+ function ct(e, t, n) {
768
+ let r = C(t), i = e.logic === "AND" && !e.negated ? e : {
663
769
  id: a(),
664
770
  logic: "AND",
665
771
  conditions: e.conditions.length ? [e] : []
666
- }, o = i.conditions.filter((e) => v(e) || e.id !== r);
772
+ }, o = i.conditions.filter((e) => y(e) || e.id !== r);
667
773
  return {
668
774
  ...i,
669
775
  conditions: n ? [...o, n] : o
670
776
  };
671
777
  }
672
- function rt(e, t, n) {
673
- return Re(w(e.id), e.column, t, n);
778
+ function lt(e, t, n) {
779
+ return We(C(e.id), e.column, t, n);
674
780
  }
675
- function it(e, t) {
676
- let n = w(e.id);
781
+ function ut(e, t) {
782
+ let n = C(e.id);
677
783
  if (t.length > 7) return {
678
784
  id: n,
679
785
  column: e.column,
@@ -696,16 +802,16 @@ function it(e, t) {
696
802
  enabled: !0
697
803
  };
698
804
  }
699
- function at(e, t) {
805
+ function dt(e, t) {
700
806
  let n = e.steps.find((e) => e.id === t);
701
807
  return n?.condition ? {
702
- id: w(e.id),
808
+ id: C(e.id),
703
809
  ...n.condition,
704
810
  enabled: !0
705
811
  } : null;
706
812
  }
707
- var O = (e) => e === null ? "" : String(e), ot = "\0others";
708
- function st(e, t) {
813
+ var D = (e) => e === null ? "" : String(e), ft = "\0others";
814
+ function pt(e, t) {
709
815
  if (!t) return null;
710
816
  if (e.kind === "trend") {
711
817
  let n = t.value?.from;
@@ -713,13 +819,13 @@ function st(e, t) {
713
819
  }
714
820
  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);
715
821
  }
716
- function k(e, t) {
822
+ function O(e, t) {
717
823
  return e.compute ? e.compute(t) : t.length;
718
824
  }
719
- function A(e, t) {
825
+ function k(e, t) {
720
826
  let n = /* @__PURE__ */ new Map();
721
827
  for (let r of e) {
722
- let e = y(t, r), i = O(e), a = n.get(i);
828
+ let e = x(t, r), i = D(e), a = n.get(i);
723
829
  a ? a.count++ : n.set(i, {
724
830
  value: e,
725
831
  count: 1
@@ -727,63 +833,63 @@ function A(e, t) {
727
833
  }
728
834
  return Array.from(n.values());
729
835
  }
730
- function ct(e, t, n, r) {
836
+ function mt(e, t, n, r) {
731
837
  return {
732
838
  ...e,
733
839
  buckets: e.buckets.map((e) => ({
734
840
  ...e,
735
- children: A(t.filter((t) => O(y(n, t)) === O(e.value)), r)
841
+ children: k(t.filter((t) => D(x(n, t)) === D(e.value)), r)
736
842
  }))
737
843
  };
738
844
  }
739
- function lt(e, t = /* @__PURE__ */ new Date()) {
845
+ function ht(e, t = /* @__PURE__ */ new Date()) {
740
846
  return Array.from({ length: e }, (n, r) => {
741
847
  let i = new Date(t.getFullYear(), t.getMonth() - (e - 1 - r), 1);
742
848
  return `${i.getFullYear()}-${String(i.getMonth() + 1).padStart(2, "0")}`;
743
849
  });
744
850
  }
745
- function ut(e, t = /* @__PURE__ */ new Date()) {
851
+ function A(e, t = /* @__PURE__ */ new Date()) {
746
852
  let n = (e) => String(e).padStart(2, "0");
747
853
  return Array.from({ length: e }, (r, i) => {
748
854
  let a = new Date(t.getFullYear(), t.getMonth(), t.getDate() - (e - 1 - i));
749
855
  return `${a.getFullYear()}-${n(a.getMonth() + 1)}-${n(a.getDate())}`;
750
856
  });
751
857
  }
752
- function dt(t, n, r, a) {
753
- let o = new Map(r.map((e) => [e, []]));
754
- for (let r of t) {
755
- let t = e(i(n, r)), s = t === null ? null : a === "month" ? t.slice(0, 7) : t;
756
- s !== null && o.get(s)?.push(r);
858
+ function gt(e, t, r, i) {
859
+ let a = new Map(r.map((e) => [e, []]));
860
+ for (let r of e) {
861
+ let e = n(s(t, r)), o = e === null ? null : i === "month" ? e.slice(0, 7) : e;
862
+ o !== null && a.get(o)?.push(r);
757
863
  }
758
- return o;
864
+ return a;
759
865
  }
760
- function ft(e, t, n, r, i, a) {
761
- let o = n === "month" ? lt(r, i) : ut(r, i), s = dt(e, t, o, n);
866
+ function _t(e, t, n, r, i, a) {
867
+ let o = n === "month" ? ht(r, i) : A(r, i), s = gt(e, t, o, n);
762
868
  return o.map((e) => {
763
869
  let t = s.get(e);
764
870
  return {
765
871
  period: e,
766
872
  count: t.length,
767
- ...a ? { split: A(t, a) } : {}
873
+ ...a ? { split: k(t, a) } : {}
768
874
  };
769
875
  });
770
876
  }
771
- function pt(e, t, n, r, i, a) {
772
- 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));
877
+ function vt(e, t, n, r, i, a) {
878
+ 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));
773
879
  return {
774
880
  points: o.slice(i).map((e) => ({
775
881
  period: e,
776
- count: k(t, s.get(e))
882
+ count: O(t, s.get(e))
777
883
  })),
778
- previous: k(t, c)
884
+ previous: O(t, c)
779
885
  };
780
886
  }
781
- function mt(e, t, n, r, i, a) {
887
+ function yt(e, t, n, r, i, a) {
782
888
  let o = n.buckets.map((e) => ({
783
889
  ...e,
784
- key: O(e.value),
785
- label: b(t, e.value, r, e.label)
786
- })), s = E(e, i).from === "least";
890
+ key: D(e.value),
891
+ label: S(t, e.value, r, e.label)
892
+ })), s = T(e, i).from === "least";
787
893
  o.sort((e, t) => (s ? e.count - t.count : t.count - e.count) || e.label.localeCompare(t.label));
788
894
  let c = o.map((t, n) => ({
789
895
  key: t.key,
@@ -792,13 +898,13 @@ function mt(e, t, n, r, i, a) {
792
898
  count: t.count,
793
899
  slot: e.slots?.[t.key] ?? n + 1,
794
900
  ...t.children ? { children: [...t.children].sort((e, t) => t.count - e.count).map((e) => ({
795
- key: O(e.value),
796
- label: b(a, e.value, r, e.label),
901
+ key: D(e.value),
902
+ label: S(a, e.value, r, e.label),
797
903
  count: e.count
798
904
  })) } : {}
799
905
  }));
800
906
  return n.others > 0 && c.push({
801
- key: ot,
907
+ key: ft,
802
908
  value: null,
803
909
  label: r.others,
804
910
  count: n.others,
@@ -806,18 +912,18 @@ function mt(e, t, n, r, i, a) {
806
912
  others: !0
807
913
  }), c;
808
914
  }
809
- var ht = (e, t) => {
915
+ var bt = (e, t) => {
810
916
  try {
811
917
  return new Intl.DateTimeFormat(e, t);
812
918
  } catch {
813
919
  return new Intl.DateTimeFormat(void 0, t);
814
920
  }
815
921
  };
816
- function gt(e, t, n) {
817
- let r = ht(n, t === "month" ? { month: "short" } : {
922
+ function xt(e, t, n) {
923
+ let r = bt(n, t === "month" ? { month: "short" } : {
818
924
  day: "numeric",
819
925
  month: "short"
820
- }), i = ht(n, t === "month" ? {
926
+ }), i = bt(n, t === "month" ? {
821
927
  month: "long",
822
928
  year: "numeric"
823
929
  } : { dateStyle: "medium" });
@@ -831,15 +937,15 @@ function gt(e, t, n) {
831
937
  };
832
938
  });
833
939
  }
834
- function _t(e, t, n, r) {
940
+ function St(e, t, n, r) {
835
941
  let i = /* @__PURE__ */ new Map(), a = t.map((e) => {
836
942
  let t = {};
837
943
  for (let a of e.split ?? []) {
838
- let e = O(a.value);
944
+ let e = D(a.value);
839
945
  t[e] = (t[e] ?? 0) + a.count;
840
946
  let o = i.get(e) ?? {
841
947
  value: a.value,
842
- label: b(n, a.value, r, a.label),
948
+ label: S(n, a.value, r, a.label),
843
949
  count: 0
844
950
  };
845
951
  o.count += a.count, i.set(e, o);
@@ -859,13 +965,13 @@ var j = (e, t) => t > 0 ? e / t * 100 : 0;
859
965
  function M(e) {
860
966
  return e > 0 && e < 1 ? "<1%" : e > 99 && e < 100 ? ">99%" : `${Math.round(e)}%`;
861
967
  }
862
- function vt(e, t) {
968
+ function Ct(e, t) {
863
969
  return e.text ? e.text(t) : `${e.label}: ${t}`;
864
970
  }
865
- function yt(e, t) {
971
+ function wt(e, t) {
866
972
  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(" · ");
867
973
  }
868
- function bt(e, t, n) {
974
+ function Tt(e, t, n) {
869
975
  let r = {}, i = [];
870
976
  for (let a of e) {
871
977
  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({
@@ -904,7 +1010,7 @@ function bt(e, t, n) {
904
1010
  };
905
1011
  }
906
1012
  // src/components/Charts/palette.ts
907
- var xt = 10, N = {
1013
+ var Et = 10, N = {
908
1014
  light: {
909
1015
  1: "#2a78d6",
910
1016
  2: "#eb6834",
@@ -941,7 +1047,7 @@ var xt = 10, N = {
941
1047
  info: "#6b95ea",
942
1048
  neutral: "#737380"
943
1049
  }
944
- }, St = {
1050
+ }, Dt = {
945
1051
  light: {
946
1052
  lightness: [
947
1053
  .46,
@@ -975,7 +1081,7 @@ var xt = 10, N = {
975
1081
  background: "#1f1f1f"
976
1082
  }
977
1083
  };
978
- function Ct(e, t, n) {
1084
+ function Ot(e, t, n) {
979
1085
  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;
980
1086
  return [
981
1087
  4.0767416621 * o - 3.3077115913 * s + .2309699292 * c,
@@ -983,10 +1089,10 @@ function Ct(e, t, n) {
983
1089
  -.0041960863 * o - .7034186147 * s + 1.707614701 * c
984
1090
  ];
985
1091
  }
986
- var wt = (e) => `#${e.map((e) => {
1092
+ var kt = (e) => `#${e.map((e) => {
987
1093
  let t = Math.min(1, Math.max(0, e)), n = t <= .0031308 ? 12.92 * t : 1.055 * t ** (1 / 2.4) - .055;
988
1094
  return Math.round(n * 255).toString(16).padStart(2, "0");
989
- }).join("")}`, Tt = (e, t, n) => wt(Ct(e, t, n));
1095
+ }).join("")}`, At = (e, t, n) => kt(Ot(e, t, n));
990
1096
  function P(e) {
991
1097
  let t = (t) => {
992
1098
  let n = parseInt(e.slice(t, t + 2), 16) / 255;
@@ -1002,15 +1108,15 @@ function P(e) {
1002
1108
  .0259040371 * a + .7827717662 * o - .808675766 * s
1003
1109
  ];
1004
1110
  }
1005
- var F = (e, t) => Math.hypot(e[0] - t[0], e[1] - t[1], e[2] - t[2]), Et = {};
1006
- function Dt(e) {
1007
- let t = Et[e];
1111
+ var F = (e, t) => Math.hypot(e[0] - t[0], e[1] - t[1], e[2] - t[2]), jt = {};
1112
+ function Mt(e) {
1113
+ let t = jt[e];
1008
1114
  if (t) return t;
1009
- let n = St[e], r = [];
1115
+ let n = Dt[e], r = [];
1010
1116
  for (let e of n.lightness) for (let t of n.chroma) for (let i = 0; i < 360; i += n.hueStep) {
1011
- let n = Ct(e, t, i);
1117
+ let n = Ot(e, t, i);
1012
1118
  if (n.some((e) => e < -5e-4 || e > 1.0005)) continue;
1013
- let a = wt(n);
1119
+ let a = kt(n);
1014
1120
  r.push({
1015
1121
  hex: a,
1016
1122
  lab: P(a)
@@ -1025,9 +1131,9 @@ function Dt(e) {
1025
1131
  candidates: r,
1026
1132
  nearest: r.map((e) => Math.min(...a.map((t) => F(t, e.lab))))
1027
1133
  };
1028
- return Et[e] = o, o;
1134
+ return jt[e] = o, o;
1029
1135
  }
1030
- function Ot(e) {
1136
+ function Nt(e) {
1031
1137
  let t = -1;
1032
1138
  for (let n = 0; n < e.candidates.length; n++) (t < 0 || e.nearest[n] > e.nearest[t]) && (t = n);
1033
1139
  if (t < 0 || e.nearest[t] <= 0) {
@@ -1039,15 +1145,15 @@ function Ot(e) {
1039
1145
  for (let t = 0; t < e.candidates.length; t++) e.nearest[t] = Math.min(e.nearest[t], F(n.lab, e.candidates[t].lab));
1040
1146
  }
1041
1147
  function I(e, t) {
1042
- let n = Dt(t);
1043
- for (; n.colours.length <= e;) Ot(n);
1148
+ let n = Mt(t);
1149
+ for (; n.colours.length <= e;) Nt(n);
1044
1150
  return n.colours[e];
1045
1151
  }
1046
- var kt = (e, t) => typeof e == "number" ? I(e - 1, t) : N[t][e];
1047
- function At(e) {
1152
+ var Pt = (e, t) => typeof e == "number" ? I(e - 1, t) : N[t][e];
1153
+ function Ft(e) {
1048
1154
  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")})`;
1049
1155
  }
1050
- var jt = {
1156
+ var It = {
1051
1157
  bands: [{
1052
1158
  below: 20,
1053
1159
  color: "negative"
@@ -1056,11 +1162,11 @@ var jt = {
1056
1162
  color: "warning"
1057
1163
  }],
1058
1164
  above: "positive"
1059
- }, Mt = (e) => typeof e == "object" && !!e;
1060
- function Nt(e, t) {
1061
- return Mt(e) ? e.bands.find((e) => t < e.below)?.color ?? e.above : e;
1165
+ }, Lt = (e) => typeof e == "object" && !!e;
1166
+ function Rt(e, t) {
1167
+ return Lt(e) ? e.bands.find((e) => t < e.below)?.color ?? e.above : e;
1062
1168
  }
1063
- 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 = {
1169
+ 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 = {
1064
1170
  light: [
1065
1171
  "#e8eff9",
1066
1172
  "#bcd3f2",
@@ -1075,11 +1181,11 @@ var Pt = (e) => typeof e == "string" && e.startsWith("#"), Ft = (e) => Pt(e) ? e
1075
1181
  "#4f8bd6",
1076
1182
  "#82baff"
1077
1183
  ]
1078
- }, Lt = (e) => `var(--chart-heat-${Math.max(0, Math.min(It.light.length - 1, e))})`, R = {
1184
+ }, Ht = (e) => `var(--chart-heat-${Math.max(0, Math.min(Vt.light.length - 1, e))})`, R = {
1079
1185
  dark: "#0f0f0f",
1080
1186
  light: "#ffffff"
1081
1187
  };
1082
- function Rt(e) {
1188
+ function Ut(e) {
1083
1189
  let t = (t) => {
1084
1190
  let n = parseInt(e.slice(t, t + 2), 16) / 255;
1085
1191
  return n <= .04045 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4;
@@ -1087,14 +1193,14 @@ function Rt(e) {
1087
1193
  return .2126 * t(1) + .7152 * t(3) + .0722 * t(5);
1088
1194
  }
1089
1195
  function z(e) {
1090
- let t = Rt(e);
1196
+ let t = Ut(e);
1091
1197
  return (t + .05) / .05 > 1.05 / (t + .05) ? R.dark : R.light;
1092
1198
  }
1093
- function zt(e) {
1199
+ function Wt(e) {
1094
1200
  return `var(--chart-scheme-light, ${z(L(e, "light"))}) var(--chart-scheme-dark, ${z(L(e, "dark"))})`;
1095
1201
  }
1096
1202
  // src/components/Charts/labels.ts
1097
- var Bt = {
1203
+ var Gt = {
1098
1204
  legend: "Legend",
1099
1205
  total: "Total",
1100
1206
  empty: "No records",
@@ -1139,10 +1245,10 @@ var Bt = {
1139
1245
  funnelOfFirst: "Of the first step",
1140
1246
  funnelDrop: "Drop from the step before"
1141
1247
  }, B = (e, t = !1) => `chart-root ${e}${t ? " chart-compact" : ""}`;
1142
- function Vt({ title: e, children: t }) {
1143
- return e == null || e === "" ? /* @__PURE__ */ u(ee, { children: t }) : /* @__PURE__ */ te("figure", {
1248
+ function Kt({ title: e, children: t }) {
1249
+ return e == null || e === "" ? /* @__PURE__ */ d(ee, { children: t }) : /* @__PURE__ */ te("figure", {
1144
1250
  className: B("chart-titled"),
1145
- children: [/* @__PURE__ */ u("figcaption", {
1251
+ children: [/* @__PURE__ */ d("figcaption", {
1146
1252
  className: "chart-title",
1147
1253
  children: e
1148
1254
  }), t]
@@ -1151,9 +1257,9 @@ function Vt({ title: e, children: t }) {
1151
1257
  function V(e) {
1152
1258
  return e > 0 && e < .1 ? "<0.1%" : e < 100 && e > 99.9 ? ">99.9%" : `${e.toFixed(1)}%`;
1153
1259
  }
1154
- var Ht = (e) => e === 0 ? V(0) : `${e > 0 ? "−" : "+"}${V(Math.abs(e))}`;
1155
- function Ut({ locale: e, format: t, labels: n }) {
1156
- let r = _e().locale, i = e ?? r, a = l(() => {
1260
+ var qt = (e) => e === 0 ? V(0) : `${e > 0 ? "−" : "+"}${V(Math.abs(e))}`;
1261
+ function Jt({ locale: e, format: t, labels: n }) {
1262
+ let r = xe().locale, i = e ?? r, a = u(() => {
1157
1263
  if (t) return t;
1158
1264
  let e;
1159
1265
  try {
@@ -1162,25 +1268,25 @@ function Ut({ locale: e, format: t, labels: n }) {
1162
1268
  e = new Intl.NumberFormat();
1163
1269
  }
1164
1270
  return (t) => e.format(t);
1165
- }, [i, t]), o = ae().charts;
1271
+ }, [i, t]), o = p().charts;
1166
1272
  return {
1167
1273
  nf: a,
1168
- L: l(() => ({
1169
- ...Bt,
1274
+ L: u(() => ({
1275
+ ...Gt,
1170
1276
  ...o,
1171
1277
  ...n
1172
1278
  }), [o, n])
1173
1279
  };
1174
1280
  }
1175
- function Wt({ ariaLabel: e, text: t, compact: n }) {
1176
- return /* @__PURE__ */ u("div", {
1281
+ function Yt({ ariaLabel: e, text: t, compact: n }) {
1282
+ return /* @__PURE__ */ d("div", {
1177
1283
  className: B("chart-empty", n),
1178
1284
  role: "img",
1179
1285
  "aria-label": `${e}: ${t}`,
1180
1286
  children: t
1181
1287
  });
1182
1288
  }
1183
- function Gt(e, t, n, r = {}) {
1289
+ function Xt(e, t, n, r = {}) {
1184
1290
  if (n <= 0) return null;
1185
1291
  let i = {
1186
1292
  ArrowLeft: -1,
@@ -1191,15 +1297,15 @@ function Gt(e, t, n, r = {}) {
1191
1297
  };
1192
1298
  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]));
1193
1299
  }
1194
- function Kt(e, t, n, r = {}, i = () => !0) {
1195
- let a = Gt(e, t, n, r);
1300
+ function Zt(e, t, n, r = {}, i = () => !0) {
1301
+ let a = Xt(e, t, n, r);
1196
1302
  if (a === null || i(a)) return a;
1197
1303
  let o = e === "Home" ? !0 : e === "End" ? !1 : t === null ? a === 0 : a > t;
1198
1304
  for (let e = a; e >= 0 && e < n; e += o ? 1 : -1) if (i(e)) return e;
1199
1305
  return t !== null && i(t) ? t : null;
1200
1306
  }
1201
- function qt({ text: e }) {
1202
- return /* @__PURE__ */ u("span", {
1307
+ function Qt({ text: e }) {
1308
+ return /* @__PURE__ */ d("span", {
1203
1309
  className: "chart-sr-only",
1204
1310
  "aria-live": "polite",
1205
1311
  children: e
@@ -1237,7 +1343,7 @@ function U(e) {
1237
1343
  case "number": return e.points?.length ? ["numberTrend", "number"] : ["number"];
1238
1344
  }
1239
1345
  }
1240
- function Jt(e, t, n) {
1346
+ function $t(e, t, n) {
1241
1347
  let r = U(e).filter((e) => !n || n.includes(e)), i = r.length ? r : U(e);
1242
1348
  return t && i.includes(t) ? t : i[0];
1243
1349
  }
@@ -1245,7 +1351,7 @@ var W = (e) => [{
1245
1351
  key: "n",
1246
1352
  label: e,
1247
1353
  slot: 1
1248
- }], Yt = (e, t) => ({
1354
+ }], en = (e, t) => ({
1249
1355
  ...e.key === void 0 ? {} : { key: e.key },
1250
1356
  label: e.label,
1251
1357
  ...e.fullLabel === void 0 ? {} : { fullLabel: e.fullLabel },
@@ -1254,15 +1360,15 @@ var W = (e) => [{
1254
1360
  ...e.href ? { href: e.href } : {},
1255
1361
  ...e.slot === void 0 ? {} : { slot: e.slot }
1256
1362
  }), G = (e, t) => e.slot ?? t + 1;
1257
- function Xt(e, t, n, r) {
1258
- let i = Jt(e, t, r);
1363
+ function tn(e, t, n, r) {
1364
+ let i = $t(e, t, r);
1259
1365
  switch (e.type) {
1260
1366
  case "values": {
1261
1367
  let t = H(e.series) ? e.series : W(n.count);
1262
1368
  if (i === "bars") return {
1263
1369
  kind: "bars",
1264
1370
  series: t,
1265
- data: e.values.map((t) => Yt(t, H(e.series)))
1371
+ data: e.values.map((t) => en(t, H(e.series)))
1266
1372
  };
1267
1373
  if (i === "treemap") return {
1268
1374
  kind: "treemap",
@@ -1300,7 +1406,7 @@ function Xt(e, t, n, r) {
1300
1406
  count: e.count ?? Object.values(e.counts ?? {}).reduce((e, t) => e + t, 0)
1301
1407
  }))
1302
1408
  };
1303
- let t = H(e.series), r = t ? e.series : W(n.count), a = e.points.map((e) => Yt(e, t));
1409
+ let t = H(e.series), r = t ? e.series : W(n.count), a = e.points.map((e) => en(e, t));
1304
1410
  if (i === "line" || i === "area") return {
1305
1411
  kind: "line",
1306
1412
  area: i === "area",
@@ -1335,7 +1441,7 @@ function Xt(e, t, n, r) {
1335
1441
  key: "value",
1336
1442
  label: e.label,
1337
1443
  value: e.value,
1338
- slot: Nt(e.color ?? 1, t)
1444
+ slot: Rt(e.color ?? 1, t)
1339
1445
  }, {
1340
1446
  key: "rest",
1341
1447
  label: n.rest,
@@ -1382,13 +1488,13 @@ function Xt(e, t, n, r) {
1382
1488
  }
1383
1489
  }
1384
1490
  // src/components/Charts/geometry.ts
1385
- 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;
1386
- function tn(e) {
1491
+ 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;
1492
+ function sn(e) {
1387
1493
  let t = e.reduce((e, t) => e + t.value, 0);
1388
1494
  if (!t) return [];
1389
- let n = e.filter((e) => e.value > 0).length > 1 ? en : 0, r = 0, i = [];
1495
+ let n = e.filter((e) => e.value > 0).length > 1 ? on : 0, r = 0, i = [];
1390
1496
  for (let a of e) {
1391
- let e = a.value / t * $t;
1497
+ let e = a.value / t * an;
1392
1498
  a.value > 0 && i.push({
1393
1499
  slice: a,
1394
1500
  start: r,
@@ -1398,13 +1504,13 @@ function tn(e) {
1398
1504
  return i;
1399
1505
  }
1400
1506
  var K = (e, t) => t ? e / t * 100 : 0;
1401
- function nn(e) {
1507
+ function cn(e) {
1402
1508
  if (e <= 5) return 5;
1403
1509
  let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
1404
1510
  return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * t;
1405
1511
  }
1406
- function rn(e) {
1407
- let t = nn(Math.max(1, ...e));
1512
+ function ln(e) {
1513
+ let t = cn(Math.max(1, ...e));
1408
1514
  return {
1409
1515
  max: t,
1410
1516
  ticks: [
@@ -1414,8 +1520,8 @@ function rn(e) {
1414
1520
  ]
1415
1521
  };
1416
1522
  }
1417
- 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));
1418
- function cn(e, t, n = 2) {
1523
+ 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));
1524
+ function pn(e, t, n = 2) {
1419
1525
  if (e <= 0) return [];
1420
1526
  let r = Math.max(0, (t - n * (e - 1)) / e);
1421
1527
  return Array.from({ length: e }, (e, t) => ({
@@ -1424,26 +1530,26 @@ function cn(e, t, n = 2) {
1424
1530
  }));
1425
1531
  }
1426
1532
  var q = (e, t, n) => t <= 1 ? n / 2 : e / (t - 1) * n;
1427
- function ln(e, t, n, r) {
1533
+ function mn(e, t, n, r) {
1428
1534
  return e.map((i, a) => ({
1429
1535
  x: q(a, e.length, t),
1430
1536
  y: n - Math.max(0, i) / (r || 1) * n
1431
1537
  }));
1432
1538
  }
1433
- var J = (e) => Math.round(e * 100) / 100, un = (e) => e.map((e, t) => `${t ? "L" : "M"}${J(e.x)} ${J(e.y)}`).join(" ");
1434
- function dn(e, t) {
1435
- return e.length ? `${un(e)} L${J(e[e.length - 1].x)} ${J(t)} L${J(e[0].x)} ${J(t)} Z` : "";
1539
+ var J = (e) => Math.round(e * 100) / 100, hn = (e) => e.map((e, t) => `${t ? "L" : "M"}${J(e.x)} ${J(e.y)}`).join(" ");
1540
+ function gn(e, t) {
1541
+ return e.length ? `${hn(e)} L${J(e[e.length - 1].x)} ${J(t)} L${J(e[0].x)} ${J(t)} Z` : "";
1436
1542
  }
1437
- function fn(e, t, n) {
1543
+ function _n(e, t, n) {
1438
1544
  return n <= 1 || t <= 0 ? 0 : Math.max(0, Math.min(n - 1, Math.round(e / t * (n - 1))));
1439
1545
  }
1440
- function pn(e, t = 6) {
1546
+ function vn(e, t = 6) {
1441
1547
  if (e <= 0) return [];
1442
1548
  if (e <= t) return Array.from({ length: e }, (e, t) => t);
1443
1549
  let n = (e - 1) / (t - 1);
1444
1550
  return Array.from(new Set(Array.from({ length: t }, (e, t) => Math.round(t * n))));
1445
1551
  }
1446
- function mn(e, t, n) {
1552
+ function yn(e, t, n) {
1447
1553
  if (!e.length) return [];
1448
1554
  let r = Math.min(...e), i = Math.max(...e);
1449
1555
  return e.map((a, o) => ({
@@ -1451,7 +1557,7 @@ function mn(e, t, n) {
1451
1557
  y: i === r ? n / 2 : n - (a - r) / (i - r) * n
1452
1558
  }));
1453
1559
  }
1454
- function hn(e, t) {
1560
+ function bn(e, t) {
1455
1561
  let n = e - t;
1456
1562
  return {
1457
1563
  direction: n > 0 ? "up" : n < 0 ? "down" : "same",
@@ -1459,7 +1565,7 @@ function hn(e, t) {
1459
1565
  percent: t ? n / t * 100 : n ? null : 0
1460
1566
  };
1461
1567
  }
1462
- function gn(e, t) {
1568
+ function xn(e, t) {
1463
1569
  return e === "same" || t === "none" ? "neutral" : e === t ? "positive" : "negative";
1464
1570
  }
1465
1571
  function Y(e, t, n, r) {
@@ -1469,7 +1575,7 @@ function Y(e, t, n, r) {
1469
1575
  };
1470
1576
  }
1471
1577
  var X = (e) => Math.round(e * 1e4) / 1e4;
1472
- function _n(e, t, n, r, i) {
1578
+ function Sn(e, t, n, r, i) {
1473
1579
  if (i - r >= 2 * Math.PI - 1e-9) {
1474
1580
  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);
1475
1581
  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)}`;
@@ -1477,26 +1583,26 @@ function _n(e, t, n, r, i) {
1477
1583
  let a = Y(e, t, n, r), o = Y(e, t, n, i);
1478
1584
  return `M${X(a.x)} ${X(a.y)} A${n} ${n} 0 ${+(i - r > Math.PI)} 1 ${X(o.x)} ${X(o.y)}`;
1479
1585
  }
1480
- function vn(e, t, n, r, i) {
1586
+ function Cn(e, t, n, r, i) {
1481
1587
  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`;
1482
1588
  let a = Y(e, t, n, r), o = Y(e, t, n, i);
1483
1589
  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`;
1484
1590
  }
1485
- var yn = 864e5;
1591
+ var wn = 864e5;
1486
1592
  function Z(e) {
1487
1593
  let [t, n, r] = e.split("-").map(Number);
1488
1594
  return Date.UTC(t, n - 1, r);
1489
1595
  }
1490
- var bn = (e) => new Date(e).toISOString().slice(0, 10), xn = (e) => (new Date(Z(e)).getUTCDay() + 6) % 7;
1491
- function Sn(e, t) {
1492
- let n = Z(e), r = Math.min(371, Math.max(0, Math.round((Z(t) - n) / yn) + 1));
1493
- return Array.from({ length: r }, (e, t) => bn(n + t * yn));
1596
+ var Tn = (e) => new Date(e).toISOString().slice(0, 10), En = (e) => (new Date(Z(e)).getUTCDay() + 6) % 7;
1597
+ function Dn(e, t) {
1598
+ let n = Z(e), r = Math.min(371, Math.max(0, Math.round((Z(t) - n) / wn) + 1));
1599
+ return Array.from({ length: r }, (e, t) => Tn(n + t * wn));
1494
1600
  }
1495
- var Cn = 371;
1496
- function wn(e, t) {
1601
+ var On = 371;
1602
+ function kn(e, t) {
1497
1603
  return e <= 0 || t <= 0 ? 0 : Math.min(4, Math.max(1, Math.ceil(e / t * 4)));
1498
1604
  }
1499
- function Tn(e) {
1605
+ function An(e) {
1500
1606
  if (!e.length) return {
1501
1607
  cells: [],
1502
1608
  weeks: 0,
@@ -1504,14 +1610,14 @@ function Tn(e) {
1504
1610
  max: 0,
1505
1611
  total: 0
1506
1612
  };
1507
- 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) => {
1613
+ 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) => {
1508
1614
  let r = n.get(e) ?? 0;
1509
1615
  return {
1510
1616
  day: e,
1511
1617
  count: r,
1512
1618
  week: Math.floor((t + i) / 7),
1513
1619
  weekday: (t + i) % 7,
1514
- level: wn(r, a)
1620
+ level: kn(r, a)
1515
1621
  };
1516
1622
  }), s = o.filter((e) => e.day.endsWith("-01")).map((e) => ({
1517
1623
  month: e.day.slice(0, 7),
@@ -1532,9 +1638,9 @@ var Q = {
1532
1638
  min: 4,
1533
1639
  max: 16,
1534
1640
  compactMax: 12
1535
- }, En = 8;
1536
- function Dn(e, t, n = Q.max, r = 1) {
1537
- let i = Math.floor(n * r), a = En * r;
1641
+ }, jn = 8;
1642
+ function Mn(e, t, n = Q.max, r = 1) {
1643
+ let i = Math.floor(n * r), a = jn * r;
1538
1644
  if (!e || t <= 0) return {
1539
1645
  cell: i,
1540
1646
  gap: 2,
@@ -1546,7 +1652,7 @@ function Dn(e, t, n = Q.max, r = 1) {
1546
1652
  cell: r,
1547
1653
  gap: n
1548
1654
  };
1549
- }, s = o(e - On(r));
1655
+ }, s = o(e - Nn(r));
1550
1656
  if (s.cell >= a) return {
1551
1657
  cell: Math.min(i, s.cell),
1552
1658
  gap: s.gap,
@@ -1559,12 +1665,12 @@ function Dn(e, t, n = Q.max, r = 1) {
1559
1665
  weekdays: !1
1560
1666
  };
1561
1667
  }
1562
- var On = (e = 1) => Math.round(28 * e), kn = (e = 1) => 26 * e;
1563
- function An(e, t, n = 1) {
1668
+ var Nn = (e = 1) => Math.round(28 * e), Pn = (e = 1) => 26 * e;
1669
+ function Fn(e, t, n = 1) {
1564
1670
  let r = [];
1565
1671
  for (let i of e) {
1566
1672
  let e = r[r.length - 1];
1567
- (!e || (i.week - e.week) * t >= kn(n)) && r.push(i);
1673
+ (!e || (i.week - e.week) * t >= Pn(n)) && r.push(i);
1568
1674
  }
1569
1675
  return r;
1570
1676
  }
@@ -1626,14 +1732,14 @@ function $(e, t) {
1626
1732
  }
1627
1733
  return l.length && c(l), n;
1628
1734
  }
1629
- var jn = {
1735
+ var In = {
1630
1736
  w: 44,
1631
1737
  h: 28
1632
1738
  };
1633
- function Mn(e, t, n, r = 1) {
1739
+ function Ln(e, t, n, r = 1) {
1634
1740
  let i = {
1635
- w: jn.w * r,
1636
- h: jn.h * r
1741
+ w: In.w * r,
1742
+ h: In.h * r
1637
1743
  }, a = 16 * r, o = (e) => e.w >= i.w && e.h >= i.h, s = [], c = $(e.map((e) => e.value), {
1638
1744
  x: 0,
1639
1745
  y: 0,
@@ -1660,13 +1766,13 @@ function Mn(e, t, n, r = 1) {
1660
1766
  rect: n,
1661
1767
  label: l > 0
1662
1768
  });
1663
- let ee = {
1769
+ let u = {
1664
1770
  x: n.x + 2,
1665
1771
  y: n.y + l + 2,
1666
1772
  w: Math.max(0, n.w - 4),
1667
1773
  h: Math.max(0, n.h - l - 4)
1668
1774
  };
1669
- $(r.map((e) => e.value), ee).forEach((t, n) => {
1775
+ $(r.map((e) => e.value), u).forEach((t, n) => {
1670
1776
  t.w > 0 && t.h > 0 && s.push({
1671
1777
  node: r[n],
1672
1778
  parent: e,
@@ -1676,8 +1782,8 @@ function Mn(e, t, n, r = 1) {
1676
1782
  });
1677
1783
  }), s;
1678
1784
  }
1679
- var Nn = (e) => Math.max(.55, 1 - e * .09);
1680
- function Pn(e) {
1785
+ var Rn = (e) => Math.max(.55, 1 - e * .09);
1786
+ function zn(e) {
1681
1787
  let t = Math.max(0, ...e.map((e) => e.value)), n = e[0]?.value ?? 0;
1682
1788
  return e.map((r, i) => {
1683
1789
  let a = i > 0 ? e[i - 1].value : 0;
@@ -1689,7 +1795,7 @@ function Pn(e) {
1689
1795
  };
1690
1796
  });
1691
1797
  }
1692
- var Fn = {
1798
+ var Bn = {
1693
1799
  half: {
1694
1800
  width: 120,
1695
1801
  height: 68,
@@ -1709,16 +1815,16 @@ var Fn = {
1709
1815
  to: 2 * Math.PI
1710
1816
  }
1711
1817
  };
1712
- function In(e, t) {
1713
- let n = Fn[e], r = Math.max(0, Math.min(100, t)) / 100;
1818
+ function Vn(e, t) {
1819
+ let n = Bn[e], r = Math.max(0, Math.min(100, t)) / 100;
1714
1820
  return {
1715
1821
  a0: n.from,
1716
1822
  a1: n.to,
1717
1823
  end: n.from + (n.to - n.from) * r
1718
1824
  };
1719
1825
  }
1720
- var Ln = .62, Rn = 8;
1721
- function zn(e, t = 48, n = 50) {
1826
+ var Hn = .62, Un = 8;
1827
+ function Wn(e, t = 48, n = 50) {
1722
1828
  let r = e.reduce((e, t) => e + t.value, 0);
1723
1829
  if (!r) return [];
1724
1830
  let i = 0, a = [];
@@ -1727,7 +1833,7 @@ function zn(e, t = 48, n = 50) {
1727
1833
  let e = K(o.value, r), s = i + o.value / r * 2 * Math.PI, c = e < 8 ? null : e >= 100 ? {
1728
1834
  x: n,
1729
1835
  y: n
1730
- } : Y(n, n, t * Ln, (i + s) / 2);
1836
+ } : Y(n, n, t * Hn, (i + s) / 2);
1731
1837
  a.push({
1732
1838
  slice: o,
1733
1839
  a0: i,
@@ -1738,4 +1844,4 @@ function zn(e, t = 48, n = 50) {
1738
1844
  }
1739
1845
  return a;
1740
1846
  }
1741
- 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 };
1847
+ export { Dt as $, ze as $t, Wn as A, le as An, dt as At, $t as B, St as Bt, sn as C, xe as Cn, T as Ct, hn as D, de as Dn, _t as Dt, pn as E, _e as En, O as Et, yn as F, M as Ft, Qt as G, C as Gt, W as H, Ct as Ht, $ as I, xt as It, V as J, ut as Jt, Kt as K, Tt as Kt, Ln as L, pt as Lt, Y as M, ie as Mn, wt as Mt, K as N, p as Nn, ot as Nt, mn as O, me as On, k as Ot, dn as P, tt as Pt, Gt as Q, Be as Qt, bn as R, ct as Rt, xn as S, be as Sn, lt as St, Vn as T, ye 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, je as Zt, fn as _, De as _n, Pt as _t, Un as a, b as an, I as at, Z as b, Te as bn, Je as bt, vn as c, Ne as cn, Ht as ct, An as d, Se as dn, Lt as dt, Ve as en, Vt as et, Fn as f, Ce as fn, Rt as ft, ln as g, we as gn, Ft as gt, Rn as h, Ee as hn, At as ht, Bn as i, Fe as in, Et as it, q as j, ne as jn, Ye as jt, _n as k, fe as kn, vt as kt, un as l, Ge as ln, P as lt, Nn as m, Ae as mn, F as mt, On as n, S as nn, It as nt, Sn as o, Ue as on, Bt as ot, Pn as p, v as pn, Ut as pt, B as q, at as qt, an as r, Pe as rn, N as rt, gn as s, Me 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, Oe as vn, Wt as vt, zn as w, ve as wn, yt as wt, Dn as x, y as xn, Qe as xt, rn as y, ke as yn, ft as yt, Cn as z, j as zt };