@idux/charts-core 1.1.0 → 1.2.1

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.
package/dist/index.js CHANGED
@@ -1,13 +1,38 @@
1
- import { DataZoomComponent as e, GridComponent as t, LegendComponent as n, TitleComponent as r, TooltipComponent as i } from "echarts/components";
2
- import { LabelLayout as a, UniversalTransition as o } from "echarts/features";
3
- import { SVGRenderer as s } from "echarts/renderers";
4
- import { computed as c, defineComponent as l, getCurrentInstance as u, h as d, isVue2 as f, onBeforeUnmount as p, onBeforeUpdate as m, onMounted as ee, onUpdated as te, shallowRef as h, unref as g, watch as _, watchEffect as v } from "vue-demi";
5
- import { PictorialBarChart as y } from "echarts/charts";
6
- import { init as ne, registerTheme as b, use as x } from "echarts/core";
7
- import { cloneDeep as S, isBoolean as re, isEqual as C, isNil as ie } from "lodash-es";
1
+ import { DataZoomComponent as e, GridComponent as t, LegendComponent as n, MarkAreaComponent as r, MarkLineComponent as i, MarkPointComponent as a, TitleComponent as o, TooltipComponent as s } from "echarts/components";
2
+ import { LabelLayout as c, UniversalTransition as l } from "echarts/features";
3
+ import { SVGRenderer as u } from "echarts/renderers";
4
+ import { computed as d, defineComponent as f, getCurrentInstance as p, h as m, inject as ee, isVue2 as h, onBeforeUnmount as te, onBeforeUpdate as g, onMounted as ne, onUpdated as re, shallowRef as _, unref as v, watch as y, watchEffect as ie } from "vue-demi";
5
+ import { PictorialBarChart as b } from "echarts/charts";
6
+ import { init as ae, registerTheme as x, use as S } from "echarts/core";
7
+ import { cloneDeep as C, isBoolean as oe, isEqual as w, isNil as se } from "lodash-es";
8
+ // composables/tooltipTheme.ts
9
+ var ce = 0;
10
+ function le(e) {
11
+ let t = `ix-chart-tooltip-${++ce}`, n = "light", r = null, i = () => {
12
+ let i = e();
13
+ i && (i.dataset.ixChartTheme = n, r?.isConnected || (r = i.ownerDocument.querySelector(`.${t}`)), r && (r.dataset.ixChartTheme = n));
14
+ };
15
+ return {
16
+ prepare(e) {
17
+ if (!e.tooltip) return e;
18
+ let n = (e) => ({
19
+ ...e,
20
+ className: [e.className, t].filter(Boolean).join(" ")
21
+ });
22
+ return {
23
+ ...e,
24
+ tooltip: Array.isArray(e.tooltip) ? e.tooltip.map(n) : n(e.tooltip)
25
+ };
26
+ },
27
+ sync(e) {
28
+ n = e.getOption().darkMode === !0 ? "dark" : "light", i();
29
+ },
30
+ rendered: i
31
+ };
32
+ }
8
33
  // composables/useResizeObserver.ts
