drizzle-cube 0.2.13 → 0.2.15

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 (158) hide show
  1. package/dist/adapters/compiler-A-Mz5Rzh.cjs +22 -0
  2. package/dist/adapters/{compiler-DrkCCzf0.js → compiler-CQq2_dSQ.js} +1677 -1540
  3. package/dist/adapters/express/index.cjs +1 -1
  4. package/dist/adapters/express/index.js +1 -1
  5. package/dist/adapters/fastify/index.cjs +1 -1
  6. package/dist/adapters/fastify/index.js +1 -1
  7. package/dist/adapters/hono/index.cjs +1 -1
  8. package/dist/adapters/hono/index.js +1 -1
  9. package/dist/adapters/nextjs/index.cjs +1 -1
  10. package/dist/adapters/nextjs/index.js +1 -1
  11. package/dist/client/charts.js +27 -36
  12. package/dist/client/charts.js.map +1 -1
  13. package/dist/client/chunks/charts-B8YMw1mi.js +7227 -0
  14. package/dist/client/chunks/charts-B8YMw1mi.js.map +1 -0
  15. package/dist/client/chunks/charts-amt7VOyw.js +277 -0
  16. package/dist/client/chunks/{charts-CHzWeaY1.js.map → charts-amt7VOyw.js.map} +1 -1
  17. package/dist/client/chunks/components-K3xrnHN-.js +13698 -0
  18. package/dist/client/chunks/components-K3xrnHN-.js.map +1 -0
  19. package/dist/client/chunks/core-Dkym7d1O.js +6 -0
  20. package/dist/client/chunks/core-Dkym7d1O.js.map +1 -0
  21. package/dist/client/chunks/{index-DlsvcKXf.js → index-B7NSVb33.js} +2 -2
  22. package/dist/client/chunks/{index-DlsvcKXf.js.map → index-B7NSVb33.js.map} +1 -1
  23. package/dist/client/chunks/javascript-DII1YQGr.js +659 -0
  24. package/dist/client/chunks/javascript-DII1YQGr.js.map +1 -0
  25. package/dist/client/components/AnalysisBuilder/AnalysisFilterItem.d.ts +1 -3
  26. package/dist/client/components/AnalysisBuilder/FilterConfigModal.d.ts +16 -0
  27. package/dist/client/components/AnalyticsPortlet.d.ts +2 -1
  28. package/dist/client/components/DashboardFilters/FilterEditModal.d.ts +1 -1
  29. package/dist/client/components/DashboardFilters/ReadOnlyFilterList.d.ts +1 -1
  30. package/dist/client/components/DashboardPortletCard.d.ts +3 -3
  31. package/dist/client/components/QueryBuilderShim.d.ts +3 -0
  32. package/dist/client/components/charts/ActivityGridChart.d.ts +3 -1
  33. package/dist/client/components/charts/AreaChart.d.ts +3 -1
  34. package/dist/client/components/charts/BarChart.d.ts +3 -1
  35. package/dist/client/components/charts/BubbleChart.d.ts +3 -1
  36. package/dist/client/components/charts/DataTable.d.ts +3 -1
  37. package/dist/client/components/charts/KpiDelta.d.ts +3 -1
  38. package/dist/client/components/charts/KpiNumber.d.ts +3 -1
  39. package/dist/client/components/charts/KpiText.d.ts +3 -1
  40. package/dist/client/components/charts/LineChart.d.ts +3 -1
  41. package/dist/client/components/charts/MarkdownChart.d.ts +3 -1
  42. package/dist/client/components/charts/PieChart.d.ts +3 -1
  43. package/dist/client/components/charts/RadarChart.d.ts +3 -1
  44. package/dist/client/components/charts/RadialBarChart.d.ts +3 -1
  45. package/dist/client/components/charts/ScatterChart.d.ts +3 -1
  46. package/dist/client/components/charts/TreeMapChart.d.ts +3 -1
  47. package/dist/client/components/{QueryBuilder → shared}/CubeMetaExplorer.d.ts +1 -1
  48. package/dist/client/components/{QueryBuilder → shared}/DateRangeFilter.d.ts +1 -1
  49. package/dist/client/components/{QueryBuilder → shared}/FilterBuilder.d.ts +1 -1
  50. package/dist/client/components/{QueryBuilder → shared}/FilterGroup.d.ts +1 -1
  51. package/dist/client/components/{QueryBuilder → shared}/FilterItem.d.ts +1 -1
  52. package/dist/client/components/{QueryBuilder → shared}/FilterValueSelector.d.ts +1 -1
  53. package/dist/client/components/{QueryBuilder → shared}/utils.d.ts +1 -1
  54. package/dist/client/components.d.ts +1 -1
  55. package/dist/client/components.js +2 -2
  56. package/dist/client/hooks/useCubeFieldLabel.d.ts +16 -0
  57. package/dist/client/hooks/useScrollDetection.d.ts +27 -0
  58. package/dist/client/hooks/useTheme.d.ts +11 -0
  59. package/dist/client/hooks.js +8 -8
  60. package/dist/client/icons.js +5 -5
  61. package/dist/client/index.d.ts +8 -3
  62. package/dist/client/index.js +50 -45
  63. package/dist/client/index.js.map +1 -1
  64. package/dist/client/providers/CubeApiProvider.d.ts +22 -0
  65. package/dist/client/providers/CubeFeaturesProvider.d.ts +15 -0
  66. package/dist/client/providers/CubeMetaProvider.d.ts +17 -0
  67. package/dist/client/providers/CubeProvider.d.ts +28 -8
  68. package/dist/client/providers.js +3 -3
  69. package/dist/client/shared/components/CodeBlock.d.ts +10 -0
  70. package/dist/client/shared/index.d.ts +1 -0
  71. package/dist/client/styles.css +1 -1
  72. package/dist/client/utils/chartUtils.d.ts +2 -2
  73. package/dist/client/utils/filterUtils.d.ts +15 -0
  74. package/dist/client/utils/index.d.ts +1 -0
  75. package/dist/client/{components/QueryBuilder → utils}/shareUtils.d.ts +1 -1
  76. package/dist/client/utils/syntaxHighlighting.d.ts +31 -0
  77. package/dist/client-bundle-stats.html +1 -1
  78. package/dist/server/index.cjs +16 -16
  79. package/dist/server/index.d.ts +50 -0
  80. package/dist/server/index.js +857 -729
  81. package/package.json +5 -1
  82. package/dist/adapters/compiler-CMwSRhTS.cjs +0 -22
  83. package/dist/client/chunks/chart-activitygridchart-CUGN9Xq9.js +0 -2622
  84. package/dist/client/chunks/chart-activitygridchart-CUGN9Xq9.js.map +0 -1
  85. package/dist/client/chunks/chart-activitygridchart-config-AVBoHdRn.js +0 -244
  86. package/dist/client/chunks/chart-activitygridchart-config-AVBoHdRn.js.map +0 -1
  87. package/dist/client/chunks/chart-areachart-B4tknnsY.js +0 -239
  88. package/dist/client/chunks/chart-areachart-B4tknnsY.js.map +0 -1
  89. package/dist/client/chunks/chart-areachart-config-D9pPUKHZ.js +0 -78
  90. package/dist/client/chunks/chart-areachart-config-D9pPUKHZ.js.map +0 -1
  91. package/dist/client/chunks/chart-axisformatcontrols-Ch_IYF94.js +0 -196
  92. package/dist/client/chunks/chart-axisformatcontrols-Ch_IYF94.js.map +0 -1
  93. package/dist/client/chunks/chart-barchart-D_op06r-.js +0 -216
  94. package/dist/client/chunks/chart-barchart-D_op06r-.js.map +0 -1
  95. package/dist/client/chunks/chart-barchart-config-iniz62ni.js +0 -71
  96. package/dist/client/chunks/chart-barchart-config-iniz62ni.js.map +0 -1
  97. package/dist/client/chunks/chart-bubblechart-BsaIXUbS.js +0 -214
  98. package/dist/client/chunks/chart-bubblechart-BsaIXUbS.js.map +0 -1
  99. package/dist/client/chunks/chart-bubblechart-config-yLq2oyR3.js +0 -72
  100. package/dist/client/chunks/chart-bubblechart-config-yLq2oyR3.js.map +0 -1
  101. package/dist/client/chunks/chart-chartcontainer-CdwzIKP1.js +0 -103
  102. package/dist/client/chunks/chart-chartcontainer-CdwzIKP1.js.map +0 -1
  103. package/dist/client/chunks/chart-charttooltip-Bx3I8jQv.js +0 -26
  104. package/dist/client/chunks/chart-charttooltip-Bx3I8jQv.js.map +0 -1
  105. package/dist/client/chunks/chart-datatable-C7MS9q4Y.js +0 -283
  106. package/dist/client/chunks/chart-datatable-C7MS9q4Y.js.map +0 -1
  107. package/dist/client/chunks/chart-datatable-config-DmEA3A-7.js +0 -29
  108. package/dist/client/chunks/chart-datatable-config-DmEA3A-7.js.map +0 -1
  109. package/dist/client/chunks/chart-kpidelta-7-KOmb3w.js +0 -436
  110. package/dist/client/chunks/chart-kpidelta-7-KOmb3w.js.map +0 -1
  111. package/dist/client/chunks/chart-kpidelta-config-DtSDG4Kl.js +0 -98
  112. package/dist/client/chunks/chart-kpidelta-config-DtSDG4Kl.js.map +0 -1
  113. package/dist/client/chunks/chart-kpinumber-HOPfcK2N.js +0 -398
  114. package/dist/client/chunks/chart-kpinumber-HOPfcK2N.js.map +0 -1
  115. package/dist/client/chunks/chart-kpinumber-config-Da2LFeKM.js +0 -76
  116. package/dist/client/chunks/chart-kpinumber-config-Da2LFeKM.js.map +0 -1
  117. package/dist/client/chunks/chart-kpitext-BZkC9u3A.js +0 -165
  118. package/dist/client/chunks/chart-kpitext-BZkC9u3A.js.map +0 -1
  119. package/dist/client/chunks/chart-kpitext-config-DjvigyfE.js +0 -48
  120. package/dist/client/chunks/chart-kpitext-config-DjvigyfE.js.map +0 -1
  121. package/dist/client/chunks/chart-linechart-DqFmLbRe.js +0 -198
  122. package/dist/client/chunks/chart-linechart-DqFmLbRe.js.map +0 -1
  123. package/dist/client/chunks/chart-linechart-config-DLVS2Zxc.js +0 -66
  124. package/dist/client/chunks/chart-linechart-config-DLVS2Zxc.js.map +0 -1
  125. package/dist/client/chunks/chart-markdownchart-9n_TemoB.js +0 -256
  126. package/dist/client/chunks/chart-markdownchart-9n_TemoB.js.map +0 -1
  127. package/dist/client/chunks/chart-markdownchart-config-CgOA3YSw.js +0 -61
  128. package/dist/client/chunks/chart-markdownchart-config-CgOA3YSw.js.map +0 -1
  129. package/dist/client/chunks/chart-piechart-CrXFd9pE.js +0 -127
  130. package/dist/client/chunks/chart-piechart-CrXFd9pE.js.map +0 -1
  131. package/dist/client/chunks/chart-piechart-config-DgwOeKHr.js +0 -39
  132. package/dist/client/chunks/chart-piechart-config-DgwOeKHr.js.map +0 -1
  133. package/dist/client/chunks/chart-radarchart-config-BAV8D5PR.js +0 -45
  134. package/dist/client/chunks/chart-radarchart-config-BAV8D5PR.js.map +0 -1
  135. package/dist/client/chunks/chart-radarchart-tar2GBkO.js +0 -131
  136. package/dist/client/chunks/chart-radarchart-tar2GBkO.js.map +0 -1
  137. package/dist/client/chunks/chart-radialbarchart-ab8Swtal.js +0 -120
  138. package/dist/client/chunks/chart-radialbarchart-ab8Swtal.js.map +0 -1
  139. package/dist/client/chunks/chart-radialbarchart-config-CKozBBEC.js +0 -38
  140. package/dist/client/chunks/chart-radialbarchart-config-CKozBBEC.js.map +0 -1
  141. package/dist/client/chunks/chart-scatterchart-BP06BeU5.js +0 -203
  142. package/dist/client/chunks/chart-scatterchart-BP06BeU5.js.map +0 -1
  143. package/dist/client/chunks/chart-scatterchart-config-UdHmbZ3s.js +0 -54
  144. package/dist/client/chunks/chart-scatterchart-config-UdHmbZ3s.js.map +0 -1
  145. package/dist/client/chunks/chart-treemapchart-DAiixITm.js +0 -265
  146. package/dist/client/chunks/chart-treemapchart-DAiixITm.js.map +0 -1
  147. package/dist/client/chunks/chart-treemapchart-config-D17VOwTM.js +0 -47
  148. package/dist/client/chunks/chart-treemapchart-config-D17VOwTM.js.map +0 -1
  149. package/dist/client/chunks/charts-CHzWeaY1.js +0 -286
  150. package/dist/client/chunks/components-DnM9CCUS.js +0 -13931
  151. package/dist/client/chunks/components-DnM9CCUS.js.map +0 -1
  152. package/dist/client/components/QueryBuilder/QueryAnalysisPanel.d.ts +0 -7
  153. package/dist/client/components/QueryBuilder/QueryPanel.d.ts +0 -4
  154. package/dist/client/components/QueryBuilder/ResultsPanel.d.ts +0 -4
  155. package/dist/client/components/QueryBuilder/SetupPanel.d.ts +0 -11
  156. package/dist/client/components/QueryBuilder/ShareWarningModal.d.ts +0 -9
  157. package/dist/client/components/QueryBuilder/index.d.ts +0 -3
  158. /package/dist/client/components/{QueryBuilder → shared}/DateRangeSelector.d.ts +0 -0
