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