@loopr-ai/craft 0.8.2 → 0.9.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/Box-96e795c4.js +58 -0
- package/dist/{ButtonBase-08b16b61.js → ButtonBase-46c20f20.js} +3 -3
- package/dist/{TextField-f61d210a.js → TextField-df89b641.js} +373 -387
- package/dist/{TransitionGroupContext-0e899f4c.js → TransitionGroupContext-21923db7.js} +1 -1
- package/dist/ZoomControllers-657c8b74.js +3383 -0
- package/dist/components/cell/AvatarGroup/index.js +3 -3
- package/dist/components/cell/Button/index.js +3 -3
- package/dist/components/cell/Chip/index.js +5 -5
- package/dist/components/cell/ProgressBar/index.js +3 -3
- package/dist/components/cell/Search/index.js +2 -2
- package/dist/components/cell/Typography/index.js +1 -1
- package/dist/components/organ/Form/ErrorMessage/ErrorMessage.styles.d.ts +14 -0
- package/dist/components/organ/Form/ErrorMessage/ErrorMessage.styles.js +16 -0
- package/dist/components/organ/Form/ErrorMessage/index.d.ts +6 -0
- package/dist/components/organ/Form/ErrorMessage/index.js +14 -0
- package/dist/components/organ/Form/Form.interfaces.d.ts +4 -2
- package/dist/components/organ/Form/Form.styles.d.ts +6 -99
- package/dist/components/organ/Form/Form.styles.js +8 -102
- package/dist/components/organ/Form/FormInput.js +54 -1524
- package/dist/components/organ/Form/Label/Label.styles.d.ts +14 -0
- package/dist/components/organ/Form/Label/Label.styles.js +16 -0
- package/dist/components/organ/Form/Label/index.d.ts +10 -0
- package/dist/components/organ/Form/Label/index.js +17 -0
- package/dist/components/organ/Form/RadioInput/RadioInput.styles.d.ts +17 -0
- package/dist/components/organ/Form/RadioInput/RadioInput.styles.js +20 -0
- package/dist/components/organ/Form/RadioInput/index.d.ts +16 -0
- package/dist/components/organ/Form/RadioInput/index.js +1053 -0
- package/dist/components/organ/Form/TextfieldInput/TextfieldInput.styles.d.ts +75 -0
- package/dist/components/organ/Form/TextfieldInput/TextfieldInput.styles.js +66 -0
- package/dist/components/organ/Form/TextfieldInput/index.d.ts +23 -0
- package/dist/components/organ/Form/TextfieldInput/index.js +525 -0
- package/dist/components/organ/Form/index.js +136 -148
- package/dist/components/organ/ZoomControlWithDrag/ZoomControllers.js +2 -2
- package/dist/components/organ/ZoomControlWithDrag/index.js +29 -35
- package/dist/{createSvgIcon-45340b5e.js → createSvgIcon-59e7bc15.js} +3195 -3245
- package/dist/{createSvgIcon-5aac746d.js → createSvgIcon-b444ce70.js} +5 -5
- package/dist/{createTheme-759a022d.js → createTheme-d2329909.js} +4 -4
- package/dist/dividerClasses-9354a5c9.js +10 -0
- package/dist/{exactProp-23d6a154.js → exactProp-3ee21234.js} +1 -1
- package/dist/{extendSxProp-cf8fd923.js → extendSxProp-f6cb682b.js} +1 -1
- package/dist/global/colors.d.ts +1 -0
- package/dist/global/colors.js +5 -4
- package/dist/global/theme.js +1 -1
- package/dist/{index-c9c32237.js → index-ae3eb123.js} +8 -8
- package/dist/main.js +1 -1
- package/dist/providers/CraftThemeProvider.js +2 -2
- package/dist/{styled-78608e1f.js → styled-8f7db30d.js} +39 -39
- package/dist/useControlled-4e337b2f.js +54 -0
- package/dist/useFormControl-b25c5813.js +19 -0
- package/dist/{useTheme-8906bd79.js → useTheme-21caf71b.js} +1 -1
- package/package.json +1 -1
- package/dist/Tooltip-e797a425.js +0 -2022
- package/dist/ZoomControllers-d04c25f8.js +0 -1432
|
@@ -0,0 +1,3383 @@
|
|
|
1
|
+
import At, { jsx as _, jsxs as wt, Fragment as Vr } from "react/jsx-runtime";
|
|
2
|
+
import { o as xo, P as Hr, H as Pt, u as Fr, G as Mo, k as dt, e as Zr, r as Rt, i as Dt } from "./createSvgIcon-59e7bc15.js";
|
|
3
|
+
import * as D from "react";
|
|
4
|
+
import Re, { useRef as Tt, useImperativeHandle as Ur, useEffect as Gt, useContext as Jt } from "react";
|
|
5
|
+
import { g as It, b as Pe, a as S, f as Ie, _ as je, P as u } from "./createTheme-d2329909.js";
|
|
6
|
+
import { g as eo, s as xe, b as xt, c as Be, e as Mt } from "./styled-8f7db30d.js";
|
|
7
|
+
import { u as qr } from "./useTheme-21caf71b.js";
|
|
8
|
+
import { c as Jo } from "./chainPropTypes-004bf492.js";
|
|
9
|
+
import { r as Io, u as Zt, c as Yo, b as Kr, a as Qr } from "./TransitionGroupContext-21923db7.js";
|
|
10
|
+
import { c as Gr } from "./useThemeWithoutDefault-188598a8.js";
|
|
11
|
+
import { u as Jr, a as Ir } from "./useControlled-4e337b2f.js";
|
|
12
|
+
import { B as ei } from "./ButtonBase-46c20f20.js";
|
|
13
|
+
import { B as ti } from "./Box-96e795c4.js";
|
|
14
|
+
import { g as oi } from "./dividerClasses-9354a5c9.js";
|
|
15
|
+
function ri(e) {
|
|
16
|
+
return It("MuiIconButton", e);
|
|
17
|
+
}
|
|
18
|
+
const ii = eo("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge"]), ni = ii, ai = ["edge", "children", "className", "color", "disabled", "disableFocusRipple", "size"], si = (e) => {
|
|
19
|
+
const {
|
|
20
|
+
classes: o,
|
|
21
|
+
disabled: t,
|
|
22
|
+
color: r,
|
|
23
|
+
edge: i,
|
|
24
|
+
size: n
|
|
25
|
+
} = e, a = {
|
|
26
|
+
root: ["root", t && "disabled", r !== "default" && `color${Pe(r)}`, i && `edge${Pe(i)}`, `size${Pe(n)}`]
|
|
27
|
+
};
|
|
28
|
+
return Mt(a, ri, o);
|
|
29
|
+
}, li = xe(ei, {
|
|
30
|
+
name: "MuiIconButton",
|
|
31
|
+
slot: "Root",
|
|
32
|
+
overridesResolver: (e, o) => {
|
|
33
|
+
const {
|
|
34
|
+
ownerState: t
|
|
35
|
+
} = e;
|
|
36
|
+
return [o.root, t.color !== "default" && o[`color${Pe(t.color)}`], t.edge && o[`edge${Pe(t.edge)}`], o[`size${Pe(t.size)}`]];
|
|
37
|
+
}
|
|
38
|
+
})(({
|
|
39
|
+
theme: e,
|
|
40
|
+
ownerState: o
|
|
41
|
+
}) => S({
|
|
42
|
+
textAlign: "center",
|
|
43
|
+
flex: "0 0 auto",
|
|
44
|
+
fontSize: e.typography.pxToRem(24),
|
|
45
|
+
padding: 8,
|
|
46
|
+
borderRadius: "50%",
|
|
47
|
+
overflow: "visible",
|
|
48
|
+
// Explicitly set the default value to solve a bug on IE11.
|
|
49
|
+
color: (e.vars || e).palette.action.active,
|
|
50
|
+
transition: e.transitions.create("background-color", {
|
|
51
|
+
duration: e.transitions.duration.shortest
|
|
52
|
+
})
|
|
53
|
+
}, !o.disableRipple && {
|
|
54
|
+
"&:hover": {
|
|
55
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})` : Ie(e.palette.action.active, e.palette.action.hoverOpacity),
|
|
56
|
+
// Reset on touch devices, it doesn't add specificity
|
|
57
|
+
"@media (hover: none)": {
|
|
58
|
+
backgroundColor: "transparent"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, o.edge === "start" && {
|
|
62
|
+
marginLeft: o.size === "small" ? -3 : -12
|
|
63
|
+
}, o.edge === "end" && {
|
|
64
|
+
marginRight: o.size === "small" ? -3 : -12
|
|
65
|
+
}), ({
|
|
66
|
+
theme: e,
|
|
67
|
+
ownerState: o
|
|
68
|
+
}) => {
|
|
69
|
+
var t;
|
|
70
|
+
const r = (t = (e.vars || e).palette) == null ? void 0 : t[o.color];
|
|
71
|
+
return S({}, o.color === "inherit" && {
|
|
72
|
+
color: "inherit"
|
|
73
|
+
}, o.color !== "inherit" && o.color !== "default" && S({
|
|
74
|
+
color: r == null ? void 0 : r.main
|
|
75
|
+
}, !o.disableRipple && {
|
|
76
|
+
"&:hover": S({}, r && {
|
|
77
|
+
backgroundColor: e.vars ? `rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})` : Ie(r.main, e.palette.action.hoverOpacity)
|
|
78
|
+
}, {
|
|
79
|
+
// Reset on touch devices, it doesn't add specificity
|
|
80
|
+
"@media (hover: none)": {
|
|
81
|
+
backgroundColor: "transparent"
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
}), o.size === "small" && {
|
|
85
|
+
padding: 5,
|
|
86
|
+
fontSize: e.typography.pxToRem(18)
|
|
87
|
+
}, o.size === "large" && {
|
|
88
|
+
padding: 12,
|
|
89
|
+
fontSize: e.typography.pxToRem(28)
|
|
90
|
+
}, {
|
|
91
|
+
[`&.${ni.disabled}`]: {
|
|
92
|
+
backgroundColor: "transparent",
|
|
93
|
+
color: (e.vars || e).palette.action.disabled
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}), er = /* @__PURE__ */ D.forwardRef(function(o, t) {
|
|
97
|
+
const r = xt({
|
|
98
|
+
props: o,
|
|
99
|
+
name: "MuiIconButton"
|
|
100
|
+
}), {
|
|
101
|
+
edge: i = !1,
|
|
102
|
+
children: n,
|
|
103
|
+
className: a,
|
|
104
|
+
color: s = "default",
|
|
105
|
+
disabled: l = !1,
|
|
106
|
+
disableFocusRipple: d = !1,
|
|
107
|
+
size: p = "medium"
|
|
108
|
+
} = r, f = je(r, ai), c = S({}, r, {
|
|
109
|
+
edge: i,
|
|
110
|
+
color: s,
|
|
111
|
+
disabled: l,
|
|
112
|
+
disableFocusRipple: d,
|
|
113
|
+
size: p
|
|
114
|
+
}), v = si(c);
|
|
115
|
+
return /* @__PURE__ */ _(li, S({
|
|
116
|
+
className: Be(v.root, a),
|
|
117
|
+
centerRipple: !0,
|
|
118
|
+
focusRipple: !d,
|
|
119
|
+
disabled: l,
|
|
120
|
+
ref: t,
|
|
121
|
+
ownerState: c
|
|
122
|
+
}, f, {
|
|
123
|
+
children: n
|
|
124
|
+
}));
|
|
125
|
+
});
|
|
126
|
+
process.env.NODE_ENV !== "production" && (er.propTypes = {
|
|
127
|
+
// ----------------------------- Warning --------------------------------
|
|
128
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
129
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
130
|
+
// ----------------------------------------------------------------------
|
|
131
|
+
/**
|
|
132
|
+
* The icon to display.
|
|
133
|
+
*/
|
|
134
|
+
children: Jo(u.node, (e) => D.Children.toArray(e.children).some((t) => /* @__PURE__ */ D.isValidElement(t) && t.props.onClick) ? new Error(["MUI: You are providing an onClick event listener to a child of a button element.", "Prefer applying it to the IconButton directly.", "This guarantees that the whole <button> will be responsive to click events."].join(`
|
|
135
|
+
`)) : null),
|
|
136
|
+
/**
|
|
137
|
+
* Override or extend the styles applied to the component.
|
|
138
|
+
*/
|
|
139
|
+
classes: u.object,
|
|
140
|
+
/**
|
|
141
|
+
* @ignore
|
|
142
|
+
*/
|
|
143
|
+
className: u.string,
|
|
144
|
+
/**
|
|
145
|
+
* The color of the component.
|
|
146
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
147
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
148
|
+
* @default 'default'
|
|
149
|
+
*/
|
|
150
|
+
color: u.oneOfType([u.oneOf(["inherit", "default", "primary", "secondary", "error", "info", "success", "warning"]), u.string]),
|
|
151
|
+
/**
|
|
152
|
+
* If `true`, the component is disabled.
|
|
153
|
+
* @default false
|
|
154
|
+
*/
|
|
155
|
+
disabled: u.bool,
|
|
156
|
+
/**
|
|
157
|
+
* If `true`, the keyboard focus ripple is disabled.
|
|
158
|
+
* @default false
|
|
159
|
+
*/
|
|
160
|
+
disableFocusRipple: u.bool,
|
|
161
|
+
/**
|
|
162
|
+
* If `true`, the ripple effect is disabled.
|
|
163
|
+
*
|
|
164
|
+
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
165
|
+
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
disableRipple: u.bool,
|
|
169
|
+
/**
|
|
170
|
+
* If given, uses a negative margin to counteract the padding on one
|
|
171
|
+
* side (this is often helpful for aligning the left or right
|
|
172
|
+
* side of the icon with content above or below, without ruining the border
|
|
173
|
+
* size and shape).
|
|
174
|
+
* @default false
|
|
175
|
+
*/
|
|
176
|
+
edge: u.oneOf(["end", "start", !1]),
|
|
177
|
+
/**
|
|
178
|
+
* The size of the component.
|
|
179
|
+
* `small` is equivalent to the dense button styling.
|
|
180
|
+
* @default 'medium'
|
|
181
|
+
*/
|
|
182
|
+
size: u.oneOfType([u.oneOf(["small", "medium", "large"]), u.string]),
|
|
183
|
+
/**
|
|
184
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
185
|
+
*/
|
|
186
|
+
sx: u.oneOfType([u.arrayOf(u.oneOfType([u.func, u.object, u.bool])), u.func, u.object])
|
|
187
|
+
});
|
|
188
|
+
const ft = er, ui = {
|
|
189
|
+
disableDefaultClasses: !1
|
|
190
|
+
}, pi = /* @__PURE__ */ D.createContext(ui);
|
|
191
|
+
function di(e) {
|
|
192
|
+
const {
|
|
193
|
+
disableDefaultClasses: o
|
|
194
|
+
} = D.useContext(pi);
|
|
195
|
+
return (t) => o ? "" : e(t);
|
|
196
|
+
}
|
|
197
|
+
var H = "top", re = "bottom", ie = "right", F = "left", to = "auto", ot = [H, re, ie, F], ze = "start", et = "end", fi = "clippingParents", tr = "viewport", qe = "popper", ci = "reference", _o = /* @__PURE__ */ ot.reduce(function(e, o) {
|
|
198
|
+
return e.concat([o + "-" + ze, o + "-" + et]);
|
|
199
|
+
}, []), or = /* @__PURE__ */ [].concat(ot, [to]).reduce(function(e, o) {
|
|
200
|
+
return e.concat([o, o + "-" + ze, o + "-" + et]);
|
|
201
|
+
}, []), vi = "beforeRead", mi = "read", hi = "afterRead", gi = "beforeMain", bi = "main", yi = "afterMain", wi = "beforeWrite", Pi = "write", Ti = "afterWrite", Ci = [vi, mi, hi, gi, bi, yi, wi, Pi, Ti];
|
|
202
|
+
function ce(e) {
|
|
203
|
+
return e ? (e.nodeName || "").toLowerCase() : null;
|
|
204
|
+
}
|
|
205
|
+
function J(e) {
|
|
206
|
+
if (e == null)
|
|
207
|
+
return window;
|
|
208
|
+
if (e.toString() !== "[object Window]") {
|
|
209
|
+
var o = e.ownerDocument;
|
|
210
|
+
return o && o.defaultView || window;
|
|
211
|
+
}
|
|
212
|
+
return e;
|
|
213
|
+
}
|
|
214
|
+
function De(e) {
|
|
215
|
+
var o = J(e).Element;
|
|
216
|
+
return e instanceof o || e instanceof Element;
|
|
217
|
+
}
|
|
218
|
+
function oe(e) {
|
|
219
|
+
var o = J(e).HTMLElement;
|
|
220
|
+
return e instanceof o || e instanceof HTMLElement;
|
|
221
|
+
}
|
|
222
|
+
function oo(e) {
|
|
223
|
+
if (typeof ShadowRoot > "u")
|
|
224
|
+
return !1;
|
|
225
|
+
var o = J(e).ShadowRoot;
|
|
226
|
+
return e instanceof o || e instanceof ShadowRoot;
|
|
227
|
+
}
|
|
228
|
+
function Si(e) {
|
|
229
|
+
var o = e.state;
|
|
230
|
+
Object.keys(o.elements).forEach(function(t) {
|
|
231
|
+
var r = o.styles[t] || {}, i = o.attributes[t] || {}, n = o.elements[t];
|
|
232
|
+
!oe(n) || !ce(n) || (Object.assign(n.style, r), Object.keys(i).forEach(function(a) {
|
|
233
|
+
var s = i[a];
|
|
234
|
+
s === !1 ? n.removeAttribute(a) : n.setAttribute(a, s === !0 ? "" : s);
|
|
235
|
+
}));
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
function Oi(e) {
|
|
239
|
+
var o = e.state, t = {
|
|
240
|
+
popper: {
|
|
241
|
+
position: o.options.strategy,
|
|
242
|
+
left: "0",
|
|
243
|
+
top: "0",
|
|
244
|
+
margin: "0"
|
|
245
|
+
},
|
|
246
|
+
arrow: {
|
|
247
|
+
position: "absolute"
|
|
248
|
+
},
|
|
249
|
+
reference: {}
|
|
250
|
+
};
|
|
251
|
+
return Object.assign(o.elements.popper.style, t.popper), o.styles = t, o.elements.arrow && Object.assign(o.elements.arrow.style, t.arrow), function() {
|
|
252
|
+
Object.keys(o.elements).forEach(function(r) {
|
|
253
|
+
var i = o.elements[r], n = o.attributes[r] || {}, a = Object.keys(o.styles.hasOwnProperty(r) ? o.styles[r] : t[r]), s = a.reduce(function(l, d) {
|
|
254
|
+
return l[d] = "", l;
|
|
255
|
+
}, {});
|
|
256
|
+
!oe(i) || !ce(i) || (Object.assign(i.style, s), Object.keys(n).forEach(function(l) {
|
|
257
|
+
i.removeAttribute(l);
|
|
258
|
+
}));
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
const Ei = {
|
|
263
|
+
name: "applyStyles",
|
|
264
|
+
enabled: !0,
|
|
265
|
+
phase: "write",
|
|
266
|
+
fn: Si,
|
|
267
|
+
effect: Oi,
|
|
268
|
+
requires: ["computeStyles"]
|
|
269
|
+
};
|
|
270
|
+
function fe(e) {
|
|
271
|
+
return e.split("-")[0];
|
|
272
|
+
}
|
|
273
|
+
var Ae = Math.max, Ct = Math.min, Xe = Math.round;
|
|
274
|
+
function Ut() {
|
|
275
|
+
var e = navigator.userAgentData;
|
|
276
|
+
return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(o) {
|
|
277
|
+
return o.brand + "/" + o.version;
|
|
278
|
+
}).join(" ") : navigator.userAgent;
|
|
279
|
+
}
|
|
280
|
+
function rr() {
|
|
281
|
+
return !/^((?!chrome|android).)*safari/i.test(Ut());
|
|
282
|
+
}
|
|
283
|
+
function We(e, o, t) {
|
|
284
|
+
o === void 0 && (o = !1), t === void 0 && (t = !1);
|
|
285
|
+
var r = e.getBoundingClientRect(), i = 1, n = 1;
|
|
286
|
+
o && oe(e) && (i = e.offsetWidth > 0 && Xe(r.width) / e.offsetWidth || 1, n = e.offsetHeight > 0 && Xe(r.height) / e.offsetHeight || 1);
|
|
287
|
+
var a = De(e) ? J(e) : window, s = a.visualViewport, l = !rr() && t, d = (r.left + (l && s ? s.offsetLeft : 0)) / i, p = (r.top + (l && s ? s.offsetTop : 0)) / n, f = r.width / i, c = r.height / n;
|
|
288
|
+
return {
|
|
289
|
+
width: f,
|
|
290
|
+
height: c,
|
|
291
|
+
top: p,
|
|
292
|
+
right: d + f,
|
|
293
|
+
bottom: p + c,
|
|
294
|
+
left: d,
|
|
295
|
+
x: d,
|
|
296
|
+
y: p
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function ro(e) {
|
|
300
|
+
var o = We(e), t = e.offsetWidth, r = e.offsetHeight;
|
|
301
|
+
return Math.abs(o.width - t) <= 1 && (t = o.width), Math.abs(o.height - r) <= 1 && (r = o.height), {
|
|
302
|
+
x: e.offsetLeft,
|
|
303
|
+
y: e.offsetTop,
|
|
304
|
+
width: t,
|
|
305
|
+
height: r
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
function ir(e, o) {
|
|
309
|
+
var t = o.getRootNode && o.getRootNode();
|
|
310
|
+
if (e.contains(o))
|
|
311
|
+
return !0;
|
|
312
|
+
if (t && oo(t)) {
|
|
313
|
+
var r = o;
|
|
314
|
+
do {
|
|
315
|
+
if (r && e.isSameNode(r))
|
|
316
|
+
return !0;
|
|
317
|
+
r = r.parentNode || r.host;
|
|
318
|
+
} while (r);
|
|
319
|
+
}
|
|
320
|
+
return !1;
|
|
321
|
+
}
|
|
322
|
+
function ge(e) {
|
|
323
|
+
return J(e).getComputedStyle(e);
|
|
324
|
+
}
|
|
325
|
+
function Ai(e) {
|
|
326
|
+
return ["table", "td", "th"].indexOf(ce(e)) >= 0;
|
|
327
|
+
}
|
|
328
|
+
function Ce(e) {
|
|
329
|
+
return ((De(e) ? e.ownerDocument : (
|
|
330
|
+
// $FlowFixMe[prop-missing]
|
|
331
|
+
e.document
|
|
332
|
+
)) || window.document).documentElement;
|
|
333
|
+
}
|
|
334
|
+
function Yt(e) {
|
|
335
|
+
return ce(e) === "html" ? e : (
|
|
336
|
+
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
337
|
+
// $FlowFixMe[incompatible-return]
|
|
338
|
+
// $FlowFixMe[prop-missing]
|
|
339
|
+
e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
340
|
+
e.parentNode || // DOM Element detected
|
|
341
|
+
(oo(e) ? e.host : null) || // ShadowRoot detected
|
|
342
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
343
|
+
Ce(e)
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
function No(e) {
|
|
347
|
+
return !oe(e) || // https://github.com/popperjs/popper-core/issues/837
|
|
348
|
+
ge(e).position === "fixed" ? null : e.offsetParent;
|
|
349
|
+
}
|
|
350
|
+
function Ri(e) {
|
|
351
|
+
var o = /firefox/i.test(Ut()), t = /Trident/i.test(Ut());
|
|
352
|
+
if (t && oe(e)) {
|
|
353
|
+
var r = ge(e);
|
|
354
|
+
if (r.position === "fixed")
|
|
355
|
+
return null;
|
|
356
|
+
}
|
|
357
|
+
var i = Yt(e);
|
|
358
|
+
for (oo(i) && (i = i.host); oe(i) && ["html", "body"].indexOf(ce(i)) < 0; ) {
|
|
359
|
+
var n = ge(i);
|
|
360
|
+
if (n.transform !== "none" || n.perspective !== "none" || n.contain === "paint" || ["transform", "perspective"].indexOf(n.willChange) !== -1 || o && n.willChange === "filter" || o && n.filter && n.filter !== "none")
|
|
361
|
+
return i;
|
|
362
|
+
i = i.parentNode;
|
|
363
|
+
}
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
function rt(e) {
|
|
367
|
+
for (var o = J(e), t = No(e); t && Ai(t) && ge(t).position === "static"; )
|
|
368
|
+
t = No(t);
|
|
369
|
+
return t && (ce(t) === "html" || ce(t) === "body" && ge(t).position === "static") ? o : t || Ri(e) || o;
|
|
370
|
+
}
|
|
371
|
+
function io(e) {
|
|
372
|
+
return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
|
|
373
|
+
}
|
|
374
|
+
function Ge(e, o, t) {
|
|
375
|
+
return Ae(e, Ct(o, t));
|
|
376
|
+
}
|
|
377
|
+
function Di(e, o, t) {
|
|
378
|
+
var r = Ge(e, o, t);
|
|
379
|
+
return r > t ? t : r;
|
|
380
|
+
}
|
|
381
|
+
function nr() {
|
|
382
|
+
return {
|
|
383
|
+
top: 0,
|
|
384
|
+
right: 0,
|
|
385
|
+
bottom: 0,
|
|
386
|
+
left: 0
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
function ar(e) {
|
|
390
|
+
return Object.assign({}, nr(), e);
|
|
391
|
+
}
|
|
392
|
+
function sr(e, o) {
|
|
393
|
+
return o.reduce(function(t, r) {
|
|
394
|
+
return t[r] = e, t;
|
|
395
|
+
}, {});
|
|
396
|
+
}
|
|
397
|
+
var xi = function(o, t) {
|
|
398
|
+
return o = typeof o == "function" ? o(Object.assign({}, t.rects, {
|
|
399
|
+
placement: t.placement
|
|
400
|
+
})) : o, ar(typeof o != "number" ? o : sr(o, ot));
|
|
401
|
+
};
|
|
402
|
+
function Mi(e) {
|
|
403
|
+
var o, t = e.state, r = e.name, i = e.options, n = t.elements.arrow, a = t.modifiersData.popperOffsets, s = fe(t.placement), l = io(s), d = [F, ie].indexOf(s) >= 0, p = d ? "height" : "width";
|
|
404
|
+
if (!(!n || !a)) {
|
|
405
|
+
var f = xi(i.padding, t), c = ro(n), v = l === "y" ? H : F, h = l === "y" ? re : ie, m = t.rects.reference[p] + t.rects.reference[l] - a[l] - t.rects.popper[p], g = a[l] - t.rects.reference[l], P = rt(n), C = P ? l === "y" ? P.clientHeight || 0 : P.clientWidth || 0 : 0, y = m / 2 - g / 2, b = f[v], w = C - c[p] - f[h], T = C / 2 - c[p] / 2 + y, O = Ge(b, T, w), x = l;
|
|
406
|
+
t.modifiersData[r] = (o = {}, o[x] = O, o.centerOffset = O - T, o);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function Yi(e) {
|
|
410
|
+
var o = e.state, t = e.options, r = t.element, i = r === void 0 ? "[data-popper-arrow]" : r;
|
|
411
|
+
i != null && (typeof i == "string" && (i = o.elements.popper.querySelector(i), !i) || ir(o.elements.popper, i) && (o.elements.arrow = i));
|
|
412
|
+
}
|
|
413
|
+
const _i = {
|
|
414
|
+
name: "arrow",
|
|
415
|
+
enabled: !0,
|
|
416
|
+
phase: "main",
|
|
417
|
+
fn: Mi,
|
|
418
|
+
effect: Yi,
|
|
419
|
+
requires: ["popperOffsets"],
|
|
420
|
+
requiresIfExists: ["preventOverflow"]
|
|
421
|
+
};
|
|
422
|
+
function $e(e) {
|
|
423
|
+
return e.split("-")[1];
|
|
424
|
+
}
|
|
425
|
+
var Ni = {
|
|
426
|
+
top: "auto",
|
|
427
|
+
right: "auto",
|
|
428
|
+
bottom: "auto",
|
|
429
|
+
left: "auto"
|
|
430
|
+
};
|
|
431
|
+
function Bi(e, o) {
|
|
432
|
+
var t = e.x, r = e.y, i = o.devicePixelRatio || 1;
|
|
433
|
+
return {
|
|
434
|
+
x: Xe(t * i) / i || 0,
|
|
435
|
+
y: Xe(r * i) / i || 0
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
function Bo(e) {
|
|
439
|
+
var o, t = e.popper, r = e.popperRect, i = e.placement, n = e.variation, a = e.offsets, s = e.position, l = e.gpuAcceleration, d = e.adaptive, p = e.roundOffsets, f = e.isFixed, c = a.x, v = c === void 0 ? 0 : c, h = a.y, m = h === void 0 ? 0 : h, g = typeof p == "function" ? p({
|
|
440
|
+
x: v,
|
|
441
|
+
y: m
|
|
442
|
+
}) : {
|
|
443
|
+
x: v,
|
|
444
|
+
y: m
|
|
445
|
+
};
|
|
446
|
+
v = g.x, m = g.y;
|
|
447
|
+
var P = a.hasOwnProperty("x"), C = a.hasOwnProperty("y"), y = F, b = H, w = window;
|
|
448
|
+
if (d) {
|
|
449
|
+
var T = rt(t), O = "clientHeight", x = "clientWidth";
|
|
450
|
+
if (T === J(t) && (T = Ce(t), ge(T).position !== "static" && s === "absolute" && (O = "scrollHeight", x = "scrollWidth")), T = T, i === H || (i === F || i === ie) && n === et) {
|
|
451
|
+
b = re;
|
|
452
|
+
var E = f && T === w && w.visualViewport ? w.visualViewport.height : (
|
|
453
|
+
// $FlowFixMe[prop-missing]
|
|
454
|
+
T[O]
|
|
455
|
+
);
|
|
456
|
+
m -= E - r.height, m *= l ? 1 : -1;
|
|
457
|
+
}
|
|
458
|
+
if (i === F || (i === H || i === re) && n === et) {
|
|
459
|
+
y = ie;
|
|
460
|
+
var A = f && T === w && w.visualViewport ? w.visualViewport.width : (
|
|
461
|
+
// $FlowFixMe[prop-missing]
|
|
462
|
+
T[x]
|
|
463
|
+
);
|
|
464
|
+
v -= A - r.width, v *= l ? 1 : -1;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
var M = Object.assign({
|
|
468
|
+
position: s
|
|
469
|
+
}, d && Ni), X = p === !0 ? Bi({
|
|
470
|
+
x: v,
|
|
471
|
+
y: m
|
|
472
|
+
}, J(t)) : {
|
|
473
|
+
x: v,
|
|
474
|
+
y: m
|
|
475
|
+
};
|
|
476
|
+
if (v = X.x, m = X.y, l) {
|
|
477
|
+
var N;
|
|
478
|
+
return Object.assign({}, M, (N = {}, N[b] = C ? "0" : "", N[y] = P ? "0" : "", N.transform = (w.devicePixelRatio || 1) <= 1 ? "translate(" + v + "px, " + m + "px)" : "translate3d(" + v + "px, " + m + "px, 0)", N));
|
|
479
|
+
}
|
|
480
|
+
return Object.assign({}, M, (o = {}, o[b] = C ? m + "px" : "", o[y] = P ? v + "px" : "", o.transform = "", o));
|
|
481
|
+
}
|
|
482
|
+
function zi(e) {
|
|
483
|
+
var o = e.state, t = e.options, r = t.gpuAcceleration, i = r === void 0 ? !0 : r, n = t.adaptive, a = n === void 0 ? !0 : n, s = t.roundOffsets, l = s === void 0 ? !0 : s, d = {
|
|
484
|
+
placement: fe(o.placement),
|
|
485
|
+
variation: $e(o.placement),
|
|
486
|
+
popper: o.elements.popper,
|
|
487
|
+
popperRect: o.rects.popper,
|
|
488
|
+
gpuAcceleration: i,
|
|
489
|
+
isFixed: o.options.strategy === "fixed"
|
|
490
|
+
};
|
|
491
|
+
o.modifiersData.popperOffsets != null && (o.styles.popper = Object.assign({}, o.styles.popper, Bo(Object.assign({}, d, {
|
|
492
|
+
offsets: o.modifiersData.popperOffsets,
|
|
493
|
+
position: o.options.strategy,
|
|
494
|
+
adaptive: a,
|
|
495
|
+
roundOffsets: l
|
|
496
|
+
})))), o.modifiersData.arrow != null && (o.styles.arrow = Object.assign({}, o.styles.arrow, Bo(Object.assign({}, d, {
|
|
497
|
+
offsets: o.modifiersData.arrow,
|
|
498
|
+
position: "absolute",
|
|
499
|
+
adaptive: !1,
|
|
500
|
+
roundOffsets: l
|
|
501
|
+
})))), o.attributes.popper = Object.assign({}, o.attributes.popper, {
|
|
502
|
+
"data-popper-placement": o.placement
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
const Xi = {
|
|
506
|
+
name: "computeStyles",
|
|
507
|
+
enabled: !0,
|
|
508
|
+
phase: "beforeWrite",
|
|
509
|
+
fn: zi,
|
|
510
|
+
data: {}
|
|
511
|
+
};
|
|
512
|
+
var ct = {
|
|
513
|
+
passive: !0
|
|
514
|
+
};
|
|
515
|
+
function Wi(e) {
|
|
516
|
+
var o = e.state, t = e.instance, r = e.options, i = r.scroll, n = i === void 0 ? !0 : i, a = r.resize, s = a === void 0 ? !0 : a, l = J(o.elements.popper), d = [].concat(o.scrollParents.reference, o.scrollParents.popper);
|
|
517
|
+
return n && d.forEach(function(p) {
|
|
518
|
+
p.addEventListener("scroll", t.update, ct);
|
|
519
|
+
}), s && l.addEventListener("resize", t.update, ct), function() {
|
|
520
|
+
n && d.forEach(function(p) {
|
|
521
|
+
p.removeEventListener("scroll", t.update, ct);
|
|
522
|
+
}), s && l.removeEventListener("resize", t.update, ct);
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
const $i = {
|
|
526
|
+
name: "eventListeners",
|
|
527
|
+
enabled: !0,
|
|
528
|
+
phase: "write",
|
|
529
|
+
fn: function() {
|
|
530
|
+
},
|
|
531
|
+
effect: Wi,
|
|
532
|
+
data: {}
|
|
533
|
+
};
|
|
534
|
+
var ki = {
|
|
535
|
+
left: "right",
|
|
536
|
+
right: "left",
|
|
537
|
+
bottom: "top",
|
|
538
|
+
top: "bottom"
|
|
539
|
+
};
|
|
540
|
+
function bt(e) {
|
|
541
|
+
return e.replace(/left|right|bottom|top/g, function(o) {
|
|
542
|
+
return ki[o];
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
var ji = {
|
|
546
|
+
start: "end",
|
|
547
|
+
end: "start"
|
|
548
|
+
};
|
|
549
|
+
function zo(e) {
|
|
550
|
+
return e.replace(/start|end/g, function(o) {
|
|
551
|
+
return ji[o];
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
function no(e) {
|
|
555
|
+
var o = J(e), t = o.pageXOffset, r = o.pageYOffset;
|
|
556
|
+
return {
|
|
557
|
+
scrollLeft: t,
|
|
558
|
+
scrollTop: r
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
function ao(e) {
|
|
562
|
+
return We(Ce(e)).left + no(e).scrollLeft;
|
|
563
|
+
}
|
|
564
|
+
function Li(e, o) {
|
|
565
|
+
var t = J(e), r = Ce(e), i = t.visualViewport, n = r.clientWidth, a = r.clientHeight, s = 0, l = 0;
|
|
566
|
+
if (i) {
|
|
567
|
+
n = i.width, a = i.height;
|
|
568
|
+
var d = rr();
|
|
569
|
+
(d || !d && o === "fixed") && (s = i.offsetLeft, l = i.offsetTop);
|
|
570
|
+
}
|
|
571
|
+
return {
|
|
572
|
+
width: n,
|
|
573
|
+
height: a,
|
|
574
|
+
x: s + ao(e),
|
|
575
|
+
y: l
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
function Vi(e) {
|
|
579
|
+
var o, t = Ce(e), r = no(e), i = (o = e.ownerDocument) == null ? void 0 : o.body, n = Ae(t.scrollWidth, t.clientWidth, i ? i.scrollWidth : 0, i ? i.clientWidth : 0), a = Ae(t.scrollHeight, t.clientHeight, i ? i.scrollHeight : 0, i ? i.clientHeight : 0), s = -r.scrollLeft + ao(e), l = -r.scrollTop;
|
|
580
|
+
return ge(i || t).direction === "rtl" && (s += Ae(t.clientWidth, i ? i.clientWidth : 0) - n), {
|
|
581
|
+
width: n,
|
|
582
|
+
height: a,
|
|
583
|
+
x: s,
|
|
584
|
+
y: l
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
function so(e) {
|
|
588
|
+
var o = ge(e), t = o.overflow, r = o.overflowX, i = o.overflowY;
|
|
589
|
+
return /auto|scroll|overlay|hidden/.test(t + i + r);
|
|
590
|
+
}
|
|
591
|
+
function lr(e) {
|
|
592
|
+
return ["html", "body", "#document"].indexOf(ce(e)) >= 0 ? e.ownerDocument.body : oe(e) && so(e) ? e : lr(Yt(e));
|
|
593
|
+
}
|
|
594
|
+
function Je(e, o) {
|
|
595
|
+
var t;
|
|
596
|
+
o === void 0 && (o = []);
|
|
597
|
+
var r = lr(e), i = r === ((t = e.ownerDocument) == null ? void 0 : t.body), n = J(r), a = i ? [n].concat(n.visualViewport || [], so(r) ? r : []) : r, s = o.concat(a);
|
|
598
|
+
return i ? s : (
|
|
599
|
+
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
600
|
+
s.concat(Je(Yt(a)))
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
function qt(e) {
|
|
604
|
+
return Object.assign({}, e, {
|
|
605
|
+
left: e.x,
|
|
606
|
+
top: e.y,
|
|
607
|
+
right: e.x + e.width,
|
|
608
|
+
bottom: e.y + e.height
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
function Hi(e, o) {
|
|
612
|
+
var t = We(e, !1, o === "fixed");
|
|
613
|
+
return t.top = t.top + e.clientTop, t.left = t.left + e.clientLeft, t.bottom = t.top + e.clientHeight, t.right = t.left + e.clientWidth, t.width = e.clientWidth, t.height = e.clientHeight, t.x = t.left, t.y = t.top, t;
|
|
614
|
+
}
|
|
615
|
+
function Xo(e, o, t) {
|
|
616
|
+
return o === tr ? qt(Li(e, t)) : De(o) ? Hi(o, t) : qt(Vi(Ce(e)));
|
|
617
|
+
}
|
|
618
|
+
function Fi(e) {
|
|
619
|
+
var o = Je(Yt(e)), t = ["absolute", "fixed"].indexOf(ge(e).position) >= 0, r = t && oe(e) ? rt(e) : e;
|
|
620
|
+
return De(r) ? o.filter(function(i) {
|
|
621
|
+
return De(i) && ir(i, r) && ce(i) !== "body";
|
|
622
|
+
}) : [];
|
|
623
|
+
}
|
|
624
|
+
function Zi(e, o, t, r) {
|
|
625
|
+
var i = o === "clippingParents" ? Fi(e) : [].concat(o), n = [].concat(i, [t]), a = n[0], s = n.reduce(function(l, d) {
|
|
626
|
+
var p = Xo(e, d, r);
|
|
627
|
+
return l.top = Ae(p.top, l.top), l.right = Ct(p.right, l.right), l.bottom = Ct(p.bottom, l.bottom), l.left = Ae(p.left, l.left), l;
|
|
628
|
+
}, Xo(e, a, r));
|
|
629
|
+
return s.width = s.right - s.left, s.height = s.bottom - s.top, s.x = s.left, s.y = s.top, s;
|
|
630
|
+
}
|
|
631
|
+
function ur(e) {
|
|
632
|
+
var o = e.reference, t = e.element, r = e.placement, i = r ? fe(r) : null, n = r ? $e(r) : null, a = o.x + o.width / 2 - t.width / 2, s = o.y + o.height / 2 - t.height / 2, l;
|
|
633
|
+
switch (i) {
|
|
634
|
+
case H:
|
|
635
|
+
l = {
|
|
636
|
+
x: a,
|
|
637
|
+
y: o.y - t.height
|
|
638
|
+
};
|
|
639
|
+
break;
|
|
640
|
+
case re:
|
|
641
|
+
l = {
|
|
642
|
+
x: a,
|
|
643
|
+
y: o.y + o.height
|
|
644
|
+
};
|
|
645
|
+
break;
|
|
646
|
+
case ie:
|
|
647
|
+
l = {
|
|
648
|
+
x: o.x + o.width,
|
|
649
|
+
y: s
|
|
650
|
+
};
|
|
651
|
+
break;
|
|
652
|
+
case F:
|
|
653
|
+
l = {
|
|
654
|
+
x: o.x - t.width,
|
|
655
|
+
y: s
|
|
656
|
+
};
|
|
657
|
+
break;
|
|
658
|
+
default:
|
|
659
|
+
l = {
|
|
660
|
+
x: o.x,
|
|
661
|
+
y: o.y
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
var d = i ? io(i) : null;
|
|
665
|
+
if (d != null) {
|
|
666
|
+
var p = d === "y" ? "height" : "width";
|
|
667
|
+
switch (n) {
|
|
668
|
+
case ze:
|
|
669
|
+
l[d] = l[d] - (o[p] / 2 - t[p] / 2);
|
|
670
|
+
break;
|
|
671
|
+
case et:
|
|
672
|
+
l[d] = l[d] + (o[p] / 2 - t[p] / 2);
|
|
673
|
+
break;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return l;
|
|
677
|
+
}
|
|
678
|
+
function tt(e, o) {
|
|
679
|
+
o === void 0 && (o = {});
|
|
680
|
+
var t = o, r = t.placement, i = r === void 0 ? e.placement : r, n = t.strategy, a = n === void 0 ? e.strategy : n, s = t.boundary, l = s === void 0 ? fi : s, d = t.rootBoundary, p = d === void 0 ? tr : d, f = t.elementContext, c = f === void 0 ? qe : f, v = t.altBoundary, h = v === void 0 ? !1 : v, m = t.padding, g = m === void 0 ? 0 : m, P = ar(typeof g != "number" ? g : sr(g, ot)), C = c === qe ? ci : qe, y = e.rects.popper, b = e.elements[h ? C : c], w = Zi(De(b) ? b : b.contextElement || Ce(e.elements.popper), l, p, a), T = We(e.elements.reference), O = ur({
|
|
681
|
+
reference: T,
|
|
682
|
+
element: y,
|
|
683
|
+
strategy: "absolute",
|
|
684
|
+
placement: i
|
|
685
|
+
}), x = qt(Object.assign({}, y, O)), E = c === qe ? x : T, A = {
|
|
686
|
+
top: w.top - E.top + P.top,
|
|
687
|
+
bottom: E.bottom - w.bottom + P.bottom,
|
|
688
|
+
left: w.left - E.left + P.left,
|
|
689
|
+
right: E.right - w.right + P.right
|
|
690
|
+
}, M = e.modifiersData.offset;
|
|
691
|
+
if (c === qe && M) {
|
|
692
|
+
var X = M[i];
|
|
693
|
+
Object.keys(A).forEach(function(N) {
|
|
694
|
+
var Z = [ie, re].indexOf(N) >= 0 ? 1 : -1, U = [H, re].indexOf(N) >= 0 ? "y" : "x";
|
|
695
|
+
A[N] += X[U] * Z;
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
return A;
|
|
699
|
+
}
|
|
700
|
+
function Ui(e, o) {
|
|
701
|
+
o === void 0 && (o = {});
|
|
702
|
+
var t = o, r = t.placement, i = t.boundary, n = t.rootBoundary, a = t.padding, s = t.flipVariations, l = t.allowedAutoPlacements, d = l === void 0 ? or : l, p = $e(r), f = p ? s ? _o : _o.filter(function(h) {
|
|
703
|
+
return $e(h) === p;
|
|
704
|
+
}) : ot, c = f.filter(function(h) {
|
|
705
|
+
return d.indexOf(h) >= 0;
|
|
706
|
+
});
|
|
707
|
+
c.length === 0 && (c = f);
|
|
708
|
+
var v = c.reduce(function(h, m) {
|
|
709
|
+
return h[m] = tt(e, {
|
|
710
|
+
placement: m,
|
|
711
|
+
boundary: i,
|
|
712
|
+
rootBoundary: n,
|
|
713
|
+
padding: a
|
|
714
|
+
})[fe(m)], h;
|
|
715
|
+
}, {});
|
|
716
|
+
return Object.keys(v).sort(function(h, m) {
|
|
717
|
+
return v[h] - v[m];
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
function qi(e) {
|
|
721
|
+
if (fe(e) === to)
|
|
722
|
+
return [];
|
|
723
|
+
var o = bt(e);
|
|
724
|
+
return [zo(e), o, zo(o)];
|
|
725
|
+
}
|
|
726
|
+
function Ki(e) {
|
|
727
|
+
var o = e.state, t = e.options, r = e.name;
|
|
728
|
+
if (!o.modifiersData[r]._skip) {
|
|
729
|
+
for (var i = t.mainAxis, n = i === void 0 ? !0 : i, a = t.altAxis, s = a === void 0 ? !0 : a, l = t.fallbackPlacements, d = t.padding, p = t.boundary, f = t.rootBoundary, c = t.altBoundary, v = t.flipVariations, h = v === void 0 ? !0 : v, m = t.allowedAutoPlacements, g = o.options.placement, P = fe(g), C = P === g, y = l || (C || !h ? [bt(g)] : qi(g)), b = [g].concat(y).reduce(function(K, Q) {
|
|
730
|
+
return K.concat(fe(Q) === to ? Ui(o, {
|
|
731
|
+
placement: Q,
|
|
732
|
+
boundary: p,
|
|
733
|
+
rootBoundary: f,
|
|
734
|
+
padding: d,
|
|
735
|
+
flipVariations: h,
|
|
736
|
+
allowedAutoPlacements: m
|
|
737
|
+
}) : Q);
|
|
738
|
+
}, []), w = o.rects.reference, T = o.rects.popper, O = /* @__PURE__ */ new Map(), x = !0, E = b[0], A = 0; A < b.length; A++) {
|
|
739
|
+
var M = b[A], X = fe(M), N = $e(M) === ze, Z = [H, re].indexOf(X) >= 0, U = Z ? "width" : "height", B = tt(o, {
|
|
740
|
+
placement: M,
|
|
741
|
+
boundary: p,
|
|
742
|
+
rootBoundary: f,
|
|
743
|
+
altBoundary: c,
|
|
744
|
+
padding: d
|
|
745
|
+
}), W = Z ? N ? ie : F : N ? re : H;
|
|
746
|
+
w[U] > T[U] && (W = bt(W));
|
|
747
|
+
var $ = bt(W), q = [];
|
|
748
|
+
if (n && q.push(B[X] <= 0), s && q.push(B[W] <= 0, B[$] <= 0), q.every(function(K) {
|
|
749
|
+
return K;
|
|
750
|
+
})) {
|
|
751
|
+
E = M, x = !1;
|
|
752
|
+
break;
|
|
753
|
+
}
|
|
754
|
+
O.set(M, q);
|
|
755
|
+
}
|
|
756
|
+
if (x)
|
|
757
|
+
for (var be = h ? 3 : 1, se = function(Q) {
|
|
758
|
+
var le = b.find(function(ue) {
|
|
759
|
+
var k = O.get(ue);
|
|
760
|
+
if (k)
|
|
761
|
+
return k.slice(0, Q).every(function(L) {
|
|
762
|
+
return L;
|
|
763
|
+
});
|
|
764
|
+
});
|
|
765
|
+
if (le)
|
|
766
|
+
return E = le, "break";
|
|
767
|
+
}, ve = be; ve > 0; ve--) {
|
|
768
|
+
var ne = se(ve);
|
|
769
|
+
if (ne === "break")
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
o.placement !== E && (o.modifiersData[r]._skip = !0, o.placement = E, o.reset = !0);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
const Qi = {
|
|
776
|
+
name: "flip",
|
|
777
|
+
enabled: !0,
|
|
778
|
+
phase: "main",
|
|
779
|
+
fn: Ki,
|
|
780
|
+
requiresIfExists: ["offset"],
|
|
781
|
+
data: {
|
|
782
|
+
_skip: !1
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
function Wo(e, o, t) {
|
|
786
|
+
return t === void 0 && (t = {
|
|
787
|
+
x: 0,
|
|
788
|
+
y: 0
|
|
789
|
+
}), {
|
|
790
|
+
top: e.top - o.height - t.y,
|
|
791
|
+
right: e.right - o.width + t.x,
|
|
792
|
+
bottom: e.bottom - o.height + t.y,
|
|
793
|
+
left: e.left - o.width - t.x
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
function $o(e) {
|
|
797
|
+
return [H, ie, re, F].some(function(o) {
|
|
798
|
+
return e[o] >= 0;
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
function Gi(e) {
|
|
802
|
+
var o = e.state, t = e.name, r = o.rects.reference, i = o.rects.popper, n = o.modifiersData.preventOverflow, a = tt(o, {
|
|
803
|
+
elementContext: "reference"
|
|
804
|
+
}), s = tt(o, {
|
|
805
|
+
altBoundary: !0
|
|
806
|
+
}), l = Wo(a, r), d = Wo(s, i, n), p = $o(l), f = $o(d);
|
|
807
|
+
o.modifiersData[t] = {
|
|
808
|
+
referenceClippingOffsets: l,
|
|
809
|
+
popperEscapeOffsets: d,
|
|
810
|
+
isReferenceHidden: p,
|
|
811
|
+
hasPopperEscaped: f
|
|
812
|
+
}, o.attributes.popper = Object.assign({}, o.attributes.popper, {
|
|
813
|
+
"data-popper-reference-hidden": p,
|
|
814
|
+
"data-popper-escaped": f
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
const Ji = {
|
|
818
|
+
name: "hide",
|
|
819
|
+
enabled: !0,
|
|
820
|
+
phase: "main",
|
|
821
|
+
requiresIfExists: ["preventOverflow"],
|
|
822
|
+
fn: Gi
|
|
823
|
+
};
|
|
824
|
+
function Ii(e, o, t) {
|
|
825
|
+
var r = fe(e), i = [F, H].indexOf(r) >= 0 ? -1 : 1, n = typeof t == "function" ? t(Object.assign({}, o, {
|
|
826
|
+
placement: e
|
|
827
|
+
})) : t, a = n[0], s = n[1];
|
|
828
|
+
return a = a || 0, s = (s || 0) * i, [F, ie].indexOf(r) >= 0 ? {
|
|
829
|
+
x: s,
|
|
830
|
+
y: a
|
|
831
|
+
} : {
|
|
832
|
+
x: a,
|
|
833
|
+
y: s
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
function en(e) {
|
|
837
|
+
var o = e.state, t = e.options, r = e.name, i = t.offset, n = i === void 0 ? [0, 0] : i, a = or.reduce(function(p, f) {
|
|
838
|
+
return p[f] = Ii(f, o.rects, n), p;
|
|
839
|
+
}, {}), s = a[o.placement], l = s.x, d = s.y;
|
|
840
|
+
o.modifiersData.popperOffsets != null && (o.modifiersData.popperOffsets.x += l, o.modifiersData.popperOffsets.y += d), o.modifiersData[r] = a;
|
|
841
|
+
}
|
|
842
|
+
const tn = {
|
|
843
|
+
name: "offset",
|
|
844
|
+
enabled: !0,
|
|
845
|
+
phase: "main",
|
|
846
|
+
requires: ["popperOffsets"],
|
|
847
|
+
fn: en
|
|
848
|
+
};
|
|
849
|
+
function on(e) {
|
|
850
|
+
var o = e.state, t = e.name;
|
|
851
|
+
o.modifiersData[t] = ur({
|
|
852
|
+
reference: o.rects.reference,
|
|
853
|
+
element: o.rects.popper,
|
|
854
|
+
strategy: "absolute",
|
|
855
|
+
placement: o.placement
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
const rn = {
|
|
859
|
+
name: "popperOffsets",
|
|
860
|
+
enabled: !0,
|
|
861
|
+
phase: "read",
|
|
862
|
+
fn: on,
|
|
863
|
+
data: {}
|
|
864
|
+
};
|
|
865
|
+
function nn(e) {
|
|
866
|
+
return e === "x" ? "y" : "x";
|
|
867
|
+
}
|
|
868
|
+
function an(e) {
|
|
869
|
+
var o = e.state, t = e.options, r = e.name, i = t.mainAxis, n = i === void 0 ? !0 : i, a = t.altAxis, s = a === void 0 ? !1 : a, l = t.boundary, d = t.rootBoundary, p = t.altBoundary, f = t.padding, c = t.tether, v = c === void 0 ? !0 : c, h = t.tetherOffset, m = h === void 0 ? 0 : h, g = tt(o, {
|
|
870
|
+
boundary: l,
|
|
871
|
+
rootBoundary: d,
|
|
872
|
+
padding: f,
|
|
873
|
+
altBoundary: p
|
|
874
|
+
}), P = fe(o.placement), C = $e(o.placement), y = !C, b = io(P), w = nn(b), T = o.modifiersData.popperOffsets, O = o.rects.reference, x = o.rects.popper, E = typeof m == "function" ? m(Object.assign({}, o.rects, {
|
|
875
|
+
placement: o.placement
|
|
876
|
+
})) : m, A = typeof E == "number" ? {
|
|
877
|
+
mainAxis: E,
|
|
878
|
+
altAxis: E
|
|
879
|
+
} : Object.assign({
|
|
880
|
+
mainAxis: 0,
|
|
881
|
+
altAxis: 0
|
|
882
|
+
}, E), M = o.modifiersData.offset ? o.modifiersData.offset[o.placement] : null, X = {
|
|
883
|
+
x: 0,
|
|
884
|
+
y: 0
|
|
885
|
+
};
|
|
886
|
+
if (T) {
|
|
887
|
+
if (n) {
|
|
888
|
+
var N, Z = b === "y" ? H : F, U = b === "y" ? re : ie, B = b === "y" ? "height" : "width", W = T[b], $ = W + g[Z], q = W - g[U], be = v ? -x[B] / 2 : 0, se = C === ze ? O[B] : x[B], ve = C === ze ? -x[B] : -O[B], ne = o.elements.arrow, K = v && ne ? ro(ne) : {
|
|
889
|
+
width: 0,
|
|
890
|
+
height: 0
|
|
891
|
+
}, Q = o.modifiersData["arrow#persistent"] ? o.modifiersData["arrow#persistent"].padding : nr(), le = Q[Z], ue = Q[U], k = Ge(0, O[B], K[B]), L = y ? O[B] / 2 - be - k - le - A.mainAxis : se - k - le - A.mainAxis, me = y ? -O[B] / 2 + be + k + ue + A.mainAxis : ve + k + ue + A.mainAxis, j = o.elements.arrow && rt(o.elements.arrow), Le = j ? b === "y" ? j.clientTop || 0 : j.clientLeft || 0 : 0, Me = (N = M == null ? void 0 : M[b]) != null ? N : 0, nt = W + L - Me - Le, I = W + me - Me, Ye = Ge(v ? Ct($, nt) : $, W, v ? Ae(q, I) : q);
|
|
892
|
+
T[b] = Ye, X[b] = Ye - W;
|
|
893
|
+
}
|
|
894
|
+
if (s) {
|
|
895
|
+
var at, V = b === "x" ? H : F, st = b === "x" ? re : ie, ae = T[w], _e = w === "y" ? "height" : "width", Oe = ae + g[V], Ne = ae - g[st], ye = [H, F].indexOf(P) !== -1, Ee = (at = M == null ? void 0 : M[w]) != null ? at : 0, pe = ye ? Oe : ae - O[_e] - x[_e] - Ee + A.altAxis, Ve = ye ? ae + O[_e] + x[_e] - Ee - A.altAxis : Ne, lt = v && ye ? Di(pe, ae, Ve) : Ge(v ? pe : Oe, ae, v ? Ve : Ne);
|
|
896
|
+
T[w] = lt, X[w] = lt - ae;
|
|
897
|
+
}
|
|
898
|
+
o.modifiersData[r] = X;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
const sn = {
|
|
902
|
+
name: "preventOverflow",
|
|
903
|
+
enabled: !0,
|
|
904
|
+
phase: "main",
|
|
905
|
+
fn: an,
|
|
906
|
+
requiresIfExists: ["offset"]
|
|
907
|
+
};
|
|
908
|
+
function ln(e) {
|
|
909
|
+
return {
|
|
910
|
+
scrollLeft: e.scrollLeft,
|
|
911
|
+
scrollTop: e.scrollTop
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
function un(e) {
|
|
915
|
+
return e === J(e) || !oe(e) ? no(e) : ln(e);
|
|
916
|
+
}
|
|
917
|
+
function pn(e) {
|
|
918
|
+
var o = e.getBoundingClientRect(), t = Xe(o.width) / e.offsetWidth || 1, r = Xe(o.height) / e.offsetHeight || 1;
|
|
919
|
+
return t !== 1 || r !== 1;
|
|
920
|
+
}
|
|
921
|
+
function dn(e, o, t) {
|
|
922
|
+
t === void 0 && (t = !1);
|
|
923
|
+
var r = oe(o), i = oe(o) && pn(o), n = Ce(o), a = We(e, i, t), s = {
|
|
924
|
+
scrollLeft: 0,
|
|
925
|
+
scrollTop: 0
|
|
926
|
+
}, l = {
|
|
927
|
+
x: 0,
|
|
928
|
+
y: 0
|
|
929
|
+
};
|
|
930
|
+
return (r || !r && !t) && ((ce(o) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
931
|
+
so(n)) && (s = un(o)), oe(o) ? (l = We(o, !0), l.x += o.clientLeft, l.y += o.clientTop) : n && (l.x = ao(n))), {
|
|
932
|
+
x: a.left + s.scrollLeft - l.x,
|
|
933
|
+
y: a.top + s.scrollTop - l.y,
|
|
934
|
+
width: a.width,
|
|
935
|
+
height: a.height
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
function fn(e) {
|
|
939
|
+
var o = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), r = [];
|
|
940
|
+
e.forEach(function(n) {
|
|
941
|
+
o.set(n.name, n);
|
|
942
|
+
});
|
|
943
|
+
function i(n) {
|
|
944
|
+
t.add(n.name);
|
|
945
|
+
var a = [].concat(n.requires || [], n.requiresIfExists || []);
|
|
946
|
+
a.forEach(function(s) {
|
|
947
|
+
if (!t.has(s)) {
|
|
948
|
+
var l = o.get(s);
|
|
949
|
+
l && i(l);
|
|
950
|
+
}
|
|
951
|
+
}), r.push(n);
|
|
952
|
+
}
|
|
953
|
+
return e.forEach(function(n) {
|
|
954
|
+
t.has(n.name) || i(n);
|
|
955
|
+
}), r;
|
|
956
|
+
}
|
|
957
|
+
function cn(e) {
|
|
958
|
+
var o = fn(e);
|
|
959
|
+
return Ci.reduce(function(t, r) {
|
|
960
|
+
return t.concat(o.filter(function(i) {
|
|
961
|
+
return i.phase === r;
|
|
962
|
+
}));
|
|
963
|
+
}, []);
|
|
964
|
+
}
|
|
965
|
+
function vn(e) {
|
|
966
|
+
var o;
|
|
967
|
+
return function() {
|
|
968
|
+
return o || (o = new Promise(function(t) {
|
|
969
|
+
Promise.resolve().then(function() {
|
|
970
|
+
o = void 0, t(e());
|
|
971
|
+
});
|
|
972
|
+
})), o;
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
function mn(e) {
|
|
976
|
+
var o = e.reduce(function(t, r) {
|
|
977
|
+
var i = t[r.name];
|
|
978
|
+
return t[r.name] = i ? Object.assign({}, i, r, {
|
|
979
|
+
options: Object.assign({}, i.options, r.options),
|
|
980
|
+
data: Object.assign({}, i.data, r.data)
|
|
981
|
+
}) : r, t;
|
|
982
|
+
}, {});
|
|
983
|
+
return Object.keys(o).map(function(t) {
|
|
984
|
+
return o[t];
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
var ko = {
|
|
988
|
+
placement: "bottom",
|
|
989
|
+
modifiers: [],
|
|
990
|
+
strategy: "absolute"
|
|
991
|
+
};
|
|
992
|
+
function jo() {
|
|
993
|
+
for (var e = arguments.length, o = new Array(e), t = 0; t < e; t++)
|
|
994
|
+
o[t] = arguments[t];
|
|
995
|
+
return !o.some(function(r) {
|
|
996
|
+
return !(r && typeof r.getBoundingClientRect == "function");
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
function hn(e) {
|
|
1000
|
+
e === void 0 && (e = {});
|
|
1001
|
+
var o = e, t = o.defaultModifiers, r = t === void 0 ? [] : t, i = o.defaultOptions, n = i === void 0 ? ko : i;
|
|
1002
|
+
return function(s, l, d) {
|
|
1003
|
+
d === void 0 && (d = n);
|
|
1004
|
+
var p = {
|
|
1005
|
+
placement: "bottom",
|
|
1006
|
+
orderedModifiers: [],
|
|
1007
|
+
options: Object.assign({}, ko, n),
|
|
1008
|
+
modifiersData: {},
|
|
1009
|
+
elements: {
|
|
1010
|
+
reference: s,
|
|
1011
|
+
popper: l
|
|
1012
|
+
},
|
|
1013
|
+
attributes: {},
|
|
1014
|
+
styles: {}
|
|
1015
|
+
}, f = [], c = !1, v = {
|
|
1016
|
+
state: p,
|
|
1017
|
+
setOptions: function(P) {
|
|
1018
|
+
var C = typeof P == "function" ? P(p.options) : P;
|
|
1019
|
+
m(), p.options = Object.assign({}, n, p.options, C), p.scrollParents = {
|
|
1020
|
+
reference: De(s) ? Je(s) : s.contextElement ? Je(s.contextElement) : [],
|
|
1021
|
+
popper: Je(l)
|
|
1022
|
+
};
|
|
1023
|
+
var y = cn(mn([].concat(r, p.options.modifiers)));
|
|
1024
|
+
return p.orderedModifiers = y.filter(function(b) {
|
|
1025
|
+
return b.enabled;
|
|
1026
|
+
}), h(), v.update();
|
|
1027
|
+
},
|
|
1028
|
+
// Sync update – it will always be executed, even if not necessary. This
|
|
1029
|
+
// is useful for low frequency updates where sync behavior simplifies the
|
|
1030
|
+
// logic.
|
|
1031
|
+
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
1032
|
+
// prefer the async Popper#update method
|
|
1033
|
+
forceUpdate: function() {
|
|
1034
|
+
if (!c) {
|
|
1035
|
+
var P = p.elements, C = P.reference, y = P.popper;
|
|
1036
|
+
if (jo(C, y)) {
|
|
1037
|
+
p.rects = {
|
|
1038
|
+
reference: dn(C, rt(y), p.options.strategy === "fixed"),
|
|
1039
|
+
popper: ro(y)
|
|
1040
|
+
}, p.reset = !1, p.placement = p.options.placement, p.orderedModifiers.forEach(function(A) {
|
|
1041
|
+
return p.modifiersData[A.name] = Object.assign({}, A.data);
|
|
1042
|
+
});
|
|
1043
|
+
for (var b = 0; b < p.orderedModifiers.length; b++) {
|
|
1044
|
+
if (p.reset === !0) {
|
|
1045
|
+
p.reset = !1, b = -1;
|
|
1046
|
+
continue;
|
|
1047
|
+
}
|
|
1048
|
+
var w = p.orderedModifiers[b], T = w.fn, O = w.options, x = O === void 0 ? {} : O, E = w.name;
|
|
1049
|
+
typeof T == "function" && (p = T({
|
|
1050
|
+
state: p,
|
|
1051
|
+
options: x,
|
|
1052
|
+
name: E,
|
|
1053
|
+
instance: v
|
|
1054
|
+
}) || p);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
// Async and optimistically optimized update – it will not be executed if
|
|
1060
|
+
// not necessary (debounced to run at most once-per-tick)
|
|
1061
|
+
update: vn(function() {
|
|
1062
|
+
return new Promise(function(g) {
|
|
1063
|
+
v.forceUpdate(), g(p);
|
|
1064
|
+
});
|
|
1065
|
+
}),
|
|
1066
|
+
destroy: function() {
|
|
1067
|
+
m(), c = !0;
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
if (!jo(s, l))
|
|
1071
|
+
return v;
|
|
1072
|
+
v.setOptions(d).then(function(g) {
|
|
1073
|
+
!c && d.onFirstUpdate && d.onFirstUpdate(g);
|
|
1074
|
+
});
|
|
1075
|
+
function h() {
|
|
1076
|
+
p.orderedModifiers.forEach(function(g) {
|
|
1077
|
+
var P = g.name, C = g.options, y = C === void 0 ? {} : C, b = g.effect;
|
|
1078
|
+
if (typeof b == "function") {
|
|
1079
|
+
var w = b({
|
|
1080
|
+
state: p,
|
|
1081
|
+
name: P,
|
|
1082
|
+
instance: v,
|
|
1083
|
+
options: y
|
|
1084
|
+
}), T = function() {
|
|
1085
|
+
};
|
|
1086
|
+
f.push(w || T);
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
function m() {
|
|
1091
|
+
f.forEach(function(g) {
|
|
1092
|
+
return g();
|
|
1093
|
+
}), f = [];
|
|
1094
|
+
}
|
|
1095
|
+
return v;
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
var gn = [$i, rn, Xi, Ei, tn, Qi, sn, _i, Ji], bn = /* @__PURE__ */ hn({
|
|
1099
|
+
defaultModifiers: gn
|
|
1100
|
+
});
|
|
1101
|
+
function yn(e) {
|
|
1102
|
+
return It("MuiPopper", e);
|
|
1103
|
+
}
|
|
1104
|
+
eo("MuiPopper", ["root"]);
|
|
1105
|
+
const wn = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"], Pn = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
|
|
1106
|
+
function Tn(e, o) {
|
|
1107
|
+
if (o === "ltr")
|
|
1108
|
+
return e;
|
|
1109
|
+
switch (e) {
|
|
1110
|
+
case "bottom-end":
|
|
1111
|
+
return "bottom-start";
|
|
1112
|
+
case "bottom-start":
|
|
1113
|
+
return "bottom-end";
|
|
1114
|
+
case "top-end":
|
|
1115
|
+
return "top-start";
|
|
1116
|
+
case "top-start":
|
|
1117
|
+
return "top-end";
|
|
1118
|
+
default:
|
|
1119
|
+
return e;
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
function St(e) {
|
|
1123
|
+
return typeof e == "function" ? e() : e;
|
|
1124
|
+
}
|
|
1125
|
+
function _t(e) {
|
|
1126
|
+
return e.nodeType !== void 0;
|
|
1127
|
+
}
|
|
1128
|
+
function Cn(e) {
|
|
1129
|
+
return !_t(e);
|
|
1130
|
+
}
|
|
1131
|
+
const Sn = () => Mt({
|
|
1132
|
+
root: ["root"]
|
|
1133
|
+
}, di(yn)), On = {}, En = /* @__PURE__ */ D.forwardRef(function(o, t) {
|
|
1134
|
+
var r;
|
|
1135
|
+
const {
|
|
1136
|
+
anchorEl: i,
|
|
1137
|
+
children: n,
|
|
1138
|
+
direction: a,
|
|
1139
|
+
disablePortal: s,
|
|
1140
|
+
modifiers: l,
|
|
1141
|
+
open: d,
|
|
1142
|
+
placement: p,
|
|
1143
|
+
popperOptions: f,
|
|
1144
|
+
popperRef: c,
|
|
1145
|
+
slotProps: v = {},
|
|
1146
|
+
slots: h = {},
|
|
1147
|
+
TransitionProps: m
|
|
1148
|
+
// @ts-ignore internal logic
|
|
1149
|
+
// prevent from spreading to DOM, it can come from the parent component e.g. Select.
|
|
1150
|
+
} = o, g = je(o, wn), P = D.useRef(null), C = Zt(P, t), y = D.useRef(null), b = Zt(y, c), w = D.useRef(b);
|
|
1151
|
+
Yo(() => {
|
|
1152
|
+
w.current = b;
|
|
1153
|
+
}, [b]), D.useImperativeHandle(c, () => y.current, []);
|
|
1154
|
+
const T = Tn(p, a), [O, x] = D.useState(T), [E, A] = D.useState(St(i));
|
|
1155
|
+
D.useEffect(() => {
|
|
1156
|
+
y.current && y.current.forceUpdate();
|
|
1157
|
+
}), D.useEffect(() => {
|
|
1158
|
+
i && A(St(i));
|
|
1159
|
+
}, [i]), Yo(() => {
|
|
1160
|
+
if (!E || !d)
|
|
1161
|
+
return;
|
|
1162
|
+
const U = ($) => {
|
|
1163
|
+
x($.placement);
|
|
1164
|
+
};
|
|
1165
|
+
if (process.env.NODE_ENV !== "production" && E && _t(E) && E.nodeType === 1) {
|
|
1166
|
+
const $ = E.getBoundingClientRect();
|
|
1167
|
+
process.env.NODE_ENV !== "test" && $.top === 0 && $.left === 0 && $.right === 0 && $.bottom === 0 && console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
|
|
1168
|
+
`));
|
|
1169
|
+
}
|
|
1170
|
+
let B = [{
|
|
1171
|
+
name: "preventOverflow",
|
|
1172
|
+
options: {
|
|
1173
|
+
altBoundary: s
|
|
1174
|
+
}
|
|
1175
|
+
}, {
|
|
1176
|
+
name: "flip",
|
|
1177
|
+
options: {
|
|
1178
|
+
altBoundary: s
|
|
1179
|
+
}
|
|
1180
|
+
}, {
|
|
1181
|
+
name: "onUpdate",
|
|
1182
|
+
enabled: !0,
|
|
1183
|
+
phase: "afterWrite",
|
|
1184
|
+
fn: ({
|
|
1185
|
+
state: $
|
|
1186
|
+
}) => {
|
|
1187
|
+
U($);
|
|
1188
|
+
}
|
|
1189
|
+
}];
|
|
1190
|
+
l != null && (B = B.concat(l)), f && f.modifiers != null && (B = B.concat(f.modifiers));
|
|
1191
|
+
const W = bn(E, P.current, S({
|
|
1192
|
+
placement: T
|
|
1193
|
+
}, f, {
|
|
1194
|
+
modifiers: B
|
|
1195
|
+
}));
|
|
1196
|
+
return w.current(W), () => {
|
|
1197
|
+
W.destroy(), w.current(null);
|
|
1198
|
+
};
|
|
1199
|
+
}, [E, s, l, d, f, T]);
|
|
1200
|
+
const M = {
|
|
1201
|
+
placement: O
|
|
1202
|
+
};
|
|
1203
|
+
m !== null && (M.TransitionProps = m);
|
|
1204
|
+
const X = Sn(), N = (r = h.root) != null ? r : "div", Z = Fr({
|
|
1205
|
+
elementType: N,
|
|
1206
|
+
externalSlotProps: v.root,
|
|
1207
|
+
externalForwardedProps: g,
|
|
1208
|
+
additionalProps: {
|
|
1209
|
+
role: "tooltip",
|
|
1210
|
+
ref: C
|
|
1211
|
+
},
|
|
1212
|
+
ownerState: o,
|
|
1213
|
+
className: X.root
|
|
1214
|
+
});
|
|
1215
|
+
return /* @__PURE__ */ _(N, S({}, Z, {
|
|
1216
|
+
children: typeof n == "function" ? n(M) : n
|
|
1217
|
+
}));
|
|
1218
|
+
}), pr = /* @__PURE__ */ D.forwardRef(function(o, t) {
|
|
1219
|
+
const {
|
|
1220
|
+
anchorEl: r,
|
|
1221
|
+
children: i,
|
|
1222
|
+
container: n,
|
|
1223
|
+
direction: a = "ltr",
|
|
1224
|
+
disablePortal: s = !1,
|
|
1225
|
+
keepMounted: l = !1,
|
|
1226
|
+
modifiers: d,
|
|
1227
|
+
open: p,
|
|
1228
|
+
placement: f = "bottom",
|
|
1229
|
+
popperOptions: c = On,
|
|
1230
|
+
popperRef: v,
|
|
1231
|
+
style: h,
|
|
1232
|
+
transition: m = !1,
|
|
1233
|
+
slotProps: g = {},
|
|
1234
|
+
slots: P = {}
|
|
1235
|
+
} = o, C = je(o, Pn), [y, b] = D.useState(!0), w = () => {
|
|
1236
|
+
b(!1);
|
|
1237
|
+
}, T = () => {
|
|
1238
|
+
b(!0);
|
|
1239
|
+
};
|
|
1240
|
+
if (!l && !p && (!m || y))
|
|
1241
|
+
return null;
|
|
1242
|
+
let O;
|
|
1243
|
+
if (n)
|
|
1244
|
+
O = n;
|
|
1245
|
+
else if (r) {
|
|
1246
|
+
const A = St(r);
|
|
1247
|
+
O = A && _t(A) ? xo(A).body : xo(null).body;
|
|
1248
|
+
}
|
|
1249
|
+
const x = !p && l && (!m || y) ? "none" : void 0, E = m ? {
|
|
1250
|
+
in: p,
|
|
1251
|
+
onEnter: w,
|
|
1252
|
+
onExited: T
|
|
1253
|
+
} : void 0;
|
|
1254
|
+
return /* @__PURE__ */ _(Hr, {
|
|
1255
|
+
disablePortal: s,
|
|
1256
|
+
container: O,
|
|
1257
|
+
children: /* @__PURE__ */ _(En, S({
|
|
1258
|
+
anchorEl: r,
|
|
1259
|
+
direction: a,
|
|
1260
|
+
disablePortal: s,
|
|
1261
|
+
modifiers: d,
|
|
1262
|
+
ref: t,
|
|
1263
|
+
open: m ? !y : p,
|
|
1264
|
+
placement: f,
|
|
1265
|
+
popperOptions: c,
|
|
1266
|
+
popperRef: v,
|
|
1267
|
+
slotProps: g,
|
|
1268
|
+
slots: P
|
|
1269
|
+
}, C, {
|
|
1270
|
+
style: S({
|
|
1271
|
+
// Prevents scroll issue, waiting for Popper.js to add this style once initiated.
|
|
1272
|
+
position: "fixed",
|
|
1273
|
+
// Fix Popper.js display issue
|
|
1274
|
+
top: 0,
|
|
1275
|
+
left: 0,
|
|
1276
|
+
display: x
|
|
1277
|
+
}, h),
|
|
1278
|
+
TransitionProps: E,
|
|
1279
|
+
children: i
|
|
1280
|
+
}))
|
|
1281
|
+
});
|
|
1282
|
+
});
|
|
1283
|
+
process.env.NODE_ENV !== "production" && (pr.propTypes = {
|
|
1284
|
+
// ----------------------------- Warning --------------------------------
|
|
1285
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1286
|
+
// | To update them edit TypeScript types and run "yarn proptypes" |
|
|
1287
|
+
// ----------------------------------------------------------------------
|
|
1288
|
+
/**
|
|
1289
|
+
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
|
|
1290
|
+
* or a function that returns either.
|
|
1291
|
+
* It's used to set the position of the popper.
|
|
1292
|
+
* The return value will passed as the reference object of the Popper instance.
|
|
1293
|
+
*/
|
|
1294
|
+
anchorEl: Jo(u.oneOfType([Pt, u.object, u.func]), (e) => {
|
|
1295
|
+
if (e.open) {
|
|
1296
|
+
const o = St(e.anchorEl);
|
|
1297
|
+
if (o && _t(o) && o.nodeType === 1) {
|
|
1298
|
+
const t = o.getBoundingClientRect();
|
|
1299
|
+
if (process.env.NODE_ENV !== "test" && t.top === 0 && t.left === 0 && t.right === 0 && t.bottom === 0)
|
|
1300
|
+
return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
|
|
1301
|
+
`));
|
|
1302
|
+
} else if (!o || typeof o.getBoundingClientRect != "function" || Cn(o) && o.contextElement != null && o.contextElement.nodeType !== 1)
|
|
1303
|
+
return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "It should be an HTML element instance or a virtualElement ", "(https://popper.js.org/docs/v2/virtual-elements/)."].join(`
|
|
1304
|
+
`));
|
|
1305
|
+
}
|
|
1306
|
+
return null;
|
|
1307
|
+
}),
|
|
1308
|
+
/**
|
|
1309
|
+
* Popper render function or node.
|
|
1310
|
+
*/
|
|
1311
|
+
children: u.oneOfType([u.node, u.func]),
|
|
1312
|
+
/**
|
|
1313
|
+
* An HTML element or function that returns one.
|
|
1314
|
+
* The `container` will have the portal children appended to it.
|
|
1315
|
+
*
|
|
1316
|
+
* By default, it uses the body of the top-level document object,
|
|
1317
|
+
* so it's simply `document.body` most of the time.
|
|
1318
|
+
*/
|
|
1319
|
+
container: u.oneOfType([Pt, u.func]),
|
|
1320
|
+
/**
|
|
1321
|
+
* Direction of the text.
|
|
1322
|
+
* @default 'ltr'
|
|
1323
|
+
*/
|
|
1324
|
+
direction: u.oneOf(["ltr", "rtl"]),
|
|
1325
|
+
/**
|
|
1326
|
+
* The `children` will be under the DOM hierarchy of the parent component.
|
|
1327
|
+
* @default false
|
|
1328
|
+
*/
|
|
1329
|
+
disablePortal: u.bool,
|
|
1330
|
+
/**
|
|
1331
|
+
* Always keep the children in the DOM.
|
|
1332
|
+
* This prop can be useful in SEO situation or
|
|
1333
|
+
* when you want to maximize the responsiveness of the Popper.
|
|
1334
|
+
* @default false
|
|
1335
|
+
*/
|
|
1336
|
+
keepMounted: u.bool,
|
|
1337
|
+
/**
|
|
1338
|
+
* Popper.js is based on a "plugin-like" architecture,
|
|
1339
|
+
* most of its features are fully encapsulated "modifiers".
|
|
1340
|
+
*
|
|
1341
|
+
* A modifier is a function that is called each time Popper.js needs to
|
|
1342
|
+
* compute the position of the popper.
|
|
1343
|
+
* For this reason, modifiers should be very performant to avoid bottlenecks.
|
|
1344
|
+
* To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
|
|
1345
|
+
*/
|
|
1346
|
+
modifiers: u.arrayOf(u.shape({
|
|
1347
|
+
data: u.object,
|
|
1348
|
+
effect: u.func,
|
|
1349
|
+
enabled: u.bool,
|
|
1350
|
+
fn: u.func,
|
|
1351
|
+
name: u.any,
|
|
1352
|
+
options: u.object,
|
|
1353
|
+
phase: u.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
|
|
1354
|
+
requires: u.arrayOf(u.string),
|
|
1355
|
+
requiresIfExists: u.arrayOf(u.string)
|
|
1356
|
+
})),
|
|
1357
|
+
/**
|
|
1358
|
+
* If `true`, the component is shown.
|
|
1359
|
+
*/
|
|
1360
|
+
open: u.bool.isRequired,
|
|
1361
|
+
/**
|
|
1362
|
+
* Popper placement.
|
|
1363
|
+
* @default 'bottom'
|
|
1364
|
+
*/
|
|
1365
|
+
placement: u.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
|
|
1366
|
+
/**
|
|
1367
|
+
* Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
|
|
1368
|
+
* @default {}
|
|
1369
|
+
*/
|
|
1370
|
+
popperOptions: u.shape({
|
|
1371
|
+
modifiers: u.array,
|
|
1372
|
+
onFirstUpdate: u.func,
|
|
1373
|
+
placement: u.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
|
|
1374
|
+
strategy: u.oneOf(["absolute", "fixed"])
|
|
1375
|
+
}),
|
|
1376
|
+
/**
|
|
1377
|
+
* A ref that points to the used popper instance.
|
|
1378
|
+
*/
|
|
1379
|
+
popperRef: Io,
|
|
1380
|
+
/**
|
|
1381
|
+
* The props used for each slot inside the Popper.
|
|
1382
|
+
* @default {}
|
|
1383
|
+
*/
|
|
1384
|
+
slotProps: u.shape({
|
|
1385
|
+
root: u.oneOfType([u.func, u.object])
|
|
1386
|
+
}),
|
|
1387
|
+
/**
|
|
1388
|
+
* The components used for each slot inside the Popper.
|
|
1389
|
+
* Either a string to use a HTML element or a component.
|
|
1390
|
+
* @default {}
|
|
1391
|
+
*/
|
|
1392
|
+
slots: u.shape({
|
|
1393
|
+
root: u.elementType
|
|
1394
|
+
}),
|
|
1395
|
+
/**
|
|
1396
|
+
* Help supporting a react-transition-group/Transition component.
|
|
1397
|
+
* @default false
|
|
1398
|
+
*/
|
|
1399
|
+
transition: u.bool
|
|
1400
|
+
});
|
|
1401
|
+
const An = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"], Rn = xe(pr, {
|
|
1402
|
+
name: "MuiPopper",
|
|
1403
|
+
slot: "Root",
|
|
1404
|
+
overridesResolver: (e, o) => o.root
|
|
1405
|
+
})({}), dr = /* @__PURE__ */ D.forwardRef(function(o, t) {
|
|
1406
|
+
var r;
|
|
1407
|
+
const i = Gr(), n = xt({
|
|
1408
|
+
props: o,
|
|
1409
|
+
name: "MuiPopper"
|
|
1410
|
+
}), {
|
|
1411
|
+
anchorEl: a,
|
|
1412
|
+
component: s,
|
|
1413
|
+
components: l,
|
|
1414
|
+
componentsProps: d,
|
|
1415
|
+
container: p,
|
|
1416
|
+
disablePortal: f,
|
|
1417
|
+
keepMounted: c,
|
|
1418
|
+
modifiers: v,
|
|
1419
|
+
open: h,
|
|
1420
|
+
placement: m,
|
|
1421
|
+
popperOptions: g,
|
|
1422
|
+
popperRef: P,
|
|
1423
|
+
transition: C,
|
|
1424
|
+
slots: y,
|
|
1425
|
+
slotProps: b
|
|
1426
|
+
} = n, w = je(n, An), T = (r = y == null ? void 0 : y.root) != null ? r : l == null ? void 0 : l.Root, O = S({
|
|
1427
|
+
anchorEl: a,
|
|
1428
|
+
container: p,
|
|
1429
|
+
disablePortal: f,
|
|
1430
|
+
keepMounted: c,
|
|
1431
|
+
modifiers: v,
|
|
1432
|
+
open: h,
|
|
1433
|
+
placement: m,
|
|
1434
|
+
popperOptions: g,
|
|
1435
|
+
popperRef: P,
|
|
1436
|
+
transition: C
|
|
1437
|
+
}, w);
|
|
1438
|
+
return /* @__PURE__ */ _(Rn, S({
|
|
1439
|
+
as: s,
|
|
1440
|
+
direction: i == null ? void 0 : i.direction,
|
|
1441
|
+
slots: {
|
|
1442
|
+
root: T
|
|
1443
|
+
},
|
|
1444
|
+
slotProps: b ?? d
|
|
1445
|
+
}, O, {
|
|
1446
|
+
ref: t
|
|
1447
|
+
}));
|
|
1448
|
+
});
|
|
1449
|
+
process.env.NODE_ENV !== "production" && (dr.propTypes = {
|
|
1450
|
+
// ----------------------------- Warning --------------------------------
|
|
1451
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1452
|
+
// | To update them edit TypeScript types and run "yarn proptypes" |
|
|
1453
|
+
// ----------------------------------------------------------------------
|
|
1454
|
+
/**
|
|
1455
|
+
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
|
|
1456
|
+
* or a function that returns either.
|
|
1457
|
+
* It's used to set the position of the popper.
|
|
1458
|
+
* The return value will passed as the reference object of the Popper instance.
|
|
1459
|
+
*/
|
|
1460
|
+
anchorEl: u.oneOfType([Pt, u.object, u.func]),
|
|
1461
|
+
/**
|
|
1462
|
+
* Popper render function or node.
|
|
1463
|
+
*/
|
|
1464
|
+
children: u.oneOfType([u.node, u.func]),
|
|
1465
|
+
/**
|
|
1466
|
+
* The component used for the root node.
|
|
1467
|
+
* Either a string to use a HTML element or a component.
|
|
1468
|
+
*/
|
|
1469
|
+
component: u.elementType,
|
|
1470
|
+
/**
|
|
1471
|
+
* The components used for each slot inside the Popper.
|
|
1472
|
+
* Either a string to use a HTML element or a component.
|
|
1473
|
+
* @default {}
|
|
1474
|
+
*/
|
|
1475
|
+
components: u.shape({
|
|
1476
|
+
Root: u.elementType
|
|
1477
|
+
}),
|
|
1478
|
+
/**
|
|
1479
|
+
* The props used for each slot inside the Popper.
|
|
1480
|
+
* @default {}
|
|
1481
|
+
*/
|
|
1482
|
+
componentsProps: u.shape({
|
|
1483
|
+
root: u.oneOfType([u.func, u.object])
|
|
1484
|
+
}),
|
|
1485
|
+
/**
|
|
1486
|
+
* An HTML element or function that returns one.
|
|
1487
|
+
* The `container` will have the portal children appended to it.
|
|
1488
|
+
*
|
|
1489
|
+
* By default, it uses the body of the top-level document object,
|
|
1490
|
+
* so it's simply `document.body` most of the time.
|
|
1491
|
+
*/
|
|
1492
|
+
container: u.oneOfType([Pt, u.func]),
|
|
1493
|
+
/**
|
|
1494
|
+
* The `children` will be under the DOM hierarchy of the parent component.
|
|
1495
|
+
* @default false
|
|
1496
|
+
*/
|
|
1497
|
+
disablePortal: u.bool,
|
|
1498
|
+
/**
|
|
1499
|
+
* Always keep the children in the DOM.
|
|
1500
|
+
* This prop can be useful in SEO situation or
|
|
1501
|
+
* when you want to maximize the responsiveness of the Popper.
|
|
1502
|
+
* @default false
|
|
1503
|
+
*/
|
|
1504
|
+
keepMounted: u.bool,
|
|
1505
|
+
/**
|
|
1506
|
+
* Popper.js is based on a "plugin-like" architecture,
|
|
1507
|
+
* most of its features are fully encapsulated "modifiers".
|
|
1508
|
+
*
|
|
1509
|
+
* A modifier is a function that is called each time Popper.js needs to
|
|
1510
|
+
* compute the position of the popper.
|
|
1511
|
+
* For this reason, modifiers should be very performant to avoid bottlenecks.
|
|
1512
|
+
* To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
|
|
1513
|
+
*/
|
|
1514
|
+
modifiers: u.arrayOf(u.shape({
|
|
1515
|
+
data: u.object,
|
|
1516
|
+
effect: u.func,
|
|
1517
|
+
enabled: u.bool,
|
|
1518
|
+
fn: u.func,
|
|
1519
|
+
name: u.any,
|
|
1520
|
+
options: u.object,
|
|
1521
|
+
phase: u.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
|
|
1522
|
+
requires: u.arrayOf(u.string),
|
|
1523
|
+
requiresIfExists: u.arrayOf(u.string)
|
|
1524
|
+
})),
|
|
1525
|
+
/**
|
|
1526
|
+
* If `true`, the component is shown.
|
|
1527
|
+
*/
|
|
1528
|
+
open: u.bool.isRequired,
|
|
1529
|
+
/**
|
|
1530
|
+
* Popper placement.
|
|
1531
|
+
* @default 'bottom'
|
|
1532
|
+
*/
|
|
1533
|
+
placement: u.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
|
|
1534
|
+
/**
|
|
1535
|
+
* Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
|
|
1536
|
+
* @default {}
|
|
1537
|
+
*/
|
|
1538
|
+
popperOptions: u.shape({
|
|
1539
|
+
modifiers: u.array,
|
|
1540
|
+
onFirstUpdate: u.func,
|
|
1541
|
+
placement: u.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
|
|
1542
|
+
strategy: u.oneOf(["absolute", "fixed"])
|
|
1543
|
+
}),
|
|
1544
|
+
/**
|
|
1545
|
+
* A ref that points to the used popper instance.
|
|
1546
|
+
*/
|
|
1547
|
+
popperRef: Io,
|
|
1548
|
+
/**
|
|
1549
|
+
* The props used for each slot inside the Popper.
|
|
1550
|
+
* @default {}
|
|
1551
|
+
*/
|
|
1552
|
+
slotProps: u.shape({
|
|
1553
|
+
root: u.oneOfType([u.func, u.object])
|
|
1554
|
+
}),
|
|
1555
|
+
/**
|
|
1556
|
+
* The components used for each slot inside the Popper.
|
|
1557
|
+
* Either a string to use a HTML element or a component.
|
|
1558
|
+
* @default {}
|
|
1559
|
+
*/
|
|
1560
|
+
slots: u.shape({
|
|
1561
|
+
root: u.elementType
|
|
1562
|
+
}),
|
|
1563
|
+
/**
|
|
1564
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1565
|
+
*/
|
|
1566
|
+
sx: u.oneOfType([u.arrayOf(u.oneOfType([u.func, u.object, u.bool])), u.func, u.object]),
|
|
1567
|
+
/**
|
|
1568
|
+
* Help supporting a react-transition-group/Transition component.
|
|
1569
|
+
* @default false
|
|
1570
|
+
*/
|
|
1571
|
+
transition: u.bool
|
|
1572
|
+
});
|
|
1573
|
+
const fr = dr, Dn = ["absolute", "children", "className", "component", "flexItem", "light", "orientation", "role", "textAlign", "variant"], xn = (e) => {
|
|
1574
|
+
const {
|
|
1575
|
+
absolute: o,
|
|
1576
|
+
children: t,
|
|
1577
|
+
classes: r,
|
|
1578
|
+
flexItem: i,
|
|
1579
|
+
light: n,
|
|
1580
|
+
orientation: a,
|
|
1581
|
+
textAlign: s,
|
|
1582
|
+
variant: l
|
|
1583
|
+
} = e;
|
|
1584
|
+
return Mt({
|
|
1585
|
+
root: ["root", o && "absolute", l, n && "light", a === "vertical" && "vertical", i && "flexItem", t && "withChildren", t && a === "vertical" && "withChildrenVertical", s === "right" && a !== "vertical" && "textAlignRight", s === "left" && a !== "vertical" && "textAlignLeft"],
|
|
1586
|
+
wrapper: ["wrapper", a === "vertical" && "wrapperVertical"]
|
|
1587
|
+
}, oi, r);
|
|
1588
|
+
}, Mn = xe("div", {
|
|
1589
|
+
name: "MuiDivider",
|
|
1590
|
+
slot: "Root",
|
|
1591
|
+
overridesResolver: (e, o) => {
|
|
1592
|
+
const {
|
|
1593
|
+
ownerState: t
|
|
1594
|
+
} = e;
|
|
1595
|
+
return [o.root, t.absolute && o.absolute, o[t.variant], t.light && o.light, t.orientation === "vertical" && o.vertical, t.flexItem && o.flexItem, t.children && o.withChildren, t.children && t.orientation === "vertical" && o.withChildrenVertical, t.textAlign === "right" && t.orientation !== "vertical" && o.textAlignRight, t.textAlign === "left" && t.orientation !== "vertical" && o.textAlignLeft];
|
|
1596
|
+
}
|
|
1597
|
+
})(({
|
|
1598
|
+
theme: e,
|
|
1599
|
+
ownerState: o
|
|
1600
|
+
}) => S({
|
|
1601
|
+
margin: 0,
|
|
1602
|
+
// Reset browser default style.
|
|
1603
|
+
flexShrink: 0,
|
|
1604
|
+
borderWidth: 0,
|
|
1605
|
+
borderStyle: "solid",
|
|
1606
|
+
borderColor: (e.vars || e).palette.divider,
|
|
1607
|
+
borderBottomWidth: "thin"
|
|
1608
|
+
}, o.absolute && {
|
|
1609
|
+
position: "absolute",
|
|
1610
|
+
bottom: 0,
|
|
1611
|
+
left: 0,
|
|
1612
|
+
width: "100%"
|
|
1613
|
+
}, o.light && {
|
|
1614
|
+
borderColor: e.vars ? `rgba(${e.vars.palette.dividerChannel} / 0.08)` : Ie(e.palette.divider, 0.08)
|
|
1615
|
+
}, o.variant === "inset" && {
|
|
1616
|
+
marginLeft: 72
|
|
1617
|
+
}, o.variant === "middle" && o.orientation === "horizontal" && {
|
|
1618
|
+
marginLeft: e.spacing(2),
|
|
1619
|
+
marginRight: e.spacing(2)
|
|
1620
|
+
}, o.variant === "middle" && o.orientation === "vertical" && {
|
|
1621
|
+
marginTop: e.spacing(1),
|
|
1622
|
+
marginBottom: e.spacing(1)
|
|
1623
|
+
}, o.orientation === "vertical" && {
|
|
1624
|
+
height: "100%",
|
|
1625
|
+
borderBottomWidth: 0,
|
|
1626
|
+
borderRightWidth: "thin"
|
|
1627
|
+
}, o.flexItem && {
|
|
1628
|
+
alignSelf: "stretch",
|
|
1629
|
+
height: "auto"
|
|
1630
|
+
}), ({
|
|
1631
|
+
ownerState: e
|
|
1632
|
+
}) => S({}, e.children && {
|
|
1633
|
+
display: "flex",
|
|
1634
|
+
whiteSpace: "nowrap",
|
|
1635
|
+
textAlign: "center",
|
|
1636
|
+
border: 0,
|
|
1637
|
+
"&::before, &::after": {
|
|
1638
|
+
content: '""',
|
|
1639
|
+
alignSelf: "center"
|
|
1640
|
+
}
|
|
1641
|
+
}), ({
|
|
1642
|
+
theme: e,
|
|
1643
|
+
ownerState: o
|
|
1644
|
+
}) => S({}, o.children && o.orientation !== "vertical" && {
|
|
1645
|
+
"&::before, &::after": {
|
|
1646
|
+
width: "100%",
|
|
1647
|
+
borderTop: `thin solid ${(e.vars || e).palette.divider}`
|
|
1648
|
+
}
|
|
1649
|
+
}), ({
|
|
1650
|
+
theme: e,
|
|
1651
|
+
ownerState: o
|
|
1652
|
+
}) => S({}, o.children && o.orientation === "vertical" && {
|
|
1653
|
+
flexDirection: "column",
|
|
1654
|
+
"&::before, &::after": {
|
|
1655
|
+
height: "100%",
|
|
1656
|
+
borderLeft: `thin solid ${(e.vars || e).palette.divider}`
|
|
1657
|
+
}
|
|
1658
|
+
}), ({
|
|
1659
|
+
ownerState: e
|
|
1660
|
+
}) => S({}, e.textAlign === "right" && e.orientation !== "vertical" && {
|
|
1661
|
+
"&::before": {
|
|
1662
|
+
width: "90%"
|
|
1663
|
+
},
|
|
1664
|
+
"&::after": {
|
|
1665
|
+
width: "10%"
|
|
1666
|
+
}
|
|
1667
|
+
}, e.textAlign === "left" && e.orientation !== "vertical" && {
|
|
1668
|
+
"&::before": {
|
|
1669
|
+
width: "10%"
|
|
1670
|
+
},
|
|
1671
|
+
"&::after": {
|
|
1672
|
+
width: "90%"
|
|
1673
|
+
}
|
|
1674
|
+
})), Yn = xe("span", {
|
|
1675
|
+
name: "MuiDivider",
|
|
1676
|
+
slot: "Wrapper",
|
|
1677
|
+
overridesResolver: (e, o) => {
|
|
1678
|
+
const {
|
|
1679
|
+
ownerState: t
|
|
1680
|
+
} = e;
|
|
1681
|
+
return [o.wrapper, t.orientation === "vertical" && o.wrapperVertical];
|
|
1682
|
+
}
|
|
1683
|
+
})(({
|
|
1684
|
+
theme: e,
|
|
1685
|
+
ownerState: o
|
|
1686
|
+
}) => S({
|
|
1687
|
+
display: "inline-block",
|
|
1688
|
+
paddingLeft: `calc(${e.spacing(1)} * 1.2)`,
|
|
1689
|
+
paddingRight: `calc(${e.spacing(1)} * 1.2)`
|
|
1690
|
+
}, o.orientation === "vertical" && {
|
|
1691
|
+
paddingTop: `calc(${e.spacing(1)} * 1.2)`,
|
|
1692
|
+
paddingBottom: `calc(${e.spacing(1)} * 1.2)`
|
|
1693
|
+
})), lo = /* @__PURE__ */ D.forwardRef(function(o, t) {
|
|
1694
|
+
const r = xt({
|
|
1695
|
+
props: o,
|
|
1696
|
+
name: "MuiDivider"
|
|
1697
|
+
}), {
|
|
1698
|
+
absolute: i = !1,
|
|
1699
|
+
children: n,
|
|
1700
|
+
className: a,
|
|
1701
|
+
component: s = n ? "div" : "hr",
|
|
1702
|
+
flexItem: l = !1,
|
|
1703
|
+
light: d = !1,
|
|
1704
|
+
orientation: p = "horizontal",
|
|
1705
|
+
role: f = s !== "hr" ? "separator" : void 0,
|
|
1706
|
+
textAlign: c = "center",
|
|
1707
|
+
variant: v = "fullWidth"
|
|
1708
|
+
} = r, h = je(r, Dn), m = S({}, r, {
|
|
1709
|
+
absolute: i,
|
|
1710
|
+
component: s,
|
|
1711
|
+
flexItem: l,
|
|
1712
|
+
light: d,
|
|
1713
|
+
orientation: p,
|
|
1714
|
+
role: f,
|
|
1715
|
+
textAlign: c,
|
|
1716
|
+
variant: v
|
|
1717
|
+
}), g = xn(m);
|
|
1718
|
+
return /* @__PURE__ */ _(Mn, S({
|
|
1719
|
+
as: s,
|
|
1720
|
+
className: Be(g.root, a),
|
|
1721
|
+
role: f,
|
|
1722
|
+
ref: t,
|
|
1723
|
+
ownerState: m
|
|
1724
|
+
}, h, {
|
|
1725
|
+
children: n ? /* @__PURE__ */ _(Yn, {
|
|
1726
|
+
className: g.wrapper,
|
|
1727
|
+
ownerState: m,
|
|
1728
|
+
children: n
|
|
1729
|
+
}) : null
|
|
1730
|
+
}));
|
|
1731
|
+
});
|
|
1732
|
+
lo.muiSkipListHighlight = !0;
|
|
1733
|
+
process.env.NODE_ENV !== "production" && (lo.propTypes = {
|
|
1734
|
+
// ----------------------------- Warning --------------------------------
|
|
1735
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1736
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
1737
|
+
// ----------------------------------------------------------------------
|
|
1738
|
+
/**
|
|
1739
|
+
* Absolutely position the element.
|
|
1740
|
+
* @default false
|
|
1741
|
+
*/
|
|
1742
|
+
absolute: u.bool,
|
|
1743
|
+
/**
|
|
1744
|
+
* The content of the component.
|
|
1745
|
+
*/
|
|
1746
|
+
children: u.node,
|
|
1747
|
+
/**
|
|
1748
|
+
* Override or extend the styles applied to the component.
|
|
1749
|
+
*/
|
|
1750
|
+
classes: u.object,
|
|
1751
|
+
/**
|
|
1752
|
+
* @ignore
|
|
1753
|
+
*/
|
|
1754
|
+
className: u.string,
|
|
1755
|
+
/**
|
|
1756
|
+
* The component used for the root node.
|
|
1757
|
+
* Either a string to use a HTML element or a component.
|
|
1758
|
+
*/
|
|
1759
|
+
component: u.elementType,
|
|
1760
|
+
/**
|
|
1761
|
+
* If `true`, a vertical divider will have the correct height when used in flex container.
|
|
1762
|
+
* (By default, a vertical divider will have a calculated height of `0px` if it is the child of a flex container.)
|
|
1763
|
+
* @default false
|
|
1764
|
+
*/
|
|
1765
|
+
flexItem: u.bool,
|
|
1766
|
+
/**
|
|
1767
|
+
* If `true`, the divider will have a lighter color.
|
|
1768
|
+
* @default false
|
|
1769
|
+
*/
|
|
1770
|
+
light: u.bool,
|
|
1771
|
+
/**
|
|
1772
|
+
* The component orientation.
|
|
1773
|
+
* @default 'horizontal'
|
|
1774
|
+
*/
|
|
1775
|
+
orientation: u.oneOf(["horizontal", "vertical"]),
|
|
1776
|
+
/**
|
|
1777
|
+
* @ignore
|
|
1778
|
+
*/
|
|
1779
|
+
role: u.string,
|
|
1780
|
+
/**
|
|
1781
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1782
|
+
*/
|
|
1783
|
+
sx: u.oneOfType([u.arrayOf(u.oneOfType([u.func, u.object, u.bool])), u.func, u.object]),
|
|
1784
|
+
/**
|
|
1785
|
+
* The text alignment.
|
|
1786
|
+
* @default 'center'
|
|
1787
|
+
*/
|
|
1788
|
+
textAlign: u.oneOf(["center", "left", "right"]),
|
|
1789
|
+
/**
|
|
1790
|
+
* The variant to use.
|
|
1791
|
+
* @default 'fullWidth'
|
|
1792
|
+
*/
|
|
1793
|
+
variant: u.oneOfType([u.oneOf(["fullWidth", "inset", "middle"]), u.string])
|
|
1794
|
+
});
|
|
1795
|
+
const Lo = lo;
|
|
1796
|
+
function _n(e) {
|
|
1797
|
+
return It("MuiTooltip", e);
|
|
1798
|
+
}
|
|
1799
|
+
const Nn = eo("MuiTooltip", ["popper", "popperInteractive", "popperArrow", "popperClose", "tooltip", "tooltipArrow", "touch", "tooltipPlacementLeft", "tooltipPlacementRight", "tooltipPlacementTop", "tooltipPlacementBottom", "arrow"]), we = Nn, Bn = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "slotProps", "slots", "title", "TransitionComponent", "TransitionProps"];
|
|
1800
|
+
function zn(e) {
|
|
1801
|
+
return Math.round(e * 1e5) / 1e5;
|
|
1802
|
+
}
|
|
1803
|
+
const Xn = (e) => {
|
|
1804
|
+
const {
|
|
1805
|
+
classes: o,
|
|
1806
|
+
disableInteractive: t,
|
|
1807
|
+
arrow: r,
|
|
1808
|
+
touch: i,
|
|
1809
|
+
placement: n
|
|
1810
|
+
} = e, a = {
|
|
1811
|
+
popper: ["popper", !t && "popperInteractive", r && "popperArrow"],
|
|
1812
|
+
tooltip: ["tooltip", r && "tooltipArrow", i && "touch", `tooltipPlacement${Pe(n.split("-")[0])}`],
|
|
1813
|
+
arrow: ["arrow"]
|
|
1814
|
+
};
|
|
1815
|
+
return Mt(a, _n, o);
|
|
1816
|
+
}, Wn = xe(fr, {
|
|
1817
|
+
name: "MuiTooltip",
|
|
1818
|
+
slot: "Popper",
|
|
1819
|
+
overridesResolver: (e, o) => {
|
|
1820
|
+
const {
|
|
1821
|
+
ownerState: t
|
|
1822
|
+
} = e;
|
|
1823
|
+
return [o.popper, !t.disableInteractive && o.popperInteractive, t.arrow && o.popperArrow, !t.open && o.popperClose];
|
|
1824
|
+
}
|
|
1825
|
+
})(({
|
|
1826
|
+
theme: e,
|
|
1827
|
+
ownerState: o,
|
|
1828
|
+
open: t
|
|
1829
|
+
}) => S({
|
|
1830
|
+
zIndex: (e.vars || e).zIndex.tooltip,
|
|
1831
|
+
pointerEvents: "none"
|
|
1832
|
+
}, !o.disableInteractive && {
|
|
1833
|
+
pointerEvents: "auto"
|
|
1834
|
+
}, !t && {
|
|
1835
|
+
pointerEvents: "none"
|
|
1836
|
+
}, o.arrow && {
|
|
1837
|
+
[`&[data-popper-placement*="bottom"] .${we.arrow}`]: {
|
|
1838
|
+
top: 0,
|
|
1839
|
+
marginTop: "-0.71em",
|
|
1840
|
+
"&::before": {
|
|
1841
|
+
transformOrigin: "0 100%"
|
|
1842
|
+
}
|
|
1843
|
+
},
|
|
1844
|
+
[`&[data-popper-placement*="top"] .${we.arrow}`]: {
|
|
1845
|
+
bottom: 0,
|
|
1846
|
+
marginBottom: "-0.71em",
|
|
1847
|
+
"&::before": {
|
|
1848
|
+
transformOrigin: "100% 0"
|
|
1849
|
+
}
|
|
1850
|
+
},
|
|
1851
|
+
[`&[data-popper-placement*="right"] .${we.arrow}`]: S({}, o.isRtl ? {
|
|
1852
|
+
right: 0,
|
|
1853
|
+
marginRight: "-0.71em"
|
|
1854
|
+
} : {
|
|
1855
|
+
left: 0,
|
|
1856
|
+
marginLeft: "-0.71em"
|
|
1857
|
+
}, {
|
|
1858
|
+
height: "1em",
|
|
1859
|
+
width: "0.71em",
|
|
1860
|
+
"&::before": {
|
|
1861
|
+
transformOrigin: "100% 100%"
|
|
1862
|
+
}
|
|
1863
|
+
}),
|
|
1864
|
+
[`&[data-popper-placement*="left"] .${we.arrow}`]: S({}, o.isRtl ? {
|
|
1865
|
+
left: 0,
|
|
1866
|
+
marginLeft: "-0.71em"
|
|
1867
|
+
} : {
|
|
1868
|
+
right: 0,
|
|
1869
|
+
marginRight: "-0.71em"
|
|
1870
|
+
}, {
|
|
1871
|
+
height: "1em",
|
|
1872
|
+
width: "0.71em",
|
|
1873
|
+
"&::before": {
|
|
1874
|
+
transformOrigin: "0 0"
|
|
1875
|
+
}
|
|
1876
|
+
})
|
|
1877
|
+
})), $n = xe("div", {
|
|
1878
|
+
name: "MuiTooltip",
|
|
1879
|
+
slot: "Tooltip",
|
|
1880
|
+
overridesResolver: (e, o) => {
|
|
1881
|
+
const {
|
|
1882
|
+
ownerState: t
|
|
1883
|
+
} = e;
|
|
1884
|
+
return [o.tooltip, t.touch && o.touch, t.arrow && o.tooltipArrow, o[`tooltipPlacement${Pe(t.placement.split("-")[0])}`]];
|
|
1885
|
+
}
|
|
1886
|
+
})(({
|
|
1887
|
+
theme: e,
|
|
1888
|
+
ownerState: o
|
|
1889
|
+
}) => S({
|
|
1890
|
+
backgroundColor: e.vars ? e.vars.palette.Tooltip.bg : Ie(e.palette.grey[700], 0.92),
|
|
1891
|
+
borderRadius: (e.vars || e).shape.borderRadius,
|
|
1892
|
+
color: (e.vars || e).palette.common.white,
|
|
1893
|
+
fontFamily: e.typography.fontFamily,
|
|
1894
|
+
padding: "4px 8px",
|
|
1895
|
+
fontSize: e.typography.pxToRem(11),
|
|
1896
|
+
maxWidth: 300,
|
|
1897
|
+
margin: 2,
|
|
1898
|
+
wordWrap: "break-word",
|
|
1899
|
+
fontWeight: e.typography.fontWeightMedium
|
|
1900
|
+
}, o.arrow && {
|
|
1901
|
+
position: "relative",
|
|
1902
|
+
margin: 0
|
|
1903
|
+
}, o.touch && {
|
|
1904
|
+
padding: "8px 16px",
|
|
1905
|
+
fontSize: e.typography.pxToRem(14),
|
|
1906
|
+
lineHeight: `${zn(16 / 14)}em`,
|
|
1907
|
+
fontWeight: e.typography.fontWeightRegular
|
|
1908
|
+
}, {
|
|
1909
|
+
[`.${we.popper}[data-popper-placement*="left"] &`]: S({
|
|
1910
|
+
transformOrigin: "right center"
|
|
1911
|
+
}, o.isRtl ? S({
|
|
1912
|
+
marginLeft: "14px"
|
|
1913
|
+
}, o.touch && {
|
|
1914
|
+
marginLeft: "24px"
|
|
1915
|
+
}) : S({
|
|
1916
|
+
marginRight: "14px"
|
|
1917
|
+
}, o.touch && {
|
|
1918
|
+
marginRight: "24px"
|
|
1919
|
+
})),
|
|
1920
|
+
[`.${we.popper}[data-popper-placement*="right"] &`]: S({
|
|
1921
|
+
transformOrigin: "left center"
|
|
1922
|
+
}, o.isRtl ? S({
|
|
1923
|
+
marginRight: "14px"
|
|
1924
|
+
}, o.touch && {
|
|
1925
|
+
marginRight: "24px"
|
|
1926
|
+
}) : S({
|
|
1927
|
+
marginLeft: "14px"
|
|
1928
|
+
}, o.touch && {
|
|
1929
|
+
marginLeft: "24px"
|
|
1930
|
+
})),
|
|
1931
|
+
[`.${we.popper}[data-popper-placement*="top"] &`]: S({
|
|
1932
|
+
transformOrigin: "center bottom",
|
|
1933
|
+
marginBottom: "14px"
|
|
1934
|
+
}, o.touch && {
|
|
1935
|
+
marginBottom: "24px"
|
|
1936
|
+
}),
|
|
1937
|
+
[`.${we.popper}[data-popper-placement*="bottom"] &`]: S({
|
|
1938
|
+
transformOrigin: "center top",
|
|
1939
|
+
marginTop: "14px"
|
|
1940
|
+
}, o.touch && {
|
|
1941
|
+
marginTop: "24px"
|
|
1942
|
+
})
|
|
1943
|
+
})), kn = xe("span", {
|
|
1944
|
+
name: "MuiTooltip",
|
|
1945
|
+
slot: "Arrow",
|
|
1946
|
+
overridesResolver: (e, o) => o.arrow
|
|
1947
|
+
})(({
|
|
1948
|
+
theme: e
|
|
1949
|
+
}) => ({
|
|
1950
|
+
overflow: "hidden",
|
|
1951
|
+
position: "absolute",
|
|
1952
|
+
width: "1em",
|
|
1953
|
+
height: "0.71em",
|
|
1954
|
+
boxSizing: "border-box",
|
|
1955
|
+
color: e.vars ? e.vars.palette.Tooltip.bg : Ie(e.palette.grey[700], 0.9),
|
|
1956
|
+
"&::before": {
|
|
1957
|
+
content: '""',
|
|
1958
|
+
margin: "auto",
|
|
1959
|
+
display: "block",
|
|
1960
|
+
width: "100%",
|
|
1961
|
+
height: "100%",
|
|
1962
|
+
backgroundColor: "currentColor",
|
|
1963
|
+
transform: "rotate(45deg)"
|
|
1964
|
+
}
|
|
1965
|
+
}));
|
|
1966
|
+
let vt = !1, Vt = null, Ke = {
|
|
1967
|
+
x: 0,
|
|
1968
|
+
y: 0
|
|
1969
|
+
};
|
|
1970
|
+
function mt(e, o) {
|
|
1971
|
+
return (t) => {
|
|
1972
|
+
o && o(t), e(t);
|
|
1973
|
+
};
|
|
1974
|
+
}
|
|
1975
|
+
const cr = /* @__PURE__ */ D.forwardRef(function(o, t) {
|
|
1976
|
+
var r, i, n, a, s, l, d, p, f, c, v, h, m, g, P, C, y, b, w;
|
|
1977
|
+
const T = xt({
|
|
1978
|
+
props: o,
|
|
1979
|
+
name: "MuiTooltip"
|
|
1980
|
+
}), {
|
|
1981
|
+
arrow: O = !1,
|
|
1982
|
+
children: x,
|
|
1983
|
+
components: E = {},
|
|
1984
|
+
componentsProps: A = {},
|
|
1985
|
+
describeChild: M = !1,
|
|
1986
|
+
disableFocusListener: X = !1,
|
|
1987
|
+
disableHoverListener: N = !1,
|
|
1988
|
+
disableInteractive: Z = !1,
|
|
1989
|
+
disableTouchListener: U = !1,
|
|
1990
|
+
enterDelay: B = 100,
|
|
1991
|
+
enterNextDelay: W = 0,
|
|
1992
|
+
enterTouchDelay: $ = 700,
|
|
1993
|
+
followCursor: q = !1,
|
|
1994
|
+
id: be,
|
|
1995
|
+
leaveDelay: se = 0,
|
|
1996
|
+
leaveTouchDelay: ve = 1500,
|
|
1997
|
+
onClose: ne,
|
|
1998
|
+
onOpen: K,
|
|
1999
|
+
open: Q,
|
|
2000
|
+
placement: le = "bottom",
|
|
2001
|
+
PopperComponent: ue,
|
|
2002
|
+
PopperProps: k = {},
|
|
2003
|
+
slotProps: L = {},
|
|
2004
|
+
slots: me = {},
|
|
2005
|
+
title: j,
|
|
2006
|
+
TransitionComponent: Le = Mo,
|
|
2007
|
+
TransitionProps: Me
|
|
2008
|
+
} = T, nt = je(T, Bn), I = /* @__PURE__ */ D.isValidElement(x) ? x : /* @__PURE__ */ _("span", {
|
|
2009
|
+
children: x
|
|
2010
|
+
}), Ye = qr(), at = Ye.direction === "rtl", [V, st] = D.useState(), [ae, _e] = D.useState(null), Oe = D.useRef(!1), Ne = Z || q, ye = D.useRef(), Ee = D.useRef(), pe = D.useRef(), Ve = D.useRef(), [lt, ho] = Jr({
|
|
2011
|
+
controlled: Q,
|
|
2012
|
+
default: !1,
|
|
2013
|
+
name: "Tooltip",
|
|
2014
|
+
state: "open"
|
|
2015
|
+
});
|
|
2016
|
+
let he = lt;
|
|
2017
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2018
|
+
const {
|
|
2019
|
+
current: R
|
|
2020
|
+
} = D.useRef(Q !== void 0);
|
|
2021
|
+
D.useEffect(() => {
|
|
2022
|
+
V && V.disabled && !R && j !== "" && V.tagName.toLowerCase() === "button" && console.error(["MUI: You are providing a disabled `button` child to the Tooltip component.", "A disabled element does not fire events.", "Tooltip needs to listen to the child element's events to display the title.", "", "Add a simple wrapper element, such as a `span`."].join(`
|
|
2023
|
+
`));
|
|
2024
|
+
}, [j, V, R]);
|
|
2025
|
+
}
|
|
2026
|
+
const Wt = Ir(be), He = D.useRef(), ut = D.useCallback(() => {
|
|
2027
|
+
He.current !== void 0 && (document.body.style.WebkitUserSelect = He.current, He.current = void 0), clearTimeout(Ve.current);
|
|
2028
|
+
}, []);
|
|
2029
|
+
D.useEffect(() => () => {
|
|
2030
|
+
clearTimeout(ye.current), clearTimeout(Ee.current), clearTimeout(pe.current), ut();
|
|
2031
|
+
}, [ut]);
|
|
2032
|
+
const go = (R) => {
|
|
2033
|
+
clearTimeout(Vt), vt = !0, ho(!0), K && !he && K(R);
|
|
2034
|
+
}, pt = Kr(
|
|
2035
|
+
/**
|
|
2036
|
+
* @param {React.SyntheticEvent | Event} event
|
|
2037
|
+
*/
|
|
2038
|
+
(R) => {
|
|
2039
|
+
clearTimeout(Vt), Vt = setTimeout(() => {
|
|
2040
|
+
vt = !1;
|
|
2041
|
+
}, 800 + se), ho(!1), ne && he && ne(R), clearTimeout(ye.current), ye.current = setTimeout(() => {
|
|
2042
|
+
Oe.current = !1;
|
|
2043
|
+
}, Ye.transitions.duration.shortest);
|
|
2044
|
+
}
|
|
2045
|
+
), $t = (R) => {
|
|
2046
|
+
Oe.current && R.type !== "touchstart" || (V && V.removeAttribute("title"), clearTimeout(Ee.current), clearTimeout(pe.current), B || vt && W ? Ee.current = setTimeout(() => {
|
|
2047
|
+
go(R);
|
|
2048
|
+
}, vt ? W : B) : go(R));
|
|
2049
|
+
}, bo = (R) => {
|
|
2050
|
+
clearTimeout(Ee.current), clearTimeout(pe.current), pe.current = setTimeout(() => {
|
|
2051
|
+
pt(R);
|
|
2052
|
+
}, se);
|
|
2053
|
+
}, {
|
|
2054
|
+
isFocusVisibleRef: yo,
|
|
2055
|
+
onBlur: Mr,
|
|
2056
|
+
onFocus: Yr,
|
|
2057
|
+
ref: _r
|
|
2058
|
+
} = Qr(), [, wo] = D.useState(!1), Po = (R) => {
|
|
2059
|
+
Mr(R), yo.current === !1 && (wo(!1), bo(R));
|
|
2060
|
+
}, To = (R) => {
|
|
2061
|
+
V || st(R.currentTarget), Yr(R), yo.current === !0 && (wo(!0), $t(R));
|
|
2062
|
+
}, Co = (R) => {
|
|
2063
|
+
Oe.current = !0;
|
|
2064
|
+
const G = I.props;
|
|
2065
|
+
G.onTouchStart && G.onTouchStart(R);
|
|
2066
|
+
}, So = $t, Oo = bo, Nr = (R) => {
|
|
2067
|
+
Co(R), clearTimeout(pe.current), clearTimeout(ye.current), ut(), He.current = document.body.style.WebkitUserSelect, document.body.style.WebkitUserSelect = "none", Ve.current = setTimeout(() => {
|
|
2068
|
+
document.body.style.WebkitUserSelect = He.current, $t(R);
|
|
2069
|
+
}, $);
|
|
2070
|
+
}, Br = (R) => {
|
|
2071
|
+
I.props.onTouchEnd && I.props.onTouchEnd(R), ut(), clearTimeout(pe.current), pe.current = setTimeout(() => {
|
|
2072
|
+
pt(R);
|
|
2073
|
+
}, ve);
|
|
2074
|
+
};
|
|
2075
|
+
D.useEffect(() => {
|
|
2076
|
+
if (!he)
|
|
2077
|
+
return;
|
|
2078
|
+
function R(G) {
|
|
2079
|
+
(G.key === "Escape" || G.key === "Esc") && pt(G);
|
|
2080
|
+
}
|
|
2081
|
+
return document.addEventListener("keydown", R), () => {
|
|
2082
|
+
document.removeEventListener("keydown", R);
|
|
2083
|
+
};
|
|
2084
|
+
}, [pt, he]);
|
|
2085
|
+
const zr = Zt(I.ref, _r, st, t);
|
|
2086
|
+
!j && j !== 0 && (he = !1);
|
|
2087
|
+
const kt = D.useRef(), Xr = (R) => {
|
|
2088
|
+
const G = I.props;
|
|
2089
|
+
G.onMouseMove && G.onMouseMove(R), Ke = {
|
|
2090
|
+
x: R.clientX,
|
|
2091
|
+
y: R.clientY
|
|
2092
|
+
}, kt.current && kt.current.update();
|
|
2093
|
+
}, Fe = {}, jt = typeof j == "string";
|
|
2094
|
+
M ? (Fe.title = !he && jt && !N ? j : null, Fe["aria-describedby"] = he ? Wt : null) : (Fe["aria-label"] = jt ? j : null, Fe["aria-labelledby"] = he && !jt ? Wt : null);
|
|
2095
|
+
const ee = S({}, Fe, nt, I.props, {
|
|
2096
|
+
className: Be(nt.className, I.props.className),
|
|
2097
|
+
onTouchStart: Co,
|
|
2098
|
+
ref: zr
|
|
2099
|
+
}, q ? {
|
|
2100
|
+
onMouseMove: Xr
|
|
2101
|
+
} : {});
|
|
2102
|
+
process.env.NODE_ENV !== "production" && (ee["data-mui-internal-clone-element"] = !0, D.useEffect(() => {
|
|
2103
|
+
V && !V.getAttribute("data-mui-internal-clone-element") && console.error(["MUI: The `children` component of the Tooltip is not forwarding its props correctly.", "Please make sure that props are spread on the same element that the ref is applied to."].join(`
|
|
2104
|
+
`));
|
|
2105
|
+
}, [V]));
|
|
2106
|
+
const Ze = {};
|
|
2107
|
+
U || (ee.onTouchStart = Nr, ee.onTouchEnd = Br), N || (ee.onMouseOver = mt(So, ee.onMouseOver), ee.onMouseLeave = mt(Oo, ee.onMouseLeave), Ne || (Ze.onMouseOver = So, Ze.onMouseLeave = Oo)), X || (ee.onFocus = mt(To, ee.onFocus), ee.onBlur = mt(Po, ee.onBlur), Ne || (Ze.onFocus = To, Ze.onBlur = Po)), process.env.NODE_ENV !== "production" && I.props.title && console.error(["MUI: You have provided a `title` prop to the child of <Tooltip />.", `Remove this title prop \`${I.props.title}\` or the Tooltip component.`].join(`
|
|
2108
|
+
`));
|
|
2109
|
+
const Wr = D.useMemo(() => {
|
|
2110
|
+
var R;
|
|
2111
|
+
let G = [{
|
|
2112
|
+
name: "arrow",
|
|
2113
|
+
enabled: !!ae,
|
|
2114
|
+
options: {
|
|
2115
|
+
element: ae,
|
|
2116
|
+
padding: 4
|
|
2117
|
+
}
|
|
2118
|
+
}];
|
|
2119
|
+
return (R = k.popperOptions) != null && R.modifiers && (G = G.concat(k.popperOptions.modifiers)), S({}, k.popperOptions, {
|
|
2120
|
+
modifiers: G
|
|
2121
|
+
});
|
|
2122
|
+
}, [ae, k]), Ue = S({}, T, {
|
|
2123
|
+
isRtl: at,
|
|
2124
|
+
arrow: O,
|
|
2125
|
+
disableInteractive: Ne,
|
|
2126
|
+
placement: le,
|
|
2127
|
+
PopperComponentProp: ue,
|
|
2128
|
+
touch: Oe.current
|
|
2129
|
+
}), Lt = Xn(Ue), Eo = (r = (i = me.popper) != null ? i : E.Popper) != null ? r : Wn, Ao = (n = (a = (s = me.transition) != null ? s : E.Transition) != null ? a : Le) != null ? n : Mo, Ro = (l = (d = me.tooltip) != null ? d : E.Tooltip) != null ? l : $n, Do = (p = (f = me.arrow) != null ? f : E.Arrow) != null ? p : kn, $r = dt(Eo, S({}, k, (c = L.popper) != null ? c : A.popper, {
|
|
2130
|
+
className: Be(Lt.popper, k == null ? void 0 : k.className, (v = (h = L.popper) != null ? h : A.popper) == null ? void 0 : v.className)
|
|
2131
|
+
}), Ue), kr = dt(Ao, S({}, Me, (m = L.transition) != null ? m : A.transition), Ue), jr = dt(Ro, S({}, (g = L.tooltip) != null ? g : A.tooltip, {
|
|
2132
|
+
className: Be(Lt.tooltip, (P = (C = L.tooltip) != null ? C : A.tooltip) == null ? void 0 : P.className)
|
|
2133
|
+
}), Ue), Lr = dt(Do, S({}, (y = L.arrow) != null ? y : A.arrow, {
|
|
2134
|
+
className: Be(Lt.arrow, (b = (w = L.arrow) != null ? w : A.arrow) == null ? void 0 : b.className)
|
|
2135
|
+
}), Ue);
|
|
2136
|
+
return /* @__PURE__ */ wt(D.Fragment, {
|
|
2137
|
+
children: [/* @__PURE__ */ D.cloneElement(I, ee), /* @__PURE__ */ _(Eo, S({
|
|
2138
|
+
as: ue ?? fr,
|
|
2139
|
+
placement: le,
|
|
2140
|
+
anchorEl: q ? {
|
|
2141
|
+
getBoundingClientRect: () => ({
|
|
2142
|
+
top: Ke.y,
|
|
2143
|
+
left: Ke.x,
|
|
2144
|
+
right: Ke.x,
|
|
2145
|
+
bottom: Ke.y,
|
|
2146
|
+
width: 0,
|
|
2147
|
+
height: 0
|
|
2148
|
+
})
|
|
2149
|
+
} : V,
|
|
2150
|
+
popperRef: kt,
|
|
2151
|
+
open: V ? he : !1,
|
|
2152
|
+
id: Wt,
|
|
2153
|
+
transition: !0
|
|
2154
|
+
}, Ze, $r, {
|
|
2155
|
+
popperOptions: Wr,
|
|
2156
|
+
children: ({
|
|
2157
|
+
TransitionProps: R
|
|
2158
|
+
}) => /* @__PURE__ */ _(Ao, S({
|
|
2159
|
+
timeout: Ye.transitions.duration.shorter
|
|
2160
|
+
}, R, kr, {
|
|
2161
|
+
children: /* @__PURE__ */ wt(Ro, S({}, jr, {
|
|
2162
|
+
children: [j, O ? /* @__PURE__ */ _(Do, S({}, Lr, {
|
|
2163
|
+
ref: _e
|
|
2164
|
+
})) : null]
|
|
2165
|
+
}))
|
|
2166
|
+
}))
|
|
2167
|
+
}))]
|
|
2168
|
+
});
|
|
2169
|
+
});
|
|
2170
|
+
process.env.NODE_ENV !== "production" && (cr.propTypes = {
|
|
2171
|
+
// ----------------------------- Warning --------------------------------
|
|
2172
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
2173
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
2174
|
+
// ----------------------------------------------------------------------
|
|
2175
|
+
/**
|
|
2176
|
+
* If `true`, adds an arrow to the tooltip.
|
|
2177
|
+
* @default false
|
|
2178
|
+
*/
|
|
2179
|
+
arrow: u.bool,
|
|
2180
|
+
/**
|
|
2181
|
+
* Tooltip reference element.
|
|
2182
|
+
*/
|
|
2183
|
+
children: Zr.isRequired,
|
|
2184
|
+
/**
|
|
2185
|
+
* Override or extend the styles applied to the component.
|
|
2186
|
+
*/
|
|
2187
|
+
classes: u.object,
|
|
2188
|
+
/**
|
|
2189
|
+
* @ignore
|
|
2190
|
+
*/
|
|
2191
|
+
className: u.string,
|
|
2192
|
+
/**
|
|
2193
|
+
* The components used for each slot inside.
|
|
2194
|
+
*
|
|
2195
|
+
* This prop is an alias for the `slots` prop.
|
|
2196
|
+
* It's recommended to use the `slots` prop instead.
|
|
2197
|
+
*
|
|
2198
|
+
* @default {}
|
|
2199
|
+
*/
|
|
2200
|
+
components: u.shape({
|
|
2201
|
+
Arrow: u.elementType,
|
|
2202
|
+
Popper: u.elementType,
|
|
2203
|
+
Tooltip: u.elementType,
|
|
2204
|
+
Transition: u.elementType
|
|
2205
|
+
}),
|
|
2206
|
+
/**
|
|
2207
|
+
* The extra props for the slot components.
|
|
2208
|
+
* You can override the existing props or add new ones.
|
|
2209
|
+
*
|
|
2210
|
+
* This prop is an alias for the `slotProps` prop.
|
|
2211
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
2212
|
+
*
|
|
2213
|
+
* @default {}
|
|
2214
|
+
*/
|
|
2215
|
+
componentsProps: u.shape({
|
|
2216
|
+
arrow: u.object,
|
|
2217
|
+
popper: u.object,
|
|
2218
|
+
tooltip: u.object,
|
|
2219
|
+
transition: u.object
|
|
2220
|
+
}),
|
|
2221
|
+
/**
|
|
2222
|
+
* Set to `true` if the `title` acts as an accessible description.
|
|
2223
|
+
* By default the `title` acts as an accessible label for the child.
|
|
2224
|
+
* @default false
|
|
2225
|
+
*/
|
|
2226
|
+
describeChild: u.bool,
|
|
2227
|
+
/**
|
|
2228
|
+
* Do not respond to focus-visible events.
|
|
2229
|
+
* @default false
|
|
2230
|
+
*/
|
|
2231
|
+
disableFocusListener: u.bool,
|
|
2232
|
+
/**
|
|
2233
|
+
* Do not respond to hover events.
|
|
2234
|
+
* @default false
|
|
2235
|
+
*/
|
|
2236
|
+
disableHoverListener: u.bool,
|
|
2237
|
+
/**
|
|
2238
|
+
* Makes a tooltip not interactive, i.e. it will close when the user
|
|
2239
|
+
* hovers over the tooltip before the `leaveDelay` is expired.
|
|
2240
|
+
* @default false
|
|
2241
|
+
*/
|
|
2242
|
+
disableInteractive: u.bool,
|
|
2243
|
+
/**
|
|
2244
|
+
* Do not respond to long press touch events.
|
|
2245
|
+
* @default false
|
|
2246
|
+
*/
|
|
2247
|
+
disableTouchListener: u.bool,
|
|
2248
|
+
/**
|
|
2249
|
+
* The number of milliseconds to wait before showing the tooltip.
|
|
2250
|
+
* This prop won't impact the enter touch delay (`enterTouchDelay`).
|
|
2251
|
+
* @default 100
|
|
2252
|
+
*/
|
|
2253
|
+
enterDelay: u.number,
|
|
2254
|
+
/**
|
|
2255
|
+
* The number of milliseconds to wait before showing the tooltip when one was already recently opened.
|
|
2256
|
+
* @default 0
|
|
2257
|
+
*/
|
|
2258
|
+
enterNextDelay: u.number,
|
|
2259
|
+
/**
|
|
2260
|
+
* The number of milliseconds a user must touch the element before showing the tooltip.
|
|
2261
|
+
* @default 700
|
|
2262
|
+
*/
|
|
2263
|
+
enterTouchDelay: u.number,
|
|
2264
|
+
/**
|
|
2265
|
+
* If `true`, the tooltip follow the cursor over the wrapped element.
|
|
2266
|
+
* @default false
|
|
2267
|
+
*/
|
|
2268
|
+
followCursor: u.bool,
|
|
2269
|
+
/**
|
|
2270
|
+
* This prop is used to help implement the accessibility logic.
|
|
2271
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
2272
|
+
*/
|
|
2273
|
+
id: u.string,
|
|
2274
|
+
/**
|
|
2275
|
+
* The number of milliseconds to wait before hiding the tooltip.
|
|
2276
|
+
* This prop won't impact the leave touch delay (`leaveTouchDelay`).
|
|
2277
|
+
* @default 0
|
|
2278
|
+
*/
|
|
2279
|
+
leaveDelay: u.number,
|
|
2280
|
+
/**
|
|
2281
|
+
* The number of milliseconds after the user stops touching an element before hiding the tooltip.
|
|
2282
|
+
* @default 1500
|
|
2283
|
+
*/
|
|
2284
|
+
leaveTouchDelay: u.number,
|
|
2285
|
+
/**
|
|
2286
|
+
* Callback fired when the component requests to be closed.
|
|
2287
|
+
*
|
|
2288
|
+
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
2289
|
+
*/
|
|
2290
|
+
onClose: u.func,
|
|
2291
|
+
/**
|
|
2292
|
+
* Callback fired when the component requests to be open.
|
|
2293
|
+
*
|
|
2294
|
+
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
2295
|
+
*/
|
|
2296
|
+
onOpen: u.func,
|
|
2297
|
+
/**
|
|
2298
|
+
* If `true`, the component is shown.
|
|
2299
|
+
*/
|
|
2300
|
+
open: u.bool,
|
|
2301
|
+
/**
|
|
2302
|
+
* Tooltip placement.
|
|
2303
|
+
* @default 'bottom'
|
|
2304
|
+
*/
|
|
2305
|
+
placement: u.oneOf(["bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
|
|
2306
|
+
/**
|
|
2307
|
+
* The component used for the popper.
|
|
2308
|
+
* @default Popper
|
|
2309
|
+
*/
|
|
2310
|
+
PopperComponent: u.elementType,
|
|
2311
|
+
/**
|
|
2312
|
+
* Props applied to the [`Popper`](/material-ui/api/popper/) element.
|
|
2313
|
+
* @default {}
|
|
2314
|
+
*/
|
|
2315
|
+
PopperProps: u.object,
|
|
2316
|
+
/**
|
|
2317
|
+
* The extra props for the slot components.
|
|
2318
|
+
* You can override the existing props or add new ones.
|
|
2319
|
+
*
|
|
2320
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
2321
|
+
*
|
|
2322
|
+
* @default {}
|
|
2323
|
+
*/
|
|
2324
|
+
slotProps: u.shape({
|
|
2325
|
+
arrow: u.object,
|
|
2326
|
+
popper: u.object,
|
|
2327
|
+
tooltip: u.object,
|
|
2328
|
+
transition: u.object
|
|
2329
|
+
}),
|
|
2330
|
+
/**
|
|
2331
|
+
* The components used for each slot inside.
|
|
2332
|
+
*
|
|
2333
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
2334
|
+
*
|
|
2335
|
+
* @default {}
|
|
2336
|
+
*/
|
|
2337
|
+
slots: u.shape({
|
|
2338
|
+
arrow: u.elementType,
|
|
2339
|
+
popper: u.elementType,
|
|
2340
|
+
tooltip: u.elementType,
|
|
2341
|
+
transition: u.elementType
|
|
2342
|
+
}),
|
|
2343
|
+
/**
|
|
2344
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
2345
|
+
*/
|
|
2346
|
+
sx: u.oneOfType([u.arrayOf(u.oneOfType([u.func, u.object, u.bool])), u.func, u.object]),
|
|
2347
|
+
/**
|
|
2348
|
+
* Tooltip title. Zero-length titles string, undefined, null and false are never displayed.
|
|
2349
|
+
*/
|
|
2350
|
+
title: u.node,
|
|
2351
|
+
/**
|
|
2352
|
+
* The component used for the transition.
|
|
2353
|
+
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
2354
|
+
* @default Grow
|
|
2355
|
+
*/
|
|
2356
|
+
TransitionComponent: u.elementType,
|
|
2357
|
+
/**
|
|
2358
|
+
* Props applied to the transition element.
|
|
2359
|
+
* By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
|
|
2360
|
+
*/
|
|
2361
|
+
TransitionProps: u.object
|
|
2362
|
+
});
|
|
2363
|
+
const ht = cr;
|
|
2364
|
+
var te = function(e, o) {
|
|
2365
|
+
return Number(e.toFixed(o));
|
|
2366
|
+
}, jn = function(e, o) {
|
|
2367
|
+
return typeof e == "number" ? e : o;
|
|
2368
|
+
}, z = function(e, o, t) {
|
|
2369
|
+
t && typeof t == "function" && t(e, o);
|
|
2370
|
+
}, Ln = function(e) {
|
|
2371
|
+
return -Math.cos(e * Math.PI) / 2 + 0.5;
|
|
2372
|
+
}, Vn = function(e) {
|
|
2373
|
+
return e;
|
|
2374
|
+
}, Hn = function(e) {
|
|
2375
|
+
return e * e;
|
|
2376
|
+
}, Fn = function(e) {
|
|
2377
|
+
return e * (2 - e);
|
|
2378
|
+
}, Zn = function(e) {
|
|
2379
|
+
return e < 0.5 ? 2 * e * e : -1 + (4 - 2 * e) * e;
|
|
2380
|
+
}, Un = function(e) {
|
|
2381
|
+
return e * e * e;
|
|
2382
|
+
}, qn = function(e) {
|
|
2383
|
+
return --e * e * e + 1;
|
|
2384
|
+
}, Kn = function(e) {
|
|
2385
|
+
return e < 0.5 ? 4 * e * e * e : (e - 1) * (2 * e - 2) * (2 * e - 2) + 1;
|
|
2386
|
+
}, Qn = function(e) {
|
|
2387
|
+
return e * e * e * e;
|
|
2388
|
+
}, Gn = function(e) {
|
|
2389
|
+
return 1 - --e * e * e * e;
|
|
2390
|
+
}, Jn = function(e) {
|
|
2391
|
+
return e < 0.5 ? 8 * e * e * e * e : 1 - 8 * --e * e * e * e;
|
|
2392
|
+
}, In = function(e) {
|
|
2393
|
+
return e * e * e * e * e;
|
|
2394
|
+
}, ea = function(e) {
|
|
2395
|
+
return 1 + --e * e * e * e * e;
|
|
2396
|
+
}, ta = function(e) {
|
|
2397
|
+
return e < 0.5 ? 16 * e * e * e * e * e : 1 + 16 * --e * e * e * e * e;
|
|
2398
|
+
}, vr = {
|
|
2399
|
+
easeOut: Ln,
|
|
2400
|
+
linear: Vn,
|
|
2401
|
+
easeInQuad: Hn,
|
|
2402
|
+
easeOutQuad: Fn,
|
|
2403
|
+
easeInOutQuad: Zn,
|
|
2404
|
+
easeInCubic: Un,
|
|
2405
|
+
easeOutCubic: qn,
|
|
2406
|
+
easeInOutCubic: Kn,
|
|
2407
|
+
easeInQuart: Qn,
|
|
2408
|
+
easeOutQuart: Gn,
|
|
2409
|
+
easeInOutQuart: Jn,
|
|
2410
|
+
easeInQuint: In,
|
|
2411
|
+
easeOutQuint: ea,
|
|
2412
|
+
easeInOutQuint: ta
|
|
2413
|
+
}, mr = function(e) {
|
|
2414
|
+
typeof e == "number" && cancelAnimationFrame(e);
|
|
2415
|
+
}, de = function(e) {
|
|
2416
|
+
e.mounted && (mr(e.animation), e.animate = !1, e.animation = null, e.velocity = null);
|
|
2417
|
+
};
|
|
2418
|
+
function hr(e, o, t, r) {
|
|
2419
|
+
if (e.mounted) {
|
|
2420
|
+
var i = (/* @__PURE__ */ new Date()).getTime(), n = 1;
|
|
2421
|
+
de(e), e.animation = function() {
|
|
2422
|
+
if (!e.mounted)
|
|
2423
|
+
return mr(e.animation);
|
|
2424
|
+
var a = (/* @__PURE__ */ new Date()).getTime() - i, s = a / t, l = vr[o], d = l(s);
|
|
2425
|
+
a >= t ? (r(n), e.animation = null) : e.animation && (r(d), requestAnimationFrame(e.animation));
|
|
2426
|
+
}, requestAnimationFrame(e.animation);
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
function oa(e) {
|
|
2430
|
+
var o = e.scale, t = e.positionX, r = e.positionY;
|
|
2431
|
+
return !(Number.isNaN(o) || Number.isNaN(t) || Number.isNaN(r));
|
|
2432
|
+
}
|
|
2433
|
+
function Se(e, o, t, r) {
|
|
2434
|
+
var i = oa(o);
|
|
2435
|
+
if (!(!e.mounted || !i)) {
|
|
2436
|
+
var n = e.setTransformState, a = e.transformState, s = a.scale, l = a.positionX, d = a.positionY, p = o.scale - s, f = o.positionX - l, c = o.positionY - d;
|
|
2437
|
+
t === 0 ? n(o.scale, o.positionX, o.positionY) : hr(e, r, t, function(v) {
|
|
2438
|
+
var h = s + p * v, m = l + f * v, g = d + c * v;
|
|
2439
|
+
n(h, m, g);
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
function ra(e, o, t) {
|
|
2444
|
+
var r = e.offsetWidth, i = e.offsetHeight, n = o.offsetWidth, a = o.offsetHeight, s = n * t, l = a * t, d = r - s, p = i - l;
|
|
2445
|
+
return {
|
|
2446
|
+
wrapperWidth: r,
|
|
2447
|
+
wrapperHeight: i,
|
|
2448
|
+
newContentWidth: s,
|
|
2449
|
+
newDiffWidth: d,
|
|
2450
|
+
newContentHeight: l,
|
|
2451
|
+
newDiffHeight: p
|
|
2452
|
+
};
|
|
2453
|
+
}
|
|
2454
|
+
var ia = function(e, o, t, r, i, n, a) {
|
|
2455
|
+
var s = e > o ? t * (a ? 1 : 0.5) : 0, l = r > i ? n * (a ? 1 : 0.5) : 0, d = e - o - s, p = s, f = r - i - l, c = l;
|
|
2456
|
+
return { minPositionX: d, maxPositionX: p, minPositionY: f, maxPositionY: c };
|
|
2457
|
+
}, uo = function(e, o) {
|
|
2458
|
+
var t = e.wrapperComponent, r = e.contentComponent, i = e.setup.centerZoomedOut;
|
|
2459
|
+
if (!t || !r)
|
|
2460
|
+
throw new Error("Components are not mounted");
|
|
2461
|
+
var n = ra(t, r, o), a = n.wrapperWidth, s = n.wrapperHeight, l = n.newContentWidth, d = n.newDiffWidth, p = n.newContentHeight, f = n.newDiffHeight, c = ia(a, l, d, s, p, f, !!i);
|
|
2462
|
+
return c;
|
|
2463
|
+
}, Kt = function(e, o, t, r) {
|
|
2464
|
+
return r ? e < o ? te(o, 2) : e > t ? te(t, 2) : te(e, 2) : te(e, 2);
|
|
2465
|
+
}, ke = function(e, o) {
|
|
2466
|
+
var t = uo(e, o);
|
|
2467
|
+
return e.bounds = t, t;
|
|
2468
|
+
};
|
|
2469
|
+
function Nt(e, o, t, r, i, n, a) {
|
|
2470
|
+
var s = t.minPositionX, l = t.minPositionY, d = t.maxPositionX, p = t.maxPositionY, f = 0, c = 0;
|
|
2471
|
+
a && (f = i, c = n);
|
|
2472
|
+
var v = Kt(e, s - f, d + f, r), h = Kt(o, l - c, p + c, r);
|
|
2473
|
+
return { x: v, y: h };
|
|
2474
|
+
}
|
|
2475
|
+
function Bt(e, o, t, r, i, n) {
|
|
2476
|
+
var a = e.transformState, s = a.scale, l = a.positionX, d = a.positionY, p = r - s;
|
|
2477
|
+
if (typeof o != "number" || typeof t != "number")
|
|
2478
|
+
return console.error("Mouse X and Y position were not provided!"), { x: l, y: d };
|
|
2479
|
+
var f = l - o * p, c = d - t * p, v = Nt(f, c, i, n, 0, 0, null);
|
|
2480
|
+
return v;
|
|
2481
|
+
}
|
|
2482
|
+
function it(e, o, t, r, i) {
|
|
2483
|
+
var n = i ? r : 0, a = o - n;
|
|
2484
|
+
return !Number.isNaN(t) && e >= t ? t : !Number.isNaN(o) && e <= a ? a : e;
|
|
2485
|
+
}
|
|
2486
|
+
var Vo = function(e, o) {
|
|
2487
|
+
var t = e.setup.panning.excluded, r = e.isInitialized, i = e.wrapperComponent, n = o.target, a = i == null ? void 0 : i.contains(n), s = r && n && a;
|
|
2488
|
+
if (!s)
|
|
2489
|
+
return !1;
|
|
2490
|
+
var l = zt(n, t);
|
|
2491
|
+
return !l;
|
|
2492
|
+
}, Ho = function(e) {
|
|
2493
|
+
var o = e.isInitialized, t = e.isPanning, r = e.setup, i = r.panning.disabled, n = o && t && !i;
|
|
2494
|
+
return !!n;
|
|
2495
|
+
}, na = function(e, o) {
|
|
2496
|
+
var t = e.transformState, r = t.positionX, i = t.positionY;
|
|
2497
|
+
e.isPanning = !0;
|
|
2498
|
+
var n = o.clientX, a = o.clientY;
|
|
2499
|
+
e.startCoords = { x: n - r, y: a - i };
|
|
2500
|
+
}, aa = function(e, o) {
|
|
2501
|
+
var t = o.touches, r = e.transformState, i = r.positionX, n = r.positionY;
|
|
2502
|
+
e.isPanning = !0;
|
|
2503
|
+
var a = t.length === 1;
|
|
2504
|
+
if (a) {
|
|
2505
|
+
var s = t[0].clientX, l = t[0].clientY;
|
|
2506
|
+
e.startCoords = { x: s - i, y: l - n };
|
|
2507
|
+
}
|
|
2508
|
+
};
|
|
2509
|
+
function sa(e) {
|
|
2510
|
+
var o = e.transformState, t = o.positionX, r = o.positionY, i = o.scale, n = e.setup, a = n.disabled, s = n.limitToBounds, l = n.centerZoomedOut, d = e.wrapperComponent;
|
|
2511
|
+
if (!(a || !d || !e.bounds)) {
|
|
2512
|
+
var p = e.bounds, f = p.maxPositionX, c = p.minPositionX, v = p.maxPositionY, h = p.minPositionY, m = t > f || t < c, g = r > v || r < h, P = t > f ? d.offsetWidth : e.setup.minPositionX || 0, C = r > v ? d.offsetHeight : e.setup.minPositionY || 0, y = Bt(e, P, C, i, e.bounds, s || l), b = y.x, w = y.y;
|
|
2513
|
+
return {
|
|
2514
|
+
scale: i,
|
|
2515
|
+
positionX: m ? b : t,
|
|
2516
|
+
positionY: g ? w : r
|
|
2517
|
+
};
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
function la(e, o, t, r, i) {
|
|
2521
|
+
var n = e.setup.limitToBounds, a = e.wrapperComponent, s = e.bounds, l = e.transformState, d = l.scale, p = l.positionX, f = l.positionY;
|
|
2522
|
+
if (!(a === null || s === null || o === p && t === f)) {
|
|
2523
|
+
var c = Nt(o, t, s, n, r, i, a), v = c.x, h = c.y;
|
|
2524
|
+
e.setTransformState(d, v, h);
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
var ua = function(e, o, t) {
|
|
2528
|
+
var r = e.startCoords, i = e.transformState, n = e.setup.panning, a = n.lockAxisX, s = n.lockAxisY, l = i.positionX, d = i.positionY;
|
|
2529
|
+
if (!r)
|
|
2530
|
+
return { x: l, y: d };
|
|
2531
|
+
var p = o - r.x, f = t - r.y, c = a ? l : p, v = s ? d : f;
|
|
2532
|
+
return { x: c, y: v };
|
|
2533
|
+
}, Ot = function(e, o) {
|
|
2534
|
+
var t = e.setup, r = e.transformState, i = r.scale, n = t.minScale, a = t.disablePadding;
|
|
2535
|
+
return o > 0 && i >= n && !a ? o : 0;
|
|
2536
|
+
}, pa = function(e) {
|
|
2537
|
+
var o = e.mounted, t = e.setup, r = t.disabled, i = t.velocityAnimation, n = e.transformState.scale, a = i.disabled, s = !a || n > 1 || !r || o;
|
|
2538
|
+
return !!s;
|
|
2539
|
+
}, da = function(e) {
|
|
2540
|
+
var o = e.mounted, t = e.velocity, r = e.bounds, i = e.setup, n = i.disabled, a = i.velocityAnimation, s = e.transformState.scale, l = a.disabled, d = !l || s > 1 || !n || o;
|
|
2541
|
+
return !(!d || !t || !r);
|
|
2542
|
+
};
|
|
2543
|
+
function fa(e, o) {
|
|
2544
|
+
var t = e.setup.velocityAnimation, r = t.equalToMove, i = t.animationTime, n = t.sensitivity;
|
|
2545
|
+
return r ? i * o * n : i;
|
|
2546
|
+
}
|
|
2547
|
+
function Fo(e, o, t, r, i, n, a, s, l, d) {
|
|
2548
|
+
if (i) {
|
|
2549
|
+
if (o > a && t > a) {
|
|
2550
|
+
var p = a + (e - a) * d;
|
|
2551
|
+
return p > l ? l : p < a ? a : p;
|
|
2552
|
+
}
|
|
2553
|
+
if (o < n && t < n) {
|
|
2554
|
+
var p = n + (e - n) * d;
|
|
2555
|
+
return p < s ? s : p > n ? n : p;
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
return r ? o : Kt(e, n, a, i);
|
|
2559
|
+
}
|
|
2560
|
+
function ca(e, o) {
|
|
2561
|
+
var t = 1;
|
|
2562
|
+
return o ? Math.min(t, e.offsetWidth / window.innerWidth) : t;
|
|
2563
|
+
}
|
|
2564
|
+
function va(e, o) {
|
|
2565
|
+
var t = pa(e);
|
|
2566
|
+
if (t) {
|
|
2567
|
+
var r = e.lastMousePosition, i = e.velocityTime, n = e.setup, a = e.wrapperComponent, s = n.velocityAnimation.equalToMove, l = Date.now();
|
|
2568
|
+
if (r && i && a) {
|
|
2569
|
+
var d = ca(a, s), p = o.x - r.x, f = o.y - r.y, c = p / d, v = f / d, h = l - i, m = p * p + f * f, g = Math.sqrt(m) / h;
|
|
2570
|
+
e.velocity = { velocityX: c, velocityY: v, total: g };
|
|
2571
|
+
}
|
|
2572
|
+
e.lastMousePosition = o, e.velocityTime = l;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
function ma(e) {
|
|
2576
|
+
var o = e.velocity, t = e.bounds, r = e.setup, i = e.wrapperComponent, n = da(e);
|
|
2577
|
+
if (!(!n || !o || !t || !i)) {
|
|
2578
|
+
var a = o.velocityX, s = o.velocityY, l = o.total, d = t.maxPositionX, p = t.minPositionX, f = t.maxPositionY, c = t.minPositionY, v = r.limitToBounds, h = r.alignmentAnimation, m = r.zoomAnimation, g = r.panning, P = g.lockAxisY, C = g.lockAxisX, y = m.animationType, b = h.sizeX, w = h.sizeY, T = h.velocityAlignmentTime, O = T, x = fa(e, l), E = Math.max(x, O), A = Ot(e, b), M = Ot(e, w), X = A * i.offsetWidth / 100, N = M * i.offsetHeight / 100, Z = d + X, U = p - X, B = f + N, W = c - N, $ = e.transformState, q = (/* @__PURE__ */ new Date()).getTime();
|
|
2579
|
+
hr(e, y, E, function(be) {
|
|
2580
|
+
var se = e.transformState, ve = se.scale, ne = se.positionX, K = se.positionY, Q = (/* @__PURE__ */ new Date()).getTime() - q, le = Q / O, ue = vr[h.animationType], k = 1 - ue(Math.min(1, le)), L = 1 - be, me = ne + a * L, j = K + s * L, Le = Fo(me, $.positionX, ne, C, v, p, d, U, Z, k), Me = Fo(j, $.positionY, K, P, v, c, f, W, B, k);
|
|
2581
|
+
(ne !== me || K !== j) && e.setTransformState(ve, Le, Me);
|
|
2582
|
+
});
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
function Zo(e, o) {
|
|
2586
|
+
var t = e.transformState.scale;
|
|
2587
|
+
de(e), ke(e, t), window.TouchEvent !== void 0 && o instanceof TouchEvent ? aa(e, o) : na(e, o);
|
|
2588
|
+
}
|
|
2589
|
+
function gr(e) {
|
|
2590
|
+
var o = e.transformState.scale, t = e.setup, r = t.minScale, i = t.alignmentAnimation, n = i.disabled, a = i.sizeX, s = i.sizeY, l = i.animationTime, d = i.animationType, p = n || o < r || !a && !s;
|
|
2591
|
+
if (!p) {
|
|
2592
|
+
var f = sa(e);
|
|
2593
|
+
f && Se(e, f, l, d);
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
function Uo(e, o, t) {
|
|
2597
|
+
var r = e.startCoords, i = e.setup, n = i.alignmentAnimation, a = n.sizeX, s = n.sizeY;
|
|
2598
|
+
if (r) {
|
|
2599
|
+
var l = ua(e, o, t), d = l.x, p = l.y, f = Ot(e, a), c = Ot(e, s);
|
|
2600
|
+
va(e, { x: d, y: p }), la(e, d, p, f, c);
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
function ha(e) {
|
|
2604
|
+
if (e.isPanning) {
|
|
2605
|
+
var o = e.setup.panning.velocityDisabled, t = e.velocity, r = e.wrapperComponent, i = e.contentComponent;
|
|
2606
|
+
e.isPanning = !1, e.animate = !1, e.animation = null;
|
|
2607
|
+
var n = r == null ? void 0 : r.getBoundingClientRect(), a = i == null ? void 0 : i.getBoundingClientRect(), s = (n == null ? void 0 : n.width) || 0, l = (n == null ? void 0 : n.height) || 0, d = (a == null ? void 0 : a.width) || 0, p = (a == null ? void 0 : a.height) || 0, f = s < d || l < p, c = !o && t && (t == null ? void 0 : t.total) > 0.1 && f;
|
|
2608
|
+
c ? ma(e) : gr(e);
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
function po(e, o, t, r) {
|
|
2612
|
+
var i = e.setup, n = i.minScale, a = i.maxScale, s = i.limitToBounds, l = it(te(o, 2), n, a, 0, !1), d = ke(e, l), p = Bt(e, t, r, l, d, s), f = p.x, c = p.y;
|
|
2613
|
+
return { scale: l, positionX: f, positionY: c };
|
|
2614
|
+
}
|
|
2615
|
+
function br(e, o, t) {
|
|
2616
|
+
var r = e.transformState.scale, i = e.wrapperComponent, n = e.setup, a = n.minScale, s = n.limitToBounds, l = n.zoomAnimation, d = l.disabled, p = l.animationTime, f = l.animationType, c = d || r >= a;
|
|
2617
|
+
if ((r >= 1 || s) && gr(e), !(c || !i || !e.mounted)) {
|
|
2618
|
+
var v = o || i.offsetWidth / 2, h = t || i.offsetHeight / 2, m = po(e, a, v, h);
|
|
2619
|
+
m && Se(e, m, p, f);
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
var Te = function() {
|
|
2623
|
+
return Te = Object.assign || function(o) {
|
|
2624
|
+
for (var t, r = 1, i = arguments.length; r < i; r++) {
|
|
2625
|
+
t = arguments[r];
|
|
2626
|
+
for (var n in t)
|
|
2627
|
+
Object.prototype.hasOwnProperty.call(t, n) && (o[n] = t[n]);
|
|
2628
|
+
}
|
|
2629
|
+
return o;
|
|
2630
|
+
}, Te.apply(this, arguments);
|
|
2631
|
+
};
|
|
2632
|
+
function qo(e, o, t) {
|
|
2633
|
+
if (t || arguments.length === 2)
|
|
2634
|
+
for (var r = 0, i = o.length, n; r < i; r++)
|
|
2635
|
+
(n || !(r in o)) && (n || (n = Array.prototype.slice.call(o, 0, r)), n[r] = o[r]);
|
|
2636
|
+
return e.concat(n || Array.prototype.slice.call(o));
|
|
2637
|
+
}
|
|
2638
|
+
var gt = {
|
|
2639
|
+
previousScale: 1,
|
|
2640
|
+
scale: 1,
|
|
2641
|
+
positionX: 0,
|
|
2642
|
+
positionY: 0
|
|
2643
|
+
}, Qe = {
|
|
2644
|
+
disabled: !1,
|
|
2645
|
+
minPositionX: null,
|
|
2646
|
+
maxPositionX: null,
|
|
2647
|
+
minPositionY: null,
|
|
2648
|
+
maxPositionY: null,
|
|
2649
|
+
minScale: 1,
|
|
2650
|
+
maxScale: 8,
|
|
2651
|
+
limitToBounds: !0,
|
|
2652
|
+
centerZoomedOut: !1,
|
|
2653
|
+
centerOnInit: !1,
|
|
2654
|
+
disablePadding: !1,
|
|
2655
|
+
smooth: !0,
|
|
2656
|
+
wheel: {
|
|
2657
|
+
step: 0.2,
|
|
2658
|
+
disabled: !1,
|
|
2659
|
+
smoothStep: 1e-3,
|
|
2660
|
+
wheelDisabled: !1,
|
|
2661
|
+
touchPadDisabled: !1,
|
|
2662
|
+
activationKeys: [],
|
|
2663
|
+
excluded: []
|
|
2664
|
+
},
|
|
2665
|
+
panning: {
|
|
2666
|
+
disabled: !1,
|
|
2667
|
+
velocityDisabled: !1,
|
|
2668
|
+
lockAxisX: !1,
|
|
2669
|
+
lockAxisY: !1,
|
|
2670
|
+
activationKeys: [],
|
|
2671
|
+
excluded: []
|
|
2672
|
+
},
|
|
2673
|
+
pinch: {
|
|
2674
|
+
step: 5,
|
|
2675
|
+
disabled: !1,
|
|
2676
|
+
excluded: []
|
|
2677
|
+
},
|
|
2678
|
+
doubleClick: {
|
|
2679
|
+
disabled: !1,
|
|
2680
|
+
step: 0.7,
|
|
2681
|
+
mode: "zoomIn",
|
|
2682
|
+
animationType: "easeOut",
|
|
2683
|
+
animationTime: 200,
|
|
2684
|
+
excluded: []
|
|
2685
|
+
},
|
|
2686
|
+
zoomAnimation: {
|
|
2687
|
+
disabled: !1,
|
|
2688
|
+
size: 0.4,
|
|
2689
|
+
animationTime: 200,
|
|
2690
|
+
animationType: "easeOut"
|
|
2691
|
+
},
|
|
2692
|
+
alignmentAnimation: {
|
|
2693
|
+
disabled: !1,
|
|
2694
|
+
sizeX: 100,
|
|
2695
|
+
sizeY: 100,
|
|
2696
|
+
animationTime: 200,
|
|
2697
|
+
velocityAlignmentTime: 400,
|
|
2698
|
+
animationType: "easeOut"
|
|
2699
|
+
},
|
|
2700
|
+
velocityAnimation: {
|
|
2701
|
+
disabled: !1,
|
|
2702
|
+
sensitivity: 1,
|
|
2703
|
+
animationTime: 400,
|
|
2704
|
+
animationType: "easeOut",
|
|
2705
|
+
equalToMove: !0
|
|
2706
|
+
}
|
|
2707
|
+
}, yr = function(e) {
|
|
2708
|
+
var o, t, r, i;
|
|
2709
|
+
return {
|
|
2710
|
+
previousScale: (o = e.initialScale) !== null && o !== void 0 ? o : gt.scale,
|
|
2711
|
+
scale: (t = e.initialScale) !== null && t !== void 0 ? t : gt.scale,
|
|
2712
|
+
positionX: (r = e.initialPositionX) !== null && r !== void 0 ? r : gt.positionX,
|
|
2713
|
+
positionY: (i = e.initialPositionY) !== null && i !== void 0 ? i : gt.positionY
|
|
2714
|
+
};
|
|
2715
|
+
}, Ko = function(e) {
|
|
2716
|
+
var o = Te({}, Qe);
|
|
2717
|
+
return Object.keys(e).forEach(function(t) {
|
|
2718
|
+
var r = typeof e[t] < "u", i = typeof Qe[t] < "u";
|
|
2719
|
+
if (i && r) {
|
|
2720
|
+
var n = Object.prototype.toString.call(Qe[t]), a = n === "[object Object]", s = n === "[object Array]";
|
|
2721
|
+
a ? o[t] = Te(Te({}, Qe[t]), e[t]) : s ? o[t] = qo(qo([], Qe[t], !0), e[t], !0) : o[t] = e[t];
|
|
2722
|
+
}
|
|
2723
|
+
}), o;
|
|
2724
|
+
}, wr = function(e, o, t) {
|
|
2725
|
+
var r = e.transformState.scale, i = e.wrapperComponent, n = e.setup, a = n.maxScale, s = n.minScale, l = n.zoomAnimation, d = n.smooth, p = l.size;
|
|
2726
|
+
if (!i)
|
|
2727
|
+
throw new Error("Wrapper is not mounted");
|
|
2728
|
+
var f = d ? r * Math.exp(o * t) : r + o * t, c = it(te(f, 3), s, a, p, !1);
|
|
2729
|
+
return c;
|
|
2730
|
+
};
|
|
2731
|
+
function Pr(e, o, t, r, i) {
|
|
2732
|
+
var n = e.wrapperComponent, a = e.transformState, s = a.scale, l = a.positionX, d = a.positionY;
|
|
2733
|
+
if (!n)
|
|
2734
|
+
return console.error("No WrapperComponent found");
|
|
2735
|
+
var p = n.offsetWidth, f = n.offsetHeight, c = (p / 2 - l) / s, v = (f / 2 - d) / s, h = wr(e, o, t), m = po(e, h, c, v);
|
|
2736
|
+
if (!m)
|
|
2737
|
+
return console.error("Error during zoom event. New transformation state was not calculated.");
|
|
2738
|
+
Se(e, m, r, i);
|
|
2739
|
+
}
|
|
2740
|
+
function Tr(e, o, t, r) {
|
|
2741
|
+
var i = e.setup, n = e.wrapperComponent, a = i.limitToBounds, s = yr(e.props), l = e.transformState, d = l.scale, p = l.positionX, f = l.positionY;
|
|
2742
|
+
if (n) {
|
|
2743
|
+
var c = uo(e, s.scale), v = Nt(s.positionX, s.positionY, c, a, 0, 0, n), h = {
|
|
2744
|
+
scale: s.scale,
|
|
2745
|
+
positionX: v.x,
|
|
2746
|
+
positionY: v.y
|
|
2747
|
+
};
|
|
2748
|
+
d === s.scale && p === s.positionX && f === s.positionY || (r == null || r(), Se(e, h, o, t));
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
function ga(e, o, t, r) {
|
|
2752
|
+
var i = e.getBoundingClientRect(), n = o.getBoundingClientRect(), a = t.getBoundingClientRect(), s = n.x * r.scale, l = n.y * r.scale;
|
|
2753
|
+
return {
|
|
2754
|
+
x: (i.x - a.x + s) / r.scale,
|
|
2755
|
+
y: (i.y - a.y + l) / r.scale
|
|
2756
|
+
};
|
|
2757
|
+
}
|
|
2758
|
+
function ba(e, o, t) {
|
|
2759
|
+
var r = e.wrapperComponent, i = e.contentComponent, n = e.transformState, a = e.setup, s = a.limitToBounds, l = a.minScale, d = a.maxScale;
|
|
2760
|
+
if (!r || !i)
|
|
2761
|
+
return n;
|
|
2762
|
+
var p = r.getBoundingClientRect(), f = o.getBoundingClientRect(), c = ga(o, r, i, n), v = c.x, h = c.y, m = f.width / n.scale, g = f.height / n.scale, P = r.offsetWidth / m, C = r.offsetHeight / g, y = it(t || Math.min(P, C), l, d, 0, !1), b = (p.width - m * y) / 2, w = (p.height - g * y) / 2, T = (p.left - v) * y + b, O = (p.top - h) * y + w, x = uo(e, y), E = Nt(T, O, x, s, 0, 0, r), A = E.x, M = E.y;
|
|
2763
|
+
return { positionX: A, positionY: M, scale: y };
|
|
2764
|
+
}
|
|
2765
|
+
var ya = function(e) {
|
|
2766
|
+
return function(o, t, r) {
|
|
2767
|
+
o === void 0 && (o = 0.5), t === void 0 && (t = 300), r === void 0 && (r = "easeOut"), Pr(e, 1, o, t, r);
|
|
2768
|
+
};
|
|
2769
|
+
}, wa = function(e) {
|
|
2770
|
+
return function(o, t, r) {
|
|
2771
|
+
o === void 0 && (o = 0.5), t === void 0 && (t = 300), r === void 0 && (r = "easeOut"), Pr(e, -1, o, t, r);
|
|
2772
|
+
};
|
|
2773
|
+
}, Pa = function(e) {
|
|
2774
|
+
return function(o, t, r, i, n) {
|
|
2775
|
+
i === void 0 && (i = 300), n === void 0 && (n = "easeOut");
|
|
2776
|
+
var a = e.transformState, s = a.positionX, l = a.positionY, d = a.scale, p = e.wrapperComponent, f = e.contentComponent, c = e.setup.disabled;
|
|
2777
|
+
if (!(c || !p || !f)) {
|
|
2778
|
+
var v = {
|
|
2779
|
+
positionX: Number.isNaN(o) ? s : o,
|
|
2780
|
+
positionY: Number.isNaN(t) ? l : t,
|
|
2781
|
+
scale: Number.isNaN(r) ? d : r
|
|
2782
|
+
};
|
|
2783
|
+
Se(e, v, i, n);
|
|
2784
|
+
}
|
|
2785
|
+
};
|
|
2786
|
+
}, Ta = function(e) {
|
|
2787
|
+
return function(o, t) {
|
|
2788
|
+
o === void 0 && (o = 200), t === void 0 && (t = "easeOut"), Tr(e, o, t);
|
|
2789
|
+
};
|
|
2790
|
+
}, Ca = function(e) {
|
|
2791
|
+
return function(o, t, r) {
|
|
2792
|
+
t === void 0 && (t = 200), r === void 0 && (r = "easeOut");
|
|
2793
|
+
var i = e.transformState, n = e.wrapperComponent, a = e.contentComponent;
|
|
2794
|
+
if (n && a) {
|
|
2795
|
+
var s = Cr(o || i.scale, n, a);
|
|
2796
|
+
Se(e, s, t, r);
|
|
2797
|
+
}
|
|
2798
|
+
};
|
|
2799
|
+
}, Sa = function(e) {
|
|
2800
|
+
return function(o, t, r, i) {
|
|
2801
|
+
r === void 0 && (r = 600), i === void 0 && (i = "easeOut"), de(e);
|
|
2802
|
+
var n = e.wrapperComponent, a = typeof o == "string" ? document.getElementById(o) : o;
|
|
2803
|
+
if (n && a && n.contains(a)) {
|
|
2804
|
+
var s = ba(e, a, t);
|
|
2805
|
+
Se(e, s, r, i);
|
|
2806
|
+
}
|
|
2807
|
+
};
|
|
2808
|
+
}, Et = function(e) {
|
|
2809
|
+
return {
|
|
2810
|
+
instance: e,
|
|
2811
|
+
zoomIn: ya(e),
|
|
2812
|
+
zoomOut: wa(e),
|
|
2813
|
+
setTransform: Pa(e),
|
|
2814
|
+
resetTransform: Ta(e),
|
|
2815
|
+
centerView: Ca(e),
|
|
2816
|
+
zoomToElement: Sa(e)
|
|
2817
|
+
};
|
|
2818
|
+
}, Oa = function(e) {
|
|
2819
|
+
return {
|
|
2820
|
+
instance: e,
|
|
2821
|
+
state: e.transformState
|
|
2822
|
+
};
|
|
2823
|
+
}, Y = function(e) {
|
|
2824
|
+
var o = {};
|
|
2825
|
+
return Object.assign(o, Oa(e)), Object.assign(o, Et(e)), o;
|
|
2826
|
+
}, Ht = !1;
|
|
2827
|
+
function Ft() {
|
|
2828
|
+
try {
|
|
2829
|
+
var e = {
|
|
2830
|
+
get passive() {
|
|
2831
|
+
return Ht = !0, !1;
|
|
2832
|
+
}
|
|
2833
|
+
};
|
|
2834
|
+
return e;
|
|
2835
|
+
} catch {
|
|
2836
|
+
return Ht = !1, Ht;
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
var zt = function(e, o) {
|
|
2840
|
+
var t = e.tagName.toUpperCase(), r = o.find(function(n) {
|
|
2841
|
+
return n.toUpperCase() === t;
|
|
2842
|
+
});
|
|
2843
|
+
if (r)
|
|
2844
|
+
return !0;
|
|
2845
|
+
var i = o.find(function(n) {
|
|
2846
|
+
return e.classList.contains(n);
|
|
2847
|
+
});
|
|
2848
|
+
return !!i;
|
|
2849
|
+
}, Qt = function(e) {
|
|
2850
|
+
e && clearTimeout(e);
|
|
2851
|
+
}, Ea = function(e, o, t) {
|
|
2852
|
+
return "translate(".concat(e, "px, ").concat(o, "px) scale(").concat(t, ")");
|
|
2853
|
+
}, Cr = function(e, o, t) {
|
|
2854
|
+
var r = t.offsetWidth * e, i = t.offsetHeight * e, n = (o.offsetWidth - r) / 2, a = (o.offsetHeight - i) / 2;
|
|
2855
|
+
return {
|
|
2856
|
+
scale: e,
|
|
2857
|
+
positionX: n,
|
|
2858
|
+
positionY: a
|
|
2859
|
+
};
|
|
2860
|
+
};
|
|
2861
|
+
function Aa(e) {
|
|
2862
|
+
return function(o) {
|
|
2863
|
+
e.forEach(function(t) {
|
|
2864
|
+
typeof t == "function" ? t(o) : t != null && (t.current = o);
|
|
2865
|
+
});
|
|
2866
|
+
};
|
|
2867
|
+
}
|
|
2868
|
+
var Ra = function(e, o) {
|
|
2869
|
+
var t = e.setup.wheel, r = t.disabled, i = t.wheelDisabled, n = t.touchPadDisabled, a = t.excluded, s = e.isInitialized, l = e.isPanning, d = o.target, p = s && !l && !r && d;
|
|
2870
|
+
if (!p || i && !o.ctrlKey || n && o.ctrlKey)
|
|
2871
|
+
return !1;
|
|
2872
|
+
var f = zt(d, a);
|
|
2873
|
+
return !f;
|
|
2874
|
+
}, Da = function(e) {
|
|
2875
|
+
return e ? e.deltaY < 0 ? 1 : -1 : 0;
|
|
2876
|
+
};
|
|
2877
|
+
function xa(e, o) {
|
|
2878
|
+
var t = Da(e), r = jn(o, t);
|
|
2879
|
+
return r;
|
|
2880
|
+
}
|
|
2881
|
+
function Sr(e, o, t) {
|
|
2882
|
+
var r = o.getBoundingClientRect(), i = 0, n = 0;
|
|
2883
|
+
if ("clientX" in e)
|
|
2884
|
+
i = (e.clientX - r.left) / t, n = (e.clientY - r.top) / t;
|
|
2885
|
+
else {
|
|
2886
|
+
var a = e.touches[0];
|
|
2887
|
+
i = (a.clientX - r.left) / t, n = (a.clientY - r.top) / t;
|
|
2888
|
+
}
|
|
2889
|
+
return (Number.isNaN(i) || Number.isNaN(n)) && console.error("No mouse or touch offset found"), {
|
|
2890
|
+
x: i,
|
|
2891
|
+
y: n
|
|
2892
|
+
};
|
|
2893
|
+
}
|
|
2894
|
+
var Ma = function(e, o, t, r, i) {
|
|
2895
|
+
var n = e.transformState.scale, a = e.wrapperComponent, s = e.setup, l = s.maxScale, d = s.minScale, p = s.zoomAnimation, f = s.disablePadding, c = p.size, v = p.disabled;
|
|
2896
|
+
if (!a)
|
|
2897
|
+
throw new Error("Wrapper is not mounted");
|
|
2898
|
+
var h = n + o * t;
|
|
2899
|
+
if (i)
|
|
2900
|
+
return h;
|
|
2901
|
+
var m = r ? !1 : !v, g = it(te(h, 3), d, l, c, m && !f);
|
|
2902
|
+
return g;
|
|
2903
|
+
}, Ya = function(e, o) {
|
|
2904
|
+
var t = e.previousWheelEvent, r = e.transformState.scale, i = e.setup, n = i.maxScale, a = i.minScale;
|
|
2905
|
+
return t ? r < n || r > a || Math.sign(t.deltaY) !== Math.sign(o.deltaY) || t.deltaY > 0 && t.deltaY < o.deltaY || t.deltaY < 0 && t.deltaY > o.deltaY || Math.sign(t.deltaY) !== Math.sign(o.deltaY) : !1;
|
|
2906
|
+
}, _a = function(e, o) {
|
|
2907
|
+
var t = e.setup.pinch, r = t.disabled, i = t.excluded, n = e.isInitialized, a = o.target, s = n && !r && a;
|
|
2908
|
+
if (!s)
|
|
2909
|
+
return !1;
|
|
2910
|
+
var l = zt(a, i);
|
|
2911
|
+
return !l;
|
|
2912
|
+
}, Na = function(e) {
|
|
2913
|
+
var o = e.setup.pinch.disabled, t = e.isInitialized, r = e.pinchStartDistance, i = t && !o && r;
|
|
2914
|
+
return !!i;
|
|
2915
|
+
}, Ba = function(e, o, t) {
|
|
2916
|
+
var r = t.getBoundingClientRect(), i = e.touches, n = te(i[0].clientX - r.left, 5), a = te(i[0].clientY - r.top, 5), s = te(i[1].clientX - r.left, 5), l = te(i[1].clientY - r.top, 5);
|
|
2917
|
+
return {
|
|
2918
|
+
x: (n + s) / 2 / o,
|
|
2919
|
+
y: (a + l) / 2 / o
|
|
2920
|
+
};
|
|
2921
|
+
}, Or = function(e) {
|
|
2922
|
+
return Math.sqrt(Math.pow(e.touches[0].pageX - e.touches[1].pageX, 2) + Math.pow(e.touches[0].pageY - e.touches[1].pageY, 2));
|
|
2923
|
+
}, za = function(e, o) {
|
|
2924
|
+
var t = e.pinchStartScale, r = e.pinchStartDistance, i = e.setup, n = i.maxScale, a = i.minScale, s = i.zoomAnimation, l = i.disablePadding, d = s.size, p = s.disabled;
|
|
2925
|
+
if (!t || r === null || !o)
|
|
2926
|
+
throw new Error("Pinch touches distance was not provided");
|
|
2927
|
+
if (o < 0)
|
|
2928
|
+
return e.transformState.scale;
|
|
2929
|
+
var f = o / r, c = f * t;
|
|
2930
|
+
return it(te(c, 2), a, n, d, !p && !l);
|
|
2931
|
+
}, Xa = 160, Wa = 100, $a = function(e, o) {
|
|
2932
|
+
var t = e.props, r = t.onWheelStart, i = t.onZoomStart;
|
|
2933
|
+
e.wheelStopEventTimer || (de(e), z(Y(e), o, r), z(Y(e), o, i));
|
|
2934
|
+
}, ka = function(e, o) {
|
|
2935
|
+
var t = e.props, r = t.onWheel, i = t.onZoom, n = e.contentComponent, a = e.setup, s = e.transformState, l = s.scale, d = a.limitToBounds, p = a.centerZoomedOut, f = a.zoomAnimation, c = a.wheel, v = a.disablePadding, h = a.smooth, m = f.size, g = f.disabled, P = c.step, C = c.smoothStep;
|
|
2936
|
+
if (!n)
|
|
2937
|
+
throw new Error("Component not mounted");
|
|
2938
|
+
o.preventDefault(), o.stopPropagation();
|
|
2939
|
+
var y = xa(o, null), b = h ? C * Math.abs(o.deltaY) : P, w = Ma(e, y, b, !o.ctrlKey);
|
|
2940
|
+
if (l !== w) {
|
|
2941
|
+
var T = ke(e, w), O = Sr(o, n, l), x = g || m === 0 || p || v, E = d && x, A = Bt(e, O.x, O.y, w, T, E), M = A.x, X = A.y;
|
|
2942
|
+
e.previousWheelEvent = o, e.setTransformState(w, M, X), z(Y(e), o, r), z(Y(e), o, i);
|
|
2943
|
+
}
|
|
2944
|
+
}, ja = function(e, o) {
|
|
2945
|
+
var t = e.props, r = t.onWheelStop, i = t.onZoomStop;
|
|
2946
|
+
Qt(e.wheelAnimationTimer), e.wheelAnimationTimer = setTimeout(function() {
|
|
2947
|
+
e.mounted && (br(e, o.x, o.y), e.wheelAnimationTimer = null);
|
|
2948
|
+
}, Wa);
|
|
2949
|
+
var n = Ya(e, o);
|
|
2950
|
+
n && (Qt(e.wheelStopEventTimer), e.wheelStopEventTimer = setTimeout(function() {
|
|
2951
|
+
e.mounted && (e.wheelStopEventTimer = null, z(Y(e), o, r), z(Y(e), o, i));
|
|
2952
|
+
}, Xa));
|
|
2953
|
+
}, La = function(e, o) {
|
|
2954
|
+
var t = Or(o);
|
|
2955
|
+
e.pinchStartDistance = t, e.lastDistance = t, e.pinchStartScale = e.transformState.scale, e.isPanning = !1, de(e);
|
|
2956
|
+
}, Va = function(e, o) {
|
|
2957
|
+
var t = e.contentComponent, r = e.pinchStartDistance, i = e.transformState.scale, n = e.setup, a = n.limitToBounds, s = n.centerZoomedOut, l = n.zoomAnimation, d = l.disabled, p = l.size;
|
|
2958
|
+
if (!(r === null || !t)) {
|
|
2959
|
+
var f = Ba(o, i, t);
|
|
2960
|
+
if (!(!Number.isFinite(f.x) || !Number.isFinite(f.y))) {
|
|
2961
|
+
var c = Or(o), v = za(e, c);
|
|
2962
|
+
if (v !== i) {
|
|
2963
|
+
var h = ke(e, v), m = d || p === 0 || s, g = a && m, P = Bt(e, f.x, f.y, v, h, g), C = P.x, y = P.y;
|
|
2964
|
+
e.pinchMidpoint = f, e.lastDistance = c, e.setTransformState(v, C, y);
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
}
|
|
2968
|
+
}, Ha = function(e) {
|
|
2969
|
+
var o = e.pinchMidpoint;
|
|
2970
|
+
e.velocity = null, e.lastDistance = null, e.pinchMidpoint = null, e.pinchStartScale = null, e.pinchStartDistance = null, br(e, o == null ? void 0 : o.x, o == null ? void 0 : o.y);
|
|
2971
|
+
}, Er = function(e, o) {
|
|
2972
|
+
var t = e.props.onZoomStop, r = e.setup.doubleClick.animationTime;
|
|
2973
|
+
Qt(e.doubleClickStopEventTimer), e.doubleClickStopEventTimer = setTimeout(function() {
|
|
2974
|
+
e.doubleClickStopEventTimer = null, z(Y(e), o, t);
|
|
2975
|
+
}, r);
|
|
2976
|
+
}, Fa = function(e, o) {
|
|
2977
|
+
var t = e.props, r = t.onZoomStart, i = t.onZoom, n = e.setup.doubleClick, a = n.animationTime, s = n.animationType;
|
|
2978
|
+
z(Y(e), o, r), Tr(e, a, s, function() {
|
|
2979
|
+
return z(Y(e), o, i);
|
|
2980
|
+
}), Er(e, o);
|
|
2981
|
+
};
|
|
2982
|
+
function Za(e, o) {
|
|
2983
|
+
var t = e.setup, r = e.doubleClickStopEventTimer, i = e.transformState, n = e.contentComponent, a = i.scale, s = e.props, l = s.onZoomStart, d = s.onZoom, p = t.doubleClick, f = p.disabled, c = p.mode, v = p.step, h = p.animationTime, m = p.animationType;
|
|
2984
|
+
if (!f && !r) {
|
|
2985
|
+
if (c === "reset")
|
|
2986
|
+
return Fa(e, o);
|
|
2987
|
+
if (!n)
|
|
2988
|
+
return console.error("No ContentComponent found");
|
|
2989
|
+
var g = c === "zoomOut" ? -1 : 1, P = wr(e, g, v);
|
|
2990
|
+
if (a !== P) {
|
|
2991
|
+
z(Y(e), o, l);
|
|
2992
|
+
var C = Sr(o, n, a), y = po(e, P, C.x, C.y);
|
|
2993
|
+
if (!y)
|
|
2994
|
+
return console.error("Error during zoom event. New transformation state was not calculated.");
|
|
2995
|
+
z(Y(e), o, d), Se(e, y, h, m), Er(e, o);
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
var Ua = function(e, o) {
|
|
3000
|
+
var t = e.isInitialized, r = e.setup, i = e.wrapperComponent, n = r.doubleClick, a = n.disabled, s = n.excluded, l = o.target, d = i == null ? void 0 : i.contains(l), p = t && l && d && !a;
|
|
3001
|
+
if (!p)
|
|
3002
|
+
return !1;
|
|
3003
|
+
var f = zt(l, s);
|
|
3004
|
+
return !f;
|
|
3005
|
+
}, qa = (
|
|
3006
|
+
/** @class */
|
|
3007
|
+
function() {
|
|
3008
|
+
function e(o) {
|
|
3009
|
+
var t = this;
|
|
3010
|
+
this.mounted = !0, this.onChangeCallbacks = /* @__PURE__ */ new Set(), this.onInitCallbacks = /* @__PURE__ */ new Set(), this.wrapperComponent = null, this.contentComponent = null, this.isInitialized = !1, this.bounds = null, this.previousWheelEvent = null, this.wheelStopEventTimer = null, this.wheelAnimationTimer = null, this.isPanning = !1, this.startCoords = null, this.lastTouch = null, this.distance = null, this.lastDistance = null, this.pinchStartDistance = null, this.pinchStartScale = null, this.pinchMidpoint = null, this.doubleClickStopEventTimer = null, this.velocity = null, this.velocityTime = null, this.lastMousePosition = null, this.animate = !1, this.animation = null, this.maxBounds = null, this.pressedKeys = {}, this.mount = function() {
|
|
3011
|
+
t.initializeWindowEvents();
|
|
3012
|
+
}, this.unmount = function() {
|
|
3013
|
+
t.cleanupWindowEvents();
|
|
3014
|
+
}, this.update = function(r) {
|
|
3015
|
+
ke(t, t.transformState.scale), t.setup = Ko(r);
|
|
3016
|
+
}, this.initializeWindowEvents = function() {
|
|
3017
|
+
var r, i = Ft(), n = (r = t.wrapperComponent) === null || r === void 0 ? void 0 : r.ownerDocument, a = n == null ? void 0 : n.defaultView;
|
|
3018
|
+
a == null || a.addEventListener("mousedown", t.onPanningStart, i), a == null || a.addEventListener("mousemove", t.onPanning, i), a == null || a.addEventListener("mouseup", t.onPanningStop, i), n == null || n.addEventListener("mouseleave", t.clearPanning, i), a == null || a.addEventListener("keyup", t.setKeyUnPressed, i), a == null || a.addEventListener("keydown", t.setKeyPressed, i);
|
|
3019
|
+
}, this.cleanupWindowEvents = function() {
|
|
3020
|
+
var r, i, n = Ft(), a = (r = t.wrapperComponent) === null || r === void 0 ? void 0 : r.ownerDocument, s = a == null ? void 0 : a.defaultView;
|
|
3021
|
+
s == null || s.removeEventListener("mousedown", t.onPanningStart, n), s == null || s.removeEventListener("mousemove", t.onPanning, n), s == null || s.removeEventListener("mouseup", t.onPanningStop, n), a == null || a.removeEventListener("mouseleave", t.clearPanning, n), s == null || s.removeEventListener("keyup", t.setKeyUnPressed, n), s == null || s.removeEventListener("keydown", t.setKeyPressed, n), document.removeEventListener("mouseleave", t.clearPanning, n), de(t), (i = t.observer) === null || i === void 0 || i.disconnect();
|
|
3022
|
+
}, this.handleInitializeWrapperEvents = function(r) {
|
|
3023
|
+
var i = Ft();
|
|
3024
|
+
r.addEventListener("wheel", t.onWheelZoom, i), r.addEventListener("dblclick", t.onDoubleClick, i), r.addEventListener("touchstart", t.onTouchPanningStart, i), r.addEventListener("touchmove", t.onTouchPanning, i), r.addEventListener("touchend", t.onTouchPanningStop, i);
|
|
3025
|
+
}, this.handleInitialize = function(r) {
|
|
3026
|
+
var i = t.setup.centerOnInit;
|
|
3027
|
+
t.applyTransformation(), t.onInitCallbacks.forEach(function(n) {
|
|
3028
|
+
return n(Y(t));
|
|
3029
|
+
}), i && (t.setCenter(), t.observer = new ResizeObserver(function() {
|
|
3030
|
+
var n;
|
|
3031
|
+
t.onInitCallbacks.forEach(function(a) {
|
|
3032
|
+
return a(Y(t));
|
|
3033
|
+
}), t.setCenter(), (n = t.observer) === null || n === void 0 || n.disconnect();
|
|
3034
|
+
}), t.observer.observe(r));
|
|
3035
|
+
}, this.onWheelZoom = function(r) {
|
|
3036
|
+
var i = t.setup.disabled;
|
|
3037
|
+
if (!i) {
|
|
3038
|
+
var n = Ra(t, r);
|
|
3039
|
+
if (n) {
|
|
3040
|
+
var a = t.isPressingKeys(t.setup.wheel.activationKeys);
|
|
3041
|
+
a && ($a(t, r), ka(t, r), ja(t, r));
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
}, this.onPanningStart = function(r) {
|
|
3045
|
+
var i = t.setup.disabled, n = t.props.onPanningStart;
|
|
3046
|
+
if (!i) {
|
|
3047
|
+
var a = Vo(t, r);
|
|
3048
|
+
if (a) {
|
|
3049
|
+
var s = t.isPressingKeys(t.setup.panning.activationKeys);
|
|
3050
|
+
s && (r.preventDefault(), r.stopPropagation(), de(t), Zo(t, r), z(Y(t), r, n));
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
}, this.onPanning = function(r) {
|
|
3054
|
+
var i = t.setup.disabled, n = t.props.onPanning;
|
|
3055
|
+
if (!i) {
|
|
3056
|
+
var a = Ho(t);
|
|
3057
|
+
if (a) {
|
|
3058
|
+
var s = t.isPressingKeys(t.setup.panning.activationKeys);
|
|
3059
|
+
s && (r.preventDefault(), r.stopPropagation(), Uo(t, r.clientX, r.clientY), z(Y(t), r, n));
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
}, this.onPanningStop = function(r) {
|
|
3063
|
+
var i = t.props.onPanningStop;
|
|
3064
|
+
t.isPanning && (ha(t), z(Y(t), r, i));
|
|
3065
|
+
}, this.onPinchStart = function(r) {
|
|
3066
|
+
var i = t.setup.disabled, n = t.props, a = n.onPinchingStart, s = n.onZoomStart;
|
|
3067
|
+
if (!i) {
|
|
3068
|
+
var l = _a(t, r);
|
|
3069
|
+
l && (La(t, r), de(t), z(Y(t), r, a), z(Y(t), r, s));
|
|
3070
|
+
}
|
|
3071
|
+
}, this.onPinch = function(r) {
|
|
3072
|
+
var i = t.setup.disabled, n = t.props, a = n.onPinching, s = n.onZoom;
|
|
3073
|
+
if (!i) {
|
|
3074
|
+
var l = Na(t);
|
|
3075
|
+
l && (r.preventDefault(), r.stopPropagation(), Va(t, r), z(Y(t), r, a), z(Y(t), r, s));
|
|
3076
|
+
}
|
|
3077
|
+
}, this.onPinchStop = function(r) {
|
|
3078
|
+
var i = t.props, n = i.onPinchingStop, a = i.onZoomStop;
|
|
3079
|
+
t.pinchStartScale && (Ha(t), z(Y(t), r, n), z(Y(t), r, a));
|
|
3080
|
+
}, this.onTouchPanningStart = function(r) {
|
|
3081
|
+
var i = t.setup.disabled, n = t.props.onPanningStart;
|
|
3082
|
+
if (!i) {
|
|
3083
|
+
var a = Vo(t, r);
|
|
3084
|
+
if (a) {
|
|
3085
|
+
var s = t.lastTouch && +/* @__PURE__ */ new Date() - t.lastTouch < 200;
|
|
3086
|
+
if (s && r.touches.length === 1)
|
|
3087
|
+
t.onDoubleClick(r);
|
|
3088
|
+
else {
|
|
3089
|
+
t.lastTouch = +/* @__PURE__ */ new Date(), de(t);
|
|
3090
|
+
var l = r.touches, d = l.length === 1, p = l.length === 2;
|
|
3091
|
+
d && (de(t), Zo(t, r), z(Y(t), r, n)), p && t.onPinchStart(r);
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
}, this.onTouchPanning = function(r) {
|
|
3096
|
+
var i = t.setup.disabled, n = t.props.onPanning;
|
|
3097
|
+
if (t.isPanning && r.touches.length === 1) {
|
|
3098
|
+
if (i)
|
|
3099
|
+
return;
|
|
3100
|
+
var a = Ho(t);
|
|
3101
|
+
if (!a)
|
|
3102
|
+
return;
|
|
3103
|
+
r.preventDefault(), r.stopPropagation();
|
|
3104
|
+
var s = r.touches[0];
|
|
3105
|
+
Uo(t, s.clientX, s.clientY), z(Y(t), r, n);
|
|
3106
|
+
} else
|
|
3107
|
+
r.touches.length > 1 && t.onPinch(r);
|
|
3108
|
+
}, this.onTouchPanningStop = function(r) {
|
|
3109
|
+
t.onPanningStop(r), t.onPinchStop(r);
|
|
3110
|
+
}, this.onDoubleClick = function(r) {
|
|
3111
|
+
var i = t.setup.disabled;
|
|
3112
|
+
if (!i) {
|
|
3113
|
+
var n = Ua(t, r);
|
|
3114
|
+
n && Za(t, r);
|
|
3115
|
+
}
|
|
3116
|
+
}, this.clearPanning = function(r) {
|
|
3117
|
+
t.isPanning && t.onPanningStop(r);
|
|
3118
|
+
}, this.setKeyPressed = function(r) {
|
|
3119
|
+
t.pressedKeys[r.key] = !0;
|
|
3120
|
+
}, this.setKeyUnPressed = function(r) {
|
|
3121
|
+
t.pressedKeys[r.key] = !1;
|
|
3122
|
+
}, this.isPressingKeys = function(r) {
|
|
3123
|
+
return r.length ? !!r.find(function(i) {
|
|
3124
|
+
return t.pressedKeys[i];
|
|
3125
|
+
}) : !0;
|
|
3126
|
+
}, this.setTransformState = function(r, i, n) {
|
|
3127
|
+
var a = t.props.onTransformed;
|
|
3128
|
+
if (!Number.isNaN(r) && !Number.isNaN(i) && !Number.isNaN(n)) {
|
|
3129
|
+
r !== t.transformState.scale && (t.transformState.previousScale = t.transformState.scale, t.transformState.scale = r), t.transformState.positionX = i, t.transformState.positionY = n, t.applyTransformation();
|
|
3130
|
+
var s = Y(t);
|
|
3131
|
+
t.onChangeCallbacks.forEach(function(l) {
|
|
3132
|
+
return l(s);
|
|
3133
|
+
}), z(s, { scale: r, positionX: i, positionY: n }, a);
|
|
3134
|
+
} else
|
|
3135
|
+
console.error("Detected NaN set state values");
|
|
3136
|
+
}, this.setCenter = function() {
|
|
3137
|
+
if (t.wrapperComponent && t.contentComponent) {
|
|
3138
|
+
var r = Cr(t.transformState.scale, t.wrapperComponent, t.contentComponent);
|
|
3139
|
+
t.setTransformState(r.scale, r.positionX, r.positionY);
|
|
3140
|
+
}
|
|
3141
|
+
}, this.handleTransformStyles = function(r, i, n) {
|
|
3142
|
+
return t.props.customTransform ? t.props.customTransform(r, i, n) : Ea(r, i, n);
|
|
3143
|
+
}, this.applyTransformation = function() {
|
|
3144
|
+
if (!(!t.mounted || !t.contentComponent)) {
|
|
3145
|
+
var r = t.transformState, i = r.scale, n = r.positionX, a = r.positionY, s = t.handleTransformStyles(n, a, i);
|
|
3146
|
+
t.contentComponent.style.transform = s;
|
|
3147
|
+
}
|
|
3148
|
+
}, this.getContext = function() {
|
|
3149
|
+
return Y(t);
|
|
3150
|
+
}, this.onChange = function(r) {
|
|
3151
|
+
return t.onChangeCallbacks.has(r) || t.onChangeCallbacks.add(r), function() {
|
|
3152
|
+
t.onChangeCallbacks.delete(r);
|
|
3153
|
+
};
|
|
3154
|
+
}, this.onInit = function(r) {
|
|
3155
|
+
return t.onInitCallbacks.has(r) || t.onInitCallbacks.add(r), function() {
|
|
3156
|
+
t.onInitCallbacks.delete(r);
|
|
3157
|
+
};
|
|
3158
|
+
}, this.init = function(r, i) {
|
|
3159
|
+
t.cleanupWindowEvents(), t.wrapperComponent = r, t.contentComponent = i, ke(t, t.transformState.scale), t.handleInitializeWrapperEvents(r), t.handleInitialize(i), t.initializeWindowEvents(), t.isInitialized = !0;
|
|
3160
|
+
var n = Y(t);
|
|
3161
|
+
z(n, void 0, t.props.onInit);
|
|
3162
|
+
}, this.props = o, this.setup = Ko(this.props), this.transformState = yr(this.props);
|
|
3163
|
+
}
|
|
3164
|
+
return e;
|
|
3165
|
+
}()
|
|
3166
|
+
), Xt = Re.createContext(null), Ka = function(e, o) {
|
|
3167
|
+
return typeof e == "function" ? e(o) : e;
|
|
3168
|
+
}, Ms = Re.forwardRef(function(e, o) {
|
|
3169
|
+
var t = Tt(new qa(e)).current, r = Ka(e.children, Et(t));
|
|
3170
|
+
return Ur(o, function() {
|
|
3171
|
+
return Et(t);
|
|
3172
|
+
}, [t]), Gt(function() {
|
|
3173
|
+
t.update(e);
|
|
3174
|
+
}, [t, e]), Re.createElement(Xt.Provider, { value: t }, r);
|
|
3175
|
+
});
|
|
3176
|
+
Re.forwardRef(function(e, o) {
|
|
3177
|
+
var t = Tt(null), r = Jt(Xt);
|
|
3178
|
+
return Gt(function() {
|
|
3179
|
+
return r.onChange(function(i) {
|
|
3180
|
+
if (t.current) {
|
|
3181
|
+
var n = 0, a = 0;
|
|
3182
|
+
t.current.style.transform = r.handleTransformStyles(n, a, 1 / i.instance.transformState.scale);
|
|
3183
|
+
}
|
|
3184
|
+
});
|
|
3185
|
+
}, [r]), Re.createElement("div", Te({}, e, { ref: Aa([t, o]) }));
|
|
3186
|
+
});
|
|
3187
|
+
function Qa(e, o) {
|
|
3188
|
+
o === void 0 && (o = {});
|
|
3189
|
+
var t = o.insertAt;
|
|
3190
|
+
if (!(!e || typeof document > "u")) {
|
|
3191
|
+
var r = document.head || document.getElementsByTagName("head")[0], i = document.createElement("style");
|
|
3192
|
+
i.type = "text/css", t === "top" && r.firstChild ? r.insertBefore(i, r.firstChild) : r.appendChild(i), i.styleSheet ? i.styleSheet.cssText = e : i.appendChild(document.createTextNode(e));
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
var Ga = `.transform-component-module_wrapper__SPB86 {
|
|
3196
|
+
position: relative;
|
|
3197
|
+
width: -moz-fit-content;
|
|
3198
|
+
width: fit-content;
|
|
3199
|
+
height: -moz-fit-content;
|
|
3200
|
+
height: fit-content;
|
|
3201
|
+
overflow: hidden;
|
|
3202
|
+
-webkit-touch-callout: none; /* iOS Safari */
|
|
3203
|
+
-webkit-user-select: none; /* Safari */
|
|
3204
|
+
-khtml-user-select: none; /* Konqueror HTML */
|
|
3205
|
+
-moz-user-select: none; /* Firefox */
|
|
3206
|
+
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
3207
|
+
user-select: none;
|
|
3208
|
+
margin: 0;
|
|
3209
|
+
padding: 0;
|
|
3210
|
+
}
|
|
3211
|
+
.transform-component-module_content__FBWxo {
|
|
3212
|
+
display: flex;
|
|
3213
|
+
flex-wrap: wrap;
|
|
3214
|
+
width: -moz-fit-content;
|
|
3215
|
+
width: fit-content;
|
|
3216
|
+
height: -moz-fit-content;
|
|
3217
|
+
height: fit-content;
|
|
3218
|
+
margin: 0;
|
|
3219
|
+
padding: 0;
|
|
3220
|
+
transform-origin: 0% 0%;
|
|
3221
|
+
}
|
|
3222
|
+
.transform-component-module_content__FBWxo img {
|
|
3223
|
+
pointer-events: none;
|
|
3224
|
+
}
|
|
3225
|
+
`, Qo = { wrapper: "transform-component-module_wrapper__SPB86", content: "transform-component-module_content__FBWxo" };
|
|
3226
|
+
Qa(Ga);
|
|
3227
|
+
var Ys = function(e) {
|
|
3228
|
+
var o = e.children, t = e.wrapperClass, r = t === void 0 ? "" : t, i = e.contentClass, n = i === void 0 ? "" : i, a = e.wrapperStyle, s = e.contentStyle, l = e.wrapperProps, d = l === void 0 ? {} : l, p = e.contentProps, f = p === void 0 ? {} : p, c = Jt(Xt).init, v = Tt(null), h = Tt(null);
|
|
3229
|
+
return Gt(function() {
|
|
3230
|
+
var m = v.current, g = h.current;
|
|
3231
|
+
m !== null && g !== null && c && c(m, g);
|
|
3232
|
+
}, []), Re.createElement(
|
|
3233
|
+
"div",
|
|
3234
|
+
Te({}, d, { ref: v, className: "react-transform-wrapper ".concat(Qo.wrapper, " ").concat(r), style: a }),
|
|
3235
|
+
Re.createElement("div", Te({}, f, { ref: h, className: "react-transform-component ".concat(Qo.content, " ").concat(n), style: s }), o)
|
|
3236
|
+
);
|
|
3237
|
+
}, Ja = function() {
|
|
3238
|
+
var e = Jt(Xt);
|
|
3239
|
+
if (!e)
|
|
3240
|
+
throw new Error("Transform context must be placed inside TransformWrapper");
|
|
3241
|
+
return e;
|
|
3242
|
+
}, Ia = function() {
|
|
3243
|
+
var e = Ja();
|
|
3244
|
+
return Et(e);
|
|
3245
|
+
}, fo = {}, es = Dt;
|
|
3246
|
+
Object.defineProperty(fo, "__esModule", {
|
|
3247
|
+
value: !0
|
|
3248
|
+
});
|
|
3249
|
+
var Ar = fo.default = void 0, ts = es(Rt()), os = At, rs = (0, ts.default)(/* @__PURE__ */ (0, os.jsx)("path", {
|
|
3250
|
+
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
3251
|
+
}), "Add");
|
|
3252
|
+
Ar = fo.default = rs;
|
|
3253
|
+
var co = {}, is = Dt;
|
|
3254
|
+
Object.defineProperty(co, "__esModule", {
|
|
3255
|
+
value: !0
|
|
3256
|
+
});
|
|
3257
|
+
var Rr = co.default = void 0, ns = is(Rt()), as = At, ss = (0, ns.default)(/* @__PURE__ */ (0, as.jsx)("path", {
|
|
3258
|
+
d: "M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
|
|
3259
|
+
}), "Refresh");
|
|
3260
|
+
Rr = co.default = ss;
|
|
3261
|
+
var vo = {}, ls = Dt;
|
|
3262
|
+
Object.defineProperty(vo, "__esModule", {
|
|
3263
|
+
value: !0
|
|
3264
|
+
});
|
|
3265
|
+
var Dr = vo.default = void 0, us = ls(Rt()), ps = At, ds = (0, us.default)(/* @__PURE__ */ (0, ps.jsx)("path", {
|
|
3266
|
+
d: "M19 13H5v-2h14v2z"
|
|
3267
|
+
}), "Remove");
|
|
3268
|
+
Dr = vo.default = ds;
|
|
3269
|
+
var mo = {}, fs = Dt;
|
|
3270
|
+
Object.defineProperty(mo, "__esModule", {
|
|
3271
|
+
value: !0
|
|
3272
|
+
});
|
|
3273
|
+
var xr = mo.default = void 0, cs = fs(Rt()), vs = At, ms = (0, cs.default)(/* @__PURE__ */ (0, vs.jsx)("path", {
|
|
3274
|
+
d: "m4 7.59 5-5c.78-.78 2.05-.78 2.83 0L20.24 11h-2.83L10.4 4 5.41 9H8v2H2V5h2v2.59zM20 19h2v-6h-6v2h2.59l-4.99 5-7.01-7H3.76l8.41 8.41c.78.78 2.05.78 2.83 0l5-5V19z"
|
|
3275
|
+
}), "ScreenRotationAlt");
|
|
3276
|
+
xr = mo.default = ms;
|
|
3277
|
+
const hs = {
|
|
3278
|
+
position: "absolute",
|
|
3279
|
+
zIndex: 1,
|
|
3280
|
+
right: "2rem",
|
|
3281
|
+
bottom: "2rem",
|
|
3282
|
+
width: "fit-content",
|
|
3283
|
+
display: "flex",
|
|
3284
|
+
flexDirection: "column",
|
|
3285
|
+
justifyContent: "flex-end",
|
|
3286
|
+
backgroundColor: "#0F0E0E4D",
|
|
3287
|
+
borderRadius: "5rem"
|
|
3288
|
+
}, Go = {
|
|
3289
|
+
backgroundColor: "#0000000D",
|
|
3290
|
+
height: "0.0625rem"
|
|
3291
|
+
}, yt = {
|
|
3292
|
+
color: "white",
|
|
3293
|
+
"&:focus": {
|
|
3294
|
+
outline: "none"
|
|
3295
|
+
}
|
|
3296
|
+
}, gs = {
|
|
3297
|
+
...yt,
|
|
3298
|
+
position: "absolute",
|
|
3299
|
+
zIndex: 1,
|
|
3300
|
+
right: "2rem",
|
|
3301
|
+
bottom: "10rem",
|
|
3302
|
+
background: "#0F0E0E4D",
|
|
3303
|
+
color: "white",
|
|
3304
|
+
padding: "0.55rem"
|
|
3305
|
+
}, _s = ({
|
|
3306
|
+
controllerContainerProps: e,
|
|
3307
|
+
zoomInButtonProps: o,
|
|
3308
|
+
zoomOutButtonProps: t,
|
|
3309
|
+
resetTransformButtonProps: r,
|
|
3310
|
+
dividerProps: i,
|
|
3311
|
+
handleRotate: n,
|
|
3312
|
+
rotateButtonProps: a
|
|
3313
|
+
}) => {
|
|
3314
|
+
const { zoomIn: s, zoomOut: l, resetTransform: d } = Ia();
|
|
3315
|
+
function p() {
|
|
3316
|
+
s();
|
|
3317
|
+
}
|
|
3318
|
+
function f() {
|
|
3319
|
+
l();
|
|
3320
|
+
}
|
|
3321
|
+
function c() {
|
|
3322
|
+
d();
|
|
3323
|
+
}
|
|
3324
|
+
return /* @__PURE__ */ wt(Vr, { children: [
|
|
3325
|
+
/* @__PURE__ */ _(ht, { title: "Rotate", placement: "left", children: /* @__PURE__ */ _(
|
|
3326
|
+
ft,
|
|
3327
|
+
{
|
|
3328
|
+
disableRipple: !0,
|
|
3329
|
+
disableFocusRipple: !0,
|
|
3330
|
+
"aria-label": "Rotate",
|
|
3331
|
+
onClick: n,
|
|
3332
|
+
sx: gs,
|
|
3333
|
+
...a,
|
|
3334
|
+
children: /* @__PURE__ */ _(xr, {})
|
|
3335
|
+
}
|
|
3336
|
+
) }),
|
|
3337
|
+
/* @__PURE__ */ wt(ti, { sx: hs, ...e, children: [
|
|
3338
|
+
/* @__PURE__ */ _(ht, { title: "Zoom In", placement: "left", children: /* @__PURE__ */ _(
|
|
3339
|
+
ft,
|
|
3340
|
+
{
|
|
3341
|
+
disableRipple: !0,
|
|
3342
|
+
disableFocusRipple: !0,
|
|
3343
|
+
"aria-label": "Zoom In",
|
|
3344
|
+
onClick: p,
|
|
3345
|
+
sx: yt,
|
|
3346
|
+
...o,
|
|
3347
|
+
children: /* @__PURE__ */ _(Ar, {})
|
|
3348
|
+
}
|
|
3349
|
+
) }),
|
|
3350
|
+
/* @__PURE__ */ _(Lo, { sx: Go, ...i }),
|
|
3351
|
+
/* @__PURE__ */ _(ht, { title: "Zoom Out", placement: "left", children: /* @__PURE__ */ _(
|
|
3352
|
+
ft,
|
|
3353
|
+
{
|
|
3354
|
+
disableFocusRipple: !0,
|
|
3355
|
+
disableRipple: !0,
|
|
3356
|
+
"aria-label": "Zoom Out",
|
|
3357
|
+
onClick: f,
|
|
3358
|
+
sx: yt,
|
|
3359
|
+
...t,
|
|
3360
|
+
children: /* @__PURE__ */ _(Dr, {})
|
|
3361
|
+
}
|
|
3362
|
+
) }),
|
|
3363
|
+
/* @__PURE__ */ _(Lo, { sx: Go, ...i }),
|
|
3364
|
+
/* @__PURE__ */ _(ht, { title: "Reset", placement: "left", children: /* @__PURE__ */ _(
|
|
3365
|
+
ft,
|
|
3366
|
+
{
|
|
3367
|
+
disableFocusRipple: !0,
|
|
3368
|
+
disableRipple: !0,
|
|
3369
|
+
"aria-label": "Reset",
|
|
3370
|
+
onClick: c,
|
|
3371
|
+
sx: yt,
|
|
3372
|
+
...r,
|
|
3373
|
+
children: /* @__PURE__ */ _(Rr, {})
|
|
3374
|
+
}
|
|
3375
|
+
) })
|
|
3376
|
+
] })
|
|
3377
|
+
] });
|
|
3378
|
+
};
|
|
3379
|
+
export {
|
|
3380
|
+
Ms as T,
|
|
3381
|
+
_s as Z,
|
|
3382
|
+
Ys as a
|
|
3383
|
+
};
|