@@ -1,2622 +0,0 @@
1
- import { jsx as U, jsxs as yt } from "react/jsx-runtime";
2
- import { useState as Q, useCallback as Tt, useEffect as bt, useContext as ln, createContext as fn, useMemo as ae, useRef as oe, useLayoutEffect as hn } from "react";
3
- class dn {
4
- apiUrl;
5
- headers;
6
- credentials;
7
- constructor(e, n = {}) {
8
- this.apiUrl = n.apiUrl || "/cubejs-api/v1", this.headers = {
9
- "Content-Type": "application/json",
10
- ...n.headers
11
- }, this.credentials = n.credentials ?? "include", e && (this.headers.Authorization = e);
12
- }
13
- async load(e) {
14
- const n = JSON.stringify(e), r = encodeURIComponent(n), i = `${this.apiUrl}/load?query=${r}`, a = await fetch(i, {
15
- method: "GET",
16
- headers: {
17
- // Remove Content-Type for GET request
18
- ...Object.fromEntries(
19
- Object.entries(this.headers).filter(([s]) => s !== "Content-Type")
20
- )
21
- },
22
- credentials: this.credentials
23
- });
24
- if (!a.ok) {
25
- let s = `Cube query failed: ${a.status}`;
26
- try {
27
- const c = await a.text();
28
- try {
29
- const u = JSON.parse(c);
30
- u.error ? s = u.error : s += ` ${c}`;
31
- } catch {
32
- s += ` ${c}`;
33
- }
34
- } catch {
35
- }
36
- throw new Error(s);
37
- }
38
- const o = await a.json();
39
- return new Dt(o);
40
- }
41
- async meta() {
42
- const e = `${this.apiUrl}/meta`, n = await fetch(e, {
43
- method: "GET",
44
- headers: this.headers,
45
- credentials: this.credentials
46
- });
47
- if (!n.ok)
48
- throw new Error(`Failed to fetch meta: ${n.status}`);
49
- return n.json();
50
- }
51
- async sql(e) {
52
- const n = encodeURIComponent(JSON.stringify(e)), r = `${this.apiUrl}/sql?query=${n}`, i = await fetch(r, {
53
- method: "GET",
54
- headers: {
55
- // Remove Content-Type for GET request
56
- ...Object.fromEntries(
57
- Object.entries(this.headers).filter(([a]) => a !== "Content-Type")
58
- )
59
- },
60
- credentials: this.credentials
61
- });
62
- if (!i.ok)
63
- throw new Error(`SQL generation failed: ${i.status}`);
64
- return i.json();
65
- }
66
- async dryRun(e) {
67
- const n = `${this.apiUrl}/dry-run`, r = await fetch(n, {
68
- method: "POST",
69
- headers: this.headers,
70
- credentials: this.credentials,
71
- body: JSON.stringify({ query: e })
72
- });
73
- if (!r.ok) {
74
- let i = `Dry run failed: ${r.status}`;
75
- try {
76
- const a = await r.text();
77
- try {
78
- const o = JSON.parse(a);
79
- o.error ? i = o.error : i += ` ${a}`;
80
- } catch {
81
- i += ` ${a}`;
82
- }
83
- } catch {
84
- }
85
- throw new Error(i);
86
- }
87
- return r.json();
88
- }
89
- /**
90
- * Execute multiple queries in a single batch request
91
- * Used by BatchCoordinator to optimize network requests
92
- */
93
- async batchLoad(e) {
94
- const n = `${this.apiUrl}/batch`, r = await fetch(n, {
95
- method: "POST",
96
- headers: this.headers,
97
- credentials: this.credentials,
98
- body: JSON.stringify({ queries: e })
99
- });
100
- if (!r.ok) {
101
- let a = `Batch query failed: ${r.status}`;
102
- try {
103
- const o = await r.text();
104
- try {
105
- const s = JSON.parse(o);
106
- s.error ? a = s.error : a += ` ${o}`;
107
- } catch {
108
- a += ` ${o}`;
109
- }
110
- } catch {
111
- }
112
- throw new Error(a);
113
- }
114
- return (await r.json()).results.map((a) => !a.success && a.error ? {
115
- ...new Dt({ data: [], annotation: {} }),
116
- error: a.error
117
- } : new Dt(a));
118
- }
119
- }
120
- class Dt {
121
- loadResponse;
122
- constructor(e) {
123
- this.loadResponse = e;
124
- }
125
- rawData() {
126
- return this.loadResponse.results && this.loadResponse.results[0] ? this.loadResponse.results[0].data || [] : this.loadResponse.data || [];
127
- }
128
- tablePivot() {
129
- return this.rawData();
130
- }
131
- series() {
132
- return this.rawData();
133
- }
134
- annotation() {
135
- return this.loadResponse.results && this.loadResponse.results[0] ? this.loadResponse.results[0].annotation || {} : this.loadResponse.annotation || {};
136
- }
137
- }
138
- function mn(t, e = {}) {
139
- return new dn(t, e);
140
- }
141
- const gn = 900 * 1e3;
142
- let j = null;
143
- function yn(t) {
144
- const e = {};
145
- return t.cubes.forEach((n) => {
146
- n.measures.forEach((r) => {
147
- e[r.name] = r.title || r.shortTitle || r.name;
148
- }), n.dimensions.forEach((r) => {
149
- e[r.name] = r.title || r.shortTitle || r.name;
150
- }), n.segments.forEach((r) => {
151
- e[r.name] = r.title || r.shortTitle || r.name;
152
- });
153
- }), e;
154
- }
155
- function pn() {
156
- return j ? Date.now() - j.timestamp < gn : !1;
157
- }
158
- function xn(t) {
159
- const [e, n] = Q(null), [r, i] = Q({}), [a, o] = Q(!0), [s, c] = Q(null), u = Tt(async () => {
160
- if (pn() && j) {
161
- n(j.data), i(j.labelMap), o(!1), c(null);
162
- return;
163
- }
164
- try {
165
- o(!0), c(null);
166
- const l = await t.meta(), h = yn(l);
167
- j = {
168
- data: l,
169
- labelMap: h,
170
- timestamp: Date.now()
171
- }, n(l), i(h);
172
- } catch (l) {
173
- const h = l instanceof Error ? l.message : "Failed to fetch metadata";
174
- c(h), console.error("Failed to fetch cube metadata:", l);
175
- } finally {
176
- o(!1);
177
- }
178
- }, [t]);
179
- bt(() => {
180
- u();
181
- }, [u]);
182
- const f = Tt((l) => r[l] || l, [r]), d = Tt(() => {
183
- j = null, u();
184
- }, [u]);
185
- return {
186
- meta: e,
187
- labelMap: r,
188
- loading: a,
189
- error: s,
190
- refetch: d,
191
- getFieldLabel: f
192
- };
193
- }
194
- class wn {
195
- queue = [];
196
- flushScheduled = !1;
197
- batchExecutor;
198
- delayMs;
199
- constructor(e, n = 100) {
200
- this.batchExecutor = e, this.delayMs = n;
201
- }
202
- /**
203
- * Register a query to be batched. Returns a promise that resolves
204
- * when the batch is executed and this specific query's result is available.
205
- */
206
- register(e) {
207
- return new Promise((n, r) => {
208
- this.queue.push({ query: e, resolve: n, reject: r }), this.flushScheduled || this.scheduleFlush();
209
- });
210
- }
211
- /**
212
- * Schedule a flush after a short delay to collect multiple queries.
213
- * The delay allows queries from lazy-loaded portlets that become visible
214
- * during the same scroll action to be batched together.
215
- */
216
- scheduleFlush() {
217
- this.flushScheduled = !0, setTimeout(() => {
218
- this.flush();
219
- }, this.delayMs);
220
- }
221
- /**
222
- * Execute all queued queries as a batch and resolve individual promises
223
- */
224
- async flush() {
225
- this.flushScheduled = !1;
226
- const e = this.queue.slice();
227
- if (this.queue = [], e.length !== 0)
228
- try {
229
- const n = e.map((i) => i.query), r = await this.batchExecutor(n);
230
- e.forEach((i, a) => {
231
- const o = r[a];
232
- o && "error" in o && o.error ? i.reject(new Error(o.error)) : i.resolve(o);
233
- });
234
- } catch (n) {
235
- e.forEach((r) => {
236
- r.reject(n instanceof Error ? n : new Error(String(n)));
237
- });
238
- }
239
- }
240
- /**
241
- * Get current queue size (useful for debugging)
242
- */
243
- getQueueSize() {
244
- return this.queue.length;
245
- }
246
- /**
247
- * Clear the queue (useful for testing/cleanup)
248
- */
249
- clear() {
250
- this.queue = [], this.flushScheduled = !1;
251
- }
252
- }
253
- const Ce = fn(null);
254
- function ka({
255
- cubeApi: t,
256
- apiOptions: e,
257
- token: n,
258
- options: r = {},
259
- features: i = { enableAI: !0, aiEndpoint: "/api/ai/generate", showSchemaDiagram: !1, useAnalysisBuilder: !1 },
260
- // Default to AI enabled, schema diagram disabled, old portlet edit modal
261
- dashboardModes: a = ["rows", "grid"],
262
- enableBatching: o = !0,
263
- // Default to batching enabled
264
- batchDelayMs: s = 100,
265
- // Default 100ms batch window
266
- children: c
267
- }) {
268
- const [u, f] = Q(null), d = u || {
269
- apiOptions: e || { apiUrl: "/cubejs-api/v1" },
270
- token: n
271
- }, l = ae(() => t && !e && !n ? t : mn(d.token, d.apiOptions), [t, e, n, d.apiOptions, d.token]), h = ae(() => {
272
- if (!o)
273
- return null;
274
- const F = (E) => l.batchLoad(E);
275
- return new wn(F, s);
276
- }, [o, l, s]), { meta: b, labelMap: A, loading: S, error: R, getFieldLabel: v, refetch: k } = xn(l), M = {
277
- cubeApi: l,
278
- options: r,
279
- meta: b,
280
- labelMap: A,
281
- metaLoading: S,
282
- metaError: R,
283
- getFieldLabel: v,
284
- refetchMeta: k,
285
- updateApiConfig: (F, E) => {
286
- f({
287
- apiOptions: F,
288
- token: E
289
- });
290
- },
291
- features: i,
292
- batchCoordinator: h,
293
- enableBatching: o,
294
- dashboardModes: a
295
- };
296
- return /* @__PURE__ */ U(Ce.Provider, { value: M, children: c });
297
- }
298
- function bn() {
299
- const t = ln(Ce);
300
- if (!t)
301
- throw new Error("useCubeContext must be used within a CubeProvider");
302
- return t;
303
- }
304
- function $a(t) {
305
- return t != null && !isNaN(Number(t));
306
- }
307
- function It(t) {
308
- if (t == null) return null;
309
- const e = typeof t == "string" ? parseFloat(t) : Number(t);
310
- return isNaN(e) ? null : e;
311
- }
312
- function vn(t) {
313
- if (t == null) return "No data";
314
- const e = typeof t == "number" ? t : parseFloat(t);
315
- return isNaN(e) ? String(t) : Number.isInteger(e) ? e.toLocaleString() : parseFloat(e.toFixed(2)).toLocaleString();
316
- }
317
- function Aa(t, e, n) {
318
- if (t == null)
319
- return "No data";
320
- const r = typeof t == "number" ? t : parseFloat(String(t));
321
- if (isNaN(r))
322
- return String(t);
323
- if (!isFinite(r))
324
- return r > 0 ? "∞" : "-∞";
325
- const i = typeof navigator < "u" ? navigator.language : "en-US";
326
- if (!e)
327
- return vn(t);
328
- const { unit: a, abbreviate: o = !0, decimals: s, customPrefix: c, customSuffix: u } = e;
329
- let f = r, d = "";
330
- if (o) {
331
- const h = Math.abs(r);
332
- h >= 1e9 ? (f = r / 1e9, d = "B") : h >= 1e6 ? (f = r / 1e6, d = "M") : h >= 1e3 && (f = r / 1e3, d = "K");
333
- }
334
- const l = s !== void 0 ? s : Number.isInteger(f) ? 0 : 2;
335
- switch (a) {
336
- case "currency": {
337
- const h = Mn(i);
338
- if (o && d) {
339
- const b = new Intl.NumberFormat(i, {
340
- style: "currency",
341
- currency: h,
342
- minimumFractionDigits: l,
343
- maximumFractionDigits: l
344
- }).format(f), A = new Intl.NumberFormat(i, {
345
- style: "currency",
346
- currency: h
347
- }).formatToParts(f);
348
- return A[A.length - 1]?.type === "currency" ? b.replace(/(\s*[^\d\s]+)$/, d + "$1") : b + d;
349
- }
350
- return new Intl.NumberFormat(i, {
351
- style: "currency",
352
- currency: h,
353
- minimumFractionDigits: l,
354
- maximumFractionDigits: l
355
- }).format(f);
356
- }
357
- case "percent": {
358
- const h = Math.abs(f) <= 1 && !o ? f * 100 : f;
359
- return new Intl.NumberFormat(i, {
360
- minimumFractionDigits: l,
361
- maximumFractionDigits: l
362
- }).format(h) + d + "%";
363
- }
364
- case "custom": {
365
- const h = c || "", b = u || "", A = new Intl.NumberFormat(i, {
366
- minimumFractionDigits: l,
367
- maximumFractionDigits: l
368
- }).format(f);
369
- return h + A + d + b;
370
- }
371
- default:
372
- return new Intl.NumberFormat(i, {
373
- minimumFractionDigits: l,
374
- maximumFractionDigits: l
375
- }).format(f) + d;
376
- }
377
- }
378
- function Mn(t) {
379
- const n = t.split("-")[1]?.toUpperCase();
380
- return {
381
- US: "USD",
382
- CA: "CAD",
383
- GB: "GBP",
384
- UK: "GBP",
385
- AU: "AUD",
386
- NZ: "NZD",
387
- EU: "EUR",
388
- DE: "EUR",
389
- FR: "EUR",
390
- IT: "EUR",
391
- ES: "EUR",
392
- NL: "EUR",
393
- BE: "EUR",
394
- AT: "EUR",
395
- IE: "EUR",
396
- PT: "EUR",
397
- FI: "EUR",
398
- JP: "JPY",
399
- CN: "CNY",
400
- KR: "KRW",
401
- IN: "INR",
402
- BR: "BRL",
403
- MX: "MXN",
404
- CH: "CHF",
405
- SE: "SEK",
406
- NO: "NOK",
407
- DK: "DKK",
408
- PL: "PLN",
409
- RU: "RUB",
410
- ZA: "ZAR",
411
- SG: "SGD",
412
- HK: "HKD",
413
- TW: "TWD",
414
- TH: "THB",
415
- MY: "MYR",
416
- PH: "PHP",
417
- ID: "IDR",
418
- VN: "VND",
419
- AE: "AED",
420
- SA: "SAR",
421
- IL: "ILS",
422
- TR: "TRY"
423
- }[n] || "USD";
424
- }
425
- function qt(t, e) {
426
- return e[t] || t;
427
- }
428
- function Xt(t, e) {
429
- if (!t) return String(t || "Unknown");
430
- const n = String(t);
431
- if (n.match(/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}/)) {
432
- let r = n;
433
- n.includes(" ") && (r = n.replace(" ", "T").replace("+00", "Z").replace(/\+\d{2}:\d{2}$/, "Z")), !r.endsWith("Z") && !r.includes("+") && (r = r + "Z");
434
- const i = new Date(r);
435
- if (isNaN(i.getTime()))
436
- return n;
437
- const a = i.getUTCFullYear(), o = String(i.getUTCMonth() + 1).padStart(2, "0"), s = String(i.getUTCDate()).padStart(2, "0"), c = i.getUTCHours(), u = i.getUTCMinutes();
438
- if (e)
439
- switch (e.toLowerCase()) {
440
- case "year":
441
- return `${a}`;
442
- case "quarter": {
443
- const l = Math.floor(i.getUTCMonth() / 3) + 1;
444
- return `${a}-Q${l}`;
445
- }
446
- case "month":
447
- return `${a}-${o}`;
448
- case "week":
449
- return `${a}-${o}-${s}`;
450
- case "day":
451
- return `${a}-${o}-${s}`;
452
- case "hour":
453
- return `${a}-${o}-${s} ${String(c).padStart(2, "0")}:00`;
454
- case "minute":
455
- return `${a}-${o}-${s} ${String(c).padStart(2, "0")}:${String(u).padStart(2, "0")}`;
456
- }
457
- const f = i.getUTCSeconds(), d = i.getUTCMilliseconds();
458
- if (s === "01" && c === 0 && u === 0 && f === 0 && d === 0) {
459
- if (o === "01" || o === "04" || o === "07" || o === "10") {
460
- const l = Math.floor(i.getUTCMonth() / 3) + 1;
461
- return `${a}-Q${l}`;
462
- }
463
- return `${a}-${o}`;
464
- }
465
- return c === 0 && u === 0 && f === 0 && d === 0 ? `${a}-${o}-${s}` : u === 0 && f === 0 && d === 0 ? `${a}-${o}-${s} ${String(c).padStart(2, "0")}:00` : `${a}-${o}-${s} ${String(c).padStart(2, "0")}:${String(u).padStart(2, "0")}`;
466
- }
467
- return n;
468
- }
469
- function Fe(t, e) {
470
- try {
471
- if (t?.timeDimensions) {
472
- const r = t.timeDimensions.find((i) => e === i.dimension || e.startsWith(i.dimension.replace(".", "_")) || e === `${i.dimension}_${i.granularity}`);
473
- if (r?.granularity)
474
- return r.granularity;
475
- }
476
- const n = e.match(/_([a-z]+)$/);
477
- if (n) {
478
- const r = n[1];
479
- if (["year", "quarter", "month", "week", "day", "hour", "minute", "second"].includes(r))
480
- return r;
481
- }
482
- return;
483
- } catch {
484
- return;
485
- }
486
- }
487
- function _n(t, e, n, r, i = {}) {
488
- if (!t || t.length === 0) return [];
489
- const a = Fe(r, e);
490
- return t.map((o) => {
491
- const s = {
492
- name: Xt(o[e], a) || o[e] || "Unknown"
493
- };
494
- return n.forEach((c) => {
495
- const u = qt(c, i);
496
- s[u] = It(o[c]);
497
- }), s;
498
- });
499
- }
500
- function Ea(t, e, n, r, i, a = {}) {
501
- if (!t || t.length === 0)
502
- return { data: [], seriesKeys: [], hasDimensions: !1 };
503
- const o = r || {}, s = [
504
- ...o.dimensions || [],
505
- ...o.timeDimensions?.map((h) => h.dimension) || []
506
- ], c = o.measures || [], u = n.filter((h) => c.includes(h)), f = (i || []).filter((h) => s.includes(h));
507
- if (f.length > 0) {
508
- const h = {};
509
- t.forEach((S) => {
510
- const R = Fe(r, e), v = Xt(S[e], R) || S[e] || "Unknown";
511
- h[v] || (h[v] = { name: String(v) }), u.forEach((k) => {
512
- const C = qt(k, a), M = It(S[k]);
513
- if (M !== null) {
514
- const F = h[v][C];
515
- h[v][C] = F == null ? M : F + M;
516
- } else C in h[v] || (h[v][C] = null);
517
- }), f.forEach((k) => {
518
- const C = S[k];
519
- if (C != null) {
520
- const M = String(C), F = u[0] || c.find(
521
- (E) => E.includes("totalCost") || E.includes("count") || E.includes("sum")
522
- ) || c[0];
523
- if (F) {
524
- const E = It(S[F]);
525
- if (E !== null) {
526
- const x = h[v][M];
527
- h[v][M] = x == null ? E : x + E;
528
- } else M in h[v] || (h[v][M] = null);
529
- }
530
- }
531
- });
532
- });
533
- const b = Object.values(h), A = Array.from(new Set(
534
- t.flatMap(
535
- (S) => f.map((R) => {
536
- const v = S[R];
537
- return v != null ? String(v) : null;
538
- }).filter((R) => R !== null)
539
- )
540
- ));
541
- return {
542
- data: b,
543
- seriesKeys: A,
544
- hasDimensions: !0
545
- };
546
- }
547
- const d = _n(t, e, n, r, a), l = n.map((h) => qt(h, a));
548
- return {
549
- data: d,
550
- seriesKeys: l,
551
- hasDimensions: !1
552
- };
553
- }
554
- const Ca = [
555
- "#3b82f6",
556
- // blue
557
- "#10b981",
558
- // green
559
- "#f59e0b",
560
- // yellow
561
- "#ef4444",
562
- // red
563
- "#8b5cf6",
564
- // purple
565
- "#f97316",
566
- // orange
567
- "#06b6d4",
568
- // cyan
569
- "#84cc16"
570
- // lime
571
- ], Nn = [
572
- "#440154",
573
- // dark purple
574
- "#414487",
575
- // purple-blue
576
- "#2a788e",
577
- // teal
578
- "#22a884",
579
- // green-teal
580
- "#7ad151",
581
- // green
582
- "#fde725"
583
- // yellow
584
- ], Fa = "#10b981", Ra = "#ef4444", Ta = {
585
- top: 5,
586
- right: 30,
587
- left: 20,
588
- bottom: 5
589
- };
590
- function Da(t) {
591
- return typeof window > "u" ? "" : getComputedStyle(document.documentElement).getPropertyValue(`--dc-${t}`).trim();
592
- }
593
- function Sn(t, e) {
594
- typeof window > "u" || document.documentElement.style.setProperty(`--dc-${t}`, e);
595
- }
596
- function La(t) {
597
- typeof window > "u" || Object.entries(t.colors).forEach(([e, n]) => {
598
- if (n) {
599
- const r = e.replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
600
- Sn(r, n);
601
- }
602
- });
603
- }
604
- function Ha() {
605
- if (typeof window > "u") return;
606
- const t = document.documentElement.style;
607
- Array.from(t).forEach((n) => {
608
- n.startsWith("--dc-") && t.removeProperty(n);
609
- });
610
- }
611
- function Mt() {
612
- if (typeof window > "u") return "light";
613
- const t = localStorage.getItem("theme");
614
- if (t === "dark" || t === "neon" || t === "light")
615
- return t;
616
- const e = document.documentElement.getAttribute("data-theme");
617
- return e === "dark" || e === "neon" ? e : document.documentElement.classList.contains("dark") || document.body.classList.contains("dark") ? "dark" : document.documentElement.classList.contains("neon") || document.body.classList.contains("neon") ? "neon" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
618
- }
619
- function Pa(t) {
620
- typeof window > "u" || (document.documentElement.classList.remove("dark", "neon"), document.documentElement.setAttribute("data-theme", t), (t === "dark" || t === "neon") && document.documentElement.classList.add(t), localStorage.setItem("theme", t));
621
- }
622
- function Ua() {
623
- const t = Mt();
624
- return t === "dark" || t === "neon";
625
- }
626
- function kn(t) {
627
- if (typeof window > "u") return () => {
628
- };
629
- const e = new MutationObserver(() => {
630
- t(Mt());
631
- });
632
- e.observe(document.documentElement, {
633
- attributes: !0,
634
- attributeFilter: ["class", "data-theme"]
635
- });
636
- const n = window.matchMedia("(prefers-color-scheme: dark)"), r = () => t(Mt());
637
- return n.addEventListener("change", r), () => {
638
- e.disconnect(), n.removeEventListener("change", r);
639
- };
640
- }
641
- const Ia = {
642
- light: {
643
- name: "light",
644
- colors: {
645
- surface: "#ffffff",
646
- surfaceSecondary: "#f9fafb",
647
- text: "#111827",
648
- textSecondary: "#374151",
649
- textMuted: "#6b7280",
650
- border: "#e5e7eb",
651
- primary: "#3b82f6",
652
- primaryHover: "#2563eb"
653
- }
654
- },
655
- dark: {
656
- name: "dark",
657
- colors: {
658
- surface: "#1e293b",
659
- surfaceSecondary: "#334155",
660
- text: "#f1f5f9",
661
- textSecondary: "#e2e8f0",
662
- textMuted: "#cbd5e1",
663
- border: "#475569",
664
- primary: "#60a5fa",
665
- primaryHover: "#3b82f6"
666
- }
667
- },
668
- neon: {
669
- name: "neon",
670
- colors: {
671
- surface: "#0a0118",
672
- surfaceSecondary: "#1a0f2e",
673
- surfaceTertiary: "#2a1f3e",
674
- text: "#ffffff",
675
- textSecondary: "#e0e0ff",
676
- textMuted: "#b0b0d0",
677
- border: "#ff00ff",
678
- borderSecondary: "#00ffff",
679
- primary: "#00ffff",
680
- primaryHover: "#00cccc",
681
- primaryContent: "#000000",
682
- success: "#00ff00",
683
- warning: "#ffff00",
684
- error: "#ff0066",
685
- info: "#00ffff",
686
- danger: "#ff1493"
687
- }
688
- }
689
- };
690
- function vt(t, e) {
691
- return t == null || e == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
692
- }
693
- function $n(t, e) {
694
- return t == null || e == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
695
- }
696
- function Re(t) {
697
- let e, n, r;
698
- t.length !== 2 ? (e = vt, n = (s, c) => vt(t(s), c), r = (s, c) => t(s) - c) : (e = t === vt || t === $n ? t : An, n = t, r = t);
699
- function i(s, c, u = 0, f = s.length) {
700
- if (u < f) {
701
- if (e(c, c) !== 0) return f;
702
- do {
703
- const d = u + f >>> 1;
704
- n(s[d], c) < 0 ? u = d + 1 : f = d;
705
- } while (u < f);
706
- }
707
- return u;
708
- }
709
- function a(s, c, u = 0, f = s.length) {
710
- if (u < f) {
711
- if (e(c, c) !== 0) return f;
712
- do {
713
- const d = u + f >>> 1;
714
- n(s[d], c) <= 0 ? u = d + 1 : f = d;
715
- } while (u < f);
716
- }
717
- return u;
718
- }
719
- function o(s, c, u = 0, f = s.length) {
720
- const d = i(s, c, u, f - 1);
721
- return d > u && r(s[d - 1], c) > -r(s[d], c) ? d - 1 : d;
722
- }
723
- return { left: i, center: o, right: a };
724
- }
725
- function An() {
726
- return 0;
727
- }
728
- function En(t) {
729
- return t === null ? NaN : +t;
730
- }
731
- const Cn = Re(vt), Te = Cn.right;
732
- Re(En).center;
733
- function qa(t, e) {
734
- let n, r;
735
- if (e === void 0)
736
- for (const i of t)
737
- i != null && (n === void 0 ? i >= i && (n = r = i) : (n > i && (n = i), r < i && (r = i)));
738
- else {
739
- let i = -1;
740
- for (let a of t)
741
- (a = e(a, ++i, t)) != null && (n === void 0 ? a >= a && (n = r = a) : (n > a && (n = a), r < a && (r = a)));
742
- }
743
- return [n, r];
744
- }
745
- class se extends Map {
746
- constructor(e, n = Tn) {
747
- if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: n } }), e != null) for (const [r, i] of e) this.set(r, i);
748
- }
749
- get(e) {
750
- return super.get(ce(this, e));
751
- }
752
- has(e) {
753
- return super.has(ce(this, e));
754
- }
755
- set(e, n) {
756
- return super.set(Fn(this, e), n);
757
- }
758
- delete(e) {
759
- return super.delete(Rn(this, e));
760
- }
761
- }
762
- function ce({ _intern: t, _key: e }, n) {
763
- const r = e(n);
764
- return t.has(r) ? t.get(r) : n;
765
- }
766
- function Fn({ _intern: t, _key: e }, n) {
767
- const r = e(n);
768
- return t.has(r) ? t.get(r) : (t.set(r, n), n);
769
- }
770
- function Rn({ _intern: t, _key: e }, n) {
771
- const r = e(n);
772
- return t.has(r) && (n = t.get(r), t.delete(r)), n;
773
- }
774
- function Tn(t) {
775
- return t !== null && typeof t == "object" ? t.valueOf() : t;
776
- }
777
- const Dn = Math.sqrt(50), Ln = Math.sqrt(10), Hn = Math.sqrt(2);
778
- function _t(t, e, n) {
779
- const r = (e - t) / Math.max(0, n), i = Math.floor(Math.log10(r)), a = r / Math.pow(10, i), o = a >= Dn ? 10 : a >= Ln ? 5 : a >= Hn ? 2 : 1;
780
- let s, c, u;
781
- return i < 0 ? (u = Math.pow(10, -i) / o, s = Math.round(t * u), c = Math.round(e * u), s / u < t && ++s, c / u > e && --c, u = -u) : (u = Math.pow(10, i) * o, s = Math.round(t / u), c = Math.round(e / u), s * u < t && ++s, c * u > e && --c), c < s && 0.5 <= n && n < 2 ? _t(t, e, n * 2) : [s, c, u];
782
- }
783
- function Pn(t, e, n) {
784
- if (e = +e, t = +t, n = +n, !(n > 0)) return [];
785
- if (t === e) return [t];
786
- const r = e < t, [i, a, o] = r ? _t(e, t, n) : _t(t, e, n);
787
- if (!(a >= i)) return [];
788
- const s = a - i + 1, c = new Array(s);
789
- if (r)
790
- if (o < 0) for (let u = 0; u < s; ++u) c[u] = (a - u) / -o;
791
- else for (let u = 0; u < s; ++u) c[u] = (a - u) * o;
792
- else if (o < 0) for (let u = 0; u < s; ++u) c[u] = (i + u) / -o;
793
- else for (let u = 0; u < s; ++u) c[u] = (i + u) * o;
794
- return c;
795
- }
796
- function Vt(t, e, n) {
797
- return e = +e, t = +t, n = +n, _t(t, e, n)[2];
798
- }
799
- function Un(t, e, n) {
800
- e = +e, t = +t, n = +n;
801
- const r = e < t, i = r ? Vt(e, t, n) : Vt(t, e, n);
802
- return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
803
- }
804
- function ue(t, e) {
805
- let n;
806
- if (e === void 0)
807
- for (const r of t)
808
- r != null && (n < r || n === void 0 && r >= r) && (n = r);
809
- else {
810
- let r = -1;
811
- for (let i of t)
812
- (i = e(i, ++r, t)) != null && (n < i || n === void 0 && i >= i) && (n = i);
813
- }
814
- return n;
815
- }
816
- function le(t, e) {
817
- let n;
818
- if (e === void 0)
819
- for (const r of t)
820
- r != null && (n > r || n === void 0 && r >= r) && (n = r);
821
- else {
822
- let r = -1;
823
- for (let i of t)
824
- (i = e(i, ++r, t)) != null && (n > i || n === void 0 && i >= i) && (n = i);
825
- }
826
- return n;
827
- }
828
- function In(t) {
829
- return t;
830
- }
831
- var Lt = 1, Ht = 2, Ot = 3, ut = 4, fe = 1e-6;
832
- function qn(t) {
833
- return "translate(" + t + ",0)";
834
- }
835
- function Vn(t) {
836
- return "translate(0," + t + ")";
837
- }
838
- function On(t) {
839
- return (e) => +t(e);
840
- }
841
- function zn(t, e) {
842
- return e = Math.max(0, t.bandwidth() - e * 2) / 2, t.round() && (e = Math.round(e)), (n) => +t(n) + e;
843
- }
844
- function Wn() {
845
- return !this.__axis;
846
- }
847
- function De(t, e) {
848
- var n = [], r = null, i = null, a = 6, o = 6, s = 3, c = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, u = t === Lt || t === ut ? -1 : 1, f = t === ut || t === Ht ? "x" : "y", d = t === Lt || t === Ot ? qn : Vn;
849
- function l(h) {
850
- var b = r ?? (e.ticks ? e.ticks.apply(e, n) : e.domain()), A = i ?? (e.tickFormat ? e.tickFormat.apply(e, n) : In), S = Math.max(a, 0) + s, R = e.range(), v = +R[0] + c, k = +R[R.length - 1] + c, C = (e.bandwidth ? zn : On)(e.copy(), c), M = h.selection ? h.selection() : h, F = M.selectAll(".domain").data([null]), E = M.selectAll(".tick").data(b, e).order(), x = E.exit(), m = E.enter().append("g").attr("class", "tick"), _ = E.select("line"), g = E.select("text");
851
- F = F.merge(F.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), E = E.merge(m), _ = _.merge(m.append("line").attr("stroke", "currentColor").attr(f + "2", u * a)), g = g.merge(m.append("text").attr("fill", "currentColor").attr(f, u * S).attr("dy", t === Lt ? "0em" : t === Ot ? "0.71em" : "0.32em")), h !== M && (F = F.transition(h), E = E.transition(h), _ = _.transition(h), g = g.transition(h), x = x.transition(h).attr("opacity", fe).attr("transform", function(w) {
852
- return isFinite(w = C(w)) ? d(w + c) : this.getAttribute("transform");
853
- }), m.attr("opacity", fe).attr("transform", function(w) {
854
- var N = this.parentNode.__axis;
855
- return d((N && isFinite(N = N(w)) ? N : C(w)) + c);
856
- })), x.remove(), F.attr("d", t === ut || t === Ht ? o ? "M" + u * o + "," + v + "H" + c + "V" + k + "H" + u * o : "M" + c + "," + v + "V" + k : o ? "M" + v + "," + u * o + "V" + c + "H" + k + "V" + u * o : "M" + v + "," + c + "H" + k), E.attr("opacity", 1).attr("transform", function(w) {
857
- return d(C(w) + c);
858
- }), _.attr(f + "2", u * a), g.attr(f, u * S).text(A), M.filter(Wn).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === Ht ? "start" : t === ut ? "end" : "middle"), M.each(function() {
859
- this.__axis = C;
860
- });
861
- }
862
- return l.scale = function(h) {
863
- return arguments.length ? (e = h, l) : e;
864
- }, l.ticks = function() {
865
- return n = Array.from(arguments), l;
866
- }, l.tickArguments = function(h) {
867
- return arguments.length ? (n = h == null ? [] : Array.from(h), l) : n.slice();
868
- }, l.tickValues = function(h) {
869
- return arguments.length ? (r = h == null ? null : Array.from(h), l) : r && r.slice();
870
- }, l.tickFormat = function(h) {
871
- return arguments.length ? (i = h, l) : i;
872
- }, l.tickSize = function(h) {
873
- return arguments.length ? (a = o = +h, l) : a;
874
- }, l.tickSizeInner = function(h) {
875
- return arguments.length ? (a = +h, l) : a;
876
- }, l.tickSizeOuter = function(h) {
877
- return arguments.length ? (o = +h, l) : o;
878
- }, l.tickPadding = function(h) {
879
- return arguments.length ? (s = +h, l) : s;
880
- }, l.offset = function(h) {
881
- return arguments.length ? (c = +h, l) : c;
882
- }, l;
883
- }
884
- function Va(t) {
885
- return De(Ot, t);
886
- }
887
- function Oa(t) {
888
- return De(ut, t);
889
- }
890
- var zt = "http://www.w3.org/1999/xhtml";
891
- const he = {
892
- svg: "http://www.w3.org/2000/svg",
893
- xhtml: zt,
894
- xlink: "http://www.w3.org/1999/xlink",
895
- xml: "http://www.w3.org/XML/1998/namespace",
896
- xmlns: "http://www.w3.org/2000/xmlns/"
897
- };
898
- function Le(t) {
899
- var e = t += "", n = e.indexOf(":");
900
- return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), he.hasOwnProperty(e) ? { space: he[e], local: t } : t;
901
- }
902
- function Yn(t) {
903
- return function() {
904
- var e = this.ownerDocument, n = this.namespaceURI;
905
- return n === zt && e.documentElement.namespaceURI === zt ? e.createElement(t) : e.createElementNS(n, t);
906
- };
907
- }
908
- function Bn(t) {
909
- return function() {
910
- return this.ownerDocument.createElementNS(t.space, t.local);
911
- };
912
- }
913
- function He(t) {
914
- var e = Le(t);
915
- return (e.local ? Bn : Yn)(e);
916
- }
917
- function Xn() {
918
- }
919
- function Pe(t) {
920
- return t == null ? Xn : function() {
921
- return this.querySelector(t);
922
- };
923
- }
924
- function Gn(t) {
925
- typeof t != "function" && (t = Pe(t));
926
- for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
927
- for (var a = e[i], o = a.length, s = r[i] = new Array(o), c, u, f = 0; f < o; ++f)
928
- (c = a[f]) && (u = t.call(c, c.__data__, f, a)) && ("__data__" in c && (u.__data__ = c.__data__), s[f] = u);
929
- return new O(r, this._parents);
930
- }
931
- function Qn(t) {
932
- return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
933
- }
934
- function Kn() {
935
- return [];
936
- }
937
- function Jn(t) {
938
- return t == null ? Kn : function() {
939
- return this.querySelectorAll(t);
940
- };
941
- }
942
- function Zn(t) {
943
- return function() {
944
- return Qn(t.apply(this, arguments));
945
- };
946
- }
947
- function jn(t) {
948
- typeof t == "function" ? t = Zn(t) : t = Jn(t);
949
- for (var e = this._groups, n = e.length, r = [], i = [], a = 0; a < n; ++a)
950
- for (var o = e[a], s = o.length, c, u = 0; u < s; ++u)
951
- (c = o[u]) && (r.push(t.call(c, c.__data__, u, o)), i.push(c));
952
- return new O(r, i);
953
- }
954
- function tr(t) {
955
- return function() {
956
- return this.matches(t);
957
- };
958
- }
959
- function Ue(t) {
960
- return function(e) {
961
- return e.matches(t);
962
- };
963
- }
964
- var er = Array.prototype.find;
965
- function nr(t) {
966
- return function() {
967
- return er.call(this.children, t);
968
- };
969
- }
970
- function rr() {
971
- return this.firstElementChild;
972
- }
973
- function ir(t) {
974
- return this.select(t == null ? rr : nr(typeof t == "function" ? t : Ue(t)));
975
- }
976
- var ar = Array.prototype.filter;
977
- function or() {
978
- return Array.from(this.children);
979
- }
980
- function sr(t) {
981
- return function() {
982
- return ar.call(this.children, t);
983
- };
984
- }
985
- function cr(t) {
986
- return this.selectAll(t == null ? or : sr(typeof t == "function" ? t : Ue(t)));
987
- }
988
- function ur(t) {
989
- typeof t != "function" && (t = tr(t));
990
- for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
991
- for (var a = e[i], o = a.length, s = r[i] = [], c, u = 0; u < o; ++u)
992
- (c = a[u]) && t.call(c, c.__data__, u, a) && s.push(c);
993
- return new O(r, this._parents);
994
- }
995
- function Ie(t) {
996
- return new Array(t.length);
997
- }
998
- function lr() {
999
- return new O(this._enter || this._groups.map(Ie), this._parents);
1000
- }
1001
- function Nt(t, e) {
1002
- this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e;
1003
- }
1004
- Nt.prototype = {
1005
- constructor: Nt,
1006
- appendChild: function(t) {
1007
- return this._parent.insertBefore(t, this._next);
1008
- },
1009
- insertBefore: function(t, e) {
1010
- return this._parent.insertBefore(t, e);
1011
- },
1012
- querySelector: function(t) {
1013
- return this._parent.querySelector(t);
1014
- },
1015
- querySelectorAll: function(t) {
1016
- return this._parent.querySelectorAll(t);
1017
- }
1018
- };
1019
- function fr(t) {
1020
- return function() {
1021
- return t;
1022
- };
1023
- }
1024
- function hr(t, e, n, r, i, a) {
1025
- for (var o = 0, s, c = e.length, u = a.length; o < u; ++o)
1026
- (s = e[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new Nt(t, a[o]);
1027
- for (; o < c; ++o)
1028
- (s = e[o]) && (i[o] = s);
1029
- }
1030
- function dr(t, e, n, r, i, a, o) {
1031
- var s, c, u = /* @__PURE__ */ new Map(), f = e.length, d = a.length, l = new Array(f), h;
1032
- for (s = 0; s < f; ++s)
1033
- (c = e[s]) && (l[s] = h = o.call(c, c.__data__, s, e) + "", u.has(h) ? i[s] = c : u.set(h, c));
1034
- for (s = 0; s < d; ++s)
1035
- h = o.call(t, a[s], s, a) + "", (c = u.get(h)) ? (r[s] = c, c.__data__ = a[s], u.delete(h)) : n[s] = new Nt(t, a[s]);
1036
- for (s = 0; s < f; ++s)
1037
- (c = e[s]) && u.get(l[s]) === c && (i[s] = c);
1038
- }
1039
- function mr(t) {
1040
- return t.__data__;
1041
- }
1042
- function gr(t, e) {
1043
- if (!arguments.length) return Array.from(this, mr);
1044
- var n = e ? dr : hr, r = this._parents, i = this._groups;
1045
- typeof t != "function" && (t = fr(t));
1046
- for (var a = i.length, o = new Array(a), s = new Array(a), c = new Array(a), u = 0; u < a; ++u) {
1047
- var f = r[u], d = i[u], l = d.length, h = yr(t.call(f, f && f.__data__, u, r)), b = h.length, A = s[u] = new Array(b), S = o[u] = new Array(b), R = c[u] = new Array(l);
1048
- n(f, d, A, S, R, h, e);
1049
- for (var v = 0, k = 0, C, M; v < b; ++v)
1050
- if (C = A[v]) {
1051
- for (v >= k && (k = v + 1); !(M = S[k]) && ++k < b; ) ;
1052
- C._next = M || null;
1053
- }
1054
- }
1055
- return o = new O(o, r), o._enter = s, o._exit = c, o;
1056
- }
1057
- function yr(t) {
1058
- return typeof t == "object" && "length" in t ? t : Array.from(t);
1059
- }
1060
- function pr() {
1061
- return new O(this._exit || this._groups.map(Ie), this._parents);
1062
- }
1063
- function xr(t, e, n) {
1064
- var r = this.enter(), i = this, a = this.exit();
1065
- return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? a.remove() : n(a), r && i ? r.merge(i).order() : i;
1066
- }
1067
- function wr(t) {
1068
- for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, a = r.length, o = Math.min(i, a), s = new Array(i), c = 0; c < o; ++c)
1069
- for (var u = n[c], f = r[c], d = u.length, l = s[c] = new Array(d), h, b = 0; b < d; ++b)
1070
- (h = u[b] || f[b]) && (l[b] = h);
1071
- for (; c < i; ++c)
1072
- s[c] = n[c];
1073
- return new O(s, this._parents);
1074
- }
1075
- function br() {
1076
- for (var t = this._groups, e = -1, n = t.length; ++e < n; )
1077
- for (var r = t[e], i = r.length - 1, a = r[i], o; --i >= 0; )
1078
- (o = r[i]) && (a && o.compareDocumentPosition(a) ^ 4 && a.parentNode.insertBefore(o, a), a = o);
1079
- return this;
1080
- }
1081
- function vr(t) {
1082
- t || (t = Mr);
1083
- function e(d, l) {
1084
- return d && l ? t(d.__data__, l.__data__) : !d - !l;
1085
- }
1086
- for (var n = this._groups, r = n.length, i = new Array(r), a = 0; a < r; ++a) {
1087
- for (var o = n[a], s = o.length, c = i[a] = new Array(s), u, f = 0; f < s; ++f)
1088
- (u = o[f]) && (c[f] = u);
1089
- c.sort(e);
1090
- }
1091
- return new O(i, this._parents).order();
1092
- }
1093
- function Mr(t, e) {
1094
- return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
1095
- }
1096
- function _r() {
1097
- var t = arguments[0];
1098
- return arguments[0] = this, t.apply(null, arguments), this;
1099
- }
1100
- function Nr() {
1101
- return Array.from(this);
1102
- }
1103
- function Sr() {
1104
- for (var t = this._groups, e = 0, n = t.length; e < n; ++e)
1105
- for (var r = t[e], i = 0, a = r.length; i < a; ++i) {
1106
- var o = r[i];
1107
- if (o) return o;
1108
- }
1109
- return null;
1110
- }
1111
- function kr() {
1112
- let t = 0;
1113
- for (const e of this) ++t;
1114
- return t;
1115
- }
1116
- function $r() {
1117
- return !this.node();
1118
- }
1119
- function Ar(t) {
1120
- for (var e = this._groups, n = 0, r = e.length; n < r; ++n)
1121
- for (var i = e[n], a = 0, o = i.length, s; a < o; ++a)
1122
- (s = i[a]) && t.call(s, s.__data__, a, i);
1123
- return this;
1124
- }
1125
- function Er(t) {
1126
- return function() {
1127
- this.removeAttribute(t);
1128
- };
1129
- }
1130
- function Cr(t) {
1131
- return function() {
1132
- this.removeAttributeNS(t.space, t.local);
1133
- };
1134
- }
1135
- function Fr(t, e) {
1136
- return function() {
1137
- this.setAttribute(t, e);
1138
- };
1139
- }
1140
- function Rr(t, e) {
1141
- return function() {
1142
- this.setAttributeNS(t.space, t.local, e);
1143
- };
1144
- }
1145
- function Tr(t, e) {
1146
- return function() {
1147
- var n = e.apply(this, arguments);
1148
- n == null ? this.removeAttribute(t) : this.setAttribute(t, n);
1149
- };
1150
- }
1151
- function Dr(t, e) {
1152
- return function() {
1153
- var n = e.apply(this, arguments);
1154
- n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n);
1155
- };
1156
- }
1157
- function Lr(t, e) {
1158
- var n = Le(t);
1159
- if (arguments.length < 2) {
1160
- var r = this.node();
1161
- return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n);
1162
- }
1163
- return this.each((e == null ? n.local ? Cr : Er : typeof e == "function" ? n.local ? Dr : Tr : n.local ? Rr : Fr)(n, e));
1164
- }
1165
- function qe(t) {
1166
- return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
1167
- }
1168
- function Hr(t) {
1169
- return function() {
1170
- this.style.removeProperty(t);
1171
- };
1172
- }
1173
- function Pr(t, e, n) {
1174
- return function() {
1175
- this.style.setProperty(t, e, n);
1176
- };
1177
- }
1178
- function Ur(t, e, n) {
1179
- return function() {
1180
- var r = e.apply(this, arguments);
1181
- r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n);
1182
- };
1183
- }
1184
- function Ir(t, e, n) {
1185
- return arguments.length > 1 ? this.each((e == null ? Hr : typeof e == "function" ? Ur : Pr)(t, e, n ?? "")) : qr(this.node(), t);
1186
- }
1187
- function qr(t, e) {
1188
- return t.style.getPropertyValue(e) || qe(t).getComputedStyle(t, null).getPropertyValue(e);
1189
- }
1190
- function Vr(t) {
1191
- return function() {
1192
- delete this[t];
1193
- };
1194
- }
1195
- function Or(t, e) {
1196
- return function() {
1197
- this[t] = e;
1198
- };
1199
- }
1200
- function zr(t, e) {
1201
- return function() {
1202
- var n = e.apply(this, arguments);
1203
- n == null ? delete this[t] : this[t] = n;
1204
- };
1205
- }
1206
- function Wr(t, e) {
1207
- return arguments.length > 1 ? this.each((e == null ? Vr : typeof e == "function" ? zr : Or)(t, e)) : this.node()[t];
1208
- }
1209
- function Ve(t) {
1210
- return t.trim().split(/^|\s+/);
1211
- }
1212
- function Gt(t) {
1213
- return t.classList || new Oe(t);
1214
- }
1215
- function Oe(t) {
1216
- this._node = t, this._names = Ve(t.getAttribute("class") || "");
1217
- }
1218
- Oe.prototype = {
1219
- add: function(t) {
1220
- var e = this._names.indexOf(t);
1221
- e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" ")));
1222
- },
1223
- remove: function(t) {
1224
- var e = this._names.indexOf(t);
1225
- e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" ")));
1226
- },
1227
- contains: function(t) {
1228
- return this._names.indexOf(t) >= 0;
1229
- }
1230
- };
1231
- function ze(t, e) {
1232
- for (var n = Gt(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]);
1233
- }
1234
- function We(t, e) {
1235
- for (var n = Gt(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]);
1236
- }
1237
- function Yr(t) {
1238
- return function() {
1239
- ze(this, t);
1240
- };
1241
- }
1242
- function Br(t) {
1243
- return function() {
1244
- We(this, t);
1245
- };
1246
- }
1247
- function Xr(t, e) {
1248
- return function() {
1249
- (e.apply(this, arguments) ? ze : We)(this, t);
1250
- };
1251
- }
1252
- function Gr(t, e) {
1253
- var n = Ve(t + "");
1254
- if (arguments.length < 2) {
1255
- for (var r = Gt(this.node()), i = -1, a = n.length; ++i < a; ) if (!r.contains(n[i])) return !1;
1256
- return !0;
1257
- }
1258
- return this.each((typeof e == "function" ? Xr : e ? Yr : Br)(n, e));
1259
- }
1260
- function Qr() {
1261
- this.textContent = "";
1262
- }
1263
- function Kr(t) {
1264
- return function() {
1265
- this.textContent = t;
1266
- };
1267
- }
1268
- function Jr(t) {
1269
- return function() {
1270
- var e = t.apply(this, arguments);
1271
- this.textContent = e ?? "";
1272
- };
1273
- }
1274
- function Zr(t) {
1275
- return arguments.length ? this.each(t == null ? Qr : (typeof t == "function" ? Jr : Kr)(t)) : this.node().textContent;
1276
- }
1277
- function jr() {
1278
- this.innerHTML = "";
1279
- }
1280
- function ti(t) {
1281
- return function() {
1282
- this.innerHTML = t;
1283
- };
1284
- }
1285
- function ei(t) {
1286
- return function() {
1287
- var e = t.apply(this, arguments);
1288
- this.innerHTML = e ?? "";
1289
- };
1290
- }
1291
- function ni(t) {
1292
- return arguments.length ? this.each(t == null ? jr : (typeof t == "function" ? ei : ti)(t)) : this.node().innerHTML;
1293
- }
1294
- function ri() {
1295
- this.nextSibling && this.parentNode.appendChild(this);
1296
- }
1297
- function ii() {
1298
- return this.each(ri);
1299
- }
1300
- function ai() {
1301
- this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
1302
- }
1303
- function oi() {
1304
- return this.each(ai);
1305
- }
1306
- function si(t) {
1307
- var e = typeof t == "function" ? t : He(t);
1308
- return this.select(function() {
1309
- return this.appendChild(e.apply(this, arguments));
1310
- });
1311
- }
1312
- function ci() {
1313
- return null;
1314
- }
1315
- function ui(t, e) {
1316
- var n = typeof t == "function" ? t : He(t), r = e == null ? ci : typeof e == "function" ? e : Pe(e);
1317
- return this.select(function() {
1318
- return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null);
1319
- });
1320
- }
1321
- function li() {
1322
- var t = this.parentNode;
1323
- t && t.removeChild(this);
1324
- }
1325
- function fi() {
1326
- return this.each(li);
1327
- }
1328
- function hi() {
1329
- var t = this.cloneNode(!1), e = this.parentNode;
1330
- return e ? e.insertBefore(t, this.nextSibling) : t;
1331
- }
1332
- function di() {
1333
- var t = this.cloneNode(!0), e = this.parentNode;
1334
- return e ? e.insertBefore(t, this.nextSibling) : t;
1335
- }
1336
- function mi(t) {
1337
- return this.select(t ? di : hi);
1338
- }
1339
- function gi(t) {
1340
- return arguments.length ? this.property("__data__", t) : this.node().__data__;
1341
- }
1342
- function yi(t) {
1343
- return function(e) {
1344
- t.call(this, e, this.__data__);
1345
- };
1346
- }
1347
- function pi(t) {
1348
- return t.trim().split(/^|\s+/).map(function(e) {
1349
- var n = "", r = e.indexOf(".");
1350
- return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n };
1351
- });
1352
- }
1353
- function xi(t) {
1354
- return function() {
1355
- var e = this.__on;
1356
- if (e) {
1357
- for (var n = 0, r = -1, i = e.length, a; n < i; ++n)
1358
- a = e[n], (!t.type || a.type === t.type) && a.name === t.name ? this.removeEventListener(a.type, a.listener, a.options) : e[++r] = a;
1359
- ++r ? e.length = r : delete this.__on;
1360
- }
1361
- };
1362
- }
1363
- function wi(t, e, n) {
1364
- return function() {
1365
- var r = this.__on, i, a = yi(e);
1366
- if (r) {
1367
- for (var o = 0, s = r.length; o < s; ++o)
1368
- if ((i = r[o]).type === t.type && i.name === t.name) {
1369
- this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = a, i.options = n), i.value = e;
1370
- return;
1371
- }
1372
- }
1373
- this.addEventListener(t.type, a, n), i = { type: t.type, name: t.name, value: e, listener: a, options: n }, r ? r.push(i) : this.__on = [i];
1374
- };
1375
- }
1376
- function bi(t, e, n) {
1377
- var r = pi(t + ""), i, a = r.length, o;
1378
- if (arguments.length < 2) {
1379
- var s = this.node().__on;
1380
- if (s) {
1381
- for (var c = 0, u = s.length, f; c < u; ++c)
1382
- for (i = 0, f = s[c]; i < a; ++i)
1383
- if ((o = r[i]).type === f.type && o.name === f.name)
1384
- return f.value;
1385
- }
1386
- return;
1387
- }
1388
- for (s = e ? wi : xi, i = 0; i < a; ++i) this.each(s(r[i], e, n));
1389
- return this;
1390
- }
1391
- function Ye(t, e, n) {
1392
- var r = qe(t), i = r.CustomEvent;
1393
- typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i);
1394
- }
1395
- function vi(t, e) {
1396
- return function() {
1397
- return Ye(this, t, e);
1398
- };
1399
- }
1400
- function Mi(t, e) {
1401
- return function() {
1402
- return Ye(this, t, e.apply(this, arguments));
1403
- };
1404
- }
1405
- function _i(t, e) {
1406
- return this.each((typeof e == "function" ? Mi : vi)(t, e));
1407
- }
1408
- function* Ni() {
1409
- for (var t = this._groups, e = 0, n = t.length; e < n; ++e)
1410
- for (var r = t[e], i = 0, a = r.length, o; i < a; ++i)
1411
- (o = r[i]) && (yield o);
1412
- }
1413
- var Si = [null];
1414
- function O(t, e) {
1415
- this._groups = t, this._parents = e;
1416
- }
1417
- function ki() {
1418
- return this;
1419
- }
1420
- O.prototype = {
1421
- constructor: O,
1422
- select: Gn,
1423
- selectAll: jn,
1424
- selectChild: ir,
1425
- selectChildren: cr,
1426
- filter: ur,
1427
- data: gr,
1428
- enter: lr,
1429
- exit: pr,
1430
- join: xr,
1431
- merge: wr,
1432
- selection: ki,
1433
- order: br,
1434
- sort: vr,
1435
- call: _r,
1436
- nodes: Nr,
1437
- node: Sr,
1438
- size: kr,
1439
- empty: $r,
1440
- each: Ar,
1441
- attr: Lr,
1442
- style: Ir,
1443
- property: Wr,
1444
- classed: Gr,
1445
- text: Zr,
1446
- html: ni,
1447
- raise: ii,
1448
- lower: oi,
1449
- append: si,
1450
- insert: ui,
1451
- remove: fi,
1452
- clone: mi,
1453
- datum: gi,
1454
- on: bi,
1455
- dispatch: _i,
1456
- [Symbol.iterator]: Ni
1457
- };
1458
- function ct(t) {
1459
- return typeof t == "string" ? new O([[document.querySelector(t)]], [document.documentElement]) : new O([[t]], Si);
1460
- }
1461
- function Qt(t, e, n) {
1462
- t.prototype = e.prototype = n, n.constructor = t;
1463
- }
1464
- function Be(t, e) {
1465
- var n = Object.create(t.prototype);
1466
- for (var r in e) n[r] = e[r];
1467
- return n;
1468
- }
1469
- function dt() {
1470
- }
1471
- var lt = 0.7, St = 1 / lt, it = "\\s*([+-]?\\d+)\\s*", ft = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Y = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", $i = /^#([0-9a-f]{3,8})$/, Ai = new RegExp(`^rgb\\(${it},${it},${it}\\)$`), Ei = new RegExp(`^rgb\\(${Y},${Y},${Y}\\)$`), Ci = new RegExp(`^rgba\\(${it},${it},${it},${ft}\\)$`), Fi = new RegExp(`^rgba\\(${Y},${Y},${Y},${ft}\\)$`), Ri = new RegExp(`^hsl\\(${ft},${Y},${Y}\\)$`), Ti = new RegExp(`^hsla\\(${ft},${Y},${Y},${ft}\\)$`), de = {
1472
- aliceblue: 15792383,
1473
- antiquewhite: 16444375,
1474
- aqua: 65535,
1475
- aquamarine: 8388564,
1476
- azure: 15794175,
1477
- beige: 16119260,
1478
- bisque: 16770244,
1479
- black: 0,
1480
- blanchedalmond: 16772045,
1481
- blue: 255,
1482
- blueviolet: 9055202,
1483
- brown: 10824234,
1484
- burlywood: 14596231,
1485
- cadetblue: 6266528,
1486
- chartreuse: 8388352,
1487
- chocolate: 13789470,
1488
- coral: 16744272,
1489
- cornflowerblue: 6591981,
1490
- cornsilk: 16775388,
1491
- crimson: 14423100,
1492
- cyan: 65535,
1493
- darkblue: 139,
1494
- darkcyan: 35723,
1495
- darkgoldenrod: 12092939,
1496
- darkgray: 11119017,
1497
- darkgreen: 25600,
1498
- darkgrey: 11119017,
1499
- darkkhaki: 12433259,
1500
- darkmagenta: 9109643,
1501
- darkolivegreen: 5597999,
1502
- darkorange: 16747520,
1503
- darkorchid: 10040012,
1504
- darkred: 9109504,
1505
- darksalmon: 15308410,
1506
- darkseagreen: 9419919,
1507
- darkslateblue: 4734347,
1508
- darkslategray: 3100495,
1509
- darkslategrey: 3100495,
1510
- darkturquoise: 52945,
1511
- darkviolet: 9699539,
1512
- deeppink: 16716947,
1513
- deepskyblue: 49151,
1514
- dimgray: 6908265,
1515
- dimgrey: 6908265,
1516
- dodgerblue: 2003199,
1517
- firebrick: 11674146,
1518
- floralwhite: 16775920,
1519
- forestgreen: 2263842,
1520
- fuchsia: 16711935,
1521
- gainsboro: 14474460,
1522
- ghostwhite: 16316671,
1523
- gold: 16766720,
1524
- goldenrod: 14329120,
1525
- gray: 8421504,
1526
- green: 32768,
1527
- greenyellow: 11403055,
1528
- grey: 8421504,
1529
- honeydew: 15794160,
1530
- hotpink: 16738740,
1531
- indianred: 13458524,
1532
- indigo: 4915330,
1533
- ivory: 16777200,
1534
- khaki: 15787660,
1535
- lavender: 15132410,
1536
- lavenderblush: 16773365,
1537
- lawngreen: 8190976,
1538
- lemonchiffon: 16775885,
1539
- lightblue: 11393254,
1540
- lightcoral: 15761536,
1541
- lightcyan: 14745599,
1542
- lightgoldenrodyellow: 16448210,
1543
- lightgray: 13882323,
1544
- lightgreen: 9498256,
1545
- lightgrey: 13882323,
1546
- lightpink: 16758465,
1547
- lightsalmon: 16752762,
1548
- lightseagreen: 2142890,
1549
- lightskyblue: 8900346,
1550
- lightslategray: 7833753,
1551
- lightslategrey: 7833753,
1552
- lightsteelblue: 11584734,
1553
- lightyellow: 16777184,
1554
- lime: 65280,
1555
- limegreen: 3329330,
1556
- linen: 16445670,
1557
- magenta: 16711935,
1558
- maroon: 8388608,
1559
- mediumaquamarine: 6737322,
1560
- mediumblue: 205,
1561
- mediumorchid: 12211667,
1562
- mediumpurple: 9662683,
1563
- mediumseagreen: 3978097,
1564
- mediumslateblue: 8087790,
1565
- mediumspringgreen: 64154,
1566
- mediumturquoise: 4772300,
1567
- mediumvioletred: 13047173,
1568
- midnightblue: 1644912,
1569
- mintcream: 16121850,
1570
- mistyrose: 16770273,
1571
- moccasin: 16770229,
1572
- navajowhite: 16768685,
1573
- navy: 128,
1574
- oldlace: 16643558,
1575
- olive: 8421376,
1576
- olivedrab: 7048739,
1577
- orange: 16753920,
1578
- orangered: 16729344,
1579
- orchid: 14315734,
1580
- palegoldenrod: 15657130,
1581
- palegreen: 10025880,
1582
- paleturquoise: 11529966,
1583
- palevioletred: 14381203,
1584
- papayawhip: 16773077,
1585
- peachpuff: 16767673,
1586
- peru: 13468991,
1587
- pink: 16761035,
1588
- plum: 14524637,
1589
- powderblue: 11591910,
1590
- purple: 8388736,
1591
- rebeccapurple: 6697881,
1592
- red: 16711680,
1593
- rosybrown: 12357519,
1594
- royalblue: 4286945,
1595
- saddlebrown: 9127187,
1596
- salmon: 16416882,
1597
- sandybrown: 16032864,
1598
- seagreen: 3050327,
1599
- seashell: 16774638,
1600
- sienna: 10506797,
1601
- silver: 12632256,
1602
- skyblue: 8900331,
1603
- slateblue: 6970061,
1604
- slategray: 7372944,
1605
- slategrey: 7372944,
1606
- snow: 16775930,
1607
- springgreen: 65407,
1608
- steelblue: 4620980,
1609
- tan: 13808780,
1610
- teal: 32896,
1611
- thistle: 14204888,
1612
- tomato: 16737095,
1613
- turquoise: 4251856,
1614
- violet: 15631086,
1615
- wheat: 16113331,
1616
- white: 16777215,
1617
- whitesmoke: 16119285,
1618
- yellow: 16776960,
1619
- yellowgreen: 10145074
1620
- };
1621
- Qt(dt, ht, {
1622
- copy(t) {
1623
- return Object.assign(new this.constructor(), this, t);
1624
- },
1625
- displayable() {
1626
- return this.rgb().displayable();
1627
- },
1628
- hex: me,
1629
- // Deprecated! Use color.formatHex.
1630
- formatHex: me,
1631
- formatHex8: Di,
1632
- formatHsl: Li,
1633
- formatRgb: ge,
1634
- toString: ge
1635
- });
1636
- function me() {
1637
- return this.rgb().formatHex();
1638
- }
1639
- function Di() {
1640
- return this.rgb().formatHex8();
1641
- }
1642
- function Li() {
1643
- return Xe(this).formatHsl();
1644
- }
1645
- function ge() {
1646
- return this.rgb().formatRgb();
1647
- }
1648
- function ht(t) {
1649
- var e, n;
1650
- return t = (t + "").trim().toLowerCase(), (e = $i.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? ye(e) : n === 3 ? new I(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? pt(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? pt(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Ai.exec(t)) ? new I(e[1], e[2], e[3], 1) : (e = Ei.exec(t)) ? new I(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Ci.exec(t)) ? pt(e[1], e[2], e[3], e[4]) : (e = Fi.exec(t)) ? pt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Ri.exec(t)) ? we(e[1], e[2] / 100, e[3] / 100, 1) : (e = Ti.exec(t)) ? we(e[1], e[2] / 100, e[3] / 100, e[4]) : de.hasOwnProperty(t) ? ye(de[t]) : t === "transparent" ? new I(NaN, NaN, NaN, 0) : null;
1651
- }
1652
- function ye(t) {
1653
- return new I(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
1654
- }
1655
- function pt(t, e, n, r) {
1656
- return r <= 0 && (t = e = n = NaN), new I(t, e, n, r);
1657
- }
1658
- function Hi(t) {
1659
- return t instanceof dt || (t = ht(t)), t ? (t = t.rgb(), new I(t.r, t.g, t.b, t.opacity)) : new I();
1660
- }
1661
- function Wt(t, e, n, r) {
1662
- return arguments.length === 1 ? Hi(t) : new I(t, e, n, r ?? 1);
1663
- }
1664
- function I(t, e, n, r) {
1665
- this.r = +t, this.g = +e, this.b = +n, this.opacity = +r;
1666
- }
1667
- Qt(I, Wt, Be(dt, {
1668
- brighter(t) {
1669
- return t = t == null ? St : Math.pow(St, t), new I(this.r * t, this.g * t, this.b * t, this.opacity);
1670
- },
1671
- darker(t) {
1672
- return t = t == null ? lt : Math.pow(lt, t), new I(this.r * t, this.g * t, this.b * t, this.opacity);
1673
- },
1674
- rgb() {
1675
- return this;
1676
- },
1677
- clamp() {
1678
- return new I(et(this.r), et(this.g), et(this.b), kt(this.opacity));
1679
- },
1680
- displayable() {
1681
- return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
1682
- },
1683
- hex: pe,
1684
- // Deprecated! Use color.formatHex.
1685
- formatHex: pe,
1686
- formatHex8: Pi,
1687
- formatRgb: xe,
1688
- toString: xe
1689
- }));
1690
- function pe() {
1691
- return `#${tt(this.r)}${tt(this.g)}${tt(this.b)}`;
1692
- }
1693
- function Pi() {
1694
- return `#${tt(this.r)}${tt(this.g)}${tt(this.b)}${tt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
1695
- }
1696
- function xe() {
1697
- const t = kt(this.opacity);
1698
- return `${t === 1 ? "rgb(" : "rgba("}${et(this.r)}, ${et(this.g)}, ${et(this.b)}${t === 1 ? ")" : `, ${t})`}`;
1699
- }
1700
- function kt(t) {
1701
- return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
1702
- }
1703
- function et(t) {
1704
- return Math.max(0, Math.min(255, Math.round(t) || 0));
1705
- }
1706
- function tt(t) {
1707
- return t = et(t), (t < 16 ? "0" : "") + t.toString(16);
1708
- }
1709
- function we(t, e, n, r) {
1710
- return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new z(t, e, n, r);
1711
- }
1712
- function Xe(t) {
1713
- if (t instanceof z) return new z(t.h, t.s, t.l, t.opacity);
1714
- if (t instanceof dt || (t = ht(t)), !t) return new z();
1715
- if (t instanceof z) return t;
1716
- t = t.rgb();
1717
- var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), a = Math.max(e, n, r), o = NaN, s = a - i, c = (a + i) / 2;
1718
- return s ? (e === a ? o = (n - r) / s + (n < r) * 6 : n === a ? o = (r - e) / s + 2 : o = (e - n) / s + 4, s /= c < 0.5 ? a + i : 2 - a - i, o *= 60) : s = c > 0 && c < 1 ? 0 : o, new z(o, s, c, t.opacity);
1719
- }
1720
- function Ui(t, e, n, r) {
1721
- return arguments.length === 1 ? Xe(t) : new z(t, e, n, r ?? 1);
1722
- }
1723
- function z(t, e, n, r) {
1724
- this.h = +t, this.s = +e, this.l = +n, this.opacity = +r;
1725
- }
1726
- Qt(z, Ui, Be(dt, {
1727
- brighter(t) {
1728
- return t = t == null ? St : Math.pow(St, t), new z(this.h, this.s, this.l * t, this.opacity);
1729
- },
1730
- darker(t) {
1731
- return t = t == null ? lt : Math.pow(lt, t), new z(this.h, this.s, this.l * t, this.opacity);
1732
- },
1733
- rgb() {
1734
- var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r;
1735
- return new I(
1736
- Pt(t >= 240 ? t - 240 : t + 120, i, r),
1737
- Pt(t, i, r),
1738
- Pt(t < 120 ? t + 240 : t - 120, i, r),
1739
- this.opacity
1740
- );
1741
- },
1742
- clamp() {
1743
- return new z(be(this.h), xt(this.s), xt(this.l), kt(this.opacity));
1744
- },
1745
- displayable() {
1746
- return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
1747
- },
1748
- formatHsl() {
1749
- const t = kt(this.opacity);
1750
- return `${t === 1 ? "hsl(" : "hsla("}${be(this.h)}, ${xt(this.s) * 100}%, ${xt(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
1751
- }
1752
- }));
1753
- function be(t) {
1754
- return t = (t || 0) % 360, t < 0 ? t + 360 : t;
1755
- }
1756
- function xt(t) {
1757
- return Math.max(0, Math.min(1, t || 0));
1758
- }
1759
- function Pt(t, e, n) {
1760
- return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255;
1761
- }
1762
- const Kt = (t) => () => t;
1763
- function Ii(t, e) {
1764
- return function(n) {
1765
- return t + n * e;
1766
- };
1767
- }
1768
- function qi(t, e, n) {
1769
- return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) {
1770
- return Math.pow(t + r * e, n);
1771
- };
1772
- }
1773
- function Vi(t) {
1774
- return (t = +t) == 1 ? Ge : function(e, n) {
1775
- return n - e ? qi(e, n, t) : Kt(isNaN(e) ? n : e);
1776
- };
1777
- }
1778
- function Ge(t, e) {
1779
- var n = e - t;
1780
- return n ? Ii(t, n) : Kt(isNaN(t) ? e : t);
1781
- }
1782
- const ve = (function t(e) {
1783
- var n = Vi(e);
1784
- function r(i, a) {
1785
- var o = n((i = Wt(i)).r, (a = Wt(a)).r), s = n(i.g, a.g), c = n(i.b, a.b), u = Ge(i.opacity, a.opacity);
1786
- return function(f) {
1787
- return i.r = o(f), i.g = s(f), i.b = c(f), i.opacity = u(f), i + "";
1788
- };
1789
- }
1790
- return r.gamma = t, r;
1791
- })(1);
1792
- function Oi(t, e) {
1793
- e || (e = []);
1794
- var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i;
1795
- return function(a) {
1796
- for (i = 0; i < n; ++i) r[i] = t[i] * (1 - a) + e[i] * a;
1797
- return r;
1798
- };
1799
- }
1800
- function zi(t) {
1801
- return ArrayBuffer.isView(t) && !(t instanceof DataView);
1802
- }
1803
- function Wi(t, e) {
1804
- var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), a = new Array(n), o;
1805
- for (o = 0; o < r; ++o) i[o] = Jt(t[o], e[o]);
1806
- for (; o < n; ++o) a[o] = e[o];
1807
- return function(s) {
1808
- for (o = 0; o < r; ++o) a[o] = i[o](s);
1809
- return a;
1810
- };
1811
- }
1812
- function Yi(t, e) {
1813
- var n = /* @__PURE__ */ new Date();
1814
- return t = +t, e = +e, function(r) {
1815
- return n.setTime(t * (1 - r) + e * r), n;
1816
- };
1817
- }
1818
- function $t(t, e) {
1819
- return t = +t, e = +e, function(n) {
1820
- return t * (1 - n) + e * n;
1821
- };
1822
- }
1823
- function Bi(t, e) {
1824
- var n = {}, r = {}, i;
1825
- (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {});
1826
- for (i in e)
1827
- i in t ? n[i] = Jt(t[i], e[i]) : r[i] = e[i];
1828
- return function(a) {
1829
- for (i in n) r[i] = n[i](a);
1830
- return r;
1831
- };
1832
- }
1833
- var Yt = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Ut = new RegExp(Yt.source, "g");
1834
- function Xi(t) {
1835
- return function() {
1836
- return t;
1837
- };
1838
- }
1839
- function Gi(t) {
1840
- return function(e) {
1841
- return t(e) + "";
1842
- };
1843
- }
1844
- function Qi(t, e) {
1845
- var n = Yt.lastIndex = Ut.lastIndex = 0, r, i, a, o = -1, s = [], c = [];
1846
- for (t = t + "", e = e + ""; (r = Yt.exec(t)) && (i = Ut.exec(e)); )
1847
- (a = i.index) > n && (a = e.slice(n, a), s[o] ? s[o] += a : s[++o] = a), (r = r[0]) === (i = i[0]) ? s[o] ? s[o] += i : s[++o] = i : (s[++o] = null, c.push({ i: o, x: $t(r, i) })), n = Ut.lastIndex;
1848
- return n < e.length && (a = e.slice(n), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? c[0] ? Gi(c[0].x) : Xi(e) : (e = c.length, function(u) {
1849
- for (var f = 0, d; f < e; ++f) s[(d = c[f]).i] = d.x(u);
1850
- return s.join("");
1851
- });
1852
- }
1853
- function Jt(t, e) {
1854
- var n = typeof e, r;
1855
- return e == null || n === "boolean" ? Kt(e) : (n === "number" ? $t : n === "string" ? (r = ht(e)) ? (e = r, ve) : Qi : e instanceof ht ? ve : e instanceof Date ? Yi : zi(e) ? Oi : Array.isArray(e) ? Wi : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Bi : $t)(t, e);
1856
- }
1857
- function Ki(t, e) {
1858
- return t = +t, e = +e, function(n) {
1859
- return Math.round(t * (1 - n) + e * n);
1860
- };
1861
- }
1862
- function Ji(t) {
1863
- return Math.abs(t = Math.round(t)) >= 1e21 ? t.toLocaleString("en").replace(/,/g, "") : t.toString(10);
1864
- }
1865
- function At(t, e) {
1866
- if ((n = (t = e ? t.toExponential(e - 1) : t.toExponential()).indexOf("e")) < 0) return null;
1867
- var n, r = t.slice(0, n);
1868
- return [
1869
- r.length > 1 ? r[0] + r.slice(2) : r,
1870
- +t.slice(n + 1)
1871
- ];
1872
- }
1873
- function at(t) {
1874
- return t = At(Math.abs(t)), t ? t[1] : NaN;
1875
- }
1876
- function Zi(t, e) {
1877
- return function(n, r) {
1878
- for (var i = n.length, a = [], o = 0, s = t[0], c = 0; i > 0 && s > 0 && (c + s + 1 > r && (s = Math.max(1, r - c)), a.push(n.substring(i -= s, i + s)), !((c += s + 1) > r)); )
1879
- s = t[o = (o + 1) % t.length];
1880
- return a.reverse().join(e);
1881
- };
1882
- }
1883
- function ji(t) {
1884
- return function(e) {
1885
- return e.replace(/[0-9]/g, function(n) {
1886
- return t[+n];
1887
- });
1888
- };
1889
- }
1890
- var ta = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
1891
- function Et(t) {
1892
- if (!(e = ta.exec(t))) throw new Error("invalid format: " + t);
1893
- var e;
1894
- return new Zt({
1895
- fill: e[1],
1896
- align: e[2],
1897
- sign: e[3],
1898
- symbol: e[4],
1899
- zero: e[5],
1900
- width: e[6],
1901
- comma: e[7],
1902
- precision: e[8] && e[8].slice(1),
1903
- trim: e[9],
1904
- type: e[10]
1905
- });
1906
- }
1907
- Et.prototype = Zt.prototype;
1908
- function Zt(t) {
1909
- this.fill = t.fill === void 0 ? " " : t.fill + "", this.align = t.align === void 0 ? ">" : t.align + "", this.sign = t.sign === void 0 ? "-" : t.sign + "", this.symbol = t.symbol === void 0 ? "" : t.symbol + "", this.zero = !!t.zero, this.width = t.width === void 0 ? void 0 : +t.width, this.comma = !!t.comma, this.precision = t.precision === void 0 ? void 0 : +t.precision, this.trim = !!t.trim, this.type = t.type === void 0 ? "" : t.type + "";
1910
- }
1911
- Zt.prototype.toString = function() {
1912
- return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
1913
- };
1914
- function ea(t) {
1915
- t: for (var e = t.length, n = 1, r = -1, i; n < e; ++n)
1916
- switch (t[n]) {
1917
- case ".":
1918
- r = i = n;
1919
- break;
1920
- case "0":
1921
- r === 0 && (r = n), i = n;
1922
- break;
1923
- default:
1924
- if (!+t[n]) break t;
1925
- r > 0 && (r = 0);
1926
- break;
1927
- }
1928
- return r > 0 ? t.slice(0, r) + t.slice(i + 1) : t;
1929
- }
1930
- var Qe;
1931
- function na(t, e) {
1932
- var n = At(t, e);
1933
- if (!n) return t + "";
1934
- var r = n[0], i = n[1], a = i - (Qe = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, o = r.length;
1935
- return a === o ? r : a > o ? r + new Array(a - o + 1).join("0") : a > 0 ? r.slice(0, a) + "." + r.slice(a) : "0." + new Array(1 - a).join("0") + At(t, Math.max(0, e + a - 1))[0];
1936
- }
1937
- function Me(t, e) {
1938
- var n = At(t, e);
1939
- if (!n) return t + "";
1940
- var r = n[0], i = n[1];
1941
- return i < 0 ? "0." + new Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + new Array(i - r.length + 2).join("0");
1942
- }
1943
- const _e = {
1944
- "%": (t, e) => (t * 100).toFixed(e),
1945
- b: (t) => Math.round(t).toString(2),
1946
- c: (t) => t + "",
1947
- d: Ji,
1948
- e: (t, e) => t.toExponential(e),
1949
- f: (t, e) => t.toFixed(e),
1950
- g: (t, e) => t.toPrecision(e),
1951
- o: (t) => Math.round(t).toString(8),
1952
- p: (t, e) => Me(t * 100, e),
1953
- r: Me,
1954
- s: na,
1955
- X: (t) => Math.round(t).toString(16).toUpperCase(),
1956
- x: (t) => Math.round(t).toString(16)
1957
- };
1958
- function Ne(t) {
1959
- return t;
1960
- }
1961
- var Se = Array.prototype.map, ke = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
1962
- function ra(t) {
1963
- var e = t.grouping === void 0 || t.thousands === void 0 ? Ne : Zi(Se.call(t.grouping, Number), t.thousands + ""), n = t.currency === void 0 ? "" : t.currency[0] + "", r = t.currency === void 0 ? "" : t.currency[1] + "", i = t.decimal === void 0 ? "." : t.decimal + "", a = t.numerals === void 0 ? Ne : ji(Se.call(t.numerals, String)), o = t.percent === void 0 ? "%" : t.percent + "", s = t.minus === void 0 ? "−" : t.minus + "", c = t.nan === void 0 ? "NaN" : t.nan + "";
1964
- function u(d) {
1965
- d = Et(d);
1966
- var l = d.fill, h = d.align, b = d.sign, A = d.symbol, S = d.zero, R = d.width, v = d.comma, k = d.precision, C = d.trim, M = d.type;
1967
- M === "n" ? (v = !0, M = "g") : _e[M] || (k === void 0 && (k = 12), C = !0, M = "g"), (S || l === "0" && h === "=") && (S = !0, l = "0", h = "=");
1968
- var F = A === "$" ? n : A === "#" && /[boxX]/.test(M) ? "0" + M.toLowerCase() : "", E = A === "$" ? r : /[%p]/.test(M) ? o : "", x = _e[M], m = /[defgprs%]/.test(M);
1969
- k = k === void 0 ? 6 : /[gprs]/.test(M) ? Math.max(1, Math.min(21, k)) : Math.max(0, Math.min(20, k));
1970
- function _(g) {
1971
- var w = F, N = E, T, q, ot;
1972
- if (M === "c")
1973
- N = x(g) + N, g = "";
1974
- else {
1975
- g = +g;
1976
- var L = g < 0 || 1 / g < 0;
1977
- if (g = isNaN(g) ? c : x(Math.abs(g), k), C && (g = ea(g)), L && +g == 0 && b !== "+" && (L = !1), w = (L ? b === "(" ? b : s : b === "-" || b === "(" ? "" : b) + w, N = (M === "s" ? ke[8 + Qe / 3] : "") + N + (L && b === "(" ? ")" : ""), m) {
1978
- for (T = -1, q = g.length; ++T < q; )
1979
- if (ot = g.charCodeAt(T), 48 > ot || ot > 57) {
1980
- N = (ot === 46 ? i + g.slice(T + 1) : g.slice(T)) + N, g = g.slice(0, T);
1981
- break;
1982
- }
1983
- }
1984
- }
1985
- v && !S && (g = e(g, 1 / 0));
1986
- var K = w.length + g.length + N.length, V = K < R ? new Array(R - K + 1).join(l) : "";
1987
- switch (v && S && (g = e(V + g, V.length ? R - N.length : 1 / 0), V = ""), h) {
1988
- case "<":
1989
- g = w + g + N + V;
1990
- break;
1991
- case "=":
1992
- g = w + V + g + N;
1993
- break;
1994
- case "^":
1995
- g = V.slice(0, K = V.length >> 1) + w + g + N + V.slice(K);
1996
- break;
1997
- default:
1998
- g = V + w + g + N;
1999
- break;
2000
- }
2001
- return a(g);
2002
- }
2003
- return _.toString = function() {
2004
- return d + "";
2005
- }, _;
2006
- }
2007
- function f(d, l) {
2008
- var h = u((d = Et(d), d.type = "f", d)), b = Math.max(-8, Math.min(8, Math.floor(at(l) / 3))) * 3, A = Math.pow(10, -b), S = ke[8 + b / 3];
2009
- return function(R) {
2010
- return h(A * R) + S;
2011
- };
2012
- }
2013
- return {
2014
- format: u,
2015
- formatPrefix: f
2016
- };
2017
- }
2018
- var wt, Ke, Je;
2019
- ia({
2020
- thousands: ",",
2021
- grouping: [3],
2022
- currency: ["$", ""]
2023
- });
2024
- function ia(t) {
2025
- return wt = ra(t), Ke = wt.format, Je = wt.formatPrefix, wt;
2026
- }
2027
- function aa(t) {
2028
- return Math.max(0, -at(Math.abs(t)));
2029
- }
2030
- function oa(t, e) {
2031
- return Math.max(0, Math.max(-8, Math.min(8, Math.floor(at(e) / 3))) * 3 - at(Math.abs(t)));
2032
- }
2033
- function sa(t, e) {
2034
- return t = Math.abs(t), e = Math.abs(e) - t, Math.max(0, at(e) - at(t)) + 1;
2035
- }
2036
- function Ct(t, e) {
2037
- switch (arguments.length) {
2038
- case 0:
2039
- break;
2040
- case 1:
2041
- this.range(t);
2042
- break;
2043
- default:
2044
- this.range(e).domain(t);
2045
- break;
2046
- }
2047
- return this;
2048
- }
2049
- const $e = /* @__PURE__ */ Symbol("implicit");
2050
- function ca() {
2051
- var t = new se(), e = [], n = [], r = $e;
2052
- function i(a) {
2053
- let o = t.get(a);
2054
- if (o === void 0) {
2055
- if (r !== $e) return r;
2056
- t.set(a, o = e.push(a) - 1);
2057
- }
2058
- return n[o % n.length];
2059
- }
2060
- return i.domain = function(a) {
2061
- if (!arguments.length) return e.slice();
2062
- e = [], t = new se();
2063
- for (const o of a)
2064
- t.has(o) || t.set(o, e.push(o) - 1);
2065
- return i;
2066
- }, i.range = function(a) {
2067
- return arguments.length ? (n = Array.from(a), i) : n.slice();
2068
- }, i.unknown = function(a) {
2069
- return arguments.length ? (r = a, i) : r;
2070
- }, i.copy = function() {
2071
- return ca(e, n).unknown(r);
2072
- }, Ct.apply(i, arguments), i;
2073
- }
2074
- function ua(t) {
2075
- return function() {
2076
- return t;
2077
- };
2078
- }
2079
- function la(t) {
2080
- return +t;
2081
- }
2082
- var Ae = [0, 1];
2083
- function W(t) {
2084
- return t;
2085
- }
2086
- function Bt(t, e) {
2087
- return (e -= t = +t) ? function(n) {
2088
- return (n - t) / e;
2089
- } : ua(isNaN(e) ? NaN : 0.5);
2090
- }
2091
- function fa(t, e) {
2092
- var n;
2093
- return t > e && (n = t, t = e, e = n), function(r) {
2094
- return Math.max(t, Math.min(e, r));
2095
- };
2096
- }
2097
- function ha(t, e, n) {
2098
- var r = t[0], i = t[1], a = e[0], o = e[1];
2099
- return i < r ? (r = Bt(i, r), a = n(o, a)) : (r = Bt(r, i), a = n(a, o)), function(s) {
2100
- return a(r(s));
2101
- };
2102
- }
2103
- function da(t, e, n) {
2104
- var r = Math.min(t.length, e.length) - 1, i = new Array(r), a = new Array(r), o = -1;
2105
- for (t[r] < t[0] && (t = t.slice().reverse(), e = e.slice().reverse()); ++o < r; )
2106
- i[o] = Bt(t[o], t[o + 1]), a[o] = n(e[o], e[o + 1]);
2107
- return function(s) {
2108
- var c = Te(t, s, 1, r) - 1;
2109
- return a[c](i[c](s));
2110
- };
2111
- }
2112
- function Ze(t, e) {
2113
- return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());
2114
- }
2115
- function je() {
2116
- var t = Ae, e = Ae, n = Jt, r, i, a, o = W, s, c, u;
2117
- function f() {
2118
- var l = Math.min(t.length, e.length);
2119
- return o !== W && (o = fa(t[0], t[l - 1])), s = l > 2 ? da : ha, c = u = null, d;
2120
- }
2121
- function d(l) {
2122
- return l == null || isNaN(l = +l) ? a : (c || (c = s(t.map(r), e, n)))(r(o(l)));
2123
- }
2124
- return d.invert = function(l) {
2125
- return o(i((u || (u = s(e, t.map(r), $t)))(l)));
2126
- }, d.domain = function(l) {
2127
- return arguments.length ? (t = Array.from(l, la), f()) : t.slice();
2128
- }, d.range = function(l) {
2129
- return arguments.length ? (e = Array.from(l), f()) : e.slice();
2130
- }, d.rangeRound = function(l) {
2131
- return e = Array.from(l), n = Ki, f();
2132
- }, d.clamp = function(l) {
2133
- return arguments.length ? (o = l ? !0 : W, f()) : o !== W;
2134
- }, d.interpolate = function(l) {
2135
- return arguments.length ? (n = l, f()) : n;
2136
- }, d.unknown = function(l) {
2137
- return arguments.length ? (a = l, d) : a;
2138
- }, function(l, h) {
2139
- return r = l, i = h, f();
2140
- };
2141
- }
2142
- function ma() {
2143
- return je()(W, W);
2144
- }
2145
- function ga(t, e, n, r) {
2146
- var i = Un(t, e, n), a;
2147
- switch (r = Et(r ?? ",f"), r.type) {
2148
- case "s": {
2149
- var o = Math.max(Math.abs(t), Math.abs(e));
2150
- return r.precision == null && !isNaN(a = oa(i, o)) && (r.precision = a), Je(r, o);
2151
- }
2152
- case "":
2153
- case "e":
2154
- case "g":
2155
- case "p":
2156
- case "r": {
2157
- r.precision == null && !isNaN(a = sa(i, Math.max(Math.abs(t), Math.abs(e)))) && (r.precision = a - (r.type === "e"));
2158
- break;
2159
- }
2160
- case "f":
2161
- case "%": {
2162
- r.precision == null && !isNaN(a = aa(i)) && (r.precision = a - (r.type === "%") * 2);
2163
- break;
2164
- }
2165
- }
2166
- return Ke(r);
2167
- }
2168
- function jt(t) {
2169
- var e = t.domain;
2170
- return t.ticks = function(n) {
2171
- var r = e();
2172
- return Pn(r[0], r[r.length - 1], n ?? 10);
2173
- }, t.tickFormat = function(n, r) {
2174
- var i = e();
2175
- return ga(i[0], i[i.length - 1], n ?? 10, r);
2176
- }, t.nice = function(n) {
2177
- n == null && (n = 10);
2178
- var r = e(), i = 0, a = r.length - 1, o = r[i], s = r[a], c, u, f = 10;
2179
- for (s < o && (u = o, o = s, s = u, u = i, i = a, a = u); f-- > 0; ) {
2180
- if (u = Vt(o, s, n), u === c)
2181
- return r[i] = o, r[a] = s, e(r);
2182
- if (u > 0)
2183
- o = Math.floor(o / u) * u, s = Math.ceil(s / u) * u;
2184
- else if (u < 0)
2185
- o = Math.ceil(o * u) / u, s = Math.floor(s * u) / u;
2186
- else
2187
- break;
2188
- c = u;
2189
- }
2190
- return t;
2191
- }, t;
2192
- }
2193
- function ya() {
2194
- var t = ma();
2195
- return t.copy = function() {
2196
- return Ze(t, ya());
2197
- }, Ct.apply(t, arguments), jt(t);
2198
- }
2199
- function Ee(t) {
2200
- return function(e) {
2201
- return e < 0 ? -Math.pow(-e, t) : Math.pow(e, t);
2202
- };
2203
- }
2204
- function pa(t) {
2205
- return t < 0 ? -Math.sqrt(-t) : Math.sqrt(t);
2206
- }
2207
- function xa(t) {
2208
- return t < 0 ? -t * t : t * t;
2209
- }
2210
- function wa(t) {
2211
- var e = t(W, W), n = 1;
2212
- function r() {
2213
- return n === 1 ? t(W, W) : n === 0.5 ? t(pa, xa) : t(Ee(n), Ee(1 / n));
2214
- }
2215
- return e.exponent = function(i) {
2216
- return arguments.length ? (n = +i, r()) : n;
2217
- }, jt(e);
2218
- }
2219
- function tn() {
2220
- var t = wa(je());
2221
- return t.copy = function() {
2222
- return Ze(t, tn()).exponent(t.exponent());
2223
- }, Ct.apply(t, arguments), t;
2224
- }
2225
- function za() {
2226
- return tn.apply(null, arguments).exponent(0.5);
2227
- }
2228
- function en() {
2229
- var t = 0, e = 1, n = 1, r = [0.5], i = [0, 1], a;
2230
- function o(c) {
2231
- return c != null && c <= c ? i[Te(r, c, 0, n)] : a;
2232
- }
2233
- function s() {
2234
- var c = -1;
2235
- for (r = new Array(n); ++c < n; ) r[c] = ((c + 1) * e - (c - n) * t) / (n + 1);
2236
- return o;
2237
- }
2238
- return o.domain = function(c) {
2239
- return arguments.length ? ([t, e] = c, t = +t, e = +e, s()) : [t, e];
2240
- }, o.range = function(c) {
2241
- return arguments.length ? (n = (i = Array.from(c)).length - 1, s()) : i.slice();
2242
- }, o.invertExtent = function(c) {
2243
- var u = i.indexOf(c);
2244
- return u < 0 ? [NaN, NaN] : u < 1 ? [t, r[0]] : u >= n ? [r[n - 1], e] : [r[u - 1], r[u]];
2245
- }, o.unknown = function(c) {
2246
- return arguments.length && (a = c), o;
2247
- }, o.thresholds = function() {
2248
- return r.slice();
2249
- }, o.copy = function() {
2250
- return en().domain([t, e]).range(i).unknown(a);
2251
- }, Ct.apply(jt(o), arguments);
2252
- }
2253
- function ba({
2254
- data: t,
2255
- chartConfig: e,
2256
- displayConfig: n = {},
2257
- queryObject: r,
2258
- height: i = "100%",
2259
- colorPalette: a
2260
- }) {
2261
- const o = oe(null), s = oe(null), [c, u] = Q({ width: 0, height: 0 }), [f, d] = Q(!1), [l, h] = Q("light"), { getFieldLabel: b } = bn();
2262
- bt(() => (h(Mt()), kn((m) => {
2263
- h(m);
2264
- })), []);
2265
- const A = {
2266
- showTooltip: n?.showTooltip ?? !0,
2267
- showLabels: n?.showLabels ?? !0,
2268
- fitToWidth: n?.fitToWidth ?? !1
2269
- };
2270
- hn(() => {
2271
- let x = 0;
2272
- const m = 10;
2273
- let _, g;
2274
- const w = () => {
2275
- if (s.current) {
2276
- const { width: T, height: q } = s.current.getBoundingClientRect();
2277
- if (T > 0 && q > 0)
2278
- return u({ width: T, height: q }), d(!0), !0;
2279
- }
2280
- return !1;
2281
- };
2282
- if (!w() && x < m) {
2283
- const T = () => {
2284
- !w() && x < m && (x++, g = setTimeout(() => {
2285
- _ = requestAnimationFrame(T);
2286
- }, 50 * x));
2287
- };
2288
- _ = requestAnimationFrame(T);
2289
- }
2290
- return () => {
2291
- _ && cancelAnimationFrame(_), g && clearTimeout(g);
2292
- };
2293
- }, []), bt(() => {
2294
- let x = null;
2295
- const m = () => {
2296
- if (s.current) {
2297
- const { width: _, height: g } = s.current.getBoundingClientRect();
2298
- _ > 0 && g > 0 && (u({ width: _, height: g }), f || d(!0));
2299
- }
2300
- };
2301
- return s.current && (x = new ResizeObserver(() => m()), x.observe(s.current), m()), window.addEventListener("resize", m), () => {
2302
- x && x.disconnect(), window.removeEventListener("resize", m);
2303
- };
2304
- }, [f]);
2305
- const S = (x) => Math.floor(x.getMonth() / 3) + 1, R = (x) => x.getMonth() % 3 + 1, v = (x) => {
2306
- const m = x.getDate();
2307
- return Math.floor((m - 1) / 7) + 1;
2308
- }, k = (x) => {
2309
- switch (x?.toLowerCase()) {
2310
- case "year":
2311
- return null;
2312
- case "quarter":
2313
- return {
2314
- extractX: (m) => m.getFullYear(),
2315
- extractY: (m) => S(m) - 1,
2316
- // 0-3 for indexing
2317
- xLabels: [],
2318
- // Will be determined from data
2319
- yLabels: ["Q1", "Q2", "Q3", "Q4"],
2320
- xFormat: (m) => `'${m.toString().slice(-2)}`,
2321
- // '24 instead of 2024
2322
- yFormat: (m) => ["Q1", "Q2", "Q3", "Q4"][m] || "",
2323
- cellWidth: 16,
2324
- cellHeight: 16
2325
- };
2326
- case "month":
2327
- return {
2328
- extractX: (m) => {
2329
- const _ = m.getFullYear(), g = S(m);
2330
- return _ * 10 + g;
2331
- },
2332
- extractY: (m) => R(m) - 1,
2333
- // 0-2 for indexing
2334
- xLabels: [],
2335
- // Will be determined from data
2336
- yLabels: ["Month 1", "Month 2", "Month 3"],
2337
- xFormat: (m) => `Q${m % 10}`,
2338
- yFormat: (m) => ["Month 1", "Month 2", "Month 3"][m] || "",
2339
- cellWidth: 16,
2340
- cellHeight: 16,
2341
- hasHierarchicalLabels: !0,
2342
- // Flag to indicate we need special handling
2343
- getYearFromX: (m) => Math.floor(m / 10)
2344
- // Helper to get year for grouping
2345
- };
2346
- case "week":
2347
- return {
2348
- extractX: (m) => {
2349
- const _ = m.getFullYear(), g = m.getMonth() + 1;
2350
- return _ * 100 + g;
2351
- },
2352
- extractY: (m) => v(m) - 1,
2353
- // 0-5 for indexing
2354
- xLabels: [],
2355
- // Will be determined from data
2356
- yLabels: ["Week 1", "Week 2", "Week 3", "Week 4", "Week 5"],
2357
- xFormat: (m) => {
2358
- const _ = m % 100;
2359
- return ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"][_ - 1] || "";
2360
- },
2361
- yFormat: (m) => ["Week 1", "Week 2", "Week 3", "Week 4", "Week 5"][m] || "",
2362
- cellWidth: 16,
2363
- cellHeight: 16,
2364
- hasHierarchicalLabels: !0,
2365
- // Add hierarchical labels like month view
2366
- getYearFromX: (m) => Math.floor(m / 100)
2367
- // Helper to get year for grouping
2368
- };
2369
- case "day":
2370
- return {
2371
- extractX: (m) => {
2372
- const { year: _, week: g } = C(m);
2373
- return _ * 100 + g;
2374
- },
2375
- extractY: (m) => m.getDay(),
2376
- // 0-6 (Sun-Sat)
2377
- xLabels: [],
2378
- // Will be determined from data
2379
- yLabels: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
2380
- xFormat: (m) => `${m % 100}`,
2381
- yFormat: (m) => ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"][m] || "",
2382
- cellWidth: 16,
2383
- cellHeight: 16,
2384
- hasHierarchicalLabels: !0,
2385
- // Add hierarchical labels
2386
- getYearFromX: (m) => Math.floor(m / 100)
2387
- // Helper to get year for grouping
2388
- };
2389
- case "hour":
2390
- return {
2391
- extractX: (m) => {
2392
- const _ = m.getFullYear(), g = m.getMonth() + 1, w = m.getDate();
2393
- return _ * 1e4 + g * 100 + w;
2394
- },
2395
- extractY: (m) => Math.floor(m.getHours() / 3),
2396
- // 0-7 for 8 three-hour blocks
2397
- xLabels: [],
2398
- // Will be determined from data
2399
- yLabels: ["00-03", "03-06", "06-09", "09-12", "12-15", "15-18", "18-21", "21-00"],
2400
- xFormat: (m) => `${m % 100}`,
2401
- yFormat: (m) => ["00-03", "03-06", "06-09", "09-12", "12-15", "15-18", "18-21", "21-00"][m] || "",
2402
- cellWidth: 16,
2403
- cellHeight: 16,
2404
- hasHierarchicalLabels: !0,
2405
- // Show year/month grouping above
2406
- getYearFromX: (m) => Math.floor(m / 100)
2407
- // Extract YYYYMM for month grouping
2408
- };
2409
- default:
2410
- return null;
2411
- }
2412
- }, C = (x) => {
2413
- const m = new Date(Date.UTC(x.getFullYear(), x.getMonth(), x.getDate())), _ = m.getUTCDay() || 7;
2414
- m.setUTCDate(m.getUTCDate() + 4 - _);
2415
- const g = m.getUTCFullYear(), w = new Date(Date.UTC(g, 0, 1)), N = Math.ceil(((m.getTime() - w.getTime()) / 864e5 + 1) / 7);
2416
- return { year: g, week: N };
2417
- };
2418
- if (bt(() => {
2419
- if (!t || t.length === 0 || !o.current || !f || c.width === 0 || (ct(o.current).selectAll("*").remove(), !e?.dateField || !e?.valueField))
2420
- return;
2421
- const x = Array.isArray(e.dateField) ? e.dateField[0] : e.dateField, m = Array.isArray(e.valueField) ? e.valueField[0] : e.valueField;
2422
- if (!x || !m)
2423
- return;
2424
- const g = (() => {
2425
- if (!r?.timeDimensions || r.timeDimensions.length === 0)
2426
- return "day";
2427
- const y = r.timeDimensions.find(
2428
- ($) => $.dimension === x || $.dimension.includes(x)
2429
- );
2430
- if (y && y.granularity)
2431
- return y.granularity;
2432
- const p = r.timeDimensions[0];
2433
- return p && p.granularity ? p.granularity : "day";
2434
- })(), w = k(g);
2435
- if (!w)
2436
- return;
2437
- const N = t.map((y) => {
2438
- const p = y[x], $ = typeof y[m] == "string" ? parseFloat(y[m]) : y[m] || 0;
2439
- let D;
2440
- if (typeof p == "string") {
2441
- let P = p;
2442
- p.includes(" ") && (P = p.replace(" ", "T").replace("+00", "Z").replace(/\+\d{2}:\d{2}$/, "Z")), !P.endsWith("Z") && !P.includes("+") && (P = P + "Z"), D = new Date(P);
2443
- } else
2444
- D = new Date(p);
2445
- if (isNaN(D.getTime()))
2446
- return null;
2447
- const X = w.extractX(D), G = w.extractY(D);
2448
- return {
2449
- x: X,
2450
- y: G,
2451
- value: $,
2452
- date: D,
2453
- label: Xt(p, g)
2454
- };
2455
- }).filter((y) => y !== null);
2456
- if (N.length === 0) return;
2457
- const T = ue(N, (y) => y.y) || 0, q = le(N, (y) => y.y) || 0, L = (() => {
2458
- const y = [...new Set(N.map((p) => p.x))].sort();
2459
- return y;
2460
- })(), K = L.length * w.cellWidth + (L.length - 1) * 4, V = (T - q + 1) * w.cellHeight + (T - q) * 4, B = {
2461
- left: 60,
2462
- // Space for Y-axis labels
2463
- bottom: 10,
2464
- // Reduced since labels are at top
2465
- top: w.hasHierarchicalLabels ? 40 : 25,
2466
- // Extra space for hierarchical labels
2467
- right: 10
2468
- }, Ft = c.width - B.left - B.right, te = c.height - B.top - B.bottom;
2469
- let H, nt;
2470
- if (A.fitToWidth) {
2471
- const y = Ft / K, p = te / V, $ = Math.min(y, p);
2472
- H = w.cellWidth * $, nt = w.cellHeight * $;
2473
- } else {
2474
- const p = { width: 16, height: 16 }, $ = 24, D = Ft / K, X = te / V, G = Math.min(D, X);
2475
- H = Math.max(p.width, Math.min($, w.cellWidth * G)), nt = Math.max(p.height, Math.min($, w.cellHeight * G)), g === "week" && H < p.width && (H = p.width);
2476
- }
2477
- const ee = L.length * H + (L.length - 1) * 4, nn = ee > Ft ? ee + B.left + B.right : c.width, rt = ct(o.current).attr("width", nn).attr("height", c.height).append("g").attr("transform", `translate(${B.left},${B.top})`), ne = N.map((y) => y.value), rn = le(ne) || 0, an = ue(ne) || 1, on = en().domain([rn, an]).range(a?.gradient || Nn), re = /* @__PURE__ */ new Map();
2478
- N.forEach((y) => {
2479
- const p = `${y.x}-${y.y}`;
2480
- re.set(p, y);
2481
- });
2482
- const J = (y, p) => getComputedStyle(document.documentElement).getPropertyValue(y).trim() || p, Rt = l !== "light", mt = Rt ? J("--dc-text-muted", "#cbd5e1") : J("--dc-text-secondary", "#374151"), sn = J("--dc-border", "#e5e7eb"), cn = Rt ? J("--dc-bg-secondary", "#1e293b") : J("--dc-bg-secondary", "#f3f4f6"), ie = Rt ? J("--dc-border", "#334155") : J("--dc-bg", "#ffffff"), gt = ct("body").append("div").attr("class", "activity-grid-tooltip").style("position", "absolute").style("padding", "8px").style("background", "rgba(0, 0, 0, 0.8)").style("color", "white").style("border-radius", "4px").style("font-size", "12px").style("pointer-events", "none").style("opacity", 0).style("z-index", 1e3), st = /* @__PURE__ */ new Map();
2483
- L.forEach((y, p) => {
2484
- st.set(y, p);
2485
- });
2486
- for (const y of L)
2487
- for (let p = q; p <= T; p++) {
2488
- const $ = `${y}-${p}`, D = re.get($), X = st.get(y) || 0, G = rt.append("rect").attr("x", X * (H + 4)).attr("y", (p - q) * (nt + 4)).attr("width", H).attr("height", nt).attr("rx", 2).attr("ry", 2).style("fill", D ? on(D.value) : cn).style("stroke", ie).style("stroke-width", 1);
2489
- A.showTooltip && G.style("cursor", "pointer").on("mouseover", function(P) {
2490
- if (ct(this).style("stroke", "#000").style("stroke-width", 2), D) {
2491
- const Z = [
2492
- `<strong>${D.label}</strong>`,
2493
- `${b(m)}: ${D.value}`
2494
- ].join("<br>");
2495
- gt.html(Z).style("left", P.pageX + 10 + "px").style("top", P.pageY - 10 + "px").transition().duration(200).style("opacity", 1);
2496
- }
2497
- }).on("mousemove", function(P) {
2498
- gt.style("left", P.pageX + 10 + "px").style("top", P.pageY - 10 + "px");
2499
- }).on("mouseout", function() {
2500
- ct(this).style("stroke", ie).style("stroke-width", 1), gt.transition().duration(200).style("opacity", 0);
2501
- });
2502
- }
2503
- if (A.showLabels) {
2504
- if (w.hasHierarchicalLabels && w.getYearFromX) {
2505
- const y = /* @__PURE__ */ new Map();
2506
- for (const p of L) {
2507
- const $ = w.getYearFromX(p);
2508
- y.has($) || y.set($, []), y.get($).push(p);
2509
- }
2510
- for (const p of L) {
2511
- const $ = st.get(p) || 0;
2512
- rt.append("text").attr("x", $ * (H + 4) + H / 2).attr("y", -8).attr("text-anchor", "middle").style("font-size", "10px").style("fill", mt).text(w.xFormat(p));
2513
- }
2514
- for (const [p, $] of y)
2515
- if ($.length > 0) {
2516
- const D = Math.min(...$.map((Z) => st.get(Z) || 0)), X = Math.max(...$.map((Z) => st.get(Z) || 0)), G = (D + X) / 2;
2517
- let P = "";
2518
- if (p > 9999) {
2519
- const Z = Math.floor(p / 100), un = p % 100;
2520
- P = `${["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][un - 1]} '${Z.toString().slice(-2)}`;
2521
- } else
2522
- P = `'${p.toString().slice(-2)}`;
2523
- rt.append("text").attr("x", G * (H + 4) + H / 2).attr("y", -25).attr("text-anchor", "middle").style("font-size", "12px").style("font-weight", "bold").style("fill", mt).text(P), $.length > 1 && rt.append("line").attr("x1", D * (H + 4)).attr("x2", X * (H + 4) + H).attr("y1", -20).attr("y2", -20).style("stroke", sn).style("stroke-width", 1).style("opacity", 0.3);
2524
- }
2525
- } else {
2526
- const y = Math.max(1, Math.floor(L.length / 10));
2527
- for (let p = 0; p < L.length; p += y) {
2528
- const $ = L[p];
2529
- rt.append("text").attr("x", p * (H + 4) + H / 2).attr("y", -8).attr("text-anchor", "middle").style("font-size", "10px").style("fill", mt).text(w.xFormat($));
2530
- }
2531
- }
2532
- for (let y = q; y <= T; y++)
2533
- rt.append("text").attr("x", -8).attr("y", (y - q) * (nt + 4) + nt / 2).attr("text-anchor", "end").attr("dy", ".35em").style("font-size", "10px").style("fill", mt).text(w.yFormat(y));
2534
- }
2535
- return () => {
2536
- gt.remove();
2537
- };
2538
- }, [t, e, n, r, c, f, A.showTooltip, A.showLabels, a, l]), !t || t.length === 0)
2539
- return /* @__PURE__ */ U(
2540
- "div",
2541
- {
2542
- className: "flex items-center justify-center w-full",
2543
- style: { height: i },
2544
- children: /* @__PURE__ */ yt("div", { className: "text-center text-dc-text-muted", children: [
2545
- /* @__PURE__ */ U("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
2546
- /* @__PURE__ */ U("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in activity grid" })
2547
- ] })
2548
- }
2549
- );
2550
- if (!(e?.dateField && e?.valueField))
2551
- return /* @__PURE__ */ U(
2552
- "div",
2553
- {
2554
- className: "flex items-center justify-center w-full",
2555
- style: { height: i },
2556
- children: /* @__PURE__ */ yt("div", { className: "text-center text-dc-text-muted", children: [
2557
- /* @__PURE__ */ U("div", { className: "text-sm font-semibold mb-1", children: "Configuration Required" }),
2558
- /* @__PURE__ */ U("div", { className: "text-xs text-dc-text-secondary", children: "Activity grid requires a time dimension and a measure" })
2559
- ] })
2560
- }
2561
- );
2562
- const F = Array.isArray(e.dateField) ? e.dateField[0] : e.dateField;
2563
- return (r?.timeDimensions?.find(
2564
- (x) => x.dimension === F || x.dimension.includes(F)
2565
- )?.granularity || "day")?.toLowerCase() === "year" ? /* @__PURE__ */ U(
2566
- "div",
2567
- {
2568
- className: "flex items-center justify-center w-full",
2569
- style: { height: i },
2570
- children: /* @__PURE__ */ yt("div", { className: "text-center text-dc-text-muted", children: [
2571
- /* @__PURE__ */ U("div", { className: "text-sm font-semibold mb-1", children: "Granularity Too High" }),
2572
- /* @__PURE__ */ U("div", { className: "text-xs text-dc-text-secondary", children: "Activity grids work best with hour, day, week, month, or quarter granularity" }),
2573
- /* @__PURE__ */ U("div", { className: "text-xs text-dc-text-secondary mt-1", children: "Please choose a lower granularity for your time dimension" })
2574
- ] })
2575
- }
2576
- ) : /* @__PURE__ */ U("div", { className: "w-full flex flex-col relative", style: { height: i, minHeight: "250px", overflow: "hidden", width: "100%" }, children: /* @__PURE__ */ yt("div", { ref: s, className: "w-full h-full relative overflow-x-auto", style: { width: "100%" }, children: [
2577
- /* @__PURE__ */ U("svg", { ref: o, className: "h-full" }),
2578
- !f && /* @__PURE__ */ U("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ U("div", { className: "text-dc-text-muted text-sm", children: "Measuring chart dimensions..." }) })
2579
- ] }) });
2580
- }
2581
- const Wa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2582
- __proto__: null,
2583
- default: ba
2584
- }, Symbol.toStringTag, { value: "Module" }));
2585
- export {
2586
- Ha as A,
2587
- Pa as B,
2588
- Ta as C,
2589
- Ua as D,
2590
- xn as E,
2591
- Wa as F,
2592
- Ra as N,
2593
- Fa as P,
2594
- Ia as T,
2595
- Ca as a,
2596
- Fe as b,
2597
- Xt as c,
2598
- za as d,
2599
- qa as e,
2600
- Aa as f,
2601
- Mt as g,
2602
- Nn as h,
2603
- $a as i,
2604
- Va as j,
2605
- Oa as k,
2606
- ya as l,
2607
- ue as m,
2608
- vn as n,
2609
- ca as o,
2610
- It as p,
2611
- en as q,
2612
- ka as r,
2613
- ct as s,
2614
- Ea as t,
2615
- bn as u,
2616
- mn as v,
2617
- kn as w,
2618
- Da as x,
2619
- Sn as y,
2620
- La as z
2621
- };
2622
- //# sourceMappingURL=chart-activitygridchart-CUGN9Xq9.js.map