@telegraph/modal 0.1.21 → 0.1.22
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/CHANGELOG.md +8 -0
- package/README.md +31 -17
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +481 -466
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/Modal/Modal.d.ts +7 -1
- package/dist/types/Modal/Modal.d.ts.map +1 -1
- package/package.json +5 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as C, jsxs as Ce } from "react/jsx-runtime";
|
|
2
2
|
import * as ee from "@radix-ui/react-dialog";
|
|
3
3
|
import * as v from "react";
|
|
4
4
|
import re, { createContext as oe, useRef as pe, useLayoutEffect as Ys, useEffect as pt, useState as Xs, useContext as k, useMemo as Re, Fragment as xn, createElement as qs, useCallback as Zs, useInsertionEffect as Js, forwardRef as Qs } from "react";
|
|
@@ -9,7 +9,8 @@ import * as si from "@radix-ui/react-visually-hidden";
|
|
|
9
9
|
import { Button as ii } from "@telegraph/button";
|
|
10
10
|
import { RefToTgphRef as ri } from "@telegraph/helpers";
|
|
11
11
|
import { Stack as se, Box as oi } from "@telegraph/layout";
|
|
12
|
-
import {
|
|
12
|
+
import { Heading as ai } from "@telegraph/typography";
|
|
13
|
+
import { X as ci } from "lucide-react";
|
|
13
14
|
function Ke(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
14
15
|
return function(i) {
|
|
15
16
|
if (e == null || e(i), n === !1 || !i.defaultPrevented)
|
|
@@ -41,34 +42,34 @@ function An(...e) {
|
|
|
41
42
|
return v.useCallback(Vn(...e), e);
|
|
42
43
|
}
|
|
43
44
|
// @__NO_SIDE_EFFECTS__
|
|
44
|
-
function
|
|
45
|
-
const t = /* @__PURE__ */
|
|
46
|
-
const { children: r, ...o } = s, a = v.Children.toArray(r), l = a.find(
|
|
45
|
+
function ui(e) {
|
|
46
|
+
const t = /* @__PURE__ */ li(e), n = v.forwardRef((s, i) => {
|
|
47
|
+
const { children: r, ...o } = s, a = v.Children.toArray(r), l = a.find(di);
|
|
47
48
|
if (l) {
|
|
48
49
|
const u = l.props.children, c = a.map((f) => f === l ? v.Children.count(u) > 1 ? v.Children.only(null) : v.isValidElement(u) ? u.props.children : null : f);
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ C(t, { ...o, ref: i, children: v.isValidElement(u) ? v.cloneElement(u, void 0, c) : null });
|
|
50
51
|
}
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ C(t, { ...o, ref: i, children: r });
|
|
52
53
|
});
|
|
53
54
|
return n.displayName = `${e}.Slot`, n;
|
|
54
55
|
}
|
|
55
56
|
// @__NO_SIDE_EFFECTS__
|
|
56
|
-
function
|
|
57
|
+
function li(e) {
|
|
57
58
|
const t = v.forwardRef((n, s) => {
|
|
58
59
|
const { children: i, ...r } = n;
|
|
59
60
|
if (v.isValidElement(i)) {
|
|
60
|
-
const o =
|
|
61
|
+
const o = pi(i), a = hi(r, i.props);
|
|
61
62
|
return i.type !== v.Fragment && (a.ref = s ? Vn(s, o) : o), v.cloneElement(i, a);
|
|
62
63
|
}
|
|
63
64
|
return v.Children.count(i) > 1 ? v.Children.only(null) : null;
|
|
64
65
|
});
|
|
65
66
|
return t.displayName = `${e}.SlotClone`, t;
|
|
66
67
|
}
|
|
67
|
-
var
|
|
68
|
-
function
|
|
69
|
-
return v.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId ===
|
|
68
|
+
var fi = Symbol("radix.slottable");
|
|
69
|
+
function di(e) {
|
|
70
|
+
return v.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === fi;
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
+
function hi(e, t) {
|
|
72
73
|
const n = { ...t };
|
|
73
74
|
for (const s in t) {
|
|
74
75
|
const i = e[s], r = t[s];
|
|
@@ -79,12 +80,12 @@ function di(e, t) {
|
|
|
79
80
|
}
|
|
80
81
|
return { ...e, ...n };
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function pi(e) {
|
|
83
84
|
var s, i;
|
|
84
85
|
let t = (s = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : s.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
85
86
|
return n ? e.ref : (t = (i = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : i.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
86
87
|
}
|
|
87
|
-
var
|
|
88
|
+
var mi = [
|
|
88
89
|
"a",
|
|
89
90
|
"button",
|
|
90
91
|
"div",
|
|
@@ -102,14 +103,14 @@ var pi = [
|
|
|
102
103
|
"span",
|
|
103
104
|
"svg",
|
|
104
105
|
"ul"
|
|
105
|
-
], Cn =
|
|
106
|
-
const n = /* @__PURE__ */
|
|
106
|
+
], Cn = mi.reduce((e, t) => {
|
|
107
|
+
const n = /* @__PURE__ */ ui(`Primitive.${t}`), s = v.forwardRef((i, r) => {
|
|
107
108
|
const { asChild: o, ...a } = i, l = o ? n : t;
|
|
108
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
109
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ C(l, { ...a, ref: r });
|
|
109
110
|
});
|
|
110
111
|
return s.displayName = `Primitive.${t}`, { ...e, [t]: s };
|
|
111
112
|
}, {});
|
|
112
|
-
function
|
|
113
|
+
function gi(e, t) {
|
|
113
114
|
e && ei.flushSync(() => e.dispatchEvent(t));
|
|
114
115
|
}
|
|
115
116
|
function mt(e) {
|
|
@@ -121,7 +122,7 @@ function mt(e) {
|
|
|
121
122
|
return (s = t.current) == null ? void 0 : s.call(t, ...n);
|
|
122
123
|
}, []);
|
|
123
124
|
}
|
|
124
|
-
function
|
|
125
|
+
function yi(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
125
126
|
const n = mt(e);
|
|
126
127
|
v.useEffect(() => {
|
|
127
128
|
const s = (i) => {
|
|
@@ -130,7 +131,7 @@ function gi(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
130
131
|
return t.addEventListener("keydown", s, { capture: !0 }), () => t.removeEventListener("keydown", s, { capture: !0 });
|
|
131
132
|
}, [n, t]);
|
|
132
133
|
}
|
|
133
|
-
var
|
|
134
|
+
var bi = "DismissableLayer", ze = "dismissableLayer.update", vi = "dismissableLayer.pointerDownOutside", Ti = "dismissableLayer.focusOutside", _t, Mn = v.createContext({
|
|
134
135
|
layers: /* @__PURE__ */ new Set(),
|
|
135
136
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
136
137
|
branches: /* @__PURE__ */ new Set()
|
|
@@ -144,14 +145,14 @@ var yi = "DismissableLayer", ze = "dismissableLayer.update", bi = "dismissableLa
|
|
|
144
145
|
onInteractOutside: o,
|
|
145
146
|
onDismiss: a,
|
|
146
147
|
...l
|
|
147
|
-
} = e, u = v.useContext(Mn), [c, f] = v.useState(null), d = (c == null ? void 0 : c.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = v.useState({}), g = An(t, (x) => f(x)), y = Array.from(u.layers), [T] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), p = y.indexOf(T), V = c ? y.indexOf(c) : -1, m = u.layersWithOutsidePointerEventsDisabled.size > 0,
|
|
148
|
+
} = e, u = v.useContext(Mn), [c, f] = v.useState(null), d = (c == null ? void 0 : c.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = v.useState({}), g = An(t, (x) => f(x)), y = Array.from(u.layers), [T] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), p = y.indexOf(T), V = c ? y.indexOf(c) : -1, m = u.layersWithOutsidePointerEventsDisabled.size > 0, M = V >= p, w = xi((x) => {
|
|
148
149
|
const S = x.target, D = [...u.branches].some((O) => O.contains(S));
|
|
149
|
-
!
|
|
150
|
-
}, d), A =
|
|
150
|
+
!M || D || (i == null || i(x), o == null || o(x), x.defaultPrevented || a == null || a());
|
|
151
|
+
}, d), A = Vi((x) => {
|
|
151
152
|
const S = x.target;
|
|
152
153
|
[...u.branches].some((O) => O.contains(S)) || (r == null || r(x), o == null || o(x), x.defaultPrevented || a == null || a());
|
|
153
154
|
}, d);
|
|
154
|
-
return
|
|
155
|
+
return yi((x) => {
|
|
155
156
|
V === u.layers.size - 1 && (s == null || s(x), !x.defaultPrevented && a && (x.preventDefault(), a()));
|
|
156
157
|
}, d), v.useEffect(() => {
|
|
157
158
|
if (c)
|
|
@@ -163,13 +164,13 @@ var yi = "DismissableLayer", ze = "dismissableLayer.update", bi = "dismissableLa
|
|
|
163
164
|
}, [c, u]), v.useEffect(() => {
|
|
164
165
|
const x = () => h({});
|
|
165
166
|
return document.addEventListener(ze, x), () => document.removeEventListener(ze, x);
|
|
166
|
-
}, []), /* @__PURE__ */
|
|
167
|
+
}, []), /* @__PURE__ */ C(
|
|
167
168
|
Cn.div,
|
|
168
169
|
{
|
|
169
170
|
...l,
|
|
170
171
|
ref: g,
|
|
171
172
|
style: {
|
|
172
|
-
pointerEvents: m ?
|
|
173
|
+
pointerEvents: m ? M ? "auto" : "none" : void 0,
|
|
173
174
|
...e.style
|
|
174
175
|
},
|
|
175
176
|
onFocusCapture: Ke(e.onFocusCapture, A.onFocusCapture),
|
|
@@ -182,8 +183,8 @@ var yi = "DismissableLayer", ze = "dismissableLayer.update", bi = "dismissableLa
|
|
|
182
183
|
);
|
|
183
184
|
}
|
|
184
185
|
);
|
|
185
|
-
Pn.displayName =
|
|
186
|
-
var
|
|
186
|
+
Pn.displayName = bi;
|
|
187
|
+
var wi = "DismissableLayerBranch", Si = v.forwardRef((e, t) => {
|
|
187
188
|
const n = v.useContext(Mn), s = v.useRef(null), i = An(t, s);
|
|
188
189
|
return v.useEffect(() => {
|
|
189
190
|
const r = s.current;
|
|
@@ -191,10 +192,10 @@ var Ti = "DismissableLayerBranch", wi = v.forwardRef((e, t) => {
|
|
|
191
192
|
return n.branches.add(r), () => {
|
|
192
193
|
n.branches.delete(r);
|
|
193
194
|
};
|
|
194
|
-
}, [n.branches]), /* @__PURE__ */
|
|
195
|
+
}, [n.branches]), /* @__PURE__ */ C(Cn.div, { ...e, ref: i });
|
|
195
196
|
});
|
|
196
|
-
|
|
197
|
-
function
|
|
197
|
+
Si.displayName = wi;
|
|
198
|
+
function xi(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
198
199
|
const n = mt(e), s = v.useRef(!1), i = v.useRef(() => {
|
|
199
200
|
});
|
|
200
201
|
return v.useEffect(() => {
|
|
@@ -202,7 +203,7 @@ function Si(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
202
203
|
if (a.target && !s.current) {
|
|
203
204
|
let l = function() {
|
|
204
205
|
En(
|
|
205
|
-
|
|
206
|
+
vi,
|
|
206
207
|
n,
|
|
207
208
|
u,
|
|
208
209
|
{ discrete: !0 }
|
|
@@ -224,11 +225,11 @@ function Si(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
224
225
|
onPointerDownCapture: () => s.current = !0
|
|
225
226
|
};
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
+
function Vi(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
228
229
|
const n = mt(e), s = v.useRef(!1);
|
|
229
230
|
return v.useEffect(() => {
|
|
230
231
|
const i = (r) => {
|
|
231
|
-
r.target && !s.current && En(
|
|
232
|
+
r.target && !s.current && En(Ti, n, { originalEvent: r }, {
|
|
232
233
|
discrete: !1
|
|
233
234
|
});
|
|
234
235
|
};
|
|
@@ -244,18 +245,18 @@ function Ut() {
|
|
|
244
245
|
}
|
|
245
246
|
function En(e, t, n, { discrete: s }) {
|
|
246
247
|
const i = n.originalEvent.target, r = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
247
|
-
t && i.addEventListener(e, t, { once: !0 }), s ?
|
|
248
|
+
t && i.addEventListener(e, t, { once: !0 }), s ? gi(i, r) : i.dispatchEvent(r);
|
|
248
249
|
}
|
|
249
|
-
var
|
|
250
|
-
},
|
|
251
|
-
function
|
|
250
|
+
var Ai = globalThis != null && globalThis.document ? v.useLayoutEffect : () => {
|
|
251
|
+
}, Ci = v[" useInsertionEffect ".trim().toString()] || Ai;
|
|
252
|
+
function Mi({
|
|
252
253
|
prop: e,
|
|
253
254
|
defaultProp: t,
|
|
254
255
|
onChange: n = () => {
|
|
255
256
|
},
|
|
256
257
|
caller: s
|
|
257
258
|
}) {
|
|
258
|
-
const [i, r, o] =
|
|
259
|
+
const [i, r, o] = Pi({
|
|
259
260
|
defaultProp: t,
|
|
260
261
|
onChange: n
|
|
261
262
|
}), a = e !== void 0, l = a ? e : i;
|
|
@@ -272,7 +273,7 @@ function Ci({
|
|
|
272
273
|
(c) => {
|
|
273
274
|
var f;
|
|
274
275
|
if (a) {
|
|
275
|
-
const d =
|
|
276
|
+
const d = Ei(c) ? c(e) : c;
|
|
276
277
|
d !== e && ((f = o.current) == null || f.call(o, d));
|
|
277
278
|
} else
|
|
278
279
|
r(c);
|
|
@@ -281,31 +282,31 @@ function Ci({
|
|
|
281
282
|
);
|
|
282
283
|
return [l, u];
|
|
283
284
|
}
|
|
284
|
-
function
|
|
285
|
+
function Pi({
|
|
285
286
|
defaultProp: e,
|
|
286
287
|
onChange: t
|
|
287
288
|
}) {
|
|
288
289
|
const [n, s] = v.useState(e), i = v.useRef(n), r = v.useRef(t);
|
|
289
|
-
return
|
|
290
|
+
return Ci(() => {
|
|
290
291
|
r.current = t;
|
|
291
292
|
}, [t]), v.useEffect(() => {
|
|
292
293
|
var o;
|
|
293
294
|
i.current !== n && ((o = r.current) == null || o.call(r, n), i.current = n);
|
|
294
295
|
}, [n, i]), [n, s, r];
|
|
295
296
|
}
|
|
296
|
-
function
|
|
297
|
+
function Ei(e) {
|
|
297
298
|
return typeof e == "function";
|
|
298
299
|
}
|
|
299
|
-
const
|
|
300
|
-
function
|
|
300
|
+
const Di = oe({});
|
|
301
|
+
function Fi(e) {
|
|
301
302
|
const t = pe(null);
|
|
302
303
|
return t.current === null && (t.current = e()), t.current;
|
|
303
304
|
}
|
|
304
|
-
const gt = typeof window < "u",
|
|
305
|
-
function
|
|
305
|
+
const gt = typeof window < "u", Oi = gt ? Ys : pt, Dn = /* @__PURE__ */ oe(null);
|
|
306
|
+
function Ri(e, t) {
|
|
306
307
|
e.indexOf(t) === -1 && e.push(t);
|
|
307
308
|
}
|
|
308
|
-
function
|
|
309
|
+
function Li(e, t) {
|
|
309
310
|
const n = e.indexOf(t);
|
|
310
311
|
n > -1 && e.splice(n, 1);
|
|
311
312
|
}
|
|
@@ -323,7 +324,7 @@ process.env.NODE_ENV !== "production" && (ve = (e, t, n) => {
|
|
|
323
324
|
throw new Error(Ye(t, n));
|
|
324
325
|
});
|
|
325
326
|
const W = {}, Fn = (e) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);
|
|
326
|
-
function
|
|
327
|
+
function Ii(e) {
|
|
327
328
|
return typeof e == "object" && e !== null;
|
|
328
329
|
}
|
|
329
330
|
const On = (e) => /^0[^.\s]+$/u.test(e);
|
|
@@ -332,7 +333,7 @@ function yt(e) {
|
|
|
332
333
|
let t;
|
|
333
334
|
return () => (t === void 0 && (t = e()), t);
|
|
334
335
|
}
|
|
335
|
-
const ae = /* @__NO_SIDE_EFFECTS__ */ (e) => e,
|
|
336
|
+
const ae = /* @__NO_SIDE_EFFECTS__ */ (e) => e, ki = (e, t) => (n) => t(e(n)), Le = (...e) => e.reduce(ki), Rn = /* @__NO_SIDE_EFFECTS__ */ (e, t, n) => {
|
|
336
337
|
const s = t - e;
|
|
337
338
|
return s === 0 ? 1 : (n - e) / s;
|
|
338
339
|
};
|
|
@@ -341,7 +342,7 @@ class Ln {
|
|
|
341
342
|
this.subscriptions = [];
|
|
342
343
|
}
|
|
343
344
|
add(t) {
|
|
344
|
-
return
|
|
345
|
+
return Ri(this.subscriptions, t), () => Li(this.subscriptions, t);
|
|
345
346
|
}
|
|
346
347
|
notify(t, n, s) {
|
|
347
348
|
const i = this.subscriptions.length;
|
|
@@ -365,43 +366,43 @@ const B = /* @__NO_SIDE_EFFECTS__ */ (e) => e * 1e3, K = /* @__NO_SIDE_EFFECTS__
|
|
|
365
366
|
function In(e, t) {
|
|
366
367
|
return t ? e * (1e3 / t) : 0;
|
|
367
368
|
}
|
|
368
|
-
const
|
|
369
|
+
const Ht = /* @__PURE__ */ new Set();
|
|
369
370
|
function kn(e, t, n) {
|
|
370
|
-
e ||
|
|
371
|
+
e || Ht.has(t) || (console.warn(Ye(t, n)), Ht.add(t));
|
|
371
372
|
}
|
|
372
|
-
const Nn = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e,
|
|
373
|
-
function
|
|
373
|
+
const Nn = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e, Ni = 1e-7, Bi = 12;
|
|
374
|
+
function Ki(e, t, n, s, i) {
|
|
374
375
|
let r, o, a = 0;
|
|
375
376
|
do
|
|
376
377
|
o = t + (n - t) / 2, r = Nn(o, s, i) - e, r > 0 ? n = o : t = o;
|
|
377
|
-
while (Math.abs(r) >
|
|
378
|
+
while (Math.abs(r) > Ni && ++a < Bi);
|
|
378
379
|
return o;
|
|
379
380
|
}
|
|
380
381
|
function Te(e, t, n, s) {
|
|
381
382
|
if (e === t && n === s)
|
|
382
383
|
return ae;
|
|
383
|
-
const i = (r) =>
|
|
384
|
+
const i = (r) => Ki(r, 0, 1, e, n);
|
|
384
385
|
return (r) => r === 0 || r === 1 ? r : Nn(i(r), t, s);
|
|
385
386
|
}
|
|
386
|
-
const Bn = (e) => (t) => t <= 0.5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, Kn = (e) => (t) => 1 - e(1 - t), Wn = /* @__PURE__ */ Te(0.33, 1.53, 0.69, 0.99), bt = /* @__PURE__ */ Kn(Wn), $n = /* @__PURE__ */ Bn(bt), jn = (e) => (e *= 2) < 1 ? 0.5 * bt(e) : 0.5 * (2 - Math.pow(2, -10 * (e - 1))), vt = (e) => 1 - Math.sin(Math.acos(e)),
|
|
387
|
+
const Bn = (e) => (t) => t <= 0.5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, Kn = (e) => (t) => 1 - e(1 - t), Wn = /* @__PURE__ */ Te(0.33, 1.53, 0.69, 0.99), bt = /* @__PURE__ */ Kn(Wn), $n = /* @__PURE__ */ Bn(bt), jn = (e) => (e *= 2) < 1 ? 0.5 * bt(e) : 0.5 * (2 - Math.pow(2, -10 * (e - 1))), vt = (e) => 1 - Math.sin(Math.acos(e)), Wi = Kn(vt), _n = Bn(vt), $i = /* @__PURE__ */ Te(0.42, 0, 1, 1), ji = /* @__PURE__ */ Te(0, 0, 0.58, 1), Un = /* @__PURE__ */ Te(0.42, 0, 0.58, 1), _i = (e) => Array.isArray(e) && typeof e[0] != "number", Hn = (e) => Array.isArray(e) && typeof e[0] == "number", Gt = {
|
|
387
388
|
linear: ae,
|
|
388
|
-
easeIn:
|
|
389
|
+
easeIn: $i,
|
|
389
390
|
easeInOut: Un,
|
|
390
|
-
easeOut:
|
|
391
|
+
easeOut: ji,
|
|
391
392
|
circIn: vt,
|
|
392
393
|
circInOut: _n,
|
|
393
|
-
circOut:
|
|
394
|
+
circOut: Wi,
|
|
394
395
|
backIn: bt,
|
|
395
396
|
backInOut: $n,
|
|
396
397
|
backOut: Wn,
|
|
397
398
|
anticipate: jn
|
|
398
|
-
},
|
|
399
|
-
if (
|
|
399
|
+
}, Ui = (e) => typeof e == "string", zt = (e) => {
|
|
400
|
+
if (Hn(e)) {
|
|
400
401
|
X(e.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
|
|
401
402
|
const [t, n, s, i] = e;
|
|
402
403
|
return Te(t, n, s, i);
|
|
403
|
-
} else if (
|
|
404
|
-
return X(
|
|
404
|
+
} else if (Ui(e))
|
|
405
|
+
return X(Gt[e] !== void 0, `Invalid easing type '${e}'`, "invalid-easing-type"), Gt[e];
|
|
405
406
|
return e;
|
|
406
407
|
}, Se = [
|
|
407
408
|
"setup",
|
|
@@ -421,7 +422,7 @@ const Bn = (e) => (t) => t <= 0.5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, Kn
|
|
|
421
422
|
"postRender"
|
|
422
423
|
// Compute
|
|
423
424
|
];
|
|
424
|
-
function
|
|
425
|
+
function Hi(e, t) {
|
|
425
426
|
let n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), i = !1, r = !1;
|
|
426
427
|
const o = /* @__PURE__ */ new WeakSet();
|
|
427
428
|
let a = {
|
|
@@ -460,37 +461,37 @@ function Ui(e, t) {
|
|
|
460
461
|
return u;
|
|
461
462
|
}
|
|
462
463
|
const Gi = 40;
|
|
463
|
-
function
|
|
464
|
+
function Gn(e, t) {
|
|
464
465
|
let n = !1, s = !0;
|
|
465
466
|
const i = {
|
|
466
467
|
delta: 0,
|
|
467
468
|
timestamp: 0,
|
|
468
469
|
isProcessing: !1
|
|
469
|
-
}, r = () => n = !0, o = Se.reduce((m,
|
|
470
|
+
}, r = () => n = !0, o = Se.reduce((m, M) => (m[M] = Hi(r), m), {}), { setup: a, read: l, resolveKeyframes: u, preUpdate: c, update: f, preRender: d, render: h, postRender: g } = o, y = () => {
|
|
470
471
|
const m = W.useManualTiming ? i.timestamp : performance.now();
|
|
471
472
|
n = !1, W.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(m - i.timestamp, Gi), 1)), i.timestamp = m, i.isProcessing = !0, a.process(i), l.process(i), u.process(i), c.process(i), f.process(i), d.process(i), h.process(i), g.process(i), i.isProcessing = !1, n && t && (s = !1, e(y));
|
|
472
473
|
}, T = () => {
|
|
473
474
|
n = !0, s = !0, i.isProcessing || e(y);
|
|
474
475
|
};
|
|
475
|
-
return { schedule: Se.reduce((m,
|
|
476
|
-
const w = o[
|
|
477
|
-
return m[
|
|
476
|
+
return { schedule: Se.reduce((m, M) => {
|
|
477
|
+
const w = o[M];
|
|
478
|
+
return m[M] = (A, x = !1, S = !1) => (n || T(), w.schedule(A, x, S)), m;
|
|
478
479
|
}, {}), cancel: (m) => {
|
|
479
|
-
for (let
|
|
480
|
-
o[Se[
|
|
480
|
+
for (let M = 0; M < Se.length; M++)
|
|
481
|
+
o[Se[M]].cancel(m);
|
|
481
482
|
}, state: i, steps: o };
|
|
482
483
|
}
|
|
483
|
-
const { schedule: N, cancel: Xe, state: Me } = /* @__PURE__ */
|
|
484
|
+
const { schedule: N, cancel: Xe, state: Me } = /* @__PURE__ */ Gn(typeof requestAnimationFrame < "u" ? requestAnimationFrame : ae, !0);
|
|
484
485
|
let Ve;
|
|
485
|
-
function
|
|
486
|
+
function zi() {
|
|
486
487
|
Ve = void 0;
|
|
487
488
|
}
|
|
488
489
|
const I = {
|
|
489
490
|
now: () => (Ve === void 0 && I.set(Me.isProcessing || W.useManualTiming ? Me.timestamp : performance.now()), Ve),
|
|
490
491
|
set: (e) => {
|
|
491
|
-
Ve = e, queueMicrotask(
|
|
492
|
+
Ve = e, queueMicrotask(zi);
|
|
492
493
|
}
|
|
493
|
-
}, zn = (e) => (t) => typeof t == "string" && t.startsWith(e), Yn = /* @__PURE__ */ zn("--"),
|
|
494
|
+
}, zn = (e) => (t) => typeof t == "string" && t.startsWith(e), Yn = /* @__PURE__ */ zn("--"), Yi = /* @__PURE__ */ zn("var(--"), Tt = (e) => Yi(e) ? Xi.test(e.split("/*")[0].trim()) : !1, Xi = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, ce = {
|
|
494
495
|
test: (e) => typeof e == "number",
|
|
495
496
|
parse: parseFloat,
|
|
496
497
|
transform: (e) => e
|
|
@@ -501,10 +502,10 @@ const I = {
|
|
|
501
502
|
...ce,
|
|
502
503
|
default: 1
|
|
503
504
|
}, me = (e) => Math.round(e * 1e5) / 1e5, wt = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
504
|
-
function
|
|
505
|
+
function qi(e) {
|
|
505
506
|
return e == null;
|
|
506
507
|
}
|
|
507
|
-
const
|
|
508
|
+
const Zi = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, St = (e, t) => (n) => !!(typeof n == "string" && Zi.test(n) && n.startsWith(e) || t && !qi(n) && Object.prototype.hasOwnProperty.call(n, t)), Xn = (e, t, n) => (s) => {
|
|
508
509
|
if (typeof s != "string")
|
|
509
510
|
return s;
|
|
510
511
|
const [i, r, o, a] = s.match(wt);
|
|
@@ -514,15 +515,15 @@ const qi = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s
|
|
|
514
515
|
[n]: parseFloat(o),
|
|
515
516
|
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
516
517
|
};
|
|
517
|
-
},
|
|
518
|
+
}, Ji = (e) => Y(0, 255, e), We = {
|
|
518
519
|
...ce,
|
|
519
|
-
transform: (e) => Math.round(
|
|
520
|
+
transform: (e) => Math.round(Ji(e))
|
|
520
521
|
}, U = {
|
|
521
522
|
test: /* @__PURE__ */ St("rgb", "red"),
|
|
522
523
|
parse: /* @__PURE__ */ Xn("red", "green", "blue"),
|
|
523
524
|
transform: ({ red: e, green: t, blue: n, alpha: s = 1 }) => "rgba(" + We.transform(e) + ", " + We.transform(t) + ", " + We.transform(n) + ", " + me(ge.transform(s)) + ")"
|
|
524
525
|
};
|
|
525
|
-
function
|
|
526
|
+
function Qi(e) {
|
|
526
527
|
let t = "", n = "", s = "", i = "";
|
|
527
528
|
return e.length > 5 ? (t = e.substring(1, 3), n = e.substring(3, 5), s = e.substring(5, 7), i = e.substring(7, 9)) : (t = e.substring(1, 2), n = e.substring(2, 3), s = e.substring(3, 4), i = e.substring(4, 5), t += t, n += n, s += s, i += i), {
|
|
528
529
|
red: parseInt(t, 16),
|
|
@@ -533,13 +534,13 @@ function Ji(e) {
|
|
|
533
534
|
}
|
|
534
535
|
const qe = {
|
|
535
536
|
test: /* @__PURE__ */ St("#"),
|
|
536
|
-
parse:
|
|
537
|
+
parse: Qi,
|
|
537
538
|
transform: U.transform
|
|
538
539
|
}, we = /* @__NO_SIDE_EFFECTS__ */ (e) => ({
|
|
539
540
|
test: (t) => typeof t == "string" && t.endsWith(e) && t.split(" ").length === 1,
|
|
540
541
|
parse: parseFloat,
|
|
541
542
|
transform: (t) => `${t}${e}`
|
|
542
|
-
}), $ = /* @__PURE__ */ we("deg"), te = /* @__PURE__ */ we("%"), b = /* @__PURE__ */ we("px"),
|
|
543
|
+
}), $ = /* @__PURE__ */ we("deg"), te = /* @__PURE__ */ we("%"), b = /* @__PURE__ */ we("px"), er = /* @__PURE__ */ we("vh"), tr = /* @__PURE__ */ we("vw"), Yt = {
|
|
543
544
|
...te,
|
|
544
545
|
parse: (e) => te.parse(e) / 100,
|
|
545
546
|
transform: (e) => te.transform(e * 100)
|
|
@@ -555,12 +556,12 @@ const qe = {
|
|
|
555
556
|
const t = E.parse(e);
|
|
556
557
|
return t.alpha = 0, E.transform(t);
|
|
557
558
|
}
|
|
558
|
-
},
|
|
559
|
-
function
|
|
559
|
+
}, nr = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
560
|
+
function sr(e) {
|
|
560
561
|
var t, n;
|
|
561
|
-
return isNaN(e) && typeof e == "string" && (((t = e.match(wt)) == null ? void 0 : t.length) || 0) + (((n = e.match(
|
|
562
|
+
return isNaN(e) && typeof e == "string" && (((t = e.match(wt)) == null ? void 0 : t.length) || 0) + (((n = e.match(nr)) == null ? void 0 : n.length) || 0) > 0;
|
|
562
563
|
}
|
|
563
|
-
const qn = "number", Zn = "color",
|
|
564
|
+
const qn = "number", Zn = "color", ir = "var", rr = "var(", Xt = "${}", or = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
564
565
|
function ye(e) {
|
|
565
566
|
const t = e.toString(), n = [], s = {
|
|
566
567
|
color: [],
|
|
@@ -568,7 +569,7 @@ function ye(e) {
|
|
|
568
569
|
var: []
|
|
569
570
|
}, i = [];
|
|
570
571
|
let r = 0;
|
|
571
|
-
const a = t.replace(
|
|
572
|
+
const a = t.replace(or, (l) => (E.test(l) ? (s.color.push(r), i.push(Zn), n.push(E.parse(l))) : l.startsWith(rr) ? (s.var.push(r), i.push(ir), n.push(l)) : (s.number.push(r), i.push(qn), n.push(parseFloat(l))), ++r, Xt)).split(Xt);
|
|
572
573
|
return { values: n, split: a, indexes: s, types: i };
|
|
573
574
|
}
|
|
574
575
|
function Jn(e) {
|
|
@@ -586,21 +587,21 @@ function Qn(e) {
|
|
|
586
587
|
return r;
|
|
587
588
|
};
|
|
588
589
|
}
|
|
589
|
-
const
|
|
590
|
-
function
|
|
590
|
+
const ar = (e) => typeof e == "number" ? 0 : E.test(e) ? E.getAnimatableNone(e) : e;
|
|
591
|
+
function cr(e) {
|
|
591
592
|
const t = Jn(e);
|
|
592
|
-
return Qn(e)(t.map(
|
|
593
|
+
return Qn(e)(t.map(ar));
|
|
593
594
|
}
|
|
594
595
|
const ue = {
|
|
595
|
-
test:
|
|
596
|
+
test: sr,
|
|
596
597
|
parse: Jn,
|
|
597
598
|
createTransformer: Qn,
|
|
598
|
-
getAnimatableNone:
|
|
599
|
+
getAnimatableNone: cr
|
|
599
600
|
};
|
|
600
601
|
function $e(e, t, n) {
|
|
601
602
|
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
602
603
|
}
|
|
603
|
-
function
|
|
604
|
+
function ur({ hue: e, saturation: t, lightness: n, alpha: s }) {
|
|
604
605
|
e /= 360, t /= 100, n /= 100;
|
|
605
606
|
let i = 0, r = 0, o = 0;
|
|
606
607
|
if (!t)
|
|
@@ -622,13 +623,13 @@ function Pe(e, t) {
|
|
|
622
623
|
const Ie = (e, t, n) => e + (t - e) * n, je = (e, t, n) => {
|
|
623
624
|
const s = e * e, i = n * (t * t - s) + s;
|
|
624
625
|
return i < 0 ? 0 : Math.sqrt(i);
|
|
625
|
-
},
|
|
626
|
+
}, lr = [qe, U, J], fr = (e) => lr.find((t) => t.test(e));
|
|
626
627
|
function qt(e) {
|
|
627
|
-
const t =
|
|
628
|
+
const t = fr(e);
|
|
628
629
|
if (ve(!!t, `'${e}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"), !t)
|
|
629
630
|
return !1;
|
|
630
631
|
let n = t.parse(e);
|
|
631
|
-
return t === J && (n =
|
|
632
|
+
return t === J && (n = ur(n)), n;
|
|
632
633
|
}
|
|
633
634
|
const Zt = (e, t) => {
|
|
634
635
|
const n = qt(e), s = qt(t);
|
|
@@ -637,14 +638,14 @@ const Zt = (e, t) => {
|
|
|
637
638
|
const i = { ...n };
|
|
638
639
|
return (r) => (i.red = je(n.red, s.red, r), i.green = je(n.green, s.green, r), i.blue = je(n.blue, s.blue, r), i.alpha = Ie(n.alpha, s.alpha, r), U.transform(i));
|
|
639
640
|
}, Ze = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
640
|
-
function
|
|
641
|
+
function dr(e, t) {
|
|
641
642
|
return Ze.has(e) ? (n) => n <= 0 ? e : t : (n) => n >= 1 ? t : e;
|
|
642
643
|
}
|
|
643
|
-
function
|
|
644
|
+
function hr(e, t) {
|
|
644
645
|
return (n) => Ie(e, t, n);
|
|
645
646
|
}
|
|
646
647
|
function xt(e) {
|
|
647
|
-
return typeof e == "number" ?
|
|
648
|
+
return typeof e == "number" ? hr : typeof e == "string" ? Tt(e) ? Pe : E.test(e) ? Zt : gr : Array.isArray(e) ? es : typeof e == "object" ? E.test(e) ? Zt : pr : Pe;
|
|
648
649
|
}
|
|
649
650
|
function es(e, t) {
|
|
650
651
|
const n = [...e], s = n.length, i = e.map((r, o) => xt(r)(r, t[o]));
|
|
@@ -654,7 +655,7 @@ function es(e, t) {
|
|
|
654
655
|
return n;
|
|
655
656
|
};
|
|
656
657
|
}
|
|
657
|
-
function
|
|
658
|
+
function pr(e, t) {
|
|
658
659
|
const n = { ...e, ...t }, s = {};
|
|
659
660
|
for (const i in n)
|
|
660
661
|
e[i] !== void 0 && t[i] !== void 0 && (s[i] = xt(e[i])(e[i], t[i]));
|
|
@@ -664,7 +665,7 @@ function hr(e, t) {
|
|
|
664
665
|
return n;
|
|
665
666
|
};
|
|
666
667
|
}
|
|
667
|
-
function
|
|
668
|
+
function mr(e, t) {
|
|
668
669
|
const n = [], s = { color: 0, var: 0, number: 0 };
|
|
669
670
|
for (let i = 0; i < t.values.length; i++) {
|
|
670
671
|
const r = t.types[i], o = e.indexes[r][s[r]], a = e.values[o] ?? 0;
|
|
@@ -672,14 +673,14 @@ function pr(e, t) {
|
|
|
672
673
|
}
|
|
673
674
|
return n;
|
|
674
675
|
}
|
|
675
|
-
const
|
|
676
|
+
const gr = (e, t) => {
|
|
676
677
|
const n = ue.createTransformer(t), s = ye(e), i = ye(t);
|
|
677
|
-
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? Ze.has(e) && !i.values.length || Ze.has(t) && !s.values.length ?
|
|
678
|
+
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? Ze.has(e) && !i.values.length || Ze.has(t) && !s.values.length ? dr(e, t) : Le(es(mr(s, i), i.values), n) : (ve(!0, `Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), Pe(e, t));
|
|
678
679
|
};
|
|
679
680
|
function ts(e, t, n) {
|
|
680
681
|
return typeof e == "number" && typeof t == "number" && typeof n == "number" ? Ie(e, t, n) : xt(e)(e, t);
|
|
681
682
|
}
|
|
682
|
-
const
|
|
683
|
+
const yr = (e) => {
|
|
683
684
|
const t = ({ timestamp: n }) => e(n);
|
|
684
685
|
return {
|
|
685
686
|
start: (n = !0) => N.update(t, n),
|
|
@@ -705,7 +706,7 @@ function Vt(e) {
|
|
|
705
706
|
t += n, s = e.next(t);
|
|
706
707
|
return t >= Ee ? 1 / 0 : t;
|
|
707
708
|
}
|
|
708
|
-
function
|
|
709
|
+
function br(e, t = 100, n) {
|
|
709
710
|
const s = n({ ...e, keyframes: [0, t] }), i = Math.min(Vt(s), Ee);
|
|
710
711
|
return {
|
|
711
712
|
type: "keyframes",
|
|
@@ -713,9 +714,9 @@ function yr(e, t = 100, n) {
|
|
|
713
714
|
duration: /* @__PURE__ */ K(i)
|
|
714
715
|
};
|
|
715
716
|
}
|
|
716
|
-
const
|
|
717
|
+
const vr = 5;
|
|
717
718
|
function ss(e, t, n) {
|
|
718
|
-
const s = Math.max(t -
|
|
719
|
+
const s = Math.max(t - vr, 0);
|
|
719
720
|
return In(n - e(s), t - s);
|
|
720
721
|
}
|
|
721
722
|
const P = {
|
|
@@ -747,7 +748,7 @@ const P = {
|
|
|
747
748
|
minDamping: 0.05,
|
|
748
749
|
maxDamping: 1
|
|
749
750
|
}, _e = 1e-3;
|
|
750
|
-
function
|
|
751
|
+
function Tr({ duration: e = P.duration, bounce: t = P.bounce, velocity: n = P.velocity, mass: s = P.mass }) {
|
|
751
752
|
let i, r;
|
|
752
753
|
ve(e <= /* @__PURE__ */ B(P.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
|
|
753
754
|
let o = 1 - t;
|
|
@@ -764,7 +765,7 @@ function vr({ duration: e = P.duration, bounce: t = P.bounce, velocity: n = P.ve
|
|
|
764
765
|
const c = Math.exp(-u * e), f = (n - u) * (e * e);
|
|
765
766
|
return c * f;
|
|
766
767
|
});
|
|
767
|
-
const a = 5 / e, l =
|
|
768
|
+
const a = 5 / e, l = Sr(i, r, a);
|
|
768
769
|
if (e = /* @__PURE__ */ B(e), isNaN(l))
|
|
769
770
|
return {
|
|
770
771
|
stiffness: P.stiffness,
|
|
@@ -780,21 +781,21 @@ function vr({ duration: e = P.duration, bounce: t = P.bounce, velocity: n = P.ve
|
|
|
780
781
|
};
|
|
781
782
|
}
|
|
782
783
|
}
|
|
783
|
-
const
|
|
784
|
-
function
|
|
784
|
+
const wr = 12;
|
|
785
|
+
function Sr(e, t, n) {
|
|
785
786
|
let s = n;
|
|
786
|
-
for (let i = 1; i <
|
|
787
|
+
for (let i = 1; i < wr; i++)
|
|
787
788
|
s = s - e(s) / t(s);
|
|
788
789
|
return s;
|
|
789
790
|
}
|
|
790
791
|
function Je(e, t) {
|
|
791
792
|
return e * Math.sqrt(1 - t * t);
|
|
792
793
|
}
|
|
793
|
-
const
|
|
794
|
+
const xr = ["duration", "bounce"], Vr = ["stiffness", "damping", "mass"];
|
|
794
795
|
function Jt(e, t) {
|
|
795
796
|
return t.some((n) => e[n] !== void 0);
|
|
796
797
|
}
|
|
797
|
-
function
|
|
798
|
+
function Ar(e) {
|
|
798
799
|
let t = {
|
|
799
800
|
velocity: P.velocity,
|
|
800
801
|
stiffness: P.stiffness,
|
|
@@ -803,7 +804,7 @@ function Vr(e) {
|
|
|
803
804
|
isResolvedFromDuration: !1,
|
|
804
805
|
...e
|
|
805
806
|
};
|
|
806
|
-
if (!Jt(e,
|
|
807
|
+
if (!Jt(e, Vr) && Jt(e, xr))
|
|
807
808
|
if (e.visualDuration) {
|
|
808
809
|
const n = e.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * Y(0.05, 1, 1 - (e.bounce || 0)) * Math.sqrt(i);
|
|
809
810
|
t = {
|
|
@@ -813,7 +814,7 @@ function Vr(e) {
|
|
|
813
814
|
damping: r
|
|
814
815
|
};
|
|
815
816
|
} else {
|
|
816
|
-
const n =
|
|
817
|
+
const n = Tr(e);
|
|
817
818
|
t = {
|
|
818
819
|
...t,
|
|
819
820
|
...n,
|
|
@@ -829,7 +830,7 @@ function De(e = P.visualDuration, t = P.bounce) {
|
|
|
829
830
|
bounce: t
|
|
830
831
|
} : e;
|
|
831
832
|
let { restSpeed: s, restDelta: i } = n;
|
|
832
|
-
const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: l, damping: u, mass: c, duration: f, velocity: d, isResolvedFromDuration: h } =
|
|
833
|
+
const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: l, damping: u, mass: c, duration: f, velocity: d, isResolvedFromDuration: h } = Ar({
|
|
833
834
|
...n,
|
|
834
835
|
velocity: -/* @__PURE__ */ K(n.velocity || 0)
|
|
835
836
|
}), g = d || 0, y = u / (2 * Math.sqrt(l * c)), T = o - r, p = /* @__PURE__ */ K(Math.sqrt(l / c)), V = Math.abs(T) < 5;
|
|
@@ -850,7 +851,7 @@ function De(e = P.visualDuration, t = P.bounce) {
|
|
|
850
851
|
return o - x * ((g + y * p * T) * Math.sinh(S) + w * T * Math.cosh(S)) / w;
|
|
851
852
|
};
|
|
852
853
|
}
|
|
853
|
-
const
|
|
854
|
+
const M = {
|
|
854
855
|
calculatedDuration: h && f || null,
|
|
855
856
|
next: (w) => {
|
|
856
857
|
const A = m(w);
|
|
@@ -865,16 +866,16 @@ function De(e = P.visualDuration, t = P.bounce) {
|
|
|
865
866
|
return a.value = a.done ? o : A, a;
|
|
866
867
|
},
|
|
867
868
|
toString: () => {
|
|
868
|
-
const w = Math.min(Vt(
|
|
869
|
+
const w = Math.min(Vt(M), Ee), A = ns((x) => M.next(w * x).value, w, 30);
|
|
869
870
|
return w + "ms " + A;
|
|
870
871
|
},
|
|
871
872
|
toTransition: () => {
|
|
872
873
|
}
|
|
873
874
|
};
|
|
874
|
-
return
|
|
875
|
+
return M;
|
|
875
876
|
}
|
|
876
877
|
De.applyToOptions = (e) => {
|
|
877
|
-
const t =
|
|
878
|
+
const t = br(e, 100, De);
|
|
878
879
|
return e.ease = t.ease, e.duration = /* @__PURE__ */ B(t.duration), e.type = "keyframes", e;
|
|
879
880
|
};
|
|
880
881
|
function Qe({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
|
|
@@ -885,7 +886,7 @@ function Qe({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 3
|
|
|
885
886
|
let y = n * t;
|
|
886
887
|
const T = f + y, p = o === void 0 ? T : o(T);
|
|
887
888
|
p !== T && (y = p - f);
|
|
888
|
-
const V = (S) => -y * Math.exp(-S / s), m = (S) => p + V(S),
|
|
889
|
+
const V = (S) => -y * Math.exp(-S / s), m = (S) => p + V(S), M = (S) => {
|
|
889
890
|
const D = V(S), O = m(S);
|
|
890
891
|
d.done = Math.abs(D) <= u, d.value = d.done ? p : O;
|
|
891
892
|
};
|
|
@@ -905,11 +906,11 @@ function Qe({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 3
|
|
|
905
906
|
calculatedDuration: null,
|
|
906
907
|
next: (S) => {
|
|
907
908
|
let D = !1;
|
|
908
|
-
return !A && w === void 0 && (D = !0,
|
|
909
|
+
return !A && w === void 0 && (D = !0, M(S), x(S)), w !== void 0 && S >= w ? A.next(S - w) : (!D && M(S), d);
|
|
909
910
|
}
|
|
910
911
|
};
|
|
911
912
|
}
|
|
912
|
-
function
|
|
913
|
+
function Cr(e, t, n) {
|
|
913
914
|
const s = [], i = n || W.mix || ts, r = e.length - 1;
|
|
914
915
|
for (let o = 0; o < r; o++) {
|
|
915
916
|
let a = i(e[o], e[o + 1]);
|
|
@@ -921,7 +922,7 @@ function Ar(e, t, n) {
|
|
|
921
922
|
}
|
|
922
923
|
return s;
|
|
923
924
|
}
|
|
924
|
-
function
|
|
925
|
+
function Mr(e, t, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
925
926
|
const r = e.length;
|
|
926
927
|
if (X(r === t.length, "Both input and output ranges must be the same length", "range-length"), r === 1)
|
|
927
928
|
return () => t[0];
|
|
@@ -929,7 +930,7 @@ function Cr(e, t, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
|
929
930
|
return () => t[1];
|
|
930
931
|
const o = e[0] === e[1];
|
|
931
932
|
e[0] > e[r - 1] && (e = [...e].reverse(), t = [...t].reverse());
|
|
932
|
-
const a =
|
|
933
|
+
const a = Cr(t, s, i), l = a.length, u = (c) => {
|
|
933
934
|
if (o && c < e[0])
|
|
934
935
|
return t[0];
|
|
935
936
|
let f = 0;
|
|
@@ -941,46 +942,46 @@ function Cr(e, t, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
|
941
942
|
};
|
|
942
943
|
return n ? (c) => u(Y(e[0], e[r - 1], c)) : u;
|
|
943
944
|
}
|
|
944
|
-
function
|
|
945
|
+
function Pr(e, t) {
|
|
945
946
|
const n = e[e.length - 1];
|
|
946
947
|
for (let s = 1; s <= t; s++) {
|
|
947
948
|
const i = /* @__PURE__ */ Rn(0, t, s);
|
|
948
949
|
e.push(Ie(n, 1, i));
|
|
949
950
|
}
|
|
950
951
|
}
|
|
951
|
-
function
|
|
952
|
+
function Er(e) {
|
|
952
953
|
const t = [0];
|
|
953
|
-
return
|
|
954
|
+
return Pr(t, e.length - 1), t;
|
|
954
955
|
}
|
|
955
|
-
function
|
|
956
|
+
function Dr(e, t) {
|
|
956
957
|
return e.map((n) => n * t);
|
|
957
958
|
}
|
|
958
|
-
function
|
|
959
|
+
function Fr(e, t) {
|
|
959
960
|
return e.map(() => t || Un).splice(0, e.length - 1);
|
|
960
961
|
}
|
|
961
962
|
function Q({ duration: e = 300, keyframes: t, times: n, ease: s = "easeInOut" }) {
|
|
962
|
-
const i =
|
|
963
|
+
const i = _i(s) ? s.map(zt) : zt(s), r = {
|
|
963
964
|
done: !1,
|
|
964
965
|
value: t[0]
|
|
965
|
-
}, o =
|
|
966
|
+
}, o = Dr(
|
|
966
967
|
// Only use the provided offsets if they're the correct length
|
|
967
968
|
// TODO Maybe we should warn here if there's a length mismatch
|
|
968
|
-
n && n.length === t.length ? n :
|
|
969
|
+
n && n.length === t.length ? n : Er(t),
|
|
969
970
|
e
|
|
970
|
-
), a =
|
|
971
|
-
ease: Array.isArray(i) ? i :
|
|
971
|
+
), a = Mr(o, t, {
|
|
972
|
+
ease: Array.isArray(i) ? i : Fr(t, i)
|
|
972
973
|
});
|
|
973
974
|
return {
|
|
974
975
|
calculatedDuration: e,
|
|
975
976
|
next: (l) => (r.value = a(l), r.done = l >= e, r)
|
|
976
977
|
};
|
|
977
978
|
}
|
|
978
|
-
const
|
|
979
|
+
const Or = (e) => e !== null;
|
|
979
980
|
function At(e, { repeat: t, repeatType: n = "loop" }, s, i = 1) {
|
|
980
|
-
const r = e.filter(
|
|
981
|
+
const r = e.filter(Or), a = i < 0 || t && n !== "loop" && t % 2 === 1 ? 0 : r.length - 1;
|
|
981
982
|
return !a || s === void 0 ? r[a] : s;
|
|
982
983
|
}
|
|
983
|
-
const
|
|
984
|
+
const Rr = {
|
|
984
985
|
decay: Qe,
|
|
985
986
|
inertia: Qe,
|
|
986
987
|
tween: Q,
|
|
@@ -988,7 +989,7 @@ const Or = {
|
|
|
988
989
|
spring: De
|
|
989
990
|
};
|
|
990
991
|
function is(e) {
|
|
991
|
-
typeof e.type == "string" && (e.type =
|
|
992
|
+
typeof e.type == "string" && (e.type = Rr[e.type]);
|
|
992
993
|
}
|
|
993
994
|
class Ct {
|
|
994
995
|
constructor() {
|
|
@@ -1014,7 +1015,7 @@ class Ct {
|
|
|
1014
1015
|
return this.finished.then(t, n);
|
|
1015
1016
|
}
|
|
1016
1017
|
}
|
|
1017
|
-
const
|
|
1018
|
+
const Lr = (e) => e / 100;
|
|
1018
1019
|
class Mt extends Ct {
|
|
1019
1020
|
constructor(t) {
|
|
1020
1021
|
super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = () => {
|
|
@@ -1029,7 +1030,7 @@ class Mt extends Ct {
|
|
|
1029
1030
|
const { type: n = Q, repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = t;
|
|
1030
1031
|
let { keyframes: a } = t;
|
|
1031
1032
|
const l = n || Q;
|
|
1032
|
-
process.env.NODE_ENV !== "production" && l !== Q && X(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`, "spring-two-frames"), l !== Q && typeof a[0] != "number" && (this.mixKeyframes = Le(
|
|
1033
|
+
process.env.NODE_ENV !== "production" && l !== Q && X(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`, "spring-two-frames"), l !== Q && typeof a[0] != "number" && (this.mixKeyframes = Le(Lr, ts(a[0], a[1])), a = [0, 100]);
|
|
1033
1034
|
const u = l({ ...t, keyframes: a });
|
|
1034
1035
|
r === "mirror" && (this.mirroredGenerator = l({
|
|
1035
1036
|
...t,
|
|
@@ -1051,13 +1052,13 @@ class Mt extends Ct {
|
|
|
1051
1052
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, t) : this.speed < 0 && (this.startTime = Math.min(t - i / this.speed, this.startTime)), n ? this.currentTime = t : this.updateTime(t);
|
|
1052
1053
|
const p = this.currentTime - u * (this.playbackSpeed >= 0 ? 1 : -1), V = this.playbackSpeed >= 0 ? p < 0 : p > i;
|
|
1053
1054
|
this.currentTime = Math.max(p, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = i);
|
|
1054
|
-
let m = this.currentTime,
|
|
1055
|
+
let m = this.currentTime, M = s;
|
|
1055
1056
|
if (f) {
|
|
1056
1057
|
const S = Math.min(this.currentTime, i) / a;
|
|
1057
1058
|
let D = Math.floor(S), O = S % 1;
|
|
1058
|
-
!O && S >= 1 && (O = 1), O === 1 && D--, D = Math.min(D, f + 1), !!(D % 2) && (d === "reverse" ? (O = 1 - O, h && (O -= h / a)) : d === "mirror" && (
|
|
1059
|
+
!O && S >= 1 && (O = 1), O === 1 && D--, D = Math.min(D, f + 1), !!(D % 2) && (d === "reverse" ? (O = 1 - O, h && (O -= h / a)) : d === "mirror" && (M = o)), m = Y(0, 1, O) * a;
|
|
1059
1060
|
}
|
|
1060
|
-
const w = V ? { done: !1, value: c[0] } :
|
|
1061
|
+
const w = V ? { done: !1, value: c[0] } : M.next(m);
|
|
1061
1062
|
r && (w.value = r(w.value));
|
|
1062
1063
|
let { done: A } = w;
|
|
1063
1064
|
!V && l !== null && (A = this.playbackSpeed >= 0 ? this.currentTime >= i : this.currentTime <= 0);
|
|
@@ -1094,7 +1095,7 @@ class Mt extends Ct {
|
|
|
1094
1095
|
var i, r;
|
|
1095
1096
|
if (this.isStopped)
|
|
1096
1097
|
return;
|
|
1097
|
-
const { driver: t =
|
|
1098
|
+
const { driver: t = yr, startTime: n } = this.options;
|
|
1098
1099
|
this.driver || (this.driver = t((o) => this.tick(o))), (r = (i = this.options).onPlay) == null || r.call(i);
|
|
1099
1100
|
const s = this.driver.now();
|
|
1100
1101
|
this.state === "finished" ? (this.updateFinished(), this.startTime = s) : this.holdTime !== null ? this.startTime = s - this.holdTime : this.startTime || (this.startTime = n ?? s), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
|
|
@@ -1127,14 +1128,14 @@ class Mt extends Ct {
|
|
|
1127
1128
|
return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), (n = this.driver) == null || n.stop(), t.observe(this);
|
|
1128
1129
|
}
|
|
1129
1130
|
}
|
|
1130
|
-
function
|
|
1131
|
+
function Ir(e) {
|
|
1131
1132
|
for (let t = 1; t < e.length; t++)
|
|
1132
1133
|
e[t] ?? (e[t] = e[t - 1]);
|
|
1133
1134
|
}
|
|
1134
|
-
const
|
|
1135
|
-
const t =
|
|
1135
|
+
const H = (e) => e * 180 / Math.PI, et = (e) => {
|
|
1136
|
+
const t = H(Math.atan2(e[1], e[0]));
|
|
1136
1137
|
return tt(t);
|
|
1137
|
-
},
|
|
1138
|
+
}, kr = {
|
|
1138
1139
|
x: 4,
|
|
1139
1140
|
y: 5,
|
|
1140
1141
|
translateX: 4,
|
|
@@ -1144,10 +1145,10 @@ const G = (e) => e * 180 / Math.PI, et = (e) => {
|
|
|
1144
1145
|
scale: (e) => (Math.abs(e[0]) + Math.abs(e[3])) / 2,
|
|
1145
1146
|
rotate: et,
|
|
1146
1147
|
rotateZ: et,
|
|
1147
|
-
skewX: (e) =>
|
|
1148
|
-
skewY: (e) =>
|
|
1148
|
+
skewX: (e) => H(Math.atan(e[1])),
|
|
1149
|
+
skewY: (e) => H(Math.atan(e[2])),
|
|
1149
1150
|
skew: (e) => (Math.abs(e[1]) + Math.abs(e[2])) / 2
|
|
1150
|
-
}, tt = (e) => (e = e % 360, e < 0 && (e += 360), e), Qt = et, en = (e) => Math.sqrt(e[0] * e[0] + e[1] * e[1]), tn = (e) => Math.sqrt(e[4] * e[4] + e[5] * e[5]),
|
|
1151
|
+
}, tt = (e) => (e = e % 360, e < 0 && (e += 360), e), Qt = et, en = (e) => Math.sqrt(e[0] * e[0] + e[1] * e[1]), tn = (e) => Math.sqrt(e[4] * e[4] + e[5] * e[5]), Nr = {
|
|
1151
1152
|
x: 12,
|
|
1152
1153
|
y: 13,
|
|
1153
1154
|
z: 14,
|
|
@@ -1157,12 +1158,12 @@ const G = (e) => e * 180 / Math.PI, et = (e) => {
|
|
|
1157
1158
|
scaleX: en,
|
|
1158
1159
|
scaleY: tn,
|
|
1159
1160
|
scale: (e) => (en(e) + tn(e)) / 2,
|
|
1160
|
-
rotateX: (e) => tt(
|
|
1161
|
-
rotateY: (e) => tt(
|
|
1161
|
+
rotateX: (e) => tt(H(Math.atan2(e[6], e[5]))),
|
|
1162
|
+
rotateY: (e) => tt(H(Math.atan2(-e[2], e[0]))),
|
|
1162
1163
|
rotateZ: Qt,
|
|
1163
1164
|
rotate: Qt,
|
|
1164
|
-
skewX: (e) =>
|
|
1165
|
-
skewY: (e) =>
|
|
1165
|
+
skewX: (e) => H(Math.atan(e[4])),
|
|
1166
|
+
skewY: (e) => H(Math.atan(e[1])),
|
|
1166
1167
|
skew: (e) => (Math.abs(e[1]) + Math.abs(e[4])) / 2
|
|
1167
1168
|
};
|
|
1168
1169
|
function nt(e) {
|
|
@@ -1174,21 +1175,21 @@ function st(e, t) {
|
|
|
1174
1175
|
const n = e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
|
|
1175
1176
|
let s, i;
|
|
1176
1177
|
if (n)
|
|
1177
|
-
s =
|
|
1178
|
+
s = Nr, i = n;
|
|
1178
1179
|
else {
|
|
1179
1180
|
const a = e.match(/^matrix\(([-\d.e\s,]+)\)$/u);
|
|
1180
|
-
s =
|
|
1181
|
+
s = kr, i = a;
|
|
1181
1182
|
}
|
|
1182
1183
|
if (!i)
|
|
1183
1184
|
return nt(t);
|
|
1184
|
-
const r = s[t], o = i[1].split(",").map(
|
|
1185
|
+
const r = s[t], o = i[1].split(",").map(Kr);
|
|
1185
1186
|
return typeof r == "function" ? r(o) : o[r];
|
|
1186
1187
|
}
|
|
1187
|
-
const
|
|
1188
|
+
const Br = (e, t) => {
|
|
1188
1189
|
const { transform: n = "none" } = getComputedStyle(e);
|
|
1189
1190
|
return st(n, t);
|
|
1190
1191
|
};
|
|
1191
|
-
function
|
|
1192
|
+
function Kr(e) {
|
|
1192
1193
|
return parseFloat(e.trim());
|
|
1193
1194
|
}
|
|
1194
1195
|
const le = [
|
|
@@ -1209,15 +1210,15 @@ const le = [
|
|
|
1209
1210
|
"skew",
|
|
1210
1211
|
"skewX",
|
|
1211
1212
|
"skewY"
|
|
1212
|
-
], fe = new Set(le), nn = (e) => e === ce || e === b,
|
|
1213
|
-
function
|
|
1213
|
+
], fe = new Set(le), nn = (e) => e === ce || e === b, Wr = /* @__PURE__ */ new Set(["x", "y", "z"]), $r = le.filter((e) => !Wr.has(e));
|
|
1214
|
+
function jr(e) {
|
|
1214
1215
|
const t = [];
|
|
1215
|
-
return
|
|
1216
|
+
return $r.forEach((n) => {
|
|
1216
1217
|
const s = e.getValue(n);
|
|
1217
1218
|
s !== void 0 && (t.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
1218
1219
|
}), t;
|
|
1219
1220
|
}
|
|
1220
|
-
const
|
|
1221
|
+
const G = {
|
|
1221
1222
|
// Dimensions
|
|
1222
1223
|
width: ({ x: e }, { paddingLeft: t = "0", paddingRight: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
|
|
1223
1224
|
height: ({ y: e }, { paddingTop: t = "0", paddingBottom: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
|
|
@@ -1229,15 +1230,15 @@ const H = {
|
|
|
1229
1230
|
x: (e, { transform: t }) => st(t, "x"),
|
|
1230
1231
|
y: (e, { transform: t }) => st(t, "y")
|
|
1231
1232
|
};
|
|
1232
|
-
|
|
1233
|
-
|
|
1233
|
+
G.translateX = G.x;
|
|
1234
|
+
G.translateY = G.y;
|
|
1234
1235
|
const z = /* @__PURE__ */ new Set();
|
|
1235
1236
|
let it = !1, rt = !1, ot = !1;
|
|
1236
1237
|
function rs() {
|
|
1237
1238
|
if (rt) {
|
|
1238
1239
|
const e = Array.from(z).filter((s) => s.needsMeasurement), t = new Set(e.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
1239
1240
|
t.forEach((s) => {
|
|
1240
|
-
const i =
|
|
1241
|
+
const i = jr(s);
|
|
1241
1242
|
i.length && (n.set(s, i), s.render());
|
|
1242
1243
|
}), e.forEach((s) => s.measureInitialState()), t.forEach((s) => {
|
|
1243
1244
|
s.render();
|
|
@@ -1257,7 +1258,7 @@ function os() {
|
|
|
1257
1258
|
e.readKeyframes(), e.needsMeasurement && (rt = !0);
|
|
1258
1259
|
});
|
|
1259
1260
|
}
|
|
1260
|
-
function
|
|
1261
|
+
function _r() {
|
|
1261
1262
|
ot = !0, os(), rs(), ot = !1;
|
|
1262
1263
|
}
|
|
1263
1264
|
class Pt {
|
|
@@ -1279,7 +1280,7 @@ class Pt {
|
|
|
1279
1280
|
}
|
|
1280
1281
|
t[0] === void 0 && (t[0] = o), i && r === void 0 && i.set(t[0]);
|
|
1281
1282
|
}
|
|
1282
|
-
|
|
1283
|
+
Ir(t);
|
|
1283
1284
|
}
|
|
1284
1285
|
setFinalKeyframe() {
|
|
1285
1286
|
}
|
|
@@ -1299,16 +1300,16 @@ class Pt {
|
|
|
1299
1300
|
this.state === "pending" && this.scheduleResolve();
|
|
1300
1301
|
}
|
|
1301
1302
|
}
|
|
1302
|
-
const
|
|
1303
|
-
function
|
|
1304
|
-
|
|
1303
|
+
const Ur = (e) => e.startsWith("--");
|
|
1304
|
+
function Hr(e, t, n) {
|
|
1305
|
+
Ur(t) ? e.style.setProperty(t, n) : e.style[t] = n;
|
|
1305
1306
|
}
|
|
1306
|
-
const Gr = /* @__PURE__ */ yt(() => window.ScrollTimeline !== void 0),
|
|
1307
|
-
function
|
|
1307
|
+
const Gr = /* @__PURE__ */ yt(() => window.ScrollTimeline !== void 0), zr = {};
|
|
1308
|
+
function Yr(e, t) {
|
|
1308
1309
|
const n = /* @__PURE__ */ yt(e);
|
|
1309
|
-
return () =>
|
|
1310
|
+
return () => zr[t] ?? n();
|
|
1310
1311
|
}
|
|
1311
|
-
const as = /* @__PURE__ */
|
|
1312
|
+
const as = /* @__PURE__ */ Yr(() => {
|
|
1312
1313
|
try {
|
|
1313
1314
|
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
1314
1315
|
} catch {
|
|
@@ -1328,9 +1329,9 @@ const as = /* @__PURE__ */ zr(() => {
|
|
|
1328
1329
|
};
|
|
1329
1330
|
function cs(e, t) {
|
|
1330
1331
|
if (e)
|
|
1331
|
-
return typeof e == "function" ? as() ? ns(e, t) : "ease-out" :
|
|
1332
|
+
return typeof e == "function" ? as() ? ns(e, t) : "ease-out" : Hn(e) ? he(e) : Array.isArray(e) ? e.map((n) => cs(n, t) || sn.easeOut) : sn[e];
|
|
1332
1333
|
}
|
|
1333
|
-
function
|
|
1334
|
+
function Xr(e, t, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a = "easeOut", times: l } = {}, u = void 0) {
|
|
1334
1335
|
const c = {
|
|
1335
1336
|
[t]: n
|
|
1336
1337
|
};
|
|
@@ -1350,20 +1351,20 @@ function Yr(e, t, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatTyp
|
|
|
1350
1351
|
function us(e) {
|
|
1351
1352
|
return typeof e == "function" && "applyToOptions" in e;
|
|
1352
1353
|
}
|
|
1353
|
-
function
|
|
1354
|
+
function qr({ type: e, ...t }) {
|
|
1354
1355
|
return us(e) && as() ? e.applyToOptions(t) : (t.duration ?? (t.duration = 300), t.ease ?? (t.ease = "easeOut"), t);
|
|
1355
1356
|
}
|
|
1356
|
-
class
|
|
1357
|
+
class Zr extends Ct {
|
|
1357
1358
|
constructor(t) {
|
|
1358
1359
|
if (super(), this.finishedTime = null, this.isStopped = !1, !t)
|
|
1359
1360
|
return;
|
|
1360
1361
|
const { element: n, name: s, keyframes: i, pseudoElement: r, allowFlatten: o = !1, finalKeyframe: a, onComplete: l } = t;
|
|
1361
1362
|
this.isPseudoElement = !!r, this.allowFlatten = o, this.options = t, X(typeof t.type != "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring");
|
|
1362
|
-
const u =
|
|
1363
|
-
this.animation =
|
|
1363
|
+
const u = qr(t);
|
|
1364
|
+
this.animation = Xr(n, s, i, u, r), u.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
|
|
1364
1365
|
if (this.finishedTime = this.time, !r) {
|
|
1365
1366
|
const c = At(i, this.options, a, this.speed);
|
|
1366
|
-
this.updateMotionValue ? this.updateMotionValue(c) :
|
|
1367
|
+
this.updateMotionValue ? this.updateMotionValue(c) : Hr(n, s, c), this.animation.cancel();
|
|
1367
1368
|
}
|
|
1368
1369
|
l == null || l(), this.notifyFinished();
|
|
1369
1370
|
};
|
|
@@ -1450,16 +1451,16 @@ const ls = {
|
|
|
1450
1451
|
backInOut: $n,
|
|
1451
1452
|
circInOut: _n
|
|
1452
1453
|
};
|
|
1453
|
-
function
|
|
1454
|
+
function Jr(e) {
|
|
1454
1455
|
return e in ls;
|
|
1455
1456
|
}
|
|
1456
|
-
function
|
|
1457
|
-
typeof e.ease == "string" &&
|
|
1457
|
+
function Qr(e) {
|
|
1458
|
+
typeof e.ease == "string" && Jr(e.ease) && (e.ease = ls[e.ease]);
|
|
1458
1459
|
}
|
|
1459
1460
|
const rn = 10;
|
|
1460
|
-
class
|
|
1461
|
+
class eo extends Zr {
|
|
1461
1462
|
constructor(t) {
|
|
1462
|
-
|
|
1463
|
+
Qr(t), is(t), super(t), t.startTime && (this.startTime = t.startTime), this.options = t;
|
|
1463
1464
|
}
|
|
1464
1465
|
/**
|
|
1465
1466
|
* WAAPI doesn't natively have any interruption capabilities.
|
|
@@ -1487,7 +1488,7 @@ class Qr extends qr {
|
|
|
1487
1488
|
const on = (e, t) => t === "zIndex" ? !1 : !!(typeof e == "number" || Array.isArray(e) || typeof e == "string" && // It's animatable if we have a string
|
|
1488
1489
|
(ue.test(e) || e === "0") && // And it contains numbers and/or colors
|
|
1489
1490
|
!e.startsWith("url("));
|
|
1490
|
-
function
|
|
1491
|
+
function to(e) {
|
|
1491
1492
|
const t = e[0];
|
|
1492
1493
|
if (e.length === 1)
|
|
1493
1494
|
return !0;
|
|
@@ -1495,40 +1496,40 @@ function eo(e) {
|
|
|
1495
1496
|
if (e[n] !== t)
|
|
1496
1497
|
return !0;
|
|
1497
1498
|
}
|
|
1498
|
-
function
|
|
1499
|
+
function no(e, t, n, s) {
|
|
1499
1500
|
const i = e[0];
|
|
1500
1501
|
if (i === null)
|
|
1501
1502
|
return !1;
|
|
1502
1503
|
if (t === "display" || t === "visibility")
|
|
1503
1504
|
return !0;
|
|
1504
1505
|
const r = e[e.length - 1], o = on(i, t), a = on(r, t);
|
|
1505
|
-
return ve(o === a, `You are trying to animate ${t} from "${i}" to "${r}". "${o ? r : i}" is not an animatable value.`, "value-not-animatable"), !o || !a ? !1 :
|
|
1506
|
+
return ve(o === a, `You are trying to animate ${t} from "${i}" to "${r}". "${o ? r : i}" is not an animatable value.`, "value-not-animatable"), !o || !a ? !1 : to(e) || (n === "spring" || us(n)) && s;
|
|
1506
1507
|
}
|
|
1507
1508
|
function at(e) {
|
|
1508
1509
|
e.duration = 0, e.type;
|
|
1509
1510
|
}
|
|
1510
|
-
const
|
|
1511
|
+
const so = /* @__PURE__ */ new Set([
|
|
1511
1512
|
"opacity",
|
|
1512
1513
|
"clipPath",
|
|
1513
1514
|
"filter",
|
|
1514
1515
|
"transform"
|
|
1515
1516
|
// TODO: Could be re-enabled now we have support for linear() easing
|
|
1516
1517
|
// "background-color"
|
|
1517
|
-
]),
|
|
1518
|
-
function
|
|
1518
|
+
]), io = /* @__PURE__ */ yt(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
1519
|
+
function ro(e) {
|
|
1519
1520
|
var c;
|
|
1520
1521
|
const { motionValue: t, name: n, repeatDelay: s, repeatType: i, damping: r, type: o } = e;
|
|
1521
1522
|
if (!(((c = t == null ? void 0 : t.owner) == null ? void 0 : c.current) instanceof HTMLElement))
|
|
1522
1523
|
return !1;
|
|
1523
1524
|
const { onUpdate: l, transformTemplate: u } = t.owner.getProps();
|
|
1524
|
-
return
|
|
1525
|
+
return io() && n && so.has(n) && (n !== "transform" || !u) && /**
|
|
1525
1526
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
1526
1527
|
* no way to read the value from WAAPI every frame.
|
|
1527
1528
|
*/
|
|
1528
1529
|
!l && !s && i !== "mirror" && r !== 0 && o !== "inertia";
|
|
1529
1530
|
}
|
|
1530
|
-
const
|
|
1531
|
-
class
|
|
1531
|
+
const oo = 40;
|
|
1532
|
+
class ao extends Ct {
|
|
1532
1533
|
constructor({ autoplay: t = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", keyframes: a, name: l, motionValue: u, element: c, ...f }) {
|
|
1533
1534
|
var g;
|
|
1534
1535
|
super(), this.stop = () => {
|
|
@@ -1552,13 +1553,13 @@ class oo extends Ct {
|
|
|
1552
1553
|
onKeyframesResolved(t, n, s, i) {
|
|
1553
1554
|
this.keyframeResolver = void 0;
|
|
1554
1555
|
const { name: r, type: o, velocity: a, delay: l, isHandoff: u, onUpdate: c } = s;
|
|
1555
|
-
this.resolvedAt = I.now(),
|
|
1556
|
+
this.resolvedAt = I.now(), no(t, r, o, a) || ((W.instantAnimations || !l) && (c == null || c(At(t, s, n))), t[0] = t[t.length - 1], at(s), s.repeat = 0);
|
|
1556
1557
|
const d = {
|
|
1557
|
-
startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt >
|
|
1558
|
+
startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt > oo ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
|
|
1558
1559
|
finalKeyframe: n,
|
|
1559
1560
|
...s,
|
|
1560
1561
|
keyframes: t
|
|
1561
|
-
}, h = !u &&
|
|
1562
|
+
}, h = !u && ro(d) ? new eo({
|
|
1562
1563
|
...d,
|
|
1563
1564
|
element: d.motionValue.owner.current
|
|
1564
1565
|
}) : new Mt(d);
|
|
@@ -1573,7 +1574,7 @@ class oo extends Ct {
|
|
|
1573
1574
|
}
|
|
1574
1575
|
get animation() {
|
|
1575
1576
|
var t;
|
|
1576
|
-
return this._animation || ((t = this.keyframeResolver) == null || t.resume(),
|
|
1577
|
+
return this._animation || ((t = this.keyframeResolver) == null || t.resume(), _r()), this._animation;
|
|
1577
1578
|
}
|
|
1578
1579
|
get duration() {
|
|
1579
1580
|
return this.animation.duration;
|
|
@@ -1613,21 +1614,21 @@ class oo extends Ct {
|
|
|
1613
1614
|
this._animation && this.animation.cancel(), (t = this.keyframeResolver) == null || t.cancel();
|
|
1614
1615
|
}
|
|
1615
1616
|
}
|
|
1616
|
-
const
|
|
1617
|
+
const co = (
|
|
1617
1618
|
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
1618
1619
|
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
1619
1620
|
);
|
|
1620
|
-
function
|
|
1621
|
-
const t =
|
|
1621
|
+
function uo(e) {
|
|
1622
|
+
const t = co.exec(e);
|
|
1622
1623
|
if (!t)
|
|
1623
1624
|
return [,];
|
|
1624
1625
|
const [, n, s, i] = t;
|
|
1625
1626
|
return [`--${n ?? s}`, i];
|
|
1626
1627
|
}
|
|
1627
|
-
const
|
|
1628
|
+
const lo = 4;
|
|
1628
1629
|
function fs(e, t, n = 1) {
|
|
1629
|
-
X(n <=
|
|
1630
|
-
const [s, i] =
|
|
1630
|
+
X(n <= lo, `Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
|
|
1631
|
+
const [s, i] = uo(e);
|
|
1631
1632
|
if (!s)
|
|
1632
1633
|
return;
|
|
1633
1634
|
const r = window.getComputedStyle(t).getPropertyValue(s);
|
|
@@ -1648,15 +1649,15 @@ const hs = /* @__PURE__ */ new Set([
|
|
|
1648
1649
|
"right",
|
|
1649
1650
|
"bottom",
|
|
1650
1651
|
...le
|
|
1651
|
-
]),
|
|
1652
|
+
]), fo = {
|
|
1652
1653
|
test: (e) => e === "auto",
|
|
1653
1654
|
parse: (e) => e
|
|
1654
|
-
}, ps = (e) => (t) => t.test(e), ms = [ce, b, te, $,
|
|
1655
|
-
function
|
|
1655
|
+
}, ps = (e) => (t) => t.test(e), ms = [ce, b, te, $, tr, er, fo], an = (e) => ms.find(ps(e));
|
|
1656
|
+
function ho(e) {
|
|
1656
1657
|
return typeof e == "number" ? e === 0 : e !== null ? e === "none" || e === "0" || On(e) : !0;
|
|
1657
1658
|
}
|
|
1658
|
-
const
|
|
1659
|
-
function
|
|
1659
|
+
const po = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
1660
|
+
function mo(e) {
|
|
1660
1661
|
const [t, n] = e.slice(0, -1).split("(");
|
|
1661
1662
|
if (t === "drop-shadow")
|
|
1662
1663
|
return e;
|
|
@@ -1664,19 +1665,19 @@ function po(e) {
|
|
|
1664
1665
|
if (!s)
|
|
1665
1666
|
return e;
|
|
1666
1667
|
const i = n.replace(s, "");
|
|
1667
|
-
let r =
|
|
1668
|
+
let r = po.has(t) ? 1 : 0;
|
|
1668
1669
|
return s !== n && (r *= 100), t + "(" + r + i + ")";
|
|
1669
1670
|
}
|
|
1670
|
-
const
|
|
1671
|
+
const go = /\b([a-z-]*)\(.*?\)/gu, ct = {
|
|
1671
1672
|
...ue,
|
|
1672
1673
|
getAnimatableNone: (e) => {
|
|
1673
|
-
const t = e.match(
|
|
1674
|
-
return t ? t.map(
|
|
1674
|
+
const t = e.match(go);
|
|
1675
|
+
return t ? t.map(mo).join(" ") : e;
|
|
1675
1676
|
}
|
|
1676
1677
|
}, cn = {
|
|
1677
1678
|
...ce,
|
|
1678
1679
|
transform: Math.round
|
|
1679
|
-
},
|
|
1680
|
+
}, yo = {
|
|
1680
1681
|
rotate: $,
|
|
1681
1682
|
rotateX: $,
|
|
1682
1683
|
rotateY: $,
|
|
@@ -1737,13 +1738,13 @@ const mo = /\b([a-z-]*)\(.*?\)/gu, ct = {
|
|
|
1737
1738
|
// Misc
|
|
1738
1739
|
backgroundPositionX: b,
|
|
1739
1740
|
backgroundPositionY: b,
|
|
1740
|
-
...
|
|
1741
|
+
...yo,
|
|
1741
1742
|
zIndex: cn,
|
|
1742
1743
|
// SVG
|
|
1743
1744
|
fillOpacity: ge,
|
|
1744
1745
|
strokeOpacity: ge,
|
|
1745
1746
|
numOctaves: cn
|
|
1746
|
-
},
|
|
1747
|
+
}, bo = {
|
|
1747
1748
|
...Et,
|
|
1748
1749
|
// Color props
|
|
1749
1750
|
color: E,
|
|
@@ -1759,23 +1760,23 @@ const mo = /\b([a-z-]*)\(.*?\)/gu, ct = {
|
|
|
1759
1760
|
borderLeftColor: E,
|
|
1760
1761
|
filter: ct,
|
|
1761
1762
|
WebkitFilter: ct
|
|
1762
|
-
}, gs = (e) =>
|
|
1763
|
+
}, gs = (e) => bo[e];
|
|
1763
1764
|
function ys(e, t) {
|
|
1764
1765
|
let n = gs(e);
|
|
1765
1766
|
return n !== ct && (n = ue), n.getAnimatableNone ? n.getAnimatableNone(t) : void 0;
|
|
1766
1767
|
}
|
|
1767
|
-
const
|
|
1768
|
-
function
|
|
1768
|
+
const vo = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
1769
|
+
function To(e, t, n) {
|
|
1769
1770
|
let s = 0, i;
|
|
1770
1771
|
for (; s < e.length && !i; ) {
|
|
1771
1772
|
const r = e[s];
|
|
1772
|
-
typeof r == "string" && !
|
|
1773
|
+
typeof r == "string" && !vo.has(r) && ye(r).values.length && (i = e[s]), s++;
|
|
1773
1774
|
}
|
|
1774
1775
|
if (i && n)
|
|
1775
1776
|
for (const r of t)
|
|
1776
1777
|
e[r] = ys(n, i);
|
|
1777
1778
|
}
|
|
1778
|
-
class
|
|
1779
|
+
class wo extends Pt {
|
|
1779
1780
|
constructor(t, n, s, i, r) {
|
|
1780
1781
|
super(t, n, s, i, r, !0);
|
|
1781
1782
|
}
|
|
@@ -1800,19 +1801,19 @@ class To extends Pt {
|
|
|
1800
1801
|
const u = t[l];
|
|
1801
1802
|
typeof u == "string" && (t[l] = parseFloat(u));
|
|
1802
1803
|
}
|
|
1803
|
-
else
|
|
1804
|
+
else G[s] && (this.needsMeasurement = !0);
|
|
1804
1805
|
}
|
|
1805
1806
|
resolveNoneKeyframes() {
|
|
1806
1807
|
const { unresolvedKeyframes: t, name: n } = this, s = [];
|
|
1807
1808
|
for (let i = 0; i < t.length; i++)
|
|
1808
|
-
(t[i] === null ||
|
|
1809
|
-
s.length &&
|
|
1809
|
+
(t[i] === null || ho(t[i])) && s.push(i);
|
|
1810
|
+
s.length && To(t, s, n);
|
|
1810
1811
|
}
|
|
1811
1812
|
measureInitialState() {
|
|
1812
1813
|
const { element: t, unresolvedKeyframes: n, name: s } = this;
|
|
1813
1814
|
if (!t || !t.current)
|
|
1814
1815
|
return;
|
|
1815
|
-
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin =
|
|
1816
|
+
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = G[s](t.measureViewportBox(), window.getComputedStyle(t.current)), n[0] = this.measuredOrigin;
|
|
1816
1817
|
const i = n[n.length - 1];
|
|
1817
1818
|
i !== void 0 && t.getValue(s, i).jump(i, !1);
|
|
1818
1819
|
}
|
|
@@ -1824,12 +1825,12 @@ class To extends Pt {
|
|
|
1824
1825
|
const i = t.getValue(n);
|
|
1825
1826
|
i && i.jump(this.measuredOrigin, !1);
|
|
1826
1827
|
const r = s.length - 1, o = s[r];
|
|
1827
|
-
s[r] =
|
|
1828
|
+
s[r] = G[n](t.measureViewportBox(), window.getComputedStyle(t.current)), o !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = o), (a = this.removedTransforms) != null && a.length && this.removedTransforms.forEach(([l, u]) => {
|
|
1828
1829
|
t.getValue(l).set(u);
|
|
1829
1830
|
}), this.resolveNoneKeyframes();
|
|
1830
1831
|
}
|
|
1831
1832
|
}
|
|
1832
|
-
function
|
|
1833
|
+
function So(e, t, n) {
|
|
1833
1834
|
if (e instanceof EventTarget)
|
|
1834
1835
|
return [e];
|
|
1835
1836
|
if (typeof e == "string") {
|
|
@@ -1840,11 +1841,11 @@ function wo(e, t, n) {
|
|
|
1840
1841
|
return Array.from(e);
|
|
1841
1842
|
}
|
|
1842
1843
|
const bs = (e, t) => t && typeof e == "number" ? t.transform(e) : e;
|
|
1843
|
-
function
|
|
1844
|
-
return
|
|
1844
|
+
function xo(e) {
|
|
1845
|
+
return Ii(e) && "offsetHeight" in e;
|
|
1845
1846
|
}
|
|
1846
|
-
const un = 30,
|
|
1847
|
-
class
|
|
1847
|
+
const un = 30, Vo = (e) => !isNaN(parseFloat(e));
|
|
1848
|
+
class Ao {
|
|
1848
1849
|
/**
|
|
1849
1850
|
* @param init - The initiating value
|
|
1850
1851
|
* @param config - Optional configuration options
|
|
@@ -1861,7 +1862,7 @@ class Vo {
|
|
|
1861
1862
|
}, this.hasAnimated = !1, this.setCurrent(t), this.owner = n.owner;
|
|
1862
1863
|
}
|
|
1863
1864
|
setCurrent(t) {
|
|
1864
|
-
this.current = t, this.updatedAt = I.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity =
|
|
1865
|
+
this.current = t, this.updatedAt = I.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = Vo(this.current));
|
|
1865
1866
|
}
|
|
1866
1867
|
setPrevFrameValue(t = this.current) {
|
|
1867
1868
|
this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -2047,16 +2048,16 @@ class Vo {
|
|
|
2047
2048
|
}
|
|
2048
2049
|
}
|
|
2049
2050
|
function Fe(e, t) {
|
|
2050
|
-
return new
|
|
2051
|
+
return new Ao(e, t);
|
|
2051
2052
|
}
|
|
2052
|
-
const { schedule:
|
|
2053
|
+
const { schedule: Co } = /* @__PURE__ */ Gn(queueMicrotask, !1), Mo = {
|
|
2053
2054
|
y: !1
|
|
2054
2055
|
};
|
|
2055
|
-
function
|
|
2056
|
-
return
|
|
2056
|
+
function Po() {
|
|
2057
|
+
return Mo.y;
|
|
2057
2058
|
}
|
|
2058
2059
|
function vs(e, t) {
|
|
2059
|
-
const n =
|
|
2060
|
+
const n = So(e), s = new AbortController(), i = {
|
|
2060
2061
|
passive: !0,
|
|
2061
2062
|
...t,
|
|
2062
2063
|
signal: s.signal
|
|
@@ -2064,9 +2065,9 @@ function vs(e, t) {
|
|
|
2064
2065
|
return [n, i, () => s.abort()];
|
|
2065
2066
|
}
|
|
2066
2067
|
function ln(e) {
|
|
2067
|
-
return !(e.pointerType === "touch" ||
|
|
2068
|
+
return !(e.pointerType === "touch" || Po());
|
|
2068
2069
|
}
|
|
2069
|
-
function
|
|
2070
|
+
function Eo(e, t, n = {}) {
|
|
2070
2071
|
const [s, i, r] = vs(e, n), o = (a) => {
|
|
2071
2072
|
if (!ln(a))
|
|
2072
2073
|
return;
|
|
@@ -2082,15 +2083,15 @@ function Po(e, t, n = {}) {
|
|
|
2082
2083
|
a.addEventListener("pointerenter", o, i);
|
|
2083
2084
|
}), r;
|
|
2084
2085
|
}
|
|
2085
|
-
const Ts = (e, t) => t ? e === t ? !0 : Ts(e, t.parentElement) : !1,
|
|
2086
|
+
const Ts = (e, t) => t ? e === t ? !0 : Ts(e, t.parentElement) : !1, Do = (e) => e.pointerType === "mouse" ? typeof e.button != "number" || e.button <= 0 : e.isPrimary !== !1, Fo = /* @__PURE__ */ new Set([
|
|
2086
2087
|
"BUTTON",
|
|
2087
2088
|
"INPUT",
|
|
2088
2089
|
"SELECT",
|
|
2089
2090
|
"TEXTAREA",
|
|
2090
2091
|
"A"
|
|
2091
2092
|
]);
|
|
2092
|
-
function
|
|
2093
|
-
return
|
|
2093
|
+
function Oo(e) {
|
|
2094
|
+
return Fo.has(e.tagName) || e.tabIndex !== -1;
|
|
2094
2095
|
}
|
|
2095
2096
|
const Ae = /* @__PURE__ */ new WeakSet();
|
|
2096
2097
|
function fn(e) {
|
|
@@ -2101,7 +2102,7 @@ function fn(e) {
|
|
|
2101
2102
|
function Ue(e, t) {
|
|
2102
2103
|
e.dispatchEvent(new PointerEvent("pointer" + t, { isPrimary: !0, bubbles: !0 }));
|
|
2103
2104
|
}
|
|
2104
|
-
const
|
|
2105
|
+
const Ro = (e, t) => {
|
|
2105
2106
|
const n = e.currentTarget;
|
|
2106
2107
|
if (!n)
|
|
2107
2108
|
return;
|
|
@@ -2117,9 +2118,9 @@ const Oo = (e, t) => {
|
|
|
2117
2118
|
n.addEventListener("keydown", s, t), n.addEventListener("blur", () => n.removeEventListener("keydown", s), t);
|
|
2118
2119
|
};
|
|
2119
2120
|
function dn(e) {
|
|
2120
|
-
return
|
|
2121
|
+
return Do(e) && !0;
|
|
2121
2122
|
}
|
|
2122
|
-
function
|
|
2123
|
+
function Lo(e, t, n = {}) {
|
|
2123
2124
|
const [s, i, r] = vs(e, n), o = (a) => {
|
|
2124
2125
|
const l = a.currentTarget;
|
|
2125
2126
|
if (!dn(a))
|
|
@@ -2135,10 +2136,10 @@ function Ro(e, t, n = {}) {
|
|
|
2135
2136
|
window.addEventListener("pointerup", f, i), window.addEventListener("pointercancel", d, i);
|
|
2136
2137
|
};
|
|
2137
2138
|
return s.forEach((a) => {
|
|
2138
|
-
(n.useGlobalTarget ? window : a).addEventListener("pointerdown", o, i),
|
|
2139
|
+
(n.useGlobalTarget ? window : a).addEventListener("pointerdown", o, i), xo(a) && (a.addEventListener("focus", (u) => Ro(u, i)), !Oo(a) && !a.hasAttribute("tabindex") && (a.tabIndex = 0));
|
|
2139
2140
|
}), r;
|
|
2140
2141
|
}
|
|
2141
|
-
const R = (e) => !!(e && e.getVelocity),
|
|
2142
|
+
const R = (e) => !!(e && e.getVelocity), Io = [...ms, E, ue], ko = (e) => Io.find(ps(e)), ws = oe({
|
|
2142
2143
|
transformPagePoint: (e) => e,
|
|
2143
2144
|
isStatic: !1,
|
|
2144
2145
|
reducedMotion: "never"
|
|
@@ -2173,22 +2174,22 @@ function pn(e) {
|
|
|
2173
2174
|
...e[t]
|
|
2174
2175
|
};
|
|
2175
2176
|
}
|
|
2176
|
-
function
|
|
2177
|
-
const [, s] = Xs(!
|
|
2178
|
-
if (!
|
|
2177
|
+
function No({ children: e, features: t, strict: n = !1 }) {
|
|
2178
|
+
const [, s] = Xs(!He(t)), i = pe(void 0);
|
|
2179
|
+
if (!He(t)) {
|
|
2179
2180
|
const { renderer: r, ...o } = t;
|
|
2180
2181
|
i.current = r, pn(o);
|
|
2181
2182
|
}
|
|
2182
2183
|
return pt(() => {
|
|
2183
|
-
|
|
2184
|
+
He(t) && t().then(({ renderer: r, ...o }) => {
|
|
2184
2185
|
pn(o), i.current = r, s(!0);
|
|
2185
2186
|
});
|
|
2186
|
-
}, []),
|
|
2187
|
+
}, []), C(Dt.Provider, { value: { renderer: i.current, strict: n }, children: e });
|
|
2187
2188
|
}
|
|
2188
|
-
function
|
|
2189
|
+
function He(e) {
|
|
2189
2190
|
return typeof e == "function";
|
|
2190
2191
|
}
|
|
2191
|
-
const
|
|
2192
|
+
const Bo = /* @__PURE__ */ new Set([
|
|
2192
2193
|
"animate",
|
|
2193
2194
|
"exit",
|
|
2194
2195
|
"variants",
|
|
@@ -2221,17 +2222,17 @@ const No = /* @__PURE__ */ new Set([
|
|
|
2221
2222
|
"viewport"
|
|
2222
2223
|
]);
|
|
2223
2224
|
function Oe(e) {
|
|
2224
|
-
return e.startsWith("while") || e.startsWith("drag") && e !== "draggable" || e.startsWith("layout") || e.startsWith("onTap") || e.startsWith("onPan") || e.startsWith("onLayout") ||
|
|
2225
|
+
return e.startsWith("while") || e.startsWith("drag") && e !== "draggable" || e.startsWith("layout") || e.startsWith("onTap") || e.startsWith("onPan") || e.startsWith("onLayout") || Bo.has(e);
|
|
2225
2226
|
}
|
|
2226
2227
|
let Ss = (e) => !Oe(e);
|
|
2227
|
-
function
|
|
2228
|
+
function Ko(e) {
|
|
2228
2229
|
typeof e == "function" && (Ss = (t) => t.startsWith("on") ? !Oe(t) : e(t));
|
|
2229
2230
|
}
|
|
2230
2231
|
try {
|
|
2231
|
-
|
|
2232
|
+
Ko(require("@emotion/is-prop-valid").default);
|
|
2232
2233
|
} catch {
|
|
2233
2234
|
}
|
|
2234
|
-
function
|
|
2235
|
+
function Wo(e, t, n) {
|
|
2235
2236
|
const s = {};
|
|
2236
2237
|
for (const i in e)
|
|
2237
2238
|
i === "values" && typeof e.values == "object" || (Ss(i) || n === !0 && Oe(i) || !t && !Oe(i) || // If trying to use native HTML drag events, forward drag listeners
|
|
@@ -2260,7 +2261,7 @@ function Be(e) {
|
|
|
2260
2261
|
function xs(e) {
|
|
2261
2262
|
return !!(Be(e) || e.variants);
|
|
2262
2263
|
}
|
|
2263
|
-
function
|
|
2264
|
+
function $o(e, t) {
|
|
2264
2265
|
if (Be(e)) {
|
|
2265
2266
|
const { initial: n, animate: s } = e;
|
|
2266
2267
|
return {
|
|
@@ -2270,26 +2271,26 @@ function Wo(e, t) {
|
|
|
2270
2271
|
}
|
|
2271
2272
|
return e.inherit !== !1 ? t : {};
|
|
2272
2273
|
}
|
|
2273
|
-
function
|
|
2274
|
-
const { initial: t, animate: n } =
|
|
2274
|
+
function jo(e) {
|
|
2275
|
+
const { initial: t, animate: n } = $o(e, k(ke));
|
|
2275
2276
|
return Re(() => ({ initial: t, animate: n }), [mn(t), mn(n)]);
|
|
2276
2277
|
}
|
|
2277
2278
|
function mn(e) {
|
|
2278
2279
|
return Array.isArray(e) ? e.join(" ") : e;
|
|
2279
2280
|
}
|
|
2280
|
-
const
|
|
2281
|
+
const _o = {};
|
|
2281
2282
|
function Vs(e, { layout: t, layoutId: n }) {
|
|
2282
|
-
return fe.has(e) || e.startsWith("origin") || (t || n !== void 0) && (!!
|
|
2283
|
+
return fe.has(e) || e.startsWith("origin") || (t || n !== void 0) && (!!_o[e] || e === "opacity");
|
|
2283
2284
|
}
|
|
2284
|
-
const
|
|
2285
|
+
const Uo = {
|
|
2285
2286
|
x: "translateX",
|
|
2286
2287
|
y: "translateY",
|
|
2287
2288
|
z: "translateZ",
|
|
2288
2289
|
transformPerspective: "perspective"
|
|
2289
|
-
},
|
|
2290
|
+
}, Ho = le.length;
|
|
2290
2291
|
function Go(e, t, n) {
|
|
2291
2292
|
let s = "", i = !0;
|
|
2292
|
-
for (let r = 0; r <
|
|
2293
|
+
for (let r = 0; r < Ho; r++) {
|
|
2293
2294
|
const o = le[r], a = e[o];
|
|
2294
2295
|
if (a === void 0)
|
|
2295
2296
|
continue;
|
|
@@ -2298,7 +2299,7 @@ function Go(e, t, n) {
|
|
|
2298
2299
|
const u = bs(a, Et[o]);
|
|
2299
2300
|
if (!l) {
|
|
2300
2301
|
i = !1;
|
|
2301
|
-
const c =
|
|
2302
|
+
const c = Uo[o] || o;
|
|
2302
2303
|
s += `${c}(${u}) `;
|
|
2303
2304
|
}
|
|
2304
2305
|
n && (t[o] = u);
|
|
@@ -2337,30 +2338,30 @@ function As(e, t, n) {
|
|
|
2337
2338
|
for (const s in t)
|
|
2338
2339
|
!R(t[s]) && !Vs(s, n) && (e[s] = t[s]);
|
|
2339
2340
|
}
|
|
2340
|
-
function
|
|
2341
|
+
function zo({ transformTemplate: e }, t) {
|
|
2341
2342
|
return Re(() => {
|
|
2342
2343
|
const n = Lt();
|
|
2343
2344
|
return Rt(n, t, e), Object.assign({}, n.vars, n.style);
|
|
2344
2345
|
}, [t]);
|
|
2345
2346
|
}
|
|
2346
|
-
function
|
|
2347
|
+
function Yo(e, t) {
|
|
2347
2348
|
const n = e.style || {}, s = {};
|
|
2348
|
-
return As(s, n, e), Object.assign(s,
|
|
2349
|
+
return As(s, n, e), Object.assign(s, zo(e, t)), s;
|
|
2349
2350
|
}
|
|
2350
|
-
function
|
|
2351
|
-
const n = {}, s =
|
|
2351
|
+
function Xo(e, t) {
|
|
2352
|
+
const n = {}, s = Yo(e, t);
|
|
2352
2353
|
return e.drag && e.dragListener !== !1 && (n.draggable = !1, s.userSelect = s.WebkitUserSelect = s.WebkitTouchCallout = "none", s.touchAction = e.drag === !0 ? "none" : `pan-${e.drag === "x" ? "y" : "x"}`), e.tabIndex === void 0 && (e.onTap || e.onTapStart || e.whileTap) && (n.tabIndex = 0), n.style = s, n;
|
|
2353
2354
|
}
|
|
2354
|
-
const
|
|
2355
|
+
const qo = {
|
|
2355
2356
|
offset: "stroke-dashoffset",
|
|
2356
2357
|
array: "stroke-dasharray"
|
|
2357
|
-
},
|
|
2358
|
+
}, Zo = {
|
|
2358
2359
|
offset: "strokeDashoffset",
|
|
2359
2360
|
array: "strokeDasharray"
|
|
2360
2361
|
};
|
|
2361
|
-
function
|
|
2362
|
+
function Jo(e, t, n = 1, s = 0, i = !0) {
|
|
2362
2363
|
e.pathLength = 1;
|
|
2363
|
-
const r = i ?
|
|
2364
|
+
const r = i ? qo : Zo;
|
|
2364
2365
|
e[r.offset] = b.transform(-s);
|
|
2365
2366
|
const o = b.transform(t), a = b.transform(n);
|
|
2366
2367
|
e[r.array] = `${o} ${a}`;
|
|
@@ -2381,13 +2382,13 @@ function Cs(e, {
|
|
|
2381
2382
|
}
|
|
2382
2383
|
e.attrs = e.style, e.style = {};
|
|
2383
2384
|
const { attrs: f, style: d } = e;
|
|
2384
|
-
f.transform && (d.transform = f.transform, delete f.transform), (d.transform || f.transformOrigin) && (d.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), d.transform && (d.transformBox = (c == null ? void 0 : c.transformBox) ?? "fill-box", delete f.transformBox), t !== void 0 && (f.x = t), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), i !== void 0 &&
|
|
2385
|
+
f.transform && (d.transform = f.transform, delete f.transform), (d.transform || f.transformOrigin) && (d.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), d.transform && (d.transformBox = (c == null ? void 0 : c.transformBox) ?? "fill-box", delete f.transformBox), t !== void 0 && (f.x = t), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), i !== void 0 && Jo(f, i, r, o, !1);
|
|
2385
2386
|
}
|
|
2386
2387
|
const Ms = () => ({
|
|
2387
2388
|
...Lt(),
|
|
2388
2389
|
attrs: {}
|
|
2389
2390
|
}), Ps = (e) => typeof e == "string" && e.toLowerCase() === "svg";
|
|
2390
|
-
function
|
|
2391
|
+
function Qo(e, t, n, s) {
|
|
2391
2392
|
const i = Re(() => {
|
|
2392
2393
|
const r = Ms();
|
|
2393
2394
|
return Cs(r, t, Ps(s), e.transformTemplate, e.style), {
|
|
@@ -2401,7 +2402,7 @@ function Jo(e, t, n, s) {
|
|
|
2401
2402
|
}
|
|
2402
2403
|
return i;
|
|
2403
2404
|
}
|
|
2404
|
-
const
|
|
2405
|
+
const ea = [
|
|
2405
2406
|
"animate",
|
|
2406
2407
|
"circle",
|
|
2407
2408
|
"defs",
|
|
@@ -2441,15 +2442,15 @@ function It(e) {
|
|
|
2441
2442
|
/**
|
|
2442
2443
|
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
2443
2444
|
*/
|
|
2444
|
-
!!(
|
|
2445
|
+
!!(ea.indexOf(e) > -1 || /**
|
|
2445
2446
|
* If it contains a capital letter, it's an SVG component
|
|
2446
2447
|
*/
|
|
2447
2448
|
/[A-Z]/u.test(e))
|
|
2448
2449
|
)
|
|
2449
2450
|
);
|
|
2450
2451
|
}
|
|
2451
|
-
function
|
|
2452
|
-
const a = (It(e) ?
|
|
2452
|
+
function ta(e, t, n, { latestValues: s }, i, r = !1) {
|
|
2453
|
+
const a = (It(e) ? Qo : Xo)(t, s, i, e), l = Wo(t, typeof e == "string", r), u = e !== xn ? { ...l, ...a, ref: n } : {}, { children: c } = t, f = Re(() => R(c) ? c.get() : c, [c]);
|
|
2453
2454
|
return qs(e, {
|
|
2454
2455
|
...u,
|
|
2455
2456
|
children: f
|
|
@@ -2472,19 +2473,19 @@ function kt(e, t, n, s) {
|
|
|
2472
2473
|
}
|
|
2473
2474
|
return t;
|
|
2474
2475
|
}
|
|
2475
|
-
function
|
|
2476
|
+
function na(e) {
|
|
2476
2477
|
return R(e) ? e.get() : e;
|
|
2477
2478
|
}
|
|
2478
|
-
function
|
|
2479
|
+
function sa({ scrapeMotionValuesFromProps: e, createRenderState: t }, n, s, i) {
|
|
2479
2480
|
return {
|
|
2480
|
-
latestValues:
|
|
2481
|
+
latestValues: ia(n, s, i, e),
|
|
2481
2482
|
renderState: t()
|
|
2482
2483
|
};
|
|
2483
2484
|
}
|
|
2484
|
-
function
|
|
2485
|
+
function ia(e, t, n, s) {
|
|
2485
2486
|
const i = {}, r = s(e, {});
|
|
2486
2487
|
for (const d in r)
|
|
2487
|
-
i[d] =
|
|
2488
|
+
i[d] = na(r[d]);
|
|
2488
2489
|
let { initial: o, animate: a } = e;
|
|
2489
2490
|
const l = Be(e), u = xs(e);
|
|
2490
2491
|
t && u && !l && e.inherit !== !1 && (o === void 0 && (o = t.initial), a === void 0 && (a = t.animate));
|
|
@@ -2500,8 +2501,8 @@ function sa(e, t, n, s) {
|
|
|
2500
2501
|
for (const V in p) {
|
|
2501
2502
|
let m = p[V];
|
|
2502
2503
|
if (Array.isArray(m)) {
|
|
2503
|
-
const
|
|
2504
|
-
m = m[
|
|
2504
|
+
const M = c ? m.length - 1 : 0;
|
|
2505
|
+
m = m[M];
|
|
2505
2506
|
}
|
|
2506
2507
|
m !== null && (i[V] = m);
|
|
2507
2508
|
}
|
|
@@ -2513,8 +2514,8 @@ function sa(e, t, n, s) {
|
|
|
2513
2514
|
return i;
|
|
2514
2515
|
}
|
|
2515
2516
|
const Es = (e) => (t, n) => {
|
|
2516
|
-
const s = k(ke), i = k(Dn), r = () =>
|
|
2517
|
-
return n ? r() :
|
|
2517
|
+
const s = k(ke), i = k(Dn), r = () => sa(e, t, s, i);
|
|
2518
|
+
return n ? r() : Fi(r);
|
|
2518
2519
|
};
|
|
2519
2520
|
function Nt(e, t, n) {
|
|
2520
2521
|
var r;
|
|
@@ -2523,7 +2524,7 @@ function Nt(e, t, n) {
|
|
|
2523
2524
|
(R(s[o]) || t.style && R(t.style[o]) || Vs(o, e) || ((r = n == null ? void 0 : n.getValue(o)) == null ? void 0 : r.liveStyle) !== void 0) && (i[o] = s[o]);
|
|
2524
2525
|
return i;
|
|
2525
2526
|
}
|
|
2526
|
-
const
|
|
2527
|
+
const ra = /* @__PURE__ */ Es({
|
|
2527
2528
|
scrapeMotionValuesFromProps: Nt,
|
|
2528
2529
|
createRenderState: Lt
|
|
2529
2530
|
});
|
|
@@ -2536,14 +2537,14 @@ function Ds(e, t, n) {
|
|
|
2536
2537
|
}
|
|
2537
2538
|
return s;
|
|
2538
2539
|
}
|
|
2539
|
-
const
|
|
2540
|
+
const oa = /* @__PURE__ */ Es({
|
|
2540
2541
|
scrapeMotionValuesFromProps: Ds,
|
|
2541
2542
|
createRenderState: Ms
|
|
2542
|
-
}),
|
|
2543
|
+
}), aa = Symbol.for("motionComponentSymbol");
|
|
2543
2544
|
function Fs(e) {
|
|
2544
2545
|
return e && typeof e == "object" && Object.prototype.hasOwnProperty.call(e, "current");
|
|
2545
2546
|
}
|
|
2546
|
-
function
|
|
2547
|
+
function ca(e, t, n) {
|
|
2547
2548
|
return Zs(
|
|
2548
2549
|
(s) => {
|
|
2549
2550
|
s && e.onMount && e.onMount(s), t && (s ? t.mount(s) : t.unmount()), n && (typeof n == "function" ? n(s) : Fs(n) && (n.current = s));
|
|
@@ -2556,8 +2557,8 @@ function aa(e, t, n) {
|
|
|
2556
2557
|
[t]
|
|
2557
2558
|
);
|
|
2558
2559
|
}
|
|
2559
|
-
const Bt = (e) => e.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(),
|
|
2560
|
-
function
|
|
2560
|
+
const Bt = (e) => e.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), ua = "framerAppearId", Os = "data-" + Bt(ua), la = oe({});
|
|
2561
|
+
function fa(e, t, n, s, i) {
|
|
2561
2562
|
var y, T;
|
|
2562
2563
|
const { visualElement: r } = k(ke), o = k(Dt), a = k(Dn), l = k(ws).reducedMotion, u = pe(null);
|
|
2563
2564
|
s = s || o.renderer, !u.current && s && (u.current = s(e, {
|
|
@@ -2568,14 +2569,14 @@ function la(e, t, n, s, i) {
|
|
|
2568
2569
|
blockInitialAnimation: a ? a.initial === !1 : !1,
|
|
2569
2570
|
reducedMotionConfig: l
|
|
2570
2571
|
}));
|
|
2571
|
-
const c = u.current, f = k(
|
|
2572
|
-
c && !c.projection && i && (c.type === "html" || c.type === "svg") &&
|
|
2572
|
+
const c = u.current, f = k(la);
|
|
2573
|
+
c && !c.projection && i && (c.type === "html" || c.type === "svg") && da(u.current, n, i, f);
|
|
2573
2574
|
const d = pe(!1);
|
|
2574
2575
|
Js(() => {
|
|
2575
2576
|
c && d.current && c.update(n, a);
|
|
2576
2577
|
});
|
|
2577
2578
|
const h = n[Os], g = pe(!!h && !((y = window.MotionHandoffIsComplete) != null && y.call(window, h)) && ((T = window.MotionHasOptimisedAnimation) == null ? void 0 : T.call(window, h)));
|
|
2578
|
-
return
|
|
2579
|
+
return Oi(() => {
|
|
2579
2580
|
c && (d.current = !0, window.MotionIsMounted = !0, c.updateFeatures(), c.scheduleRenderMicrotask(), g.current && c.animationState && c.animationState.animateChanges());
|
|
2580
2581
|
}), pt(() => {
|
|
2581
2582
|
c && (!g.current && c.animationState && c.animationState.animateChanges(), g.current && (queueMicrotask(() => {
|
|
@@ -2584,7 +2585,7 @@ function la(e, t, n, s, i) {
|
|
|
2584
2585
|
}), g.current = !1), c.enteringChildren = void 0);
|
|
2585
2586
|
}), c;
|
|
2586
2587
|
}
|
|
2587
|
-
function
|
|
2588
|
+
function da(e, t, n, s) {
|
|
2588
2589
|
const { layoutId: i, layout: r, drag: o, dragConstraints: a, layoutScroll: l, layoutRoot: u, layoutCrossfade: c } = t;
|
|
2589
2590
|
e.projection = new n(e.latestValues, t["data-framer-portal-id"] ? void 0 : Rs(e.parent)), e.projection.setOptions({
|
|
2590
2591
|
layoutId: i,
|
|
@@ -2609,34 +2610,34 @@ function Rs(e) {
|
|
|
2609
2610
|
if (e)
|
|
2610
2611
|
return e.options.allowProjection !== !1 ? e.projection : Rs(e.parent);
|
|
2611
2612
|
}
|
|
2612
|
-
function
|
|
2613
|
-
const i = It(e) ?
|
|
2613
|
+
function ha(e, { forwardMotionProps: t = !1 } = {}, n, s) {
|
|
2614
|
+
const i = It(e) ? oa : ra;
|
|
2614
2615
|
function r(a, l) {
|
|
2615
2616
|
let u;
|
|
2616
2617
|
const c = {
|
|
2617
2618
|
...k(ws),
|
|
2618
2619
|
...a,
|
|
2619
|
-
layoutId:
|
|
2620
|
-
}, { isStatic: f } = c, d =
|
|
2620
|
+
layoutId: pa(a)
|
|
2621
|
+
}, { isStatic: f } = c, d = jo(a), h = i(a, f);
|
|
2621
2622
|
if (!f && gt) {
|
|
2622
|
-
|
|
2623
|
-
const g =
|
|
2624
|
-
u = g.MeasureLayout, d.visualElement =
|
|
2623
|
+
ma(c, n);
|
|
2624
|
+
const g = ga(c);
|
|
2625
|
+
u = g.MeasureLayout, d.visualElement = fa(e, h, c, s, g.ProjectionNode);
|
|
2625
2626
|
}
|
|
2626
|
-
return Ce(ke.Provider, { value: d, children: [u && d.visualElement ?
|
|
2627
|
+
return Ce(ke.Provider, { value: d, children: [u && d.visualElement ? C(u, { visualElement: d.visualElement, ...c }) : null, ta(e, a, ca(h, d.visualElement, l), h, f, t)] });
|
|
2627
2628
|
}
|
|
2628
2629
|
r.displayName = `motion.${typeof e == "string" ? e : `create(${e.displayName ?? e.name ?? ""})`}`;
|
|
2629
2630
|
const o = Qs(r);
|
|
2630
|
-
return o[
|
|
2631
|
+
return o[aa] = e, o;
|
|
2631
2632
|
}
|
|
2632
|
-
function
|
|
2633
|
-
const t = k(
|
|
2633
|
+
function pa({ layoutId: e }) {
|
|
2634
|
+
const t = k(Di).id;
|
|
2634
2635
|
return t && e !== void 0 ? t + "-" + e : e;
|
|
2635
2636
|
}
|
|
2636
|
-
function
|
|
2637
|
+
function ma(e, t) {
|
|
2637
2638
|
k(Dt).strict, process.env.NODE_ENV;
|
|
2638
2639
|
}
|
|
2639
|
-
function
|
|
2640
|
+
function ga(e) {
|
|
2640
2641
|
const { drag: t, layout: n } = ie;
|
|
2641
2642
|
if (!t && !n)
|
|
2642
2643
|
return {};
|
|
@@ -2646,13 +2647,13 @@ function ma(e) {
|
|
|
2646
2647
|
ProjectionNode: s.ProjectionNode
|
|
2647
2648
|
};
|
|
2648
2649
|
}
|
|
2649
|
-
function
|
|
2650
|
+
function ya({ top: e, left: t, right: n, bottom: s }) {
|
|
2650
2651
|
return {
|
|
2651
2652
|
x: { min: t, max: n },
|
|
2652
2653
|
y: { min: e, max: s }
|
|
2653
2654
|
};
|
|
2654
2655
|
}
|
|
2655
|
-
function
|
|
2656
|
+
function ba(e, t) {
|
|
2656
2657
|
if (!t)
|
|
2657
2658
|
return e;
|
|
2658
2659
|
const n = t({ x: e.left, y: e.top }), s = t({ x: e.right, y: e.bottom });
|
|
@@ -2663,14 +2664,14 @@ function ya(e, t) {
|
|
|
2663
2664
|
right: s.x
|
|
2664
2665
|
};
|
|
2665
2666
|
}
|
|
2666
|
-
function
|
|
2667
|
-
return
|
|
2667
|
+
function va(e, t) {
|
|
2668
|
+
return ya(ba(e.getBoundingClientRect(), t));
|
|
2668
2669
|
}
|
|
2669
2670
|
const yn = () => ({ min: 0, max: 0 }), Ls = () => ({
|
|
2670
2671
|
x: yn(),
|
|
2671
2672
|
y: yn()
|
|
2672
2673
|
}), ut = { current: null }, Is = { current: !1 };
|
|
2673
|
-
function
|
|
2674
|
+
function Ta() {
|
|
2674
2675
|
if (Is.current = !0, !!gt)
|
|
2675
2676
|
if (window.matchMedia) {
|
|
2676
2677
|
const e = window.matchMedia("(prefers-reduced-motion)"), t = () => ut.current = e.matches;
|
|
@@ -2678,8 +2679,8 @@ function va() {
|
|
|
2678
2679
|
} else
|
|
2679
2680
|
ut.current = !1;
|
|
2680
2681
|
}
|
|
2681
|
-
const
|
|
2682
|
-
function
|
|
2682
|
+
const wa = /* @__PURE__ */ new WeakMap();
|
|
2683
|
+
function Sa(e, t, n) {
|
|
2683
2684
|
for (const s in t) {
|
|
2684
2685
|
const i = t[s], r = n[s];
|
|
2685
2686
|
if (R(i))
|
|
@@ -2708,7 +2709,7 @@ const bn = [
|
|
|
2708
2709
|
"LayoutAnimationStart",
|
|
2709
2710
|
"LayoutAnimationComplete"
|
|
2710
2711
|
];
|
|
2711
|
-
class
|
|
2712
|
+
class xa {
|
|
2712
2713
|
/**
|
|
2713
2714
|
* This method takes React props and returns found MotionValues. For example, HTML
|
|
2714
2715
|
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
@@ -2736,7 +2737,7 @@ class Sa {
|
|
|
2736
2737
|
}
|
|
2737
2738
|
mount(t) {
|
|
2738
2739
|
var n;
|
|
2739
|
-
this.current = t,
|
|
2740
|
+
this.current = t, wa.set(t, this), this.projection && !this.projection.instance && this.projection.mount(t), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((s, i) => this.bindToMotionValue(i, s)), Is.current || Ta(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : ut.current, process.env.NODE_ENV !== "production" && kn(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), (n = this.parent) == null || n.addChild(this), this.update(this.props, this.presenceContext);
|
|
2740
2741
|
}
|
|
2741
2742
|
unmount() {
|
|
2742
2743
|
var t;
|
|
@@ -2812,7 +2813,7 @@ class Sa {
|
|
|
2812
2813
|
const r = "on" + i, o = t[r];
|
|
2813
2814
|
o && (this.propEventSubscriptions[i] = this.on(i, o));
|
|
2814
2815
|
}
|
|
2815
|
-
this.prevMotionValues =
|
|
2816
|
+
this.prevMotionValues = Sa(this, this.scrapeMotionValuesFromProps(t, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
2816
2817
|
}
|
|
2817
2818
|
getProps() {
|
|
2818
2819
|
return this.props;
|
|
@@ -2877,7 +2878,7 @@ class Sa {
|
|
|
2877
2878
|
*/
|
|
2878
2879
|
readValue(t, n) {
|
|
2879
2880
|
let s = this.latestValues[t] !== void 0 || !this.current ? this.latestValues[t] : this.getBaseTargetFromProps(this.props, t) ?? this.readValueFromInstance(this.current, t, this.options);
|
|
2880
|
-
return s != null && (typeof s == "string" && (Fn(s) || On(s)) ? s = parseFloat(s) : !
|
|
2881
|
+
return s != null && (typeof s == "string" && (Fn(s) || On(s)) ? s = parseFloat(s) : !ko(s) && ue.test(n) && (s = ys(t, n)), this.setBaseTarget(t, R(s) ? s.get() : s)), R(s) ? s.get() : s;
|
|
2881
2882
|
}
|
|
2882
2883
|
/**
|
|
2883
2884
|
* Set the base target to later animate back to. This is currently
|
|
@@ -2910,12 +2911,12 @@ class Sa {
|
|
|
2910
2911
|
this.events[t] && this.events[t].notify(...n);
|
|
2911
2912
|
}
|
|
2912
2913
|
scheduleRenderMicrotask() {
|
|
2913
|
-
|
|
2914
|
+
Co.render(this.render);
|
|
2914
2915
|
}
|
|
2915
2916
|
}
|
|
2916
|
-
class ks extends
|
|
2917
|
+
class ks extends xa {
|
|
2917
2918
|
constructor() {
|
|
2918
|
-
super(...arguments), this.KeyframeResolver =
|
|
2919
|
+
super(...arguments), this.KeyframeResolver = wo;
|
|
2919
2920
|
}
|
|
2920
2921
|
sortInstanceNodePosition(t, n) {
|
|
2921
2922
|
return t.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
@@ -2943,24 +2944,24 @@ function Ns(e, { style: t, vars: n }, s, i) {
|
|
|
2943
2944
|
for (o in n)
|
|
2944
2945
|
r.setProperty(o, n[o]);
|
|
2945
2946
|
}
|
|
2946
|
-
function
|
|
2947
|
+
function Va(e) {
|
|
2947
2948
|
return window.getComputedStyle(e);
|
|
2948
2949
|
}
|
|
2949
|
-
class
|
|
2950
|
+
class Aa extends ks {
|
|
2950
2951
|
constructor() {
|
|
2951
2952
|
super(...arguments), this.type = "html", this.renderInstance = Ns;
|
|
2952
2953
|
}
|
|
2953
2954
|
readValueFromInstance(t, n) {
|
|
2954
2955
|
var s;
|
|
2955
2956
|
if (fe.has(n))
|
|
2956
|
-
return (s = this.projection) != null && s.isProjecting ? nt(n) :
|
|
2957
|
+
return (s = this.projection) != null && s.isProjecting ? nt(n) : Br(t, n);
|
|
2957
2958
|
{
|
|
2958
|
-
const i =
|
|
2959
|
+
const i = Va(t), r = (Yn(n) ? i.getPropertyValue(n) : i[n]) || 0;
|
|
2959
2960
|
return typeof r == "string" ? r.trim() : r;
|
|
2960
2961
|
}
|
|
2961
2962
|
}
|
|
2962
2963
|
measureInstanceViewportBox(t, { transformPagePoint: n }) {
|
|
2963
|
-
return
|
|
2964
|
+
return va(t, n);
|
|
2964
2965
|
}
|
|
2965
2966
|
build(t, n, s) {
|
|
2966
2967
|
Rt(t, n, s.transformTemplate);
|
|
@@ -2994,12 +2995,12 @@ const Bs = /* @__PURE__ */ new Set([
|
|
|
2994
2995
|
"textLength",
|
|
2995
2996
|
"lengthAdjust"
|
|
2996
2997
|
]);
|
|
2997
|
-
function
|
|
2998
|
+
function Ca(e, t, n, s) {
|
|
2998
2999
|
Ns(e, t, void 0, s);
|
|
2999
3000
|
for (const i in t.attrs)
|
|
3000
3001
|
e.setAttribute(Bs.has(i) ? i : Bt(i), t.attrs[i]);
|
|
3001
3002
|
}
|
|
3002
|
-
class
|
|
3003
|
+
class Ma extends ks {
|
|
3003
3004
|
constructor() {
|
|
3004
3005
|
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = Ls;
|
|
3005
3006
|
}
|
|
@@ -3020,13 +3021,13 @@ class Ca extends ks {
|
|
|
3020
3021
|
Cs(t, n, this.isSVGTag, s.transformTemplate, s.style);
|
|
3021
3022
|
}
|
|
3022
3023
|
renderInstance(t, n, s, i) {
|
|
3023
|
-
|
|
3024
|
+
Ca(t, n, s, i);
|
|
3024
3025
|
}
|
|
3025
3026
|
mount(t) {
|
|
3026
3027
|
this.isSVGTag = Ps(t.tagName), super.mount(t);
|
|
3027
3028
|
}
|
|
3028
3029
|
}
|
|
3029
|
-
const
|
|
3030
|
+
const Pa = (e, t) => It(e) ? new Ma(t) : new Aa(t, {
|
|
3030
3031
|
allowProjection: e !== xn
|
|
3031
3032
|
});
|
|
3032
3033
|
function ne(e, t, n) {
|
|
@@ -3034,63 +3035,63 @@ function ne(e, t, n) {
|
|
|
3034
3035
|
return kt(s, t, n !== void 0 ? n : s.custom, e);
|
|
3035
3036
|
}
|
|
3036
3037
|
const lt = (e) => Array.isArray(e);
|
|
3037
|
-
function
|
|
3038
|
+
function Ea(e, t, n) {
|
|
3038
3039
|
e.hasValue(t) ? e.getValue(t).set(n) : e.addValue(t, Fe(n));
|
|
3039
3040
|
}
|
|
3040
|
-
function
|
|
3041
|
+
function Da(e) {
|
|
3041
3042
|
return lt(e) ? e[e.length - 1] || 0 : e;
|
|
3042
3043
|
}
|
|
3043
|
-
function
|
|
3044
|
+
function Fa(e, t) {
|
|
3044
3045
|
const n = ne(e, t);
|
|
3045
3046
|
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
|
|
3046
3047
|
r = { ...r, ...s };
|
|
3047
3048
|
for (const o in r) {
|
|
3048
|
-
const a =
|
|
3049
|
-
|
|
3049
|
+
const a = Da(r[o]);
|
|
3050
|
+
Ea(e, o, a);
|
|
3050
3051
|
}
|
|
3051
3052
|
}
|
|
3052
|
-
function
|
|
3053
|
+
function Oa(e) {
|
|
3053
3054
|
return !!(R(e) && e.add);
|
|
3054
3055
|
}
|
|
3055
|
-
function
|
|
3056
|
+
function Ra(e, t) {
|
|
3056
3057
|
const n = e.getValue("willChange");
|
|
3057
|
-
if (
|
|
3058
|
+
if (Oa(n))
|
|
3058
3059
|
return n.add(t);
|
|
3059
3060
|
if (!n && W.WillChange) {
|
|
3060
3061
|
const s = new W.WillChange("auto");
|
|
3061
3062
|
e.addValue("willChange", s), s.add(t);
|
|
3062
3063
|
}
|
|
3063
3064
|
}
|
|
3064
|
-
function
|
|
3065
|
+
function La(e) {
|
|
3065
3066
|
return e.props[Os];
|
|
3066
3067
|
}
|
|
3067
|
-
const
|
|
3068
|
-
function
|
|
3069
|
-
const i = e.filter(
|
|
3068
|
+
const Ia = (e) => e !== null;
|
|
3069
|
+
function ka(e, { repeat: t, repeatType: n = "loop" }, s) {
|
|
3070
|
+
const i = e.filter(Ia), r = t && n !== "loop" && t % 2 === 1 ? 0 : i.length - 1;
|
|
3070
3071
|
return i[r];
|
|
3071
3072
|
}
|
|
3072
|
-
const
|
|
3073
|
+
const Na = {
|
|
3073
3074
|
type: "spring",
|
|
3074
3075
|
stiffness: 500,
|
|
3075
3076
|
damping: 25,
|
|
3076
3077
|
restSpeed: 10
|
|
3077
|
-
},
|
|
3078
|
+
}, Ba = (e) => ({
|
|
3078
3079
|
type: "spring",
|
|
3079
3080
|
stiffness: 550,
|
|
3080
3081
|
damping: e === 0 ? 2 * Math.sqrt(550) : 30,
|
|
3081
3082
|
restSpeed: 10
|
|
3082
|
-
}),
|
|
3083
|
+
}), Ka = {
|
|
3083
3084
|
type: "keyframes",
|
|
3084
3085
|
duration: 0.8
|
|
3085
|
-
},
|
|
3086
|
+
}, Wa = {
|
|
3086
3087
|
type: "keyframes",
|
|
3087
3088
|
ease: [0.25, 0.1, 0.35, 1],
|
|
3088
3089
|
duration: 0.3
|
|
3089
|
-
},
|
|
3090
|
-
function
|
|
3090
|
+
}, $a = (e, { keyframes: t }) => t.length > 2 ? Ka : fe.has(e) ? e.startsWith("scale") ? Ba(t[1]) : Na : Wa;
|
|
3091
|
+
function ja({ when: e, delay: t, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: l, elapsed: u, ...c }) {
|
|
3091
3092
|
return !!Object.keys(c).length;
|
|
3092
3093
|
}
|
|
3093
|
-
const
|
|
3094
|
+
const _a = (e, t, n, s = {}, i, r) => (o) => {
|
|
3094
3095
|
const a = ds(s, e) || {}, l = a.delay || s.delay || 0;
|
|
3095
3096
|
let { elapsed: u = 0 } = s;
|
|
3096
3097
|
u = u - /* @__PURE__ */ B(l);
|
|
@@ -3110,10 +3111,10 @@ const ja = (e, t, n, s = {}, i, r) => (o) => {
|
|
|
3110
3111
|
motionValue: t,
|
|
3111
3112
|
element: r ? void 0 : i
|
|
3112
3113
|
};
|
|
3113
|
-
|
|
3114
|
+
ja(a) || Object.assign(c, $a(e, c)), c.duration && (c.duration = /* @__PURE__ */ B(c.duration)), c.repeatDelay && (c.repeatDelay = /* @__PURE__ */ B(c.repeatDelay)), c.from !== void 0 && (c.keyframes[0] = c.from);
|
|
3114
3115
|
let f = !1;
|
|
3115
3116
|
if ((c.type === !1 || c.duration === 0 && !c.repeatDelay) && (at(c), c.delay === 0 && (f = !0)), (W.instantAnimations || W.skipAnimations) && (f = !0, at(c), c.delay = 0), c.allowFlatten = !a.type && !a.ease, f && !r && t.get() !== void 0) {
|
|
3116
|
-
const d =
|
|
3117
|
+
const d = ka(c.keyframes, a);
|
|
3117
3118
|
if (d !== void 0) {
|
|
3118
3119
|
N.update(() => {
|
|
3119
3120
|
c.onUpdate(d), c.onComplete();
|
|
@@ -3121,9 +3122,9 @@ const ja = (e, t, n, s = {}, i, r) => (o) => {
|
|
|
3121
3122
|
return;
|
|
3122
3123
|
}
|
|
3123
3124
|
}
|
|
3124
|
-
return a.isSync ? new Mt(c) : new
|
|
3125
|
+
return a.isSync ? new Mt(c) : new ao(c);
|
|
3125
3126
|
};
|
|
3126
|
-
function
|
|
3127
|
+
function Ua({ protectedKeys: e, needsAnimating: t }, n) {
|
|
3127
3128
|
const s = e.hasOwnProperty(n) && t[n] !== !0;
|
|
3128
3129
|
return t[n] = !1, s;
|
|
3129
3130
|
}
|
|
@@ -3133,7 +3134,7 @@ function Ks(e, t, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
|
3133
3134
|
const l = [], u = i && e.animationState && e.animationState.getState()[i];
|
|
3134
3135
|
for (const c in a) {
|
|
3135
3136
|
const f = e.getValue(c, e.latestValues[c] ?? null), d = a[c];
|
|
3136
|
-
if (d === void 0 || u &&
|
|
3137
|
+
if (d === void 0 || u && Ua(u, c))
|
|
3137
3138
|
continue;
|
|
3138
3139
|
const h = {
|
|
3139
3140
|
delay: n,
|
|
@@ -3143,19 +3144,19 @@ function Ks(e, t, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
|
3143
3144
|
continue;
|
|
3144
3145
|
let y = !1;
|
|
3145
3146
|
if (window.MotionHandoffAnimation) {
|
|
3146
|
-
const p =
|
|
3147
|
+
const p = La(e);
|
|
3147
3148
|
if (p) {
|
|
3148
3149
|
const V = window.MotionHandoffAnimation(p, c, N);
|
|
3149
3150
|
V !== null && (h.startTime = V, y = !0);
|
|
3150
3151
|
}
|
|
3151
3152
|
}
|
|
3152
|
-
|
|
3153
|
+
Ra(e, c), f.start(_a(c, f, d, e.shouldReduceMotion && hs.has(c) ? { type: !1 } : h, e, y));
|
|
3153
3154
|
const T = f.animation;
|
|
3154
3155
|
T && l.push(T);
|
|
3155
3156
|
}
|
|
3156
3157
|
return o && Promise.all(l).then(() => {
|
|
3157
3158
|
N.update(() => {
|
|
3158
|
-
o &&
|
|
3159
|
+
o && Fa(e, o);
|
|
3159
3160
|
});
|
|
3160
3161
|
}), l;
|
|
3161
3162
|
}
|
|
@@ -3170,7 +3171,7 @@ function ft(e, t, n = {}) {
|
|
|
3170
3171
|
n.transitionOverride && (i = n.transitionOverride);
|
|
3171
3172
|
const r = s ? () => Promise.all(Ks(e, s, n)) : () => Promise.resolve(), o = e.variantChildren && e.variantChildren.size ? (u = 0) => {
|
|
3172
3173
|
const { delayChildren: c = 0, staggerChildren: f, staggerDirection: d } = i;
|
|
3173
|
-
return
|
|
3174
|
+
return Ha(e, t, u, c, f, d, n);
|
|
3174
3175
|
} : () => Promise.resolve(), { when: a } = i;
|
|
3175
3176
|
if (a) {
|
|
3176
3177
|
const [u, c] = a === "beforeChildren" ? [r, o] : [o, r];
|
|
@@ -3178,7 +3179,7 @@ function ft(e, t, n = {}) {
|
|
|
3178
3179
|
} else
|
|
3179
3180
|
return Promise.all([r(), o(n.delay)]);
|
|
3180
3181
|
}
|
|
3181
|
-
function
|
|
3182
|
+
function Ha(e, t, n = 0, s = 0, i = 0, r = 1, o) {
|
|
3182
3183
|
const a = [];
|
|
3183
3184
|
for (const l of e.variantChildren)
|
|
3184
3185
|
l.notify("AnimationStart", t), a.push(ft(l, t, {
|
|
@@ -3214,7 +3215,7 @@ function $s(e, t) {
|
|
|
3214
3215
|
return !1;
|
|
3215
3216
|
return !0;
|
|
3216
3217
|
}
|
|
3217
|
-
const
|
|
3218
|
+
const za = Ot.length;
|
|
3218
3219
|
function js(e) {
|
|
3219
3220
|
if (!e)
|
|
3220
3221
|
return;
|
|
@@ -3223,18 +3224,18 @@ function js(e) {
|
|
|
3223
3224
|
return e.props.initial !== void 0 && (n.initial = e.props.initial), n;
|
|
3224
3225
|
}
|
|
3225
3226
|
const t = {};
|
|
3226
|
-
for (let n = 0; n <
|
|
3227
|
+
for (let n = 0; n < za; n++) {
|
|
3227
3228
|
const s = Ot[n], i = e.props[s];
|
|
3228
3229
|
(be(i) || i === !1) && (t[s] = i);
|
|
3229
3230
|
}
|
|
3230
3231
|
return t;
|
|
3231
3232
|
}
|
|
3232
|
-
const
|
|
3233
|
-
function
|
|
3233
|
+
const Ya = [...Ft].reverse(), Xa = Ft.length;
|
|
3234
|
+
function qa(e) {
|
|
3234
3235
|
return (t) => Promise.all(t.map(({ animation: n, options: s }) => Ga(e, n, s)));
|
|
3235
3236
|
}
|
|
3236
|
-
function
|
|
3237
|
-
let t =
|
|
3237
|
+
function Za(e) {
|
|
3238
|
+
let t = qa(e), n = vn(), s = !0;
|
|
3238
3239
|
const i = (l) => (u, c) => {
|
|
3239
3240
|
var d;
|
|
3240
3241
|
const f = ne(e, c, l === "exit" ? (d = e.presenceContext) == null ? void 0 : d.custom : void 0);
|
|
@@ -3250,23 +3251,23 @@ function qa(e) {
|
|
|
3250
3251
|
function o(l) {
|
|
3251
3252
|
const { props: u } = e, c = js(e.parent) || {}, f = [], d = /* @__PURE__ */ new Set();
|
|
3252
3253
|
let h = {}, g = 1 / 0;
|
|
3253
|
-
for (let T = 0; T <
|
|
3254
|
-
const p =
|
|
3254
|
+
for (let T = 0; T < Xa; T++) {
|
|
3255
|
+
const p = Ya[T], V = n[p], m = u[p] !== void 0 ? u[p] : c[p], M = be(m), w = p === l ? V.isActive : null;
|
|
3255
3256
|
w === !1 && (g = T);
|
|
3256
|
-
let A = m === c[p] && m !== u[p] &&
|
|
3257
|
+
let A = m === c[p] && m !== u[p] && M;
|
|
3257
3258
|
if (A && s && e.manuallyAnimateOnMount && (A = !1), V.protectedKeys = { ...h }, // If it isn't active and hasn't *just* been set as inactive
|
|
3258
3259
|
!V.isActive && w === null || // If we didn't and don't have any defined prop for this animation type
|
|
3259
3260
|
!m && !V.prevProp || // Or if the prop doesn't define an animation
|
|
3260
3261
|
Ne(m) || typeof m == "boolean")
|
|
3261
3262
|
continue;
|
|
3262
|
-
const x =
|
|
3263
|
+
const x = Ja(V.prevProp, m);
|
|
3263
3264
|
let S = x || // If we're making this variant active, we want to always make it active
|
|
3264
|
-
p === l && V.isActive && !A &&
|
|
3265
|
-
T > g &&
|
|
3265
|
+
p === l && V.isActive && !A && M || // If we removed a higher-priority variant (i is in reverse order)
|
|
3266
|
+
T > g && M, D = !1;
|
|
3266
3267
|
const O = Array.isArray(m) ? m : [m];
|
|
3267
3268
|
let q = O.reduce(i(p), {});
|
|
3268
3269
|
w === !1 && (q = {});
|
|
3269
|
-
const { prevResolvedValues: Kt = {} } = V,
|
|
3270
|
+
const { prevResolvedValues: Kt = {} } = V, Gs = {
|
|
3270
3271
|
...Kt,
|
|
3271
3272
|
...q
|
|
3272
3273
|
}, Wt = (F) => {
|
|
@@ -3274,7 +3275,7 @@ function qa(e) {
|
|
|
3274
3275
|
const L = e.getValue(F);
|
|
3275
3276
|
L && (L.liveStyle = !1);
|
|
3276
3277
|
};
|
|
3277
|
-
for (const F in
|
|
3278
|
+
for (const F in Gs) {
|
|
3278
3279
|
const L = q[F], j = Kt[F];
|
|
3279
3280
|
if (h.hasOwnProperty(F))
|
|
3280
3281
|
continue;
|
|
@@ -3335,7 +3336,7 @@ function qa(e) {
|
|
|
3335
3336
|
}
|
|
3336
3337
|
};
|
|
3337
3338
|
}
|
|
3338
|
-
function
|
|
3339
|
+
function Ja(e, t) {
|
|
3339
3340
|
return typeof t == "string" ? t !== e : Array.isArray(t) ? !$s(t, e) : !1;
|
|
3340
3341
|
}
|
|
3341
3342
|
function _(e = !1) {
|
|
@@ -3364,14 +3365,14 @@ class de {
|
|
|
3364
3365
|
update() {
|
|
3365
3366
|
}
|
|
3366
3367
|
}
|
|
3367
|
-
class
|
|
3368
|
+
class Qa extends de {
|
|
3368
3369
|
/**
|
|
3369
3370
|
* We dynamically generate the AnimationState manager as it contains a reference
|
|
3370
3371
|
* to the underlying animation library. We only want to load that if we load this,
|
|
3371
3372
|
* so people can optionally code split it out using the `m` component.
|
|
3372
3373
|
*/
|
|
3373
3374
|
constructor(t) {
|
|
3374
|
-
super(t), t.animationState || (t.animationState =
|
|
3375
|
+
super(t), t.animationState || (t.animationState = Za(t));
|
|
3375
3376
|
}
|
|
3376
3377
|
updateAnimationControlsSubscription() {
|
|
3377
3378
|
const { animate: t } = this.node.getProps();
|
|
@@ -3392,10 +3393,10 @@ class Ja extends de {
|
|
|
3392
3393
|
this.node.animationState.reset(), (t = this.unmountControls) == null || t.call(this);
|
|
3393
3394
|
}
|
|
3394
3395
|
}
|
|
3395
|
-
let
|
|
3396
|
-
class
|
|
3396
|
+
let ec = 0;
|
|
3397
|
+
class tc extends de {
|
|
3397
3398
|
constructor() {
|
|
3398
|
-
super(...arguments), this.id =
|
|
3399
|
+
super(...arguments), this.id = ec++;
|
|
3399
3400
|
}
|
|
3400
3401
|
update() {
|
|
3401
3402
|
if (!this.node.presenceContext)
|
|
@@ -3415,12 +3416,12 @@ class ec extends de {
|
|
|
3415
3416
|
unmount() {
|
|
3416
3417
|
}
|
|
3417
3418
|
}
|
|
3418
|
-
const
|
|
3419
|
+
const nc = {
|
|
3419
3420
|
animation: {
|
|
3420
|
-
Feature:
|
|
3421
|
+
Feature: Qa
|
|
3421
3422
|
},
|
|
3422
3423
|
exit: {
|
|
3423
|
-
Feature:
|
|
3424
|
+
Feature: tc
|
|
3424
3425
|
}
|
|
3425
3426
|
};
|
|
3426
3427
|
function Tn(e, t, n, s = { passive: !0 }) {
|
|
@@ -3440,15 +3441,15 @@ function wn(e, t, n) {
|
|
|
3440
3441
|
const i = "onHover" + n, r = s[i];
|
|
3441
3442
|
r && N.postRender(() => r(t, _s(t)));
|
|
3442
3443
|
}
|
|
3443
|
-
class
|
|
3444
|
+
class sc extends de {
|
|
3444
3445
|
mount() {
|
|
3445
3446
|
const { current: t } = this.node;
|
|
3446
|
-
t && (this.unmount =
|
|
3447
|
+
t && (this.unmount = Eo(t, (n, s) => (wn(this.node, s, "Start"), (i) => wn(this.node, i, "End"))));
|
|
3447
3448
|
}
|
|
3448
3449
|
unmount() {
|
|
3449
3450
|
}
|
|
3450
3451
|
}
|
|
3451
|
-
class
|
|
3452
|
+
class ic extends de {
|
|
3452
3453
|
constructor() {
|
|
3453
3454
|
super(...arguments), this.isActive = !1;
|
|
3454
3455
|
}
|
|
@@ -3478,37 +3479,37 @@ function Sn(e, t, n) {
|
|
|
3478
3479
|
const i = "onTap" + (n === "End" ? "" : n), r = s[i];
|
|
3479
3480
|
r && N.postRender(() => r(t, _s(t)));
|
|
3480
3481
|
}
|
|
3481
|
-
class
|
|
3482
|
+
class rc extends de {
|
|
3482
3483
|
mount() {
|
|
3483
3484
|
const { current: t } = this.node;
|
|
3484
|
-
t && (this.unmount =
|
|
3485
|
+
t && (this.unmount = Lo(t, (n, s) => (Sn(this.node, s, "Start"), (i, { success: r }) => Sn(this.node, i, r ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
3485
3486
|
}
|
|
3486
3487
|
unmount() {
|
|
3487
3488
|
}
|
|
3488
3489
|
}
|
|
3489
|
-
const dt = /* @__PURE__ */ new WeakMap(),
|
|
3490
|
+
const dt = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), oc = (e) => {
|
|
3490
3491
|
const t = dt.get(e.target);
|
|
3491
3492
|
t && t(e);
|
|
3492
|
-
},
|
|
3493
|
-
e.forEach(
|
|
3493
|
+
}, ac = (e) => {
|
|
3494
|
+
e.forEach(oc);
|
|
3494
3495
|
};
|
|
3495
|
-
function
|
|
3496
|
+
function cc({ root: e, ...t }) {
|
|
3496
3497
|
const n = e || document;
|
|
3497
|
-
|
|
3498
|
-
const s =
|
|
3499
|
-
return s[i] || (s[i] = new IntersectionObserver(
|
|
3498
|
+
Ge.has(n) || Ge.set(n, {});
|
|
3499
|
+
const s = Ge.get(n), i = JSON.stringify(t);
|
|
3500
|
+
return s[i] || (s[i] = new IntersectionObserver(ac, { root: e, ...t })), s[i];
|
|
3500
3501
|
}
|
|
3501
|
-
function
|
|
3502
|
-
const s =
|
|
3502
|
+
function uc(e, t, n) {
|
|
3503
|
+
const s = cc(t);
|
|
3503
3504
|
return dt.set(e, n), s.observe(e), () => {
|
|
3504
3505
|
dt.delete(e), s.unobserve(e);
|
|
3505
3506
|
};
|
|
3506
3507
|
}
|
|
3507
|
-
const
|
|
3508
|
+
const lc = {
|
|
3508
3509
|
some: 0,
|
|
3509
3510
|
all: 1
|
|
3510
3511
|
};
|
|
3511
|
-
class
|
|
3512
|
+
class fc extends de {
|
|
3512
3513
|
constructor() {
|
|
3513
3514
|
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
3514
3515
|
}
|
|
@@ -3517,7 +3518,7 @@ class lc extends de {
|
|
|
3517
3518
|
const { viewport: t = {} } = this.node.getProps(), { root: n, margin: s, amount: i = "some", once: r } = t, o = {
|
|
3518
3519
|
root: n ? n.current : void 0,
|
|
3519
3520
|
rootMargin: s,
|
|
3520
|
-
threshold: typeof i == "number" ? i :
|
|
3521
|
+
threshold: typeof i == "number" ? i : lc[i]
|
|
3521
3522
|
}, a = (l) => {
|
|
3522
3523
|
const { isIntersecting: u } = l;
|
|
3523
3524
|
if (this.isInView === u || (this.isInView = u, r && !u && this.hasEnteredView))
|
|
@@ -3526,7 +3527,7 @@ class lc extends de {
|
|
|
3526
3527
|
const { onViewportEnter: c, onViewportLeave: f } = this.node.getProps(), d = u ? c : f;
|
|
3527
3528
|
d && d(l);
|
|
3528
3529
|
};
|
|
3529
|
-
return
|
|
3530
|
+
return uc(this.node.current, o, a);
|
|
3530
3531
|
}
|
|
3531
3532
|
mount() {
|
|
3532
3533
|
this.startObserver();
|
|
@@ -3535,36 +3536,36 @@ class lc extends de {
|
|
|
3535
3536
|
if (typeof IntersectionObserver > "u")
|
|
3536
3537
|
return;
|
|
3537
3538
|
const { props: t, prevProps: n } = this.node;
|
|
3538
|
-
["amount", "margin", "root"].some(
|
|
3539
|
+
["amount", "margin", "root"].some(dc(t, n)) && this.startObserver();
|
|
3539
3540
|
}
|
|
3540
3541
|
unmount() {
|
|
3541
3542
|
}
|
|
3542
3543
|
}
|
|
3543
|
-
function
|
|
3544
|
+
function dc({ viewport: e = {} }, { viewport: t = {} } = {}) {
|
|
3544
3545
|
return (n) => e[n] !== t[n];
|
|
3545
3546
|
}
|
|
3546
|
-
const
|
|
3547
|
+
const hc = {
|
|
3547
3548
|
inView: {
|
|
3548
|
-
Feature:
|
|
3549
|
+
Feature: fc
|
|
3549
3550
|
},
|
|
3550
3551
|
tap: {
|
|
3551
|
-
Feature:
|
|
3552
|
+
Feature: rc
|
|
3552
3553
|
},
|
|
3553
3554
|
focus: {
|
|
3554
|
-
Feature:
|
|
3555
|
+
Feature: ic
|
|
3555
3556
|
},
|
|
3556
3557
|
hover: {
|
|
3557
|
-
Feature:
|
|
3558
|
+
Feature: sc
|
|
3558
3559
|
}
|
|
3559
|
-
},
|
|
3560
|
-
renderer:
|
|
3561
|
-
...
|
|
3562
|
-
...
|
|
3560
|
+
}, pc = {
|
|
3561
|
+
renderer: Pa,
|
|
3562
|
+
...nc,
|
|
3563
|
+
...hc
|
|
3563
3564
|
};
|
|
3564
|
-
function
|
|
3565
|
-
return
|
|
3565
|
+
function mc(e, t) {
|
|
3566
|
+
return ha(e, t);
|
|
3566
3567
|
}
|
|
3567
|
-
const ht = /* @__PURE__ */
|
|
3568
|
+
const ht = /* @__PURE__ */ mc("div"), Us = re.createContext({
|
|
3568
3569
|
layers: [],
|
|
3569
3570
|
setLayers: () => {
|
|
3570
3571
|
},
|
|
@@ -3574,7 +3575,7 @@ const ht = /* @__PURE__ */ pc("div"), Us = re.createContext({
|
|
|
3574
3575
|
},
|
|
3575
3576
|
removeTopLayer: () => {
|
|
3576
3577
|
}
|
|
3577
|
-
}),
|
|
3578
|
+
}), Ic = ({ children: e }) => {
|
|
3578
3579
|
const [t, n] = re.useState([]), s = (o) => {
|
|
3579
3580
|
n((a) => [...a, o]);
|
|
3580
3581
|
}, i = (o) => {
|
|
@@ -3583,29 +3584,29 @@ const ht = /* @__PURE__ */ pc("div"), Us = re.createContext({
|
|
|
3583
3584
|
const o = t[t.length - 1];
|
|
3584
3585
|
o && i(o);
|
|
3585
3586
|
};
|
|
3586
|
-
return /* @__PURE__ */
|
|
3587
|
+
return /* @__PURE__ */ C(
|
|
3587
3588
|
Us.Provider,
|
|
3588
3589
|
{
|
|
3589
3590
|
value: { layers: t, setLayers: n, addLayer: s, removeLayer: i, removeTopLayer: r },
|
|
3590
3591
|
children: e
|
|
3591
3592
|
}
|
|
3592
3593
|
);
|
|
3593
|
-
},
|
|
3594
|
+
}, Hs = () => re.useContext(Us), gc = ({
|
|
3594
3595
|
defaultOpen: e,
|
|
3595
3596
|
open: t,
|
|
3596
3597
|
onOpenChange: n,
|
|
3597
3598
|
...s
|
|
3598
3599
|
}) => {
|
|
3599
|
-
const [i, r] =
|
|
3600
|
+
const [i, r] = Mi({
|
|
3600
3601
|
prop: t,
|
|
3601
3602
|
onChange: n,
|
|
3602
3603
|
defaultProp: e ?? !1
|
|
3603
|
-
}), o =
|
|
3604
|
+
}), o = Hs(), a = s.a11yTitle;
|
|
3604
3605
|
if (re.useEffect(() => {
|
|
3605
3606
|
!i && o.layers.includes(a) && o.removeLayer(a);
|
|
3606
3607
|
}, [a, o, i]), !!i)
|
|
3607
|
-
return /* @__PURE__ */
|
|
3608
|
-
},
|
|
3608
|
+
return /* @__PURE__ */ C(yc, { open: i, onOpenChange: r, ...s });
|
|
3609
|
+
}, yc = ({
|
|
3609
3610
|
open: e,
|
|
3610
3611
|
onOpenChange: t,
|
|
3611
3612
|
a11yTitle: n,
|
|
@@ -3618,12 +3619,12 @@ const ht = /* @__PURE__ */ pc("div"), Us = re.createContext({
|
|
|
3618
3619
|
...l
|
|
3619
3620
|
}) => {
|
|
3620
3621
|
var y, T;
|
|
3621
|
-
const u = n, c =
|
|
3622
|
+
const u = n, c = Hs();
|
|
3622
3623
|
re.useEffect(() => {
|
|
3623
3624
|
!c || !e || c.layers.includes(u) || c.addLayer(u);
|
|
3624
3625
|
}, [u, c, e]);
|
|
3625
3626
|
const f = ((y = c.layers) == null ? void 0 : y.indexOf(u)) || 0, d = ((T = c.layers) == null ? void 0 : T.length) || 0, h = f !== 0, g = u === c.layers[c.layers.length - 1];
|
|
3626
|
-
return /* @__PURE__ */
|
|
3627
|
+
return /* @__PURE__ */ C(No, { features: pc, children: /* @__PURE__ */ C(
|
|
3627
3628
|
Pn,
|
|
3628
3629
|
{
|
|
3629
3630
|
onEscapeKeyDown: (p) => {
|
|
@@ -3644,19 +3645,19 @@ const ht = /* @__PURE__ */ pc("div"), Us = re.createContext({
|
|
|
3644
3645
|
},
|
|
3645
3646
|
children: [
|
|
3646
3647
|
/* @__PURE__ */ Ce(si.Root, { children: [
|
|
3647
|
-
/* @__PURE__ */
|
|
3648
|
-
s && /* @__PURE__ */
|
|
3648
|
+
/* @__PURE__ */ C(ee.Title, { children: n }),
|
|
3649
|
+
s && /* @__PURE__ */ C(ee.Description, { children: s })
|
|
3649
3650
|
] }),
|
|
3650
3651
|
e && // We add the className "tgph" here so that styles within
|
|
3651
3652
|
// the portal get scoped properly to telegraph
|
|
3652
|
-
/* @__PURE__ */
|
|
3653
|
+
/* @__PURE__ */ C(ni.Root, { className: "tgph", children: /* @__PURE__ */ C(bc, { layer: f, children: /* @__PURE__ */ C(
|
|
3653
3654
|
ti,
|
|
3654
3655
|
{
|
|
3655
3656
|
trapped: typeof r == "boolean" ? r : g,
|
|
3656
3657
|
onMountAutoFocus: o,
|
|
3657
3658
|
onUnmountAutoFocus: a,
|
|
3658
3659
|
asChild: !0,
|
|
3659
|
-
children: /* @__PURE__ */
|
|
3660
|
+
children: /* @__PURE__ */ C(ri, { children: /* @__PURE__ */ C(
|
|
3660
3661
|
se,
|
|
3661
3662
|
{
|
|
3662
3663
|
as: ht,
|
|
@@ -3677,7 +3678,7 @@ const ht = /* @__PURE__ */ pc("div"), Us = re.createContext({
|
|
|
3677
3678
|
maxWidth: "calc(100vw - var(--tgph-spacing-8))",
|
|
3678
3679
|
zIndex: `calc(var(--tgph-zIndex-modal) + ${f})`
|
|
3679
3680
|
},
|
|
3680
|
-
children: /* @__PURE__ */
|
|
3681
|
+
children: /* @__PURE__ */ C(
|
|
3681
3682
|
se,
|
|
3682
3683
|
{
|
|
3683
3684
|
direction: "column",
|
|
@@ -3714,8 +3715,8 @@ const ht = /* @__PURE__ */ pc("div"), Us = re.createContext({
|
|
|
3714
3715
|
)
|
|
3715
3716
|
}
|
|
3716
3717
|
) });
|
|
3717
|
-
},
|
|
3718
|
-
/* @__PURE__ */
|
|
3718
|
+
}, bc = ({ layer: e, children: t }) => e > 0 ? t : /* @__PURE__ */ Ce(ee.Overlay, { children: [
|
|
3719
|
+
/* @__PURE__ */ C(
|
|
3719
3720
|
oi,
|
|
3720
3721
|
{
|
|
3721
3722
|
as: ht,
|
|
@@ -3735,25 +3736,25 @@ const ht = /* @__PURE__ */ pc("div"), Us = re.createContext({
|
|
|
3735
3736
|
}
|
|
3736
3737
|
),
|
|
3737
3738
|
t
|
|
3738
|
-
] }),
|
|
3739
|
-
({ children: e, ...t }, n) => /* @__PURE__ */
|
|
3740
|
-
),
|
|
3739
|
+
] }), vc = re.forwardRef(
|
|
3740
|
+
({ children: e, ...t }, n) => /* @__PURE__ */ C(ee.Content, { ref: n, asChild: !0, ...t, children: /* @__PURE__ */ C(se, { direction: "column", h: "full", ...t, children: e }) })
|
|
3741
|
+
), Tc = ({
|
|
3741
3742
|
size: e = "1",
|
|
3742
3743
|
variant: t = "ghost",
|
|
3743
3744
|
...n
|
|
3744
|
-
}) => /* @__PURE__ */
|
|
3745
|
+
}) => /* @__PURE__ */ C(ee.Close, { asChild: !0, children: /* @__PURE__ */ C(
|
|
3745
3746
|
ii,
|
|
3746
3747
|
{
|
|
3747
|
-
icon: { icon:
|
|
3748
|
+
icon: { icon: ci, alt: "Close Modal" },
|
|
3748
3749
|
variant: t,
|
|
3749
3750
|
size: e,
|
|
3750
3751
|
...n
|
|
3751
3752
|
}
|
|
3752
|
-
) }),
|
|
3753
|
+
) }), wc = ({
|
|
3753
3754
|
style: e,
|
|
3754
3755
|
children: t,
|
|
3755
3756
|
...n
|
|
3756
|
-
}) => /* @__PURE__ */
|
|
3757
|
+
}) => /* @__PURE__ */ C(
|
|
3757
3758
|
se,
|
|
3758
3759
|
{
|
|
3759
3760
|
direction: "column",
|
|
@@ -3766,10 +3767,10 @@ const ht = /* @__PURE__ */ pc("div"), Us = re.createContext({
|
|
|
3766
3767
|
...n,
|
|
3767
3768
|
children: t
|
|
3768
3769
|
}
|
|
3769
|
-
),
|
|
3770
|
+
), Sc = ({
|
|
3770
3771
|
children: e,
|
|
3771
3772
|
...t
|
|
3772
|
-
}) => /* @__PURE__ */
|
|
3773
|
+
}) => /* @__PURE__ */ C(
|
|
3773
3774
|
se,
|
|
3774
3775
|
{
|
|
3775
3776
|
direction: "row",
|
|
@@ -3781,10 +3782,10 @@ const ht = /* @__PURE__ */ pc("div"), Us = re.createContext({
|
|
|
3781
3782
|
...t,
|
|
3782
3783
|
children: e
|
|
3783
3784
|
}
|
|
3784
|
-
),
|
|
3785
|
+
), xc = ({
|
|
3785
3786
|
children: e,
|
|
3786
3787
|
...t
|
|
3787
|
-
}) => /* @__PURE__ */
|
|
3788
|
+
}) => /* @__PURE__ */ C(
|
|
3788
3789
|
se,
|
|
3789
3790
|
{
|
|
3790
3791
|
direction: "row",
|
|
@@ -3797,17 +3798,31 @@ const ht = /* @__PURE__ */ pc("div"), Us = re.createContext({
|
|
|
3797
3798
|
...t,
|
|
3798
3799
|
children: e
|
|
3799
3800
|
}
|
|
3800
|
-
),
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3801
|
+
), Vc = ({
|
|
3802
|
+
as: e,
|
|
3803
|
+
size: t = "3",
|
|
3804
|
+
weight: n = "medium",
|
|
3805
|
+
...s
|
|
3806
|
+
}) => /* @__PURE__ */ C(
|
|
3807
|
+
ai,
|
|
3808
|
+
{
|
|
3809
|
+
as: e || "h2",
|
|
3810
|
+
size: t,
|
|
3811
|
+
weight: n,
|
|
3812
|
+
...s
|
|
3813
|
+
}
|
|
3814
|
+
), Ac = {};
|
|
3815
|
+
Object.assign(Ac, {
|
|
3816
|
+
Root: gc,
|
|
3817
|
+
Content: vc,
|
|
3818
|
+
Close: Tc,
|
|
3819
|
+
Body: wc,
|
|
3820
|
+
Header: Sc,
|
|
3821
|
+
Footer: xc,
|
|
3822
|
+
Heading: Vc
|
|
3808
3823
|
});
|
|
3809
3824
|
export {
|
|
3810
|
-
|
|
3811
|
-
|
|
3825
|
+
Ac as Modal,
|
|
3826
|
+
Ic as ModalStackingProvider
|
|
3812
3827
|
};
|
|
3813
3828
|
//# sourceMappingURL=index.mjs.map
|