@omnitend/dashboard-for-laravel 0.41.1 → 0.42.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 (62) hide show
  1. package/README.md +2 -1
  2. package/dist/assets/MavenPro-Bold-35b16f06.woff2 +0 -0
  3. package/dist/assets/MavenPro-Medium-febc8674.woff2 +0 -0
  4. package/dist/assets/MavenPro-Regular-aee3df9e.woff2 +0 -0
  5. package/dist/assets/MavenPro-SemiBold-c555dbfa.woff2 +0 -0
  6. package/dist/assets/Poppins-Medium-5800fa57.woff2 +0 -0
  7. package/dist/assets/Poppins-SemiBold-94a36267.woff2 +0 -0
  8. package/dist/charts.js +148 -130
  9. package/dist/charts.js.map +1 -1
  10. package/dist/charts.umd.cjs +1 -1
  11. package/dist/charts.umd.cjs.map +1 -1
  12. package/dist/components/base/DModal.vue.d.ts +26 -2
  13. package/dist/components/charts/chartTheme.d.ts +14 -2
  14. package/dist/components/extended/DXField.vue.d.ts +16 -5
  15. package/dist/components/extended/DXForm.vue.d.ts +25 -9
  16. package/dist/components/extended/DXLoading.vue.d.ts +9 -0
  17. package/dist/components/extended/DXModalActions.vue.d.ts +12 -0
  18. package/dist/components/extended/DXNumberStepper.vue.d.ts +33 -0
  19. package/dist/components/extended/DXSaveButton.vue.d.ts +38 -0
  20. package/dist/components/extended/DXSwitch.vue.d.ts +1 -1
  21. package/dist/components/extended/DXTable.vue.d.ts +8 -2
  22. package/dist/composables/useForm.d.ts +7 -0
  23. package/dist/dashboard-for-laravel.js +9547 -9246
  24. package/dist/dashboard-for-laravel.js.map +1 -1
  25. package/dist/dashboard-for-laravel.umd.cjs +7 -7
  26. package/dist/dashboard-for-laravel.umd.cjs.map +1 -1
  27. package/dist/index.d.ts +5 -0
  28. package/dist/style.css +2 -2
  29. package/dist/types/index.d.ts +20 -3
  30. package/docs/public/api-reference.json +219 -17
  31. package/docs/public/docs-map.md +4 -2
  32. package/docs/public/llms.txt +7 -2
  33. package/package.json +1 -1
  34. package/resources/css/theme.scss +524 -103
  35. package/resources/fonts/maven-pro/MavenPro-Bold.woff2 +0 -0
  36. package/resources/fonts/maven-pro/MavenPro-Medium.woff2 +0 -0
  37. package/resources/fonts/maven-pro/MavenPro-Regular.woff2 +0 -0
  38. package/resources/fonts/maven-pro/MavenPro-SemiBold.woff2 +0 -0
  39. package/resources/fonts/maven-pro/OFL.txt +93 -0
  40. package/resources/fonts/poppins/OFL.txt +93 -0
  41. package/resources/fonts/poppins/Poppins-Medium.woff2 +0 -0
  42. package/resources/fonts/poppins/Poppins-SemiBold.woff2 +0 -0
  43. package/resources/js/components/base/DModal.vue +13 -2
  44. package/resources/js/components/charts/DXBarChart.vue +2 -1
  45. package/resources/js/components/charts/DXDoughnutChart.vue +2 -1
  46. package/resources/js/components/charts/DXLineChart.vue +2 -1
  47. package/resources/js/components/charts/chartTheme.ts +68 -21
  48. package/resources/js/components/extended/DXDashboard.vue +4 -2
  49. package/resources/js/components/extended/DXDashboardSidebar.vue +52 -20
  50. package/resources/js/components/extended/DXField.vue +59 -28
  51. package/resources/js/components/extended/DXForm.vue +122 -21
  52. package/resources/js/components/extended/DXLoading.vue +47 -0
  53. package/resources/js/components/extended/DXModalActions.vue +13 -0
  54. package/resources/js/components/extended/DXNumberStepper.vue +243 -0
  55. package/resources/js/components/extended/DXSaveButton.vue +82 -0
  56. package/resources/js/components/extended/DXSwitch.vue +8 -5
  57. package/resources/js/components/extended/DXTable.vue +58 -22
  58. package/resources/js/components/extended/DXTablePagination.vue +1 -1
  59. package/resources/js/composables/useForm.ts +11 -0
  60. package/resources/js/composables/useToast.ts +1 -1
  61. package/resources/js/index.ts +5 -0
  62. package/resources/js/types/index.ts +21 -3
package/README.md CHANGED
@@ -150,7 +150,8 @@ await form.delete("/api/users/1", options);
150
150
  form.processing; // boolean
151
151
  form.errors; // ValidationErrors
152
152
  form.hasErrors; // computed boolean
153
- form.recentlySuccessful; // boolean
153
+ form.recentlySuccessful; // boolean (clears after 1.5s)
154
+ form.wasSuccessful; // boolean (latest submit succeeded; until the next submit)
154
155
 
155
156
  // Form methods
156
157
  form.reset(); // Reset to initial values
