@caspeco/casper-ui-library 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/components/combobox/combobox-button.d.ts +1 -1
  2. package/dist/components/combobox/combobox-button.d.ts.map +1 -1
  3. package/dist/components/combobox/combobox-button.js +85 -69
  4. package/dist/components/combobox/combobox-item.d.ts +2 -1
  5. package/dist/components/combobox/combobox-item.d.ts.map +1 -1
  6. package/dist/components/combobox/combobox-item.js +10 -10
  7. package/dist/components/combobox/combobox-menu.js +68 -69
  8. package/dist/components/combobox/combobox.d.ts.map +1 -1
  9. package/dist/components/combobox/combobox.js +120 -123
  10. package/dist/components/combobox/types.d.ts +2 -0
  11. package/dist/components/combobox/types.d.ts.map +1 -1
  12. package/dist/components/date-picker/base-date-picker.js +175 -176
  13. package/dist/components/date-picker/date-picker-header.js +10 -10
  14. package/dist/components/date-picker/helper.js +9 -9
  15. package/dist/components/image-upload/image-cropper.js +112 -113
  16. package/dist/components/image-upload/image-upload-dropzone.js +35 -36
  17. package/dist/components/menu/menu-group.js +44 -45
  18. package/dist/components/segmented-control/segmented-control.js +29 -29
  19. package/dist/components/table/table-cell.js +25 -26
  20. package/dist/components/table/table-header-dropdown.js +60 -60
  21. package/dist/components/table/table-header-row.js +19 -20
  22. package/dist/components/table/table-toolbar.js +63 -64
  23. package/dist/components/table/use-controllable-state.js +7 -7
  24. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
  25. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +41 -41
  26. package/dist/node_modules/date-fns/addDays.js +7 -7
  27. package/dist/node_modules/date-fns/addMonths.js +13 -13
  28. package/dist/node_modules/date-fns/differenceInCalendarDays.js +11 -11
  29. package/dist/node_modules/date-fns/endOfDay.js +6 -6
  30. package/dist/node_modules/date-fns/endOfMonth.js +6 -6
  31. package/dist/node_modules/date-fns/format.js +46 -47
  32. package/dist/node_modules/date-fns/getDayOfYear.js +8 -8
  33. package/dist/node_modules/date-fns/getISOWeek.js +9 -9
  34. package/dist/node_modules/date-fns/getISOWeekYear.js +10 -10
  35. package/dist/node_modules/date-fns/getWeek.js +9 -9
  36. package/dist/node_modules/date-fns/getWeekYear.js +13 -14
  37. package/dist/node_modules/date-fns/isSameDay.js +9 -9
  38. package/dist/node_modules/date-fns/isSameMonth.js +9 -9
  39. package/dist/node_modules/date-fns/isSameWeek.js +8 -8
  40. package/dist/node_modules/date-fns/isSameYear.js +9 -9
  41. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +12 -12
  42. package/dist/node_modules/date-fns/locale/da/_lib/formatDistance.js +4 -4
  43. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +3 -3
  44. package/dist/node_modules/date-fns/locale/es/_lib/formatDistance.js +4 -4
  45. package/dist/node_modules/date-fns/locale/et/_lib/formatDistance.js +6 -6
  46. package/dist/node_modules/date-fns/locale/fi/_lib/formatDistance.js +17 -17
  47. package/dist/node_modules/date-fns/locale/lt/_lib/formatDistance.js +47 -47
  48. package/dist/node_modules/date-fns/locale/lv/_lib/formatDistance.js +11 -11
  49. package/dist/node_modules/date-fns/locale/nb/_lib/formatDistance.js +3 -3
  50. package/dist/node_modules/date-fns/locale/nl/_lib/formatDistance.js +4 -4
  51. package/dist/node_modules/date-fns/locale/sv/_lib/formatDistance.js +5 -5
  52. package/dist/node_modules/date-fns/startOfDay.js +6 -6
  53. package/dist/node_modules/date-fns/startOfMonth.js +6 -6
  54. package/dist/node_modules/date-fns/startOfWeek.js +7 -8
  55. package/dist/node_modules/date-fns/startOfWeekYear.js +9 -10
  56. package/dist/node_modules/date-fns/startOfYear.js +5 -5
  57. package/dist/theme/theme-config/components/modal-theme.js +13 -15
  58. package/dist/theme/theme-config/components/select-theme.js +15 -19
  59. package/package.json +3 -3