9
- function ae(e, t, n) {
10
- _([
34
+ function ue(e, t, n) {
35
+ y([
11
36
  e,
12
37
  t,
13
38
  n
@@ -18,36 +43,38 @@ function ae(e, t, n) {
18
43
  o = void 0, t.value === n && n.resize();
19
44
  }));
20
45
  };
21
- oe(e, s), a(() => {
22
- se(e, s), o !== void 0 && cancelAnimationFrame(o);
46
+ de(e, s), a(() => {
47
+ fe(e, s), o !== void 0 && cancelAnimationFrame(o);
23
48
  });
24
49
  });
25
50
  }
26
- var w = /* @__PURE__ */ new Map();
27
- function oe(e, t, n) {
51
+ var T = /* @__PURE__ */ new Map();
52
+ function de(e, t, n) {
28
53
  if (e && t) {
29
- if (w.has(e)) w.get(e).listeners.push(t);
54
+ if (T.has(e)) T.get(e).listeners.push(t);
30
55
  else {
31
56
  let r = [t], i = new ResizeObserver((e) => {
32
57
  e.forEach((e) => r.forEach((t) => t(e)));
33
58
  });
34
- i.observe(e, n), w.set(e, {
59
+ i.observe(e, n), T.set(e, {
35
60
  listeners: r,
36
61
  ro: i
37
62
  });
38
63
  }
39
64
  }
40
65
  }
41
- function se(e, t) {
42
- if (!e || !t || !w.has(e)) return;
43
- let { listeners: n, ro: r } = w.get(e), i = n.indexOf(t);
44
- i > -1 && (n.splice(i, 1), n.length === 0 && (r.disconnect(), w.delete(e)));
66
+ function fe(e, t) {
67
+ if (!e || !t || !T.has(e)) return;
68
+ let { listeners: n, ro: r } = T.get(e), i = n.indexOf(t);
69
+ i > -1 && (n.splice(i, 1), n.length === 0 && (r.disconnect(), T.delete(e)));
45
70
  }
71
+ // themes/token.ts
72
+ var pe = Symbol("CHART_THEME_TOKEN");
46
73
  // composables/useChart.ts
47
- x([y]);
48
- var T = { text: "加载中..." };
49
- function E(e, t) {
50
- let n = () => typeof t == "function" ? t() : t, r = h(), i = h(), a = h(), o = c(() => g(e).autoResize ?? !0), s = c(() => g(e).group), l = c(() => g(e).initOption), u = c(() => g(e).loading), d = c(() => g(e).setOptionOpts), f = c(() => g(e).theme ?? "seer"), m = [], y = (e, t) => {
74
+ S([b]);
75
+ var me = { text: "加载中..." };
76
+ function he(e, t) {
77
+ let n = () => typeof t == "function" ? t() : t, r = _(), i = _(), a = _(), o = d(() => v(e).autoResize ?? !0), s = d(() => v(e).group), c = d(() => v(e).initOption), l = d(() => v(e).loading), u = d(() => v(e).setOptionOpts), f = ee(pe, void 0), p = d(() => v(e).theme ?? v(f) ?? "seer"), m = [], h = (e, t) => {
51
78
  m = m.filter((n) => {
52
79
  let r = t.some(([e, t, r]) => e === n.name && t === n.handler && r === n.once);
53
80
  return r || e.off(n.name, n.wrapped), r;
@@ -63,45 +90,54 @@ function E(e, t) {
63
90
  wrapped: i
64
91
  }), e.on(t, i);
65
92
  });
66
- }, b = () => {
93
+ }, g = le(() => r.value), b = () => {
67
94
  let t = r.value;
68
95
  if (!t) return;
69
- let o = ne(t, f.value, l.value), s = g(e), { restOptions: c, events: u } = D(s, n(), !1);
70
- o.setOption(c, d.value), a.value = S(c), y(o, u);
71
- let p = s.onReady || n()?.ready;
72
- p && p(o), i.value = o;
96
+ let o = ae(t, p.value, c.value);
97
+ o.on("rendered", g.rendered);
98
+ let s = v(e), { restOptions: l, events: d } = E(s, n(), !1);
99
+ o.setOption(g.prepare(l), u.value), g.sync(o), a.value = C(l), h(o, d);
100
+ let f = s.onReady || n()?.ready;
101
+ f && f(o), i.value = o;
73
102
  }, x = () => {
74
103
  i.value && (i.value.dispose(), i.value = void 0, m = []);
75
104
  };
76
- return ee(() => b()), p(() => x()), te(() => {
77
- i.value && y(i.value, D(g(e), n(), !1).events);
78
- }), _(() => g(e), (e) => {
105
+ return ne(() => b()), te(() => x()), re(() => {
106
+ i.value && h(i.value, E(v(e), n(), !1).events);
107
+ }), y(() => v(e), (e) => {
79
108
  let t = i.value;
80
109
  if (!t) return;
81
- let { restOptions: r, events: o } = D(e, n(), !1);
82
- y(t, o), C(r, a.value) || (t.setOption(r, d.value), a.value = S(r));
83
- }, { deep: !0 }), _([() => S(f.value), () => S(l.value)], ([e, t], [n, r]) => {
84
- C(e, n) && C(t, r) || (x(), b());
85
- }), v(() => {
110
+ let { restOptions: r, events: o } = E(e, n(), !1);
111
+ h(t, o), w(r, a.value) || (t.setOption(g.prepare(r), u.value), r.darkMode === a.value?.darkMode ? g.rendered() : g.sync(t), a.value = C(r));
112
+ }, { deep: !0 }), y([() => C(p.value), () => C(c.value)], ([e, t], [n, r]) => {
113
+ w(e, n) && w(t, r) || (x(), b());
114
+ }), ie(() => {
86
115
  let e = s.value;
87
116
  i.value && (i.value.group = e ?? "");
88
- }), v(() => {
117
+ }), ie(() => {
89
118
  let e = i.value;
90
119
  if (!e) return;
91
- let t = u.value;
92
- t ? e.showLoading(re(t) ? T : {
93
- ...T,
94
- ...t
95
- }) : e.hideLoading();
96
- }), ae(r, i, o), {
120
+ let t = l.value;
121
+ if (t) {
122
+ let n = e.getOption().darkMode === !0 ? {
123
+ ...me,
124
+ textColor: "#F4F8FF",
125
+ maskColor: "rgba(10, 12, 15, 0.8)"
126
+ } : me;
127
+ e.showLoading(oe(t) ? n : {
128
+ ...n,
129
+ ...t
130
+ });
131
+ } else e.hideLoading();
132
+ }), ue(r, i, o), {
97
133
  containerRef: r,
98
134
  chartRef: i
99
135
  };
100
136
  }
101
- function ce(e) {
137
+ function ge(e) {
102
138
  return /^on[^a-z]/.test(e);
103
139
  }
104
- var le = [
140
+ var _e = [
105
141
  "class",
106
142
  "style",
107
143
  "autoResize",
@@ -112,11 +148,11 @@ var le = [
112
148
  "theme",
113
149
  "onReady"
114
150
  ];
115
- function D(e, t = {}, n = !0) {
151
+ function E(e, t = {}, n = !0) {
116
152
  let r = {}, i = [];
117
153
  return Object.keys(e).forEach((t) => {
118
- if (!le.includes(t)) {
119
- if (ce(t)) {
154
+ if (!_e.includes(t)) {
155
+ if (ge(t)) {
120
156
  if (n) return;
121
157
  let r = e[t];
122
158
  if (r) {
@@ -129,7 +165,7 @@ function D(e, t = {}, n = !0) {
129
165
  }
130
166
  } else r[t] = e[t];
131
167
  }
132
- }), f && !n && Object.keys(t).forEach((e) => {
168
+ }), h && !n && Object.keys(t).forEach((e) => {
133
169
  if (e === "ready" || e === "~ready") return;
134
170
  let n = t[e];
135
171
  if (n) {
@@ -145,164 +181,45 @@ function D(e, t = {}, n = !0) {
145
181
  events: i
146
182
  };
147
183
  }
148
- // composables/useTooltips.ts
149
- function O(e, t) {
150
- return `
151
- <div class="charts-tooltips">
152
- <div class="charts-tooltips-title">${e}</div>
153
- ${t.map((e) => `
154
- <div class="charts-tooltips-item">
155
- <span class="charts-tooltips-item-border" style="background: ${e.color}"></span>
156
- <span class="charts-tooltips-item-name">${e.name}</span>
157
- <span class="charts-tooltips-item-value">${e.value}</span>
158
- </div>`).join("")}
159
- </div>`;
160
- }
161
- // composables/useStripe.ts
162
- function k({ data: e = [], color: t = "", offset: n = [0, 0], rotate: r = -20, size: i = [2, 8] }) {
163
- return {
164
- name: "",
165
- data: e,
166
- type: "pictorialBar",
167
- symbolRotate: r,
168
- silent: !0,
169
- itemStyle: {
170
- color: t,
171
- opacity: 0
172
- },
173
- emphasis: { itemStyle: { opacity: 1 } },
174
- symbolRepeat: "fixed",
175
- symbolMargin: 2,
176
- symbol: "rect",
177
- symbolClip: !0,
178
- symbolSize: i,
179
- symbolPosition: "start",
180
- symbolOffset: n,
181
- z: 1,
182
- animationEasing: "elasticOut"
183
- };
184
- }
185
- function ue(e) {
186
- return {
187
- axisPointer: { lineStyle: { opacity: .6 } },
188
- formatter: function(t) {
189
- if (!t?.length) return "";
190
- let n = t[0].name;
191
- return O(n, t.filter((e) => !!e.seriesName).map((t) => ({
192
- name: t.seriesName,
193
- value: `${t.value} ${e}`,
194
- color: t.color
195
- })));
196
- }
197
- };
198
- }
199
- function de({ series: e, color: t, offset: n = [0, 0], rotate: r, size: i }) {
200
- return [{
201
- type: "bar",
202
- z: 0,
203
- ...e
204
- }, k({
205
- data: e.data,
206
- offset: n,
207
- color: t,
208
- rotate: r,
209
- size: i
210
- })];
211
- }
212
- function fe() {
213
- return { aria: {
214
- enabled: !0,
215
- decal: {
216
- show: !0,
217
- decals: [{
218
- color: "white",
219
- dashArrayX: [1, 0],
220
- dashArrayY: [6, 0],
221
- symbolSize: .5,
222
- rotation: Math.PI / 2
223
- }]
224
- }
225
- } };
226
- }
227
- // composables/useReactiveAttrs.ts
228
- var pe = {
229
- "auto-resize": "autoResize",
230
- "init-option": "initOption",
231
- "set-option-opts": "setOptionOpts"
232
- };
233
- function A(e) {
234
- let t = u()?.proxy, n = () => Object.fromEntries(Object.entries(f && t ? t.$attrs : e).map(([e, t]) => [pe[e] ?? e, t]));
235
- if (f && t) return c(n);
236
- let r = h(n());
237
- return m(() => {
238
- let e = n(), t = r.value;
239
- (Object.keys(t).length !== Object.keys(e).length || Object.keys(e).some((n) => !Object.is(t[n], e[n]))) && (r.value = e);
240
- }), r;
241
- }
242
- // utils/withChartProps.ts
243
- function j() {
244
- return (e) => e;
245
- }
246
- // components/Chart.ts
247
- var me = j()(l({
248
- name: "IxChart",
249
- inheritAttrs: !1,
250
- setup(e, t) {
251
- let { containerRef: n } = E(A(t.attrs), () => t.listeners ?? {});
252
- return { containerRef: n };
253
- },
254
- render() {
255
- let { class: e, style: t } = this.$attrs;
256
- return d("div", {
257
- ref: "containerRef",
258
- class: e,
259
- style: {
260
- width: "100%",
261
- height: "100%",
262
- ...t
263
- }
264
- });
265
- }
266
- }));
267
- // ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/util.js
268
- function M(e, t) {
269
- he(e) && (e = "100%");
270
- let n = P(e);
184
+ // ../../node_modules/.pnpm/@ctrl+tinycolor@4.3.0/node_modules/@ctrl/tinycolor/dist/module/util.js
185
+ function D(e, t) {
186
+ ve(e) && (e = "100%");
187
+ let n = k(e);
271
188
  return e = t === 360 ? parseFloat(e) : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (e = t === 360 ? (e < 0 ? e % t + t : e % t) / t : e % t / t, e);
272
189
  }
273
- function N(e) {
190
+ function O(e) {
274
191
  return Math.min(1, Math.max(0, e));
275
192
  }
276
- function he(e) {
277
- return typeof e == "string" && e.indexOf(".") !== -1 && !P(e) && parseFloat(e) === 1;
193
+ function ve(e) {
194
+ return typeof e == "string" && e.indexOf(".") !== -1 && !k(e) && parseFloat(e) === 1;
278
195
  }
279
- function P(e) {
196
+ function k(e) {
280
197
  return typeof e == "string" && e.indexOf("%") !== -1;
281
198
  }
282
- function F(e) {
283
- return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
199
+ function A(e) {
200
+ return e = typeof e == "string" && e.trim().endsWith("%") ? parseFloat(e) / 100 : parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
284
201
  }
285
- function ge(e) {
202
+ function ye(e) {
286
203
  return Number(e) <= 1 ? `${Number(e) * 100}%` : e;
287
204
  }
288
- function I(e) {
289
- if (typeof e != "number" || !(e <= 1)) return ge(e);
205
+ function j(e) {
206
+ if (typeof e != "number" || !(e <= 1)) return ye(e);
290
207
  let t = Math.min(100, Math.max(0, e * 100)) * 100;
291
208
  return (t >= 1e-6 ? Math.trunc(t) : parseInt(String(t), 10)) / 100;
292
209
  }
293
- function _e(e) {
210
+ function be(e) {
294
211
  return e.length === 1 ? "0" + e : String(e);
295
212
  }
296
- // ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/conversion.js
297
- function ve(e, t, n) {
213
+ // ../../node_modules/.pnpm/@ctrl+tinycolor@4.3.0/node_modules/@ctrl/tinycolor/dist/module/conversion.js
214
+ function xe(e, t, n) {
298
215
  return {
299
- r: M(e, 255) * 255,
300
- g: M(t, 255) * 255,
301
- b: M(n, 255) * 255
216
+ r: D(e, 255) * 255,
217
+ g: D(t, 255) * 255,
218
+ b: D(n, 255) * 255
302
219
  };
303
220
  }
304
- function L(e, t, n) {
305
- e = M(e, 255), t = M(t, 255), n = M(n, 255);
221
+ function M(e, t, n) {
222
+ e = D(e, 255), t = D(t, 255), n = D(n, 255);
306
223
  let r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o, s = (r + i) / 2;
307
224
  if (r === i) o = 0, a = 0;
308
225
  else {
@@ -324,15 +241,15 @@ function L(e, t, n) {
324
241
  l: s
325
242
  };
326
243
  }
327
- function R(e, t, n) {
244
+ function N(e, t, n) {
328
245
  return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
329
246
  }
330
- function ye(e, t, n) {
247
+ function Se(e, t, n) {
331
248
  let r, i, a;
332
- if (e = M(e, 360), t = M(t, 100), n = M(n, 100), t === 0) i = n, a = n, r = n;
249
+ if (e = D(e, 360), t = D(t, 100), n = D(n, 100), t === 0) i = n, a = n, r = n;
333
250
  else {
334
251
  let o = n < .5 ? n * (1 + t) : n + t - n * t, s = 2 * n - o;
335
- r = R(s, o, e + 1 / 3), i = R(s, o, e), a = R(s, o, e - 1 / 3);
252
+ r = N(s, o, e + 1 / 3), i = N(s, o, e), a = N(s, o, e - 1 / 3);
336
253
  }
337
254
  return {
338
255
  r: r * 255,
@@ -340,8 +257,8 @@ function ye(e, t, n) {
340
257
  b: a * 255
341
258
  };
342
259
  }
343
- function z(e, t, n) {
344
- e = M(e, 255), t = M(t, 255), n = M(n, 255);
260
+ function P(e, t, n) {
261
+ e = D(e, 255), t = D(t, 255), n = D(n, 255);
345
262
  let r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o = r, s = r - i, c = r === 0 ? 0 : s / r;
346
263
  if (r === i) a = 0;
347
264
  else {
@@ -362,8 +279,8 @@ function z(e, t, n) {
362
279
  v: o
363
280
  };
364
281
  }
365
- function be(e, t, n) {
366
- e = M(e, 360) * 6, t = M(t, 100), n = M(n, 100);
282
+ function Ce(e, t, n) {
283
+ e = D(e, 360) * 6, t = D(t, 100), n = D(n, 100);
367
284
  let r = Math.floor(e), i = e - r, a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), c = r % 6, l = [
368
285
  n,
369
286
  o,
@@ -392,25 +309,25 @@ function be(e, t, n) {
392
309
  b: d * 255
393
310
  };
394
311
  }
395
- function B(e) {
312
+ function F(e) {
396
313
  return e < 10 ? 48 + e : 87 + e;
397
314
  }
398
- function V(e) {
315
+ function I(e) {
399
316
  let t = Math.round(e);
400
- return t >= 0 && t <= 255 ? String.fromCharCode(B(t >> 4), B(t & 15)) : _e(t.toString(16));
317
+ return t >= 0 && t <= 255 ? String.fromCharCode(F(t >> 4), F(t & 15)) : be(t.toString(16));
401
318
  }
402
- function xe(e) {
403
- return V(parseFloat(e) * 255);
319
+ function we(e) {
320
+ return I(parseFloat(e) * 255);
404
321
  }
405
- function H(e, t, n, r) {
406
- let i = V(e), a = V(t), o = V(n);
322
+ function L(e, t, n, r) {
323
+ let i = I(e), a = I(t), o = I(n);
407
324
  return r && i.startsWith(i.charAt(1)) && a.startsWith(a.charAt(1)) && o.startsWith(o.charAt(1)) ? i.charAt(0) + a.charAt(0) + o.charAt(0) : i + a + o;
408
325
  }
409
- function Se(e, t, n, r, i) {
410
- let a = V(e), o = V(t), s = V(n), c = xe(r);
326
+ function Te(e, t, n, r, i) {
327
+ let a = I(e), o = I(t), s = I(n), c = we(r);
411
328
  return i && a.startsWith(a.charAt(1)) && o.startsWith(o.charAt(1)) && s.startsWith(s.charAt(1)) && c.startsWith(c.charAt(1)) ? a.charAt(0) + o.charAt(0) + s.charAt(0) + c.charAt(0) : a + o + s + c;
412
329
  }
413
- function Ce(e, t, n, r) {
330
+ function Ee(e, t, n, r) {
414
331
  let i = e / 100, a = t / 100, o = n / 100, s = r / 100;
415
332
  return {
416
333
  r: 255 * (1 - i) * (1 - s),
@@ -418,7 +335,7 @@ function Ce(e, t, n, r) {
418
335
  b: 255 * (1 - o) * (1 - s)
419
336
  };
420
337
  }
421
- function U(e, t, n) {
338
+ function R(e, t, n) {
422
339
  let r = 1 - e / 255, i = 1 - t / 255, a = 1 - n / 255, o = Math.min(r, i, a);
423
340
  return o === 1 ? (r = 0, i = 0, a = 0) : (r = (r - o) / (1 - o) * 100, i = (i - o) / (1 - o) * 100, a = (a - o) / (1 - o) * 100), o *= 100, {
424
341
  c: Math.round(r),
@@ -427,15 +344,102 @@ function U(e, t, n) {
427
344
  k: Math.round(o)
428
345
  };
429
346
  }
430
- function we(e) {
347
+ function De(e, t, n) {
348
+ let [r, i, a] = Me(B(e / 255), B(t / 255), B(n / 255)), o = Math.sqrt(i * i + a * a);
349
+ if (o <= 4e-6) return {
350
+ l: Math.min(1, r),
351
+ c: 0,
352
+ h: 0
353
+ };
354
+ let s = Math.atan2(a, i) * 180 / Math.PI;
355
+ return {
356
+ l: Math.min(1, r),
357
+ c: o,
358
+ h: s < 0 ? s + 360 : s
359
+ };
360
+ }
361
+ function Oe(e, t, n) {
362
+ if (e >= 1) return {
363
+ r: 255,
364
+ g: 255,
365
+ b: 255
366
+ };
367
+ if (e <= 0) return {
368
+ r: 0,
369
+ g: 0,
370
+ b: 0
371
+ };
372
+ let r = n * Math.PI / 180, i = Math.cos(r), a = Math.sin(r), o = Math.max(0, t), s = H(e, o * i, o * a);
373
+ return Ae(s) || (s = ke(e, o, i, a)), {
374
+ r: V(s[0]) * 255,
375
+ g: V(s[1]) * 255,
376
+ b: V(s[2]) * 255
377
+ };
378
+ }
379
+ function ke(e, t, n, r) {
380
+ let i = .02, a = 1e-4, o = je(H(e, t * n, t * r));
381
+ if (z(e, t * n, t * r, o) < i) return o;
382
+ let s = 0, c = t, l = !0;
383
+ for (; c - s > a;) {
384
+ let t = (s + c) / 2, u = H(e, t * n, t * r);
385
+ if (l && Ae(u)) {
386
+ s = t;
387
+ continue;
388
+ }
389
+ o = je(u);
390
+ let d = z(e, t * n, t * r, o);
391
+ if (d < i) {
392
+ if (i - d < a) break;
393
+ l = !1, s = t;
394
+ } else c = t;
395
+ }
396
+ return o;
397
+ }
398
+ function z(e, t, n, r) {
399
+ let [i, a, o] = Me(r[0], r[1], r[2]), s = e - i, c = t - a, l = n - o;
400
+ return Math.sqrt(s * s + c * c + l * l);
401
+ }
402
+ function Ae(e) {
403
+ return e[0] >= 0 && e[0] <= 1 && e[1] >= 0 && e[1] <= 1 && e[2] >= 0 && e[2] <= 1;
404
+ }
405
+ function je(e) {
406
+ return [
407
+ Math.min(1, Math.max(0, e[0])),
408
+ Math.min(1, Math.max(0, e[1])),
409
+ Math.min(1, Math.max(0, e[2]))
410
+ ];
411
+ }
412
+ function B(e) {
413
+ return e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
414
+ }
415
+ function V(e) {
416
+ return e <= .0031308 ? e * 12.92 : 1.055 * e ** (1 / 2.4) - .055;
417
+ }
418
+ function Me(e, t, n) {
419
+ let r = Math.cbrt(.41222146947076305 * e + .5363325372617348 * t + .05144599326750221 * n), i = Math.cbrt(.21190349581782522 * e + .6806995506452344 * t + .10739695353694056 * n), a = Math.cbrt(.08830245919005643 * e + .2817188391361215 * t + .6299787016738222 * n);
420
+ return [
421
+ .210454268309314 * r + .7936177747023054 * i - .0040720430116193 * a,
422
+ 1.9779985324311684 * r - 2.42859224204858 * i + .450593709617411 * a,
423
+ .0259040424655478 * r + .7827717124575296 * i - .8086757549230774 * a
424
+ ];
425
+ }
426
+ function H(e, t, n) {
427
+ let r = e + .3963377773761749 * t + .2158037573099136 * n, i = e - .1055613458156586 * t - .0638541728258133 * n, a = e - .0894841775298119 * t - 1.2914855480194092 * n, o = r * r * r, s = i * i * i, c = a * a * a;
428
+ return [
429
+ 4.076741636075958 * o - 3.3077115392580616 * s + .2309699031821043 * c,
430
+ -1.2684379732850317 * o + 2.6097573492876887 * s - .34131937600265727 * c,
431
+ -.004196076138675564 * o - .7034186179359363 * s + 1.7076146940746117 * c
432
+ ];
433
+ }
434
+ function Ne(e) {
431
435
  return {
432
436
  r: e >> 16,
433
437
  g: (e & 65280) >> 8,
434
438
  b: e & 255
435
439
  };
436
440
  }
437
- // ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js
438
- var W = {
441
+ // ../../node_modules/.pnpm/@ctrl+tinycolor@4.3.0/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js
442
+ var U = {
439
443
  aliceblue: "#f0f8ff",
440
444
  antiquewhite: "#faebd7",
441
445
  aqua: "#00ffff",
@@ -585,50 +589,81 @@ var W = {
585
589
  yellow: "#ffff00",
586
590
  yellowgreen: "#9acd32"
587
591
  };
588
- // ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/format-input.js
589
- function Te(e) {
592
+ // ../../node_modules/.pnpm/@ctrl+tinycolor@4.3.0/node_modules/@ctrl/tinycolor/dist/module/format-input.js
593
+ function Pe(e) {
590
594
  let t = {
591
595
  r: 0,
592
596
  g: 0,
593
597
  b: 0
594
- }, n = 1, r = !1, i = !1;
595
- if (typeof e == "string" && (e = Ee(e)), typeof e == "object") {
598
+ }, n = 1, r = !1, i = !1, a;
599
+ if (typeof e == "string" && (e = Re(e)), typeof e == "object") {
596
600
  if (X(e.r) && X(e.g) && X(e.b)) {
597
- t = ve(e.r, e.g, e.b), r = !0;
601
+ t = xe(e.r, e.g, e.b), r = !0;
598
602
  let { r: n } = e;
599
603
  i = typeof n != "number" && String(n).endsWith("%") ? "prgb" : "rgb";
600
604
  } else if (X(e.h) && X(e.s) && X(e.v)) {
601
- let n = I(e.s), a = I(e.v);
602
- t = be(e.h, n, a), r = !0, i = "hsv";
605
+ let n = j(e.s), a = j(e.v);
606
+ t = Ce(e.h, n, a), r = !0, i = "hsv";
603
607
  } else if (X(e.h) && X(e.s) && X(e.l)) {
604
- let n = I(e.s), a = I(e.l);
605
- t = ye(e.h, n, a), r = !0, i = "hsl";
606
- } else X(e.c) && X(e.m) && X(e.y) && X(e.k) && (t = Ce(e.c, e.m, e.y, e.k), r = !0, i = "cmyk");
608
+ let n = j(e.s), a = j(e.l);
609
+ t = Se(e.h, n, a), r = !0, i = "hsl";
610
+ } else if (X(e.l) && X(e.c) && X(e.h)) {
611
+ let n = Fe(e.l), o = Ie(e.c), s = Le(e.h);
612
+ Number.isFinite(n + o + s) && (a = {
613
+ l: n,
614
+ c: o,
615
+ h: s
616
+ }, t = Oe(n, o, s), r = !0, i = "oklch");
617
+ } else X(e.c) && X(e.m) && X(e.y) && X(e.k) && (t = Ee(e.c, e.m, e.y, e.k), r = !0, i = "cmyk");
607
618
  Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a);
608
619
  }
609
- return n = F(n), {
620
+ return n = A(n), {
610
621
  ok: r,
611
622
  format: e.format || i,
612
623
  r: Math.min(255, Math.max(t.r, 0)),
613
624
  g: Math.min(255, Math.max(t.g, 0)),
614
625
  b: Math.min(255, Math.max(t.b, 0)),
615
- a: n
626
+ a: n,
627
+ oklch: a
616
628
  };
617
629
  }
618
- var G = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)", K = "[\\s|\\(]+(" + G + ")[,|\\s]+(" + G + ")[,|\\s]+(" + G + ")\\s*\\)?", q = "[\\s|\\(]+(" + G + ")[,|\\s]+(" + G + ")[,|\\s]+(" + G + ")[,|\\s]+(" + G + ")\\s*\\)?", J = {
619
- CSS_UNIT: new RegExp(G),
620
- rgb: RegExp("rgb" + K),
621
- rgba: RegExp("rgba" + q),
622
- hsl: RegExp("hsl" + K),
623
- hsla: RegExp("hsla" + q),
624
- hsv: RegExp("hsv" + K),
625
- hsva: RegExp("hsva" + q),
626
- cmyk: RegExp("cmyk" + q)
630
+ function Fe(e) {
631
+ return O(typeof e == "number" ? e : W(e, 1, !1));
632
+ }
633
+ function Ie(e) {
634
+ return Math.max(0, typeof e == "number" ? e : W(e, .4, !1));
635
+ }
636
+ function Le(e) {
637
+ let t = (typeof e == "number" ? e : W(e, NaN, !0)) % 360;
638
+ return t < 0 ? t + 360 : Math.abs(t);
639
+ }
640
+ function W(e, t, n) {
641
+ let r = /^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)([a-z%]*)$/.exec(e.trim().toLowerCase());
642
+ return r ? G(Number(r[1]), r[2], t, n) : NaN;
643
+ }
644
+ function G(e, t, n, r) {
645
+ switch (t) {
646
+ case "": return e;
647
+ case "%": return r ? NaN : e / 100 * n;
648
+ case "deg": return r ? e : NaN;
649
+ case "grad": return r ? e * .9 : NaN;
650
+ case "rad": return r ? e * 180 / Math.PI : NaN;
651
+ case "turn": return r ? e * 360 : NaN;
652
+ default: return NaN;
653
+ }
654
+ }
655
+ var K = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)", q = "[\\s|\\(]+(" + K + ")[,|\\s]+(" + K + ")[,|\\s]+(" + K + ")(?:[,|\\s|/]+(" + K + "))?\\s*\\)?", J = {
656
+ CSS_UNIT: new RegExp(K),
657
+ rgb: RegExp("rgba?" + q),
658
+ hsl: RegExp("hsla?" + q),
659
+ hsv: RegExp("hsva?" + q),
660
+ cmyk: /* @__PURE__ */ RegExp("cmyk[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?")
627
661
  };
628
- function Ee(e) {
662
+ function Re(e) {
629
663
  if (e = e.trim().toLowerCase(), e.length === 0) return !1;
664
+ if (e.startsWith("oklch")) return ze(e);
630
665
  let t = !1;
631
- if (W[e]) e = W[e], t = !0;
666
+ if (U[e]) e = U[e], t = !0;
632
667
  else if (e === "transparent") return {
633
668
  r: 0,
634
669
  g: 0,
@@ -637,33 +672,33 @@ function Ee(e) {
637
672
  format: "name"
638
673
  };
639
674
  if (typeof e == "string" && e.length <= 9) {
640
- let n = De(e, t);
675
+ let n = Be(e, t);
641
676
  if (n) return n;
642
677
  }
643
678
  let n = J.rgb.exec(e);
644
- return n ? {
679
+ return n ? n[4] === void 0 ? {
645
680
  r: n[1],
646
681
  g: n[2],
647
682
  b: n[3]
648
- } : (n = J.rgba.exec(e), n ? {
683
+ } : {
649
684
  r: n[1],
650
685
  g: n[2],
651
686
  b: n[3],
652
687
  a: n[4]
653
- } : (n = J.hsl.exec(e), n ? {
688
+ } : (n = J.hsl.exec(e), n ? n[4] === void 0 ? {
654
689
  h: n[1],
655
690
  s: n[2],
656
691
  l: n[3]
657
- } : (n = J.hsla.exec(e), n ? {
692
+ } : {
658
693
  h: n[1],
659
694
  s: n[2],
660
695
  l: n[3],
661
696
  a: n[4]
662
- } : (n = J.hsv.exec(e), n ? {
697
+ } : (n = J.hsv.exec(e), n ? n[4] === void 0 ? {
663
698
  h: n[1],
664
699
  s: n[2],
665
700
  v: n[3]
666
- } : (n = J.hsva.exec(e), n ? {
701
+ } : {
667
702
  h: n[1],
668
703
  s: n[2],
669
704
  v: n[3],
@@ -673,9 +708,24 @@ function Ee(e) {
673
708
  m: n[2],
674
709
  y: n[3],
675
710
  k: n[4]
676
- } : !1))))));
711
+ } : !1)));
712
+ }
713
+ function ze(e) {
714
+ let t = /^oklch(?:\s*\(\s*|\s+)(?:none|([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(%?))[\s,]+(?:none|([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(%?))[\s,]+(?:none|([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(deg|grad|rad|turn)?)(?:(?:\s*[,/]\s*|\s+)(none|([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(%?)))?\s*\)?$/.exec(e);
715
+ if (!t) return !1;
716
+ let n = t[1] === void 0 ? 0 : G(Number(t[1]), t[2], 1, !1), r = t[3] === void 0 ? 0 : G(Number(t[3]), t[4], .4, !1), i = t[5] === void 0 ? 0 : G(Number(t[5]), t[6] ?? "", NaN, !0);
717
+ return t[7] === void 0 ? {
718
+ l: n,
719
+ c: r,
720
+ h: i
721
+ } : {
722
+ l: n,
723
+ c: r,
724
+ h: i,
725
+ a: t[8] === void 0 ? 0 : G(Number(t[8]), t[9], 1, !1)
726
+ };
677
727
  }
678
- function De(e, t) {
728
+ function Be(e, t) {
679
729
  let n = +!!e.startsWith("#"), r = e.length - n;
680
730
  if (r === 6 || r === 8) {
681
731
  let i = Y(e, n) * 16 + Y(e, n + 1), a = Y(e, n + 2) * 16 + Y(e, n + 3), o = Y(e, n + 4) * 16 + Y(e, n + 5);
@@ -719,19 +769,19 @@ function Y(e, t) {
719
769
  function X(e) {
720
770
  return typeof e == "number" ? !Number.isNaN(e) : e !== void 0 && J.CSS_UNIT.test(e);
721
771
  }
722
- // ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/index.js
723
- var Oe = class e {
772
+ // ../../node_modules/.pnpm/@ctrl+tinycolor@4.3.0/node_modules/@ctrl/tinycolor/dist/module/index.js
773
+ var Ve = class e {
724
774
  constructor(t = "", n = {}) {
725
775
  if (t instanceof e) return t;
726
- typeof t == "number" && (t = we(t)), this.originalInput = t;
727
- let r = Te(t);
776
+ typeof t == "number" && (t = Ne(t)), this.originalInput = t;
777
+ let r = Pe(t);
728
778
  this.originalInput = t, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = n.format ?? r.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = r.ok;
729
779
  }
730
- isDark() {
731
- return this.getBrightness() < 128;
780
+ isDark(e = 128) {
781
+ return this.getBrightness() < e;
732
782
  }
733
- isLight() {
734
- return !this.isDark();
783
+ isLight(e = 128) {
784
+ return !this.isDark(e);
735
785
  }
736
786
  getBrightness() {
737
787
  let e = this.toRgb();
@@ -745,14 +795,14 @@ var Oe = class e {
745
795
  return this.a;
746
796
  }
747
797
  setAlpha(e) {
748
- return this.a = F(e), this.roundA = Math.round(100 * this.a) / 100, this;
798
+ return this.a = A(e), this.roundA = Math.round(100 * this.a) / 100, this;
749
799
  }
750
800
  isMonochrome() {
751
801
  let { s: e } = this.toHsl();
752
802
  return e === 0;
753
803
  }
754
804
  toHsv() {
755
- let e = z(this.r, this.g, this.b);
805
+ let e = P(this.r, this.g, this.b);
756
806
  return {
757
807
  h: e.h * 360,
758
808
  s: e.s,
@@ -761,11 +811,11 @@ var Oe = class e {
761
811
  };
762
812
  }
763
813
  toHsvString() {
764
- let e = z(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.v * 100);
814
+ let e = P(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.v * 100);
765
815
  return this.a === 1 ? `hsv(${t}, ${n}%, ${r}%)` : `hsva(${t}, ${n}%, ${r}%, ${this.roundA})`;
766
816
  }
767
817
  toHsl() {
768
- let e = L(this.r, this.g, this.b);
818
+ let e = M(this.r, this.g, this.b);
769
819
  return {
770
820
  h: e.h * 360,
771
821
  s: e.s,
@@ -774,17 +824,42 @@ var Oe = class e {
774
824
  };
775
825
  }
776
826
  toHslString() {
777
- let e = L(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.l * 100);
827
+ let e = M(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.l * 100);
778
828
  return this.a === 1 ? `hsl(${t}, ${n}%, ${r}%)` : `hsla(${t}, ${n}%, ${r}%, ${this.roundA})`;
779
829
  }
830
+ toOklch() {
831
+ if (He(this.originalInput)) {
832
+ let e = Pe(this.originalInput);
833
+ if (e.oklch && Z(e.r) === this.r && Z(e.g) === this.g && Z(e.b) === this.b) {
834
+ let { l: t, c: n, h: r } = e.oklch;
835
+ return {
836
+ l: t,
837
+ c: n,
838
+ h: r,
839
+ a: this.a
840
+ };
841
+ }
842
+ }
843
+ let { l: e, c: t, h: n } = De(this.r, this.g, this.b);
844
+ return {
845
+ l: e,
846
+ c: t,
847
+ h: n,
848
+ a: this.a
849
+ };
850
+ }
851
+ toOklchString() {
852
+ let { l: e, c: t, h: n } = this.toOklch();
853
+ return `oklch(${Math.round(e * 1e5) / 1e3}% ${Math.round(t * 1e5) / 1e5} ${Math.round(n * 1e3) / 1e3 % 360}${this.a === 1 ? "" : ` / ${this.roundA}`})`;
854
+ }
780
855
  toHex(e = !1) {
781
- return H(this.r, this.g, this.b, e);
856
+ return L(this.r, this.g, this.b, e);
782
857
  }
783
858
  toHexString(e = !1) {
784
859
  return "#" + this.toHex(e);
785
860
  }
786
861
  toHex8(e = !1) {
787
- return Se(this.r, this.g, this.b, this.a, e);
862
+ return Te(this.r, this.g, this.b, this.a, e);
788
863
  }
789
864
  toHex8String(e = !1) {
790
865
  return "#" + this.toHex8(e);
@@ -805,7 +880,7 @@ var Oe = class e {
805
880
  return this.a === 1 ? `rgb(${e}, ${t}, ${n})` : `rgba(${e}, ${t}, ${n}, ${this.roundA})`;
806
881
  }
807
882
  toPercentageRgb() {
808
- let e = (e) => `${Math.round(M(e, 255) * 100)}%`;
883
+ let e = (e) => `${Math.round(D(e, 255) * 100)}%`;
809
884
  return {
810
885
  r: e(this.r),
811
886
  g: e(this.g),
@@ -813,21 +888,29 @@ var Oe = class e {
813
888
  a: this.a
814
889
  };
815
890
  }
891
+ toRgbRatio() {
892
+ return {
893
+ r: this.r / 255,
894
+ g: this.g / 255,
895
+ b: this.b / 255,
896
+ a: this.a
897
+ };
898
+ }
816
899
  toPercentageRgbString() {
817
- let e = (e) => Math.round(M(e, 255) * 100);
900
+ let e = (e) => Math.round(D(e, 255) * 100);
818
901
  return this.a === 1 ? `rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)` : `rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`;
819
902
  }
820
903
  toCmyk() {
821
- return { ...U(this.r, this.g, this.b) };
904
+ return { ...R(this.r, this.g, this.b) };
822
905
  }
823
906
  toCmykString() {
824
- let { c: e, m: t, y: n, k: r } = U(this.r, this.g, this.b);
907
+ let { c: e, m: t, y: n, k: r } = R(this.r, this.g, this.b);
825
908
  return `cmyk(${e}, ${t}, ${n}, ${r})`;
826
909
  }
827
910
  toName() {
828
911
  if (this.a === 0) return "transparent";
829
912
  if (this.a < 1) return !1;
830
- let e = "#" + H(this.r, this.g, this.b, !1), t = W;
913
+ let e = "#" + L(this.r, this.g, this.b, !1), t = U;
831
914
  for (let n in t) if (Object.prototype.hasOwnProperty.call(t, n) && t[n] === e) return n;
832
915
  return !1;
833
916
  }
@@ -835,7 +918,7 @@ var Oe = class e {
835
918
  let t = !!e;
836
919
  e ??= this.format;
837
920
  let n = !1, r = this.a < 1 && this.a >= 0;
838
- return !t && r && (e.startsWith("hex") || e === "name") ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), e === "cmyk" && (n = this.toCmykString()), n || this.toHexString());
921
+ return !t && r && typeof e == "string" && (e.startsWith("hex") || e === "name") ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), e === "oklch" && (n = this.toOklchString()), e === "cmyk" && (n = this.toCmykString()), n || this.toHexString());
839
922
  }
840
923
  toNumber() {
841
924
  return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
@@ -845,7 +928,7 @@ var Oe = class e {
845
928
  }
846
929
  lighten(t = 10) {
847
930
  let n = this.toHsl();
848
- return n.l += t / 100, n.l = N(n.l), new e(n);
931
+ return n.l += t / 100, n.l = O(n.l), new e(n);
849
932
  }
850
933
  brighten(t = 10) {
851
934
  let n = this.toRgb();
@@ -853,7 +936,7 @@ var Oe = class e {
853
936
  }
854
937
  darken(t = 10) {
855
938
  let n = this.toHsl();
856
- return n.l -= t / 100, n.l = N(n.l), new e(n);
939
+ return n.l -= t / 100, n.l = O(n.l), new e(n);
857
940
  }
858
941
  tint(e = 10) {
859
942
  return this.mix("white", e);
@@ -863,11 +946,11 @@ var Oe = class e {
863
946
  }
864
947
  desaturate(t = 10) {
865
948
  let n = this.toHsl();
866
- return n.s -= t / 100, n.s = N(n.s), new e(n);
949
+ return n.s -= t / 100, n.s = O(n.s), new e(n);
867
950
  }
868
951
  saturate(t = 10) {
869
952
  let n = this.toHsl();
870
- return n.s += t / 100, n.s = N(n.s), new e(n);
953
+ return n.s += t / 100, n.s = O(n.s), new e(n);
871
954
  }
872
955
  greyscale() {
873
956
  return this.desaturate(100);
@@ -947,7 +1030,146 @@ var Oe = class e {
947
1030
  let n = new e(t);
948
1031
  return this.format === "cmyk" || n.format === "cmyk" ? this.toCmykString() === n.toCmykString() : this.toRgbString() === n.toRgbString();
949
1032
  }
950
- }, Z = [
1033
+ };
1034
+ function Z(e) {
1035
+ return e < 1 ? Math.round(e) : e;
1036
+ }
1037
+ function He(e) {
1038
+ return typeof e == "string" ? e.length >= 11 && /^\s*oklch/i.test(e) : typeof e == "object" && "l" in e && "c" in e && "h" in e;
1039
+ }
1040
+ // composables/useTooltips.ts
1041
+ function Ue(e) {
1042
+ if (!e) return "";
1043
+ if (typeof e == "string") return e;
1044
+ if (!("colorStops" in e)) return "";
1045
+ let t = (e.colorStops ?? []).flatMap((e) => {
1046
+ let t = new Ve(e?.color ?? "");
1047
+ return t.isValid && t.getAlpha() > 0 ? [{
1048
+ color: e.color,
1049
+ alpha: t.getAlpha(),
1050
+ luminance: t.getLuminance()
1051
+ }] : [];
1052
+ });
1053
+ return t.sort((e, t) => t.alpha - e.alpha || e.luminance - t.luminance), t[0]?.color ?? "";
1054
+ }
1055
+ function We(e, t) {
1056
+ return `
1057
+ <div class="charts-tooltips">
1058
+ <div class="charts-tooltips-title">${e}</div>
1059
+ ${t.map((e) => `
1060
+ <div class="charts-tooltips-item">
1061
+ <span class="charts-tooltips-item-border" style="background: ${Ue(e.color)}"></span>
1062
+ <span class="charts-tooltips-item-name">${e.name}</span>
1063
+ <span class="charts-tooltips-item-value">${e.value}</span>
1064
+ </div>`).join("")}
1065
+ </div>`;
1066
+ }
1067
+ // composables/useStripe.ts
1068
+ function Ge({ data: e = [], color: t = "", offset: n = [0, 0], rotate: r = -20, size: i = [2, 8] }) {
1069
+ return {
1070
+ name: "",
1071
+ data: e,
1072
+ type: "pictorialBar",
1073
+ symbolRotate: r,
1074
+ silent: !0,
1075
+ itemStyle: {
1076
+ color: t,
1077
+ opacity: 0
1078
+ },
1079
+ emphasis: { itemStyle: { opacity: 1 } },
1080
+ symbolRepeat: "fixed",
1081
+ symbolMargin: 2,
1082
+ symbol: "rect",
1083
+ symbolClip: !0,
1084
+ symbolSize: i,
1085
+ symbolPosition: "start",
1086
+ symbolOffset: n,
1087
+ z: 1,
1088
+ animationEasing: "elasticOut"
1089
+ };
1090
+ }
1091
+ function Ke(e) {
1092
+ return {
1093
+ axisPointer: { lineStyle: { opacity: .6 } },
1094
+ formatter: function(t) {
1095
+ if (!t?.length) return "";
1096
+ let n = t[0].name;
1097
+ return We(n, t.filter((e) => !!e.seriesName).map((t) => ({
1098
+ name: t.seriesName,
1099
+ value: `${t.value} ${e}`,
1100
+ color: t.color
1101
+ })));
1102
+ }
1103
+ };
1104
+ }
1105
+ function qe({ series: e, color: t, offset: n = [0, 0], rotate: r, size: i }) {
1106
+ return [{
1107
+ type: "bar",
1108
+ z: 0,
1109
+ ...e
1110
+ }, Ge({
1111
+ data: e.data,
1112
+ offset: n,
1113
+ color: t,
1114
+ rotate: r,
1115
+ size: i
1116
+ })];
1117
+ }
1118
+ function Je() {
1119
+ return { aria: {
1120
+ enabled: !0,
1121
+ decal: {
1122
+ show: !0,
1123
+ decals: [{
1124
+ color: "white",
1125
+ dashArrayX: [1, 0],
1126
+ dashArrayY: [6, 0],
1127
+ symbolSize: .5,
1128
+ rotation: Math.PI / 2
1129
+ }]
1130
+ }
1131
+ } };
1132
+ }
1133
+ // composables/useReactiveAttrs.ts
1134
+ var Ye = {
1135
+ "auto-resize": "autoResize",
1136
+ "init-option": "initOption",
1137
+ "set-option-opts": "setOptionOpts"
1138
+ };
1139
+ function Q(e) {
1140
+ let t = p()?.proxy, n = () => Object.fromEntries(Object.entries(h && t ? t.$attrs : e).map(([e, t]) => [Ye[e] ?? e, t]));
1141
+ if (h && t) return d(n);
1142
+ let r = _(n());
1143
+ return g(() => {
1144
+ let e = n(), t = r.value;
1145
+ (Object.keys(t).length !== Object.keys(e).length || Object.keys(e).some((n) => !Object.is(t[n], e[n]))) && (r.value = e);
1146
+ }), r;
1147
+ }
1148
+ // utils/withChartProps.ts
1149
+ function Xe() {
1150
+ return (e) => e;
1151
+ }
1152
+ // components/Chart.ts
1153
+ var Ze = Xe()(f({
1154
+ name: "IxChart",
1155
+ inheritAttrs: !1,
1156
+ setup(e, t) {
1157
+ let { containerRef: n } = he(Q(t.attrs), () => t.listeners ?? {});
1158
+ return { containerRef: n };
1159
+ },
1160
+ render() {
1161
+ let { class: e, style: t } = this.$attrs;
1162
+ return m("div", {
1163
+ ref: "containerRef",
1164
+ class: e,
1165
+ style: {
1166
+ width: "100%",
1167
+ height: "100%",
1168
+ ...t
1169
+ }
1170
+ });
1171
+ }
1172
+ })), Qe = [
951
1173
  "#458FFF",
952
1174
  "#45D9A3",
953
1175
  "#FFC145",
@@ -959,7 +1181,7 @@ var Oe = class e {
959
1181
  "#F587B3",
960
1182
  "#8352CC",
961
1183
  "#65779B"
962
- ], ke = [
1184
+ ], $e = [
963
1185
  "#458FFF",
964
1186
  "#C8DEFF",
965
1187
  "#45D9A3",
@@ -982,7 +1204,7 @@ var Oe = class e {
982
1204
  "#FCDBE8",
983
1205
  "#65779B",
984
1206
  "#65779B"
985
- ], Ae = [
1207
+ ], et = [
986
1208
  "#8C1604",
987
1209
  "#DB4C35",
988
1210
  "#FF9245",
@@ -990,8 +1212,8 @@ var Oe = class e {
990
1212
  "#689FFF",
991
1213
  "#45D9A3",
992
1214
  "#99ACD1"
993
- ], Q = {
994
- color: Z,
1215
+ ], tt = {
1216
+ color: Qe,
995
1217
  textStyle: {
996
1218
  color: "#6F7785",
997
1219
  fontSize: "12px"
@@ -1044,6 +1266,7 @@ var Oe = class e {
1044
1266
  }
1045
1267
  },
1046
1268
  tooltip: {
1269
+ backgroundColor: "rgba(251, 253, 255, 0.88)",
1047
1270
  borderWidth: 0,
1048
1271
  padding: 12,
1049
1272
  textStyle: { color: "#2F3540" },
@@ -1058,12 +1281,12 @@ var Oe = class e {
1058
1281
  categoryAxis: {
1059
1282
  axisLine: {
1060
1283
  show: !0,
1061
- lineStyle: { color: "#EDF1F7" }
1284
+ lineStyle: { color: "#E1E5EB" }
1062
1285
  },
1063
1286
  axisTick: {
1064
1287
  show: !0,
1065
1288
  alignWithLabel: !0,
1066
- lineStyle: { color: "#EDF1F7" }
1289
+ lineStyle: { color: "#E1E5EB" }
1067
1290
  },
1068
1291
  axisLabel: { color: "#6F7785" },
1069
1292
  splitLine: { show: !1 },
@@ -1073,7 +1296,7 @@ var Oe = class e {
1073
1296
  axisLine: { show: !1 },
1074
1297
  axisTick: { show: !1 },
1075
1298
  axisLabel: { color: "#6F7785" },
1076
- splitLine: { lineStyle: { color: "#EDF1F7" } },
1299
+ splitLine: { lineStyle: { color: "#E1E5EB" } },
1077
1300
  splitArea: { show: !1 },
1078
1301
  nameTextStyle: {
1079
1302
  color: "#6F7785",
@@ -1088,36 +1311,39 @@ var Oe = class e {
1088
1311
  dataZoom: { height: 16 }
1089
1312
  };
1090
1313
  // utils/index.ts
1091
- function je(e) {
1092
- return !!(e && e.xAxis && e.xAxis.data);
1314
+ function nt(e) {
1315
+ return at(e?.xAxis).some((e) => e.type === "category" || e.type === "time" || e.type === void 0 && e.data !== void 0);
1093
1316
  }
1094
- function Me(e, t) {
1095
- return f ? {
1317
+ function rt(e, t) {
1318
+ return h ? {
1096
1319
  attrs: { ...e },
1097
1320
  on: { ...t }
1098
1321
  } : { ...e };
1099
1322
  }
1100
- function Ne(e) {
1323
+ function it(e) {
1101
1324
  return Object.entries(e).reduce((e, [t, n]) => (n !== void 0 && (e[t] = n), e), {});
1102
1325
  }
1103
- function Pe(e) {
1104
- return ie(e) ? [] : Array.isArray(e) ? e : [e];
1326
+ function at(e) {
1327
+ return se(e) ? [] : Array.isArray(e) ? e : [e];
1105
1328
  }
1106
- var Fe = (e, t) => new Oe(e).setAlpha(t).toRgbString();
1329
+ var ot = (e, t) => new Ve(e).setAlpha(t).toRgbString();
1107
1330
  function $(e, t) {
1108
- return x(t), b("seer", Q), e.install = (t) => {
1331
+ return S(t), x("seer", tt), e.install = (t) => {
1109
1332
  t.component(e.name, e);
1110
1333
  }, e;
1111
1334
  }
1112
1335
  // components/index.ts
1113
- var Ie = $(me, [
1336
+ var st = $(Ze, [
1114
1337
  e,
1115
1338
  n,
1116
1339
  t,
1117
- r,
1340
+ o,
1341
+ s,
1118
1342
  i,
1119
1343
  a,
1120
- o,
1121
- s
1344
+ r,
1345
+ c,
1346
+ l,
1347
+ u
1122
1348
  ]);
1123
- export { Ie as IxChart, Pe as convertArray, $ as createInstall, Ne as filterEmptyProps, Fe as getAlphaColor, je as isVertical, Me as mergeAttrs, Z as seerColors, ke as seerColorsForMore, Ae as seerColorsForRisk, Q as seerTheme, E as useChart, A as useReactiveAttrs, k as useStripe, fe as useStripeArea, de as useStripeBarSeries, ue as useStripeBarTooltip, O as useTooltipsFormatter, j as withChartProps };
1349
+ export { pe as CHART_THEME_TOKEN, st as IxChart, at as convertArray, $ as createInstall, it as filterEmptyProps, ot as getAlphaColor, Ue as getTooltipsColor, nt as isVertical, rt as mergeAttrs, Qe as seerColors, $e as seerColorsForMore, et as seerColorsForRisk, tt as seerTheme, he as useChart, Q as useReactiveAttrs, Ge as useStripe, Je as useStripeArea, qe as useStripeBarSeries, Ke as useStripeBarTooltip, We as useTooltipsFormatter, Xe as withChartProps };