@graphysdk/react-renderer 0.0.1-plugins.1 → 0.0.1-plugins.2
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/README.md +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +992 -947
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
import './index.css';
|
|
2
|
-
import { jsxs as g, jsx as o, Fragment as
|
|
3
|
-
import j, { clsx as
|
|
4
|
-
import
|
|
2
|
+
import { jsxs as g, jsx as o, Fragment as N } from "react/jsx-runtime";
|
|
3
|
+
import j, { clsx as q } from "clsx";
|
|
4
|
+
import $r, { useState as P, useEffect as _, useRef as F, useMemo as b, createContext as zr, useContext as ht, useCallback as gt, useId as ft, Fragment as pt, memo as Vr } from "react";
|
|
5
5
|
import { useStore as le } from "zustand";
|
|
6
|
-
import { isCompilerCachingEnabled as
|
|
7
|
-
import { u as
|
|
8
|
-
import { q as
|
|
9
|
-
import { useReducedMotion as
|
|
10
|
-
import { useShallow as
|
|
11
|
-
import { useFloating as Pe, offset as De, flip as Oe, shift as Be, autoUpdate as
|
|
12
|
-
import { Extension as
|
|
13
|
-
import { Bold as
|
|
6
|
+
import { isCompilerCachingEnabled as Wr, setCompilerCachingEnabled as qr, COMPILER_STAGE_KEYS as Le, buildTooltipContent as Xr, getDifferenceArrowDimensions as jr, LayoutCompiler as Yr, BORDER_PRESET_GRADIENTS as Ur, SetContentCaptionCommand as Kr, SetContentTitleCommand as Zr, SetContentSubtitleCommand as Jr, computeDirectLabelsLayout as Qr, getY as en, getX as tn, getMainAxisCoordinate as rn, getYMin as nn, getYMax as on, getXMin as sn, getXMax as an, RESTING_HOVER_STATE as ln, buildDataLabelsContent as cn, computeDifferenceArrow as dn, computeFreeformArrow as un, createSegmentYReader as hn, buildLayerYValueFormatter as gn, getSize as fn, isDefined as pn, getColor as mn, GROUP_VARIABLES as yn, formatLegends as vn, formatHeadline as bn, resolveHeadlinePlacement as xn } from "@graphysdk/viz-engine";
|
|
7
|
+
import { u as _e, c as kn, F as mt, D as I, a as ue, b as L, d as Q, r as Cn, T as Tn, e as Ee, f as G, g as yt, s as vt, h as bt, v as c, C as xt, i as kt, S as Ct, j as ee, t as C, k as Ne, l as Fe, m as wn, n as Tt, o as Sn, R as An, H as Ln, p as _n } from "./tooltip-body-Cp_va3oW.js";
|
|
8
|
+
import { q as ud, G as hd } from "./tooltip-body-Cp_va3oW.js";
|
|
9
|
+
import { useReducedMotion as En } from "motion/react";
|
|
10
|
+
import { useShallow as D } from "zustand/react/shallow";
|
|
11
|
+
import { useFloating as Pe, offset as De, flip as Oe, shift as Be, autoUpdate as Nn } from "@floating-ui/react-dom";
|
|
12
|
+
import { Extension as Fn } from "@tiptap/core";
|
|
13
|
+
import { Bold as wt } from "@tiptap/extension-bold";
|
|
14
14
|
import { Document as ke } from "@tiptap/extension-document";
|
|
15
|
-
import { HardBreak as
|
|
16
|
-
import { Heading as
|
|
17
|
-
import { Italic as
|
|
18
|
-
import { Link as
|
|
19
|
-
import { Text as
|
|
20
|
-
import { TextAlign as
|
|
21
|
-
import { TextStyle as
|
|
22
|
-
import { Underline as
|
|
23
|
-
import { UndoRedo as
|
|
24
|
-
import { Paragraph as
|
|
25
|
-
import { useEditorState as
|
|
26
|
-
import { Toolbar as
|
|
27
|
-
import { Tooltip as
|
|
28
|
-
import { createPortal as
|
|
29
|
-
import { assignInlineVars as
|
|
30
|
-
import { Popover as
|
|
31
|
-
import { HexColorPicker as
|
|
32
|
-
import { Menu as
|
|
33
|
-
import { Toggle as
|
|
34
|
-
import { getContrast as
|
|
35
|
-
typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.reactRenderer = "0.0.1-plugins.
|
|
36
|
-
var
|
|
37
|
-
const
|
|
38
|
-
const { compileBus: n } =
|
|
39
|
-
|
|
40
|
-
const { recordCompile:
|
|
41
|
-
return
|
|
15
|
+
import { HardBreak as St } from "@tiptap/extension-hard-break";
|
|
16
|
+
import { Heading as At } from "@tiptap/extension-heading";
|
|
17
|
+
import { Italic as Lt } from "@tiptap/extension-italic";
|
|
18
|
+
import { Link as _t } from "@tiptap/extension-link";
|
|
19
|
+
import { Text as Et } from "@tiptap/extension-text";
|
|
20
|
+
import { TextAlign as Nt } from "@tiptap/extension-text-align";
|
|
21
|
+
import { TextStyle as Ft, Color as Pt, FontFamily as Dt } from "@tiptap/extension-text-style";
|
|
22
|
+
import { Underline as Ot } from "@tiptap/extension-underline";
|
|
23
|
+
import { UndoRedo as Bt, Placeholder as It } from "@tiptap/extensions";
|
|
24
|
+
import { Paragraph as Pn } from "@tiptap/extension-paragraph";
|
|
25
|
+
import { useEditorState as Dn, EditorContent as On, useEditor as Bn } from "@tiptap/react";
|
|
26
|
+
import { Toolbar as S } from "@base-ui/react/toolbar";
|
|
27
|
+
import { Tooltip as W } from "@base-ui/react/tooltip";
|
|
28
|
+
import { createPortal as In } from "react-dom";
|
|
29
|
+
import { assignInlineVars as Rn } from "@vanilla-extract/dynamic";
|
|
30
|
+
import { Popover as A } from "@base-ui/react/popover";
|
|
31
|
+
import { HexColorPicker as Hn, HexColorInput as Mn } from "react-colorful";
|
|
32
|
+
import { Menu as E } from "@base-ui/react/menu";
|
|
33
|
+
import { Toggle as Gn } from "@base-ui/react/toggle";
|
|
34
|
+
import { getContrast as $n } from "color2k";
|
|
35
|
+
typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.reactRenderer = "0.0.1-plugins.2");
|
|
36
|
+
var zn = "drqe3u0", Vn = "drqe3u1", Wn = "drqe3u2", qn = "drqe3u3", oe = "drqe3u4", Xn = "drqe3u5", jn = "drqe3u6", Yn = "drqe3u7", me = "drqe3u8", Un = "drqe3u9", Kn = "drqe3ua", Zn = "drqe3ub", Jn = "drqe3uc", Qn = "drqe3ud", eo = "drqe3ue", to = "drqe3uf", ro = "drqe3ug", no = "drqe3uh", oo = "drqe3ui", Ve = { enabled: "drqe3uk drqe3uj", disabled: "drqe3ul drqe3uj" }, We = { ran: "drqe3un drqe3um", dim: "drqe3uo drqe3um" }, Rt = { ran: "drqe3uq drqe3up", cached: "drqe3ur drqe3up", untouched: "drqe3us drqe3up" };
|
|
37
|
+
const ad = ({ width: e = 380, style: t, className: r } = {}) => {
|
|
38
|
+
const { compileBus: n } = _e(), [s] = P(() => kn()), [i, l] = P(!1), [a, d] = P(Wr);
|
|
39
|
+
_(() => {
|
|
40
|
+
const { recordCompile: y } = s.getState(), m = n.getLastTrigger(), x = n.getLastCompile();
|
|
41
|
+
return m && x && y(m, x), n.subscribe(y);
|
|
42
42
|
}, [s, n]);
|
|
43
|
-
const u = le(s, (
|
|
44
|
-
d((
|
|
45
|
-
const
|
|
46
|
-
return
|
|
43
|
+
const u = le(s, (y) => y.lastCompile), h = le(s, (y) => y.history), p = n.getCacheStats(), f = u === null && h.length === 0, v = () => {
|
|
44
|
+
d((y) => {
|
|
45
|
+
const m = !y;
|
|
46
|
+
return qr(m), m;
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
|
-
return /* @__PURE__ */ g("div", { className: j(
|
|
50
|
-
/* @__PURE__ */ g("div", { className:
|
|
49
|
+
return /* @__PURE__ */ g("div", { className: j(Kn, r), style: { width: e, ...t }, children: [
|
|
50
|
+
/* @__PURE__ */ g("div", { className: zn, children: [
|
|
51
51
|
/* @__PURE__ */ g("div", { children: [
|
|
52
|
-
/* @__PURE__ */ o("div", { className:
|
|
53
|
-
/* @__PURE__ */ o("div", { className:
|
|
52
|
+
/* @__PURE__ */ o("div", { className: Vn, children: "compile cache" }),
|
|
53
|
+
/* @__PURE__ */ o("div", { className: eo, children: f ? "production: stats disabled" : u ? `last: ${u.label} · ${Ht(u.durationMs)}` : "awaiting first compile…" })
|
|
54
54
|
] }),
|
|
55
|
-
/* @__PURE__ */ o("button", { type: "button", onClick: () => l((
|
|
55
|
+
/* @__PURE__ */ o("button", { type: "button", onClick: () => l((y) => !y), className: to, children: i ? "▾" : "▴" })
|
|
56
56
|
] }),
|
|
57
|
-
!i && /* @__PURE__ */ g("div", { className:
|
|
57
|
+
!i && /* @__PURE__ */ g("div", { className: Zn, children: [
|
|
58
58
|
/* @__PURE__ */ g(
|
|
59
59
|
"button",
|
|
60
60
|
{
|
|
61
61
|
type: "button",
|
|
62
|
-
onClick:
|
|
62
|
+
onClick: v,
|
|
63
63
|
className: a ? Ve.enabled : Ve.disabled,
|
|
64
64
|
"aria-pressed": a,
|
|
65
65
|
children: [
|
|
@@ -68,26 +68,26 @@ const rd = ({ width: e = 380, style: t, className: r } = {}) => {
|
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
/* @__PURE__ */ o("span", { className:
|
|
71
|
+
/* @__PURE__ */ o("span", { className: ro, children: "next compile reflects this toggle" })
|
|
72
72
|
] }),
|
|
73
|
-
!i && !
|
|
74
|
-
/* @__PURE__ */ o(
|
|
75
|
-
/* @__PURE__ */ o(
|
|
73
|
+
!i && !f && /* @__PURE__ */ g(N, { children: [
|
|
74
|
+
/* @__PURE__ */ o(so, { delta: u?.stages, cumulative: p }),
|
|
75
|
+
/* @__PURE__ */ o(io, { entries: h })
|
|
76
76
|
] })
|
|
77
77
|
] });
|
|
78
|
-
},
|
|
79
|
-
/* @__PURE__ */ o("thead", { children: /* @__PURE__ */ g("tr", { className:
|
|
80
|
-
/* @__PURE__ */ o("th", { className:
|
|
78
|
+
}, so = ({ delta: e, cumulative: t }) => /* @__PURE__ */ g("table", { className: Wn, children: [
|
|
79
|
+
/* @__PURE__ */ o("thead", { children: /* @__PURE__ */ g("tr", { className: no, children: [
|
|
80
|
+
/* @__PURE__ */ o("th", { className: qn, children: "stage" }),
|
|
81
81
|
/* @__PURE__ */ o("th", { className: oe, children: "Δ miss" }),
|
|
82
82
|
/* @__PURE__ */ o("th", { className: oe, children: "Δ hit" }),
|
|
83
83
|
/* @__PURE__ */ o("th", { className: oe, children: "total miss" }),
|
|
84
84
|
/* @__PURE__ */ o("th", { className: oe, children: "total hit" })
|
|
85
85
|
] }) }),
|
|
86
|
-
/* @__PURE__ */ o("tbody", { children:
|
|
87
|
-
const n = e?.[r], s =
|
|
88
|
-
return /* @__PURE__ */ g("tr", { className:
|
|
89
|
-
/* @__PURE__ */ g("td", { className:
|
|
90
|
-
/* @__PURE__ */ o("span", { className:
|
|
86
|
+
/* @__PURE__ */ o("tbody", { children: Le.map((r) => {
|
|
87
|
+
const n = e?.[r], s = ao(n);
|
|
88
|
+
return /* @__PURE__ */ g("tr", { className: Jn, children: [
|
|
89
|
+
/* @__PURE__ */ g("td", { className: Xn, children: [
|
|
90
|
+
/* @__PURE__ */ o("span", { className: Rt[s], "aria-hidden": !0 }),
|
|
91
91
|
" ",
|
|
92
92
|
r
|
|
93
93
|
] }),
|
|
@@ -97,44 +97,44 @@ const rd = ({ width: e = 380, style: t, className: r } = {}) => {
|
|
|
97
97
|
/* @__PURE__ */ o("td", { className: me, children: t[r].hits })
|
|
98
98
|
] }, r);
|
|
99
99
|
}) })
|
|
100
|
-
] }),
|
|
101
|
-
/* @__PURE__ */ o("div", { className:
|
|
100
|
+
] }), io = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ g("div", { className: Qn, children: [
|
|
101
|
+
/* @__PURE__ */ o("div", { className: oo, children: "recent compiles" }),
|
|
102
102
|
e.map((t) => {
|
|
103
|
-
const r =
|
|
104
|
-
return /* @__PURE__ */ g("div", { className:
|
|
105
|
-
/* @__PURE__ */ o("span", { className:
|
|
106
|
-
/* @__PURE__ */ o("span", { className:
|
|
107
|
-
/* @__PURE__ */ g("span", { className:
|
|
103
|
+
const r = lo(t.stages, (i) => i.misses > 0), n = Le.length;
|
|
104
|
+
return /* @__PURE__ */ g("div", { className: jn, children: [
|
|
105
|
+
/* @__PURE__ */ o("span", { className: Rt[r === 0 ? "cached" : "ran"], "aria-hidden": !0 }),
|
|
106
|
+
/* @__PURE__ */ o("span", { className: Yn, title: t.label, children: t.label }),
|
|
107
|
+
/* @__PURE__ */ g("span", { className: Un, children: [
|
|
108
108
|
r,
|
|
109
109
|
"/",
|
|
110
110
|
n,
|
|
111
111
|
" ran · ",
|
|
112
|
-
|
|
112
|
+
Ht(t.durationMs)
|
|
113
113
|
] })
|
|
114
114
|
] }, t.id);
|
|
115
115
|
})
|
|
116
|
-
] }),
|
|
116
|
+
] }), ao = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", lo = (e, t) => {
|
|
117
117
|
let r = 0;
|
|
118
|
-
for (const n of
|
|
118
|
+
for (const n of Le)
|
|
119
119
|
t(e[n]) && (r += 1);
|
|
120
120
|
return r;
|
|
121
|
-
},
|
|
121
|
+
}, Ht = (e) => e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, co = {
|
|
122
122
|
small: 1.9,
|
|
123
123
|
medium: 2.3,
|
|
124
124
|
large: 2.6
|
|
125
|
-
},
|
|
125
|
+
}, uo = {
|
|
126
126
|
small: 1,
|
|
127
127
|
medium: 1,
|
|
128
128
|
large: 1.2
|
|
129
|
-
},
|
|
129
|
+
}, ho = I, Mt = mt.sm, go = 12, fo = 4, po = 4, mo = 12, yo = 4, vo = 2, Gt = 24;
|
|
130
130
|
function he(e) {
|
|
131
131
|
const { store: t } = ue();
|
|
132
132
|
return le(t, e);
|
|
133
133
|
}
|
|
134
|
-
const
|
|
135
|
-
const { cursorRef: t, subscribeCursorMove: r } = ue(), n = he((i) => i.isPointerInside), s =
|
|
136
|
-
return s.current = e,
|
|
137
|
-
},
|
|
134
|
+
const bo = (e) => {
|
|
135
|
+
const { cursorRef: t, subscribeCursorMove: r } = ue(), n = he((i) => i.isPointerInside), s = F(e);
|
|
136
|
+
return s.current = e, _(() => r(() => s.current?.()), [r]), { cursorRef: t, isInside: n };
|
|
137
|
+
}, xo = 16, ko = 8, Co = {
|
|
138
138
|
x: 0,
|
|
139
139
|
y: 0,
|
|
140
140
|
top: 0,
|
|
@@ -144,40 +144,40 @@ const po = (e) => {
|
|
|
144
144
|
width: 0,
|
|
145
145
|
height: 0,
|
|
146
146
|
toJSON: () => ({})
|
|
147
|
-
},
|
|
148
|
-
const e =
|
|
149
|
-
|
|
150
|
-
layers:
|
|
151
|
-
coordSystem:
|
|
152
|
-
scales:
|
|
153
|
-
guides:
|
|
154
|
-
numberFormat:
|
|
155
|
-
parsingLocale:
|
|
147
|
+
}, To = () => {
|
|
148
|
+
const e = L(
|
|
149
|
+
D((k) => ({
|
|
150
|
+
layers: k.layers,
|
|
151
|
+
coordSystem: k.coordSystem,
|
|
152
|
+
scales: k.scales,
|
|
153
|
+
guides: k.guides,
|
|
154
|
+
numberFormat: k.config.numberFormat,
|
|
155
|
+
parsingLocale: k.config.parsingLocale
|
|
156
156
|
}))
|
|
157
|
-
), { formattingLocale: t } =
|
|
158
|
-
}), { cursorRef: i, isInside: l } =
|
|
159
|
-
() =>
|
|
157
|
+
), { formattingLocale: t } = _e(), r = he((k) => k.hover), n = Q(), s = F(() => {
|
|
158
|
+
}), { cursorRef: i, isInside: l } = bo(() => s.current()), a = b(
|
|
159
|
+
() => Xr({ ...e, hover: r, formattingLocale: t }),
|
|
160
160
|
[e, r, t]
|
|
161
|
-
), d = a !== null && l, u =
|
|
161
|
+
), d = a !== null && l, u = b(
|
|
162
162
|
() => ({
|
|
163
163
|
getBoundingClientRect: () => {
|
|
164
|
-
const
|
|
165
|
-
return
|
|
164
|
+
const k = i.current;
|
|
165
|
+
return k === null ? Co : wo(k);
|
|
166
166
|
}
|
|
167
167
|
}),
|
|
168
168
|
[i]
|
|
169
|
-
), { refs: h, floatingStyles:
|
|
169
|
+
), { refs: h, floatingStyles: p, update: f } = Pe({
|
|
170
170
|
open: d,
|
|
171
171
|
placement: "right",
|
|
172
|
-
middleware: [De(
|
|
172
|
+
middleware: [De(xo), Oe(), Be({ padding: ko })],
|
|
173
173
|
elements: { reference: u }
|
|
174
174
|
});
|
|
175
|
-
if (s.current =
|
|
176
|
-
const
|
|
175
|
+
if (s.current = f, !d) return null;
|
|
176
|
+
const v = r.primary, y = v === null ? null : e.layers.find((k) => k.id === v.layerId) ?? null, m = y === null ? null : n(y, e.coordSystem), x = v !== null && y !== null && m?.renderTooltip ? m.renderTooltip({
|
|
177
177
|
content: a,
|
|
178
|
-
layer:
|
|
178
|
+
layer: y,
|
|
179
179
|
coordSystem: e.coordSystem,
|
|
180
|
-
primary:
|
|
180
|
+
primary: v,
|
|
181
181
|
group: r.group,
|
|
182
182
|
related: r.related
|
|
183
183
|
}) : null;
|
|
@@ -186,13 +186,13 @@ const po = (e) => {
|
|
|
186
186
|
{
|
|
187
187
|
ref: h.setFloating,
|
|
188
188
|
role: "tooltip",
|
|
189
|
-
className:
|
|
190
|
-
style:
|
|
189
|
+
className: Cn,
|
|
190
|
+
style: p,
|
|
191
191
|
"data-testid": "chart-tooltip",
|
|
192
|
-
children:
|
|
192
|
+
children: x ?? /* @__PURE__ */ o(Tn, { content: a })
|
|
193
193
|
}
|
|
194
194
|
);
|
|
195
|
-
},
|
|
195
|
+
}, wo = (e) => ({
|
|
196
196
|
x: e.clientX,
|
|
197
197
|
y: e.clientY,
|
|
198
198
|
top: e.clientY,
|
|
@@ -202,66 +202,66 @@ const po = (e) => {
|
|
|
202
202
|
width: 0,
|
|
203
203
|
height: 0,
|
|
204
204
|
toJSON: () => ({})
|
|
205
|
-
}), Ie =
|
|
205
|
+
}), Ie = Ee.sm, $t = I, zt = !1, se = 6, H = 10, So = (e, t) => (r) => {
|
|
206
206
|
if (!r.isVisible || r.ticks.length === 0) return 0;
|
|
207
207
|
const n = r.position === "top" || r.position === "bottom", s = r.ticks.map(
|
|
208
208
|
(a) => e.measureText(a.formattedLabel, {
|
|
209
|
-
family:
|
|
210
|
-
size:
|
|
209
|
+
family: $t,
|
|
210
|
+
size: G(Ie, t)
|
|
211
211
|
})
|
|
212
212
|
), i = r.labelMaxWidthPx ?? Number.POSITIVE_INFINITY;
|
|
213
213
|
if (n) {
|
|
214
214
|
if (r.labelRotation !== 0) {
|
|
215
215
|
const a = s.map((u) => u.width);
|
|
216
|
-
return qe(a, i) + 2 *
|
|
216
|
+
return qe(a, i) + 2 * H;
|
|
217
217
|
}
|
|
218
|
-
return Math.max(...s.map((a) => a.height)) +
|
|
218
|
+
return Math.max(...s.map((a) => a.height)) + H;
|
|
219
219
|
}
|
|
220
220
|
return qe(
|
|
221
221
|
s.map((a) => a.width),
|
|
222
222
|
i
|
|
223
|
-
) +
|
|
224
|
-
}, qe = (e, t) => Math.min(Math.max(...e), t),
|
|
225
|
-
const { labelLineHeight: s, labelFontWeight: i } =
|
|
223
|
+
) + H;
|
|
224
|
+
}, qe = (e, t) => Math.min(Math.max(...e), t), Ao = (e) => () => G(Ie, e), Lo = (e, t) => (r, n) => {
|
|
225
|
+
const { labelLineHeight: s, labelFontWeight: i } = jr(n, t);
|
|
226
226
|
return e.measureText(r, {
|
|
227
|
-
family:
|
|
227
|
+
family: I,
|
|
228
228
|
size: s,
|
|
229
229
|
weight: i
|
|
230
230
|
});
|
|
231
|
-
},
|
|
231
|
+
}, Vt = (e) => {
|
|
232
232
|
const { value: t, observationLabel: r, comparison: n, swatch: s, label: i } = e;
|
|
233
233
|
return [
|
|
234
234
|
{
|
|
235
235
|
role: "valueRow",
|
|
236
|
-
gap:
|
|
237
|
-
segments:
|
|
236
|
+
gap: po,
|
|
237
|
+
segments: ye([
|
|
238
238
|
ie("value", "value", t ?? "–"),
|
|
239
239
|
ie("observation", "label", r)
|
|
240
240
|
])
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
role: "trendRow",
|
|
244
|
-
gap:
|
|
245
|
-
ariaLabel: n === null ? void 0 :
|
|
246
|
-
segments:
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
gap: yo,
|
|
245
|
+
ariaLabel: n === null ? void 0 : Fo(n),
|
|
246
|
+
segments: ye([
|
|
247
|
+
Eo(n),
|
|
248
|
+
No(n),
|
|
249
249
|
ie("trendReference", "label", n?.reference ?? null)
|
|
250
250
|
])
|
|
251
251
|
},
|
|
252
252
|
{
|
|
253
253
|
role: "groupRow",
|
|
254
|
-
gap:
|
|
255
|
-
segments:
|
|
254
|
+
gap: fo,
|
|
255
|
+
segments: ye([_o(s), ie("label", "label", i)])
|
|
256
256
|
}
|
|
257
257
|
].filter((a) => a.segments.length > 0);
|
|
258
|
-
}, ie = (e, t, r) => r === null ? null : { kind: "text", textRole: e, fontRole: t, text: r },
|
|
258
|
+
}, ie = (e, t, r) => r === null ? null : { kind: "text", textRole: e, fontRole: t, text: r }, _o = (e) => e === null ? null : { kind: "swatch", swatch: e, size: go }, Eo = (e) => e === null ? null : { kind: "trendArrow", direction: e.direction, size: mo }, No = (e) => e === null ? null : {
|
|
259
259
|
kind: "text",
|
|
260
260
|
textRole: "trendPercentage",
|
|
261
261
|
fontRole: "label",
|
|
262
262
|
text: e.percentage,
|
|
263
263
|
trendDirection: e.direction
|
|
264
|
-
},
|
|
264
|
+
}, Fo = (e) => {
|
|
265
265
|
switch (e.direction) {
|
|
266
266
|
case "up":
|
|
267
267
|
return `Increased ${e.percentage} ${e.reference}`;
|
|
@@ -270,67 +270,67 @@ const po = (e) => {
|
|
|
270
270
|
case "flat":
|
|
271
271
|
return `No change ${e.reference}`;
|
|
272
272
|
}
|
|
273
|
-
},
|
|
274
|
-
const s =
|
|
273
|
+
}, ye = (e) => e.filter((t) => t !== null), Po = (e, t) => (r, n) => {
|
|
274
|
+
const s = Wt(r, n, e, t), i = qt(s.map((a) => a.width)), l = Math.max(0, s.length - 1) * Gt;
|
|
275
275
|
return {
|
|
276
276
|
width: i + l,
|
|
277
277
|
height: Math.max(0, ...s.map((a) => a.height))
|
|
278
278
|
};
|
|
279
|
-
},
|
|
279
|
+
}, Do = (e, t) => (r, n) => Wt(r, n, e, t).map((s) => s.width), Oo = (e, t) => (r, n) => {
|
|
280
280
|
const s = Ce("value", n, t);
|
|
281
|
-
return { width: e.measureText(r, s).width, height: s.size *
|
|
282
|
-
},
|
|
283
|
-
const r =
|
|
281
|
+
return { width: e.measureText(r, s).width, height: s.size * Mt };
|
|
282
|
+
}, Bo = (e, t) => {
|
|
283
|
+
const r = Po(e, t), n = Oo(e, t);
|
|
284
284
|
return (s, i) => s.kind === "perGroup" ? r(s, i) : n(s.value, i);
|
|
285
|
-
},
|
|
285
|
+
}, Wt = (e, t, r, n) => {
|
|
286
286
|
const s = {
|
|
287
287
|
value: Ce("value", t, n),
|
|
288
288
|
label: Ce("label", t, n)
|
|
289
|
-
}, i = (l) =>
|
|
289
|
+
}, i = (l) => Io(l, s, r);
|
|
290
290
|
return e.items.map((l) => {
|
|
291
|
-
const a =
|
|
291
|
+
const a = Vt(l).map(i), d = Math.max(0, a.length - 1) * vo;
|
|
292
292
|
return {
|
|
293
293
|
width: Math.max(0, ...a.map((u) => u.width)),
|
|
294
|
-
height:
|
|
294
|
+
height: qt(a.map((u) => u.height)) + d
|
|
295
295
|
};
|
|
296
296
|
});
|
|
297
|
-
},
|
|
297
|
+
}, Io = (e, t, r) => {
|
|
298
298
|
let n = 0, s = 0;
|
|
299
299
|
for (const i of e.segments)
|
|
300
300
|
if (i.kind === "text") {
|
|
301
301
|
const l = t[i.fontRole];
|
|
302
|
-
n += r.measureText(i.text, l).width, s = Math.max(s, l.size *
|
|
302
|
+
n += r.measureText(i.text, l).width, s = Math.max(s, l.size * Mt);
|
|
303
303
|
} else
|
|
304
304
|
n += i.size, s = Math.max(s, i.size);
|
|
305
305
|
return { width: n + Math.max(0, e.segments.length - 1) * e.gap, height: s };
|
|
306
306
|
}, Ce = (e, t, r) => {
|
|
307
|
-
const n = e === "value" ?
|
|
308
|
-
return { family:
|
|
309
|
-
},
|
|
310
|
-
const t =
|
|
311
|
-
return { fontSizePx: t, lineBoxHeight: t *
|
|
312
|
-
},
|
|
307
|
+
const n = e === "value" ? co[t] : uo[t];
|
|
308
|
+
return { family: ho, size: G(n, r) };
|
|
309
|
+
}, qt = (e) => e.reduce((t, r) => t + r, 0), Re = 12, Xt = 10, jt = 8, Ro = 8, Ho = 8, Mo = 2, Yt = 1, Ut = 2, Kt = 4, Zt = Ee.sm, Jt = mt.sm, Qt = I, er = 2 * (Ho + Yt), He = 2 * (Mo + Yt), Go = Ut * Kt, tr = (e) => {
|
|
310
|
+
const t = G(Zt, e);
|
|
311
|
+
return { fontSizePx: t, lineBoxHeight: t * Jt };
|
|
312
|
+
}, rr = (e) => e ? Xt : 0, $o = (e, t) => (r) => {
|
|
313
313
|
if (r.items.length === 0) return 0;
|
|
314
|
-
const { fontSizePx: n, lineBoxHeight: s } =
|
|
314
|
+
const { fontSizePx: n, lineBoxHeight: s } = tr(t), i = { family: Qt, size: n };
|
|
315
315
|
if (r.position === "top" || r.position === "bottom")
|
|
316
316
|
return Math.max(s, Re) + He;
|
|
317
317
|
const a = r.items.map((d) => {
|
|
318
|
-
const u = e.measureText(d.formattedLabel, i).width, h =
|
|
319
|
-
return h + (h > 0 ?
|
|
318
|
+
const u = e.measureText(d.formattedLabel, i).width, h = rr(d.visual.color);
|
|
319
|
+
return h + (h > 0 ? jt : 0) + u;
|
|
320
320
|
});
|
|
321
|
-
return Math.max(...a) +
|
|
322
|
-
},
|
|
323
|
-
family:
|
|
324
|
-
size:
|
|
325
|
-
}),
|
|
326
|
-
measureAxis:
|
|
327
|
-
measureAxisLabel:
|
|
328
|
-
measureLegend:
|
|
329
|
-
measureHeadline:
|
|
330
|
-
measureHeadlineItemWidths:
|
|
331
|
-
measureTickLabel:
|
|
332
|
-
measureDifferenceArrowLabel:
|
|
333
|
-
} : null, [e, t]),
|
|
321
|
+
return Math.max(...a) + er;
|
|
322
|
+
}, zo = (e, t) => (r) => e.measureText(r, {
|
|
323
|
+
family: $t,
|
|
324
|
+
size: G(Ie, t)
|
|
325
|
+
}), Vo = (e, t) => b(() => e ? {
|
|
326
|
+
measureAxis: So(e, t),
|
|
327
|
+
measureAxisLabel: Ao(t),
|
|
328
|
+
measureLegend: $o(e, t),
|
|
329
|
+
measureHeadline: Bo(e, t),
|
|
330
|
+
measureHeadlineItemWidths: Do(e, t),
|
|
331
|
+
measureTickLabel: zo(e, t),
|
|
332
|
+
measureDifferenceArrowLabel: Lo(e, t)
|
|
333
|
+
} : null, [e, t]), Wo = ({
|
|
334
334
|
measurer: e,
|
|
335
335
|
axes: t,
|
|
336
336
|
numberFormat: r,
|
|
@@ -342,8 +342,8 @@ const po = (e) => {
|
|
|
342
342
|
formattingLocale: d,
|
|
343
343
|
annotations: u,
|
|
344
344
|
coordSystem: h,
|
|
345
|
-
textScale:
|
|
346
|
-
}) =>
|
|
345
|
+
textScale: p
|
|
346
|
+
}) => b(() => e ? new Yr(e).compile({
|
|
347
347
|
axes: t,
|
|
348
348
|
numberFormat: r,
|
|
349
349
|
parsingLocale: n,
|
|
@@ -354,7 +354,7 @@ const po = (e) => {
|
|
|
354
354
|
formattingLocale: d,
|
|
355
355
|
annotations: u,
|
|
356
356
|
coordSystem: h,
|
|
357
|
-
textScale:
|
|
357
|
+
textScale: p
|
|
358
358
|
}) : null, [
|
|
359
359
|
t,
|
|
360
360
|
r,
|
|
@@ -366,19 +366,19 @@ const po = (e) => {
|
|
|
366
366
|
d,
|
|
367
367
|
u,
|
|
368
368
|
h,
|
|
369
|
-
|
|
369
|
+
p,
|
|
370
370
|
e
|
|
371
|
-
]),
|
|
371
|
+
]), Xe = "data-variant", nr = Pn.extend({
|
|
372
372
|
addAttributes() {
|
|
373
373
|
return {
|
|
374
374
|
variant: {
|
|
375
375
|
default: null,
|
|
376
|
-
parseHTML: (e) => e.getAttribute(
|
|
377
|
-
renderHTML: (e) => e.variant ? { [
|
|
376
|
+
parseHTML: (e) => e.getAttribute(Xe) ?? null,
|
|
377
|
+
renderHTML: (e) => e.variant ? { [Xe]: e.variant } : {}
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
}),
|
|
381
|
+
}), qo = Fn.create({
|
|
382
382
|
name: "preventBackspaceAcrossTitleBoundary",
|
|
383
383
|
addOptions() {
|
|
384
384
|
return { isTitleVisible: !0 };
|
|
@@ -394,28 +394,28 @@ const po = (e) => {
|
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
|
-
}),
|
|
397
|
+
}), Xo = ({
|
|
398
398
|
titlePlaceholder: e,
|
|
399
399
|
subtitlePlaceholder: t,
|
|
400
400
|
isTitleVisible: r,
|
|
401
401
|
isSubtitleVisible: n
|
|
402
402
|
}) => [
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
kt,
|
|
403
|
+
Yo({ isTitleVisible: r, isSubtitleVisible: n }),
|
|
404
|
+
nr,
|
|
405
|
+
Et,
|
|
406
|
+
Bt,
|
|
407
|
+
At.configure({ levels: [1, 2, 3] }),
|
|
409
408
|
wt,
|
|
410
|
-
Ft,
|
|
411
|
-
Et.configure({ types: ["heading", "paragraph"] }),
|
|
412
|
-
St.configure({ openOnClick: !1, autolink: !0 }),
|
|
413
409
|
Lt,
|
|
414
|
-
|
|
415
|
-
Nt,
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
410
|
+
Ot,
|
|
411
|
+
Nt.configure({ types: ["heading", "paragraph"] }),
|
|
412
|
+
_t.configure({ openOnClick: !1, autolink: !0 }),
|
|
413
|
+
Ft,
|
|
414
|
+
Pt,
|
|
415
|
+
Dt,
|
|
416
|
+
St,
|
|
417
|
+
qo.configure({ isTitleVisible: r }),
|
|
418
|
+
It.configure({
|
|
419
419
|
showOnlyCurrent: !1,
|
|
420
420
|
placeholder: ({ pos: s, editor: i }) => {
|
|
421
421
|
if (r && s === 0) return e;
|
|
@@ -423,56 +423,56 @@ const po = (e) => {
|
|
|
423
423
|
return n && s === l ? t : "";
|
|
424
424
|
}
|
|
425
425
|
})
|
|
426
|
-
],
|
|
426
|
+
], jo = ({ placeholder: e }) => [
|
|
427
427
|
ke,
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
kt,
|
|
428
|
+
nr,
|
|
429
|
+
Et,
|
|
430
|
+
Bt,
|
|
431
|
+
At.configure({ levels: [1, 2, 3] }),
|
|
433
432
|
wt,
|
|
434
|
-
Ft,
|
|
435
|
-
Et.configure({ types: ["heading", "paragraph"] }),
|
|
436
|
-
St.configure({ openOnClick: !1, autolink: !0 }),
|
|
437
433
|
Lt,
|
|
438
|
-
|
|
439
|
-
Nt,
|
|
440
|
-
|
|
441
|
-
|
|
434
|
+
Ot,
|
|
435
|
+
Nt.configure({ types: ["heading", "paragraph"] }),
|
|
436
|
+
_t.configure({ openOnClick: !1, autolink: !0 }),
|
|
437
|
+
Ft,
|
|
438
|
+
Pt,
|
|
439
|
+
Dt,
|
|
440
|
+
St,
|
|
441
|
+
It.configure({
|
|
442
442
|
showOnlyCurrent: !1,
|
|
443
443
|
placeholder: ({ pos: t }) => t === 0 ? e : ""
|
|
444
444
|
})
|
|
445
|
-
],
|
|
445
|
+
], Yo = ({
|
|
446
446
|
isTitleVisible: e,
|
|
447
447
|
isSubtitleVisible: t
|
|
448
|
-
}) => e && t ? ke.extend({ content: "block{2,}" }) : ke, T = (e, t) => `color-mix(in srgb, transparent, ${e} ${t * 100}%)`, ge = (e, t) => `hsl(from ${e} h s calc(l * ${1 - t}))`,
|
|
448
|
+
}) => e && t ? ke.extend({ content: "block{2,}" }) : ke, T = (e, t) => `color-mix(in srgb, transparent, ${e} ${t * 100}%)`, ge = (e, t) => `hsl(from ${e} h s calc(l * ${1 - t}))`, or = (e, t) => `hsl(from ${e} h s calc(l * ${1 + t}))`, Te = (e, t, r) => `color-mix(in srgb, ${e}, ${t} ${r * 100}%)`, Uo = (e) => /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e), Ko = (e) => e.length === 0 ? !1 : typeof CSS < "u" && typeof CSS.supports == "function" ? CSS.supports("color", e) : /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e), sr = {
|
|
449
449
|
elevationXs: "0 0 2px rgba(15, 15, 24, 0.12), 0 2px 2px rgba(14, 14, 52, 0.08)",
|
|
450
450
|
elevationSm: "0 0 4px rgba(15, 15, 24, 0.12), 0 4px 4px rgba(14, 14, 52, 0.08)",
|
|
451
451
|
elevationMd: "0 0 8px rgba(15, 15, 24, 0.12), 0 8px 8px rgba(14, 14, 52, 0.08)",
|
|
452
452
|
elevationLg: "0 0 16px rgba(15, 15, 24, 0.12), 0 16px 16px rgba(14, 14, 52, 0.08)"
|
|
453
|
-
},
|
|
453
|
+
}, ir = {
|
|
454
454
|
radiiXs: "4px",
|
|
455
455
|
radiiSm: "6px",
|
|
456
456
|
radiiMd: "8px",
|
|
457
457
|
radiiLg: "12px"
|
|
458
|
-
},
|
|
458
|
+
}, ar = {
|
|
459
459
|
zIndexToolbar: "10",
|
|
460
460
|
zIndexToolbarTooltip: "20",
|
|
461
461
|
zIndexToolbarPopover: "30"
|
|
462
|
-
},
|
|
463
|
-
spaceXxs:
|
|
462
|
+
}, Zo = 8, V = (e) => `${Zo * e}px`, lr = {
|
|
463
|
+
spaceXxs: V(0.25),
|
|
464
464
|
// space(0.25) → 2px
|
|
465
|
-
spaceXs:
|
|
465
|
+
spaceXs: V(0.5),
|
|
466
466
|
// space(0.5) → 4px
|
|
467
|
-
spaceSm:
|
|
467
|
+
spaceSm: V(0.75),
|
|
468
468
|
// space(0.75) → 6px
|
|
469
|
-
spaceMd:
|
|
469
|
+
spaceMd: V(1),
|
|
470
470
|
// space(1) → 8px
|
|
471
|
-
spaceLg:
|
|
471
|
+
spaceLg: V(1.5),
|
|
472
472
|
// space(1.5) → 12px
|
|
473
|
-
spaceXl:
|
|
473
|
+
spaceXl: V(2)
|
|
474
474
|
// space(2) → 16px
|
|
475
|
-
},
|
|
475
|
+
}, Jo = {
|
|
476
476
|
transparent: "transparent",
|
|
477
477
|
white: "#FFFFFF",
|
|
478
478
|
black: "#000000",
|
|
@@ -499,7 +499,7 @@ const po = (e) => {
|
|
|
499
499
|
purple50: "#7B56EA",
|
|
500
500
|
purple30: "#E093FE",
|
|
501
501
|
greyGradient80: "linear-gradient(to top, #222429, #31353f)"
|
|
502
|
-
},
|
|
502
|
+
}, Qo = {
|
|
503
503
|
textPrimary: c.grey0,
|
|
504
504
|
textSecondary: T(c.textPrimary, 0.8),
|
|
505
505
|
textDisabled: T(c.textPrimary, 0.5),
|
|
@@ -518,7 +518,7 @@ const po = (e) => {
|
|
|
518
518
|
raisedBackground: c.grey80,
|
|
519
519
|
overlayBackground: c.grey90,
|
|
520
520
|
overlayBorderGradient: c.greyGradient80
|
|
521
|
-
},
|
|
521
|
+
}, es = {
|
|
522
522
|
graphBackground: c.grey90,
|
|
523
523
|
gridLineColor: c.border10,
|
|
524
524
|
originLineColor: c.grey0,
|
|
@@ -563,7 +563,7 @@ const po = (e) => {
|
|
|
563
563
|
arrowAnnotationStickerOutlineColorInverse: "#1D2129",
|
|
564
564
|
annotationFrameBorderColor: c.blue60,
|
|
565
565
|
annotationMenuTriggerIconColor: c.white
|
|
566
|
-
},
|
|
566
|
+
}, ts = {
|
|
567
567
|
canvasDefault: "#FFFFFF",
|
|
568
568
|
canvasBlue: "#60a5fa",
|
|
569
569
|
canvasCyan: "#22d3ee",
|
|
@@ -575,19 +575,19 @@ const po = (e) => {
|
|
|
575
575
|
canvasPurple: "#a78bfa",
|
|
576
576
|
canvasGray: "#a8a29e",
|
|
577
577
|
canvasInverse: "#000000"
|
|
578
|
-
},
|
|
579
|
-
...
|
|
580
|
-
...
|
|
581
|
-
...rr,
|
|
582
|
-
...nr,
|
|
578
|
+
}, rs = {
|
|
579
|
+
...Jo,
|
|
580
|
+
...Qo,
|
|
583
581
|
...sr,
|
|
584
|
-
...
|
|
585
|
-
...
|
|
586
|
-
...
|
|
587
|
-
...
|
|
588
|
-
...
|
|
589
|
-
...
|
|
590
|
-
|
|
582
|
+
...ir,
|
|
583
|
+
...lr,
|
|
584
|
+
...ar,
|
|
585
|
+
...es,
|
|
586
|
+
...ts,
|
|
587
|
+
...bt,
|
|
588
|
+
...vt,
|
|
589
|
+
...yt
|
|
590
|
+
}, ns = {
|
|
591
591
|
transparent: "transparent",
|
|
592
592
|
white: "#FFFFFF",
|
|
593
593
|
black: "#000000",
|
|
@@ -614,7 +614,7 @@ const po = (e) => {
|
|
|
614
614
|
purple50: "#7B56EA",
|
|
615
615
|
purple30: "#E093FE",
|
|
616
616
|
greyGradient80: "linear-gradient(to top, #F0F0F1, #F9F9FF)"
|
|
617
|
-
},
|
|
617
|
+
}, os = {
|
|
618
618
|
textPrimary: c.black,
|
|
619
619
|
textSecondary: T(c.textPrimary, 0.6),
|
|
620
620
|
textDisabled: T(c.textPrimary, 0.5),
|
|
@@ -633,7 +633,7 @@ const po = (e) => {
|
|
|
633
633
|
raisedBackground: c.grey85,
|
|
634
634
|
overlayBackground: c.grey100,
|
|
635
635
|
overlayBorderGradient: c.border10
|
|
636
|
-
},
|
|
636
|
+
}, ss = {
|
|
637
637
|
graphBackground: c.grey100,
|
|
638
638
|
gridLineColor: c.border10,
|
|
639
639
|
originLineColor: c.grey0,
|
|
@@ -678,7 +678,7 @@ const po = (e) => {
|
|
|
678
678
|
arrowAnnotationStickerOutlineColorInverse: "#FFFFFF",
|
|
679
679
|
annotationFrameBorderColor: c.blue60,
|
|
680
680
|
annotationMenuTriggerIconColor: "#3d414c"
|
|
681
|
-
},
|
|
681
|
+
}, is = {
|
|
682
682
|
canvasDefault: "#000000",
|
|
683
683
|
canvasBlue: "#3b82f6",
|
|
684
684
|
canvasCyan: "#06b6d4",
|
|
@@ -690,76 +690,76 @@ const po = (e) => {
|
|
|
690
690
|
canvasPurple: "#8b5cf6",
|
|
691
691
|
canvasGray: "#78716c",
|
|
692
692
|
canvasInverse: "#ffffff"
|
|
693
|
-
},
|
|
694
|
-
...
|
|
695
|
-
...
|
|
696
|
-
...rr,
|
|
697
|
-
...nr,
|
|
693
|
+
}, as = {
|
|
694
|
+
...ns,
|
|
695
|
+
...os,
|
|
698
696
|
...sr,
|
|
699
|
-
...
|
|
700
|
-
...
|
|
701
|
-
...
|
|
702
|
-
...
|
|
703
|
-
...
|
|
704
|
-
...
|
|
705
|
-
|
|
697
|
+
...ir,
|
|
698
|
+
...lr,
|
|
699
|
+
...ar,
|
|
700
|
+
...ss,
|
|
701
|
+
...is,
|
|
702
|
+
...bt,
|
|
703
|
+
...vt,
|
|
704
|
+
...yt
|
|
705
|
+
}, ce = 0.1, ls = { light: 0.05, dark: 0.1 }, cs = (e, t) => {
|
|
706
706
|
switch (e.type) {
|
|
707
707
|
case "none":
|
|
708
708
|
return null;
|
|
709
709
|
case "solid":
|
|
710
710
|
return e.color;
|
|
711
711
|
case "tinted":
|
|
712
|
-
return
|
|
712
|
+
return hs(e.color, t);
|
|
713
713
|
case "gradient":
|
|
714
|
-
return
|
|
714
|
+
return gs(e.color, t);
|
|
715
715
|
case "preset":
|
|
716
|
-
return
|
|
716
|
+
return Ur[e.preset];
|
|
717
717
|
}
|
|
718
|
-
},
|
|
718
|
+
}, ds = (e) => e.type === "none" ? 0 : e.width, us = (e, t, r) => {
|
|
719
719
|
if (e.type === "solid")
|
|
720
720
|
return e.color;
|
|
721
721
|
if (e.type === "tinted")
|
|
722
|
-
return Te(r, e.color,
|
|
723
|
-
},
|
|
724
|
-
const n = e, s = t === "dark" ? ge(e, ce) :
|
|
722
|
+
return Te(r, e.color, ls[t]);
|
|
723
|
+
}, hs = (e, t) => t === "dark" ? ge(e, ce) : or(e, ce), gs = (e, t, r = 90) => {
|
|
724
|
+
const n = e, s = t === "dark" ? ge(e, ce) : or(e, ce);
|
|
725
725
|
return `linear-gradient(${r}deg, ${n} 0%, ${s} 100%)`;
|
|
726
726
|
};
|
|
727
|
-
var
|
|
728
|
-
const Me =
|
|
729
|
-
const e =
|
|
727
|
+
var fs = "bow4tg0", ps = "bow4tg1", ms = "bow4tg2", ys = "bow4tg3", vs = "_1ii3bsb0", bs = "_1ii3bsb1";
|
|
728
|
+
const Me = zr(null), Ge = () => {
|
|
729
|
+
const e = ht(Me);
|
|
730
730
|
if (!e) throw new Error("useThemeContext must be used inside a <ThemeProvider>.");
|
|
731
731
|
return e;
|
|
732
|
-
},
|
|
733
|
-
const s =
|
|
734
|
-
() => ({ ...e === "dark" ?
|
|
732
|
+
}, xs = ({ theme: e, themeOverrides: t = {}, appearance: r, children: n }) => {
|
|
733
|
+
const s = b(
|
|
734
|
+
() => ({ ...e === "dark" ? rs : as, ...t }),
|
|
735
735
|
[e, t]
|
|
736
|
-
), i =
|
|
736
|
+
), i = b(() => {
|
|
737
737
|
const a = {
|
|
738
738
|
[c.textScale]: String(r.textScale)
|
|
739
739
|
};
|
|
740
740
|
for (const [u, h] of Object.entries(t))
|
|
741
741
|
a[c[u]] = h;
|
|
742
|
-
const d =
|
|
743
|
-
return d !== void 0 && (a[c.graphBackground] = d),
|
|
744
|
-
}, [r.textScale, r.background, e, s.graphBackground, t]), l =
|
|
742
|
+
const d = us(r.background, e, s.graphBackground);
|
|
743
|
+
return d !== void 0 && (a[c.graphBackground] = d), Rn(a);
|
|
744
|
+
}, [r.textScale, r.background, e, s.graphBackground, t]), l = b(
|
|
745
745
|
() => ({
|
|
746
746
|
theme: e,
|
|
747
|
-
themeClass: e === "dark" ?
|
|
747
|
+
themeClass: e === "dark" ? bs : vs,
|
|
748
748
|
inlineVarsStyle: i,
|
|
749
749
|
themeValues: s
|
|
750
750
|
}),
|
|
751
751
|
[e, i, s]
|
|
752
752
|
);
|
|
753
753
|
return /* @__PURE__ */ o(Me.Provider, { value: l, children: n });
|
|
754
|
-
},
|
|
755
|
-
const n =
|
|
754
|
+
}, $ = ({ children: e, className: t, style: r }) => {
|
|
755
|
+
const n = ht(Me), s = n ? j(n.themeClass, ps) : void 0, i = n ? { ...n.inlineVarsStyle, ...r } : r;
|
|
756
756
|
return /* @__PURE__ */ o("div", { className: j(s, t), style: i, children: e });
|
|
757
|
-
},
|
|
758
|
-
var
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
),
|
|
762
|
-
const s =
|
|
757
|
+
}, ks = "graphy_root", z = () => typeof document > "u" ? null : document.getElementById(ks) ?? document.body;
|
|
758
|
+
var Cs = "yp3g0k0", Ts = "yp3g0k1", cr = "yp3g0k3", ws = "yp3g0k4", dr = "yp3g0k5", we = "yp3g0k6", Ss = "yp3g0k7", As = "yp3g0k8", ur = "yp3g0k9", Ls = "yp3g0ka", _s = "yp3g0kb", Es = "yp3g0kc", Ns = "yp3g0kd", Fs = "yp3g0ke";
|
|
759
|
+
const Ps = xt.map((e) => c[e]), Ds = Object.fromEntries(
|
|
760
|
+
xt.map((e) => [c[e], e])
|
|
761
|
+
), Os = ({ editor: e, currentColor: t, isOpen: r, onOpenChange: n }) => {
|
|
762
|
+
const s = Is(), i = gt(
|
|
763
763
|
(a) => {
|
|
764
764
|
e.chain().setColor(a).run();
|
|
765
765
|
},
|
|
@@ -767,29 +767,29 @@ const Ls = vt.map((e) => c[e]), _s = Object.fromEntries(
|
|
|
767
767
|
), l = (a) => {
|
|
768
768
|
e.chain().focus().setColor(a).run(), n(!1);
|
|
769
769
|
};
|
|
770
|
-
return /* @__PURE__ */ g(
|
|
770
|
+
return /* @__PURE__ */ g(A.Root, { open: r, onOpenChange: n, children: [
|
|
771
771
|
/* @__PURE__ */ o(
|
|
772
|
-
|
|
772
|
+
A.Trigger,
|
|
773
773
|
{
|
|
774
|
-
render: /* @__PURE__ */ o(
|
|
774
|
+
render: /* @__PURE__ */ o(S.Button, {}),
|
|
775
775
|
"aria-label": "Text color",
|
|
776
|
-
className:
|
|
776
|
+
className: Cs,
|
|
777
777
|
onMouseDown: (a) => a.preventDefault(),
|
|
778
|
-
children: /* @__PURE__ */ o("span", { className:
|
|
778
|
+
children: /* @__PURE__ */ o("span", { className: Ts, style: { background: t ?? "transparent" } })
|
|
779
779
|
}
|
|
780
780
|
),
|
|
781
|
-
/* @__PURE__ */ o(
|
|
781
|
+
/* @__PURE__ */ o(A.Portal, { container: z(), children: /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(A.Positioner, { sideOffset: 6, align: "start", className: cr, children: /* @__PURE__ */ g(A.Popup, { className: ws, onMouseDown: (a) => a.preventDefault(), children: [
|
|
782
782
|
/* @__PURE__ */ o(
|
|
783
|
-
|
|
783
|
+
je,
|
|
784
784
|
{
|
|
785
785
|
title: "Colors",
|
|
786
|
-
colors:
|
|
786
|
+
colors: Ps,
|
|
787
787
|
currentColor: t,
|
|
788
788
|
onPick: l
|
|
789
789
|
}
|
|
790
790
|
),
|
|
791
791
|
s.length > 0 && /* @__PURE__ */ o(
|
|
792
|
-
|
|
792
|
+
je,
|
|
793
793
|
{
|
|
794
794
|
title: "Chart colors",
|
|
795
795
|
colors: s,
|
|
@@ -797,60 +797,60 @@ const Ls = vt.map((e) => c[e]), _s = Object.fromEntries(
|
|
|
797
797
|
onPick: l
|
|
798
798
|
}
|
|
799
799
|
),
|
|
800
|
-
/* @__PURE__ */ o(
|
|
800
|
+
/* @__PURE__ */ o(Bs, { value: t ?? "#000000", onChange: i })
|
|
801
801
|
] }) }) }) })
|
|
802
802
|
] });
|
|
803
|
-
},
|
|
803
|
+
}, je = ({ title: e, colors: t, currentColor: r, onPick: n }) => /* @__PURE__ */ g("div", { className: dr, children: [
|
|
804
804
|
/* @__PURE__ */ o("div", { className: we, children: e }),
|
|
805
|
-
/* @__PURE__ */ o("div", { className:
|
|
805
|
+
/* @__PURE__ */ o("div", { className: Ss, children: t.map((s) => /* @__PURE__ */ o(
|
|
806
806
|
"button",
|
|
807
807
|
{
|
|
808
808
|
type: "button",
|
|
809
809
|
"aria-label": s,
|
|
810
|
-
className:
|
|
811
|
-
"data-active":
|
|
810
|
+
className: As,
|
|
811
|
+
"data-active": Hs(s, r),
|
|
812
812
|
onMouseDown: (i) => i.preventDefault(),
|
|
813
813
|
onClick: () => n(s),
|
|
814
|
-
children: /* @__PURE__ */ o("span", { className:
|
|
814
|
+
children: /* @__PURE__ */ o("span", { className: ur, style: hr(s) })
|
|
815
815
|
},
|
|
816
816
|
s
|
|
817
817
|
)) })
|
|
818
|
-
] }),
|
|
819
|
-
const [r, n] =
|
|
820
|
-
return /* @__PURE__ */ g(
|
|
821
|
-
/* @__PURE__ */ g("div", { className:
|
|
818
|
+
] }), Bs = ({ value: e, onChange: t }) => {
|
|
819
|
+
const [r, n] = P(!1), s = Ko(e) ? e : "#000000", i = Rs(s);
|
|
820
|
+
return /* @__PURE__ */ g(A.Root, { open: r, onOpenChange: n, children: [
|
|
821
|
+
/* @__PURE__ */ g("div", { className: dr, children: [
|
|
822
822
|
/* @__PURE__ */ o("div", { className: we, children: "Custom" }),
|
|
823
823
|
/* @__PURE__ */ g(
|
|
824
|
-
|
|
824
|
+
A.Trigger,
|
|
825
825
|
{
|
|
826
|
-
className:
|
|
826
|
+
className: Ls,
|
|
827
827
|
onMouseDown: (l) => l.preventDefault(),
|
|
828
828
|
"aria-label": "Pick custom color",
|
|
829
829
|
children: [
|
|
830
|
-
/* @__PURE__ */ o("span", { className:
|
|
831
|
-
/* @__PURE__ */ o("span", { className:
|
|
830
|
+
/* @__PURE__ */ o("span", { className: ur, style: hr(s) }),
|
|
831
|
+
/* @__PURE__ */ o("span", { className: _s, children: i })
|
|
832
832
|
]
|
|
833
833
|
}
|
|
834
834
|
)
|
|
835
835
|
] }),
|
|
836
|
-
/* @__PURE__ */ o(
|
|
836
|
+
/* @__PURE__ */ o(A.Portal, { container: z(), children: /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(A.Positioner, { side: "right", align: "start", sideOffset: 18, className: cr, children: /* @__PURE__ */ g(A.Popup, { className: Es, onMouseDown: (l) => l.preventDefault(), children: [
|
|
837
837
|
/* @__PURE__ */ o("div", { className: we, children: "Pick color" }),
|
|
838
|
-
/* @__PURE__ */ o(
|
|
838
|
+
/* @__PURE__ */ o(Hn, { color: i, onChange: t, className: Ns }),
|
|
839
839
|
/* @__PURE__ */ o(
|
|
840
|
-
|
|
840
|
+
Mn,
|
|
841
841
|
{
|
|
842
842
|
color: i,
|
|
843
843
|
onChange: t,
|
|
844
844
|
prefixed: !0,
|
|
845
|
-
className:
|
|
845
|
+
className: Fs,
|
|
846
846
|
onMouseDown: (l) => l.stopPropagation()
|
|
847
847
|
}
|
|
848
848
|
)
|
|
849
849
|
] }) }) }) })
|
|
850
850
|
] });
|
|
851
|
-
},
|
|
852
|
-
const e =
|
|
853
|
-
return
|
|
851
|
+
}, Is = () => {
|
|
852
|
+
const e = L((t) => t.scales.color);
|
|
853
|
+
return b(() => {
|
|
854
854
|
if (!e || e.kind !== "visual") return [];
|
|
855
855
|
const t = /* @__PURE__ */ new Set();
|
|
856
856
|
for (const r of e.domain) {
|
|
@@ -859,15 +859,15 @@ const Ls = vt.map((e) => c[e]), _s = Object.fromEntries(
|
|
|
859
859
|
}
|
|
860
860
|
return [...t];
|
|
861
861
|
}, [e]);
|
|
862
|
-
},
|
|
862
|
+
}, hr = (e) => ({
|
|
863
863
|
background: e,
|
|
864
864
|
border: `1px solid ${ge(e, 0.1)}`
|
|
865
|
-
}),
|
|
865
|
+
}), Rs = (e) => {
|
|
866
866
|
const { themeValues: t } = Ge();
|
|
867
|
-
if (
|
|
868
|
-
const r =
|
|
867
|
+
if (Uo(e)) return e.toUpperCase();
|
|
868
|
+
const r = Ds[e];
|
|
869
869
|
return r ? t[r].toUpperCase() : "#000000";
|
|
870
|
-
},
|
|
870
|
+
}, Hs = (e, t) => t === null ? !1 : e.toLowerCase() === t.toLowerCase(), Ms = {
|
|
871
871
|
xxs: 8,
|
|
872
872
|
xs: 12,
|
|
873
873
|
sm: 16,
|
|
@@ -875,13 +875,13 @@ const Ls = vt.map((e) => c[e]), _s = Object.fromEntries(
|
|
|
875
875
|
lg: 24,
|
|
876
876
|
xl: 36
|
|
877
877
|
};
|
|
878
|
-
var
|
|
879
|
-
const
|
|
880
|
-
const i =
|
|
878
|
+
var Gs = { primary: "asohov1 asohov0", secondary: "asohov2 asohov0" };
|
|
879
|
+
const R = ({ children: e, title: t, variant: r = "primary", size: n = "sm", ...s }) => {
|
|
880
|
+
const i = ft(), l = Ms[n];
|
|
881
881
|
return /* @__PURE__ */ g(
|
|
882
882
|
"svg",
|
|
883
883
|
{
|
|
884
|
-
className:
|
|
884
|
+
className: Gs[r],
|
|
885
885
|
"aria-labelledby": t ? i : void 0,
|
|
886
886
|
height: l,
|
|
887
887
|
width: l,
|
|
@@ -895,37 +895,37 @@ const I = ({ children: e, title: t, variant: r = "primary", size: n = "sm", ...s
|
|
|
895
895
|
]
|
|
896
896
|
}
|
|
897
897
|
);
|
|
898
|
-
},
|
|
899
|
-
{ id: "modern", label: "Modern", preview: "Aa", fontFamily:
|
|
900
|
-
{ id: "fresh", label: "Fresh", preview: "Aa", fontFamily:
|
|
901
|
-
{ id: "timeless", label: "Timeless", preview: "Aa", fontFamily:
|
|
902
|
-
{ id: "technical", label: "Technical", preview: "00", fontFamily:
|
|
903
|
-
{ id: "fineliner", label: "Fineliner", preview: "Aa", fontFamily:
|
|
904
|
-
{ id: "brand", label: "Brand", preview: "Aa", fontFamily:
|
|
905
|
-
],
|
|
906
|
-
var
|
|
907
|
-
const
|
|
908
|
-
const s =
|
|
898
|
+
}, gr = (e) => /* @__PURE__ */ o(R, { ...e, children: /* @__PURE__ */ o("g", { stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ o("path", { d: "m6 9 6 6 6-6" }) }) }), $s = "'Noto Serif', Georgia, 'Times New Roman', serif, 'Apple Color Emoji', 'NotoColorEmoji'", fr = `'Aeonik', 'Aeonik Fallback', ${I}`, zs = "'PT Mono', 'Courier New', monospace, 'Apple Color Emoji', 'NotoColorEmoji'", Vs = "'Intruding Cat', cursive, 'Apple Color Emoji', 'NotoColorEmoji'", Ws = `var(--brand-font-family), ${fr}`, Se = [
|
|
899
|
+
{ id: "modern", label: "Modern", preview: "Aa", fontFamily: I },
|
|
900
|
+
{ id: "fresh", label: "Fresh", preview: "Aa", fontFamily: fr },
|
|
901
|
+
{ id: "timeless", label: "Timeless", preview: "Aa", fontFamily: $s },
|
|
902
|
+
{ id: "technical", label: "Technical", preview: "00", fontFamily: zs },
|
|
903
|
+
{ id: "fineliner", label: "Fineliner", preview: "Aa", fontFamily: Vs },
|
|
904
|
+
{ id: "brand", label: "Brand", preview: "Aa", fontFamily: Ws }
|
|
905
|
+
], qs = (e) => e ? Se.find((t) => t.fontFamily === e) ?? null : null;
|
|
906
|
+
var pr = "_1qkyw7q0", mr = "_1qkyw7q1", yr = "_1qkyw7q3", vr = "_1qkyw7q4", br = "_1qkyw7q5";
|
|
907
|
+
const Xs = ({ editor: e, currentFontFamily: t, isOpen: r, onOpenChange: n }) => {
|
|
908
|
+
const s = qs(t) ?? Se[0], i = (l) => {
|
|
909
909
|
e.chain().focus().setFontFamily(l.fontFamily).run();
|
|
910
910
|
};
|
|
911
|
-
return /* @__PURE__ */ g(
|
|
911
|
+
return /* @__PURE__ */ g(E.Root, { open: r, onOpenChange: n, children: [
|
|
912
912
|
/* @__PURE__ */ g(
|
|
913
|
-
|
|
913
|
+
E.Trigger,
|
|
914
914
|
{
|
|
915
|
-
render: /* @__PURE__ */ o(
|
|
915
|
+
render: /* @__PURE__ */ o(S.Button, {}),
|
|
916
916
|
"aria-label": "Font family",
|
|
917
|
-
className:
|
|
917
|
+
className: pr,
|
|
918
918
|
onMouseDown: (l) => l.preventDefault(),
|
|
919
919
|
children: [
|
|
920
|
-
/* @__PURE__ */ o("span", { className:
|
|
921
|
-
/* @__PURE__ */ o(
|
|
920
|
+
/* @__PURE__ */ o("span", { className: mr, style: { fontFamily: s?.fontFamily }, children: s?.preview }),
|
|
921
|
+
/* @__PURE__ */ o(gr, { size: "sm" })
|
|
922
922
|
]
|
|
923
923
|
}
|
|
924
924
|
),
|
|
925
|
-
/* @__PURE__ */ o(
|
|
926
|
-
|
|
925
|
+
/* @__PURE__ */ o(E.Portal, { container: z(), children: /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(E.Positioner, { side: "bottom", align: "start", sideOffset: 6, className: yr, children: /* @__PURE__ */ o(E.Popup, { className: vr, onMouseDown: (l) => l.preventDefault(), children: Se.map((l) => /* @__PURE__ */ o(
|
|
926
|
+
E.Item,
|
|
927
927
|
{
|
|
928
|
-
className:
|
|
928
|
+
className: br,
|
|
929
929
|
"data-selected": l.id === s?.id,
|
|
930
930
|
onClick: () => i(l),
|
|
931
931
|
children: /* @__PURE__ */ o("span", { style: { fontFamily: l.fontFamily }, children: l.label })
|
|
@@ -933,40 +933,40 @@ const $s = ({ editor: e, currentFontFamily: t, isOpen: r, onOpenChange: n }) =>
|
|
|
933
933
|
l.id
|
|
934
934
|
)) }) }) }) })
|
|
935
935
|
] });
|
|
936
|
-
},
|
|
936
|
+
}, xr = { id: "text", label: "Text", previewFont: c.fontTextEditorBody }, Ye = [
|
|
937
937
|
{ id: "caption", label: "Caption", previewFont: c.fontTextEditorH6 },
|
|
938
|
-
|
|
938
|
+
xr,
|
|
939
939
|
{ id: "h3", label: "Heading 3", previewFont: c.fontTextEditorH3 },
|
|
940
940
|
{ id: "h2", label: "Heading 2", previewFont: c.fontTextEditorH2 },
|
|
941
941
|
{ id: "h1", label: "Heading 1", previewFont: c.fontTextEditorH1 }
|
|
942
|
-
],
|
|
943
|
-
const s =
|
|
944
|
-
return /* @__PURE__ */ g(
|
|
942
|
+
], js = ({ editor: e, activeStyle: t, isOpen: r, onOpenChange: n }) => {
|
|
943
|
+
const s = Ye.find((i) => i.id === t) ?? xr;
|
|
944
|
+
return /* @__PURE__ */ g(E.Root, { open: r, onOpenChange: n, children: [
|
|
945
945
|
/* @__PURE__ */ g(
|
|
946
|
-
|
|
946
|
+
E.Trigger,
|
|
947
947
|
{
|
|
948
|
-
render: /* @__PURE__ */ o(
|
|
948
|
+
render: /* @__PURE__ */ o(S.Button, {}),
|
|
949
949
|
"aria-label": "Text style",
|
|
950
|
-
className:
|
|
950
|
+
className: pr,
|
|
951
951
|
onMouseDown: (i) => i.preventDefault(),
|
|
952
952
|
children: [
|
|
953
|
-
/* @__PURE__ */ o("span", { className:
|
|
954
|
-
/* @__PURE__ */ o(
|
|
953
|
+
/* @__PURE__ */ o("span", { className: mr, children: s.label }),
|
|
954
|
+
/* @__PURE__ */ o(gr, { size: "sm" })
|
|
955
955
|
]
|
|
956
956
|
}
|
|
957
957
|
),
|
|
958
|
-
/* @__PURE__ */ o(
|
|
959
|
-
|
|
958
|
+
/* @__PURE__ */ o(E.Portal, { container: z(), children: /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(E.Positioner, { side: "bottom", align: "start", sideOffset: 6, className: yr, children: /* @__PURE__ */ o(E.Popup, { className: vr, onMouseDown: (i) => i.preventDefault(), children: Ye.map((i) => /* @__PURE__ */ o(
|
|
959
|
+
E.Item,
|
|
960
960
|
{
|
|
961
|
-
className:
|
|
961
|
+
className: br,
|
|
962
962
|
"data-selected": i.id === s.id,
|
|
963
|
-
onClick: () =>
|
|
964
|
-
children: /* @__PURE__ */ o(
|
|
963
|
+
onClick: () => Ys(e, i.id),
|
|
964
|
+
children: /* @__PURE__ */ o(Us, { font: i.previewFont, children: i.label })
|
|
965
965
|
},
|
|
966
966
|
i.id
|
|
967
967
|
)) }) }) }) })
|
|
968
968
|
] });
|
|
969
|
-
},
|
|
969
|
+
}, Ys = (e, t) => {
|
|
970
970
|
switch (t) {
|
|
971
971
|
case "caption": {
|
|
972
972
|
e.chain().focus().setNode("paragraph", { variant: "caption" }).run();
|
|
@@ -985,53 +985,53 @@ const $s = ({ editor: e, currentFontFamily: t, isOpen: r, onOpenChange: n }) =>
|
|
|
985
985
|
case "h3":
|
|
986
986
|
e.chain().focus().setHeading({ level: 3 }).run();
|
|
987
987
|
}
|
|
988
|
-
},
|
|
988
|
+
}, Us = ({ font: e, children: t }) => /* @__PURE__ */ o("span", { style: { font: e, margin: 0 }, children: t }), Ks = (e) => /* @__PURE__ */ o(R, { ...e, children: /* @__PURE__ */ o("g", { stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ o("path", { d: "M20 6 9 17l-5-5" }) }) }), Zs = (e) => /* @__PURE__ */ o(R, { ...e, children: /* @__PURE__ */ g("g", { stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
989
989
|
/* @__PURE__ */ o("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }),
|
|
990
990
|
/* @__PURE__ */ o("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" })
|
|
991
|
-
] }) }),
|
|
991
|
+
] }) }), Js = (e) => /* @__PURE__ */ o(R, { ...e, children: /* @__PURE__ */ g("g", { stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
992
992
|
/* @__PURE__ */ o("path", { d: "M18 6 6 18" }),
|
|
993
993
|
/* @__PURE__ */ o("path", { d: "m6 6 12 12" })
|
|
994
|
-
] }) }),
|
|
994
|
+
] }) }), Qs = (e) => !e.content || e.content.length === 0 ? !0 : e.content.every((t) => !t.content || t.content.length === 0), ei = (e) => {
|
|
995
995
|
const { $from: t } = e.state.selection, r = t.parent.textContent, n = t.parentOffset, s = t.start();
|
|
996
996
|
let i = n;
|
|
997
|
-
for (; i > 0 &&
|
|
997
|
+
for (; i > 0 && Ue(r[i - 1]); ) i -= 1;
|
|
998
998
|
let l = n;
|
|
999
|
-
for (; l < r.length &&
|
|
999
|
+
for (; l < r.length && Ue(r[l]); ) l += 1;
|
|
1000
1000
|
return { from: s + i, to: s + l };
|
|
1001
|
-
},
|
|
1002
|
-
var
|
|
1003
|
-
const
|
|
1004
|
-
const [i, l] =
|
|
1005
|
-
|
|
1001
|
+
}, Ue = (e) => e !== void 0 && /\S/.test(e);
|
|
1002
|
+
var ti = "b5kquu0", ri = "b5kquu1", ni = "b5kquu2", oi = "b5kquu3", Ke = "b5kquu4";
|
|
1003
|
+
const si = ({ editor: e, currentUrl: t, isActive: r, isOpen: n, onOpenChange: s }) => {
|
|
1004
|
+
const [i, l] = P(""), a = F(null);
|
|
1005
|
+
_(() => {
|
|
1006
1006
|
n && l(t ?? "");
|
|
1007
1007
|
}, [n, t]);
|
|
1008
1008
|
const d = () => {
|
|
1009
|
-
|
|
1009
|
+
ii(e, i), s(!1);
|
|
1010
1010
|
}, u = () => {
|
|
1011
1011
|
l(""), s(!1);
|
|
1012
|
-
}, h = (
|
|
1013
|
-
l(
|
|
1014
|
-
},
|
|
1015
|
-
|
|
1012
|
+
}, h = (f) => {
|
|
1013
|
+
l(f.target.value);
|
|
1014
|
+
}, p = (f) => {
|
|
1015
|
+
f.key === "Enter" && (f.preventDefault(), d());
|
|
1016
1016
|
};
|
|
1017
|
-
return /* @__PURE__ */ g(
|
|
1017
|
+
return /* @__PURE__ */ g(A.Root, { open: n, onOpenChange: s, children: [
|
|
1018
1018
|
/* @__PURE__ */ o(
|
|
1019
|
-
|
|
1019
|
+
A.Trigger,
|
|
1020
1020
|
{
|
|
1021
|
-
render: /* @__PURE__ */ o(
|
|
1021
|
+
render: /* @__PURE__ */ o(S.Button, {}),
|
|
1022
1022
|
"aria-label": "Link",
|
|
1023
1023
|
"data-active": r,
|
|
1024
|
-
className:
|
|
1025
|
-
onMouseDown: (
|
|
1026
|
-
children: /* @__PURE__ */ o(
|
|
1024
|
+
className: ti,
|
|
1025
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
1026
|
+
children: /* @__PURE__ */ o(Zs, {})
|
|
1027
1027
|
}
|
|
1028
1028
|
),
|
|
1029
|
-
/* @__PURE__ */ o(
|
|
1030
|
-
|
|
1029
|
+
/* @__PURE__ */ o(A.Portal, { container: z(), children: /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(A.Positioner, { sideOffset: 6, align: "end", className: ri, children: /* @__PURE__ */ g(
|
|
1030
|
+
A.Popup,
|
|
1031
1031
|
{
|
|
1032
|
-
className:
|
|
1032
|
+
className: ni,
|
|
1033
1033
|
initialFocus: a,
|
|
1034
|
-
onMouseDown: (
|
|
1034
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
1035
1035
|
children: [
|
|
1036
1036
|
/* @__PURE__ */ o(
|
|
1037
1037
|
"input",
|
|
@@ -1041,19 +1041,19 @@ const ti = ({ editor: e, currentUrl: t, isActive: r, isOpen: n, onOpenChange: s
|
|
|
1041
1041
|
value: i,
|
|
1042
1042
|
placeholder: "Type or paste a link...",
|
|
1043
1043
|
"aria-label": "Link URL",
|
|
1044
|
-
className:
|
|
1045
|
-
onMouseDown: (
|
|
1044
|
+
className: oi,
|
|
1045
|
+
onMouseDown: (f) => f.stopPropagation(),
|
|
1046
1046
|
onChange: h,
|
|
1047
|
-
onKeyDown:
|
|
1047
|
+
onKeyDown: p
|
|
1048
1048
|
}
|
|
1049
1049
|
),
|
|
1050
|
-
/* @__PURE__ */ o("button", { type: "button", "aria-label": "Cancel", className: Ke, onClick: u, children: /* @__PURE__ */ o(
|
|
1051
|
-
/* @__PURE__ */ o("button", { type: "button", "aria-label": "Apply link", className: Ke, onClick: d, children: /* @__PURE__ */ o(
|
|
1050
|
+
/* @__PURE__ */ o("button", { type: "button", "aria-label": "Cancel", className: Ke, onClick: u, children: /* @__PURE__ */ o(Js, {}) }),
|
|
1051
|
+
/* @__PURE__ */ o("button", { type: "button", "aria-label": "Apply link", className: Ke, onClick: d, children: /* @__PURE__ */ o(Ks, {}) })
|
|
1052
1052
|
]
|
|
1053
1053
|
}
|
|
1054
1054
|
) }) }) })
|
|
1055
1055
|
] });
|
|
1056
|
-
},
|
|
1056
|
+
}, ii = (e, t) => {
|
|
1057
1057
|
const r = t.trim(), { selection: n } = e.state;
|
|
1058
1058
|
if (!r) {
|
|
1059
1059
|
e.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
@@ -1067,68 +1067,68 @@ const ti = ({ editor: e, currentUrl: t, isActive: r, isOpen: n, onOpenChange: s
|
|
|
1067
1067
|
e.chain().focus().extendMarkRange("link").setLink({ href: r }).run();
|
|
1068
1068
|
return;
|
|
1069
1069
|
}
|
|
1070
|
-
const s =
|
|
1070
|
+
const s = ei(e);
|
|
1071
1071
|
e.chain().focus().setTextSelection(s).setLink({ href: r }).run();
|
|
1072
|
-
},
|
|
1072
|
+
}, ai = (e) => /* @__PURE__ */ o(R, { ...e, children: /* @__PURE__ */ g("g", { stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1073
1073
|
/* @__PURE__ */ o("path", { d: "M21 5H3" }),
|
|
1074
1074
|
/* @__PURE__ */ o("path", { d: "M17 12H7" }),
|
|
1075
1075
|
/* @__PURE__ */ o("path", { d: "M19 19H5" })
|
|
1076
|
-
] }) }),
|
|
1076
|
+
] }) }), li = (e) => /* @__PURE__ */ o(R, { ...e, children: /* @__PURE__ */ g("g", { stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1077
1077
|
/* @__PURE__ */ o("path", { d: "M21 5H3" }),
|
|
1078
1078
|
/* @__PURE__ */ o("path", { d: "M21 12H9" }),
|
|
1079
1079
|
/* @__PURE__ */ o("path", { d: "M21 19H7" })
|
|
1080
|
-
] }) }),
|
|
1080
|
+
] }) }), ci = (e) => /* @__PURE__ */ o(R, { ...e, children: /* @__PURE__ */ g("g", { stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1081
1081
|
/* @__PURE__ */ o("path", { d: "M21 5H3" }),
|
|
1082
1082
|
/* @__PURE__ */ o("path", { d: "M15 12H3" }),
|
|
1083
1083
|
/* @__PURE__ */ o("path", { d: "M17 19H3" })
|
|
1084
1084
|
] }) });
|
|
1085
|
-
var
|
|
1086
|
-
const
|
|
1085
|
+
var di = "k91gos0", ui = "k91gos1";
|
|
1086
|
+
const hi = 6, X = ({ label: e, isActive: t, onToggle: r, children: n }) => {
|
|
1087
1087
|
const s = (i) => i.preventDefault();
|
|
1088
|
-
return /* @__PURE__ */ g(
|
|
1088
|
+
return /* @__PURE__ */ g(W.Root, { children: [
|
|
1089
1089
|
/* @__PURE__ */ o(
|
|
1090
|
-
|
|
1090
|
+
W.Trigger,
|
|
1091
1091
|
{
|
|
1092
|
-
render: /* @__PURE__ */ o(
|
|
1092
|
+
render: /* @__PURE__ */ o(Gn, { render: /* @__PURE__ */ o(S.Button, {}), pressed: t, onPressedChange: () => r() }),
|
|
1093
1093
|
"aria-label": e,
|
|
1094
|
-
className:
|
|
1094
|
+
className: di,
|
|
1095
1095
|
onMouseDown: s,
|
|
1096
1096
|
children: n
|
|
1097
1097
|
}
|
|
1098
1098
|
),
|
|
1099
|
-
/* @__PURE__ */ o(
|
|
1099
|
+
/* @__PURE__ */ o(W.Portal, { container: z(), children: /* @__PURE__ */ o($, { children: /* @__PURE__ */ o(W.Positioner, { sideOffset: hi, children: /* @__PURE__ */ o(W.Popup, { className: ui, children: e }) }) }) })
|
|
1100
1100
|
] });
|
|
1101
|
-
},
|
|
1101
|
+
}, gi = ({ editor: e, activeAlignment: t = "left" }) => /* @__PURE__ */ g(N, { children: [
|
|
1102
1102
|
/* @__PURE__ */ o(
|
|
1103
|
-
|
|
1103
|
+
X,
|
|
1104
1104
|
{
|
|
1105
1105
|
label: "Align left",
|
|
1106
1106
|
isActive: t === "left",
|
|
1107
1107
|
onToggle: () => e.chain().focus().setTextAlign("left").run(),
|
|
1108
|
-
children: /* @__PURE__ */ o(
|
|
1108
|
+
children: /* @__PURE__ */ o(ci, {})
|
|
1109
1109
|
}
|
|
1110
1110
|
),
|
|
1111
1111
|
/* @__PURE__ */ o(
|
|
1112
|
-
|
|
1112
|
+
X,
|
|
1113
1113
|
{
|
|
1114
1114
|
label: "Align center",
|
|
1115
1115
|
isActive: t === "center",
|
|
1116
1116
|
onToggle: () => e.chain().focus().setTextAlign("center").run(),
|
|
1117
|
-
children: /* @__PURE__ */ o(
|
|
1117
|
+
children: /* @__PURE__ */ o(ai, {})
|
|
1118
1118
|
}
|
|
1119
1119
|
),
|
|
1120
1120
|
/* @__PURE__ */ o(
|
|
1121
|
-
|
|
1121
|
+
X,
|
|
1122
1122
|
{
|
|
1123
1123
|
label: "Align right",
|
|
1124
1124
|
isActive: t === "right",
|
|
1125
1125
|
onToggle: () => e.chain().focus().setTextAlign("right").run(),
|
|
1126
|
-
children: /* @__PURE__ */ o(
|
|
1126
|
+
children: /* @__PURE__ */ o(li, {})
|
|
1127
1127
|
}
|
|
1128
1128
|
)
|
|
1129
1129
|
] });
|
|
1130
|
-
var
|
|
1131
|
-
const
|
|
1130
|
+
var fi = "_1bp10ig0", J = "_1bp10ig1", ae = "_1bp10ig2";
|
|
1131
|
+
const pi = ({ editor: e }) => ({
|
|
1132
1132
|
isBold: e?.isActive("bold") ?? !1,
|
|
1133
1133
|
isItalic: e?.isActive("italic") ?? !1,
|
|
1134
1134
|
isUnderline: e?.isActive("underline") ?? !1,
|
|
@@ -1136,43 +1136,43 @@ const ui = ({ editor: e }) => ({
|
|
|
1136
1136
|
linkUrl: e?.getAttributes("link").href ?? null,
|
|
1137
1137
|
color: e?.getAttributes("textStyle").color ?? null,
|
|
1138
1138
|
fontFamily: e?.getAttributes("textStyle").fontFamily ?? null,
|
|
1139
|
-
fontSize:
|
|
1140
|
-
textAlign:
|
|
1141
|
-
}),
|
|
1142
|
-
const [t, r] =
|
|
1143
|
-
s(
|
|
1139
|
+
fontSize: mi(e),
|
|
1140
|
+
textAlign: yi(e)
|
|
1141
|
+
}), mi = (e) => e ? e.isActive("heading", { level: 1 }) ? "h1" : e.isActive("heading", { level: 2 }) ? "h2" : e.isActive("heading", { level: 3 }) ? "h3" : e.isActive("paragraph", { variant: "caption" }) ? "caption" : "text" : "text", yi = (e) => e ? e.isActive({ textAlign: "center" }) ? "center" : e.isActive({ textAlign: "right" }) ? "right" : "left" : "left", vi = 8, bi = 8, xi = ({ editor: e }) => {
|
|
1142
|
+
const [t, r] = P(!1), [n, s] = P(null), i = n !== null, l = (v) => (y) => {
|
|
1143
|
+
s(y ? v : null);
|
|
1144
1144
|
}, { refs: a, floatingStyles: d } = Pe({
|
|
1145
1145
|
placement: "top-start",
|
|
1146
1146
|
strategy: "fixed",
|
|
1147
|
-
middleware: [De(
|
|
1148
|
-
whileElementsMounted:
|
|
1149
|
-
}), u =
|
|
1147
|
+
middleware: [De(vi), Oe(), Be({ padding: bi })],
|
|
1148
|
+
whileElementsMounted: Nn
|
|
1149
|
+
}), u = F(null), h = Dn({
|
|
1150
1150
|
editor: e,
|
|
1151
|
-
selector:
|
|
1152
|
-
}),
|
|
1153
|
-
(
|
|
1154
|
-
u.current =
|
|
1151
|
+
selector: pi
|
|
1152
|
+
}), p = gt(
|
|
1153
|
+
(v) => {
|
|
1154
|
+
u.current = v, a.setFloating(v);
|
|
1155
1155
|
},
|
|
1156
1156
|
[a]
|
|
1157
1157
|
);
|
|
1158
|
-
if (
|
|
1158
|
+
if (_(() => {
|
|
1159
1159
|
e && a.setReference(e.view.dom);
|
|
1160
|
-
}, [e, a]),
|
|
1160
|
+
}, [e, a]), _(() => {
|
|
1161
1161
|
if (!e) return;
|
|
1162
|
-
const
|
|
1163
|
-
const { relatedTarget:
|
|
1164
|
-
!
|
|
1162
|
+
const v = () => r(!0), y = ({ event: m }) => {
|
|
1163
|
+
const { relatedTarget: x, currentTarget: k } = m, w = x instanceof Node && u.current?.contains(x), O = x instanceof Node && k instanceof Node && k.contains(x);
|
|
1164
|
+
!w && !O && r(!1);
|
|
1165
1165
|
};
|
|
1166
|
-
return e.on("focus",
|
|
1167
|
-
e.off("focus",
|
|
1166
|
+
return e.on("focus", v), e.on("blur", y), () => {
|
|
1167
|
+
e.off("focus", v), e.off("blur", y);
|
|
1168
1168
|
};
|
|
1169
1169
|
}, [e]), !e || !t && !i) return null;
|
|
1170
|
-
const
|
|
1171
|
-
return
|
|
1172
|
-
/* @__PURE__ */ o(
|
|
1173
|
-
/* @__PURE__ */ g(
|
|
1170
|
+
const f = z();
|
|
1171
|
+
return f ? In(
|
|
1172
|
+
/* @__PURE__ */ o($, { children: /* @__PURE__ */ o(W.Provider, { children: /* @__PURE__ */ g(S.Root, { ref: p, className: fi, style: d, children: [
|
|
1173
|
+
/* @__PURE__ */ g(S.Group, { className: J, children: [
|
|
1174
1174
|
/* @__PURE__ */ o(
|
|
1175
|
-
|
|
1175
|
+
Os,
|
|
1176
1176
|
{
|
|
1177
1177
|
editor: e,
|
|
1178
1178
|
currentColor: h?.color ?? null,
|
|
@@ -1181,7 +1181,7 @@ const ui = ({ editor: e }) => ({
|
|
|
1181
1181
|
}
|
|
1182
1182
|
),
|
|
1183
1183
|
/* @__PURE__ */ o(
|
|
1184
|
-
|
|
1184
|
+
Xs,
|
|
1185
1185
|
{
|
|
1186
1186
|
editor: e,
|
|
1187
1187
|
currentFontFamily: h?.fontFamily ?? null,
|
|
@@ -1190,9 +1190,9 @@ const ui = ({ editor: e }) => ({
|
|
|
1190
1190
|
}
|
|
1191
1191
|
)
|
|
1192
1192
|
] }),
|
|
1193
|
-
/* @__PURE__ */ o(
|
|
1194
|
-
/* @__PURE__ */ o(
|
|
1195
|
-
|
|
1193
|
+
/* @__PURE__ */ o(S.Separator, { className: ae }),
|
|
1194
|
+
/* @__PURE__ */ o(S.Group, { className: J, children: /* @__PURE__ */ o(
|
|
1195
|
+
js,
|
|
1196
1196
|
{
|
|
1197
1197
|
editor: e,
|
|
1198
1198
|
activeStyle: h?.fontSize ?? "text",
|
|
@@ -1200,10 +1200,10 @@ const ui = ({ editor: e }) => ({
|
|
|
1200
1200
|
onOpenChange: l("fontSize")
|
|
1201
1201
|
}
|
|
1202
1202
|
) }),
|
|
1203
|
-
/* @__PURE__ */ o(
|
|
1204
|
-
/* @__PURE__ */ g(
|
|
1203
|
+
/* @__PURE__ */ o(S.Separator, { className: ae }),
|
|
1204
|
+
/* @__PURE__ */ g(S.Group, { className: J, children: [
|
|
1205
1205
|
/* @__PURE__ */ o(
|
|
1206
|
-
|
|
1206
|
+
X,
|
|
1207
1207
|
{
|
|
1208
1208
|
label: "Bold",
|
|
1209
1209
|
isActive: h?.isBold ?? !1,
|
|
@@ -1212,7 +1212,7 @@ const ui = ({ editor: e }) => ({
|
|
|
1212
1212
|
}
|
|
1213
1213
|
),
|
|
1214
1214
|
/* @__PURE__ */ o(
|
|
1215
|
-
|
|
1215
|
+
X,
|
|
1216
1216
|
{
|
|
1217
1217
|
label: "Italic",
|
|
1218
1218
|
isActive: h?.isItalic ?? !1,
|
|
@@ -1221,7 +1221,7 @@ const ui = ({ editor: e }) => ({
|
|
|
1221
1221
|
}
|
|
1222
1222
|
),
|
|
1223
1223
|
/* @__PURE__ */ o(
|
|
1224
|
-
|
|
1224
|
+
X,
|
|
1225
1225
|
{
|
|
1226
1226
|
label: "Underline",
|
|
1227
1227
|
isActive: h?.isUnderline ?? !1,
|
|
@@ -1230,11 +1230,11 @@ const ui = ({ editor: e }) => ({
|
|
|
1230
1230
|
}
|
|
1231
1231
|
)
|
|
1232
1232
|
] }),
|
|
1233
|
-
/* @__PURE__ */ o(
|
|
1234
|
-
/* @__PURE__ */ o(
|
|
1235
|
-
/* @__PURE__ */ o(
|
|
1236
|
-
/* @__PURE__ */ o(
|
|
1237
|
-
|
|
1233
|
+
/* @__PURE__ */ o(S.Separator, { className: ae }),
|
|
1234
|
+
/* @__PURE__ */ o(S.Group, { className: J, children: /* @__PURE__ */ o(gi, { editor: e, activeAlignment: h?.textAlign }) }),
|
|
1235
|
+
/* @__PURE__ */ o(S.Separator, { className: ae }),
|
|
1236
|
+
/* @__PURE__ */ o(S.Group, { className: J, children: /* @__PURE__ */ o(
|
|
1237
|
+
si,
|
|
1238
1238
|
{
|
|
1239
1239
|
editor: e,
|
|
1240
1240
|
currentUrl: h?.linkUrl ?? null,
|
|
@@ -1244,19 +1244,19 @@ const ui = ({ editor: e }) => ({
|
|
|
1244
1244
|
}
|
|
1245
1245
|
) })
|
|
1246
1246
|
] }) }) }),
|
|
1247
|
-
|
|
1247
|
+
f
|
|
1248
1248
|
) : null;
|
|
1249
1249
|
};
|
|
1250
|
-
var
|
|
1251
|
-
const
|
|
1252
|
-
/* @__PURE__ */ o(
|
|
1253
|
-
/* @__PURE__ */ o(
|
|
1254
|
-
] }),
|
|
1255
|
-
const r =
|
|
1250
|
+
var ki = "_2ngohc0";
|
|
1251
|
+
const kr = ({ editor: e, ariaLabel: t }) => /* @__PURE__ */ g("div", { className: ki, children: [
|
|
1252
|
+
/* @__PURE__ */ o(xi, { editor: e }),
|
|
1253
|
+
/* @__PURE__ */ o(On, { editor: e, "aria-label": t })
|
|
1254
|
+
] }), Ci = (e, t) => {
|
|
1255
|
+
const r = F(e);
|
|
1256
1256
|
r.current = e;
|
|
1257
|
-
const n =
|
|
1257
|
+
const n = F(t);
|
|
1258
1258
|
n.current = t;
|
|
1259
|
-
const s =
|
|
1259
|
+
const s = F(null), i = F(null), l = b(() => {
|
|
1260
1260
|
const a = () => {
|
|
1261
1261
|
i.current !== null && (clearTimeout(i.current), i.current = null), s.current = null;
|
|
1262
1262
|
}, d = () => {
|
|
@@ -1272,43 +1272,43 @@ const yr = ({ editor: e, ariaLabel: t }) => /* @__PURE__ */ g("div", { className
|
|
|
1272
1272
|
s.current = h, i.current !== null && clearTimeout(i.current), i.current = setTimeout(d, n.current);
|
|
1273
1273
|
}, flush: d, cancel: a };
|
|
1274
1274
|
}, []);
|
|
1275
|
-
return
|
|
1275
|
+
return _(() => () => {
|
|
1276
1276
|
i.current !== null && clearTimeout(i.current);
|
|
1277
1277
|
}, []), l;
|
|
1278
|
-
},
|
|
1278
|
+
}, Ti = 200, Cr = ({
|
|
1279
1279
|
content: e,
|
|
1280
1280
|
extensions: t,
|
|
1281
1281
|
isEditable: r,
|
|
1282
1282
|
onUpdate: n,
|
|
1283
|
-
updateDebounceMs: s =
|
|
1283
|
+
updateDebounceMs: s = Ti
|
|
1284
1284
|
}) => {
|
|
1285
|
-
const i =
|
|
1285
|
+
const i = F(Ze(e)), l = F(!1), a = Ci((u) => {
|
|
1286
1286
|
l.current = !0, n?.(u);
|
|
1287
|
-
}, s), d =
|
|
1287
|
+
}, s), d = Bn({
|
|
1288
1288
|
extensions: t,
|
|
1289
1289
|
content: i.current,
|
|
1290
1290
|
editable: r,
|
|
1291
1291
|
immediatelyRender: !1,
|
|
1292
1292
|
onUpdate: ({ editor: u }) => a.run(u.getJSON())
|
|
1293
1293
|
});
|
|
1294
|
-
return
|
|
1294
|
+
return _(() => {
|
|
1295
1295
|
d?.setEditable(r);
|
|
1296
|
-
}, [d, r]),
|
|
1296
|
+
}, [d, r]), _(() => {
|
|
1297
1297
|
if (!d) return;
|
|
1298
1298
|
if (l.current) {
|
|
1299
1299
|
l.current = !1;
|
|
1300
1300
|
return;
|
|
1301
1301
|
}
|
|
1302
1302
|
const u = Ze(e), h = d.getJSON();
|
|
1303
|
-
|
|
1304
|
-
}, [d, e, a]),
|
|
1305
|
-
}, Ze = (e) => e === null ? { type: "doc", content: [] } : typeof e == "string" ? { type: "doc", content: [{ type: "paragraph", content: e ? [{ type: "text", text: e }] : [] }] } : e,
|
|
1303
|
+
wi(h, u) || (a.cancel(), d.commands.setContent(u, { emitUpdate: !1 }));
|
|
1304
|
+
}, [d, e, a]), _(() => () => a.flush(), [a]), d;
|
|
1305
|
+
}, Ze = (e) => e === null ? { type: "doc", content: [] } : typeof e == "string" ? { type: "doc", content: [{ type: "paragraph", content: e ? [{ type: "text", text: e }] : [] }] } : e, wi = (e, t) => JSON.stringify(e) === JSON.stringify(t), Si = /^(?:https?:|mailto:)/i, Tr = (e) => {
|
|
1306
1306
|
if (typeof e != "string") return !1;
|
|
1307
1307
|
const t = e.replace(/^[\x00-\x20]+/, "");
|
|
1308
|
-
return t.length === 0 ? !1 :
|
|
1308
|
+
return t.length === 0 ? !1 : Si.test(t);
|
|
1309
1309
|
};
|
|
1310
|
-
var
|
|
1311
|
-
const
|
|
1310
|
+
var Ai = "_1cocly40";
|
|
1311
|
+
const Li = {
|
|
1312
1312
|
modern: "'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif",
|
|
1313
1313
|
timeless: "'Noto Serif', Georgia, 'Times New Roman', serif",
|
|
1314
1314
|
fresh: "'Aeonik', 'Aeonik Fallback', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif",
|
|
@@ -1316,22 +1316,22 @@ const Ti = {
|
|
|
1316
1316
|
handwritten: "'Permanent Marker', cursive",
|
|
1317
1317
|
fineliner: "'Intruding Cat', cursive",
|
|
1318
1318
|
brand: "var(--brand-font-family), 'Aeonik', 'Inter', sans-serif"
|
|
1319
|
-
}, de = ({ content: e }) => /* @__PURE__ */ o(
|
|
1319
|
+
}, de = ({ content: e }) => /* @__PURE__ */ o(N, { children: wr(e.content ?? [e]) }), wr = (e) => e.map((t, r) => _i(t, r)), _i = (e, t) => {
|
|
1320
1320
|
if (e.type === "text")
|
|
1321
|
-
return
|
|
1321
|
+
return Ei(e, t);
|
|
1322
1322
|
if (e.type === "hardBreak" || e.type === "hard_break")
|
|
1323
1323
|
return /* @__PURE__ */ o("br", {}, t);
|
|
1324
|
-
const r = e.content ?
|
|
1324
|
+
const r = e.content ? wr(e.content) : null;
|
|
1325
1325
|
switch (e.type) {
|
|
1326
1326
|
case "doc":
|
|
1327
|
-
return /* @__PURE__ */ o(
|
|
1327
|
+
return /* @__PURE__ */ o(pt, { children: r }, t);
|
|
1328
1328
|
case "heading": {
|
|
1329
|
-
const n =
|
|
1330
|
-
return
|
|
1329
|
+
const n = Di(e.attrs?.level);
|
|
1330
|
+
return Oi(n, t, r, Qe(e.attrs));
|
|
1331
1331
|
}
|
|
1332
1332
|
case "paragraph": {
|
|
1333
|
-
const n =
|
|
1334
|
-
return /* @__PURE__ */ o("p", { "data-variant": n ?? void 0, style:
|
|
1333
|
+
const n = Y(e.attrs?.variant);
|
|
1334
|
+
return /* @__PURE__ */ o("p", { "data-variant": n ?? void 0, style: Sr(Qe(e.attrs)), children: r }, t);
|
|
1335
1335
|
}
|
|
1336
1336
|
case "blockquote":
|
|
1337
1337
|
return /* @__PURE__ */ o("blockquote", { children: r }, t);
|
|
@@ -1347,10 +1347,10 @@ const Ti = {
|
|
|
1347
1347
|
default:
|
|
1348
1348
|
return /* @__PURE__ */ o("span", { children: r }, t);
|
|
1349
1349
|
}
|
|
1350
|
-
},
|
|
1350
|
+
}, Ei = (e, t) => {
|
|
1351
1351
|
const r = e.text ?? "";
|
|
1352
|
-
return !e.marks || e.marks.length === 0 ? /* @__PURE__ */ o("span", { children: r }, t) : e.marks.reduceRight((n, s, i) =>
|
|
1353
|
-
},
|
|
1352
|
+
return !e.marks || e.marks.length === 0 ? /* @__PURE__ */ o("span", { children: r }, t) : e.marks.reduceRight((n, s, i) => Ni(s, n, `${t}-${i}`), r);
|
|
1353
|
+
}, Ni = (e, t, r) => {
|
|
1354
1354
|
switch (e.type) {
|
|
1355
1355
|
case "bold":
|
|
1356
1356
|
case "strong":
|
|
@@ -1367,30 +1367,30 @@ const Ti = {
|
|
|
1367
1367
|
case "code":
|
|
1368
1368
|
return /* @__PURE__ */ o("code", { children: t }, r);
|
|
1369
1369
|
case "link": {
|
|
1370
|
-
const n =
|
|
1371
|
-
return
|
|
1370
|
+
const n = Y(e.attrs?.href);
|
|
1371
|
+
return Tr(n) ? /* @__PURE__ */ o("a", { className: Ai, href: n, rel: "noopener noreferrer", target: "_blank", children: t }, r) : /* @__PURE__ */ o("span", { children: t }, r);
|
|
1372
1372
|
}
|
|
1373
1373
|
case "textStyle": {
|
|
1374
|
-
const n =
|
|
1374
|
+
const n = Fi(e.attrs);
|
|
1375
1375
|
return n ? /* @__PURE__ */ o("span", { style: n, children: t }, r) : /* @__PURE__ */ o("span", { children: t }, r);
|
|
1376
1376
|
}
|
|
1377
1377
|
default:
|
|
1378
1378
|
return /* @__PURE__ */ o("span", { children: t }, r);
|
|
1379
1379
|
}
|
|
1380
1380
|
}, Je = (e) => {
|
|
1381
|
-
const t =
|
|
1381
|
+
const t = Y(e && typeof e == "object" ? e.fontFamily : e);
|
|
1382
1382
|
if (t)
|
|
1383
|
-
return
|
|
1384
|
-
},
|
|
1383
|
+
return Li[t] ?? t;
|
|
1384
|
+
}, Fi = (e) => {
|
|
1385
1385
|
if (!e) return null;
|
|
1386
|
-
const t = {}, r =
|
|
1386
|
+
const t = {}, r = Y(e.color);
|
|
1387
1387
|
r && (t.color = r);
|
|
1388
1388
|
const n = Je(e.font) ?? Je(e.fontFamily);
|
|
1389
1389
|
n && (t.fontFamily = n);
|
|
1390
|
-
const s =
|
|
1390
|
+
const s = Pi(e.fontSize);
|
|
1391
1391
|
return s && (t.fontSize = s), Object.keys(t).length > 0 ? t : null;
|
|
1392
|
-
},
|
|
1393
|
-
const s =
|
|
1392
|
+
}, Pi = (e) => typeof e == "number" && Number.isFinite(e) ? `${e / 10}em` : Y(e), Y = (e) => typeof e == "string" && e.length > 0 ? e : void 0, Di = (e) => typeof e != "number" ? 3 : e < 1 ? 1 : e > 3 ? 3 : Math.round(e), Oi = (e, t, r, n) => {
|
|
1393
|
+
const s = Sr(n);
|
|
1394
1394
|
switch (e) {
|
|
1395
1395
|
case 1:
|
|
1396
1396
|
return /* @__PURE__ */ o("h1", { style: s, children: r }, t);
|
|
@@ -1402,83 +1402,83 @@ const Ti = {
|
|
|
1402
1402
|
}, Qe = (e) => {
|
|
1403
1403
|
const t = e?.textAlign;
|
|
1404
1404
|
if (t === "left" || t === "right" || t === "center" || t === "justify") return t;
|
|
1405
|
-
},
|
|
1406
|
-
var
|
|
1407
|
-
const
|
|
1408
|
-
const { caption: n, isCaptionVisible: s, source: i, isSourceVisible: l } =
|
|
1409
|
-
|
|
1405
|
+
}, Sr = (e) => e ? { textAlign: e } : void 0;
|
|
1406
|
+
var Bi = "_4dlrid0", Ar = "_4dlrid1", Ii = "xfz7dq0", Ri = "xfz7dq1", Hi = "xfz7dq2", Mi = "xfz7dq3", Gi = "xfz7dq4";
|
|
1407
|
+
const $i = ({ ref: e, footerRect: t, mode: r = "readonly" }) => {
|
|
1408
|
+
const { caption: n, isCaptionVisible: s, source: i, isSourceVisible: l } = L(
|
|
1409
|
+
D((h) => ({
|
|
1410
1410
|
caption: h.config.content.caption,
|
|
1411
1411
|
isCaptionVisible: h.config.content.isCaptionVisible,
|
|
1412
1412
|
source: h.config.content.source,
|
|
1413
1413
|
isSourceVisible: h.config.content.isSourceVisible
|
|
1414
1414
|
}))
|
|
1415
|
-
), a = r === "editable", d = s && (a || n !== null), u = l && i !== null &&
|
|
1415
|
+
), a = r === "editable", d = s && (a || n !== null), u = l && i !== null && qi(i);
|
|
1416
1416
|
return !d && !u ? null : /* @__PURE__ */ g(
|
|
1417
1417
|
"div",
|
|
1418
1418
|
{
|
|
1419
1419
|
ref: e,
|
|
1420
|
-
className:
|
|
1420
|
+
className: Ii,
|
|
1421
1421
|
style: {
|
|
1422
1422
|
left: t.x,
|
|
1423
1423
|
top: t.y,
|
|
1424
1424
|
width: t.width
|
|
1425
1425
|
},
|
|
1426
1426
|
children: [
|
|
1427
|
-
d ? a ? /* @__PURE__ */ o(
|
|
1428
|
-
u && /* @__PURE__ */ o(
|
|
1427
|
+
d ? a ? /* @__PURE__ */ o(Xi, { caption: n }) : /* @__PURE__ */ o(zi, { caption: n }) : null,
|
|
1428
|
+
u && /* @__PURE__ */ o(Vi, { source: i })
|
|
1429
1429
|
]
|
|
1430
1430
|
}
|
|
1431
1431
|
);
|
|
1432
|
-
},
|
|
1433
|
-
const t =
|
|
1434
|
-
return r === "" && t === void 0 ? null : /* @__PURE__ */ g("div", { className:
|
|
1435
|
-
/* @__PURE__ */ o("span", { className:
|
|
1436
|
-
t !== void 0 ? /* @__PURE__ */ o("a", { className:
|
|
1432
|
+
}, zi = ({ caption: e }) => e === null ? null : typeof e == "string" ? /* @__PURE__ */ o("p", { className: Ar, children: e }) : /* @__PURE__ */ o(de, { content: e }), Vi = ({ source: e }) => {
|
|
1433
|
+
const t = Tr(e.url) ? e.url : void 0, r = e.label ?? (t !== void 0 ? Wi(t) : "");
|
|
1434
|
+
return r === "" && t === void 0 ? null : /* @__PURE__ */ g("div", { className: Ri, children: [
|
|
1435
|
+
/* @__PURE__ */ o("span", { className: Mi, children: "Source:" }),
|
|
1436
|
+
t !== void 0 ? /* @__PURE__ */ o("a", { className: Hi, href: t, target: "_blank", rel: "noopener noreferrer", children: r }) : /* @__PURE__ */ o("span", { className: Gi, children: r })
|
|
1437
1437
|
] });
|
|
1438
|
-
},
|
|
1438
|
+
}, Wi = (e) => {
|
|
1439
1439
|
try {
|
|
1440
1440
|
return new URL(e).hostname;
|
|
1441
1441
|
} catch {
|
|
1442
1442
|
return e;
|
|
1443
1443
|
}
|
|
1444
|
-
},
|
|
1445
|
-
const t =
|
|
1444
|
+
}, qi = (e) => e.label !== void 0 && e.label !== "" || e.url !== void 0 && e.url !== "", Xi = ({ caption: e }) => {
|
|
1445
|
+
const t = kt(), r = b(() => jo({ placeholder: "Add caption" }), []), n = Cr({
|
|
1446
1446
|
content: e,
|
|
1447
1447
|
extensions: r,
|
|
1448
1448
|
isEditable: !0,
|
|
1449
1449
|
onUpdate: (s) => {
|
|
1450
|
-
const i =
|
|
1451
|
-
t(new
|
|
1450
|
+
const i = Qs(s) ? null : s;
|
|
1451
|
+
t(new Kr({ caption: i }));
|
|
1452
1452
|
}
|
|
1453
1453
|
});
|
|
1454
|
-
return /* @__PURE__ */ o(
|
|
1454
|
+
return /* @__PURE__ */ o(kr, { editor: n, ariaLabel: "Chart caption" });
|
|
1455
1455
|
};
|
|
1456
|
-
var
|
|
1457
|
-
const
|
|
1456
|
+
var ji = "_1k4qtbg0";
|
|
1457
|
+
const Yi = 3, Ui = ({
|
|
1458
1458
|
title: e,
|
|
1459
1459
|
isTitleVisible: t,
|
|
1460
1460
|
subtitle: r,
|
|
1461
1461
|
isSubtitleVisible: n
|
|
1462
1462
|
}) => {
|
|
1463
1463
|
const s = [];
|
|
1464
|
-
return t && s.push({ type: "heading", attrs: { level:
|
|
1465
|
-
},
|
|
1464
|
+
return t && s.push({ type: "heading", attrs: { level: Yi }, content: Zi(e) }), n && s.push(...Ji(r)), { type: "doc", content: s };
|
|
1465
|
+
}, Ki = (e) => {
|
|
1466
1466
|
const t = e.content ?? [], [r, ...n] = t;
|
|
1467
1467
|
return {
|
|
1468
|
-
title:
|
|
1469
|
-
subtitle:
|
|
1468
|
+
title: Qi(r?.content ?? []),
|
|
1469
|
+
subtitle: ea(n)
|
|
1470
1470
|
};
|
|
1471
|
-
},
|
|
1471
|
+
}, $e = (e) => ({
|
|
1472
1472
|
type: e.type ?? "text",
|
|
1473
|
-
...e.content !== void 0 ? { content: e.content.map(
|
|
1473
|
+
...e.content !== void 0 ? { content: e.content.map($e) } : {},
|
|
1474
1474
|
...e.text !== void 0 ? { text: e.text } : {},
|
|
1475
1475
|
...e.marks !== void 0 ? { marks: e.marks } : {},
|
|
1476
1476
|
...e.attrs !== void 0 ? { attrs: e.attrs } : {}
|
|
1477
|
-
}),
|
|
1477
|
+
}), Zi = (e) => e === null ? [] : typeof e == "string" ? e === "" ? [] : [{ type: "text", text: e }] : e.type === "doc" && e.content ? e.content.flatMap((t) => t.content ?? []) : e.type === "text" || e.type === "hardBreak" ? [e] : e.content ?? [], Ji = (e) => e === null ? [{ type: "paragraph" }] : typeof e == "string" ? e === "" ? [{ type: "paragraph" }] : [{ type: "paragraph", content: [{ type: "text", text: e }] }] : e.type === "doc" && e.content ? e.content.length === 0 ? [{ type: "paragraph" }] : e.content.map(et) : [et(e)], et = (e) => e.type === "paragraph" ? e : { type: "paragraph", content: e.content ?? [e] }, Qi = (e) => {
|
|
1478
1478
|
if (e.length === 0) return null;
|
|
1479
1479
|
const [t] = e;
|
|
1480
|
-
return t && e.length === 1 && t.type === "text" && (!t.marks || t.marks.length === 0) ? t.text ?? null : { type: "paragraph", content: e.map(
|
|
1481
|
-
},
|
|
1480
|
+
return t && e.length === 1 && t.type === "text" && (!t.marks || t.marks.length === 0) ? t.text ?? null : { type: "paragraph", content: e.map($e) };
|
|
1481
|
+
}, ea = (e) => {
|
|
1482
1482
|
const t = e.filter((n) => (n.content ?? []).length > 0);
|
|
1483
1483
|
if (t.length === 0) return null;
|
|
1484
1484
|
const [r] = t;
|
|
@@ -1487,10 +1487,10 @@ const Wi = 3, qi = ({
|
|
|
1487
1487
|
if (s && n.length === 1 && s.type === "text" && (!s.marks || s.marks.length === 0))
|
|
1488
1488
|
return s.text ?? null;
|
|
1489
1489
|
}
|
|
1490
|
-
return { type: "doc", content: t.map(
|
|
1491
|
-
},
|
|
1492
|
-
const { title: n, isTitleVisible: s, subtitle: i, isSubtitleVisible: l } =
|
|
1493
|
-
|
|
1490
|
+
return { type: "doc", content: t.map($e) };
|
|
1491
|
+
}, ta = ({ ref: e, headerRect: t, mode: r = "readonly" }) => {
|
|
1492
|
+
const { title: n, isTitleVisible: s, subtitle: i, isSubtitleVisible: l } = L(
|
|
1493
|
+
D((h) => ({
|
|
1494
1494
|
isTitleVisible: h.config.content.isTitleVisible,
|
|
1495
1495
|
isSubtitleVisible: h.config.content.isSubtitleVisible,
|
|
1496
1496
|
title: h.config.content.title,
|
|
@@ -1501,14 +1501,14 @@ const Wi = 3, qi = ({
|
|
|
1501
1501
|
"div",
|
|
1502
1502
|
{
|
|
1503
1503
|
ref: e,
|
|
1504
|
-
className:
|
|
1504
|
+
className: ji,
|
|
1505
1505
|
style: {
|
|
1506
1506
|
left: t.x,
|
|
1507
1507
|
top: t.y,
|
|
1508
1508
|
width: t.width
|
|
1509
1509
|
},
|
|
1510
1510
|
children: a ? /* @__PURE__ */ o(
|
|
1511
|
-
|
|
1511
|
+
na,
|
|
1512
1512
|
{
|
|
1513
1513
|
title: n,
|
|
1514
1514
|
isTitleVisible: s,
|
|
@@ -1517,7 +1517,7 @@ const Wi = 3, qi = ({
|
|
|
1517
1517
|
},
|
|
1518
1518
|
[s ? "title" : "", l ? "subtitle" : ""].join("-")
|
|
1519
1519
|
) : /* @__PURE__ */ o(
|
|
1520
|
-
|
|
1520
|
+
ra,
|
|
1521
1521
|
{
|
|
1522
1522
|
title: n,
|
|
1523
1523
|
isTitleVisible: s,
|
|
@@ -1527,107 +1527,107 @@ const Wi = 3, qi = ({
|
|
|
1527
1527
|
)
|
|
1528
1528
|
}
|
|
1529
1529
|
);
|
|
1530
|
-
},
|
|
1530
|
+
}, ra = ({
|
|
1531
1531
|
title: e,
|
|
1532
1532
|
isTitleVisible: t,
|
|
1533
1533
|
isSubtitleVisible: r,
|
|
1534
1534
|
subtitle: n
|
|
1535
|
-
}) => /* @__PURE__ */ g(
|
|
1536
|
-
t && e !== null && (typeof e == "string" ? /* @__PURE__ */ o("h1", { className:
|
|
1537
|
-
r && n !== null && (typeof n == "string" ? /* @__PURE__ */ o("p", { className:
|
|
1538
|
-
] }),
|
|
1535
|
+
}) => /* @__PURE__ */ g(N, { children: [
|
|
1536
|
+
t && e !== null && (typeof e == "string" ? /* @__PURE__ */ o("h1", { className: Bi, children: e }) : /* @__PURE__ */ o(de, { content: e })),
|
|
1537
|
+
r && n !== null && (typeof n == "string" ? /* @__PURE__ */ o("p", { className: Ar, children: n }) : /* @__PURE__ */ o(de, { content: n }))
|
|
1538
|
+
] }), na = ({
|
|
1539
1539
|
title: e,
|
|
1540
1540
|
isTitleVisible: t,
|
|
1541
1541
|
isSubtitleVisible: r,
|
|
1542
1542
|
subtitle: n
|
|
1543
1543
|
}) => {
|
|
1544
|
-
const s =
|
|
1545
|
-
() =>
|
|
1544
|
+
const s = kt(), i = b(
|
|
1545
|
+
() => Xo({
|
|
1546
1546
|
titlePlaceholder: "Untitled",
|
|
1547
1547
|
subtitlePlaceholder: "Untitled",
|
|
1548
1548
|
isTitleVisible: t,
|
|
1549
1549
|
isSubtitleVisible: r
|
|
1550
1550
|
}),
|
|
1551
1551
|
[t, r]
|
|
1552
|
-
), l =
|
|
1553
|
-
() =>
|
|
1552
|
+
), l = b(
|
|
1553
|
+
() => Ui({ title: e, isTitleVisible: t, subtitle: n, isSubtitleVisible: r }),
|
|
1554
1554
|
[e, t, n, r]
|
|
1555
|
-
), a =
|
|
1555
|
+
), a = Cr({
|
|
1556
1556
|
content: l,
|
|
1557
1557
|
extensions: i,
|
|
1558
1558
|
isEditable: !0,
|
|
1559
1559
|
onUpdate: (d) => {
|
|
1560
|
-
const u =
|
|
1561
|
-
t && s(new
|
|
1560
|
+
const u = Ki(d);
|
|
1561
|
+
t && s(new Zr({ title: u.title })), r && s(new Jr({ subtitle: u.subtitle }));
|
|
1562
1562
|
}
|
|
1563
1563
|
});
|
|
1564
|
-
return /* @__PURE__ */ o(
|
|
1564
|
+
return /* @__PURE__ */ o(kr, { editor: a, ariaLabel: "Chart title and subtitle" });
|
|
1565
1565
|
};
|
|
1566
|
-
var
|
|
1567
|
-
const
|
|
1566
|
+
var oa = "_1u9qprb0", sa = "_1u9qprb1", ia = "_9aen060", aa = "_9aen061", la = "_9aen062", Lr = "_9aen063";
|
|
1567
|
+
const ca = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1568
1568
|
__proto__: null,
|
|
1569
|
-
groupRow:
|
|
1570
|
-
item:
|
|
1571
|
-
trendRow:
|
|
1572
|
-
valueRow:
|
|
1573
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1569
|
+
groupRow: la,
|
|
1570
|
+
item: Lr,
|
|
1571
|
+
trendRow: aa,
|
|
1572
|
+
valueRow: ia
|
|
1573
|
+
}, Symbol.toStringTag, { value: "Module" })), da = (e) => /* @__PURE__ */ o(R, { ...e, children: /* @__PURE__ */ g("g", { stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1574
1574
|
/* @__PURE__ */ o("path", { d: "m5 12 7-7 7 7" }),
|
|
1575
1575
|
/* @__PURE__ */ o("path", { d: "M12 19V5" })
|
|
1576
|
-
] }) }),
|
|
1577
|
-
var
|
|
1578
|
-
const
|
|
1576
|
+
] }) }), ua = (e) => /* @__PURE__ */ o(R, { ...e, children: /* @__PURE__ */ o("g", { stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ o("path", { d: "M5 12h14" }) }) });
|
|
1577
|
+
var _r = "n7clvo0", ha = "n7clvo1", ga = "n7clvo2", fa = "n7clvo3", Er = { small: "n7clvo4", medium: "n7clvo5", large: "n7clvo6" }, pa = { small: "n7clvo7", medium: "n7clvo8", large: "n7clvo9" }, ma = { up: "n7clvoa", down: "n7clvob", flat: "n7clvoc" }, ya = { up: "n7clvoe n7clvod", down: "n7clvof n7clvod", flat: "n7clvog n7clvod" };
|
|
1578
|
+
const va = ({ segment: e, resolvedSize: t }) => {
|
|
1579
1579
|
if (e.kind === "swatch")
|
|
1580
|
-
return /* @__PURE__ */ o(
|
|
1580
|
+
return /* @__PURE__ */ o(Ct, { shape: e.swatch.shape, color: e.swatch.color, width: e.size, height: e.size });
|
|
1581
1581
|
if (e.kind === "trendArrow")
|
|
1582
|
-
return /* @__PURE__ */ o("div", { className:
|
|
1583
|
-
const r = e.fontRole === "value" ?
|
|
1584
|
-
return /* @__PURE__ */ o("span", { className:
|
|
1585
|
-
},
|
|
1582
|
+
return /* @__PURE__ */ o("div", { className: ya[e.direction], children: e.direction === "flat" ? /* @__PURE__ */ o(ua, { size: "xs", title: "" }) : /* @__PURE__ */ o(da, { size: "xs", title: "" }) });
|
|
1583
|
+
const r = e.fontRole === "value" ? Er[t] : pa[t];
|
|
1584
|
+
return /* @__PURE__ */ o("span", { className: q(ba(e), r), children: e.text });
|
|
1585
|
+
}, ba = (e) => {
|
|
1586
1586
|
switch (e.textRole) {
|
|
1587
1587
|
case "value":
|
|
1588
|
-
return
|
|
1588
|
+
return _r;
|
|
1589
1589
|
case "observation":
|
|
1590
|
-
return
|
|
1590
|
+
return ha;
|
|
1591
1591
|
case "trendPercentage":
|
|
1592
|
-
return
|
|
1592
|
+
return ma[e.trendDirection ?? "up"];
|
|
1593
1593
|
case "trendReference":
|
|
1594
|
-
return
|
|
1594
|
+
return ga;
|
|
1595
1595
|
case "label":
|
|
1596
|
-
return
|
|
1596
|
+
return fa;
|
|
1597
1597
|
}
|
|
1598
|
-
},
|
|
1598
|
+
}, xa = ({ item: e, resolvedSize: t }) => /* @__PURE__ */ o("div", { className: Lr, children: Vt(e).map((r) => /* @__PURE__ */ o(ka, { row: r, resolvedSize: t }, r.role)) }), ka = ({ row: e, resolvedSize: t }) => {
|
|
1599
1599
|
const r = e.role === "trendRow";
|
|
1600
1600
|
return /* @__PURE__ */ o(
|
|
1601
1601
|
"div",
|
|
1602
1602
|
{
|
|
1603
|
-
className:
|
|
1603
|
+
className: ca[e.role],
|
|
1604
1604
|
"data-testid": r ? "headline-trend" : void 0,
|
|
1605
|
-
"data-direction": r ?
|
|
1605
|
+
"data-direction": r ? Ca(e) : void 0,
|
|
1606
1606
|
role: r ? "img" : void 0,
|
|
1607
1607
|
"aria-label": r ? e.ariaLabel : void 0,
|
|
1608
|
-
children: e.segments.map((n, s) => /* @__PURE__ */ o(
|
|
1608
|
+
children: e.segments.map((n, s) => /* @__PURE__ */ o(va, { segment: n, resolvedSize: t }, s))
|
|
1609
1609
|
}
|
|
1610
1610
|
);
|
|
1611
|
-
},
|
|
1611
|
+
}, Ca = (e) => {
|
|
1612
1612
|
const t = e.segments.find((r) => r.kind === "trendArrow");
|
|
1613
1613
|
return t?.kind === "trendArrow" ? t.direction : void 0;
|
|
1614
|
-
},
|
|
1614
|
+
}, Ta = ({ headline: e, rect: t, resolvedSize: r, visibleItemCount: n }) => {
|
|
1615
1615
|
const s = {
|
|
1616
1616
|
left: t.x,
|
|
1617
1617
|
top: t.y,
|
|
1618
1618
|
width: t.width,
|
|
1619
1619
|
height: t.height
|
|
1620
1620
|
};
|
|
1621
|
-
return e.kind === "grandTotal" ? /* @__PURE__ */ o("div", { className:
|
|
1621
|
+
return e.kind === "grandTotal" ? /* @__PURE__ */ o("div", { className: sa, style: s, children: /* @__PURE__ */ o("span", { className: q(_r, Er[r]), children: e.value }) }) : /* @__PURE__ */ o("div", { className: oa, style: s, children: e.items.slice(0, n).map((i, l) => /* @__PURE__ */ o(xa, { item: i, resolvedSize: r }, `${i.label}-${l}`)) });
|
|
1622
1622
|
};
|
|
1623
|
-
var
|
|
1624
|
-
const
|
|
1625
|
-
const { lineBoxHeight: n } =
|
|
1623
|
+
var wa = "_1oj6yix0", Sa = "_1oj6yix1", Aa = "_1oj6yix2";
|
|
1624
|
+
const La = 8, _a = 16, Ea = 2, Na = ({ legends: e, containerRect: t, textScale: r }) => {
|
|
1625
|
+
const { lineBoxHeight: n } = tr(r), { placements: s, hasOverlap: i } = Fa(e, t, n);
|
|
1626
1626
|
if (s.length === 0) return null;
|
|
1627
|
-
const l = i ?
|
|
1628
|
-
return /* @__PURE__ */ g("div", { className:
|
|
1629
|
-
i && /* @__PURE__ */ o("svg", { className:
|
|
1630
|
-
|
|
1627
|
+
const l = i ? _a : La, a = l - Ea;
|
|
1628
|
+
return /* @__PURE__ */ g("div", { className: wa, children: [
|
|
1629
|
+
i && /* @__PURE__ */ o("svg", { className: Sa, width: t.width, height: t.height, children: s.map((d) => /* @__PURE__ */ o(
|
|
1630
|
+
Pa,
|
|
1631
1631
|
{
|
|
1632
1632
|
anchorY: d.anchorY,
|
|
1633
1633
|
labelY: d.y,
|
|
@@ -1639,14 +1639,14 @@ const Ta = 8, wa = 16, Sa = 2, Aa = ({ legends: e, containerRect: t, textScale:
|
|
|
1639
1639
|
s.map((d) => /* @__PURE__ */ o(
|
|
1640
1640
|
"span",
|
|
1641
1641
|
{
|
|
1642
|
-
className:
|
|
1642
|
+
className: Aa,
|
|
1643
1643
|
style: { left: l, top: d.y, color: d.payload.color },
|
|
1644
1644
|
children: d.payload.label
|
|
1645
1645
|
},
|
|
1646
1646
|
d.payload.key
|
|
1647
1647
|
))
|
|
1648
1648
|
] });
|
|
1649
|
-
},
|
|
1649
|
+
}, Fa = (e, t, r) => b(() => {
|
|
1650
1650
|
const n = [];
|
|
1651
1651
|
for (const s of e)
|
|
1652
1652
|
for (const i of s.items) {
|
|
@@ -1657,12 +1657,12 @@ const Ta = 8, wa = 16, Sa = 2, Aa = ({ legends: e, containerRect: t, textScale:
|
|
|
1657
1657
|
payload: { key: String(n.length), label: i.formattedLabel, color: l }
|
|
1658
1658
|
});
|
|
1659
1659
|
}
|
|
1660
|
-
return n.length === 0 || t.height <= 0 ? { placements: [], hasOverlap: !1 } :
|
|
1660
|
+
return n.length === 0 || t.height <= 0 ? { placements: [], hasOverlap: !1 } : Qr({
|
|
1661
1661
|
items: n,
|
|
1662
1662
|
containerHeight: t.height,
|
|
1663
1663
|
labelHeight: r
|
|
1664
1664
|
});
|
|
1665
|
-
}, [e, t.height, r]),
|
|
1665
|
+
}, [e, t.height, r]), Pa = ({ anchorY: e, labelY: t, endX: r, color: n }) => {
|
|
1666
1666
|
const s = r / 2;
|
|
1667
1667
|
return /* @__PURE__ */ o(
|
|
1668
1668
|
"path",
|
|
@@ -1675,8 +1675,8 @@ const Ta = 8, wa = 16, Sa = 2, Aa = ({ legends: e, containerRect: t, textScale:
|
|
|
1675
1675
|
}
|
|
1676
1676
|
);
|
|
1677
1677
|
};
|
|
1678
|
-
var
|
|
1679
|
-
const
|
|
1678
|
+
var Da = "_6a636s0", Oa = "_1kjk02r0", Ba = "_1kjk02r1", Ia = "_1kjk02r2", Ra = "_1kjk02r3", Ha = "_1kjk02r4", Ma = "_1kjk02r5", Ga = "_1kjk02r6", $a = "_1kjk02r7", za = "_1kjk02r8", Va = "_1kjk02r9", Wa = "_1kjk02ra", qa = "_1kjk02rb", Xa = "_1dw9dgx0";
|
|
1679
|
+
const ja = "#9ca3af", ve = "\0", Ya = (e) => {
|
|
1680
1680
|
const t = [];
|
|
1681
1681
|
return e.forEach((r, n) => {
|
|
1682
1682
|
const s = r.aesthetics.includes("size");
|
|
@@ -1685,9 +1685,9 @@ const Va = "#9ca3af", ye = "\0", Wa = (e) => {
|
|
|
1685
1685
|
const u = Number(i.visual.size);
|
|
1686
1686
|
if (!Number.isFinite(u) || u <= 0) continue;
|
|
1687
1687
|
}
|
|
1688
|
-
const l = i.visual.color ?? "", a = s ? `${
|
|
1688
|
+
const l = i.visual.color ?? "", a = s ? `${ve}${Number(i.visual.size)}` : "", d = i.visual.lineType;
|
|
1689
1689
|
t.push({
|
|
1690
|
-
key: `${n}${
|
|
1690
|
+
key: `${n}${ve}${String(i.value)}${ve}${l}${a}`,
|
|
1691
1691
|
formattedLabel: i.formattedLabel,
|
|
1692
1692
|
visual: i.visual,
|
|
1693
1693
|
swatchShape: i.swatchShape,
|
|
@@ -1696,64 +1696,64 @@ const Va = "#9ca3af", ye = "\0", Wa = (e) => {
|
|
|
1696
1696
|
});
|
|
1697
1697
|
}
|
|
1698
1698
|
}), t;
|
|
1699
|
-
},
|
|
1700
|
-
/* @__PURE__ */ o(
|
|
1699
|
+
}, Nr = ({ pill: e }) => e.isBubble ? /* @__PURE__ */ o(Za, { pill: e }) : /* @__PURE__ */ o(Ka, { pill: e }), Ua = ({ color: e, lineType: t, shape: r }) => e ? /* @__PURE__ */ o(Ct, { shape: r, color: e, lineType: t, width: Xt, height: Re }) : null, Ka = ({ pill: e }) => /* @__PURE__ */ g(N, { children: [
|
|
1700
|
+
/* @__PURE__ */ o(Ua, { color: e.visual.color, lineType: e.primaryLineType, shape: e.swatchShape }),
|
|
1701
1701
|
/* @__PURE__ */ o("span", { children: e.formattedLabel })
|
|
1702
|
-
] }),
|
|
1702
|
+
] }), Za = ({ pill: e }) => {
|
|
1703
1703
|
const t = Number(e.visual.size);
|
|
1704
|
-
return /* @__PURE__ */ g(
|
|
1704
|
+
return /* @__PURE__ */ g(N, { children: [
|
|
1705
1705
|
/* @__PURE__ */ o(
|
|
1706
1706
|
"span",
|
|
1707
1707
|
{
|
|
1708
|
-
className:
|
|
1708
|
+
className: Xa,
|
|
1709
1709
|
style: {
|
|
1710
1710
|
width: t,
|
|
1711
1711
|
height: t,
|
|
1712
|
-
backgroundColor: e.visual.color ??
|
|
1712
|
+
backgroundColor: e.visual.color ?? ja
|
|
1713
1713
|
}
|
|
1714
1714
|
}
|
|
1715
1715
|
),
|
|
1716
1716
|
/* @__PURE__ */ o("span", { children: e.formattedLabel })
|
|
1717
1717
|
] });
|
|
1718
|
-
},
|
|
1719
|
-
const [r, n] =
|
|
1718
|
+
}, Ja = ({ hiddenPills: e, placement: t }) => {
|
|
1719
|
+
const [r, n] = P(!1), { refs: s, floatingStyles: i } = Pe({
|
|
1720
1720
|
open: r,
|
|
1721
1721
|
placement: t,
|
|
1722
1722
|
middleware: [De(4), Oe(), Be({ padding: 8 })]
|
|
1723
1723
|
});
|
|
1724
|
-
|
|
1724
|
+
_(() => {
|
|
1725
1725
|
if (!r) return;
|
|
1726
|
-
const u = (
|
|
1727
|
-
const
|
|
1728
|
-
if (!
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1731
|
-
}, h = (
|
|
1732
|
-
|
|
1726
|
+
const u = (p) => {
|
|
1727
|
+
const f = p.target;
|
|
1728
|
+
if (!f) return;
|
|
1729
|
+
const v = s.reference.current, y = s.floating.current;
|
|
1730
|
+
v instanceof Element && v.contains(f) || y instanceof Element && y.contains(f) || n(!1);
|
|
1731
|
+
}, h = (p) => {
|
|
1732
|
+
p.key === "Escape" && n(!1);
|
|
1733
1733
|
};
|
|
1734
1734
|
return document.addEventListener("pointerdown", u), document.addEventListener("keydown", h), () => {
|
|
1735
1735
|
document.removeEventListener("pointerdown", u), document.removeEventListener("keydown", h);
|
|
1736
1736
|
};
|
|
1737
1737
|
}, [r, s.floating, s.reference]);
|
|
1738
|
-
const l = t === "left" || t === "right", a = Math.min(e.length - 1,
|
|
1739
|
-
return /* @__PURE__ */ g(
|
|
1738
|
+
const l = t === "left" || t === "right", a = Math.min(e.length - 1, Ut), d = Array.from({ length: a }, (u, h) => a - h);
|
|
1739
|
+
return /* @__PURE__ */ g(N, { children: [
|
|
1740
1740
|
/* @__PURE__ */ g(
|
|
1741
1741
|
"div",
|
|
1742
1742
|
{
|
|
1743
1743
|
ref: s.setReference,
|
|
1744
|
-
className:
|
|
1745
|
-
[
|
|
1746
|
-
[
|
|
1744
|
+
className: q(Oa, {
|
|
1745
|
+
[Ia]: l,
|
|
1746
|
+
[Ba]: !l
|
|
1747
1747
|
}),
|
|
1748
1748
|
children: [
|
|
1749
1749
|
d.map((u) => /* @__PURE__ */ o(
|
|
1750
1750
|
"span",
|
|
1751
1751
|
{
|
|
1752
|
-
className:
|
|
1753
|
-
[
|
|
1754
|
-
[
|
|
1752
|
+
className: q(Ra, {
|
|
1753
|
+
[Ma]: l,
|
|
1754
|
+
[Ha]: !l
|
|
1755
1755
|
}),
|
|
1756
|
-
style:
|
|
1756
|
+
style: Qa(u, l),
|
|
1757
1757
|
"aria-hidden": !0
|
|
1758
1758
|
},
|
|
1759
1759
|
u
|
|
@@ -1762,12 +1762,12 @@ const Va = "#9ca3af", ye = "\0", Wa = (e) => {
|
|
|
1762
1762
|
"button",
|
|
1763
1763
|
{
|
|
1764
1764
|
type: "button",
|
|
1765
|
-
className:
|
|
1765
|
+
className: q(Ga, { [$a]: r }),
|
|
1766
1766
|
onClick: () => n((u) => !u),
|
|
1767
1767
|
"aria-haspopup": "dialog",
|
|
1768
1768
|
"aria-expanded": r,
|
|
1769
1769
|
"aria-label": `Show ${e.length} hidden legend ${e.length === 1 ? "item" : "items"}`,
|
|
1770
|
-
children: /* @__PURE__ */ g("span", { className:
|
|
1770
|
+
children: /* @__PURE__ */ g("span", { className: za, children: [
|
|
1771
1771
|
"+",
|
|
1772
1772
|
e.length
|
|
1773
1773
|
] })
|
|
@@ -1782,67 +1782,67 @@ const Va = "#9ca3af", ye = "\0", Wa = (e) => {
|
|
|
1782
1782
|
ref: s.setFloating,
|
|
1783
1783
|
role: "dialog",
|
|
1784
1784
|
"aria-label": "Hidden legend items",
|
|
1785
|
-
className:
|
|
1785
|
+
className: Va,
|
|
1786
1786
|
style: i,
|
|
1787
|
-
children: /* @__PURE__ */ o("ul", { className:
|
|
1787
|
+
children: /* @__PURE__ */ o("ul", { className: Wa, children: e.map((u) => /* @__PURE__ */ o("li", { className: qa, children: /* @__PURE__ */ o(Nr, { pill: u }) }, u.key)) })
|
|
1788
1788
|
}
|
|
1789
1789
|
)
|
|
1790
1790
|
] });
|
|
1791
|
-
},
|
|
1792
|
-
const r = -e *
|
|
1791
|
+
}, Qa = (e, t) => {
|
|
1792
|
+
const r = -e * Kt;
|
|
1793
1793
|
return { transform: t ? `translateY(${r}px)` : `translateX(${r}px)` };
|
|
1794
1794
|
};
|
|
1795
|
-
var
|
|
1796
|
-
const
|
|
1795
|
+
var el = "_1cecisi0", tl = "_1cecisi1", rl = "_1cecisi2", nl = "_1cecisi3";
|
|
1796
|
+
const ol = ({
|
|
1797
1797
|
edge: e,
|
|
1798
1798
|
formattedLegends: t,
|
|
1799
1799
|
containerWidth: r,
|
|
1800
1800
|
containerHeight: n,
|
|
1801
1801
|
textScale: s
|
|
1802
1802
|
}) => {
|
|
1803
|
-
const i = ee(), l =
|
|
1803
|
+
const i = ee(), l = b(() => Ya(t), [t]), a = e === "left" || e === "right", d = a ? n : r, u = b(() => {
|
|
1804
1804
|
if (l.length === 0) return { visibleCount: 0, hasOverflow: !1 };
|
|
1805
1805
|
if (d <= 0) return { visibleCount: l.length, hasOverflow: !1 };
|
|
1806
|
-
const
|
|
1807
|
-
label:
|
|
1808
|
-
swatchInlineSize:
|
|
1806
|
+
const v = G(Zt, s), y = { family: Qt, size: v }, m = v * Jt, x = (U) => a ? sl(U, m) : tt({
|
|
1807
|
+
label: U.formattedLabel,
|
|
1808
|
+
swatchInlineSize: il(U),
|
|
1809
1809
|
textMeasurer: i,
|
|
1810
|
-
font:
|
|
1811
|
-
}),
|
|
1810
|
+
font: y
|
|
1811
|
+
}), k = l.map(x), O = (a ? m + He : tt({
|
|
1812
1812
|
label: `+${l.length}`,
|
|
1813
1813
|
swatchInlineSize: 0,
|
|
1814
1814
|
textMeasurer: i,
|
|
1815
|
-
font:
|
|
1816
|
-
})) +
|
|
1817
|
-
return
|
|
1818
|
-
pillSizes:
|
|
1819
|
-
overflowPillSize:
|
|
1815
|
+
font: y
|
|
1816
|
+
})) + Go;
|
|
1817
|
+
return ll({
|
|
1818
|
+
pillSizes: k,
|
|
1819
|
+
overflowPillSize: O,
|
|
1820
1820
|
containerSize: d,
|
|
1821
|
-
gap:
|
|
1821
|
+
gap: Ro
|
|
1822
1822
|
});
|
|
1823
1823
|
}, [l, d, a, i, s]);
|
|
1824
1824
|
if (l.length === 0) return null;
|
|
1825
|
-
const h = l.slice(0, u.visibleCount),
|
|
1825
|
+
const h = l.slice(0, u.visibleCount), p = l.slice(u.visibleCount), f = u.hasOverflow && p.length > 0;
|
|
1826
1826
|
return /* @__PURE__ */ g(
|
|
1827
1827
|
"div",
|
|
1828
1828
|
{
|
|
1829
|
-
className:
|
|
1830
|
-
[
|
|
1831
|
-
[
|
|
1829
|
+
className: q(el, {
|
|
1830
|
+
[rl]: a,
|
|
1831
|
+
[tl]: !a
|
|
1832
1832
|
}),
|
|
1833
1833
|
children: [
|
|
1834
|
-
h.map((
|
|
1835
|
-
|
|
1834
|
+
h.map((v) => /* @__PURE__ */ o("div", { className: nl, children: /* @__PURE__ */ o(Nr, { pill: v }) }, v.key)),
|
|
1835
|
+
f && /* @__PURE__ */ o(Ja, { hiddenPills: p, placement: cl(e) })
|
|
1836
1836
|
]
|
|
1837
1837
|
}
|
|
1838
1838
|
);
|
|
1839
1839
|
}, tt = ({ label: e, swatchInlineSize: t, textMeasurer: r, font: n }) => {
|
|
1840
|
-
const s = r.measureText(e, n).width, i = t > 0 ?
|
|
1841
|
-
return t + i + s +
|
|
1842
|
-
},
|
|
1843
|
-
const r =
|
|
1840
|
+
const s = r.measureText(e, n).width, i = t > 0 ? jt : 0;
|
|
1841
|
+
return t + i + s + er;
|
|
1842
|
+
}, sl = (e, t) => {
|
|
1843
|
+
const r = al(e);
|
|
1844
1844
|
return Math.max(t, r) + He;
|
|
1845
|
-
},
|
|
1845
|
+
}, il = (e) => e.isBubble ? Number(e.visual.size) : rr(e.visual.color), al = (e) => e.isBubble ? Number(e.visual.size) : Re, ll = ({
|
|
1846
1846
|
pillSizes: e,
|
|
1847
1847
|
overflowPillSize: t,
|
|
1848
1848
|
containerSize: r,
|
|
@@ -1861,7 +1861,7 @@ const el = ({
|
|
|
1861
1861
|
i = d, l += 1;
|
|
1862
1862
|
}
|
|
1863
1863
|
return { visibleCount: l, hasOverflow: !0 };
|
|
1864
|
-
},
|
|
1864
|
+
}, cl = (e) => {
|
|
1865
1865
|
switch (e) {
|
|
1866
1866
|
case "top":
|
|
1867
1867
|
return "bottom";
|
|
@@ -1872,12 +1872,12 @@ const el = ({
|
|
|
1872
1872
|
case "right":
|
|
1873
1873
|
return "left";
|
|
1874
1874
|
}
|
|
1875
|
-
},
|
|
1875
|
+
}, dl = Vr(function({
|
|
1876
1876
|
formattedLegends: t,
|
|
1877
1877
|
rects: r,
|
|
1878
1878
|
textScale: n
|
|
1879
1879
|
}) {
|
|
1880
|
-
const s =
|
|
1880
|
+
const s = b(() => {
|
|
1881
1881
|
const i = /* @__PURE__ */ new Map();
|
|
1882
1882
|
for (const l of t) {
|
|
1883
1883
|
let a = i.get(l.position);
|
|
@@ -1885,12 +1885,12 @@ const el = ({
|
|
|
1885
1885
|
}
|
|
1886
1886
|
return i;
|
|
1887
1887
|
}, [t]);
|
|
1888
|
-
return /* @__PURE__ */ o(
|
|
1888
|
+
return /* @__PURE__ */ o(N, { children: Array.from(s, ([i, l]) => {
|
|
1889
1889
|
const a = r[i];
|
|
1890
1890
|
return a === void 0 ? null : /* @__PURE__ */ g(
|
|
1891
1891
|
"div",
|
|
1892
1892
|
{
|
|
1893
|
-
className:
|
|
1893
|
+
className: Da,
|
|
1894
1894
|
style: {
|
|
1895
1895
|
left: a.x,
|
|
1896
1896
|
top: a.y,
|
|
@@ -1899,7 +1899,7 @@ const el = ({
|
|
|
1899
1899
|
},
|
|
1900
1900
|
children: [
|
|
1901
1901
|
/* @__PURE__ */ o(
|
|
1902
|
-
|
|
1902
|
+
ol,
|
|
1903
1903
|
{
|
|
1904
1904
|
edge: i,
|
|
1905
1905
|
formattedLegends: l.pill,
|
|
@@ -1908,72 +1908,72 @@ const el = ({
|
|
|
1908
1908
|
textScale: n
|
|
1909
1909
|
}
|
|
1910
1910
|
),
|
|
1911
|
-
/* @__PURE__ */ o(
|
|
1911
|
+
/* @__PURE__ */ o(Na, { legends: l.direct, containerRect: a, textScale: n })
|
|
1912
1912
|
]
|
|
1913
1913
|
},
|
|
1914
1914
|
i
|
|
1915
1915
|
);
|
|
1916
1916
|
}) });
|
|
1917
|
-
}),
|
|
1917
|
+
}), ul = (e, t, r) => {
|
|
1918
1918
|
const n = e.filter((i) => i.interactive);
|
|
1919
1919
|
if (n.length === 0) return null;
|
|
1920
1920
|
const s = n.map((i) => r(i, t)).filter((i) => i !== null).map((i) => i.guideMode);
|
|
1921
1921
|
return s.length === 0 ? null : s.some((i) => i === "bar") ? "bar" : s.every((i) => i === "continuous") ? "continuous" : null;
|
|
1922
1922
|
};
|
|
1923
|
-
function
|
|
1924
|
-
const r =
|
|
1923
|
+
function hl(e, t) {
|
|
1924
|
+
const r = rn(e.mainAxis, t);
|
|
1925
1925
|
if (e.mainAxis === "y") {
|
|
1926
|
-
const s =
|
|
1926
|
+
const s = C(Ne(r));
|
|
1927
1927
|
return { x1: 0, x2: "100%", y1: s, y2: s };
|
|
1928
1928
|
}
|
|
1929
|
-
const n =
|
|
1929
|
+
const n = C(Fe(r));
|
|
1930
1930
|
return { x1: n, x2: n, y1: 0, y2: "100%" };
|
|
1931
1931
|
}
|
|
1932
|
-
function
|
|
1933
|
-
const n = e.mainAxis === "y" ?
|
|
1932
|
+
function gl(e, t, r) {
|
|
1933
|
+
const n = e.mainAxis === "y" ? en(r.observation) : tn(r.observation);
|
|
1934
1934
|
if (n === null) return null;
|
|
1935
|
-
const s = e.mainAxis === "y" ?
|
|
1935
|
+
const s = e.mainAxis === "y" ? pl(r) : fl(r), l = (t.x?.kind === "position" ? t.x : null)?.bandwidth ?? s;
|
|
1936
1936
|
if (l === null || l <= 0) return null;
|
|
1937
1937
|
const a = l / 2;
|
|
1938
1938
|
if (e.mainAxis === "y") {
|
|
1939
|
-
const h =
|
|
1940
|
-
return { x: 0, y: h, width: "100%", height:
|
|
1939
|
+
const h = C(Ne(n + a)), p = C(l);
|
|
1940
|
+
return { x: 0, y: h, width: "100%", height: p };
|
|
1941
1941
|
}
|
|
1942
|
-
const d =
|
|
1942
|
+
const d = C(Fe(n - a)), u = C(l);
|
|
1943
1943
|
return { x: d, y: 0, width: u, height: "100%" };
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1946
|
-
const t =
|
|
1945
|
+
function fl(e) {
|
|
1946
|
+
const t = sn(e.observation), r = an(e.observation);
|
|
1947
1947
|
return t === null || r === null ? null : r - t;
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1950
|
-
const t =
|
|
1949
|
+
function pl(e) {
|
|
1950
|
+
const t = nn(e.observation), r = on(e.observation);
|
|
1951
1951
|
return t === null || r === null ? null : r - t;
|
|
1952
1952
|
}
|
|
1953
|
-
const
|
|
1954
|
-
const { coordSystem: t, layers: r, scales: n } =
|
|
1955
|
-
|
|
1953
|
+
const ml = 1, yl = "4 3", vl = ({ panelRect: e }) => {
|
|
1954
|
+
const { coordSystem: t, layers: r, scales: n } = L(
|
|
1955
|
+
D((a) => ({ coordSystem: a.coordSystem, layers: a.layers, scales: a.scales }))
|
|
1956
1956
|
), s = he((a) => a.hover.primary), i = Q();
|
|
1957
1957
|
if (t.type !== "cartesian" || r.length === 0 || s === null) return null;
|
|
1958
|
-
const l =
|
|
1959
|
-
return l === null ? null : l === "bar" ? /* @__PURE__ */ o(
|
|
1960
|
-
},
|
|
1961
|
-
const n =
|
|
1962
|
-
return /* @__PURE__ */ o(
|
|
1958
|
+
const l = ul(r, t, i);
|
|
1959
|
+
return l === null ? null : l === "bar" ? /* @__PURE__ */ o(xl, { coordSystem: t, scales: n, primary: s, panelRect: e }) : /* @__PURE__ */ o(bl, { coordSystem: t, primary: s, panelRect: e });
|
|
1960
|
+
}, bl = ({ coordSystem: e, primary: t, panelRect: r }) => {
|
|
1961
|
+
const n = hl(e, t);
|
|
1962
|
+
return /* @__PURE__ */ o(Fr, { panelRect: r, children: /* @__PURE__ */ o(
|
|
1963
1963
|
"line",
|
|
1964
1964
|
{
|
|
1965
1965
|
...n,
|
|
1966
1966
|
stroke: c.hoverGuideLineColor,
|
|
1967
|
-
strokeWidth:
|
|
1968
|
-
strokeDasharray:
|
|
1967
|
+
strokeWidth: ml,
|
|
1968
|
+
strokeDasharray: yl,
|
|
1969
1969
|
strokeLinecap: "round",
|
|
1970
1970
|
"data-testid": "hover-guide-line"
|
|
1971
1971
|
}
|
|
1972
1972
|
) });
|
|
1973
|
-
},
|
|
1974
|
-
const s =
|
|
1975
|
-
return s === null ? null : /* @__PURE__ */ o(
|
|
1976
|
-
},
|
|
1973
|
+
}, xl = ({ coordSystem: e, scales: t, primary: r, panelRect: n }) => {
|
|
1974
|
+
const s = gl(e, t, r);
|
|
1975
|
+
return s === null ? null : /* @__PURE__ */ o(Fr, { panelRect: n, children: /* @__PURE__ */ o("rect", { ...s, fill: c.hoverGuideFillColor, "data-testid": "hover-guide-rect" }) });
|
|
1976
|
+
}, Fr = ({ panelRect: e, children: t }) => /* @__PURE__ */ o(
|
|
1977
1977
|
"svg",
|
|
1978
1978
|
{
|
|
1979
1979
|
x: e.x,
|
|
@@ -1984,17 +1984,17 @@ const hl = 1, gl = "4 3", fl = ({ panelRect: e }) => {
|
|
|
1984
1984
|
"data-testid": "hover-guide",
|
|
1985
1985
|
children: t
|
|
1986
1986
|
}
|
|
1987
|
-
),
|
|
1988
|
-
|
|
1987
|
+
), kl = 200, Cl = ({ engine: e, store: t, overlayRef: r, setCursor: n = Tl }) => {
|
|
1988
|
+
_(() => {
|
|
1989
1989
|
const s = r.current;
|
|
1990
1990
|
if (!s) return;
|
|
1991
|
-
const i =
|
|
1991
|
+
const i = wl(s, e), l = Sl(s, e, t, n);
|
|
1992
1992
|
return () => {
|
|
1993
1993
|
l(), i();
|
|
1994
1994
|
};
|
|
1995
1995
|
}, [e, t, r, n]);
|
|
1996
|
-
},
|
|
1997
|
-
},
|
|
1996
|
+
}, Tl = () => {
|
|
1997
|
+
}, wl = (e, t) => {
|
|
1998
1998
|
const r = () => {
|
|
1999
1999
|
const l = e.getBoundingClientRect();
|
|
2000
2000
|
l.width === 0 || l.height === 0 || t.setViewport({ width: l.width, height: l.height });
|
|
@@ -2003,12 +2003,12 @@ const hl = 1, gl = "4 3", fl = ({ panelRect: e }) => {
|
|
|
2003
2003
|
const s = () => {
|
|
2004
2004
|
n !== null && clearTimeout(n), n = setTimeout(() => {
|
|
2005
2005
|
n = null, r();
|
|
2006
|
-
},
|
|
2006
|
+
}, kl);
|
|
2007
2007
|
}, i = new ResizeObserver(s);
|
|
2008
2008
|
return i.observe(e), r(), () => {
|
|
2009
2009
|
i.disconnect(), n !== null && clearTimeout(n);
|
|
2010
2010
|
};
|
|
2011
|
-
},
|
|
2011
|
+
}, Sl = (e, t, r, n) => {
|
|
2012
2012
|
let s = null, i = null;
|
|
2013
2013
|
const l = () => {
|
|
2014
2014
|
i = null;
|
|
@@ -2017,24 +2017,24 @@ const hl = 1, gl = "4 3", fl = ({ panelRect: e }) => {
|
|
|
2017
2017
|
n({ clientX: u.clientX, clientY: u.clientY });
|
|
2018
2018
|
const h = e.getBoundingClientRect();
|
|
2019
2019
|
if (h.width === 0 || h.height === 0) return;
|
|
2020
|
-
const
|
|
2020
|
+
const p = {
|
|
2021
2021
|
x: (u.clientX - h.left) / h.width,
|
|
2022
2022
|
y: 1 - (u.clientY - h.top) / h.height
|
|
2023
2023
|
};
|
|
2024
|
-
r.getState().setHoverState(t.query(
|
|
2024
|
+
r.getState().setHoverState(t.query(p));
|
|
2025
2025
|
}, a = (u) => {
|
|
2026
2026
|
s = u, i === null && (i = requestAnimationFrame(l));
|
|
2027
2027
|
}, d = () => {
|
|
2028
2028
|
s = null, i !== null && (cancelAnimationFrame(i), i = null), n(null);
|
|
2029
2029
|
const u = r.getState();
|
|
2030
|
-
u.hover.primary !== null && u.setHoverState(
|
|
2030
|
+
u.hover.primary !== null && u.setHoverState(ln);
|
|
2031
2031
|
};
|
|
2032
2032
|
return e.addEventListener("pointermove", a), e.addEventListener("pointerleave", d), () => {
|
|
2033
2033
|
e.removeEventListener("pointermove", a), e.removeEventListener("pointerleave", d), i !== null && cancelAnimationFrame(i), s = null;
|
|
2034
2034
|
};
|
|
2035
|
-
},
|
|
2035
|
+
}, Al = ({ panelRect: e }) => {
|
|
2036
2036
|
const { engine: t, store: r, overlayRef: n, setCursor: s } = ue();
|
|
2037
|
-
return
|
|
2037
|
+
return Cl({ engine: t, store: r, overlayRef: n, setCursor: s }), /* @__PURE__ */ o(
|
|
2038
2038
|
"rect",
|
|
2039
2039
|
{
|
|
2040
2040
|
ref: n,
|
|
@@ -2047,9 +2047,9 @@ const hl = 1, gl = "4 3", fl = ({ panelRect: e }) => {
|
|
|
2047
2047
|
"data-testid": "pointer-capture-layer"
|
|
2048
2048
|
}
|
|
2049
2049
|
);
|
|
2050
|
-
}, be = "data-hover-active",
|
|
2050
|
+
}, be = "data-hover-active", Ll = (e) => {
|
|
2051
2051
|
const { store: t } = ue(), r = le(t, (n) => n.hover.primary !== null);
|
|
2052
|
-
|
|
2052
|
+
_(() => {
|
|
2053
2053
|
const n = e.current;
|
|
2054
2054
|
if (n)
|
|
2055
2055
|
return r ? n.setAttribute(be, "true") : n.removeAttribute(be), () => {
|
|
@@ -2057,7 +2057,7 @@ const hl = 1, gl = "4 3", fl = ({ panelRect: e }) => {
|
|
|
2057
2057
|
};
|
|
2058
2058
|
}, [e, r]);
|
|
2059
2059
|
}, rt = ({ panelRect: e, zOrder: t }) => {
|
|
2060
|
-
const r =
|
|
2060
|
+
const r = L((l) => l.annotations.custom), n = wn(), s = r.filter((l) => {
|
|
2061
2061
|
const a = n(l.type);
|
|
2062
2062
|
return a !== null && (l.zOrder ?? a.zOrder) === t;
|
|
2063
2063
|
});
|
|
@@ -2078,15 +2078,15 @@ const hl = 1, gl = "4 3", fl = ({ panelRect: e }) => {
|
|
|
2078
2078
|
})
|
|
2079
2079
|
}
|
|
2080
2080
|
);
|
|
2081
|
-
},
|
|
2082
|
-
var
|
|
2083
|
-
const
|
|
2084
|
-
const u = i ? `rotate(-90 ${e} ${t})` : void 0, h = l === "aggregate" ?
|
|
2081
|
+
}, Pr = Ee.xs, Ae = I, Dr = Tt.medium, _l = Tt.semibold, Or = 6, Br = 2, El = 4, Nl = 2, nt = 4;
|
|
2082
|
+
var Fl = "_1agclyl0", Pl = "_1agclyl1", Dl = "_1agclyl2", Ol = { inside: "_1agclyl4 _1agclyl3", outside: "_1agclyl5 _1agclyl3" }, Bl = "_1agclyl6 _1agclyl3";
|
|
2083
|
+
const Ir = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l, position: a, coordType: d }) => {
|
|
2084
|
+
const u = i ? `rotate(-90 ${e} ${t})` : void 0, h = l === "aggregate" ? Bl : Ol[a], p = Il(l, a, d);
|
|
2085
2085
|
return /* @__PURE__ */ g("g", { transform: u, children: [
|
|
2086
|
-
|
|
2086
|
+
p && /* @__PURE__ */ o(
|
|
2087
2087
|
"rect",
|
|
2088
2088
|
{
|
|
2089
|
-
className:
|
|
2089
|
+
className: p,
|
|
2090
2090
|
x: e - r / 2,
|
|
2091
2091
|
y: t - n / 2,
|
|
2092
2092
|
width: r,
|
|
@@ -2097,15 +2097,15 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2097
2097
|
),
|
|
2098
2098
|
/* @__PURE__ */ o("text", { className: h, x: e, y: t, textAnchor: "middle", dominantBaseline: "central", children: s })
|
|
2099
2099
|
] });
|
|
2100
|
-
},
|
|
2101
|
-
if (e === "aggregate") return
|
|
2102
|
-
if (t === "outside" && r === "cartesian") return
|
|
2103
|
-
},
|
|
2104
|
-
dataLabel: { x:
|
|
2105
|
-
stackTotal: { x:
|
|
2106
|
-
},
|
|
2107
|
-
const r = ee(), n =
|
|
2108
|
-
|
|
2100
|
+
}, Il = (e, t, r) => {
|
|
2101
|
+
if (e === "aggregate") return Dl;
|
|
2102
|
+
if (t === "outside" && r === "cartesian") return Pl;
|
|
2103
|
+
}, Rl = {
|
|
2104
|
+
dataLabel: { x: Or, y: Br },
|
|
2105
|
+
stackTotal: { x: El, y: Nl }
|
|
2106
|
+
}, Hl = ({ panelRect: e, formattingLocale: t }) => {
|
|
2107
|
+
const r = ee(), n = L(
|
|
2108
|
+
D((a) => ({
|
|
2109
2109
|
layers: a.layers,
|
|
2110
2110
|
coordSystem: a.coordSystem,
|
|
2111
2111
|
axes: a.guides.axes,
|
|
@@ -2113,15 +2113,15 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2113
2113
|
parsingLocale: a.config.parsingLocale,
|
|
2114
2114
|
textScale: a.config.appearance.textScale
|
|
2115
2115
|
}))
|
|
2116
|
-
), s =
|
|
2117
|
-
const a =
|
|
2116
|
+
), s = b(() => {
|
|
2117
|
+
const a = G(Pr, n.textScale);
|
|
2118
2118
|
return {
|
|
2119
|
-
dataLabel: { family: Ae, size: a, weight:
|
|
2120
|
-
stackTotal: { family: Ae, size: a, weight:
|
|
2119
|
+
dataLabel: { family: Ae, size: a, weight: Dr },
|
|
2120
|
+
stackTotal: { family: Ae, size: a, weight: _l }
|
|
2121
2121
|
};
|
|
2122
|
-
}, [n.textScale]), i =
|
|
2122
|
+
}, [n.textScale]), i = b(
|
|
2123
2123
|
() => (a, d) => {
|
|
2124
|
-
const u = r.measureText(d, s[a]), h =
|
|
2124
|
+
const u = r.measureText(d, s[a]), h = Rl[a];
|
|
2125
2125
|
return {
|
|
2126
2126
|
...u,
|
|
2127
2127
|
width: u.width + h.x * 2,
|
|
@@ -2129,12 +2129,12 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2129
2129
|
};
|
|
2130
2130
|
},
|
|
2131
2131
|
[r, s]
|
|
2132
|
-
), l =
|
|
2133
|
-
() =>
|
|
2132
|
+
), l = b(
|
|
2133
|
+
() => cn({ ...n, panelRect: e, measureDataLabel: i, formattingLocale: t }),
|
|
2134
2134
|
[n, e, i, t]
|
|
2135
2135
|
);
|
|
2136
|
-
return /* @__PURE__ */ o("g", { className:
|
|
2137
|
-
|
|
2136
|
+
return /* @__PURE__ */ o("g", { className: Fl, transform: `translate(${e.x}, ${e.y})`, "data-testid": "data-labels", children: l.labels.map((a) => /* @__PURE__ */ o(
|
|
2137
|
+
Ir,
|
|
2138
2138
|
{
|
|
2139
2139
|
x: a.x,
|
|
2140
2140
|
y: a.y,
|
|
@@ -2148,13 +2148,13 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2148
2148
|
},
|
|
2149
2149
|
a.key
|
|
2150
2150
|
)) });
|
|
2151
|
-
},
|
|
2151
|
+
}, Ml = ({ linePath: e, arrowheadPath: t, stroke: r, strokeWidth: n }) => {
|
|
2152
2152
|
const s = { stroke: r, strokeWidth: n, strokeLinecap: "round", fill: "none" };
|
|
2153
2153
|
return /* @__PURE__ */ g("g", { children: [
|
|
2154
2154
|
/* @__PURE__ */ o("path", { d: e, ...s }),
|
|
2155
2155
|
/* @__PURE__ */ o("path", { d: t, ...s, strokeLinejoin: "round" })
|
|
2156
2156
|
] });
|
|
2157
|
-
},
|
|
2157
|
+
}, Gl = ({
|
|
2158
2158
|
x: e,
|
|
2159
2159
|
y: t,
|
|
2160
2160
|
text: r,
|
|
@@ -2165,18 +2165,18 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2165
2165
|
strokeColor: a,
|
|
2166
2166
|
fontWeight: d
|
|
2167
2167
|
}) => {
|
|
2168
|
-
const u = ee(),
|
|
2169
|
-
() => u.measureText(r, { family:
|
|
2168
|
+
const u = ee(), p = b(
|
|
2169
|
+
() => u.measureText(r, { family: I, size: n, weight: d }),
|
|
2170
2170
|
[u, r, n, d]
|
|
2171
|
-
).width + s * 2,
|
|
2171
|
+
).width + s * 2, f = n + i * 2;
|
|
2172
2172
|
return /* @__PURE__ */ g("g", { style: { pointerEvents: "none" }, children: [
|
|
2173
2173
|
/* @__PURE__ */ o(
|
|
2174
2174
|
"rect",
|
|
2175
2175
|
{
|
|
2176
|
-
x: e -
|
|
2177
|
-
y: t -
|
|
2178
|
-
width:
|
|
2179
|
-
height:
|
|
2176
|
+
x: e - p / 2,
|
|
2177
|
+
y: t - f / 2,
|
|
2178
|
+
width: p,
|
|
2179
|
+
height: f,
|
|
2180
2180
|
rx: 4,
|
|
2181
2181
|
fill: c.graphBackground,
|
|
2182
2182
|
stroke: a,
|
|
@@ -2191,21 +2191,21 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2191
2191
|
dominantBaseline: "central",
|
|
2192
2192
|
textAnchor: "middle",
|
|
2193
2193
|
fill: c.textPrimary,
|
|
2194
|
-
style: { fontFamily:
|
|
2194
|
+
style: { fontFamily: I, fontSize: n, fontWeight: d },
|
|
2195
2195
|
children: r
|
|
2196
2196
|
}
|
|
2197
2197
|
)
|
|
2198
2198
|
] });
|
|
2199
|
-
},
|
|
2200
|
-
const r =
|
|
2201
|
-
|
|
2199
|
+
}, $l = ({ panelRect: e, formattingLocale: t }) => {
|
|
2200
|
+
const r = L(
|
|
2201
|
+
D((s) => ({
|
|
2202
2202
|
differenceArrows: s.annotations.differenceArrows,
|
|
2203
2203
|
mainAxis: s.coordSystem.type === "cartesian" ? s.coordSystem.mainAxis : "x",
|
|
2204
2204
|
textScale: s.config.appearance.textScale
|
|
2205
2205
|
}))
|
|
2206
|
-
), n =
|
|
2206
|
+
), n = b(
|
|
2207
2207
|
() => r.differenceArrows.map(
|
|
2208
|
-
(s) =>
|
|
2208
|
+
(s) => dn({
|
|
2209
2209
|
arrow: s,
|
|
2210
2210
|
mainAxis: r.mainAxis,
|
|
2211
2211
|
panelWidth: e.width,
|
|
@@ -2225,60 +2225,60 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2225
2225
|
strokeWidth: d,
|
|
2226
2226
|
labelPosition: u,
|
|
2227
2227
|
labelText: h,
|
|
2228
|
-
labelLineHeight:
|
|
2229
|
-
labelPaddingX:
|
|
2230
|
-
labelPaddingY:
|
|
2231
|
-
labelStrokeWidth:
|
|
2232
|
-
labelFontWeight:
|
|
2228
|
+
labelLineHeight: p,
|
|
2229
|
+
labelPaddingX: f,
|
|
2230
|
+
labelPaddingY: v,
|
|
2231
|
+
labelStrokeWidth: y,
|
|
2232
|
+
labelFontWeight: m
|
|
2233
2233
|
}) => {
|
|
2234
|
-
const
|
|
2235
|
-
return /* @__PURE__ */ g(
|
|
2234
|
+
const x = s ?? c.defaultAnnotationArrowStroke;
|
|
2235
|
+
return /* @__PURE__ */ g($r.Fragment, { children: [
|
|
2236
2236
|
/* @__PURE__ */ o(
|
|
2237
|
-
|
|
2237
|
+
Ml,
|
|
2238
2238
|
{
|
|
2239
2239
|
linePath: l,
|
|
2240
2240
|
arrowheadPath: a,
|
|
2241
|
-
stroke:
|
|
2241
|
+
stroke: x,
|
|
2242
2242
|
strokeWidth: d
|
|
2243
2243
|
}
|
|
2244
2244
|
),
|
|
2245
2245
|
/* @__PURE__ */ o(
|
|
2246
|
-
|
|
2246
|
+
Gl,
|
|
2247
2247
|
{
|
|
2248
2248
|
x: u.x,
|
|
2249
2249
|
y: u.y,
|
|
2250
2250
|
text: h,
|
|
2251
|
-
lineHeight:
|
|
2252
|
-
paddingX:
|
|
2253
|
-
paddingY:
|
|
2254
|
-
strokeWidth:
|
|
2255
|
-
strokeColor:
|
|
2256
|
-
fontWeight:
|
|
2251
|
+
lineHeight: p,
|
|
2252
|
+
paddingX: f,
|
|
2253
|
+
paddingY: v,
|
|
2254
|
+
strokeWidth: y,
|
|
2255
|
+
strokeColor: x,
|
|
2256
|
+
fontWeight: m
|
|
2257
2257
|
}
|
|
2258
2258
|
)
|
|
2259
2259
|
] }, i);
|
|
2260
2260
|
}
|
|
2261
2261
|
) });
|
|
2262
|
-
},
|
|
2262
|
+
}, zl = 0, Vl = 1.15, ot = 1.15, Wl = "rgba(0, 0, 0, 0.16)", st = 2, ql = 1.4, Xl = ({
|
|
2263
2263
|
arrow: e,
|
|
2264
2264
|
fallbackColor: t,
|
|
2265
2265
|
stickerOutlineColor: r,
|
|
2266
2266
|
stickerOutlineColorInverse: n
|
|
2267
2267
|
}) => {
|
|
2268
|
-
const s =
|
|
2268
|
+
const s = ft(), i = e.color ?? t, l = jl(e.color, r, n), a = e.dashArray ? { strokeDasharray: e.dashArray, strokeDashoffset: e.dashOffset } : {}, d = e.arrowheadExtent + e.strokeWidth + st + ot, u = {
|
|
2269
2269
|
x: Math.min(e.startX, e.endX) - d,
|
|
2270
2270
|
y: Math.min(e.startY, e.endY) - d,
|
|
2271
2271
|
width: Math.abs(e.endX - e.startX) + 2 * d,
|
|
2272
2272
|
height: Math.abs(e.endY - e.startY) + 2 * d
|
|
2273
|
-
}, h = [e.linePath, e.startArrowheadPath, e.endArrowheadPath].filter((
|
|
2273
|
+
}, h = [e.linePath, e.startArrowheadPath, e.endArrowheadPath].filter((p) => p.length > 0).join(" ");
|
|
2274
2274
|
return /* @__PURE__ */ g("g", { children: [
|
|
2275
2275
|
e.hasStickerStyle && /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("filter", { id: s, filterUnits: "userSpaceOnUse", ...u, children: /* @__PURE__ */ o(
|
|
2276
2276
|
"feDropShadow",
|
|
2277
2277
|
{
|
|
2278
|
-
dx:
|
|
2279
|
-
dy:
|
|
2278
|
+
dx: zl,
|
|
2279
|
+
dy: Vl,
|
|
2280
2280
|
stdDeviation: ot,
|
|
2281
|
-
floodColor:
|
|
2281
|
+
floodColor: Wl
|
|
2282
2282
|
}
|
|
2283
2283
|
) }) }),
|
|
2284
2284
|
/* @__PURE__ */ g("g", { filter: e.hasStickerStyle ? `url(#${s})` : void 0, children: [
|
|
@@ -2325,20 +2325,20 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2325
2325
|
)
|
|
2326
2326
|
] })
|
|
2327
2327
|
] });
|
|
2328
|
-
},
|
|
2328
|
+
}, jl = (e, t, r) => {
|
|
2329
2329
|
if (e === null) return r;
|
|
2330
2330
|
try {
|
|
2331
|
-
return
|
|
2331
|
+
return $n(e, t) < ql ? r : t;
|
|
2332
2332
|
} catch {
|
|
2333
2333
|
return r;
|
|
2334
2334
|
}
|
|
2335
|
-
},
|
|
2336
|
-
const { themeValues: t } = Ge(), r =
|
|
2337
|
-
() => r.map((s) =>
|
|
2335
|
+
}, Yl = ({ panelRect: e }) => {
|
|
2336
|
+
const { themeValues: t } = Ge(), r = L((s) => s.annotations.freeformArrows), n = b(
|
|
2337
|
+
() => r.map((s) => un({ arrow: s, panelWidth: e.width, panelHeight: e.height })).filter((s) => s !== null),
|
|
2338
2338
|
[r, e.width, e.height]
|
|
2339
2339
|
);
|
|
2340
2340
|
return n.length === 0 ? null : /* @__PURE__ */ o("g", { transform: `translate(${e.x}, ${e.y})`, "data-testid": "freeform-arrows", children: n.map((s) => /* @__PURE__ */ o(
|
|
2341
|
-
|
|
2341
|
+
Xl,
|
|
2342
2342
|
{
|
|
2343
2343
|
arrow: s,
|
|
2344
2344
|
fallbackColor: c.defaultAnnotationArrowStroke,
|
|
@@ -2347,15 +2347,15 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2347
2347
|
},
|
|
2348
2348
|
s.id
|
|
2349
2349
|
)) });
|
|
2350
|
-
},
|
|
2351
|
-
const i =
|
|
2352
|
-
return d ? /* @__PURE__ */ o("svg", { x: i, y: u ? "100%" : 0, style: { overflow: "visible" }, children: /* @__PURE__ */ o("text", { ...
|
|
2353
|
-
},
|
|
2350
|
+
}, Ul = ({ edge: e, areTicksVisible: t, position: r, labelRotation: n, label: s }) => {
|
|
2351
|
+
const i = C(r), l = t ? 1 : 0, a = { style: { font: c.fontTickLabel }, fill: c.textSecondary }, d = n !== 0 && (e === "top" || e === "bottom"), u = e === "top";
|
|
2352
|
+
return d ? /* @__PURE__ */ o("svg", { x: i, y: u ? "100%" : 0, style: { overflow: "visible" }, children: /* @__PURE__ */ o("text", { ...Zl(u, l, n), ...a, children: s }) }) : /* @__PURE__ */ o("text", { ...Kl(e, i, l), ...a, children: s });
|
|
2353
|
+
}, Kl = (e, t, r) => {
|
|
2354
2354
|
switch (e) {
|
|
2355
2355
|
case "bottom":
|
|
2356
2356
|
return {
|
|
2357
2357
|
x: t,
|
|
2358
|
-
y:
|
|
2358
|
+
y: H * r,
|
|
2359
2359
|
textAnchor: "middle",
|
|
2360
2360
|
dominantBaseline: "hanging"
|
|
2361
2361
|
};
|
|
@@ -2363,28 +2363,28 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2363
2363
|
return {
|
|
2364
2364
|
x: t,
|
|
2365
2365
|
y: "100%",
|
|
2366
|
-
dy: -
|
|
2366
|
+
dy: -H * r,
|
|
2367
2367
|
textAnchor: "middle",
|
|
2368
2368
|
dominantBaseline: "auto"
|
|
2369
2369
|
};
|
|
2370
2370
|
case "left":
|
|
2371
2371
|
return {
|
|
2372
2372
|
x: "100%",
|
|
2373
|
-
dx: -
|
|
2373
|
+
dx: -H * r,
|
|
2374
2374
|
y: t,
|
|
2375
2375
|
textAnchor: "end",
|
|
2376
2376
|
dominantBaseline: "central"
|
|
2377
2377
|
};
|
|
2378
2378
|
case "right":
|
|
2379
2379
|
return {
|
|
2380
|
-
x:
|
|
2380
|
+
x: H * r,
|
|
2381
2381
|
y: t,
|
|
2382
2382
|
textAnchor: "start",
|
|
2383
2383
|
dominantBaseline: "central"
|
|
2384
2384
|
};
|
|
2385
2385
|
}
|
|
2386
|
-
},
|
|
2387
|
-
const n =
|
|
2386
|
+
}, Zl = (e, t, r) => {
|
|
2387
|
+
const n = H * t, s = e ? -n : n;
|
|
2388
2388
|
return {
|
|
2389
2389
|
x: 0,
|
|
2390
2390
|
y: s,
|
|
@@ -2392,16 +2392,16 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2392
2392
|
dominantBaseline: "central",
|
|
2393
2393
|
transform: `rotate(${r}, 0, ${s})`
|
|
2394
2394
|
};
|
|
2395
|
-
},
|
|
2395
|
+
}, Jl = ({ formattedAxis: e, rect: t }) => {
|
|
2396
2396
|
const r = e.position === "bottom" || e.position === "top";
|
|
2397
2397
|
return /* @__PURE__ */ g("svg", { x: t.x, y: t.y, width: t.width, height: t.height, style: { overflow: "visible" }, children: [
|
|
2398
|
-
|
|
2398
|
+
zt,
|
|
2399
2399
|
e.ticks.map((n, s) => {
|
|
2400
|
-
const i = n.formattedLabel, l = r ? n.position : 1 - n.position, a =
|
|
2400
|
+
const i = n.formattedLabel, l = r ? n.position : 1 - n.position, a = Ql(e.position, l, t);
|
|
2401
2401
|
return /* @__PURE__ */ g("g", { children: [
|
|
2402
2402
|
e.ticksVisible && /* @__PURE__ */ o("line", { ...a, stroke: c.gridLineColor, strokeWidth: 1 }),
|
|
2403
2403
|
/* @__PURE__ */ o(
|
|
2404
|
-
|
|
2404
|
+
Ul,
|
|
2405
2405
|
{
|
|
2406
2406
|
edge: e.position,
|
|
2407
2407
|
areTicksVisible: e.ticksVisible,
|
|
@@ -2413,8 +2413,8 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2413
2413
|
] }, s);
|
|
2414
2414
|
})
|
|
2415
2415
|
] });
|
|
2416
|
-
},
|
|
2417
|
-
const n =
|
|
2416
|
+
}, Ql = (e, t, r) => {
|
|
2417
|
+
const n = C(t);
|
|
2418
2418
|
switch (e) {
|
|
2419
2419
|
case "bottom":
|
|
2420
2420
|
return { x1: n, y1: 0, x2: n, y2: se };
|
|
@@ -2425,18 +2425,18 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2425
2425
|
case "right":
|
|
2426
2426
|
return { x1: 0, y1: n, x2: se, y2: n };
|
|
2427
2427
|
}
|
|
2428
|
-
},
|
|
2428
|
+
}, ec = ({ formattedAxes: e, rects: t }) => /* @__PURE__ */ o(N, { children: e.map((r) => {
|
|
2429
2429
|
const n = t[r.position];
|
|
2430
|
-
return !n || !r.isVisible ? null : /* @__PURE__ */ o(
|
|
2431
|
-
}) }),
|
|
2430
|
+
return !n || !r.isVisible ? null : /* @__PURE__ */ o(Jl, { formattedAxis: r, rect: n }, r.scaleAestheticKey);
|
|
2431
|
+
}) }), tc = ({ axes: e, rects: t }) => /* @__PURE__ */ o(N, { children: e.map((r) => {
|
|
2432
2432
|
const n = t[r.position];
|
|
2433
2433
|
if (!n || !r.isVisible) return null;
|
|
2434
|
-
const s =
|
|
2434
|
+
const s = rc(r.position, n);
|
|
2435
2435
|
return /* @__PURE__ */ g("g", { transform: `translate(${n.x}, ${n.y})`, children: [
|
|
2436
|
-
|
|
2436
|
+
zt,
|
|
2437
2437
|
/* @__PURE__ */ o("text", { style: { font: c.fontAxisLabel }, fill: c.textPrimary, ...s, children: r.label })
|
|
2438
2438
|
] }, `axis-label-${r.position}`);
|
|
2439
|
-
}) }),
|
|
2439
|
+
}) }), rc = (e, t) => {
|
|
2440
2440
|
const r = {
|
|
2441
2441
|
x: t.width / 2,
|
|
2442
2442
|
y: t.height / 2,
|
|
@@ -2449,7 +2449,7 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2449
2449
|
strokeDashoffset: "0",
|
|
2450
2450
|
strokeDasharray: "2 3",
|
|
2451
2451
|
strokeLinecap: "round"
|
|
2452
|
-
},
|
|
2452
|
+
}, nc = ({ axes: e, panel: t, panelRect: r }) => /* @__PURE__ */ g(
|
|
2453
2453
|
"svg",
|
|
2454
2454
|
{
|
|
2455
2455
|
x: r.x,
|
|
@@ -2477,14 +2477,52 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2477
2477
|
const s = n.position === "bottom" || n.position === "top";
|
|
2478
2478
|
return /* @__PURE__ */ o("g", { children: n.ticks.map((i, l) => {
|
|
2479
2479
|
if (i.position <= 0 || i.position >= 1) return null;
|
|
2480
|
-
const a = s ? i.position : 1 - i.position, d =
|
|
2480
|
+
const a = s ? i.position : 1 - i.position, d = C(a);
|
|
2481
2481
|
return /* @__PURE__ */ o("line", { ...s ? { x1: d, y1: 0, x2: d, y2: "100%" } : { x1: 0, y1: d, x2: "100%", y2: d }, ...it, stroke: c.gridLineColor }, l);
|
|
2482
2482
|
}) }, n.scaleAestheticKey);
|
|
2483
2483
|
})
|
|
2484
2484
|
]
|
|
2485
2485
|
}
|
|
2486
|
-
), at = ({
|
|
2487
|
-
const n =
|
|
2486
|
+
), at = 8, lt = 0.5, ct = { strokeWidth: 1, strokeLinecap: "round" }, oc = ({ axes: e, panelRect: t, coordSystem: r }) => {
|
|
2487
|
+
const n = e.find((m) => m.geometry === "circular"), s = e.find((m) => m.geometry === "radial");
|
|
2488
|
+
if (!n || n.ticks.length === 0) return null;
|
|
2489
|
+
const i = t.x + t.width / 2, l = t.y + t.height / 2, a = Math.min(t.width, t.height) / 2, { startAngle: d, innerRadius: u } = r, h = (m) => m * 2 * Math.PI + d, p = (m, x) => {
|
|
2490
|
+
const k = i + x * Math.sin(m), w = l - x * Math.cos(m);
|
|
2491
|
+
return `${k.toFixed(2)},${w.toFixed(2)}`;
|
|
2492
|
+
}, f = n.ticks.map((m) => h(m.position)), v = (m) => `${f.map((x, k) => `${k === 0 ? "M" : "L"} ${p(x, m)}`).join(" ")} Z`, y = (s?.ticks ?? []).map((m) => (u + m.position * (1 - u)) * a).filter((m) => m > lt);
|
|
2493
|
+
return y.some((m) => Math.abs(m - a) < lt) || y.push(a), /* @__PURE__ */ g("g", { "data-guide": "polar", style: { overflow: "visible" }, children: [
|
|
2494
|
+
y.map((m, x) => /* @__PURE__ */ o("path", { d: v(m), fill: "none", stroke: c.gridLineColor, ...ct }, `ring-${x}`)),
|
|
2495
|
+
f.map((m, x) => /* @__PURE__ */ o(
|
|
2496
|
+
"line",
|
|
2497
|
+
{
|
|
2498
|
+
x1: i,
|
|
2499
|
+
y1: l,
|
|
2500
|
+
x2: i + a * Math.sin(m),
|
|
2501
|
+
y2: l - a * Math.cos(m),
|
|
2502
|
+
stroke: c.gridLineColor,
|
|
2503
|
+
...ct
|
|
2504
|
+
},
|
|
2505
|
+
`spoke-${x}`
|
|
2506
|
+
)),
|
|
2507
|
+
n.ticks.map((m, x) => {
|
|
2508
|
+
const k = h(m.position), w = Math.sin(k), O = -Math.cos(k);
|
|
2509
|
+
return /* @__PURE__ */ o(
|
|
2510
|
+
"text",
|
|
2511
|
+
{
|
|
2512
|
+
x: i + w * (a + at),
|
|
2513
|
+
y: l + O * (a + at),
|
|
2514
|
+
textAnchor: w > 0.1 ? "start" : w < -0.1 ? "end" : "middle",
|
|
2515
|
+
dominantBaseline: O > 0.1 ? "hanging" : O < -0.1 ? "auto" : "central",
|
|
2516
|
+
style: { font: c.fontTickLabel },
|
|
2517
|
+
fill: c.textSecondary,
|
|
2518
|
+
children: m.formattedLabel
|
|
2519
|
+
},
|
|
2520
|
+
`label-${x}`
|
|
2521
|
+
);
|
|
2522
|
+
})
|
|
2523
|
+
] });
|
|
2524
|
+
}, dt = ({ panelRect: e, zOrder: t }) => {
|
|
2525
|
+
const n = L((s) => s.annotations.shapes).filter((s) => s.zOrder === t);
|
|
2488
2526
|
return n.length === 0 ? null : /* @__PURE__ */ o(
|
|
2489
2527
|
"svg",
|
|
2490
2528
|
{
|
|
@@ -2494,26 +2532,26 @@ const Dr = ({ x: e, y: t, width: r, height: n, text: s, isRotated: i, target: l,
|
|
|
2494
2532
|
height: e.height,
|
|
2495
2533
|
overflow: "visible",
|
|
2496
2534
|
"data-testid": `shapes-${t}`,
|
|
2497
|
-
children: n.map(({ id: s, x: i, y: l, width: a, height: d, fillColor: u, fillOpacity: h, strokeWidth:
|
|
2535
|
+
children: n.map(({ id: s, x: i, y: l, width: a, height: d, fillColor: u, fillOpacity: h, strokeWidth: p, strokeColor: f }) => /* @__PURE__ */ o(
|
|
2498
2536
|
"rect",
|
|
2499
2537
|
{
|
|
2500
|
-
x:
|
|
2501
|
-
y:
|
|
2502
|
-
width:
|
|
2503
|
-
height:
|
|
2538
|
+
x: C(i),
|
|
2539
|
+
y: C(l),
|
|
2540
|
+
width: C(a),
|
|
2541
|
+
height: C(d),
|
|
2504
2542
|
fill: u,
|
|
2505
2543
|
fillOpacity: h,
|
|
2506
|
-
stroke:
|
|
2507
|
-
strokeWidth:
|
|
2544
|
+
stroke: p > 0 ? f ?? c.defaultAnnotationShapeStroke : "none",
|
|
2545
|
+
strokeWidth: p
|
|
2508
2546
|
},
|
|
2509
2547
|
s
|
|
2510
2548
|
))
|
|
2511
2549
|
}
|
|
2512
2550
|
);
|
|
2513
2551
|
};
|
|
2514
|
-
var
|
|
2515
|
-
const
|
|
2516
|
-
const t =
|
|
2552
|
+
var sc = "_120wioc0";
|
|
2553
|
+
const ic = ({ panelRect: e }) => {
|
|
2554
|
+
const t = L((r) => r.annotations.textAnnotations);
|
|
2517
2555
|
return t.length === 0 ? null : /* @__PURE__ */ o(
|
|
2518
2556
|
"svg",
|
|
2519
2557
|
{
|
|
@@ -2526,16 +2564,16 @@ const tc = ({ panelRect: e }) => {
|
|
|
2526
2564
|
children: t.map((r) => /* @__PURE__ */ o(
|
|
2527
2565
|
"foreignObject",
|
|
2528
2566
|
{
|
|
2529
|
-
x:
|
|
2530
|
-
y:
|
|
2531
|
-
width:
|
|
2532
|
-
height:
|
|
2567
|
+
x: C(r.x),
|
|
2568
|
+
y: C(r.y),
|
|
2569
|
+
width: C(r.width),
|
|
2570
|
+
height: C(1 - r.y),
|
|
2533
2571
|
overflow: "visible",
|
|
2534
2572
|
children: /* @__PURE__ */ o(
|
|
2535
2573
|
"div",
|
|
2536
2574
|
{
|
|
2537
|
-
className:
|
|
2538
|
-
style:
|
|
2575
|
+
className: sc,
|
|
2576
|
+
style: ac(r.backgroundColor, r.backgroundColorStyle),
|
|
2539
2577
|
children: /* @__PURE__ */ o(de, { content: r.content })
|
|
2540
2578
|
}
|
|
2541
2579
|
)
|
|
@@ -2544,7 +2582,7 @@ const tc = ({ panelRect: e }) => {
|
|
|
2544
2582
|
))
|
|
2545
2583
|
}
|
|
2546
2584
|
);
|
|
2547
|
-
},
|
|
2585
|
+
}, ac = (e, t) => e === null || e === "transparent" ? { color: c.textPrimary } : t === "fade" ? {
|
|
2548
2586
|
color: c.textPrimary,
|
|
2549
2587
|
backgroundColor: Te(e, c.grey100, 0.5),
|
|
2550
2588
|
boxShadow: `0 0 0 1.5px ${Te(e, c.grey0, 0.2)}`
|
|
@@ -2553,8 +2591,8 @@ const tc = ({ panelRect: e }) => {
|
|
|
2553
2591
|
backgroundColor: e,
|
|
2554
2592
|
boxShadow: `0 0 0 1.5px ${ge(e, 0.1)}`
|
|
2555
2593
|
};
|
|
2556
|
-
var
|
|
2557
|
-
const
|
|
2594
|
+
var lc = "usd3ea0", cc = "usd3ea1";
|
|
2595
|
+
const dc = ({
|
|
2558
2596
|
layer: e,
|
|
2559
2597
|
coordSystem: t,
|
|
2560
2598
|
isAnimated: r,
|
|
@@ -2570,14 +2608,14 @@ const sc = ({
|
|
|
2570
2608
|
"g",
|
|
2571
2609
|
{
|
|
2572
2610
|
className: j({
|
|
2573
|
-
[
|
|
2574
|
-
[
|
|
2611
|
+
[cc]: n && s === "desaturate",
|
|
2612
|
+
[lc]: n && s === "dim"
|
|
2575
2613
|
}),
|
|
2576
2614
|
children: a.render({ layer: e, coordSystem: t, isAnimated: r, formattingLocale: i })
|
|
2577
2615
|
}
|
|
2578
2616
|
);
|
|
2579
2617
|
};
|
|
2580
|
-
function
|
|
2618
|
+
function uc({
|
|
2581
2619
|
plugin: e,
|
|
2582
2620
|
layer: t,
|
|
2583
2621
|
coordSystem: r,
|
|
@@ -2591,7 +2629,7 @@ function ic({
|
|
|
2591
2629
|
}
|
|
2592
2630
|
return s;
|
|
2593
2631
|
}
|
|
2594
|
-
const
|
|
2632
|
+
const hc = 4, gc = ({
|
|
2595
2633
|
plugin: e,
|
|
2596
2634
|
layer: t,
|
|
2597
2635
|
matchedLayer: r,
|
|
@@ -2601,34 +2639,34 @@ const ac = 4, lc = ({
|
|
|
2601
2639
|
panelRect: l,
|
|
2602
2640
|
formattingLocale: a
|
|
2603
2641
|
}) => {
|
|
2604
|
-
const { numberFormat: d, textScale: u } =
|
|
2605
|
-
|
|
2606
|
-
numberFormat:
|
|
2607
|
-
textScale:
|
|
2642
|
+
const { numberFormat: d, textScale: u } = L(
|
|
2643
|
+
D((y) => ({
|
|
2644
|
+
numberFormat: y.config.numberFormat,
|
|
2645
|
+
textScale: y.config.appearance.textScale
|
|
2608
2646
|
}))
|
|
2609
|
-
), h =
|
|
2610
|
-
() =>
|
|
2647
|
+
), h = b(
|
|
2648
|
+
() => uc({ plugin: e, layer: t, coordSystem: s, candidates: n }),
|
|
2611
2649
|
[e, t, s, n]
|
|
2612
|
-
),
|
|
2613
|
-
() =>
|
|
2650
|
+
), p = b(() => hn(t), [t]), f = b(
|
|
2651
|
+
() => gn({ layer: t, numberFormat: d, locale: a }),
|
|
2614
2652
|
[d, t, a]
|
|
2615
|
-
),
|
|
2616
|
-
return e === null || r === null && h.length === 0 ? null : /* @__PURE__ */ g(
|
|
2653
|
+
), v = Pr * An * u;
|
|
2654
|
+
return e === null || r === null && h.length === 0 ? null : /* @__PURE__ */ g(N, { children: [
|
|
2617
2655
|
r ? e.render({ layer: r, coordSystem: s, isAnimated: i, formattingLocale: a }) : null,
|
|
2618
|
-
h.map(({ observation:
|
|
2619
|
-
|
|
2656
|
+
h.map(({ observation: y, observationIndex: m, anchor: x }) => /* @__PURE__ */ o(
|
|
2657
|
+
fc,
|
|
2620
2658
|
{
|
|
2621
|
-
observation:
|
|
2622
|
-
anchor:
|
|
2659
|
+
observation: y,
|
|
2660
|
+
anchor: x,
|
|
2623
2661
|
panelRect: l,
|
|
2624
|
-
readSegmentY:
|
|
2625
|
-
formatYValue:
|
|
2626
|
-
labelFontSizePx:
|
|
2662
|
+
readSegmentY: p,
|
|
2663
|
+
formatYValue: f,
|
|
2664
|
+
labelFontSizePx: v
|
|
2627
2665
|
},
|
|
2628
|
-
|
|
2666
|
+
pc(y, m)
|
|
2629
2667
|
))
|
|
2630
2668
|
] });
|
|
2631
|
-
},
|
|
2669
|
+
}, fc = ({
|
|
2632
2670
|
observation: e,
|
|
2633
2671
|
anchor: t,
|
|
2634
2672
|
panelRect: r,
|
|
@@ -2636,37 +2674,37 @@ const ac = 4, lc = ({
|
|
|
2636
2674
|
formatYValue: s,
|
|
2637
2675
|
labelFontSizePx: i
|
|
2638
2676
|
}) => {
|
|
2639
|
-
const l = ee(), a = Fe(t.x), d = Ne(t.y), u = (
|
|
2640
|
-
if (
|
|
2641
|
-
const
|
|
2677
|
+
const l = ee(), a = Fe(t.x), d = Ne(t.y), u = (fn(e) ?? Sn) / 2, h = n(e), p = pn(h) ? s(h, e) : null, f = b(() => {
|
|
2678
|
+
if (p === null) return null;
|
|
2679
|
+
const v = l.measureText(p, {
|
|
2642
2680
|
family: Ae,
|
|
2643
2681
|
size: i,
|
|
2644
|
-
weight:
|
|
2682
|
+
weight: Dr
|
|
2645
2683
|
});
|
|
2646
2684
|
return {
|
|
2647
|
-
width:
|
|
2648
|
-
height:
|
|
2685
|
+
width: v.width + Or * 2,
|
|
2686
|
+
height: v.height + Br * 2
|
|
2649
2687
|
};
|
|
2650
|
-
}, [
|
|
2651
|
-
return /* @__PURE__ */ g(
|
|
2688
|
+
}, [p, l, i]);
|
|
2689
|
+
return /* @__PURE__ */ g(N, { children: [
|
|
2652
2690
|
/* @__PURE__ */ o(
|
|
2653
2691
|
"circle",
|
|
2654
2692
|
{
|
|
2655
2693
|
"data-testid": "highlight-overlay-dot",
|
|
2656
|
-
cx:
|
|
2657
|
-
cy:
|
|
2694
|
+
cx: C(a),
|
|
2695
|
+
cy: C(d),
|
|
2658
2696
|
r: u,
|
|
2659
|
-
fill:
|
|
2697
|
+
fill: mn(e)
|
|
2660
2698
|
}
|
|
2661
2699
|
),
|
|
2662
|
-
|
|
2663
|
-
|
|
2700
|
+
p !== null && f !== null && /* @__PURE__ */ o(
|
|
2701
|
+
Ir,
|
|
2664
2702
|
{
|
|
2665
2703
|
x: a * r.width,
|
|
2666
|
-
y: d * r.height - u -
|
|
2667
|
-
width:
|
|
2668
|
-
height:
|
|
2669
|
-
text:
|
|
2704
|
+
y: d * r.height - u - hc - f.height / 2,
|
|
2705
|
+
width: f.width,
|
|
2706
|
+
height: f.height,
|
|
2707
|
+
text: p,
|
|
2670
2708
|
isRotated: !1,
|
|
2671
2709
|
target: "observation",
|
|
2672
2710
|
position: "outside",
|
|
@@ -2674,12 +2712,12 @@ const ac = 4, lc = ({
|
|
|
2674
2712
|
}
|
|
2675
2713
|
)
|
|
2676
2714
|
] });
|
|
2677
|
-
},
|
|
2678
|
-
const r = e[
|
|
2715
|
+
}, pc = (e, t) => {
|
|
2716
|
+
const r = e[yn.group];
|
|
2679
2717
|
return `${String(r ?? "")}\0${t}`;
|
|
2680
|
-
},
|
|
2718
|
+
}, mc = ({ layer: e, coordSystem: t, panelRect: r }) => {
|
|
2681
2719
|
const n = Q(), { primary: s, group: i, related: l } = he(
|
|
2682
|
-
|
|
2720
|
+
D((u) => ({
|
|
2683
2721
|
primary: u.hover.primary,
|
|
2684
2722
|
group: u.hover.group,
|
|
2685
2723
|
related: u.hover.related
|
|
@@ -2698,10 +2736,10 @@ const ac = 4, lc = ({
|
|
|
2698
2736
|
panelRect: r
|
|
2699
2737
|
}) : d.length === 0 ? null : a.renderHoverCompanions({ layer: e, primary: s, related: d });
|
|
2700
2738
|
};
|
|
2701
|
-
var
|
|
2702
|
-
const
|
|
2703
|
-
const { layers: n, coordSystem: s, highlightStyle: i } =
|
|
2704
|
-
|
|
2739
|
+
var yc = "to1jkx0", vc = "to1jkx1";
|
|
2740
|
+
const bc = ({ shouldAnimate: e, panelRect: t, formattingLocale: r }) => {
|
|
2741
|
+
const { layers: n, coordSystem: s, highlightStyle: i } = L(
|
|
2742
|
+
D((l) => ({
|
|
2705
2743
|
layers: l.layers,
|
|
2706
2744
|
coordSystem: l.coordSystem,
|
|
2707
2745
|
highlightStyle: l.config.appearance.highlightStyle
|
|
@@ -2714,11 +2752,11 @@ const fc = ({ shouldAnimate: e, panelRect: t, formattingLocale: r }) => {
|
|
|
2714
2752
|
y: t.y,
|
|
2715
2753
|
width: t.width,
|
|
2716
2754
|
height: t.height,
|
|
2717
|
-
className:
|
|
2755
|
+
className: yc,
|
|
2718
2756
|
"data-testid": "geom-layers",
|
|
2719
|
-
children: n.map((l) => /* @__PURE__ */ g(
|
|
2757
|
+
children: n.map((l) => /* @__PURE__ */ g(pt, { children: [
|
|
2720
2758
|
/* @__PURE__ */ o(
|
|
2721
|
-
|
|
2759
|
+
Cc,
|
|
2722
2760
|
{
|
|
2723
2761
|
layer: l,
|
|
2724
2762
|
coordSystem: s,
|
|
@@ -2728,14 +2766,14 @@ const fc = ({ shouldAnimate: e, panelRect: t, formattingLocale: r }) => {
|
|
|
2728
2766
|
formattingLocale: r
|
|
2729
2767
|
}
|
|
2730
2768
|
),
|
|
2731
|
-
/* @__PURE__ */ o(
|
|
2732
|
-
] }, `${l.id}-${
|
|
2769
|
+
/* @__PURE__ */ o(mc, { layer: l, coordSystem: s, panelRect: t })
|
|
2770
|
+
] }, `${l.id}-${xc(s)}`))
|
|
2733
2771
|
}
|
|
2734
2772
|
);
|
|
2735
|
-
},
|
|
2773
|
+
}, xc = (e) => e.type === "cartesian" ? `cartesian-${e.mainAxis}` : e.type, kc = (e) => {
|
|
2736
2774
|
if (e.highlight !== null)
|
|
2737
|
-
return
|
|
2738
|
-
},
|
|
2775
|
+
return vc;
|
|
2776
|
+
}, Cc = ({
|
|
2739
2777
|
layer: e,
|
|
2740
2778
|
coordSystem: t,
|
|
2741
2779
|
highlightStyle: r,
|
|
@@ -2743,10 +2781,10 @@ const fc = ({ shouldAnimate: e, panelRect: t, formattingLocale: r }) => {
|
|
|
2743
2781
|
panelRect: s,
|
|
2744
2782
|
formattingLocale: i
|
|
2745
2783
|
}) => {
|
|
2746
|
-
const l = Q(), a =
|
|
2747
|
-
return /* @__PURE__ */ g("g", { className:
|
|
2784
|
+
const l = Q(), a = b(() => l(e, t), [l, e, t]), d = e.highlight;
|
|
2785
|
+
return /* @__PURE__ */ g("g", { className: kc(e), children: [
|
|
2748
2786
|
/* @__PURE__ */ o(
|
|
2749
|
-
|
|
2787
|
+
dc,
|
|
2750
2788
|
{
|
|
2751
2789
|
layer: e,
|
|
2752
2790
|
coordSystem: t,
|
|
@@ -2757,7 +2795,7 @@ const fc = ({ shouldAnimate: e, panelRect: t, formattingLocale: r }) => {
|
|
|
2757
2795
|
}
|
|
2758
2796
|
),
|
|
2759
2797
|
d !== null && /* @__PURE__ */ o(
|
|
2760
|
-
|
|
2798
|
+
gc,
|
|
2761
2799
|
{
|
|
2762
2800
|
plugin: a,
|
|
2763
2801
|
layer: e,
|
|
@@ -2771,171 +2809,178 @@ const fc = ({ shouldAnimate: e, panelRect: t, formattingLocale: r }) => {
|
|
|
2771
2809
|
)
|
|
2772
2810
|
] });
|
|
2773
2811
|
};
|
|
2774
|
-
var
|
|
2775
|
-
const
|
|
2812
|
+
var Tc = "_17uhij30";
|
|
2813
|
+
const wc = ({
|
|
2776
2814
|
formattedAxes: e,
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2815
|
+
formattedPolarAxes: t,
|
|
2816
|
+
plotRect: r,
|
|
2817
|
+
panelRect: n,
|
|
2818
|
+
axisRects: s,
|
|
2819
|
+
axisLabelRects: i,
|
|
2820
|
+
shouldAnimate: l,
|
|
2821
|
+
formattingLocale: a
|
|
2783
2822
|
}) => {
|
|
2784
|
-
const
|
|
2785
|
-
|
|
2786
|
-
const { axes:
|
|
2787
|
-
|
|
2788
|
-
|
|
2823
|
+
const d = F(null);
|
|
2824
|
+
Ll(d);
|
|
2825
|
+
const { axes: u, panelGuide: h, coordSystem: p } = L(
|
|
2826
|
+
D((x) => ({
|
|
2827
|
+
axes: x.guides.axes,
|
|
2828
|
+
panelGuide: x.guides.panel,
|
|
2829
|
+
coordSystem: x.coordSystem
|
|
2830
|
+
}))
|
|
2831
|
+
), f = b(() => Rr(n, r), [n, r]), v = b(() => ut(s, r), [s, r]), y = b(() => ut(i, r), [i, r]), m = b(() => u.filter((x) => x.geometry === "linear"), [u]);
|
|
2789
2832
|
return /* @__PURE__ */ g(
|
|
2790
2833
|
"svg",
|
|
2791
2834
|
{
|
|
2792
|
-
ref:
|
|
2793
|
-
className:
|
|
2794
|
-
width:
|
|
2795
|
-
height:
|
|
2796
|
-
style: { transform: `translate(${
|
|
2835
|
+
ref: d,
|
|
2836
|
+
className: Tc,
|
|
2837
|
+
width: r.width,
|
|
2838
|
+
height: r.height,
|
|
2839
|
+
style: { transform: `translate(${r.x}px, ${r.y}px)` },
|
|
2797
2840
|
"data-testid": "plot",
|
|
2798
2841
|
children: [
|
|
2799
|
-
/* @__PURE__ */ o(
|
|
2800
|
-
/* @__PURE__ */ o(
|
|
2801
|
-
/* @__PURE__ */ o(
|
|
2802
|
-
/* @__PURE__ */ o(
|
|
2803
|
-
/* @__PURE__ */ o(
|
|
2804
|
-
/* @__PURE__ */ o(
|
|
2805
|
-
/* @__PURE__ */ o(
|
|
2806
|
-
/* @__PURE__ */ o(
|
|
2807
|
-
/* @__PURE__ */ o(
|
|
2808
|
-
/* @__PURE__ */ o(
|
|
2809
|
-
/* @__PURE__ */ o(
|
|
2810
|
-
/* @__PURE__ */ o(
|
|
2811
|
-
/* @__PURE__ */ o(
|
|
2812
|
-
/* @__PURE__ */ o(
|
|
2842
|
+
/* @__PURE__ */ o(nc, { axes: e, panel: h, panelRect: f }),
|
|
2843
|
+
p.type === "polar" && /* @__PURE__ */ o(oc, { axes: t, panelRect: f, coordSystem: p }),
|
|
2844
|
+
/* @__PURE__ */ o(vl, { panelRect: f }),
|
|
2845
|
+
/* @__PURE__ */ o(ec, { formattedAxes: e, rects: v }),
|
|
2846
|
+
/* @__PURE__ */ o(tc, { axes: m, rects: y }),
|
|
2847
|
+
/* @__PURE__ */ o(dt, { panelRect: f, zOrder: "background" }),
|
|
2848
|
+
/* @__PURE__ */ o(rt, { panelRect: f, zOrder: "background" }),
|
|
2849
|
+
/* @__PURE__ */ o(bc, { shouldAnimate: l, panelRect: f, formattingLocale: a }),
|
|
2850
|
+
/* @__PURE__ */ o(Hl, { panelRect: f, formattingLocale: a }),
|
|
2851
|
+
/* @__PURE__ */ o($l, { panelRect: f, formattingLocale: a }),
|
|
2852
|
+
/* @__PURE__ */ o(dt, { panelRect: f, zOrder: "foreground" }),
|
|
2853
|
+
/* @__PURE__ */ o(rt, { panelRect: f, zOrder: "foreground" }),
|
|
2854
|
+
/* @__PURE__ */ o(Yl, { panelRect: f }),
|
|
2855
|
+
/* @__PURE__ */ o(ic, { panelRect: f }),
|
|
2856
|
+
/* @__PURE__ */ o(Al, { panelRect: f })
|
|
2813
2857
|
]
|
|
2814
2858
|
}
|
|
2815
2859
|
);
|
|
2816
|
-
},
|
|
2860
|
+
}, Rr = (e, t) => ({
|
|
2817
2861
|
x: e.x - t.x,
|
|
2818
2862
|
y: e.y - t.y,
|
|
2819
2863
|
width: e.width,
|
|
2820
2864
|
height: e.height
|
|
2821
|
-
}),
|
|
2865
|
+
}), ut = (e, t) => {
|
|
2822
2866
|
const r = {};
|
|
2823
2867
|
for (const [n, s] of Object.entries(e))
|
|
2824
|
-
r[n] =
|
|
2868
|
+
r[n] = Rr(s, t);
|
|
2825
2869
|
return r;
|
|
2826
2870
|
}, xe = {
|
|
2827
2871
|
headerSize: { width: 0, height: 0 },
|
|
2828
2872
|
footerSize: { width: 0, height: 0 }
|
|
2829
|
-
},
|
|
2830
|
-
const [e, t] =
|
|
2831
|
-
return
|
|
2873
|
+
}, Sc = () => {
|
|
2874
|
+
const [e, t] = P(null), [r, n] = P(null), [s, i] = P(xe);
|
|
2875
|
+
return _(() => {
|
|
2832
2876
|
const l = () => {
|
|
2833
2877
|
const d = e ? { width: e.offsetWidth, height: e.offsetHeight } : xe.headerSize, u = r ? { width: r.offsetWidth, height: r.offsetHeight } : xe.footerSize;
|
|
2834
|
-
i((h) =>
|
|
2878
|
+
i((h) => Ac(h, { headerSize: d, footerSize: u }) ? { headerSize: d, footerSize: u } : h);
|
|
2835
2879
|
};
|
|
2836
2880
|
l();
|
|
2837
2881
|
const a = new ResizeObserver(l);
|
|
2838
2882
|
return e && a.observe(e), r && a.observe(r), () => a.disconnect();
|
|
2839
2883
|
}, [e, r]), { headerRef: t, footerRef: n, measurements: s };
|
|
2840
|
-
},
|
|
2841
|
-
const { theme: s, themeClass: i, inlineVarsStyle: l } = Ge(), a =
|
|
2842
|
-
const
|
|
2843
|
-
return
|
|
2844
|
-
}, [r, u, l, e.border, s]),
|
|
2884
|
+
}, Ac = (e, t) => e.headerSize.width !== t.headerSize.width || e.headerSize.height !== t.headerSize.height || e.footerSize.width !== t.footerSize.width || e.footerSize.height !== t.footerSize.height, Lc = ({ appearance: e, isEditable: t, style: r, children: n }) => {
|
|
2885
|
+
const { theme: s, themeClass: i, inlineVarsStyle: l } = Ge(), a = ds(e.border), d = Math.max(0, e.cornerRadius), u = d === 0 ? 0 : d + a, h = b(() => {
|
|
2886
|
+
const v = { ...r, borderRadius: `${u}px`, ...l }, y = cs(e.border, s);
|
|
2887
|
+
return y !== null && (v.background = y), v;
|
|
2888
|
+
}, [r, u, l, e.border, s]), p = b(
|
|
2845
2889
|
() => ({
|
|
2846
2890
|
inset: `${a}px`,
|
|
2847
2891
|
borderRadius: `${d}px`
|
|
2848
2892
|
}),
|
|
2849
2893
|
[a, d]
|
|
2850
|
-
),
|
|
2851
|
-
return /* @__PURE__ */ o("div", { "data-testid": "graph-wrapper", className: j(
|
|
2894
|
+
), f = t && e.background.type === "solid" && e.background.color === "transparent";
|
|
2895
|
+
return /* @__PURE__ */ o("div", { "data-testid": "graph-wrapper", className: j(fs, i), style: h, children: /* @__PURE__ */ o(
|
|
2852
2896
|
"div",
|
|
2853
2897
|
{
|
|
2854
2898
|
"data-testid": "graph-inner",
|
|
2855
|
-
className: j(
|
|
2856
|
-
style:
|
|
2899
|
+
className: j(ms, { [ys]: f }),
|
|
2900
|
+
style: p,
|
|
2857
2901
|
children: n
|
|
2858
2902
|
}
|
|
2859
2903
|
) });
|
|
2860
|
-
},
|
|
2904
|
+
}, ld = (e) => /* @__PURE__ */ o(Ln, { children: /* @__PURE__ */ o(_n, { children: /* @__PURE__ */ o(_c, { ...e }) }) }), _c = ({
|
|
2861
2905
|
width: e,
|
|
2862
2906
|
height: t,
|
|
2863
2907
|
isAnimated: r,
|
|
2864
2908
|
showTooltips: n = !0,
|
|
2865
2909
|
mode: s = "readonly"
|
|
2866
2910
|
}) => {
|
|
2867
|
-
const { axes: i, legends: l, numberFormat: a, parsingLocale: d, appearance: u, annotations: h, coordSystem:
|
|
2868
|
-
|
|
2869
|
-
axes:
|
|
2870
|
-
legends:
|
|
2871
|
-
numberFormat:
|
|
2872
|
-
parsingLocale:
|
|
2873
|
-
appearance:
|
|
2874
|
-
annotations:
|
|
2875
|
-
coordSystem:
|
|
2876
|
-
headline:
|
|
2877
|
-
headlineConfig:
|
|
2911
|
+
const { axes: i, legends: l, numberFormat: a, parsingLocale: d, appearance: u, annotations: h, coordSystem: p, headline: f, headlineConfig: v } = L(
|
|
2912
|
+
D((B) => ({
|
|
2913
|
+
axes: B.guides.axes,
|
|
2914
|
+
legends: B.guides.legends,
|
|
2915
|
+
numberFormat: B.config.numberFormat,
|
|
2916
|
+
parsingLocale: B.config.parsingLocale,
|
|
2917
|
+
appearance: B.config.appearance,
|
|
2918
|
+
annotations: B.annotations,
|
|
2919
|
+
coordSystem: B.coordSystem,
|
|
2920
|
+
headline: B.guides.headline,
|
|
2921
|
+
headlineConfig: B.config.headline
|
|
2878
2922
|
}))
|
|
2879
|
-
),
|
|
2880
|
-
() =>
|
|
2881
|
-
[l, a, d,
|
|
2882
|
-
), K =
|
|
2883
|
-
() =>
|
|
2884
|
-
[
|
|
2885
|
-
),
|
|
2923
|
+
), y = En(), { headerRef: m, footerRef: x, measurements: k } = Sc(), { formattingLocale: w, theme: O, themeOverrides: U } = _e(), ze = b(
|
|
2924
|
+
() => vn({ legends: l, numberFormat: a, parsingLocale: d, formattingLocale: w }),
|
|
2925
|
+
[l, a, d, w]
|
|
2926
|
+
), K = b(
|
|
2927
|
+
() => bn({ headline: f, show: v.show, numberFormat: a, parsingLocale: d, formattingLocale: w }),
|
|
2928
|
+
[f, v.show, a, d, w]
|
|
2929
|
+
), Hr = ee(), fe = u.border.type === "none" ? 0 : u.border.width, pe = b(
|
|
2886
2930
|
() => ({
|
|
2887
2931
|
width: Math.max(0, e - 2 * fe),
|
|
2888
2932
|
height: Math.max(0, t - 2 * fe)
|
|
2889
2933
|
}),
|
|
2890
2934
|
[e, t, fe]
|
|
2891
|
-
), te =
|
|
2935
|
+
), te = b(
|
|
2892
2936
|
() => K ? {
|
|
2893
2937
|
formatted: K,
|
|
2894
|
-
size:
|
|
2895
|
-
position:
|
|
2896
|
-
innerRadius:
|
|
2938
|
+
size: v.size,
|
|
2939
|
+
position: v.position,
|
|
2940
|
+
innerRadius: p.type === "polar" ? p.innerRadius : 0
|
|
2897
2941
|
} : void 0,
|
|
2898
|
-
[K,
|
|
2899
|
-
), re =
|
|
2942
|
+
[K, v.size, v.position, p]
|
|
2943
|
+
), re = Vo(Hr, u.textScale), Z = Wo({
|
|
2900
2944
|
measurer: re,
|
|
2901
2945
|
axes: i,
|
|
2902
2946
|
numberFormat: a,
|
|
2903
2947
|
parsingLocale: d,
|
|
2904
|
-
formattedLegends:
|
|
2948
|
+
formattedLegends: ze,
|
|
2905
2949
|
containerSize: pe,
|
|
2906
|
-
externalMeasurements:
|
|
2950
|
+
externalMeasurements: k,
|
|
2907
2951
|
headline: te,
|
|
2908
|
-
formattingLocale:
|
|
2952
|
+
formattingLocale: w,
|
|
2909
2953
|
annotations: h,
|
|
2910
|
-
coordSystem:
|
|
2954
|
+
coordSystem: p,
|
|
2911
2955
|
textScale: u.textScale
|
|
2912
|
-
}), ne =
|
|
2956
|
+
}), ne = b(() => !Z || !te || !re ? null : xn({
|
|
2913
2957
|
headline: te,
|
|
2914
2958
|
layout: Z.layout,
|
|
2915
2959
|
containerSize: pe,
|
|
2916
2960
|
measurer: re,
|
|
2917
|
-
itemGap:
|
|
2961
|
+
itemGap: Gt
|
|
2918
2962
|
}), [Z, te, pe, re]);
|
|
2919
2963
|
if (!Z) return null;
|
|
2920
|
-
const { layout:
|
|
2921
|
-
return /* @__PURE__ */ o(
|
|
2922
|
-
/* @__PURE__ */ o(
|
|
2964
|
+
const { layout: M, formattedAxes: Mr, formattedPolarAxes: Gr } = Z;
|
|
2965
|
+
return /* @__PURE__ */ o(xs, { theme: O, themeOverrides: U, appearance: u, children: /* @__PURE__ */ g(Lc, { appearance: u, isEditable: s === "editable", style: { width: e, height: t }, children: [
|
|
2966
|
+
/* @__PURE__ */ o(ta, { ref: m, headerRect: M.header, mode: s }),
|
|
2923
2967
|
/* @__PURE__ */ o(
|
|
2924
|
-
|
|
2968
|
+
wc,
|
|
2925
2969
|
{
|
|
2926
|
-
formattedAxes:
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2970
|
+
formattedAxes: Mr,
|
|
2971
|
+
formattedPolarAxes: Gr,
|
|
2972
|
+
plotRect: M.plot,
|
|
2973
|
+
panelRect: M.panel,
|
|
2974
|
+
axisRects: M.axes,
|
|
2975
|
+
axisLabelRects: M.axisLabels,
|
|
2976
|
+
shouldAnimate: r ?? !y,
|
|
2977
|
+
formattingLocale: w ?? d
|
|
2933
2978
|
}
|
|
2934
2979
|
),
|
|
2935
|
-
/* @__PURE__ */ o(
|
|
2936
|
-
/* @__PURE__ */ o(
|
|
2980
|
+
/* @__PURE__ */ o($i, { ref: x, footerRect: M.footer, mode: s }),
|
|
2981
|
+
/* @__PURE__ */ o(dl, { formattedLegends: ze, rects: M.legends, textScale: u.textScale }),
|
|
2937
2982
|
K && ne && /* @__PURE__ */ o(
|
|
2938
|
-
|
|
2983
|
+
Ta,
|
|
2939
2984
|
{
|
|
2940
2985
|
headline: K,
|
|
2941
2986
|
rect: ne.rect,
|
|
@@ -2943,21 +2988,21 @@ const bc = ({
|
|
|
2943
2988
|
visibleItemCount: ne.visibleItemCount
|
|
2944
2989
|
}
|
|
2945
2990
|
),
|
|
2946
|
-
n && /* @__PURE__ */ o(
|
|
2991
|
+
n && /* @__PURE__ */ o(To, {})
|
|
2947
2992
|
] }) });
|
|
2948
2993
|
};
|
|
2949
2994
|
export {
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2995
|
+
ud as CanvasTextMeasurer,
|
|
2996
|
+
ad as DevToolsPanel,
|
|
2997
|
+
hd as GraphProvider,
|
|
2998
|
+
ld as GraphRenderer,
|
|
2999
|
+
Ln as HoverProvider,
|
|
3000
|
+
_n as TextMeasurerProvider,
|
|
3001
|
+
xs as ThemeProvider,
|
|
3002
|
+
bs as darkTheme,
|
|
3003
|
+
vs as lightTheme,
|
|
3004
|
+
L as useCompiledSelector,
|
|
3005
|
+
kt as useGraphCommandDispatcher,
|
|
2961
3006
|
he as useHoverState,
|
|
2962
3007
|
ee as useTextMeasurer,
|
|
2963
3008
|
c as vars
|