package/dist/charts.js CHANGED
@@ -1,158 +1,176 @@
1
- import { ref as p, getCurrentScope as I, onScopeDispose as j, computed as h, defineComponent as v, openBlock as y, createElementBlock as C, createVNode as _, unref as d } from "vue";
2
- import { Bar as T, Line as W, Doughnut as Z } from "vue-chartjs";
3
- import { Chart as q, registerables as z } from "chart.js";
4
- const F = (o) => !!o && typeof o == "object" && !Array.isArray(o);
5
- function x(o, e) {
6
- const t = { ...o };
7
- for (const [r, n] of Object.entries(e))
8
- F(n) && F(t[r]) ? t[r] = x(t[r], n) : t[r] = n;
9
- return t;
1
+ import { ref as g, getCurrentScope as I, onScopeDispose as T, computed as m, defineComponent as x, openBlock as _, createElementBlock as k, createVNode as D, unref as u } from "vue";
2
+ import { Bar as W, Line as j, Doughnut as G } from "vue-chartjs";
3
+ import { Chart as Z, registerables as q } from "chart.js";
4
+ const w = (t) => !!t && typeof t == "object" && !Array.isArray(t);
5
+ function S(t, e) {
6
+ const r = { ...t };
7
+ for (const [n, a] of Object.entries(e))
8
+ w(a) && w(r[n]) ? r[n] = S(r[n], a) : r[n] = a;
9
+ return r;
10
10
  }
11
- let L = !1;
11
+ let B = !1;
12
12
  function $() {
13
- L || (q.register(...z), L = !0);
13
+ B || (Z.register(...q), B = !0);
14
14
  }
15
- const V = [
16
- ["--dx-chart-1", "#2563eb"],
17
- // blue
18
- ["--dx-chart-2", "#65a30d"],
15
+ const z = [
16
+ ["--dx-chart-1", "#7fd7fd"],
17
+ // sky
18
+ ["--dx-chart-2", "#7bf25a"],
19
19
  // lime
20
- ["--dx-chart-3", "#7c3aed"],
21
- // violet
22
- ["--dx-chart-4", "#0d9488"],
23
- // teal
24
- ["--dx-chart-5", "#ea580c"],
25
- // orange
26
- ["--dx-chart-6", "#0891b2"],
27
- // cyan
28
- ["--dx-chart-7", "#d97706"],
29
- // amber
30
- ["--dx-chart-8", "#db2777"]
31
- // pink
32
- ];
33
- function M(o) {
34
- return typeof document > "u" || typeof getComputedStyle > "u" ? null : o ?? document.documentElement;
20
+ ["--dx-chart-3", "#e46ab9"],
21
+ // magenta
22
+ ["--dx-chart-4", "#d6e86a"],
23
+ // lime-yellow
24
+ ["--dx-chart-5", "#b9a3f0"],
25
+ // lavender
26
+ ["--dx-chart-6", "#efd574"],
27
+ // butter
28
+ ["--dx-chart-7", "#9fb4ff"],
29
+ // periwinkle
30
+ ["--dx-chart-8", "#f7a072"]
31
+ // peach
32
+ ], H = [
33
+ ["--dx-chart-line-1", "#5590aa"],
34
+ ["--dx-chart-line-2", "#4d9839"],
35
+ ["--dx-chart-line-3", "#d161a9"],
36
+ ["--dx-chart-line-4", "#848f41"],
37
+ ["--dx-chart-line-5", "#907fbb"],
38
+ ["--dx-chart-line-6", "#99884a"],
39
+ ["--dx-chart-line-7", "#7686be"],
40
+ ["--dx-chart-line-8", "#ba7956"]
41
+ ], J = ["--dx-chart-edge", "#121419"];
42
+ function O(t) {
43
+ return typeof document > "u" || typeof getComputedStyle > "u" ? null : t ?? document.documentElement;
44
+ }
45
+ function K(t) {
46
+ return A(z, t);
47
+ }
48
+ function Q(t) {
49
+ return A(H, t);
35
50
  }
36
- function G(o) {
37
- const e = M(o);
38
- if (e === null)
39
- return V.map(([, r]) => r);
40
- const t = getComputedStyle(e);
41
- return V.map(([r, n]) => t.getPropertyValue(r).trim() || n);
51
+ function U(t) {
52
+ return A([J], t)[0];
42
53
  }
43
- function O(o, e, t) {
44
- const r = M(t);
45
- return r === null ? e : getComputedStyle(r).getPropertyValue(o).trim() || e;
54
+ function A(t, e) {
55
+ const r = O(e);
56
+ if (r === null)
57
+ return t.map(([, a]) => a);
58
+ const n = getComputedStyle(r);
59
+ return t.map(([a, l]) => n.getPropertyValue(a).trim() || l);
46
60
  }
47
- const b = p(0);
48
- let m = null, g = 0;
49
- function P() {
50
- return typeof document > "u" || typeof MutationObserver > "u" || I() === void 0 || (g += 1, m === null && (m = new MutationObserver(() => {
51
- b.value += 1;
52
- }), m.observe(document.documentElement, {
61
+ function F(t, e, r) {
62
+ const n = O(r);
63
+ return n === null ? e : getComputedStyle(n).getPropertyValue(t).trim() || e;
64
+ }
65
+ const y = g(0);
66
+ let f = null, C = 0;
67
+ function M() {
68
+ return typeof document > "u" || typeof MutationObserver > "u" || I() === void 0 || (C += 1, f === null && (f = new MutationObserver(() => {
69
+ y.value += 1;
70
+ }), f.observe(document.documentElement, {
53
71
  attributes: !0,
54
72
  attributeFilter: ["data-bs-theme"],
55
73
  subtree: !0
56
- })), j(() => {
57
- g -= 1, g === 0 && m !== null && (m.disconnect(), m = null);
58
- })), b;
74
+ })), T(() => {
75
+ C -= 1, C === 0 && f !== null && (f.disconnect(), f = null);
76
+ })), y;
59
77
  }
60
- function R(o, e) {
61
- const t = o.replace(/^#/, "");
62
- if (/^[0-9a-f]{6}$/i.test(t)) {
63
- const n = parseInt(t.slice(0, 2), 16), l = parseInt(t.slice(2, 4), 16), s = parseInt(t.slice(4, 6), 16);
64
- return `rgba(${n}, ${l}, ${s}, ${e})`;
78
+ function P(t, e) {
79
+ const r = t.replace(/^#/, "");
80
+ if (/^[0-9a-f]{6}$/i.test(r)) {
81
+ const a = parseInt(r.slice(0, 2), 16), l = parseInt(r.slice(2, 4), 16), s = parseInt(r.slice(4, 6), 16);
82
+ return `rgba(${a}, ${l}, ${s}, ${e})`;
65
83
  }
66
- const r = o.match(/^rgba?\(([^)]+)\)$/);
67
- if (r) {
68
- const [n, l, s] = r[1].split(",").map((u) => u.trim());
69
- return `rgba(${n}, ${l}, ${s}, ${e})`;
84
+ const n = t.match(/^rgba?\(([^)]+)\)$/);
85
+ if (n) {
86
+ const [a, l, s] = n[1].split(",").map((c) => c.trim());
87
+ return `rgba(${a}, ${l}, ${s}, ${e})`;
70
88
  }
71
- return o;
89
+ return t;
72
90
  }
73
- function B(o, e, t, r) {
74
- const n = new Intl.NumberFormat(r, {
91
+ function E(t, e, r, n) {
92
+ const a = new Intl.NumberFormat(n, {
75
93
  maximumFractionDigits: 2
76
- }).format(o);
77
- return e === "currency" ? `${t}${n}` : e === "percent" ? `${n}%` : n;
94
+ }).format(t);
95
+ return e === "currency" ? `${r}${a}` : e === "percent" ? `${a}%` : a;
78
96
  }
79
- function X(o) {
97
+ function R(t) {
80
98
  const {
81
99
  valueFormat: e,
82
- currencySymbol: t = "£",
83
- locale: r,
84
- showLegend: n = !1,
100
+ currencySymbol: r = "£",
101
+ locale: n,
102
+ showLegend: a = !1,
85
103
  hasValueAxis: l = !0,
86
104
  scope: s
87
- } = o, u = R(
88
- O("--bs-border-color", "#dee2e6", s),
105
+ } = t, c = P(
106
+ F("--bs-border-color", "#dee2e6", s),
89
107
  0.6
90
- ), a = O("--bs-secondary-color", "#6c757d", s), i = {
108
+ ), d = F("--bs-secondary-color", "#6c757d", s), h = {
91
109
  responsive: !0,
92
110
  maintainAspectRatio: !1,
93
111
  plugins: {
94
- legend: { display: n, labels: { color: a } },
112
+ legend: { display: a, labels: { color: d } },
95
113
  tooltip: {
96
114
  callbacks: {
97
- label: (c) => {
98
- var w, A;
99
- const f = ((w = c.parsed) == null ? void 0 : w.y) ?? c.parsed ?? c.raw, D = typeof f == "number" ? f : Number(f), S = Number.isFinite(D) ? B(D, e, t, r) : String(f), k = ((A = c.dataset) == null ? void 0 : A.label) ?? c.label ?? "";
100
- return k ? `${k}: ${S}` : S;
115
+ label: (o) => {
116
+ var L, V;
117
+ const i = ((L = o.parsed) == null ? void 0 : L.y) ?? o.parsed ?? o.raw, b = typeof i == "number" ? i : Number(i), v = Number.isFinite(b) ? E(b, e, r, n) : String(i), p = ((V = o.dataset) == null ? void 0 : V.label) ?? o.label ?? "";
118
+ return p ? `${p}: ${v}` : v;
101
119
  }
102
120
  }
103
121
  }
104
122
  }
105
123
  };
106
- return l && (i.scales = {
124
+ return l && (h.scales = {
107
125
  x: {
108
126
  grid: { display: !1 },
109
- border: { color: u },
110
- ticks: { color: a }
127
+ border: { color: c },
128
+ ticks: { color: d }
111
129
  },
112
130
  y: {
113
131
  beginAtZero: !0,
114
- grid: { color: u, drawBorder: !1 },
132
+ grid: { color: c, drawBorder: !1 },
115
133
  border: { display: !1 },
116
134
  ticks: {
117
- color: a,
118
- callback: (c) => B(Number(c), e, t, r)
135
+ color: d,
136
+ callback: (o) => E(Number(o), e, r, n)
119
137
  }
120
138
  }
121
- }), i;
139
+ }), h;
122
140
  }
123
- function E(o, e, t, r) {
124
- const n = G(r), l = o.length === 1;
125
- return o.map((s, u) => {
126
- const a = { ...s }, i = n[u % n.length];
127
- return e === "doughnut" ? (a.backgroundColor === void 0 && (a.backgroundColor = Array.from(
128
- { length: t },
129
- (c, f) => n[f % n.length]
130
- )), a) : e === "line" ? (a.borderColor === void 0 && (a.borderColor = i), a.backgroundColor === void 0 && (a.backgroundColor = R(i, 0.15)), a.tension === void 0 && (a.tension = 0.3), a.fill === void 0 && (a.fill = !0), a.pointRadius === void 0 && (a.pointRadius = 2), a) : (a.backgroundColor === void 0 && (a.backgroundColor = l && t > 1 ? Array.from({ length: t }, () => i) : i), a.borderRadius === void 0 && (a.borderRadius = 4), a);
141
+ function N(t, e, r, n) {
142
+ const a = K(n), l = Q(n), s = U(n), c = t.length === 1;
143
+ return t.map((d, h) => {
144
+ const o = { ...d }, i = a[h % a.length], b = l[h % l.length];
145
+ return e === "doughnut" ? (o.backgroundColor === void 0 && (o.backgroundColor = Array.from(
146
+ { length: r },
147
+ (v, p) => a[p % a.length]
148
+ )), o.borderColor === void 0 && (o.borderColor = s), o.borderWidth === void 0 && (o.borderWidth = 1), o) : e === "line" ? (o.borderColor === void 0 && (o.borderColor = b), o.backgroundColor === void 0 && (o.backgroundColor = P(i, 0.35)), o.pointBackgroundColor === void 0 && (o.pointBackgroundColor = i), o.pointBorderColor === void 0 && (o.pointBorderColor = b), o.tension === void 0 && (o.tension = 0.3), o.fill === void 0 && (o.fill = !0), o.pointRadius === void 0 && (o.pointRadius = 2), o) : (o.backgroundColor === void 0 && (o.backgroundColor = c && r > 1 ? Array.from({ length: r }, () => i) : i), o.borderColor === void 0 && (o.borderColor = s), o.borderWidth === void 0 && (o.borderWidth = 1), o.borderRadius === void 0 && (o.borderRadius = 4), o);
131
149
  });
132
150
  }
133
- function N(o, e, t) {
134
- const r = P(), n = h(() => (r.value, {
151
+ function X(t, e, r) {
152
+ const n = M(), a = m(() => (n.value, {
135
153
  labels: e.labels,
136
- datasets: E(
154
+ datasets: N(
137
155
  e.datasets,
138
- o,
156
+ t,
139
157
  e.labels.length,
140
- t.value
158
+ r.value
141
159
  )
142
- })), l = h(() => (r.value, x(
143
- X({
160
+ })), l = m(() => (n.value, S(
161
+ R({
144
162
  valueFormat: e.valueFormat,
145
163
  currencySymbol: e.currencySymbol,
146
164
  locale: e.locale,
147
165
  showLegend: e.showLegend ?? e.datasets.length > 1,
148
166
  hasValueAxis: !0,
149
- scope: t.value
167
+ scope: r.value
150
168
  }),
151
169
  e.options ?? {}
152
170
  )));
153
- return { chartData: n, mergedOptions: l };
171
+ return { chartData: a, mergedOptions: l };
154
172
  }
155
- const Q = /* @__PURE__ */ v({
173
+ const oe = /* @__PURE__ */ x({
156
174
  __name: "DXBarChart",
157
175
  props: {
158
176
  labels: {},
@@ -163,21 +181,21 @@ const Q = /* @__PURE__ */ v({
163
181
  locale: {},
164
182
  showLegend: { type: Boolean, default: void 0 }
165
183
  },
166
- setup(o) {
184
+ setup(t) {
167
185
  $();
168
- const e = o, t = p(null), { chartData: r, mergedOptions: n } = N("bar", e, t);
169
- return (l, s) => (y(), C("div", {
186
+ const e = t, r = g(null), { chartData: n, mergedOptions: a } = X("bar", e, r);
187
+ return (l, s) => (_(), k("div", {
170
188
  ref_key: "host",
171
- ref: t,
189
+ ref: r,
172
190
  class: "dx-chart"
173
191
  }, [
174
- _(d(T), {
175
- data: d(r),
176
- options: d(n)
192
+ D(u(W), {
193
+ data: u(n),
194
+ options: u(a)
177
195
  }, null, 8, ["data", "options"])
178
196
  ], 512));
179
197
  }
180
- }), U = /* @__PURE__ */ v({
198
+ }), re = /* @__PURE__ */ x({
181
199
  __name: "DXLineChart",
182
200
  props: {
183
201
  labels: {},
@@ -188,21 +206,21 @@ const Q = /* @__PURE__ */ v({
188
206
  locale: {},
189
207
  showLegend: { type: Boolean, default: void 0 }
190
208
  },
191
- setup(o) {
209
+ setup(t) {
192
210
  $();
193
- const e = o, t = p(null), { chartData: r, mergedOptions: n } = N("line", e, t);
194
- return (l, s) => (y(), C("div", {
211
+ const e = t, r = g(null), { chartData: n, mergedOptions: a } = X("line", e, r);
212
+ return (l, s) => (_(), k("div", {
195
213
  ref_key: "host",
196
- ref: t,
214
+ ref: r,
197
215
  class: "dx-chart"
198
216
  }, [
199
- _(d(W), {
200
- data: d(r),
201
- options: d(n)
217
+ D(u(j), {
218
+ data: u(n),
219
+ options: u(a)
202
220
  }, null, 8, ["data", "options"])
203
221
  ], 512));
204
222
  }
205
- }), Y = /* @__PURE__ */ v({
223
+ }), ne = /* @__PURE__ */ x({
206
224
  __name: "DXDoughnutChart",
207
225
  props: {
208
226
  labels: {},
@@ -214,35 +232,35 @@ const Q = /* @__PURE__ */ v({
214
232
  locale: {},
215
233
  showLegend: { type: Boolean, default: void 0 }
216
234
  },
217
- setup(o) {
235
+ setup(t) {
218
236
  $();
219
- const e = o, t = p(null), r = P(), n = h(
237
+ const e = t, r = g(null), n = M(), a = m(
220
238
  () => e.datasets ?? [{ data: e.data ?? [] }]
221
- ), l = h(() => (r.value, {
239
+ ), l = m(() => (n.value, {
222
240
  labels: e.labels,
223
- datasets: E(
224
- n.value,
241
+ datasets: N(
242
+ a.value,
225
243
  "doughnut",
226
244
  e.labels.length,
227
- t.value
245
+ r.value
228
246
  )
229
- })), s = h(() => (r.value, x(
230
- X({
247
+ })), s = m(() => (n.value, S(
248
+ R({
231
249
  valueFormat: e.valueFormat,
232
250
  currencySymbol: e.currencySymbol,
233
251
  locale: e.locale,
234
252
  showLegend: e.showLegend ?? !0,
235
253
  hasValueAxis: !1,
236
- scope: t.value
254
+ scope: r.value
237
255
  }),
238
256
  e.options ?? {}
239
257
  )));
240
- return (u, a) => (y(), C("div", {
258
+ return (c, d) => (_(), k("div", {
241
259
  ref_key: "host",
242
- ref: t,
260
+ ref: r,
243
261
  class: "dx-chart"
244
262
  }, [
245
- _(d(Z), {
263
+ D(u(G), {
246
264
  data: l.value,
247
265
  options: s.value
248
266
  }, null, 8, ["data", "options"])
@@ -250,8 +268,8 @@ const Q = /* @__PURE__ */ v({
250
268
  }
251
269
  });
252
270
  export {
253
- Q as DXBarChart,
254
- Y as DXDoughnutChart,
255
- U as DXLineChart
271
+ oe as DXBarChart,
272
+ ne as DXDoughnutChart,
273
+ re as DXLineChart
256
274
  };
257
275
  //# sourceMappingURL=charts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"charts.js","sources":["../resources/js/components/charts/chartTheme.ts","../resources/js/components/charts/useThemedChart.ts","../resources/js/components/charts/DXBarChart.vue","../resources/js/components/charts/DXLineChart.vue","../resources/js/components/charts/DXDoughnutChart.vue"],"sourcesContent":["/**\n * Shared theming for the DX*Chart wrappers: the dedicated categorical chart\n * palette (--dx-chart-* from the live theme), dashboard-friendly default options (no gridlines /\n * legend clutter, responsive, formatted ticks), and a one-time Chart.js\n * registration. chart.js / vue-chartjs are OPTIONAL peer deps.\n */\nimport { Chart, registerables } from \"chart.js\";\nimport { getCurrentScope, onScopeDispose, ref, type Ref } from \"vue\";\n\nexport type ChartValueFormat = \"number\" | \"currency\" | \"percent\";\n\nconst isPlainObject = (value: unknown): value is Record<string, any> =>\n !!value && typeof value === \"object\" && !Array.isArray(value);\n\n/** Deep-merge consumer `options` over the themed defaults (arrays replace). */\nexport function mergeOptions(\n base: Record<string, any>,\n override: Record<string, any>,\n): Record<string, any> {\n const result: Record<string, any> = { ...base };\n for (const [key, value] of Object.entries(override)) {\n if (isPlainObject(value) && isPlainObject(result[key])) {\n result[key] = mergeOptions(result[key], value);\n } else {\n result[key] = value;\n }\n }\n return result;\n}\n\nlet registered = false;\n\n/**\n * Register Chart.js (idempotent). Uses the full `registerables` set so every\n * controller / scale / element / plugin (incl. Legend, Tooltip, Filler) is\n * available — chart.js is an external peer dep, so this adds no bundle weight.\n */\nexport function registerCharts(): void {\n if (registered) return;\n Chart.register(...registerables);\n registered = true;\n}\n\n// The dedicated data-viz palette (`$dx-chart-palette` in theme.scss) — eight\n// vivid hues in a fixed, CVD-validated order, published as --dx-chart-1..8.\n// Deliberately NOT the semantic --bs-* colours (#141): the base theme colours\n// are dark AA \"emphasis\" shades (too muted for series), and status colours\n// shouldn't impersonate \"series 2\". Fallbacks mirror the shipped theme so\n// charts still render without the CSS (SSR / tests / a consumer who didn't\n// import it). Sync with theme.scss's $dx-chart-palette is enforced by a test\n// that parses the Sass source (charts.test.ts), which is why this is exported.\nexport const PALETTE_VARS: Array<[string, string]> = [\n [\"--dx-chart-1\", \"#2563eb\"], // blue\n [\"--dx-chart-2\", \"#65a30d\"], // lime\n [\"--dx-chart-3\", \"#7c3aed\"], // violet\n [\"--dx-chart-4\", \"#0d9488\"], // teal\n [\"--dx-chart-5\", \"#ea580c\"], // orange\n [\"--dx-chart-6\", \"#0891b2\"], // cyan\n [\"--dx-chart-7\", \"#d97706\"], // amber\n [\"--dx-chart-8\", \"#db2777\"], // pink\n];\n\n/**\n * The element whose computed style the theme variables are read from.\n *\n * Bootstrap 5.3 allows `data-bs-theme` on ANY container, not just `<html>` — a\n * dark card on a light page is a supported pattern. Reading the variables off\n * `document.documentElement` therefore gives a *nested* scope the wrong palette\n * (#161), so every resolver takes the chart's own container and only falls back\n * to the root when it has none (SSR, a caller outside a component).\n */\nfunction themeScope(scope?: Element | null): Element | null {\n if (typeof document === \"undefined\" || typeof getComputedStyle === \"undefined\") {\n return null;\n }\n if (scope !== undefined && scope !== null) return scope;\n return document.documentElement;\n}\n\n/**\n * Resolve the themed categorical palette.\n *\n * @param scope The chart's container element; its computed style decides which\n * `data-bs-theme` scope applies. Omit (or pass null) to read the document\n * root — the pre-#161 behaviour, kept so the exported signature stays\n * backward compatible.\n */\nexport function getPalette(scope?: Element | null): string[] {\n const host = themeScope(scope);\n if (host === null) {\n return PALETTE_VARS.map(([, fallback]) => fallback);\n }\n const styles = getComputedStyle(host);\n return PALETTE_VARS.map(([name, fallback]) => {\n const value = styles.getPropertyValue(name).trim();\n return value || fallback;\n });\n}\n\n/** Read a single theme colour (e.g. the body text colour) with a fallback. */\nfunction themeColor(name: string, fallback: string, scope?: Element | null): string {\n const host = themeScope(scope);\n if (host === null) {\n return fallback;\n }\n const value = getComputedStyle(host).getPropertyValue(name).trim();\n return value || fallback;\n}\n\n// ---------------------------------------------------------------------------\n// Colour-mode reactivity (#161)\n//\n// The palette lives in CSS variables, which Vue cannot track: a computed that\n// calls getPalette() depends only on the props it also reads, so flipping\n// `data-bs-theme` repaints the page but leaves every MOUNTED chart on the old\n// palette until a prop changes or it remounts. One shared MutationObserver\n// bumps a version ref that the chart computeds read, which re-resolves the\n// variables. `subtree: true` because the attribute can sit on any container,\n// and `attributeFilter` keeps the observer from firing on unrelated mutations.\n// ---------------------------------------------------------------------------\n\nconst colorModeVersion = ref(0);\nlet colorModeObserver: MutationObserver | null = null;\nlet colorModeWatchers = 0;\n\n/**\n * A version ref that increments whenever a `data-bs-theme` attribute changes\n * anywhere in the document. Read it inside a computed that resolves theme\n * variables to make that computed re-run on a colour-mode switch.\n *\n * The observer is started on first use and disconnected when the last consumer's\n * effect scope is disposed, so nothing leaks after the charts unmount. Called\n * outside an effect scope (or without a DOM) it is a no-op returning a static\n * ref — there would be no teardown hook to disconnect the observer.\n */\nexport function useColorModeVersion(): Ref<number> {\n if (\n typeof document === \"undefined\" ||\n typeof MutationObserver === \"undefined\" ||\n getCurrentScope() === undefined\n ) {\n return colorModeVersion;\n }\n\n colorModeWatchers += 1;\n if (colorModeObserver === null) {\n colorModeObserver = new MutationObserver(() => {\n colorModeVersion.value += 1;\n });\n colorModeObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-bs-theme\"],\n subtree: true,\n });\n }\n\n onScopeDispose(() => {\n colorModeWatchers -= 1;\n if (colorModeWatchers === 0 && colorModeObserver !== null) {\n colorModeObserver.disconnect();\n colorModeObserver = null;\n }\n });\n\n return colorModeVersion;\n}\n\n/** Add an alpha channel to a hex or rgb() colour (best-effort). */\nexport function withAlpha(color: string, alpha: number): string {\n const hex = color.replace(/^#/, \"\");\n if (/^[0-9a-f]{6}$/i.test(hex)) {\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n }\n const rgbMatch = color.match(/^rgba?\\(([^)]+)\\)$/);\n if (rgbMatch) {\n const [r, g, b] = rgbMatch[1].split(\",\").map((n) => n.trim());\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n }\n return color;\n}\n\n/** Format a numeric value per the chart's value format (for tick/tooltips). */\nexport function formatValue(\n value: number,\n format: ChartValueFormat | undefined,\n currencySymbol: string,\n locale?: string,\n): string {\n const num = new Intl.NumberFormat(locale, {\n maximumFractionDigits: 2,\n }).format(value);\n if (format === \"currency\") return `${currencySymbol}${num}`;\n if (format === \"percent\") return `${num}%`;\n return num;\n}\n\nexport interface BaseOptionArgs {\n valueFormat?: ChartValueFormat;\n currencySymbol?: string;\n locale?: string;\n /** Show the legend (default: false for a single dataset, true for many). */\n showLegend?: boolean;\n /** Whether the chart has value axes (bar/line) vs none (doughnut). */\n hasValueAxis?: boolean;\n /** The chart's container element — decides which `data-bs-theme` scope the\n * grid/tick colours resolve against (#161). Defaults to the document root. */\n scope?: Element | null;\n}\n\n/** Dashboard default Chart.js options merged under any consumer `options`. */\nexport function baseOptions(args: BaseOptionArgs): Record<string, any> {\n const {\n valueFormat,\n currencySymbol = \"£\",\n locale,\n showLegend = false,\n hasValueAxis = true,\n scope,\n } = args;\n\n const gridColor = withAlpha(\n themeColor(\"--bs-border-color\", \"#dee2e6\", scope),\n 0.6,\n );\n const tickColor = themeColor(\"--bs-secondary-color\", \"#6c757d\", scope);\n\n const options: Record<string, any> = {\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: { display: showLegend, labels: { color: tickColor } },\n tooltip: {\n callbacks: {\n label: (ctx: any) => {\n const raw = ctx.parsed?.y ?? ctx.parsed ?? ctx.raw;\n const value = typeof raw === \"number\" ? raw : Number(raw);\n const formatted = Number.isFinite(value)\n ? formatValue(value, valueFormat, currencySymbol, locale)\n : String(raw);\n const label = ctx.dataset?.label ?? ctx.label ?? \"\";\n return label ? `${label}: ${formatted}` : formatted;\n },\n },\n },\n },\n };\n\n if (hasValueAxis) {\n options.scales = {\n x: {\n grid: { display: false },\n border: { color: gridColor },\n ticks: { color: tickColor },\n },\n y: {\n beginAtZero: true,\n grid: { color: gridColor, drawBorder: false },\n border: { display: false },\n ticks: {\n color: tickColor,\n callback: (value: number | string) =>\n formatValue(Number(value), valueFormat, currencySymbol, locale),\n },\n },\n };\n }\n\n return options;\n}\n\n/**\n * Apply the themed palette to any dataset that doesn't set its own colours.\n * Bar: one colour per dataset (or per bar for a single dataset). Line: a themed\n * stroke + translucent fill. Doughnut/pie: one colour per slice.\n *\n * `scope` is the chart's container element; the palette is resolved from its\n * computed style so a nested `data-bs-theme` container themes correctly (#161).\n * Omit it to resolve against the document root.\n */\nexport function applyPalette(\n datasets: any[],\n kind: \"bar\" | \"line\" | \"doughnut\",\n labelsCount: number,\n scope?: Element | null,\n): any[] {\n const palette = getPalette(scope);\n const single = datasets.length === 1;\n\n return datasets.map((dataset, index) => {\n const next = { ...dataset };\n const color = palette[index % palette.length];\n\n if (kind === \"doughnut\") {\n if (next.backgroundColor === undefined) {\n next.backgroundColor = Array.from(\n { length: labelsCount },\n (_, i) => palette[i % palette.length],\n );\n }\n return next;\n }\n\n if (kind === \"line\") {\n if (next.borderColor === undefined) next.borderColor = color;\n if (next.backgroundColor === undefined) {\n next.backgroundColor = withAlpha(color, 0.15);\n }\n if (next.tension === undefined) next.tension = 0.3;\n if (next.fill === undefined) next.fill = true;\n if (next.pointRadius === undefined) next.pointRadius = 2;\n return next;\n }\n\n // bar\n if (next.backgroundColor === undefined) {\n next.backgroundColor =\n single && labelsCount > 1\n ? Array.from({ length: labelsCount }, () => color)\n : color;\n }\n if (next.borderRadius === undefined) next.borderRadius = 4;\n return next;\n });\n}\n","import { computed, type ComputedRef, type Ref } from \"vue\";\nimport type { ChartData, ChartDataset, ChartOptions } from \"chart.js\";\nimport {\n baseOptions,\n applyPalette,\n mergeOptions,\n useColorModeVersion,\n type ChartValueFormat,\n} from \"./chartTheme\";\n\n/**\n * Shared props for the value-axis chart wrappers (`DXBarChart`, `DXLineChart`).\n * `DXBarChart` and `DXLineChart` differ ONLY in the chart.js component they\n * render and the palette kind — everything else (theming, option-merge,\n * legend-default) is identical, and lived duplicated in both SFCs (#135).\n */\nexport interface ThemedChartProps<TType extends \"bar\" | \"line\"> {\n /** X-axis category labels. */\n labels: string[];\n /** Chart.js datasets. Colours are themed when a dataset omits them. */\n datasets: ChartDataset<TType>[];\n /** Chart.js options; deep-merged over the themed defaults. */\n options?: ChartOptions<TType>;\n /** Format value-axis ticks and tooltips. */\n valueFormat?: ChartValueFormat;\n /** Currency symbol for valueFormat: \"currency\" (default \"£\"). */\n currencySymbol?: string;\n /** Locale for number formatting. */\n locale?: string;\n /** Show the legend (default: only when there is more than one dataset). */\n showLegend?: boolean;\n}\n\n/**\n * The themed-chart body shared by `DXBarChart` and `DXLineChart`: applies the\n * data-viz palette to un-coloured datasets and deep-merges the consumer's\n * `options` over the dashboard-friendly defaults. Pass the reactive `props`\n * object (property access stays reactive inside the computeds).\n *\n * `host` is the chart's own container element (a template ref). It is BOTH the\n * `data-bs-theme` scope the palette resolves against and — being a ref read\n * inside the computeds — the trigger that re-themes once it is populated on\n * mount, since the first render happens before a template ref exists (#161).\n */\nexport function useThemedChart<TType extends \"bar\" | \"line\">(\n type: TType,\n props: ThemedChartProps<TType>,\n host: Ref<HTMLElement | null>,\n): {\n chartData: ComputedRef<ChartData<TType>>;\n mergedOptions: ComputedRef<ChartOptions<TType>>;\n} {\n // Bumped by a MutationObserver on every `data-bs-theme` change; read below\n // so the CSS-variable palette — invisible to Vue's reactivity — is\n // re-resolved when the colour mode flips under a mounted chart.\n const colorModeVersion = useColorModeVersion();\n\n const chartData = computed(() => {\n void colorModeVersion.value;\n return {\n labels: props.labels,\n datasets: applyPalette(\n props.datasets,\n type,\n props.labels.length,\n host.value,\n ),\n } as ChartData<TType>;\n });\n\n const mergedOptions = computed(() => {\n void colorModeVersion.value;\n return mergeOptions(\n baseOptions({\n valueFormat: props.valueFormat,\n currencySymbol: props.currencySymbol,\n locale: props.locale,\n showLegend: props.showLegend ?? props.datasets.length > 1,\n hasValueAxis: true,\n scope: host.value,\n }),\n props.options ?? {},\n ) as ChartOptions<TType>;\n });\n\n return { chartData, mergedOptions };\n}\n","<!--\n @component\n A themed bar chart. Thin wrapper around vue-chartjs (chart.js) with the\n theme's dedicated chart palette (--dx-chart-1..8) applied and dashboard-friendly defaults (no x gridlines,\n formatted value ticks, responsive, legend hidden for a single series). Pass\n `labels` + `datasets`; `options` deep-merges over the defaults.\n\n Requires the optional peer deps `chart.js` and `vue-chartjs`.\n-->\n<template>\n <div ref=\"host\" class=\"dx-chart\">\n <Bar :data=\"chartData\" :options=\"mergedOptions\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { Bar } from \"vue-chartjs\";\nimport { registerCharts } from \"./chartTheme\";\nimport { useThemedChart, type ThemedChartProps } from \"./useThemedChart\";\n\nregisterCharts();\n\n// `showLegend` defaults to `undefined` (not Vue's Boolean-cast `false`) so the\n// `?? datasets.length > 1` default can actually fire when it isn't passed.\nconst props = withDefaults(defineProps<ThemedChartProps<\"bar\">>(), {\n currencySymbol: \"£\",\n showLegend: undefined,\n});\n\n// The container is the `data-bs-theme` scope the palette resolves against, so a\n// chart inside a dark card on a light page themes from the card (#161).\nconst host = ref<HTMLElement | null>(null);\n\nconst { chartData, mergedOptions } = useThemedChart(\"bar\", props, host);\n</script>\n","<!--\n @component\n A themed line chart. Thin wrapper around vue-chartjs (chart.js) with the\n theme's dedicated chart palette applied (--dx-chart-1..8 stroke + translucent fill, smoothed line)\n and dashboard-friendly defaults. Pass `labels` + `datasets`; `options`\n deep-merges over the defaults.\n\n Requires the optional peer deps `chart.js` and `vue-chartjs`.\n-->\n<template>\n <div ref=\"host\" class=\"dx-chart\">\n <Line :data=\"chartData\" :options=\"mergedOptions\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { Line } from \"vue-chartjs\";\nimport { registerCharts } from \"./chartTheme\";\nimport { useThemedChart, type ThemedChartProps } from \"./useThemedChart\";\n\nregisterCharts();\n\n// `showLegend` defaults to `undefined` (not Vue's Boolean-cast `false`) so the\n// `?? datasets.length > 1` default can actually fire when it isn't passed.\nconst props = withDefaults(defineProps<ThemedChartProps<\"line\">>(), {\n currencySymbol: \"£\",\n showLegend: undefined,\n});\n\n// The container is the `data-bs-theme` scope the palette resolves against, so a\n// chart inside a dark card on a light page themes from the card (#161).\nconst host = ref<HTMLElement | null>(null);\n\nconst { chartData, mergedOptions } = useThemedChart(\"line\", props, host);\n</script>\n","<!--\n @component\n A themed doughnut chart. Thin wrapper around vue-chartjs (chart.js) with one\n chart-palette colour (--dx-chart-1..8) per slice and dashboard-friendly defaults. Pass\n `labels` + either `data` (a number array) or full `datasets`; `options`\n deep-merges over the defaults.\n\n Requires the optional peer deps `chart.js` and `vue-chartjs`.\n-->\n<template>\n <div ref=\"host\" class=\"dx-chart\">\n <Doughnut :data=\"chartData\" :options=\"mergedOptions\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { Doughnut } from \"vue-chartjs\";\nimport {\n registerCharts,\n baseOptions,\n applyPalette,\n mergeOptions,\n useColorModeVersion,\n type ChartValueFormat,\n} from \"./chartTheme\";\n\nregisterCharts();\n\ninterface Props {\n /** Slice labels. */\n labels: string[];\n /** Convenience: a single number array (one value per label). */\n data?: number[];\n /** Full Chart.js datasets (alternative to `data`). */\n datasets?: any[];\n /** Chart.js options; deep-merged over the themed defaults. */\n options?: Record<string, any>;\n /** Format tooltip values. */\n valueFormat?: ChartValueFormat;\n /** Currency symbol for valueFormat: \"currency\" (default \"£\"). */\n currencySymbol?: string;\n /** Locale for number formatting. */\n locale?: string;\n /** Show the legend (default: true — slices need identifying). */\n showLegend?: boolean;\n}\n\n// `showLegend` defaults to `undefined` (not Vue's Boolean-cast `false`) so the\n// `?? true` default can actually fire when it isn't passed.\nconst props = withDefaults(defineProps<Props>(), {\n currencySymbol: \"£\",\n showLegend: undefined,\n});\n\n// The container is the `data-bs-theme` scope the palette resolves against, so a\n// chart inside a dark card on a light page themes from the card. Reading the ref\n// inside the computeds also re-themes on mount, when the first (pre-ref) render\n// had to fall back to the document root (#161). DXDoughnutChart doesn't share\n// `useThemedChart` (its data shape differs), so the wiring is repeated here.\nconst host = ref<HTMLElement | null>(null);\n\n// Bumped by a MutationObserver on every `data-bs-theme` change; read below so\n// the CSS-variable palette — invisible to Vue's reactivity — is re-resolved\n// when the colour mode flips under a mounted chart.\nconst colorModeVersion = useColorModeVersion();\n\nconst resolvedDatasets = computed(() =>\n props.datasets ?? [{ data: props.data ?? [] }],\n);\n\nconst chartData = computed(() => {\n void colorModeVersion.value;\n return {\n labels: props.labels,\n datasets: applyPalette(\n resolvedDatasets.value,\n \"doughnut\",\n props.labels.length,\n host.value,\n ),\n };\n});\n\nconst mergedOptions = computed(() => {\n void colorModeVersion.value;\n return mergeOptions(\n baseOptions({\n valueFormat: props.valueFormat,\n currencySymbol: props.currencySymbol,\n locale: props.locale,\n showLegend: props.showLegend ?? true,\n hasValueAxis: false,\n scope: host.value,\n }),\n props.options ?? {},\n );\n});\n</script>\n"],"names":["isPlainObject","value","mergeOptions","base","override","result","key","registered","registerCharts","Chart","registerables","PALETTE_VARS","themeScope","scope","getPalette","host","fallback","styles","name","themeColor","colorModeVersion","ref","colorModeObserver","colorModeWatchers","useColorModeVersion","getCurrentScope","onScopeDispose","withAlpha","color","alpha","hex","r","g","b","rgbMatch","n","formatValue","format","currencySymbol","locale","num","baseOptions","args","valueFormat","showLegend","hasValueAxis","gridColor","tickColor","options","ctx","raw","_a","formatted","label","_b","applyPalette","datasets","kind","labelsCount","palette","single","dataset","index","next","_","i","useThemedChart","type","props","chartData","computed","mergedOptions","__props","_createElementBlock","_createVNode","_unref","Bar","Line","resolvedDatasets","Doughnut"],"mappings":";;;AAWA,MAAMA,IAAgB,CAACC,MACnB,CAAC,CAACA,KAAS,OAAOA,KAAU,YAAY,CAAC,MAAM,QAAQA,CAAK;AAGzD,SAASC,EACZC,GACAC,GACmB;AACnB,QAAMC,IAA8B,EAAE,GAAGF,EAAA;AACzC,aAAW,CAACG,GAAKL,CAAK,KAAK,OAAO,QAAQG,CAAQ;AAC9C,IAAIJ,EAAcC,CAAK,KAAKD,EAAcK,EAAOC,CAAG,CAAC,IACjDD,EAAOC,CAAG,IAAIJ,EAAaG,EAAOC,CAAG,GAAGL,CAAK,IAE7CI,EAAOC,CAAG,IAAIL;AAGtB,SAAOI;AACX;AAEA,IAAIE,IAAa;AAOV,SAASC,IAAuB;AACnC,EAAID,MACJE,EAAM,SAAS,GAAGC,CAAa,GAC/BH,IAAa;AACjB;AAUO,MAAMI,IAAwC;AAAA,EACjD,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAC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c;AAAA,QAChC,cAAc;AAAA,QACd,OAAOrD,EAAK;AAAA,MAAA,CACb;AAAA,MACDqD,EAAM,WAAW,CAAA;AAAA,IAAC,EAErB;2BAvFCK,EAEM,OAAA;AAAA,eAFG;AAAA,MAAJ,KAAI1D;AAAA,MAAO,OAAM;AAAA,IAAA;MACpB2D,EAAuDC,EAAAI,CAAA,GAAA;AAAA,QAA5C,MAAMV,EAAA;AAAA,QAAY,SAASE,EAAA;AAAA,MAAA;;;;"}
1
+ {"version":3,"file":"charts.js","sources":["../resources/js/components/charts/chartTheme.ts","../resources/js/components/charts/useThemedChart.ts","../resources/js/components/charts/DXBarChart.vue","../resources/js/components/charts/DXLineChart.vue","../resources/js/components/charts/DXDoughnutChart.vue"],"sourcesContent":["/**\n * Shared theming for the DX*Chart wrappers: the dedicated categorical chart\n * palette (--dx-chart-* from the live theme), dashboard-friendly default options (no gridlines /\n * legend clutter, responsive, formatted ticks), and a one-time Chart.js\n * registration. chart.js / vue-chartjs are OPTIONAL peer deps.\n */\nimport { Chart, registerables } from \"chart.js\";\nimport { getCurrentScope, onScopeDispose, ref, type Ref } from \"vue\";\n\nexport type ChartValueFormat = \"number\" | \"currency\" | \"percent\";\n\nconst isPlainObject = (value: unknown): value is Record<string, any> =>\n !!value && typeof value === \"object\" && !Array.isArray(value);\n\n/** Deep-merge consumer `options` over the themed defaults (arrays replace). */\nexport function mergeOptions(\n base: Record<string, any>,\n override: Record<string, any>,\n): Record<string, any> {\n const result: Record<string, any> = { ...base };\n for (const [key, value] of Object.entries(override)) {\n if (isPlainObject(value) && isPlainObject(result[key])) {\n result[key] = mergeOptions(result[key], value);\n } else {\n result[key] = value;\n }\n }\n return result;\n}\n\nlet registered = false;\n\n/**\n * Register Chart.js (idempotent). Uses the full `registerables` set so every\n * controller / scale / element / plugin (incl. Legend, Tooltip, Filler) is\n * available — chart.js is an external peer dep, so this adds no bundle weight.\n */\nexport function registerCharts(): void {\n if (registered) return;\n Chart.register(...registerables);\n registered = true;\n}\n\n// The dedicated data-viz palette (`$dx-chart-palette` in theme.scss) — eight\n// light, vivid fills in a fixed, CVD-validated order, published as\n// --dx-chart-1..8. Deliberately NOT read from the semantic --bs-* colours\n// (#141). Fallbacks mirror the shipped theme so charts still render without\n// the CSS (SSR / tests / a consumer who didn't import it). Sync with\n// theme.scss is enforced by a test that parses the Sass source\n// (charts.test.ts), which is why these lists are exported.\nexport const PALETTE_VARS: Array<[string, string]> = [\n [\"--dx-chart-1\", \"#7fd7fd\"], // sky\n [\"--dx-chart-2\", \"#7bf25a\"], // lime\n [\"--dx-chart-3\", \"#e46ab9\"], // magenta\n [\"--dx-chart-4\", \"#d6e86a\"], // lime-yellow\n [\"--dx-chart-5\", \"#b9a3f0\"], // lavender\n [\"--dx-chart-6\", \"#efd574\"], // butter\n [\"--dx-chart-7\", \"#9fb4ff\"], // periwinkle\n [\"--dx-chart-8\", \"#f7a072\"], // peach\n];\n\n// The line/point shade for each slot (`$dx-chart-line-palette`): the fill\n// darkened to 3.5:1 on white, so a line stroke or point outline clears WCAG\n// 1.4.11 non-text contrast where the light fill alone would not. Same order.\nexport const LINE_PALETTE_VARS: Array<[string, string]> = [\n [\"--dx-chart-line-1\", \"#5590aa\"],\n [\"--dx-chart-line-2\", \"#4d9839\"],\n [\"--dx-chart-line-3\", \"#d161a9\"],\n [\"--dx-chart-line-4\", \"#848f41\"],\n [\"--dx-chart-line-5\", \"#907fbb\"],\n [\"--dx-chart-line-6\", \"#99884a\"],\n [\"--dx-chart-line-7\", \"#7686be\"],\n [\"--dx-chart-line-8\", \"#ba7956\"],\n];\n\n// The 1px outline on bars and doughnut segments (`$dx-chart-edge`): it carries\n// the non-text contrast for the light fills. Dark mode remaps it to the dark\n// body colour.\nexport const EDGE_VAR: [string, string] = [\"--dx-chart-edge\", \"#121419\"];\n\n/**\n * The element whose computed style the theme variables are read from.\n *\n * Bootstrap 5.3 allows `data-bs-theme` on ANY container, not just `<html>` — a\n * dark card on a light page is a supported pattern. Reading the variables off\n * `document.documentElement` therefore gives a *nested* scope the wrong palette\n * (#161), so every resolver takes the chart's own container and only falls back\n * to the root when it has none (SSR, a caller outside a component).\n */\nfunction themeScope(scope?: Element | null): Element | null {\n if (typeof document === \"undefined\" || typeof getComputedStyle === \"undefined\") {\n return null;\n }\n if (scope !== undefined && scope !== null) return scope;\n return document.documentElement;\n}\n\n/**\n * Resolve the themed categorical palette.\n *\n * @param scope The chart's container element; its computed style decides which\n * `data-bs-theme` scope applies. Omit (or pass null) to read the document\n * root — the pre-#161 behaviour, kept so the exported signature stays\n * backward compatible.\n */\nexport function getPalette(scope?: Element | null): string[] {\n return resolveVars(PALETTE_VARS, scope);\n}\n\n/**\n * Resolve the themed line/point shades (`--dx-chart-line-1..8`), slot for slot\n * with getPalette(). Same scope rules as getPalette().\n */\nexport function getLinePalette(scope?: Element | null): string[] {\n return resolveVars(LINE_PALETTE_VARS, scope);\n}\n\n/** Resolve the bar/segment edge colour (`--dx-chart-edge`). */\nexport function getEdgeColor(scope?: Element | null): string {\n return resolveVars([EDGE_VAR], scope)[0];\n}\n\nfunction resolveVars(vars: Array<[string, string]>, scope?: Element | null): string[] {\n const host = themeScope(scope);\n if (host === null) {\n return vars.map(([, fallback]) => fallback);\n }\n const styles = getComputedStyle(host);\n return vars.map(([name, fallback]) => {\n const value = styles.getPropertyValue(name).trim();\n return value || fallback;\n });\n}\n\n/** Read a single theme colour (e.g. the body text colour) with a fallback. */\nfunction themeColor(name: string, fallback: string, scope?: Element | null): string {\n const host = themeScope(scope);\n if (host === null) {\n return fallback;\n }\n const value = getComputedStyle(host).getPropertyValue(name).trim();\n return value || fallback;\n}\n\n// ---------------------------------------------------------------------------\n// Colour-mode reactivity (#161)\n//\n// The palette lives in CSS variables, which Vue cannot track: a computed that\n// calls getPalette() depends only on the props it also reads, so flipping\n// `data-bs-theme` repaints the page but leaves every MOUNTED chart on the old\n// palette until a prop changes or it remounts. One shared MutationObserver\n// bumps a version ref that the chart computeds read, which re-resolves the\n// variables. `subtree: true` because the attribute can sit on any container,\n// and `attributeFilter` keeps the observer from firing on unrelated mutations.\n// ---------------------------------------------------------------------------\n\nconst colorModeVersion = ref(0);\nlet colorModeObserver: MutationObserver | null = null;\nlet colorModeWatchers = 0;\n\n/**\n * A version ref that increments whenever a `data-bs-theme` attribute changes\n * anywhere in the document. Read it inside a computed that resolves theme\n * variables to make that computed re-run on a colour-mode switch.\n *\n * The observer is started on first use and disconnected when the last consumer's\n * effect scope is disposed, so nothing leaks after the charts unmount. Called\n * outside an effect scope (or without a DOM) it is a no-op returning a static\n * ref — there would be no teardown hook to disconnect the observer.\n */\nexport function useColorModeVersion(): Ref<number> {\n if (\n typeof document === \"undefined\" ||\n typeof MutationObserver === \"undefined\" ||\n getCurrentScope() === undefined\n ) {\n return colorModeVersion;\n }\n\n colorModeWatchers += 1;\n if (colorModeObserver === null) {\n colorModeObserver = new MutationObserver(() => {\n colorModeVersion.value += 1;\n });\n colorModeObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-bs-theme\"],\n subtree: true,\n });\n }\n\n onScopeDispose(() => {\n colorModeWatchers -= 1;\n if (colorModeWatchers === 0 && colorModeObserver !== null) {\n colorModeObserver.disconnect();\n colorModeObserver = null;\n }\n });\n\n return colorModeVersion;\n}\n\n/** Add an alpha channel to a hex or rgb() colour (best-effort). */\nexport function withAlpha(color: string, alpha: number): string {\n const hex = color.replace(/^#/, \"\");\n if (/^[0-9a-f]{6}$/i.test(hex)) {\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n }\n const rgbMatch = color.match(/^rgba?\\(([^)]+)\\)$/);\n if (rgbMatch) {\n const [r, g, b] = rgbMatch[1].split(\",\").map((n) => n.trim());\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n }\n return color;\n}\n\n/** Format a numeric value per the chart's value format (for tick/tooltips). */\nexport function formatValue(\n value: number,\n format: ChartValueFormat | undefined,\n currencySymbol: string,\n locale?: string,\n): string {\n const num = new Intl.NumberFormat(locale, {\n maximumFractionDigits: 2,\n }).format(value);\n if (format === \"currency\") return `${currencySymbol}${num}`;\n if (format === \"percent\") return `${num}%`;\n return num;\n}\n\nexport interface BaseOptionArgs {\n valueFormat?: ChartValueFormat;\n currencySymbol?: string;\n locale?: string;\n /** Show the legend (default: false for a single dataset, true for many). */\n showLegend?: boolean;\n /** Whether the chart has value axes (bar/line) vs none (doughnut). */\n hasValueAxis?: boolean;\n /** The chart's container element — decides which `data-bs-theme` scope the\n * grid/tick colours resolve against (#161). Defaults to the document root. */\n scope?: Element | null;\n}\n\n/** Dashboard default Chart.js options merged under any consumer `options`. */\nexport function baseOptions(args: BaseOptionArgs): Record<string, any> {\n const {\n valueFormat,\n currencySymbol = \"£\",\n locale,\n showLegend = false,\n hasValueAxis = true,\n scope,\n } = args;\n\n const gridColor = withAlpha(\n themeColor(\"--bs-border-color\", \"#dee2e6\", scope),\n 0.6,\n );\n const tickColor = themeColor(\"--bs-secondary-color\", \"#6c757d\", scope);\n\n const options: Record<string, any> = {\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: { display: showLegend, labels: { color: tickColor } },\n tooltip: {\n callbacks: {\n label: (ctx: any) => {\n const raw = ctx.parsed?.y ?? ctx.parsed ?? ctx.raw;\n const value = typeof raw === \"number\" ? raw : Number(raw);\n const formatted = Number.isFinite(value)\n ? formatValue(value, valueFormat, currencySymbol, locale)\n : String(raw);\n const label = ctx.dataset?.label ?? ctx.label ?? \"\";\n return label ? `${label}: ${formatted}` : formatted;\n },\n },\n },\n },\n };\n\n if (hasValueAxis) {\n options.scales = {\n x: {\n grid: { display: false },\n border: { color: gridColor },\n ticks: { color: tickColor },\n },\n y: {\n beginAtZero: true,\n grid: { color: gridColor, drawBorder: false },\n border: { display: false },\n ticks: {\n color: tickColor,\n callback: (value: number | string) =>\n formatValue(Number(value), valueFormat, currencySymbol, locale),\n },\n },\n };\n }\n\n return options;\n}\n\n/**\n * Apply the themed palette to any dataset that doesn't set its own colours.\n * Each property is filled in only when the caller left it undefined.\n * Bar: one fill per dataset (or per bar for a single dataset), with a 1px\n * edge outline. Line: the slot's darker line shade for the stroke and point\n * outlines, the fill for point centres, and a 35% fill wash under the line.\n * Doughnut/pie: one fill per slice, with a 1px edge outline.\n *\n * `scope` is the chart's container element; the palette is resolved from its\n * computed style so a nested `data-bs-theme` container themes correctly (#161).\n * Omit it to resolve against the document root.\n */\nexport function applyPalette(\n datasets: any[],\n kind: \"bar\" | \"line\" | \"doughnut\",\n labelsCount: number,\n scope?: Element | null,\n): any[] {\n const palette = getPalette(scope);\n const linePalette = getLinePalette(scope);\n const edge = getEdgeColor(scope);\n const single = datasets.length === 1;\n\n return datasets.map((dataset, index) => {\n const next = { ...dataset };\n const color = palette[index % palette.length];\n const lineColor = linePalette[index % linePalette.length];\n\n if (kind === \"doughnut\") {\n if (next.backgroundColor === undefined) {\n next.backgroundColor = Array.from(\n { length: labelsCount },\n (_, i) => palette[i % palette.length],\n );\n }\n if (next.borderColor === undefined) next.borderColor = edge;\n if (next.borderWidth === undefined) next.borderWidth = 1;\n return next;\n }\n\n if (kind === \"line\") {\n if (next.borderColor === undefined) next.borderColor = lineColor;\n if (next.backgroundColor === undefined) {\n next.backgroundColor = withAlpha(color, 0.35);\n }\n if (next.pointBackgroundColor === undefined) next.pointBackgroundColor = color;\n if (next.pointBorderColor === undefined) next.pointBorderColor = lineColor;\n if (next.tension === undefined) next.tension = 0.3;\n if (next.fill === undefined) next.fill = true;\n if (next.pointRadius === undefined) next.pointRadius = 2;\n return next;\n }\n\n // bar\n if (next.backgroundColor === undefined) {\n next.backgroundColor =\n single && labelsCount > 1\n ? Array.from({ length: labelsCount }, () => color)\n : color;\n }\n if (next.borderColor === undefined) next.borderColor = edge;\n if (next.borderWidth === undefined) next.borderWidth = 1;\n if (next.borderRadius === undefined) next.borderRadius = 4;\n return next;\n });\n}\n","import { computed, type ComputedRef, type Ref } from \"vue\";\nimport type { ChartData, ChartDataset, ChartOptions } from \"chart.js\";\nimport {\n baseOptions,\n applyPalette,\n mergeOptions,\n useColorModeVersion,\n type ChartValueFormat,\n} from \"./chartTheme\";\n\n/**\n * Shared props for the value-axis chart wrappers (`DXBarChart`, `DXLineChart`).\n * `DXBarChart` and `DXLineChart` differ ONLY in the chart.js component they\n * render and the palette kind — everything else (theming, option-merge,\n * legend-default) is identical, and lived duplicated in both SFCs (#135).\n */\nexport interface ThemedChartProps<TType extends \"bar\" | \"line\"> {\n /** X-axis category labels. */\n labels: string[];\n /** Chart.js datasets. Colours are themed when a dataset omits them. */\n datasets: ChartDataset<TType>[];\n /** Chart.js options; deep-merged over the themed defaults. */\n options?: ChartOptions<TType>;\n /** Format value-axis ticks and tooltips. */\n valueFormat?: ChartValueFormat;\n /** Currency symbol for valueFormat: \"currency\" (default \"£\"). */\n currencySymbol?: string;\n /** Locale for number formatting. */\n locale?: string;\n /** Show the legend (default: only when there is more than one dataset). */\n showLegend?: boolean;\n}\n\n/**\n * The themed-chart body shared by `DXBarChart` and `DXLineChart`: applies the\n * data-viz palette to un-coloured datasets and deep-merges the consumer's\n * `options` over the dashboard-friendly defaults. Pass the reactive `props`\n * object (property access stays reactive inside the computeds).\n *\n * `host` is the chart's own container element (a template ref). It is BOTH the\n * `data-bs-theme` scope the palette resolves against and — being a ref read\n * inside the computeds — the trigger that re-themes once it is populated on\n * mount, since the first render happens before a template ref exists (#161).\n */\nexport function useThemedChart<TType extends \"bar\" | \"line\">(\n type: TType,\n props: ThemedChartProps<TType>,\n host: Ref<HTMLElement | null>,\n): {\n chartData: ComputedRef<ChartData<TType>>;\n mergedOptions: ComputedRef<ChartOptions<TType>>;\n} {\n // Bumped by a MutationObserver on every `data-bs-theme` change; read below\n // so the CSS-variable palette — invisible to Vue's reactivity — is\n // re-resolved when the colour mode flips under a mounted chart.\n const colorModeVersion = useColorModeVersion();\n\n const chartData = computed(() => {\n void colorModeVersion.value;\n return {\n labels: props.labels,\n datasets: applyPalette(\n props.datasets,\n type,\n props.labels.length,\n host.value,\n ),\n } as ChartData<TType>;\n });\n\n const mergedOptions = computed(() => {\n void colorModeVersion.value;\n return mergeOptions(\n baseOptions({\n valueFormat: props.valueFormat,\n currencySymbol: props.currencySymbol,\n locale: props.locale,\n showLegend: props.showLegend ?? props.datasets.length > 1,\n hasValueAxis: true,\n scope: host.value,\n }),\n props.options ?? {},\n ) as ChartOptions<TType>;\n });\n\n return { chartData, mergedOptions };\n}\n","<!--\n @component\n A themed bar chart. Thin wrapper around vue-chartjs (chart.js) with the\n theme's dedicated chart palette (--dx-chart-1..8 fills, a 1px --dx-chart-edge outline) applied\n and dashboard-friendly defaults (no x gridlines,\n formatted value ticks, responsive, legend hidden for a single series). Pass\n `labels` + `datasets`; `options` deep-merges over the defaults.\n\n Requires the optional peer deps `chart.js` and `vue-chartjs`.\n-->\n<template>\n <div ref=\"host\" class=\"dx-chart\">\n <Bar :data=\"chartData\" :options=\"mergedOptions\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { Bar } from \"vue-chartjs\";\nimport { registerCharts } from \"./chartTheme\";\nimport { useThemedChart, type ThemedChartProps } from \"./useThemedChart\";\n\nregisterCharts();\n\n// `showLegend` defaults to `undefined` (not Vue's Boolean-cast `false`) so the\n// `?? datasets.length > 1` default can actually fire when it isn't passed.\nconst props = withDefaults(defineProps<ThemedChartProps<\"bar\">>(), {\n currencySymbol: \"£\",\n showLegend: undefined,\n});\n\n// The container is the `data-bs-theme` scope the palette resolves against, so a\n// chart inside a dark card on a light page themes from the card (#161).\nconst host = ref<HTMLElement | null>(null);\n\nconst { chartData, mergedOptions } = useThemedChart(\"bar\", props, host);\n</script>\n","<!--\n @component\n A themed line chart. Thin wrapper around vue-chartjs (chart.js) with the\n theme's dedicated chart palette applied (--dx-chart-line-1..8 stroke and point outline,\n --dx-chart-1..8 point centre and translucent area fill, smoothed line)\n and dashboard-friendly defaults. Pass `labels` + `datasets`; `options`\n deep-merges over the defaults.\n\n Requires the optional peer deps `chart.js` and `vue-chartjs`.\n-->\n<template>\n <div ref=\"host\" class=\"dx-chart\">\n <Line :data=\"chartData\" :options=\"mergedOptions\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { Line } from \"vue-chartjs\";\nimport { registerCharts } from \"./chartTheme\";\nimport { useThemedChart, type ThemedChartProps } from \"./useThemedChart\";\n\nregisterCharts();\n\n// `showLegend` defaults to `undefined` (not Vue's Boolean-cast `false`) so the\n// `?? datasets.length > 1` default can actually fire when it isn't passed.\nconst props = withDefaults(defineProps<ThemedChartProps<\"line\">>(), {\n currencySymbol: \"£\",\n showLegend: undefined,\n});\n\n// The container is the `data-bs-theme` scope the palette resolves against, so a\n// chart inside a dark card on a light page themes from the card (#161).\nconst host = ref<HTMLElement | null>(null);\n\nconst { chartData, mergedOptions } = useThemedChart(\"line\", props, host);\n</script>\n","<!--\n @component\n A themed doughnut chart. Thin wrapper around vue-chartjs (chart.js) with one\n chart-palette colour (--dx-chart-1..8) per slice, a 1px --dx-chart-edge outline, and\n dashboard-friendly defaults. Pass\n `labels` + either `data` (a number array) or full `datasets`; `options`\n deep-merges over the defaults.\n\n Requires the optional peer deps `chart.js` and `vue-chartjs`.\n-->\n<template>\n <div ref=\"host\" class=\"dx-chart\">\n <Doughnut :data=\"chartData\" :options=\"mergedOptions\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\nimport { Doughnut } from \"vue-chartjs\";\nimport {\n registerCharts,\n baseOptions,\n applyPalette,\n mergeOptions,\n useColorModeVersion,\n type ChartValueFormat,\n} from \"./chartTheme\";\n\nregisterCharts();\n\ninterface Props {\n /** Slice labels. */\n labels: string[];\n /** Convenience: a single number array (one value per label). */\n data?: number[];\n /** Full Chart.js datasets (alternative to `data`). */\n datasets?: any[];\n /** Chart.js options; deep-merged over the themed defaults. */\n options?: Record<string, any>;\n /** Format tooltip values. */\n valueFormat?: ChartValueFormat;\n /** Currency symbol for valueFormat: \"currency\" (default \"£\"). */\n currencySymbol?: string;\n /** Locale for number formatting. */\n locale?: string;\n /** Show the legend (default: true — slices need identifying). */\n showLegend?: boolean;\n}\n\n// `showLegend` defaults to `undefined` (not Vue's Boolean-cast `false`) so the\n// `?? true` default can actually fire when it isn't passed.\nconst props = withDefaults(defineProps<Props>(), {\n currencySymbol: \"£\",\n showLegend: undefined,\n});\n\n// The container is the `data-bs-theme` scope the palette resolves against, so a\n// chart inside a dark card on a light page themes from the card. Reading the ref\n// inside the computeds also re-themes on mount, when the first (pre-ref) render\n// had to fall back to the document root (#161). DXDoughnutChart doesn't share\n// `useThemedChart` (its data shape differs), so the wiring is repeated here.\nconst host = ref<HTMLElement | null>(null);\n\n// Bumped by a MutationObserver on every `data-bs-theme` change; read below so\n// the CSS-variable palette — invisible to Vue's reactivity — is re-resolved\n// when the colour mode flips under a mounted chart.\nconst colorModeVersion = useColorModeVersion();\n\nconst resolvedDatasets = computed(() =>\n props.datasets ?? [{ data: props.data ?? [] }],\n);\n\nconst chartData = computed(() => {\n void colorModeVersion.value;\n return {\n labels: props.labels,\n datasets: applyPalette(\n resolvedDatasets.value,\n \"doughnut\",\n props.labels.length,\n host.value,\n ),\n };\n});\n\nconst mergedOptions = computed(() => {\n void colorModeVersion.value;\n return mergeOptions(\n baseOptions({\n valueFormat: props.valueFormat,\n currencySymbol: props.currencySymbol,\n locale: props.locale,\n showLegend: props.showLegend ?? true,\n hasValueAxis: false,\n scope: host.value,\n }),\n props.options ?? {},\n );\n});\n</script>\n"],"names":["isPlainObject","value","mergeOptions","base","override","result","key","registered","registerCharts","Chart","registerables","PALETTE_VARS","LINE_PALETTE_VARS","EDGE_VAR","themeScope","scope","getPalette","resolveVars","getLinePalette","getEdgeColor","vars","host","fallback","styles","name","themeColor","colorModeVersion","ref","colorModeObserver","colorModeWatchers","useColorModeVersion","getCurrentScope","onScopeDispose","withAlpha","color","alpha","hex","r","g","b","rgbMatch","n","formatValue","format","currencySymbol","locale","num","baseOptions","args","valueFormat","showLegend","hasValueAxis","gridColor","tickColor","options","ctx","raw","_a","formatted","label","_b","applyPalette","datasets","kind","labelsCount","palette","linePalette","edge","single","dataset","index","next","lineColor","_","i","useThemedChart","type","props","chartData","computed","mergedOptions","__props","_createElementBlock","_createVNode","_unref","Bar","Line","resolvedDatasets","Doughnut"],"mappings":";;;AAWA,MAAMA,IAAgB,CAACC,MACnB,CAAC,CAACA,KAAS,OAAOA,KAAU,YAAY,CAAC,MAAM,QAAQA,CAAK;AAGzD,SAASC,EACZC,GACAC,GACmB;AACnB,QAAMC,IAA8B,EAAE,GAAGF,EAAA;AACzC,aAAW,CAACG,GAAKL,CAAK,KAAK,OAAO,QAAQG,CAAQ;AAC9C,IAAIJ,EAAcC,CAAK,KAAKD,EAAcK,EAAOC,CAAG,CAAC,IACjDD,EAAOC,CAAG,IAAIJ,EAAaG,EAAOC,CAAG,GAAGL,CAAK,IAE7CI,EAAOC,CAAG,IAAIL;AAGtB,SAAOI;AACX;AAEA,IAAIE,IAAa;AAOV,SAASC,IAAuB;AACnC,EAAID,MACJE,EAAM,SAAS,GAAGC,CAAa,GAC/BH,IAAa;AACjB;AASO,MAAMI,IAAwC;AAAA,EACjD,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAAA,EAC1B,CAAC,gBAAgB,SAAS;AAAA;AAC9B,GAKaC,IAA6C;AAAA,EACtD,CAAC,qBAAqB,SAAS;AAAA,EAC/B,CAAC,qBAAqB,SAAS;AAAA,EAC/B,CAAC,qBAAqB,S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