@@ -1,17 +1,16 @@
1
- import { getDefaultOptions as C } from "./_lib/defaultOptions.js";
2
- import { constructFrom as Y } from "./constructFrom.js";
3
- import { startOfWeek as D } from "./startOfWeek.js";
4
- import { toDate as F } from "./toDate.js";
5
- function H(t, e) {
6
- var u, k, m, W;
7
- const a = F(t, e == null ? void 0 : e.in), r = a.getFullYear(), c = C(), s = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((k = (u = e == null ? void 0 : e.locale) == null ? void 0 : u.options) == null ? void 0 : k.firstWeekContainsDate) ?? c.firstWeekContainsDate ?? ((W = (m = c.locale) == null ? void 0 : m.options) == null ? void 0 : W.firstWeekContainsDate) ?? 1, f = Y((e == null ? void 0 : e.in) || t, 0);
8
- f.setFullYear(r + 1, 0, s), f.setHours(0, 0, 0, 0);
9
- const O = D(f, e), l = Y((e == null ? void 0 : e.in) || t, 0);
10
- l.setFullYear(r, 0, s), l.setHours(0, 0, 0, 0);
11
- const n = D(l, e);
12
- return +a >= +O ? r + 1 : +a >= +n ? r : r - 1;
1
+ import { getDefaultOptions as k } from "./_lib/defaultOptions.js";
2
+ import { constructFrom as i } from "./constructFrom.js";
3
+ import { startOfWeek as l } from "./startOfWeek.js";
4
+ import { toDate as m } from "./toDate.js";
5
+ function C(r, e) {
6
+ const s = m(r, e?.in), t = s.getFullYear(), o = k(), f = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, a = i(e?.in || r, 0);
7
+ a.setFullYear(t + 1, 0, f), a.setHours(0, 0, 0, 0);
8
+ const c = l(a, e), n = i(e?.in || r, 0);
9
+ n.setFullYear(t, 0, f), n.setHours(0, 0, 0, 0);
10
+ const u = l(n, e);
11
+ return +s >= +c ? t + 1 : +s >= +u ? t : t - 1;
13
12
  }
14
13
  export {
15
- H as default,
16
- H as getWeekYear
14
+ C as default,
15
+ C as getWeekYear
17
16
  };
@@ -1,14 +1,14 @@
1
- import { normalizeDates as d } from "./_lib/normalizeDates.js";
1
+ import { normalizeDates as f } from "./_lib/normalizeDates.js";
2
2
  import { startOfDay as t } from "./startOfDay.js";
3
- function D(e, r, a) {
4
- const [f, m] = d(
5
- a == null ? void 0 : a.in,
6
- e,
7
- r
3
+ function s(a, e, r) {
4
+ const [o, i] = f(
5
+ r?.in,
6
+ a,
7
+ e
8
8
  );
9
- return +t(f) == +t(m);
9
+ return +t(o) == +t(i);
10
10
  }
11
11
  export {
12
- D as default,
13
- D as isSameDay
12
+ s as default,
13
+ s as isSameDay
14
14
  };
@@ -1,13 +1,13 @@
1
- import { normalizeDates as n } from "./_lib/normalizeDates.js";
2
- function g(r, l, e) {
3
- const [t, a] = n(
4
- e == null ? void 0 : e.in,
5
- r,
6
- l
1
+ import { normalizeDates as o } from "./_lib/normalizeDates.js";
2
+ function i(a, r, n) {
3
+ const [e, t] = o(
4
+ n?.in,
5
+ a,
6
+ r
7
7
  );
8
- return t.getFullYear() === a.getFullYear() && t.getMonth() === a.getMonth();
8
+ return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
9
9
  }
10
10
  export {
11
- g as default,
12
- g as isSameMonth
11
+ i as default,
12
+ i as isSameMonth
13
13
  };
@@ -1,14 +1,14 @@
1
- import { normalizeDates as l } from "./_lib/normalizeDates.js";
1
+ import { normalizeDates as i } from "./_lib/normalizeDates.js";
2
2
  import { startOfWeek as r } from "./startOfWeek.js";
3
- function c(a, t, e) {
4
- const [m, f] = l(
5
- e == null ? void 0 : e.in,
6
- a,
7
- t
3
+ function o(t, a, e) {
4
+ const [m, f] = i(
5
+ e?.in,
6
+ t,
7
+ a
8
8
  );
9
9
  return +r(m, e) == +r(f, e);
10
10
  }
11
11
  export {
12
- c as default,
13
- c as isSameWeek
12
+ o as default,
13
+ o as isSameWeek
14
14
  };
@@ -1,13 +1,13 @@
1
- import { normalizeDates as u } from "./_lib/normalizeDates.js";
2
- function f(a, r, e) {
3
- const [l, t] = u(
4
- e == null ? void 0 : e.in,
5
- a,
6
- r
1
+ import { normalizeDates as i } from "./_lib/normalizeDates.js";
2
+ function o(e, a, r) {
3
+ const [t, l] = i(
4
+ r?.in,
5
+ e,
6
+ a
7
7
  );
8
- return l.getFullYear() === t.getFullYear();
8
+ return t.getFullYear() === l.getFullYear();
9
9
  }
10
10
  export {
11
- f as default,
12
- f as isSameYear
11
+ o as default,
12
+ o as isSameYear
13
13
  };
@@ -1,18 +1,18 @@
1
- function h(e) {
2
- return (a, t) => {
3
- const c = t != null && t.context ? String(t.context) : "standalone";
4
- let l;
5
- if (c === "formatting" && e.formattingValues) {
6
- const d = e.defaultFormattingWidth || e.defaultWidth, u = t != null && t.width ? String(t.width) : d;
7
- l = e.formattingValues[u] || e.formattingValues[d];
1
+ function c(t) {
2
+ return (l, e) => {
3
+ const u = e?.context ? String(e.context) : "standalone";
4
+ let d;
5
+ if (u === "formatting" && t.formattingValues) {
6
+ const n = t.defaultFormattingWidth || t.defaultWidth, i = e?.width ? String(e.width) : n;
7
+ d = t.formattingValues[i] || t.formattingValues[n];
8
8
  } else {
9
- const d = e.defaultWidth, u = t != null && t.width ? String(t.width) : e.defaultWidth;
10
- l = e.values[u] || e.values[d];
9
+ const n = t.defaultWidth, i = e?.width ? String(e.width) : t.defaultWidth;
10
+ d = t.values[i] || t.values[n];
11
11
  }
12
- const f = e.argumentCallback ? e.argumentCallback(a) : a;
13
- return l[f];
12
+ const a = t.argumentCallback ? t.argumentCallback(l) : l;
13
+ return d[a];
14
14
  };
15
15
  }
16
16
  export {
17
- h as buildLocalizeFn
17
+ c as buildLocalizeFn
18
18
  };
@@ -60,11 +60,11 @@ const u = {
60
60
  one: "næsten 1 år",
61
61
  other: "næsten {{count}} år"
62
62
  }
63
- }, a = (o, t, n) => {
63
+ }, s = (r, o, t) => {
64
64
  let e;
65
- const r = u[o];
66
- return typeof r == "string" ? e = r : t === 1 ? e = r.one : e = r.other.replace("{{count}}", String(t)), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "om " + e : e + " siden" : e;
65
+ const n = u[r];
66
+ return typeof n == "string" ? e = n : o === 1 ? e = n.one : e = n.other.replace("{{count}}", String(o)), t?.addSuffix ? t.comparison && t.comparison > 0 ? "om " + e : e + " siden" : e;
67
67
  };
68
68
  export {
69
- a as formatDistance
69
+ s as formatDistance
70
70
  };
@@ -60,10 +60,10 @@ const a = {
60
60
  one: "almost 1 year",
61
61
  other: "almost {{count}} years"
62
62
  }
63
- }, r = (s, n, o) => {
63
+ }, r = (s, n, t) => {
64
64
  let e;
65
- const t = a[s];
66
- return typeof t == "string" ? e = t : n === 1 ? e = t.one : e = t.other.replace("{{count}}", n.toString()), o != null && o.addSuffix ? o.comparison && o.comparison > 0 ? "in " + e : e + " ago" : e;
65
+ const o = a[s];
66
+ return typeof o == "string" ? e = o : n === 1 ? e = o.one : e = o.other.replace("{{count}}", n.toString()), t?.addSuffix ? t.comparison && t.comparison > 0 ? "in " + e : e + " ago" : e;
67
67
  };
68
68
  export {
69
69
  r as formatDistance
@@ -1,4 +1,4 @@
1
- const t = {
1
+ const r = {
2
2
  lessThanXSeconds: {
3
3
  one: "menos de un segundo",
4
4
  other: "menos de {{count}} segundos"
@@ -60,10 +60,10 @@ const t = {
60
60
  one: "casi 1 año",
61
61
  other: "casi {{count}} años"
62
62
  }
63
- }, a = (r, s, o) => {
63
+ }, a = (t, s, n) => {
64
64
  let e;
65
- const n = t[r];
66
- return typeof n == "string" ? e = n : s === 1 ? e = n.one : e = n.other.replace("{{count}}", s.toString()), o != null && o.addSuffix ? o.comparison && o.comparison > 0 ? "en " + e : "hace " + e : e;
65
+ const o = r[t];
66
+ return typeof o == "string" ? e = o : s === 1 ? e = o.one : e = o.other.replace("{{count}}", s.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "en " + e : "hace " + e : e;
67
67
  };
68
68
  export {
69
69
  a as formatDistance
@@ -1,4 +1,4 @@
1
- const u = {
1
+ const s = {
2
2
  lessThanXSeconds: {
3
3
  standalone: {
4
4
  one: "vähem kui üks sekund",
@@ -153,11 +153,11 @@ const u = {
153
153
  other: "peaaegu {{count}} aasta"
154
154
  }
155
155
  }
156
- }, s = (o, a, e) => {
157
- const n = e != null && e.addSuffix ? u[o].withPreposition : u[o].standalone;
158
- let t;
159
- return typeof n == "string" ? t = n : a === 1 ? t = n.one : t = n.other.replace("{{count}}", String(a)), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? t + " pärast" : t + " eest" : t;
156
+ }, u = (n, a, t) => {
157
+ const o = t?.addSuffix ? s[n].withPreposition : s[n].standalone;
158
+ let e;
159
+ return typeof o == "string" ? e = o : a === 1 ? e = o.one : e = o.other.replace("{{count}}", String(a)), t?.addSuffix ? t.comparison && t.comparison > 0 ? e + " pärast" : e + " eest" : e;
160
160
  };
161
161
  export {
162
- s as formatDistance
162
+ u as formatDistance
163
163
  };
@@ -1,10 +1,10 @@
1
- function i(e) {
1
+ function r(e) {
2
2
  return e.replace(/sekuntia?/, "sekunnin");
3
3
  }
4
- function a(e) {
4
+ function s(e) {
5
5
  return e.replace(/minuuttia?/, "minuutin");
6
6
  }
7
- function s(e) {
7
+ function a(e) {
8
8
  return e.replace(/tuntia?/, "tunnin");
9
9
  }
10
10
  function k(e) {
@@ -16,19 +16,19 @@ function c(e) {
16
16
  function f(e) {
17
17
  return e.replace(/(kuukausi|kuukautta)/, "kuukauden");
18
18
  }
19
- function t(e) {
19
+ function u(e) {
20
20
  return e.replace(/(vuosi|vuotta)/, "vuoden");
21
21
  }
22
22
  const l = {
23
23
  lessThanXSeconds: {
24
24
  one: "alle sekunti",
25
25
  other: "alle {{count}} sekuntia",
26
- futureTense: i
26
+ futureTense: r
27
27
  },
28
28
  xSeconds: {
29
29
  one: "sekunti",
30
30
  other: "{{count}} sekuntia",
31
- futureTense: i
31
+ futureTense: r
32
32
  },
33
33
  halfAMinute: {
34
34
  one: "puoli minuuttia",
@@ -38,22 +38,22 @@ const l = {
38
38
  lessThanXMinutes: {
39
39
  one: "alle minuutti",
40
40
  other: "alle {{count}} minuuttia",
41
- futureTense: a
41
+ futureTense: s
42
42
  },
43
43
  xMinutes: {
44
44
  one: "minuutti",
45
45
  other: "{{count}} minuuttia",
46
- futureTense: a
46
+ futureTense: s
47
47
  },
48
48
  aboutXHours: {
49
49
  one: "noin tunti",
50
50
  other: "noin {{count}} tuntia",
51
- futureTense: s
51
+ futureTense: a
52
52
  },
53
53
  xHours: {
54
54
  one: "tunti",
55
55
  other: "{{count}} tuntia",
56
- futureTense: s
56
+ futureTense: a
57
57
  },
58
58
  xDays: {
59
59
  one: "päivä",
@@ -83,26 +83,26 @@ const l = {
83
83
  aboutXYears: {
84
84
  one: "noin vuosi",
85
85
  other: "noin {{count}} vuotta",
86
- futureTense: t
86
+ futureTense: u
87
87
  },
88
88
  xYears: {
89
89
  one: "vuosi",
90
90
  other: "{{count}} vuotta",
91
- futureTense: t
91
+ futureTense: u
92
92
  },
93
93
  overXYears: {
94
94
  one: "yli vuosi",
95
95
  other: "yli {{count}} vuotta",
96
- futureTense: t
96
+ futureTense: u
97
97
  },
98
98
  almostXYears: {
99
99
  one: "lähes vuosi",
100
100
  other: "lähes {{count}} vuotta",
101
- futureTense: t
101
+ futureTense: u
102
102
  }
103
- }, h = (e, r, u) => {
104
- const n = l[e], o = r === 1 ? n.one : n.other.replace("{{count}}", String(r));
105
- return u != null && u.addSuffix ? u.comparison && u.comparison > 0 ? n.futureTense(o) + " kuluttua" : o + " sitten" : o;
103
+ }, h = (e, i, t) => {
104
+ const n = l[e], o = i === 1 ? n.one : n.other.replace("{{count}}", String(i));
105
+ return t?.addSuffix ? t.comparison && t.comparison > 0 ? n.futureTense(o) + " kuluttua" : o + " sitten" : o;
106
106
  };
107
107
  export {
108
108
  h as formatDistance
@@ -16,97 +16,97 @@ const m = {
16
16
  over: "daugiau nei",
17
17
  almost: "beveik",
18
18
  lessthan: "mažiau nei"
19
- }, h = (s, r, e, t) => r ? t ? "kelių sekundžių" : "kelias sekundes" : "kelios sekundės", n = (s, r, e, t) => r ? t ? u(e)[1] : u(e)[2] : u(e)[0], a = (s, r, e, t) => {
20
- const i = s + " ";
21
- return s === 1 ? i + n(s, r, e, t) : r ? t ? i + u(e)[1] : i + (d(s) ? u(e)[1] : u(e)[2]) : i + (d(s) ? u(e)[1] : u(e)[0]);
19
+ }, h = (s, a, e, o) => a ? o ? "kelių sekundžių" : "kelias sekundes" : "kelios sekundės", t = (s, a, e, o) => a ? o ? i(e)[1] : i(e)[2] : i(e)[0], n = (s, a, e, o) => {
20
+ const u = s + " ";
21
+ return s === 1 ? u + t(s, a, e, o) : a ? o ? u + i(e)[1] : u + (d(s) ? i(e)[1] : i(e)[2]) : u + (d(s) ? i(e)[1] : i(e)[0]);
22
22
  };
23
23
  function d(s) {
24
24
  return s % 10 === 0 || s > 10 && s < 20;
25
25
  }
26
- function u(s) {
26
+ function i(s) {
27
27
  return m[s].split("_");
28
28
  }
29
29
  const x = {
30
30
  lessThanXSeconds: {
31
31
  one: h,
32
- other: a
32
+ other: n
33
33
  },
34
34
  xSeconds: {
35
35
  one: h,
36
- other: a
36
+ other: n
37
37
  },
38
38
  halfAMinute: "pusė minutės",
39
39
  lessThanXMinutes: {
40
- one: n,
41
- other: a
40
+ one: t,
41
+ other: n
42
42
  },
43
43
  xMinutes: {
44
- one: n,
45
- other: a
44
+ one: t,
45
+ other: n
46
46
  },
47
47
  aboutXHours: {
48
- one: n,
49
- other: a
48
+ one: t,
49
+ other: n
50
50
  },
51
51
  xHours: {
52
- one: n,
53
- other: a
52
+ one: t,
53
+ other: n
54
54
  },
55
55
  xDays: {
56
- one: n,
57
- other: a
56
+ one: t,
57
+ other: n
58
58
  },
59
59
  aboutXWeeks: {
60
- one: n,
61
- other: a
60
+ one: t,
61
+ other: n
62
62
  },
63
63
  xWeeks: {
64
- one: n,
65
- other: a
64
+ one: t,
65
+ other: n
66
66
  },
67
67
  aboutXMonths: {
68
- one: n,
69
- other: a
68
+ one: t,
69
+ other: n
70
70
  },
71
71
  xMonths: {
72
- one: n,
73
- other: a
72
+ one: t,
73
+ other: n
74
74
  },
75
75
  aboutXYears: {
76
- one: n,
77
- other: a
76
+ one: t,
77
+ other: n
78
78
  },
79
79
  xYears: {
80
- one: n,
81
- other: a
80
+ one: t,
81
+ other: n
82
82
  },
83
83
  overXYears: {
84
- one: n,
85
- other: a
84
+ one: t,
85
+ other: n
86
86
  },
87
87
  almostXYears: {
88
- one: n,
89
- other: a
88
+ one: t,
89
+ other: n
90
90
  }
91
- }, f = (s, r, e) => {
92
- const t = s.match(/about|over|almost|lessthan/i), i = t ? s.replace(t[0], "") : s, l = (e == null ? void 0 : e.comparison) !== void 0 && e.comparison > 0;
93
- let o;
91
+ }, f = (s, a, e) => {
92
+ const o = s.match(/about|over|almost|lessthan/i), u = o ? s.replace(o[0], "") : s, l = e?.comparison !== void 0 && e.comparison > 0;
93
+ let r;
94
94
  const _ = x[s];
95
- if (typeof _ == "string" ? o = _ : r === 1 ? o = _.one(
96
- r,
97
- (e == null ? void 0 : e.addSuffix) === !0,
98
- i.toLowerCase() + "_one",
95
+ if (typeof _ == "string" ? r = _ : a === 1 ? r = _.one(
96
+ a,
97
+ e?.addSuffix === !0,
98
+ u.toLowerCase() + "_one",
99
99
  l
100
- ) : o = _.other(
101
- r,
102
- (e == null ? void 0 : e.addSuffix) === !0,
103
- i.toLowerCase() + "_other",
100
+ ) : r = _.other(
101
+ a,
102
+ e?.addSuffix === !0,
103
+ u.toLowerCase() + "_other",
104
104
  l
105
- ), t) {
106
- const c = t[0].toLowerCase();
107
- o = m[c] + " " + o;
105
+ ), o) {
106
+ const c = o[0].toLowerCase();
107
+ r = m[c] + " " + r;
108
108
  }
109
- return e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "po " + o : "prieš " + o : o;
109
+ return e?.addSuffix ? e.comparison && e.comparison > 0 ? "po " + r : "prieš " + r : r;
110
110
  };
111
111
  export {
112
112
  f as formatDistance
@@ -1,14 +1,14 @@
1
1
  function e(n) {
2
- return (a, t) => {
3
- if (a === 1)
4
- return t != null && t.addSuffix ? n.one[0].replace("{{time}}", n.one[2]) : n.one[0].replace("{{time}}", n.one[1]);
2
+ return (t, a) => {
3
+ if (t === 1)
4
+ return a?.addSuffix ? n.one[0].replace("{{time}}", n.one[2]) : n.one[0].replace("{{time}}", n.one[1]);
5
5
  {
6
- const m = a % 10 === 1 && a % 100 !== 11;
7
- return t != null && t.addSuffix ? n.other[0].replace("{{time}}", m ? n.other[3] : n.other[4]).replace("{{count}}", String(a)) : n.other[0].replace("{{time}}", m ? n.other[1] : n.other[2]).replace("{{count}}", String(a));
6
+ const i = t % 10 === 1 && t % 100 !== 11;
7
+ return a?.addSuffix ? n.other[0].replace("{{time}}", i ? n.other[3] : n.other[4]).replace("{{count}}", String(t)) : n.other[0].replace("{{time}}", i ? n.other[1] : n.other[2]).replace("{{count}}", String(t));
8
8
  }
9
9
  };
10
10
  }
11
- const i = {
11
+ const m = {
12
12
  lessThanXSeconds: e({
13
13
  one: ["mazāk par {{time}}", "sekundi", "sekundi"],
14
14
  other: [
@@ -29,7 +29,7 @@ const i = {
29
29
  "sekundēm"
30
30
  ]
31
31
  }),
32
- halfAMinute: (n, a) => a != null && a.addSuffix ? "pusminūtes" : "pusminūte",
32
+ halfAMinute: (n, t) => t?.addSuffix ? "pusminūtes" : "pusminūte",
33
33
  lessThanXMinutes: e({
34
34
  one: ["mazāk par {{time}}", "minūti", "minūti"],
35
35
  other: [
@@ -113,10 +113,10 @@ const i = {
113
113
  one: ["gandrīz 1 {{time}}", "gads", "gada"],
114
114
  other: ["vairāk nekā {{count}} {{time}}", "gads", "gadi", "gada", "gadiem"]
115
115
  })
116
- }, d = (n, a, t) => {
117
- const m = i[n](a, t);
118
- return t != null && t.addSuffix ? t.comparison && t.comparison > 0 ? "pēc " + m : "pirms " + m : m;
116
+ }, s = (n, t, a) => {
117
+ const i = m[n](t, a);
118
+ return a?.addSuffix ? a.comparison && a.comparison > 0 ? "pēc " + i : "pirms " + i : i;
119
119
  };
120
120
  export {
121
- d as formatDistance
121
+ s as formatDistance
122
122
  };
@@ -60,10 +60,10 @@ const u = {
60
60
  one: "nesten ett år",
61
61
  other: "nesten {{count}} år"
62
62
  }
63
- }, s = (r, o, t) => {
63
+ }, s = (r, o, n) => {
64
64
  let e;
65
- const n = u[r];
66
- return typeof n == "string" ? e = n : o === 1 ? e = n.one : e = n.other.replace("{{count}}", String(o)), t != null && t.addSuffix ? t.comparison && t.comparison > 0 ? "om " + e : e + " siden" : e;
65
+ const t = u[r];
66
+ return typeof t == "string" ? e = t : o === 1 ? e = t.one : e = t.other.replace("{{count}}", String(o)), n?.addSuffix ? n.comparison && n.comparison > 0 ? "om " + e : e + " siden" : e;
67
67
  };
68
68
  export {
69
69
  s as formatDistance
@@ -1,4 +1,4 @@
1
- const t = {
1
+ const a = {
2
2
  lessThanXSeconds: {
3
3
  one: "minder dan een seconde",
4
4
  other: "minder dan {{count}} seconden"
@@ -60,10 +60,10 @@ const t = {
60
60
  one: "bijna 1 jaar",
61
61
  other: "bijna {{count}} jaar"
62
62
  }
63
- }, u = (a, r, n) => {
63
+ }, u = (t, r, o) => {
64
64
  let e;
65
- const o = t[a];
66
- return typeof o == "string" ? e = o : r === 1 ? e = o.one : e = o.other.replace("{{count}}", String(r)), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "over " + e : e + " geleden" : e;
65
+ const n = a[t];
66
+ return typeof n == "string" ? e = n : r === 1 ? e = n.one : e = n.other.replace("{{count}}", String(r)), o?.addSuffix ? o.comparison && o.comparison > 0 ? "over " + e : e + " geleden" : e;
67
67
  };
68
68
  export {
69
69
  u as formatDistance
@@ -74,13 +74,13 @@ const u = {
74
74
  "tio",
75
75
  "elva",
76
76
  "tolv"
77
- ], s = (o, t, n) => {
77
+ ], s = (r, n, o) => {
78
78
  let e;
79
- const r = u[o];
80
- return typeof r == "string" ? e = r : t === 1 ? e = r.one : e = r.other.replace(
79
+ const t = u[r];
80
+ return typeof t == "string" ? e = t : n === 1 ? e = t.one : e = t.other.replace(
81
81
  "{{count}}",
82
- t < 13 ? a[t] : String(t)
83
- ), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "om " + e : e + " sedan" : e;
82
+ n < 13 ? a[n] : String(n)
83
+ ), o?.addSuffix ? o.comparison && o.comparison > 0 ? "om " + e : e + " sedan" : e;
84
84
  };
85
85
  export {
86
86
  s as formatDistance
@@ -1,9 +1,9 @@
1
- import { toDate as e } from "./toDate.js";
2
- function u(a, t) {
3
- const r = e(a, t == null ? void 0 : t.in);
4
- return r.setHours(0, 0, 0, 0), r;
1
+ import { toDate as a } from "./toDate.js";
2
+ function n(o, r) {
3
+ const t = a(o, r?.in);
4
+ return t.setHours(0, 0, 0, 0), t;
5
5
  }
6
6
  export {
7
- u as default,
8
- u as startOfDay
7
+ n as default,
8
+ n as startOfDay
9
9
  };
@@ -1,9 +1,9 @@
1
- import { toDate as a } from "./toDate.js";
2
- function u(r, t) {
3
- const e = a(r, t == null ? void 0 : t.in);
4
- return e.setDate(1), e.setHours(0, 0, 0, 0), e;
1
+ import { toDate as r } from "./toDate.js";
2
+ function n(e, o) {
3
+ const t = r(e, o?.in);
4
+ return t.setDate(1), t.setHours(0, 0, 0, 0), t;
5
5
  }
6
6
  export {
7
- u as default,
8
- u as startOfMonth
7
+ n as default,
8
+ n as startOfMonth
9
9
  };
@@ -1,11 +1,10 @@
1
- import { getDefaultOptions as s } from "./_lib/defaultOptions.js";
2
- import { toDate as w } from "./toDate.js";
3
- function m(u, e) {
4
- var c, O, l, k;
5
- const a = s(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((O = (c = e == null ? void 0 : e.locale) == null ? void 0 : c.options) == null ? void 0 : O.weekStartsOn) ?? a.weekStartsOn ?? ((k = (l = a.locale) == null ? void 0 : l.options) == null ? void 0 : k.weekStartsOn) ?? 0, t = w(u, e == null ? void 0 : e.in), f = t.getDay(), d = (f < r ? 7 : 0) + f - r;
6
- return t.setDate(t.getDate() - d), t.setHours(0, 0, 0, 0), t;
1
+ import { getDefaultOptions as f } from "./_lib/defaultOptions.js";
2
+ import { toDate as c } from "./toDate.js";
3
+ function l(n, e) {
4
+ const a = f(), o = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0, t = c(n, e?.in), s = t.getDay(), r = (s < o ? 7 : 0) + s - o;
5
+ return t.setDate(t.getDate() - r), t.setHours(0, 0, 0, 0), t;
7
6
  }
8
7
  export {
9
- m as default,
10
- m as startOfWeek
8
+ l as default,
9
+ l as startOfWeek
11
10
  };