@pdf-viewer/react 1.0.1-rc.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RPDefaultLayout-07939e60.js → RPDefaultLayout-adbb0836.js} +246 -246
- package/dist/components/RPConfig.js +318 -340
- package/dist/components/RPController.js +43 -45
- package/dist/components/RPPages.js +2 -3
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +3 -2
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +2 -3
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +3 -4
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +2 -3
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +3 -3
- package/dist/components/page/AnnotationLayer.js +2 -3
- package/dist/components/page/CanvasLayer.js +2 -3
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +2 -3
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextLayer.js +2 -3
- package/dist/components/ui/Checkbox.js +252 -92
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +961 -224
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/contexts/ViewportContext.js +41 -41
- package/dist/floating-ui.react-dom-e6d5fe8f.js +1327 -0
- package/dist/index-316854c1.js +2299 -0
- package/dist/index-71898eb9.js +139 -0
- package/dist/main.js +1 -1
- package/dist/types/contexts/ViewportContext.d.ts +0 -1
- package/dist/types/utils/types.d.ts +2 -2
- package/dist/utils/hooks/useFileDownload.js +2 -3
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +2 -3
- package/dist/utils/hooks/usePrint.js +2 -3
- package/dist/utils/hooks/useScrollToPage.js +2 -3
- package/dist/utils/hooks/useSearch.js +2 -3
- package/dist/utils/hooks/useThumbnail.js +2 -3
- package/dist/utils/hooks/useVirtualReactWindow.js +2 -3
- package/package.json +1 -1
- package/dist/index-1db49c1a.js +0 -1664
- package/dist/index-3dff3fa8.js +0 -307
- package/dist/index-4f17fe4d.js +0 -1657
|
@@ -1,14 +1,751 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as f, Fragment as F, jsxs as Y } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { forwardRef as mt } from "react";
|
|
4
|
+
import { u as Q, c as Ee, d as ht, a as H, b as vt } from "../../index-71898eb9.js";
|
|
5
|
+
import * as yt from "react-dom";
|
|
6
|
+
import { u as gt, a as wt, b as Ct, o as Et, s as Pt, f as bt, c as xt, d as Rt, h as At, l as Tt, e as Ot } from "../../floating-ui.react-dom-e6d5fe8f.js";
|
|
7
|
+
import '../../assets/RPTooltip.css';function A(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
8
|
+
return function(r) {
|
|
9
|
+
if (e == null || e(r), n === !1 || !r.defaultPrevented)
|
|
10
|
+
return t == null ? void 0 : t(r);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function me(e, t) {
|
|
14
|
+
if (typeof e == "function")
|
|
15
|
+
return e(t);
|
|
16
|
+
e != null && (e.current = t);
|
|
17
|
+
}
|
|
18
|
+
function Pe(...e) {
|
|
19
|
+
return (t) => {
|
|
20
|
+
let n = !1;
|
|
21
|
+
const o = e.map((r) => {
|
|
22
|
+
const i = me(r, t);
|
|
23
|
+
return !n && typeof i == "function" && (n = !0), i;
|
|
24
|
+
});
|
|
25
|
+
if (n)
|
|
26
|
+
return () => {
|
|
27
|
+
for (let r = 0; r < o.length; r++) {
|
|
28
|
+
const i = o[r];
|
|
29
|
+
typeof i == "function" ? i() : me(e[r], null);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function _(...e) {
|
|
35
|
+
return s.useCallback(Pe(...e), e);
|
|
36
|
+
}
|
|
37
|
+
var be = s.forwardRef((e, t) => {
|
|
38
|
+
const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Nt);
|
|
39
|
+
if (i) {
|
|
40
|
+
const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
|
|
41
|
+
return /* @__PURE__ */ f(G, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
|
|
42
|
+
}
|
|
43
|
+
return /* @__PURE__ */ f(G, { ...o, ref: t, children: n });
|
|
44
|
+
});
|
|
45
|
+
be.displayName = "Slot";
|
|
46
|
+
var G = s.forwardRef((e, t) => {
|
|
47
|
+
const { children: n, ...o } = e;
|
|
48
|
+
if (s.isValidElement(n)) {
|
|
49
|
+
const r = Dt(n), i = St(o, n.props);
|
|
50
|
+
return n.type !== s.Fragment && (i.ref = t ? Pe(t, r) : r), s.cloneElement(n, i);
|
|
51
|
+
}
|
|
52
|
+
return s.Children.count(n) > 1 ? s.Children.only(null) : null;
|
|
53
|
+
});
|
|
54
|
+
G.displayName = "SlotClone";
|
|
55
|
+
var xe = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
|
|
56
|
+
function Nt(e) {
|
|
57
|
+
return s.isValidElement(e) && e.type === xe;
|
|
58
|
+
}
|
|
59
|
+
function St(e, t) {
|
|
60
|
+
const n = { ...t };
|
|
61
|
+
for (const o in t) {
|
|
62
|
+
const r = e[o], i = t[o];
|
|
63
|
+
/^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
|
|
64
|
+
i(...c), r(...c);
|
|
65
|
+
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
|
|
66
|
+
}
|
|
67
|
+
return { ...e, ...n };
|
|
68
|
+
}
|
|
69
|
+
function Dt(e) {
|
|
70
|
+
var o, r;
|
|
71
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
72
|
+
return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
73
|
+
}
|
|
74
|
+
var _t = [
|
|
75
|
+
"a",
|
|
76
|
+
"button",
|
|
77
|
+
"div",
|
|
78
|
+
"form",
|
|
79
|
+
"h2",
|
|
80
|
+
"h3",
|
|
81
|
+
"img",
|
|
82
|
+
"input",
|
|
83
|
+
"label",
|
|
84
|
+
"li",
|
|
85
|
+
"nav",
|
|
86
|
+
"ol",
|
|
87
|
+
"p",
|
|
88
|
+
"span",
|
|
89
|
+
"svg",
|
|
90
|
+
"ul"
|
|
91
|
+
], ee = _t.reduce((e, t) => {
|
|
92
|
+
const n = s.forwardRef((o, r) => {
|
|
93
|
+
const { asChild: i, ...a } = o, c = i ? be : t;
|
|
94
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
|
|
95
|
+
});
|
|
96
|
+
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
97
|
+
}, {});
|
|
98
|
+
function Lt(e, t) {
|
|
99
|
+
e && yt.flushSync(() => e.dispatchEvent(t));
|
|
100
|
+
}
|
|
101
|
+
var $t = "DismissableLayer", X = "dismissableLayer.update", Mt = "dismissableLayer.pointerDownOutside", It = "dismissableLayer.focusOutside", he, Re = s.createContext({
|
|
102
|
+
layers: /* @__PURE__ */ new Set(),
|
|
103
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
104
|
+
branches: /* @__PURE__ */ new Set()
|
|
105
|
+
}), Ae = s.forwardRef(
|
|
106
|
+
(e, t) => {
|
|
107
|
+
const {
|
|
108
|
+
disableOutsidePointerEvents: n = !1,
|
|
109
|
+
onEscapeKeyDown: o,
|
|
110
|
+
onPointerDownOutside: r,
|
|
111
|
+
onFocusOutside: i,
|
|
112
|
+
onInteractOutside: a,
|
|
113
|
+
onDismiss: c,
|
|
114
|
+
...l
|
|
115
|
+
} = e, u = s.useContext(Re), [d, m] = s.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = s.useState({}), v = _(t, (g) => m(g)), y = Array.from(u.layers), [w] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), E = y.indexOf(w), C = d ? y.indexOf(d) : -1, x = u.layersWithOutsidePointerEventsDisabled.size > 0, P = C >= E, R = Ht((g) => {
|
|
116
|
+
const T = g.target, L = [...u.branches].some((S) => S.contains(T));
|
|
117
|
+
!P || L || (r == null || r(g), a == null || a(g), g.defaultPrevented || c == null || c());
|
|
118
|
+
}, h), b = Ft((g) => {
|
|
119
|
+
const T = g.target;
|
|
120
|
+
[...u.branches].some((S) => S.contains(T)) || (i == null || i(g), a == null || a(g), g.defaultPrevented || c == null || c());
|
|
121
|
+
}, h);
|
|
122
|
+
return gt((g) => {
|
|
123
|
+
C === u.layers.size - 1 && (o == null || o(g), !g.defaultPrevented && c && (g.preventDefault(), c()));
|
|
124
|
+
}, h), s.useEffect(() => {
|
|
125
|
+
if (d)
|
|
126
|
+
return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (he = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), ve(), () => {
|
|
127
|
+
n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = he);
|
|
128
|
+
};
|
|
129
|
+
}, [d, h, n, u]), s.useEffect(() => () => {
|
|
130
|
+
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), ve());
|
|
131
|
+
}, [d, u]), s.useEffect(() => {
|
|
132
|
+
const g = () => p({});
|
|
133
|
+
return document.addEventListener(X, g), () => document.removeEventListener(X, g);
|
|
134
|
+
}, []), /* @__PURE__ */ f(
|
|
135
|
+
ee.div,
|
|
136
|
+
{
|
|
137
|
+
...l,
|
|
138
|
+
ref: v,
|
|
139
|
+
style: {
|
|
140
|
+
pointerEvents: x ? P ? "auto" : "none" : void 0,
|
|
141
|
+
...e.style
|
|
142
|
+
},
|
|
143
|
+
onFocusCapture: A(e.onFocusCapture, b.onFocusCapture),
|
|
144
|
+
onBlurCapture: A(e.onBlurCapture, b.onBlurCapture),
|
|
145
|
+
onPointerDownCapture: A(
|
|
146
|
+
e.onPointerDownCapture,
|
|
147
|
+
R.onPointerDownCapture
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
Ae.displayName = $t;
|
|
154
|
+
var Wt = "DismissableLayerBranch", kt = s.forwardRef((e, t) => {
|
|
155
|
+
const n = s.useContext(Re), o = s.useRef(null), r = _(t, o);
|
|
156
|
+
return s.useEffect(() => {
|
|
157
|
+
const i = o.current;
|
|
158
|
+
if (i)
|
|
159
|
+
return n.branches.add(i), () => {
|
|
160
|
+
n.branches.delete(i);
|
|
161
|
+
};
|
|
162
|
+
}, [n.branches]), /* @__PURE__ */ f(ee.div, { ...e, ref: r });
|
|
163
|
+
});
|
|
164
|
+
kt.displayName = Wt;
|
|
165
|
+
function Ht(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
166
|
+
const n = Q(e), o = s.useRef(!1), r = s.useRef(() => {
|
|
167
|
+
});
|
|
168
|
+
return s.useEffect(() => {
|
|
169
|
+
const i = (c) => {
|
|
170
|
+
if (c.target && !o.current) {
|
|
171
|
+
let l = function() {
|
|
172
|
+
Te(
|
|
173
|
+
Mt,
|
|
174
|
+
n,
|
|
175
|
+
u,
|
|
176
|
+
{ discrete: !0 }
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
const u = { originalEvent: c };
|
|
180
|
+
c.pointerType === "touch" ? (t.removeEventListener("click", r.current), r.current = l, t.addEventListener("click", r.current, { once: !0 })) : l();
|
|
181
|
+
} else
|
|
182
|
+
t.removeEventListener("click", r.current);
|
|
183
|
+
o.current = !1;
|
|
184
|
+
}, a = window.setTimeout(() => {
|
|
185
|
+
t.addEventListener("pointerdown", i);
|
|
186
|
+
}, 0);
|
|
187
|
+
return () => {
|
|
188
|
+
window.clearTimeout(a), t.removeEventListener("pointerdown", i), t.removeEventListener("click", r.current);
|
|
189
|
+
};
|
|
190
|
+
}, [t, n]), {
|
|
191
|
+
// ensures we check React component tree (not just DOM tree)
|
|
192
|
+
onPointerDownCapture: () => o.current = !0
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function Ft(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
196
|
+
const n = Q(e), o = s.useRef(!1);
|
|
197
|
+
return s.useEffect(() => {
|
|
198
|
+
const r = (i) => {
|
|
199
|
+
i.target && !o.current && Te(It, n, { originalEvent: i }, {
|
|
200
|
+
discrete: !1
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
return t.addEventListener("focusin", r), () => t.removeEventListener("focusin", r);
|
|
204
|
+
}, [t, n]), {
|
|
205
|
+
onFocusCapture: () => o.current = !0,
|
|
206
|
+
onBlurCapture: () => o.current = !1
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function ve() {
|
|
210
|
+
const e = new CustomEvent(X);
|
|
211
|
+
document.dispatchEvent(e);
|
|
212
|
+
}
|
|
213
|
+
function Te(e, t, n, { discrete: o }) {
|
|
214
|
+
const r = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
215
|
+
t && r.addEventListener(e, t, { once: !0 }), o ? Lt(r, i) : r.dispatchEvent(i);
|
|
216
|
+
}
|
|
217
|
+
function ye(e, t) {
|
|
218
|
+
if (typeof e == "function")
|
|
219
|
+
return e(t);
|
|
220
|
+
e != null && (e.current = t);
|
|
221
|
+
}
|
|
222
|
+
function Vt(...e) {
|
|
223
|
+
return (t) => {
|
|
224
|
+
let n = !1;
|
|
225
|
+
const o = e.map((r) => {
|
|
226
|
+
const i = ye(r, t);
|
|
227
|
+
return !n && typeof i == "function" && (n = !0), i;
|
|
228
|
+
});
|
|
229
|
+
if (n)
|
|
230
|
+
return () => {
|
|
231
|
+
for (let r = 0; r < o.length; r++) {
|
|
232
|
+
const i = o[r];
|
|
233
|
+
typeof i == "function" ? i() : ye(e[r], null);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
var Oe = s.forwardRef((e, t) => {
|
|
239
|
+
const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Ut);
|
|
240
|
+
if (i) {
|
|
241
|
+
const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
|
|
242
|
+
return /* @__PURE__ */ f(z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
|
|
243
|
+
}
|
|
244
|
+
return /* @__PURE__ */ f(z, { ...o, ref: t, children: n });
|
|
245
|
+
});
|
|
246
|
+
Oe.displayName = "Slot";
|
|
247
|
+
var z = s.forwardRef((e, t) => {
|
|
248
|
+
const { children: n, ...o } = e;
|
|
249
|
+
if (s.isValidElement(n)) {
|
|
250
|
+
const r = Yt(n), i = jt(o, n.props);
|
|
251
|
+
return n.type !== s.Fragment && (i.ref = t ? Vt(t, r) : r), s.cloneElement(n, i);
|
|
252
|
+
}
|
|
253
|
+
return s.Children.count(n) > 1 ? s.Children.only(null) : null;
|
|
254
|
+
});
|
|
255
|
+
z.displayName = "SlotClone";
|
|
256
|
+
var Bt = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
|
|
257
|
+
function Ut(e) {
|
|
258
|
+
return s.isValidElement(e) && e.type === Bt;
|
|
259
|
+
}
|
|
260
|
+
function jt(e, t) {
|
|
261
|
+
const n = { ...t };
|
|
262
|
+
for (const o in t) {
|
|
263
|
+
const r = e[o], i = t[o];
|
|
264
|
+
/^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
|
|
265
|
+
i(...c), r(...c);
|
|
266
|
+
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
|
|
267
|
+
}
|
|
268
|
+
return { ...e, ...n };
|
|
269
|
+
}
|
|
270
|
+
function Yt(e) {
|
|
271
|
+
var o, r;
|
|
272
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
273
|
+
return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
274
|
+
}
|
|
275
|
+
var Gt = [
|
|
276
|
+
"a",
|
|
277
|
+
"button",
|
|
278
|
+
"div",
|
|
279
|
+
"form",
|
|
280
|
+
"h2",
|
|
281
|
+
"h3",
|
|
282
|
+
"img",
|
|
283
|
+
"input",
|
|
284
|
+
"label",
|
|
285
|
+
"li",
|
|
286
|
+
"nav",
|
|
287
|
+
"ol",
|
|
288
|
+
"p",
|
|
289
|
+
"span",
|
|
290
|
+
"svg",
|
|
291
|
+
"ul"
|
|
292
|
+
], Xt = Gt.reduce((e, t) => {
|
|
293
|
+
const n = s.forwardRef((o, r) => {
|
|
294
|
+
const { asChild: i, ...a } = o, c = i ? Oe : t;
|
|
295
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
|
|
296
|
+
});
|
|
297
|
+
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
298
|
+
}, {}), zt = "Arrow", Ne = s.forwardRef((e, t) => {
|
|
299
|
+
const { children: n, width: o = 10, height: r = 5, ...i } = e;
|
|
300
|
+
return /* @__PURE__ */ f(
|
|
301
|
+
Xt.svg,
|
|
302
|
+
{
|
|
303
|
+
...i,
|
|
304
|
+
ref: t,
|
|
305
|
+
width: o,
|
|
306
|
+
height: r,
|
|
307
|
+
viewBox: "0 0 30 10",
|
|
308
|
+
preserveAspectRatio: "none",
|
|
309
|
+
children: e.asChild ? n : /* @__PURE__ */ f("polygon", { points: "0,0 30,0 15,10" })
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
});
|
|
313
|
+
Ne.displayName = zt;
|
|
314
|
+
var Zt = Ne;
|
|
315
|
+
function ge(e, t) {
|
|
316
|
+
if (typeof e == "function")
|
|
317
|
+
return e(t);
|
|
318
|
+
e != null && (e.current = t);
|
|
319
|
+
}
|
|
320
|
+
function Se(...e) {
|
|
321
|
+
return (t) => {
|
|
322
|
+
let n = !1;
|
|
323
|
+
const o = e.map((r) => {
|
|
324
|
+
const i = ge(r, t);
|
|
325
|
+
return !n && typeof i == "function" && (n = !0), i;
|
|
326
|
+
});
|
|
327
|
+
if (n)
|
|
328
|
+
return () => {
|
|
329
|
+
for (let r = 0; r < o.length; r++) {
|
|
330
|
+
const i = o[r];
|
|
331
|
+
typeof i == "function" ? i() : ge(e[r], null);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function De(...e) {
|
|
337
|
+
return s.useCallback(Se(...e), e);
|
|
338
|
+
}
|
|
339
|
+
var _e = s.forwardRef((e, t) => {
|
|
340
|
+
const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Kt);
|
|
341
|
+
if (i) {
|
|
342
|
+
const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
|
|
343
|
+
return /* @__PURE__ */ f(Z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
|
|
344
|
+
}
|
|
345
|
+
return /* @__PURE__ */ f(Z, { ...o, ref: t, children: n });
|
|
346
|
+
});
|
|
347
|
+
_e.displayName = "Slot";
|
|
348
|
+
var Z = s.forwardRef((e, t) => {
|
|
349
|
+
const { children: n, ...o } = e;
|
|
350
|
+
if (s.isValidElement(n)) {
|
|
351
|
+
const r = Qt(n), i = Jt(o, n.props);
|
|
352
|
+
return n.type !== s.Fragment && (i.ref = t ? Se(t, r) : r), s.cloneElement(n, i);
|
|
353
|
+
}
|
|
354
|
+
return s.Children.count(n) > 1 ? s.Children.only(null) : null;
|
|
355
|
+
});
|
|
356
|
+
Z.displayName = "SlotClone";
|
|
357
|
+
var qt = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
|
|
358
|
+
function Kt(e) {
|
|
359
|
+
return s.isValidElement(e) && e.type === qt;
|
|
360
|
+
}
|
|
361
|
+
function Jt(e, t) {
|
|
362
|
+
const n = { ...t };
|
|
363
|
+
for (const o in t) {
|
|
364
|
+
const r = e[o], i = t[o];
|
|
365
|
+
/^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
|
|
366
|
+
i(...c), r(...c);
|
|
367
|
+
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
|
|
368
|
+
}
|
|
369
|
+
return { ...e, ...n };
|
|
370
|
+
}
|
|
371
|
+
function Qt(e) {
|
|
372
|
+
var o, r;
|
|
373
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
374
|
+
return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
375
|
+
}
|
|
376
|
+
var en = [
|
|
377
|
+
"a",
|
|
378
|
+
"button",
|
|
379
|
+
"div",
|
|
380
|
+
"form",
|
|
381
|
+
"h2",
|
|
382
|
+
"h3",
|
|
383
|
+
"img",
|
|
384
|
+
"input",
|
|
385
|
+
"label",
|
|
386
|
+
"li",
|
|
387
|
+
"nav",
|
|
388
|
+
"ol",
|
|
389
|
+
"p",
|
|
390
|
+
"span",
|
|
391
|
+
"svg",
|
|
392
|
+
"ul"
|
|
393
|
+
], Le = en.reduce((e, t) => {
|
|
394
|
+
const n = s.forwardRef((o, r) => {
|
|
395
|
+
const { asChild: i, ...a } = o, c = i ? _e : t;
|
|
396
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
|
|
397
|
+
});
|
|
398
|
+
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
399
|
+
}, {}), te = "Popper", [$e, Me] = Ee(te), [tn, Ie] = $e(te), We = (e) => {
|
|
400
|
+
const { __scopePopper: t, children: n } = e, [o, r] = s.useState(null);
|
|
401
|
+
return /* @__PURE__ */ f(tn, { scope: t, anchor: o, onAnchorChange: r, children: n });
|
|
402
|
+
};
|
|
403
|
+
We.displayName = te;
|
|
404
|
+
var ke = "PopperAnchor", He = s.forwardRef(
|
|
405
|
+
(e, t) => {
|
|
406
|
+
const { __scopePopper: n, virtualRef: o, ...r } = e, i = Ie(ke, n), a = s.useRef(null), c = De(t, a);
|
|
407
|
+
return s.useEffect(() => {
|
|
408
|
+
i.onAnchorChange((o == null ? void 0 : o.current) || a.current);
|
|
409
|
+
}), o ? null : /* @__PURE__ */ f(Le.div, { ...r, ref: c });
|
|
410
|
+
}
|
|
411
|
+
);
|
|
412
|
+
He.displayName = ke;
|
|
413
|
+
var ne = "PopperContent", [nn, rn] = $e(ne), Fe = s.forwardRef(
|
|
414
|
+
(e, t) => {
|
|
415
|
+
var ae, le, ce, ue, de, fe;
|
|
416
|
+
const {
|
|
417
|
+
__scopePopper: n,
|
|
418
|
+
side: o = "bottom",
|
|
419
|
+
sideOffset: r = 0,
|
|
420
|
+
align: i = "center",
|
|
421
|
+
alignOffset: a = 0,
|
|
422
|
+
arrowPadding: c = 0,
|
|
423
|
+
avoidCollisions: l = !0,
|
|
424
|
+
collisionBoundary: u = [],
|
|
425
|
+
collisionPadding: d = 0,
|
|
426
|
+
sticky: m = "partial",
|
|
427
|
+
hideWhenDetached: h = !1,
|
|
428
|
+
updatePositionStrategy: p = "optimized",
|
|
429
|
+
onPlaced: v,
|
|
430
|
+
...y
|
|
431
|
+
} = e, w = Ie(ne, n), [E, C] = s.useState(null), x = De(t, (D) => C(D)), [P, R] = s.useState(null), b = ht(P), g = (b == null ? void 0 : b.width) ?? 0, T = (b == null ? void 0 : b.height) ?? 0, L = o + (i !== "center" ? "-" + i : ""), S = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, oe = Array.isArray(u) ? u : [u], tt = oe.length > 0, $ = {
|
|
432
|
+
padding: S,
|
|
433
|
+
boundary: oe.filter(sn),
|
|
434
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
435
|
+
altBoundary: tt
|
|
436
|
+
}, { refs: nt, floatingStyles: ie, placement: rt, isPositioned: M, middlewareData: O } = wt({
|
|
437
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
438
|
+
strategy: "fixed",
|
|
439
|
+
placement: L,
|
|
440
|
+
whileElementsMounted: (...D) => Ct(...D, {
|
|
441
|
+
animationFrame: p === "always"
|
|
442
|
+
}),
|
|
443
|
+
elements: {
|
|
444
|
+
reference: w.anchor
|
|
445
|
+
},
|
|
446
|
+
middleware: [
|
|
447
|
+
Et({ mainAxis: r + T, alignmentAxis: a }),
|
|
448
|
+
l && Pt({
|
|
449
|
+
mainAxis: !0,
|
|
450
|
+
crossAxis: !1,
|
|
451
|
+
limiter: m === "partial" ? Tt() : void 0,
|
|
452
|
+
...$
|
|
453
|
+
}),
|
|
454
|
+
l && bt({ ...$ }),
|
|
455
|
+
xt({
|
|
456
|
+
...$,
|
|
457
|
+
apply: ({ elements: D, rects: pe, availableWidth: ut, availableHeight: dt }) => {
|
|
458
|
+
const { width: ft, height: pt } = pe.reference, W = D.floating.style;
|
|
459
|
+
W.setProperty("--radix-popper-available-width", `${ut}px`), W.setProperty("--radix-popper-available-height", `${dt}px`), W.setProperty("--radix-popper-anchor-width", `${ft}px`), W.setProperty("--radix-popper-anchor-height", `${pt}px`);
|
|
460
|
+
}
|
|
461
|
+
}),
|
|
462
|
+
P && Rt({ element: P, padding: c }),
|
|
463
|
+
an({ arrowWidth: g, arrowHeight: T }),
|
|
464
|
+
h && At({ strategy: "referenceHidden", ...$ })
|
|
465
|
+
]
|
|
466
|
+
}), [se, ot] = Ue(rt), I = Q(v);
|
|
467
|
+
H(() => {
|
|
468
|
+
M && (I == null || I());
|
|
469
|
+
}, [M, I]);
|
|
470
|
+
const it = (ae = O.arrow) == null ? void 0 : ae.x, st = (le = O.arrow) == null ? void 0 : le.y, at = ((ce = O.arrow) == null ? void 0 : ce.centerOffset) !== 0, [lt, ct] = s.useState();
|
|
471
|
+
return H(() => {
|
|
472
|
+
E && ct(window.getComputedStyle(E).zIndex);
|
|
473
|
+
}, [E]), /* @__PURE__ */ f(
|
|
474
|
+
"div",
|
|
475
|
+
{
|
|
476
|
+
ref: nt.setFloating,
|
|
477
|
+
"data-radix-popper-content-wrapper": "",
|
|
478
|
+
style: {
|
|
479
|
+
...ie,
|
|
480
|
+
transform: M ? ie.transform : "translate(0, -200%)",
|
|
481
|
+
// keep off the page when measuring
|
|
482
|
+
minWidth: "max-content",
|
|
483
|
+
zIndex: lt,
|
|
484
|
+
"--radix-popper-transform-origin": [
|
|
485
|
+
(ue = O.transformOrigin) == null ? void 0 : ue.x,
|
|
486
|
+
(de = O.transformOrigin) == null ? void 0 : de.y
|
|
487
|
+
].join(" "),
|
|
488
|
+
// hide the content if using the hide middleware and should be hidden
|
|
489
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
490
|
+
// as if the PopperContent isn't there at all
|
|
491
|
+
...((fe = O.hide) == null ? void 0 : fe.referenceHidden) && {
|
|
492
|
+
visibility: "hidden",
|
|
493
|
+
pointerEvents: "none"
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
dir: e.dir,
|
|
497
|
+
children: /* @__PURE__ */ f(
|
|
498
|
+
nn,
|
|
499
|
+
{
|
|
500
|
+
scope: n,
|
|
501
|
+
placedSide: se,
|
|
502
|
+
onArrowChange: R,
|
|
503
|
+
arrowX: it,
|
|
504
|
+
arrowY: st,
|
|
505
|
+
shouldHideArrow: at,
|
|
506
|
+
children: /* @__PURE__ */ f(
|
|
507
|
+
Le.div,
|
|
508
|
+
{
|
|
509
|
+
"data-side": se,
|
|
510
|
+
"data-align": ot,
|
|
511
|
+
...y,
|
|
512
|
+
ref: x,
|
|
513
|
+
style: {
|
|
514
|
+
...y.style,
|
|
515
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
516
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
517
|
+
animation: M ? void 0 : "none"
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
)
|
|
521
|
+
}
|
|
522
|
+
)
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
);
|
|
527
|
+
Fe.displayName = ne;
|
|
528
|
+
var Ve = "PopperArrow", on = {
|
|
529
|
+
top: "bottom",
|
|
530
|
+
right: "left",
|
|
531
|
+
bottom: "top",
|
|
532
|
+
left: "right"
|
|
533
|
+
}, Be = s.forwardRef(function(t, n) {
|
|
534
|
+
const { __scopePopper: o, ...r } = t, i = rn(Ve, o), a = on[i.placedSide];
|
|
535
|
+
return (
|
|
536
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
537
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
538
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
539
|
+
/* @__PURE__ */ f(
|
|
540
|
+
"span",
|
|
541
|
+
{
|
|
542
|
+
ref: i.onArrowChange,
|
|
543
|
+
style: {
|
|
544
|
+
position: "absolute",
|
|
545
|
+
left: i.arrowX,
|
|
546
|
+
top: i.arrowY,
|
|
547
|
+
[a]: 0,
|
|
548
|
+
transformOrigin: {
|
|
549
|
+
top: "",
|
|
550
|
+
right: "0 0",
|
|
551
|
+
bottom: "center 0",
|
|
552
|
+
left: "100% 0"
|
|
553
|
+
}[i.placedSide],
|
|
554
|
+
transform: {
|
|
555
|
+
top: "translateY(100%)",
|
|
556
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
557
|
+
bottom: "rotate(180deg)",
|
|
558
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
559
|
+
}[i.placedSide],
|
|
560
|
+
visibility: i.shouldHideArrow ? "hidden" : void 0
|
|
561
|
+
},
|
|
562
|
+
children: /* @__PURE__ */ f(
|
|
563
|
+
Zt,
|
|
564
|
+
{
|
|
565
|
+
...r,
|
|
566
|
+
ref: n,
|
|
567
|
+
style: {
|
|
568
|
+
...r.style,
|
|
569
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
570
|
+
display: "block"
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
)
|
|
574
|
+
}
|
|
575
|
+
)
|
|
576
|
+
);
|
|
577
|
+
});
|
|
578
|
+
Be.displayName = Ve;
|
|
579
|
+
function sn(e) {
|
|
580
|
+
return e !== null;
|
|
581
|
+
}
|
|
582
|
+
var an = (e) => ({
|
|
583
|
+
name: "transformOrigin",
|
|
584
|
+
options: e,
|
|
585
|
+
fn(t) {
|
|
586
|
+
var w, E, C;
|
|
587
|
+
const { placement: n, rects: o, middlewareData: r } = t, a = ((w = r.arrow) == null ? void 0 : w.centerOffset) !== 0, c = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [u, d] = Ue(n), m = { start: "0%", center: "50%", end: "100%" }[d], h = (((E = r.arrow) == null ? void 0 : E.x) ?? 0) + c / 2, p = (((C = r.arrow) == null ? void 0 : C.y) ?? 0) + l / 2;
|
|
588
|
+
let v = "", y = "";
|
|
589
|
+
return u === "bottom" ? (v = a ? m : `${h}px`, y = `${-l}px`) : u === "top" ? (v = a ? m : `${h}px`, y = `${o.floating.height + l}px`) : u === "right" ? (v = `${-l}px`, y = a ? m : `${p}px`) : u === "left" && (v = `${o.floating.width + l}px`, y = a ? m : `${p}px`), { data: { x: v, y } };
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
function Ue(e) {
|
|
593
|
+
const [t, n = "center"] = e.split("-");
|
|
594
|
+
return [t, n];
|
|
595
|
+
}
|
|
596
|
+
var ln = We, cn = He, un = Fe, dn = Be;
|
|
597
|
+
function fn(e, t) {
|
|
598
|
+
return s.useReducer((n, o) => t[n][o] ?? n, e);
|
|
599
|
+
}
|
|
600
|
+
var je = (e) => {
|
|
601
|
+
const { present: t, children: n } = e, o = pn(t), r = typeof n == "function" ? n({ present: o.isPresent }) : s.Children.only(n), i = _(o.ref, mn(r));
|
|
602
|
+
return typeof n == "function" || o.isPresent ? s.cloneElement(r, { ref: i }) : null;
|
|
603
|
+
};
|
|
604
|
+
je.displayName = "Presence";
|
|
605
|
+
function pn(e) {
|
|
606
|
+
const [t, n] = s.useState(), o = s.useRef({}), r = s.useRef(e), i = s.useRef("none"), a = e ? "mounted" : "unmounted", [c, l] = fn(a, {
|
|
607
|
+
mounted: {
|
|
608
|
+
UNMOUNT: "unmounted",
|
|
609
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
610
|
+
},
|
|
611
|
+
unmountSuspended: {
|
|
612
|
+
MOUNT: "mounted",
|
|
613
|
+
ANIMATION_END: "unmounted"
|
|
614
|
+
},
|
|
615
|
+
unmounted: {
|
|
616
|
+
MOUNT: "mounted"
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
return s.useEffect(() => {
|
|
620
|
+
const u = k(o.current);
|
|
621
|
+
i.current = c === "mounted" ? u : "none";
|
|
622
|
+
}, [c]), H(() => {
|
|
623
|
+
const u = o.current, d = r.current;
|
|
624
|
+
if (d !== e) {
|
|
625
|
+
const h = i.current, p = k(u);
|
|
626
|
+
e ? l("MOUNT") : p === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(d && h !== p ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
|
|
627
|
+
}
|
|
628
|
+
}, [e, l]), H(() => {
|
|
629
|
+
if (t) {
|
|
630
|
+
let u;
|
|
631
|
+
const d = t.ownerDocument.defaultView ?? window, m = (p) => {
|
|
632
|
+
const y = k(o.current).includes(p.animationName);
|
|
633
|
+
if (p.target === t && y && (l("ANIMATION_END"), !r.current)) {
|
|
634
|
+
const w = t.style.animationFillMode;
|
|
635
|
+
t.style.animationFillMode = "forwards", u = d.setTimeout(() => {
|
|
636
|
+
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = w);
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
}, h = (p) => {
|
|
640
|
+
p.target === t && (i.current = k(o.current));
|
|
641
|
+
};
|
|
642
|
+
return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", m), t.addEventListener("animationend", m), () => {
|
|
643
|
+
d.clearTimeout(u), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", m), t.removeEventListener("animationend", m);
|
|
644
|
+
};
|
|
645
|
+
} else
|
|
646
|
+
l("ANIMATION_END");
|
|
647
|
+
}, [t, l]), {
|
|
648
|
+
isPresent: ["mounted", "unmountSuspended"].includes(c),
|
|
649
|
+
ref: s.useCallback((u) => {
|
|
650
|
+
u && (o.current = getComputedStyle(u)), n(u);
|
|
651
|
+
}, [])
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
function k(e) {
|
|
655
|
+
return (e == null ? void 0 : e.animationName) || "none";
|
|
656
|
+
}
|
|
657
|
+
function mn(e) {
|
|
658
|
+
var o, r;
|
|
659
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
660
|
+
return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
661
|
+
}
|
|
662
|
+
function we(e, t) {
|
|
663
|
+
if (typeof e == "function")
|
|
664
|
+
return e(t);
|
|
665
|
+
e != null && (e.current = t);
|
|
666
|
+
}
|
|
667
|
+
function hn(...e) {
|
|
668
|
+
return (t) => {
|
|
669
|
+
let n = !1;
|
|
670
|
+
const o = e.map((r) => {
|
|
671
|
+
const i = we(r, t);
|
|
672
|
+
return !n && typeof i == "function" && (n = !0), i;
|
|
673
|
+
});
|
|
674
|
+
if (n)
|
|
675
|
+
return () => {
|
|
676
|
+
for (let r = 0; r < o.length; r++) {
|
|
677
|
+
const i = o[r];
|
|
678
|
+
typeof i == "function" ? i() : we(e[r], null);
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
var Ye = s.forwardRef((e, t) => {
|
|
684
|
+
const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(yn);
|
|
685
|
+
if (i) {
|
|
686
|
+
const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
|
|
687
|
+
return /* @__PURE__ */ f(q, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
|
|
688
|
+
}
|
|
689
|
+
return /* @__PURE__ */ f(q, { ...o, ref: t, children: n });
|
|
690
|
+
});
|
|
691
|
+
Ye.displayName = "Slot";
|
|
692
|
+
var q = s.forwardRef((e, t) => {
|
|
693
|
+
const { children: n, ...o } = e;
|
|
694
|
+
if (s.isValidElement(n)) {
|
|
695
|
+
const r = wn(n), i = gn(o, n.props);
|
|
696
|
+
return n.type !== s.Fragment && (i.ref = t ? hn(t, r) : r), s.cloneElement(n, i);
|
|
697
|
+
}
|
|
698
|
+
return s.Children.count(n) > 1 ? s.Children.only(null) : null;
|
|
699
|
+
});
|
|
700
|
+
q.displayName = "SlotClone";
|
|
701
|
+
var vn = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
|
|
702
|
+
function yn(e) {
|
|
703
|
+
return s.isValidElement(e) && e.type === vn;
|
|
704
|
+
}
|
|
705
|
+
function gn(e, t) {
|
|
706
|
+
const n = { ...t };
|
|
707
|
+
for (const o in t) {
|
|
708
|
+
const r = e[o], i = t[o];
|
|
709
|
+
/^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
|
|
710
|
+
i(...c), r(...c);
|
|
711
|
+
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
|
|
712
|
+
}
|
|
713
|
+
return { ...e, ...n };
|
|
714
|
+
}
|
|
715
|
+
function wn(e) {
|
|
716
|
+
var o, r;
|
|
717
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
718
|
+
return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
719
|
+
}
|
|
720
|
+
var Cn = [
|
|
721
|
+
"a",
|
|
722
|
+
"button",
|
|
723
|
+
"div",
|
|
724
|
+
"form",
|
|
725
|
+
"h2",
|
|
726
|
+
"h3",
|
|
727
|
+
"img",
|
|
728
|
+
"input",
|
|
729
|
+
"label",
|
|
730
|
+
"li",
|
|
731
|
+
"nav",
|
|
732
|
+
"ol",
|
|
733
|
+
"p",
|
|
734
|
+
"span",
|
|
735
|
+
"svg",
|
|
736
|
+
"ul"
|
|
737
|
+
], En = Cn.reduce((e, t) => {
|
|
738
|
+
const n = s.forwardRef((o, r) => {
|
|
739
|
+
const { asChild: i, ...a } = o, c = i ? Ye : t;
|
|
740
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
|
|
741
|
+
});
|
|
742
|
+
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
743
|
+
}, {}), Pn = "VisuallyHidden", Ge = s.forwardRef(
|
|
744
|
+
(e, t) => /* @__PURE__ */ f(
|
|
745
|
+
En.span,
|
|
9
746
|
{
|
|
10
747
|
...e,
|
|
11
|
-
ref:
|
|
748
|
+
ref: t,
|
|
12
749
|
style: {
|
|
13
750
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
14
751
|
position: "absolute",
|
|
@@ -26,192 +763,192 @@ import '../../assets/RPTooltip.css';var ae = "VisuallyHidden", j = s.forwardRef(
|
|
|
26
763
|
}
|
|
27
764
|
)
|
|
28
765
|
);
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
]),
|
|
766
|
+
Ge.displayName = Pn;
|
|
767
|
+
var bn = Ge, [V, Gn] = Ee("Tooltip", [
|
|
768
|
+
Me
|
|
769
|
+
]), B = Me(), Xe = "TooltipProvider", xn = 700, K = "tooltip.open", [Rn, re] = V(Xe), ze = (e) => {
|
|
33
770
|
const {
|
|
34
|
-
__scopeTooltip:
|
|
35
|
-
delayDuration:
|
|
36
|
-
skipDelayDuration:
|
|
37
|
-
disableHoverableContent:
|
|
771
|
+
__scopeTooltip: t,
|
|
772
|
+
delayDuration: n = xn,
|
|
773
|
+
skipDelayDuration: o = 300,
|
|
774
|
+
disableHoverableContent: r = !1,
|
|
38
775
|
children: i
|
|
39
|
-
} = e, [
|
|
776
|
+
} = e, [a, c] = s.useState(!0), l = s.useRef(!1), u = s.useRef(0);
|
|
40
777
|
return s.useEffect(() => {
|
|
41
|
-
const
|
|
42
|
-
return () => window.clearTimeout(
|
|
43
|
-
}, []), /* @__PURE__ */
|
|
44
|
-
|
|
778
|
+
const d = u.current;
|
|
779
|
+
return () => window.clearTimeout(d);
|
|
780
|
+
}, []), /* @__PURE__ */ f(
|
|
781
|
+
Rn,
|
|
45
782
|
{
|
|
46
|
-
scope:
|
|
47
|
-
isOpenDelayed:
|
|
48
|
-
delayDuration:
|
|
783
|
+
scope: t,
|
|
784
|
+
isOpenDelayed: a,
|
|
785
|
+
delayDuration: n,
|
|
49
786
|
onOpen: s.useCallback(() => {
|
|
50
|
-
window.clearTimeout(
|
|
787
|
+
window.clearTimeout(u.current), c(!1);
|
|
51
788
|
}, []),
|
|
52
789
|
onClose: s.useCallback(() => {
|
|
53
|
-
window.clearTimeout(
|
|
54
|
-
() =>
|
|
55
|
-
|
|
790
|
+
window.clearTimeout(u.current), u.current = window.setTimeout(
|
|
791
|
+
() => c(!0),
|
|
792
|
+
o
|
|
56
793
|
);
|
|
57
|
-
}, [
|
|
58
|
-
isPointerInTransitRef:
|
|
59
|
-
onPointerInTransitChange: s.useCallback((
|
|
60
|
-
|
|
794
|
+
}, [o]),
|
|
795
|
+
isPointerInTransitRef: l,
|
|
796
|
+
onPointerInTransitChange: s.useCallback((d) => {
|
|
797
|
+
l.current = d;
|
|
61
798
|
}, []),
|
|
62
|
-
disableHoverableContent:
|
|
799
|
+
disableHoverableContent: r,
|
|
63
800
|
children: i
|
|
64
801
|
}
|
|
65
802
|
);
|
|
66
803
|
};
|
|
67
|
-
|
|
68
|
-
var
|
|
804
|
+
ze.displayName = Xe;
|
|
805
|
+
var U = "Tooltip", [An, j] = V(U), Ze = (e) => {
|
|
69
806
|
const {
|
|
70
|
-
__scopeTooltip:
|
|
71
|
-
children:
|
|
72
|
-
open:
|
|
73
|
-
defaultOpen:
|
|
807
|
+
__scopeTooltip: t,
|
|
808
|
+
children: n,
|
|
809
|
+
open: o,
|
|
810
|
+
defaultOpen: r = !1,
|
|
74
811
|
onOpenChange: i,
|
|
75
|
-
disableHoverableContent:
|
|
76
|
-
delayDuration:
|
|
77
|
-
} = e,
|
|
78
|
-
prop:
|
|
79
|
-
defaultProp:
|
|
80
|
-
onChange: (
|
|
81
|
-
|
|
812
|
+
disableHoverableContent: a,
|
|
813
|
+
delayDuration: c
|
|
814
|
+
} = e, l = re(U, e.__scopeTooltip), u = B(t), [d, m] = s.useState(null), h = Ot(), p = s.useRef(0), v = a ?? l.disableHoverableContent, y = c ?? l.delayDuration, w = s.useRef(!1), [E = !1, C] = vt({
|
|
815
|
+
prop: o,
|
|
816
|
+
defaultProp: r,
|
|
817
|
+
onChange: (g) => {
|
|
818
|
+
g ? (l.onOpen(), document.dispatchEvent(new CustomEvent(K))) : l.onClose(), i == null || i(g);
|
|
82
819
|
}
|
|
83
|
-
}),
|
|
84
|
-
window.clearTimeout(
|
|
85
|
-
}, [
|
|
86
|
-
window.clearTimeout(
|
|
87
|
-
}, [
|
|
88
|
-
window.clearTimeout(
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
}, [
|
|
820
|
+
}), x = s.useMemo(() => E ? w.current ? "delayed-open" : "instant-open" : "closed", [E]), P = s.useCallback(() => {
|
|
821
|
+
window.clearTimeout(p.current), p.current = 0, w.current = !1, C(!0);
|
|
822
|
+
}, [C]), R = s.useCallback(() => {
|
|
823
|
+
window.clearTimeout(p.current), p.current = 0, C(!1);
|
|
824
|
+
}, [C]), b = s.useCallback(() => {
|
|
825
|
+
window.clearTimeout(p.current), p.current = window.setTimeout(() => {
|
|
826
|
+
w.current = !0, C(!0), p.current = 0;
|
|
827
|
+
}, y);
|
|
828
|
+
}, [y, C]);
|
|
92
829
|
return s.useEffect(() => () => {
|
|
93
|
-
|
|
94
|
-
}, []), /* @__PURE__ */
|
|
95
|
-
|
|
830
|
+
p.current && (window.clearTimeout(p.current), p.current = 0);
|
|
831
|
+
}, []), /* @__PURE__ */ f(ln, { ...u, children: /* @__PURE__ */ f(
|
|
832
|
+
An,
|
|
96
833
|
{
|
|
97
|
-
scope:
|
|
98
|
-
contentId:
|
|
99
|
-
open:
|
|
100
|
-
stateAttribute:
|
|
101
|
-
trigger:
|
|
102
|
-
onTriggerChange:
|
|
834
|
+
scope: t,
|
|
835
|
+
contentId: h,
|
|
836
|
+
open: E,
|
|
837
|
+
stateAttribute: x,
|
|
838
|
+
trigger: d,
|
|
839
|
+
onTriggerChange: m,
|
|
103
840
|
onTriggerEnter: s.useCallback(() => {
|
|
104
|
-
|
|
105
|
-
}, [
|
|
841
|
+
l.isOpenDelayed ? b() : P();
|
|
842
|
+
}, [l.isOpenDelayed, b, P]),
|
|
106
843
|
onTriggerLeave: s.useCallback(() => {
|
|
107
|
-
|
|
108
|
-
}, [
|
|
109
|
-
onOpen:
|
|
110
|
-
onClose:
|
|
111
|
-
disableHoverableContent:
|
|
112
|
-
children:
|
|
844
|
+
v ? R() : (window.clearTimeout(p.current), p.current = 0);
|
|
845
|
+
}, [R, v]),
|
|
846
|
+
onOpen: P,
|
|
847
|
+
onClose: R,
|
|
848
|
+
disableHoverableContent: v,
|
|
849
|
+
children: n
|
|
113
850
|
}
|
|
114
851
|
) });
|
|
115
852
|
};
|
|
116
|
-
|
|
117
|
-
var
|
|
118
|
-
(e,
|
|
119
|
-
const { __scopeTooltip:
|
|
120
|
-
return s.useEffect(() => () => document.removeEventListener("pointerup",
|
|
121
|
-
|
|
853
|
+
Ze.displayName = U;
|
|
854
|
+
var J = "TooltipTrigger", qe = s.forwardRef(
|
|
855
|
+
(e, t) => {
|
|
856
|
+
const { __scopeTooltip: n, ...o } = e, r = j(J, n), i = re(J, n), a = B(n), c = s.useRef(null), l = _(t, c, r.onTriggerChange), u = s.useRef(!1), d = s.useRef(!1), m = s.useCallback(() => u.current = !1, []);
|
|
857
|
+
return s.useEffect(() => () => document.removeEventListener("pointerup", m), [m]), /* @__PURE__ */ f(cn, { asChild: !0, ...a, children: /* @__PURE__ */ f(
|
|
858
|
+
ee.button,
|
|
122
859
|
{
|
|
123
|
-
"aria-describedby":
|
|
124
|
-
"data-state":
|
|
125
|
-
...
|
|
126
|
-
ref:
|
|
127
|
-
onPointerMove:
|
|
128
|
-
|
|
860
|
+
"aria-describedby": r.open ? r.contentId : void 0,
|
|
861
|
+
"data-state": r.stateAttribute,
|
|
862
|
+
...o,
|
|
863
|
+
ref: l,
|
|
864
|
+
onPointerMove: A(e.onPointerMove, (h) => {
|
|
865
|
+
h.pointerType !== "touch" && !d.current && !i.isPointerInTransitRef.current && (r.onTriggerEnter(), d.current = !0);
|
|
129
866
|
}),
|
|
130
|
-
onPointerLeave:
|
|
131
|
-
|
|
867
|
+
onPointerLeave: A(e.onPointerLeave, () => {
|
|
868
|
+
r.onTriggerLeave(), d.current = !1;
|
|
132
869
|
}),
|
|
133
|
-
onPointerDown:
|
|
134
|
-
|
|
870
|
+
onPointerDown: A(e.onPointerDown, () => {
|
|
871
|
+
u.current = !0, document.addEventListener("pointerup", m, { once: !0 });
|
|
135
872
|
}),
|
|
136
|
-
onFocus:
|
|
137
|
-
|
|
873
|
+
onFocus: A(e.onFocus, () => {
|
|
874
|
+
u.current || r.onOpen();
|
|
138
875
|
}),
|
|
139
|
-
onBlur:
|
|
140
|
-
onClick:
|
|
876
|
+
onBlur: A(e.onBlur, r.onClose),
|
|
877
|
+
onClick: A(e.onClick, r.onClose)
|
|
141
878
|
}
|
|
142
879
|
) });
|
|
143
880
|
}
|
|
144
881
|
);
|
|
145
|
-
|
|
146
|
-
var
|
|
882
|
+
qe.displayName = J;
|
|
883
|
+
var Tn = "TooltipPortal", [Xn, On] = V(Tn, {
|
|
147
884
|
forceMount: void 0
|
|
148
|
-
}),
|
|
149
|
-
(e,
|
|
150
|
-
const
|
|
151
|
-
return /* @__PURE__ */
|
|
885
|
+
}), N = "TooltipContent", Ke = s.forwardRef(
|
|
886
|
+
(e, t) => {
|
|
887
|
+
const n = On(N, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, a = j(N, e.__scopeTooltip);
|
|
888
|
+
return /* @__PURE__ */ f(je, { present: o || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ f(Je, { side: r, ...i, ref: t }) : /* @__PURE__ */ f(Nn, { side: r, ...i, ref: t }) });
|
|
152
889
|
}
|
|
153
|
-
),
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
}, [
|
|
157
|
-
(
|
|
158
|
-
const
|
|
159
|
-
|
|
890
|
+
), Nn = s.forwardRef((e, t) => {
|
|
891
|
+
const n = j(N, e.__scopeTooltip), o = re(N, e.__scopeTooltip), r = s.useRef(null), i = _(t, r), [a, c] = s.useState(null), { trigger: l, onClose: u } = n, d = r.current, { onPointerInTransitChange: m } = o, h = s.useCallback(() => {
|
|
892
|
+
c(null), m(!1);
|
|
893
|
+
}, [m]), p = s.useCallback(
|
|
894
|
+
(v, y) => {
|
|
895
|
+
const w = v.currentTarget, E = { x: v.clientX, y: v.clientY }, C = _n(E, w.getBoundingClientRect()), x = Ln(E, C), P = $n(y.getBoundingClientRect()), R = In([...x, ...P]);
|
|
896
|
+
c(R), m(!0);
|
|
160
897
|
},
|
|
161
|
-
[
|
|
898
|
+
[m]
|
|
162
899
|
);
|
|
163
|
-
return s.useEffect(() => () =>
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
return
|
|
167
|
-
|
|
900
|
+
return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
|
|
901
|
+
if (l && d) {
|
|
902
|
+
const v = (w) => p(w, d), y = (w) => p(w, l);
|
|
903
|
+
return l.addEventListener("pointerleave", v), d.addEventListener("pointerleave", y), () => {
|
|
904
|
+
l.removeEventListener("pointerleave", v), d.removeEventListener("pointerleave", y);
|
|
168
905
|
};
|
|
169
906
|
}
|
|
170
|
-
}, [
|
|
171
|
-
if (
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
|
|
907
|
+
}, [l, d, p, h]), s.useEffect(() => {
|
|
908
|
+
if (a) {
|
|
909
|
+
const v = (y) => {
|
|
910
|
+
const w = y.target, E = { x: y.clientX, y: y.clientY }, C = (l == null ? void 0 : l.contains(w)) || (d == null ? void 0 : d.contains(w)), x = !Mn(E, a);
|
|
911
|
+
C ? h() : x && (h(), u());
|
|
175
912
|
};
|
|
176
|
-
return document.addEventListener("pointermove",
|
|
913
|
+
return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
|
|
177
914
|
}
|
|
178
|
-
}, [
|
|
179
|
-
}), [
|
|
180
|
-
(e,
|
|
915
|
+
}, [l, d, a, u, h]), /* @__PURE__ */ f(Je, { ...e, ref: i });
|
|
916
|
+
}), [Sn, Dn] = V(U, { isInside: !1 }), Je = s.forwardRef(
|
|
917
|
+
(e, t) => {
|
|
181
918
|
const {
|
|
182
|
-
__scopeTooltip:
|
|
183
|
-
children:
|
|
184
|
-
"aria-label":
|
|
919
|
+
__scopeTooltip: n,
|
|
920
|
+
children: o,
|
|
921
|
+
"aria-label": r,
|
|
185
922
|
onEscapeKeyDown: i,
|
|
186
|
-
onPointerDownOutside:
|
|
187
|
-
...
|
|
188
|
-
} = e,
|
|
189
|
-
return s.useEffect(() => (document.addEventListener(
|
|
190
|
-
if (
|
|
191
|
-
const
|
|
192
|
-
const
|
|
193
|
-
|
|
923
|
+
onPointerDownOutside: a,
|
|
924
|
+
...c
|
|
925
|
+
} = e, l = j(N, n), u = B(n), { onClose: d } = l;
|
|
926
|
+
return s.useEffect(() => (document.addEventListener(K, d), () => document.removeEventListener(K, d)), [d]), s.useEffect(() => {
|
|
927
|
+
if (l.trigger) {
|
|
928
|
+
const m = (h) => {
|
|
929
|
+
const p = h.target;
|
|
930
|
+
p != null && p.contains(l.trigger) && d();
|
|
194
931
|
};
|
|
195
|
-
return window.addEventListener("scroll",
|
|
932
|
+
return window.addEventListener("scroll", m, { capture: !0 }), () => window.removeEventListener("scroll", m, { capture: !0 });
|
|
196
933
|
}
|
|
197
|
-
}, [
|
|
198
|
-
|
|
934
|
+
}, [l.trigger, d]), /* @__PURE__ */ f(
|
|
935
|
+
Ae,
|
|
199
936
|
{
|
|
200
937
|
asChild: !0,
|
|
201
938
|
disableOutsidePointerEvents: !1,
|
|
202
939
|
onEscapeKeyDown: i,
|
|
203
|
-
onPointerDownOutside:
|
|
204
|
-
onFocusOutside: (
|
|
205
|
-
onDismiss:
|
|
206
|
-
children: /* @__PURE__ */
|
|
207
|
-
|
|
940
|
+
onPointerDownOutside: a,
|
|
941
|
+
onFocusOutside: (m) => m.preventDefault(),
|
|
942
|
+
onDismiss: d,
|
|
943
|
+
children: /* @__PURE__ */ Y(
|
|
944
|
+
un,
|
|
208
945
|
{
|
|
209
|
-
"data-state":
|
|
210
|
-
...
|
|
211
|
-
...
|
|
212
|
-
ref:
|
|
946
|
+
"data-state": l.stateAttribute,
|
|
947
|
+
...u,
|
|
948
|
+
...c,
|
|
949
|
+
ref: t,
|
|
213
950
|
style: {
|
|
214
|
-
...
|
|
951
|
+
...c.style,
|
|
215
952
|
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
216
953
|
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
217
954
|
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
@@ -219,8 +956,8 @@ var de = "TooltipPortal", [Le, pe] = R(de, {
|
|
|
219
956
|
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
220
957
|
},
|
|
221
958
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
959
|
+
/* @__PURE__ */ f(xe, { children: o }),
|
|
960
|
+
/* @__PURE__ */ f(Sn, { scope: n, isInside: !0, children: /* @__PURE__ */ f(bn, { id: l.contentId, role: "tooltip", children: r || o }) })
|
|
224
961
|
]
|
|
225
962
|
}
|
|
226
963
|
)
|
|
@@ -228,128 +965,128 @@ var de = "TooltipPortal", [Le, pe] = R(de, {
|
|
|
228
965
|
);
|
|
229
966
|
}
|
|
230
967
|
);
|
|
231
|
-
|
|
232
|
-
var
|
|
233
|
-
(e,
|
|
234
|
-
const { __scopeTooltip:
|
|
235
|
-
return
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
).isInside ? null : /* @__PURE__ */
|
|
968
|
+
Ke.displayName = N;
|
|
969
|
+
var Qe = "TooltipArrow", et = s.forwardRef(
|
|
970
|
+
(e, t) => {
|
|
971
|
+
const { __scopeTooltip: n, ...o } = e, r = B(n);
|
|
972
|
+
return Dn(
|
|
973
|
+
Qe,
|
|
974
|
+
n
|
|
975
|
+
).isInside ? null : /* @__PURE__ */ f(dn, { ...r, ...o, ref: t });
|
|
239
976
|
}
|
|
240
977
|
);
|
|
241
|
-
|
|
242
|
-
function
|
|
243
|
-
const
|
|
244
|
-
switch (Math.min(
|
|
978
|
+
et.displayName = Qe;
|
|
979
|
+
function _n(e, t) {
|
|
980
|
+
const n = Math.abs(t.top - e.y), o = Math.abs(t.bottom - e.y), r = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
|
|
981
|
+
switch (Math.min(n, o, r, i)) {
|
|
245
982
|
case i:
|
|
246
983
|
return "left";
|
|
247
|
-
case
|
|
984
|
+
case r:
|
|
248
985
|
return "right";
|
|
249
|
-
case
|
|
986
|
+
case n:
|
|
250
987
|
return "top";
|
|
251
|
-
case
|
|
988
|
+
case o:
|
|
252
989
|
return "bottom";
|
|
253
990
|
default:
|
|
254
991
|
throw new Error("unreachable");
|
|
255
992
|
}
|
|
256
993
|
}
|
|
257
|
-
function
|
|
258
|
-
const
|
|
259
|
-
switch (
|
|
994
|
+
function Ln(e, t, n = 5) {
|
|
995
|
+
const o = [];
|
|
996
|
+
switch (t) {
|
|
260
997
|
case "top":
|
|
261
|
-
|
|
262
|
-
{ x: e.x -
|
|
263
|
-
{ x: e.x +
|
|
998
|
+
o.push(
|
|
999
|
+
{ x: e.x - n, y: e.y + n },
|
|
1000
|
+
{ x: e.x + n, y: e.y + n }
|
|
264
1001
|
);
|
|
265
1002
|
break;
|
|
266
1003
|
case "bottom":
|
|
267
|
-
|
|
268
|
-
{ x: e.x -
|
|
269
|
-
{ x: e.x +
|
|
1004
|
+
o.push(
|
|
1005
|
+
{ x: e.x - n, y: e.y - n },
|
|
1006
|
+
{ x: e.x + n, y: e.y - n }
|
|
270
1007
|
);
|
|
271
1008
|
break;
|
|
272
1009
|
case "left":
|
|
273
|
-
|
|
274
|
-
{ x: e.x +
|
|
275
|
-
{ x: e.x +
|
|
1010
|
+
o.push(
|
|
1011
|
+
{ x: e.x + n, y: e.y - n },
|
|
1012
|
+
{ x: e.x + n, y: e.y + n }
|
|
276
1013
|
);
|
|
277
1014
|
break;
|
|
278
1015
|
case "right":
|
|
279
|
-
|
|
280
|
-
{ x: e.x -
|
|
281
|
-
{ x: e.x -
|
|
1016
|
+
o.push(
|
|
1017
|
+
{ x: e.x - n, y: e.y - n },
|
|
1018
|
+
{ x: e.x - n, y: e.y + n }
|
|
282
1019
|
);
|
|
283
1020
|
break;
|
|
284
1021
|
}
|
|
285
|
-
return
|
|
1022
|
+
return o;
|
|
286
1023
|
}
|
|
287
|
-
function
|
|
288
|
-
const { top:
|
|
1024
|
+
function $n(e) {
|
|
1025
|
+
const { top: t, right: n, bottom: o, left: r } = e;
|
|
289
1026
|
return [
|
|
1027
|
+
{ x: r, y: t },
|
|
1028
|
+
{ x: n, y: t },
|
|
290
1029
|
{ x: n, y: o },
|
|
291
|
-
{ x:
|
|
292
|
-
{ x: t, y: r },
|
|
293
|
-
{ x: n, y: r }
|
|
1030
|
+
{ x: r, y: o }
|
|
294
1031
|
];
|
|
295
1032
|
}
|
|
296
|
-
function
|
|
297
|
-
const { x:
|
|
298
|
-
let
|
|
299
|
-
for (let i = 0,
|
|
300
|
-
const
|
|
301
|
-
|
|
1033
|
+
function Mn(e, t) {
|
|
1034
|
+
const { x: n, y: o } = e;
|
|
1035
|
+
let r = !1;
|
|
1036
|
+
for (let i = 0, a = t.length - 1; i < t.length; a = i++) {
|
|
1037
|
+
const c = t[i].x, l = t[i].y, u = t[a].x, d = t[a].y;
|
|
1038
|
+
l > o != d > o && n < (u - c) * (o - l) / (d - l) + c && (r = !r);
|
|
302
1039
|
}
|
|
303
|
-
return
|
|
1040
|
+
return r;
|
|
304
1041
|
}
|
|
305
|
-
function
|
|
306
|
-
const
|
|
307
|
-
return
|
|
1042
|
+
function In(e) {
|
|
1043
|
+
const t = e.slice();
|
|
1044
|
+
return t.sort((n, o) => n.x < o.x ? -1 : n.x > o.x ? 1 : n.y < o.y ? -1 : n.y > o.y ? 1 : 0), Wn(t);
|
|
308
1045
|
}
|
|
309
|
-
function
|
|
1046
|
+
function Wn(e) {
|
|
310
1047
|
if (e.length <= 1)
|
|
311
1048
|
return e.slice();
|
|
312
|
-
const
|
|
313
|
-
for (let
|
|
314
|
-
const
|
|
315
|
-
for (;
|
|
316
|
-
const i =
|
|
317
|
-
if ((i.x -
|
|
318
|
-
|
|
1049
|
+
const t = [];
|
|
1050
|
+
for (let o = 0; o < e.length; o++) {
|
|
1051
|
+
const r = e[o];
|
|
1052
|
+
for (; t.length >= 2; ) {
|
|
1053
|
+
const i = t[t.length - 1], a = t[t.length - 2];
|
|
1054
|
+
if ((i.x - a.x) * (r.y - a.y) >= (i.y - a.y) * (r.x - a.x))
|
|
1055
|
+
t.pop();
|
|
319
1056
|
else
|
|
320
1057
|
break;
|
|
321
1058
|
}
|
|
322
|
-
|
|
1059
|
+
t.push(r);
|
|
323
1060
|
}
|
|
324
|
-
|
|
325
|
-
const
|
|
326
|
-
for (let
|
|
327
|
-
const
|
|
328
|
-
for (;
|
|
329
|
-
const i =
|
|
330
|
-
if ((i.x -
|
|
331
|
-
|
|
1061
|
+
t.pop();
|
|
1062
|
+
const n = [];
|
|
1063
|
+
for (let o = e.length - 1; o >= 0; o--) {
|
|
1064
|
+
const r = e[o];
|
|
1065
|
+
for (; n.length >= 2; ) {
|
|
1066
|
+
const i = n[n.length - 1], a = n[n.length - 2];
|
|
1067
|
+
if ((i.x - a.x) * (r.y - a.y) >= (i.y - a.y) * (r.x - a.x))
|
|
1068
|
+
n.pop();
|
|
332
1069
|
else
|
|
333
1070
|
break;
|
|
334
1071
|
}
|
|
335
|
-
|
|
1072
|
+
n.push(r);
|
|
336
1073
|
}
|
|
337
|
-
return
|
|
338
|
-
}
|
|
339
|
-
const
|
|
340
|
-
tooltipContent:
|
|
341
|
-
tooltipArrow:
|
|
342
|
-
fadeIn:
|
|
343
|
-
},
|
|
344
|
-
({ children: e, content:
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
/* @__PURE__ */
|
|
1074
|
+
return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
|
|
1075
|
+
}
|
|
1076
|
+
const kn = "_tooltipContent_1i9ed_1", Hn = "_tooltipArrow_1i9ed_8", Fn = "_fadeIn_1i9ed_1", Ce = {
|
|
1077
|
+
tooltipContent: kn,
|
|
1078
|
+
tooltipArrow: Hn,
|
|
1079
|
+
fadeIn: Fn
|
|
1080
|
+
}, Vn = mt(
|
|
1081
|
+
({ children: e, content: t, className: n }, o) => /* @__PURE__ */ f(ze, { children: /* @__PURE__ */ Y(Ze, { delayDuration: 1e3, children: [
|
|
1082
|
+
/* @__PURE__ */ f(qe, { asChild: !0, children: /* @__PURE__ */ f("div", { ref: o, className: n, children: e }) }),
|
|
1083
|
+
/* @__PURE__ */ Y(Ke, { className: Ce.tooltipContent, sideOffset: 5, children: [
|
|
1084
|
+
/* @__PURE__ */ f(et, { className: Ce.tooltipArrow }),
|
|
1085
|
+
/* @__PURE__ */ f("span", { children: t })
|
|
349
1086
|
] })
|
|
350
1087
|
] }) })
|
|
351
1088
|
);
|
|
352
|
-
|
|
1089
|
+
Vn.displayName = "RPTooltip";
|
|
353
1090
|
export {
|
|
354
|
-
|
|
1091
|
+
Vn as default
|
|
355
1092
|
};
|