@acrool/react-picker 0.0.10-alpha.0 → 0.0.10-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/acrool-react-picker.es.js +487 -485
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as kn from "react";
|
|
2
|
-
import Ln, { createContext as Mt, useContext as G, useLayoutEffect as Qs, useEffect as
|
|
2
|
+
import Ln, { createContext as Mt, useContext as G, useLayoutEffect as Qs, useEffect as lt, useRef as it, useInsertionEffect as tr, useCallback as vt, useMemo as Dt, forwardRef as De, Fragment as er, createElement as sa, useId as On, Component as ra, Children as oa, isValidElement as aa, useState as _t } from "react";
|
|
3
3
|
import la from "react-dom";
|
|
4
|
-
var st = /* @__PURE__ */ ((t) => (t.bottom = "bottom", t.top = "top", t))(st || {}),
|
|
4
|
+
var st = /* @__PURE__ */ ((t) => (t.bottom = "bottom", t.top = "top", t))(st || {}), mt = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t))(mt || {}), Ft = /* @__PURE__ */ ((t) => (t.Escape = "Escape", t.Enter = "Enter", t.Tab = "Tab", t.ArrowUp = "ArrowUp", t.ArrowDown = "ArrowDown", t))(Ft || {});
|
|
5
5
|
const fe = [
|
|
6
6
|
"color: #fff",
|
|
7
7
|
"display: inline-block",
|
|
@@ -49,23 +49,23 @@ function da(t, ...e) {
|
|
|
49
49
|
]).join(";");
|
|
50
50
|
de(t, n, ...e);
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const gt = {
|
|
53
53
|
primary: ca,
|
|
54
54
|
success: ua,
|
|
55
55
|
info: fa,
|
|
56
56
|
warning: ha,
|
|
57
57
|
danger: da
|
|
58
58
|
}, jn = Mt({
|
|
59
|
-
hide: () =>
|
|
60
|
-
show: () =>
|
|
61
|
-
toggle: () =>
|
|
59
|
+
hide: () => gt.warning("No hide method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
60
|
+
show: () => gt.warning("No show method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
61
|
+
toggle: () => gt.warning("No toggle method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
62
62
|
isVisible: !1,
|
|
63
|
-
inputFocus: () =>
|
|
64
|
-
inputBlur: () =>
|
|
63
|
+
inputFocus: () => gt.warning("No focus method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
64
|
+
inputBlur: () => gt.warning("No blur method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
65
65
|
isInputFocus: !1,
|
|
66
|
-
onChange: () =>
|
|
66
|
+
onChange: () => gt.warning("No onChange method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
67
67
|
vertical: st.bottom,
|
|
68
|
-
setVertical: () =>
|
|
68
|
+
setVertical: () => gt.warning("No onChange method detected, did you embed your app with Acrool/PickerPortal?")
|
|
69
69
|
}), uh = jn.Consumer, pa = () => G(jn);
|
|
70
70
|
var gn = { exports: {} }, qt = {};
|
|
71
71
|
/**
|
|
@@ -83,15 +83,15 @@ function ma() {
|
|
|
83
83
|
return qt;
|
|
84
84
|
Mi = 1;
|
|
85
85
|
var t = Ln, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
86
|
-
function r(
|
|
86
|
+
function r(a, l, c) {
|
|
87
87
|
var u, f = {}, d = null, p = null;
|
|
88
|
-
c !== void 0 && (d = "" + c),
|
|
89
|
-
for (u in
|
|
90
|
-
i.call(
|
|
91
|
-
if (
|
|
92
|
-
for (u in
|
|
93
|
-
f[u] === void 0 && (f[u] =
|
|
94
|
-
return { $$typeof: e, type:
|
|
88
|
+
c !== void 0 && (d = "" + c), l.key !== void 0 && (d = "" + l.key), l.ref !== void 0 && (p = l.ref);
|
|
89
|
+
for (u in l)
|
|
90
|
+
i.call(l, u) && !o.hasOwnProperty(u) && (f[u] = l[u]);
|
|
91
|
+
if (a && a.defaultProps)
|
|
92
|
+
for (u in l = a.defaultProps, l)
|
|
93
|
+
f[u] === void 0 && (f[u] = l[u]);
|
|
94
|
+
return { $$typeof: e, type: a, key: d, ref: p, props: f, _owner: s.current };
|
|
95
95
|
}
|
|
96
96
|
return qt.Fragment = n, qt.jsx = r, qt.jsxs = r, qt;
|
|
97
97
|
}
|
|
@@ -108,7 +108,7 @@ var Zt = {};
|
|
|
108
108
|
var ki;
|
|
109
109
|
function ga() {
|
|
110
110
|
return ki || (ki = 1, process.env.NODE_ENV !== "production" && function() {
|
|
111
|
-
var t = Ln, e = Symbol.for("react.element"), n = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), r = Symbol.for("react.provider"),
|
|
111
|
+
var t = Ln, e = Symbol.for("react.element"), n = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), r = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), g = Symbol.iterator, v = "@@iterator";
|
|
112
112
|
function T(h) {
|
|
113
113
|
if (h === null || typeof h != "object")
|
|
114
114
|
return null;
|
|
@@ -136,7 +136,7 @@ function ga() {
|
|
|
136
136
|
var w = !1, A = !1, L = !1, $ = !1, R = !1, _;
|
|
137
137
|
_ = Symbol.for("react.module.reference");
|
|
138
138
|
function U(h) {
|
|
139
|
-
return !!(typeof h == "string" || typeof h == "function" || h === i || h === o || R || h === s || h === c || h === u || $ || h === p || w || A || L || typeof h == "object" && h !== null && (h.$$typeof === d || h.$$typeof === f || h.$$typeof === r || h.$$typeof ===
|
|
139
|
+
return !!(typeof h == "string" || typeof h == "function" || h === i || h === o || R || h === s || h === c || h === u || $ || h === p || w || A || L || typeof h == "object" && h !== null && (h.$$typeof === d || h.$$typeof === f || h.$$typeof === r || h.$$typeof === a || h.$$typeof === l || // This needs to include all possible module reference object
|
|
140
140
|
// types supported by any Flight configuration anywhere since
|
|
141
141
|
// we don't know which Flight build this will end up being used
|
|
142
142
|
// with.
|
|
@@ -175,13 +175,13 @@ function ga() {
|
|
|
175
175
|
}
|
|
176
176
|
if (typeof h == "object")
|
|
177
177
|
switch (h.$$typeof) {
|
|
178
|
-
case
|
|
178
|
+
case a:
|
|
179
179
|
var m = h;
|
|
180
180
|
return zt(m) + ".Consumer";
|
|
181
181
|
case r:
|
|
182
182
|
var b = h;
|
|
183
183
|
return zt(b._context) + ".Provider";
|
|
184
|
-
case
|
|
184
|
+
case l:
|
|
185
185
|
return M(h, h.render, "ForwardRef");
|
|
186
186
|
case f:
|
|
187
187
|
var C = h.displayName || null;
|
|
@@ -371,7 +371,7 @@ function ga() {
|
|
|
371
371
|
}
|
|
372
372
|
if (typeof h == "object")
|
|
373
373
|
switch (h.$$typeof) {
|
|
374
|
-
case
|
|
374
|
+
case l:
|
|
375
375
|
return Oo(h.render);
|
|
376
376
|
case f:
|
|
377
377
|
return xe(h.type, m, b);
|
|
@@ -623,7 +623,7 @@ Check the top-level render call using <` + b + ">.");
|
|
|
623
623
|
var b;
|
|
624
624
|
if (typeof m == "function")
|
|
625
625
|
b = m.propTypes;
|
|
626
|
-
else if (typeof m == "object" && (m.$$typeof ===
|
|
626
|
+
else if (typeof m == "object" && (m.$$typeof === l || // Note: Memo only checks outer props here.
|
|
627
627
|
// Inner props are checked in the reconciler.
|
|
628
628
|
m.$$typeof === f))
|
|
629
629
|
b = m.propTypes;
|
|
@@ -740,7 +740,7 @@ const Fn = Mt({
|
|
|
740
740
|
transformPagePoint: (t) => t,
|
|
741
741
|
isStatic: !1,
|
|
742
742
|
reducedMotion: "never"
|
|
743
|
-
}), _e = Mt({}), Be = Mt(null), _n = typeof window < "u", ir = _n ? Qs :
|
|
743
|
+
}), _e = Mt({}), Be = Mt(null), _n = typeof window < "u", ir = _n ? Qs : lt, sr = Mt({ strict: !1 }), Ie = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Pa = "framerAppearId", rr = "data-" + Ie(Pa), xa = {
|
|
744
744
|
skipAnimations: !1,
|
|
745
745
|
useManualTiming: !1
|
|
746
746
|
};
|
|
@@ -752,10 +752,10 @@ function ba(t) {
|
|
|
752
752
|
timestamp: 0,
|
|
753
753
|
isProcessing: !1
|
|
754
754
|
};
|
|
755
|
-
function
|
|
756
|
-
o.has(c) && (
|
|
755
|
+
function a(c) {
|
|
756
|
+
o.has(c) && (l.schedule(c), t()), c(r);
|
|
757
757
|
}
|
|
758
|
-
const
|
|
758
|
+
const l = {
|
|
759
759
|
/**
|
|
760
760
|
* Schedule a process to run on the next frame.
|
|
761
761
|
*/
|
|
@@ -777,10 +777,10 @@ function ba(t) {
|
|
|
777
777
|
s = !0;
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
|
-
i = !0, [e, n] = [n, e], n.clear(), e.forEach(
|
|
780
|
+
i = !0, [e, n] = [n, e], n.clear(), e.forEach(a), i = !1, s && (s = !1, l.process(c));
|
|
781
781
|
}
|
|
782
782
|
};
|
|
783
|
-
return
|
|
783
|
+
return l;
|
|
784
784
|
}
|
|
785
785
|
const Te = [
|
|
786
786
|
"read",
|
|
@@ -802,9 +802,9 @@ function or(t, e) {
|
|
|
802
802
|
delta: 0,
|
|
803
803
|
timestamp: 0,
|
|
804
804
|
isProcessing: !1
|
|
805
|
-
}, o = () => n = !0, r = Te.reduce((P, y) => (P[y] = ba(o), P), {}), { read:
|
|
805
|
+
}, o = () => n = !0, r = Te.reduce((P, y) => (P[y] = ba(o), P), {}), { read: a, resolveKeyframes: l, update: c, preRender: u, render: f, postRender: d } = r, p = () => {
|
|
806
806
|
const P = performance.now();
|
|
807
|
-
n = !1, s.delta = i ? 1e3 / 60 : Math.max(Math.min(P - s.timestamp, Ta), 1), s.timestamp = P, s.isProcessing = !0,
|
|
807
|
+
n = !1, s.delta = i ? 1e3 / 60 : Math.max(Math.min(P - s.timestamp, Ta), 1), s.timestamp = P, s.isProcessing = !0, a.process(s), l.process(s), c.process(s), u.process(s), f.process(s), d.process(s), s.isProcessing = !1, n && e && (i = !1, t(p));
|
|
808
808
|
}, g = () => {
|
|
809
809
|
n = !0, i = !0, s.isProcessing || t(p);
|
|
810
810
|
};
|
|
@@ -823,23 +823,23 @@ function Bt(t) {
|
|
|
823
823
|
const ar = Mt({});
|
|
824
824
|
let Li = !1;
|
|
825
825
|
function wa(t, e, n, i, s) {
|
|
826
|
-
const { visualElement: o } = G(_e), r = G(sr),
|
|
826
|
+
const { visualElement: o } = G(_e), r = G(sr), a = G(Be), l = G(Fn).reducedMotion, c = it();
|
|
827
827
|
i = i || r.renderer, !c.current && i && (c.current = i(t, {
|
|
828
828
|
visualState: e,
|
|
829
829
|
parent: o,
|
|
830
830
|
props: n,
|
|
831
|
-
presenceContext:
|
|
832
|
-
blockInitialAnimation:
|
|
833
|
-
reducedMotionConfig:
|
|
831
|
+
presenceContext: a,
|
|
832
|
+
blockInitialAnimation: a ? a.initial === !1 : !1,
|
|
833
|
+
reducedMotionConfig: l
|
|
834
834
|
}));
|
|
835
835
|
const u = c.current, f = G(ar);
|
|
836
836
|
u && !u.projection && s && (u.type === "html" || u.type === "svg") && Ca(c.current, n, s, f), tr(() => {
|
|
837
|
-
u && u.update(n,
|
|
837
|
+
u && u.update(n, a);
|
|
838
838
|
});
|
|
839
839
|
const d = it(!!(n[rr] && !window.HandoffComplete));
|
|
840
840
|
return ir(() => {
|
|
841
841
|
u && (u.updateFeatures(), Bn.render(u.render), d.current && u.animationState && u.animationState.animateChanges());
|
|
842
|
-
}),
|
|
842
|
+
}), lt(() => {
|
|
843
843
|
u && (!d.current && u.animationState && u.animationState.animateChanges(), d.current && (d.current = !1, Li || (Li = !0, queueMicrotask(Sa))));
|
|
844
844
|
}), u;
|
|
845
845
|
}
|
|
@@ -847,11 +847,11 @@ function Sa() {
|
|
|
847
847
|
window.HandoffComplete = !0;
|
|
848
848
|
}
|
|
849
849
|
function Ca(t, e, n, i) {
|
|
850
|
-
const { layoutId: s, layout: o, drag: r, dragConstraints:
|
|
850
|
+
const { layoutId: s, layout: o, drag: r, dragConstraints: a, layoutScroll: l, layoutRoot: c } = e;
|
|
851
851
|
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : lr(t.parent)), t.projection.setOptions({
|
|
852
852
|
layoutId: s,
|
|
853
853
|
layout: o,
|
|
854
|
-
alwaysMeasureLayout: !!r ||
|
|
854
|
+
alwaysMeasureLayout: !!r || a && Bt(a),
|
|
855
855
|
visualElement: t,
|
|
856
856
|
/**
|
|
857
857
|
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
@@ -862,7 +862,7 @@ function Ca(t, e, n, i) {
|
|
|
862
862
|
*/
|
|
863
863
|
animationType: typeof o == "string" ? o : "both",
|
|
864
864
|
initialPromotionConfig: i,
|
|
865
|
-
layoutScroll:
|
|
865
|
+
layoutScroll: l,
|
|
866
866
|
layoutRoot: c
|
|
867
867
|
});
|
|
868
868
|
}
|
|
@@ -871,7 +871,7 @@ function lr(t) {
|
|
|
871
871
|
return t.options.allowProjection !== !1 ? t.projection : lr(t.parent);
|
|
872
872
|
}
|
|
873
873
|
function Aa(t, e, n) {
|
|
874
|
-
return
|
|
874
|
+
return vt(
|
|
875
875
|
(i) => {
|
|
876
876
|
i && t.mount && t.mount(i), e && (i ? e.mount(i) : e.unmount()), n && (typeof n == "function" ? n(i) : Bt(n) && (n.current = i));
|
|
877
877
|
},
|
|
@@ -953,28 +953,28 @@ function Ea(t) {
|
|
|
953
953
|
};
|
|
954
954
|
}
|
|
955
955
|
const Un = Mt({}), Da = Symbol.for("motionComponentSymbol"), H = (t) => t;
|
|
956
|
-
let Gt = H,
|
|
956
|
+
let Gt = H, dt = H;
|
|
957
957
|
process.env.NODE_ENV !== "production" && (Gt = (t, e) => {
|
|
958
958
|
!t && typeof console < "u" && console.warn(e);
|
|
959
|
-
},
|
|
959
|
+
}, dt = (t, e) => {
|
|
960
960
|
if (!t)
|
|
961
961
|
throw new Error(e);
|
|
962
962
|
});
|
|
963
963
|
function Ma({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: i, Component: s }) {
|
|
964
964
|
t && Ea(t);
|
|
965
|
-
function o(
|
|
965
|
+
function o(a, l) {
|
|
966
966
|
let c;
|
|
967
967
|
const u = {
|
|
968
968
|
...G(Fn),
|
|
969
|
-
...
|
|
970
|
-
layoutId: ka(
|
|
971
|
-
}, { isStatic: f } = u, d = Va(
|
|
969
|
+
...a,
|
|
970
|
+
layoutId: ka(a)
|
|
971
|
+
}, { isStatic: f } = u, d = Va(a), p = i(a, f);
|
|
972
972
|
if (!f && _n) {
|
|
973
973
|
La(u, t);
|
|
974
974
|
const g = Oa(u);
|
|
975
975
|
c = g.MeasureLayout, d.visualElement = wa(s, p, u, e, g.ProjectionNode);
|
|
976
976
|
}
|
|
977
|
-
return j.jsxs(_e.Provider, { value: d, children: [c && d.visualElement ? j.jsx(c, { visualElement: d.visualElement, ...u }) : null, n(s,
|
|
977
|
+
return j.jsxs(_e.Provider, { value: d, children: [c && d.visualElement ? j.jsx(c, { visualElement: d.visualElement, ...u }) : null, n(s, a, Aa(p, d.visualElement, l), p, f, d.visualElement)] });
|
|
978
978
|
}
|
|
979
979
|
const r = De(o);
|
|
980
980
|
return r[Da] = s, r;
|
|
@@ -987,7 +987,7 @@ function La(t, e) {
|
|
|
987
987
|
const n = G(sr).strict;
|
|
988
988
|
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
989
989
|
const i = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
990
|
-
t.ignoreStrict ? Gt(!1, i) :
|
|
990
|
+
t.ignoreStrict ? Gt(!1, i) : dt(!1, i);
|
|
991
991
|
}
|
|
992
992
|
}
|
|
993
993
|
function Oa(t) {
|
|
@@ -1110,7 +1110,7 @@ const ge = (t) => ({
|
|
|
1110
1110
|
test: (e) => me(e) && e.endsWith(t) && e.split(" ").length === 1,
|
|
1111
1111
|
parse: parseFloat,
|
|
1112
1112
|
transform: (e) => `${e}${t}`
|
|
1113
|
-
}),
|
|
1113
|
+
}), yt = ge("deg"), ot = ge("%"), S = ge("px"), Ua = ge("vh"), Wa = ge("vw"), Fi = {
|
|
1114
1114
|
...ot,
|
|
1115
1115
|
parse: (t) => ot.parse(t) / 100,
|
|
1116
1116
|
transform: (t) => ot.transform(t * 100)
|
|
@@ -1152,17 +1152,17 @@ const ge = (t) => ({
|
|
|
1152
1152
|
marginBottom: S,
|
|
1153
1153
|
marginLeft: S,
|
|
1154
1154
|
// Transform props
|
|
1155
|
-
rotate:
|
|
1156
|
-
rotateX:
|
|
1157
|
-
rotateY:
|
|
1158
|
-
rotateZ:
|
|
1155
|
+
rotate: yt,
|
|
1156
|
+
rotateX: yt,
|
|
1157
|
+
rotateY: yt,
|
|
1158
|
+
rotateZ: yt,
|
|
1159
1159
|
scale: we,
|
|
1160
1160
|
scaleX: we,
|
|
1161
1161
|
scaleY: we,
|
|
1162
1162
|
scaleZ: we,
|
|
1163
|
-
skew:
|
|
1164
|
-
skewX:
|
|
1165
|
-
skewY:
|
|
1163
|
+
skew: yt,
|
|
1164
|
+
skewX: yt,
|
|
1165
|
+
skewY: yt,
|
|
1166
1166
|
distance: S,
|
|
1167
1167
|
translateX: S,
|
|
1168
1168
|
translateY: S,
|
|
@@ -1193,13 +1193,13 @@ const ge = (t) => ({
|
|
|
1193
1193
|
function Ga(t, e, n) {
|
|
1194
1194
|
let i = "", s = !0;
|
|
1195
1195
|
for (let o = 0; o < Ka; o++) {
|
|
1196
|
-
const r = pe[o],
|
|
1197
|
-
if (
|
|
1196
|
+
const r = pe[o], a = t[r];
|
|
1197
|
+
if (a === void 0)
|
|
1198
1198
|
continue;
|
|
1199
|
-
let
|
|
1200
|
-
if (typeof
|
|
1201
|
-
const c = fr(
|
|
1202
|
-
if (!
|
|
1199
|
+
let l = !0;
|
|
1200
|
+
if (typeof a == "number" ? l = a === (r.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) {
|
|
1201
|
+
const c = fr(a, Kn[r]);
|
|
1202
|
+
if (!l) {
|
|
1203
1203
|
s = !1;
|
|
1204
1204
|
const u = $a[r] || r;
|
|
1205
1205
|
i += `${u}(${c}) `;
|
|
@@ -1212,23 +1212,23 @@ function Ga(t, e, n) {
|
|
|
1212
1212
|
const hr = (t) => (e) => typeof e == "string" && e.startsWith(t), dr = hr("--"), Ha = hr("var(--"), Gn = (t) => Ha(t) ? za.test(t.split("/*")[0].trim()) : !1, za = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
|
|
1213
1213
|
function Hn(t, e, n) {
|
|
1214
1214
|
const { style: i, vars: s, transformOrigin: o } = t;
|
|
1215
|
-
let r = !1,
|
|
1216
|
-
for (const
|
|
1217
|
-
const c = e[
|
|
1218
|
-
if (Tt.has(
|
|
1215
|
+
let r = !1, a = !1;
|
|
1216
|
+
for (const l in e) {
|
|
1217
|
+
const c = e[l];
|
|
1218
|
+
if (Tt.has(l)) {
|
|
1219
1219
|
r = !0;
|
|
1220
1220
|
continue;
|
|
1221
|
-
} else if (dr(
|
|
1222
|
-
s[
|
|
1221
|
+
} else if (dr(l)) {
|
|
1222
|
+
s[l] = c;
|
|
1223
1223
|
continue;
|
|
1224
1224
|
} else {
|
|
1225
|
-
const u = fr(c, Kn[
|
|
1226
|
-
|
|
1225
|
+
const u = fr(c, Kn[l]);
|
|
1226
|
+
l.startsWith("origin") ? (a = !0, o[l] = u) : i[l] = u;
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
|
-
if (e.transform || (r || n ? i.transform = Ga(e, t.transform, n) : i.transform && (i.transform = "none")),
|
|
1230
|
-
const { originX:
|
|
1231
|
-
i.transformOrigin = `${
|
|
1229
|
+
if (e.transform || (r || n ? i.transform = Ga(e, t.transform, n) : i.transform && (i.transform = "none")), a) {
|
|
1230
|
+
const { originX: l = "50%", originY: c = "50%", originZ: u = 0 } = o;
|
|
1231
|
+
i.transformOrigin = `${l} ${c} ${u}`;
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
|
1234
1234
|
const zn = () => ({
|
|
@@ -1323,8 +1323,8 @@ function il(t, e, n = 1, i = 0, s = !0) {
|
|
|
1323
1323
|
t.pathLength = 1;
|
|
1324
1324
|
const o = s ? el : nl;
|
|
1325
1325
|
t[o.offset] = S.transform(-i);
|
|
1326
|
-
const r = S.transform(e),
|
|
1327
|
-
t[o.array] = `${r} ${
|
|
1326
|
+
const r = S.transform(e), a = S.transform(n);
|
|
1327
|
+
t[o.array] = `${r} ${a}`;
|
|
1328
1328
|
}
|
|
1329
1329
|
function Yn(t, {
|
|
1330
1330
|
attrX: e,
|
|
@@ -1333,8 +1333,8 @@ function Yn(t, {
|
|
|
1333
1333
|
originX: s,
|
|
1334
1334
|
originY: o,
|
|
1335
1335
|
pathLength: r,
|
|
1336
|
-
pathSpacing:
|
|
1337
|
-
pathOffset:
|
|
1336
|
+
pathSpacing: a = 1,
|
|
1337
|
+
pathOffset: l = 0,
|
|
1338
1338
|
// This is object creation, which we try to avoid per-frame.
|
|
1339
1339
|
...c
|
|
1340
1340
|
}, u, f) {
|
|
@@ -1344,7 +1344,7 @@ function Yn(t, {
|
|
|
1344
1344
|
}
|
|
1345
1345
|
t.attrs = t.style, t.style = {};
|
|
1346
1346
|
const { attrs: d, style: p, dimensions: g } = t;
|
|
1347
|
-
d.transform && (g && (p.transform = d.transform), delete d.transform), g && (s !== void 0 || o !== void 0 || p.transform) && (p.transformOrigin = tl(g, s !== void 0 ? s : 0.5, o !== void 0 ? o : 0.5)), e !== void 0 && (d.x = e), n !== void 0 && (d.y = n), i !== void 0 && (d.scale = i), r !== void 0 && il(d, r,
|
|
1347
|
+
d.transform && (g && (p.transform = d.transform), delete d.transform), g && (s !== void 0 || o !== void 0 || p.transform) && (p.transformOrigin = tl(g, s !== void 0 ? s : 0.5, o !== void 0 ? o : 0.5)), e !== void 0 && (d.x = e), n !== void 0 && (d.y = n), i !== void 0 && (d.scale = i), r !== void 0 && il(d, r, a, l, !1);
|
|
1348
1348
|
}
|
|
1349
1349
|
const gr = () => ({
|
|
1350
1350
|
...zn(),
|
|
@@ -1366,7 +1366,7 @@ function sl(t, e, n, i) {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
function rl(t = !1) {
|
|
1368
1368
|
return (n, i, s, { latestValues: o }, r) => {
|
|
1369
|
-
const
|
|
1369
|
+
const l = (Wn(n) ? sl : qa)(i, o, r, n), c = Qa(i, typeof n == "string", t), u = n !== er ? { ...c, ...l, ref: s } : {}, { children: f } = i, d = Dt(() => Y(f) ? f.get() : f, [f]);
|
|
1370
1370
|
return sa(n, {
|
|
1371
1371
|
...u,
|
|
1372
1372
|
children: d
|
|
@@ -1472,12 +1472,12 @@ function We(t, e) {
|
|
|
1472
1472
|
const n = t.indexOf(e);
|
|
1473
1473
|
n > -1 && t.splice(n, 1);
|
|
1474
1474
|
}
|
|
1475
|
-
function ll({ applyWillChange: t = !1, scrapeMotionValuesFromProps: e, createRenderState: n, onMount: i }, s, o, r,
|
|
1476
|
-
const
|
|
1477
|
-
latestValues: ul(s, o, r,
|
|
1475
|
+
function ll({ applyWillChange: t = !1, scrapeMotionValuesFromProps: e, createRenderState: n, onMount: i }, s, o, r, a) {
|
|
1476
|
+
const l = {
|
|
1477
|
+
latestValues: ul(s, o, r, a ? !1 : t, e),
|
|
1478
1478
|
renderState: n()
|
|
1479
1479
|
};
|
|
1480
|
-
return i && (
|
|
1480
|
+
return i && (l.mount = (c) => i(s, c, l)), l;
|
|
1481
1481
|
}
|
|
1482
1482
|
const wr = (t) => (e, n) => {
|
|
1483
1483
|
const i = G(_e), s = G(Be), o = () => ll(t, e, i, s, n);
|
|
@@ -1492,14 +1492,14 @@ function Ni(t, e, n) {
|
|
|
1492
1492
|
for (let s = 0; s < i.length; s++) {
|
|
1493
1493
|
const o = Zn(t, i[s]);
|
|
1494
1494
|
if (o) {
|
|
1495
|
-
const { transitionEnd: r, transition:
|
|
1496
|
-
n(
|
|
1495
|
+
const { transitionEnd: r, transition: a, ...l } = o;
|
|
1496
|
+
n(l, r);
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
1499
|
}
|
|
1500
1500
|
function ul(t, e, n, i, s) {
|
|
1501
1501
|
var o;
|
|
1502
|
-
const r = {},
|
|
1502
|
+
const r = {}, a = [], l = i && ((o = t.style) === null || o === void 0 ? void 0 : o.willChange) === void 0, c = s(t, {});
|
|
1503
1503
|
for (const T in c)
|
|
1504
1504
|
r[T] = Ae(c[T]);
|
|
1505
1505
|
let { initial: u, animate: f } = t;
|
|
@@ -1519,12 +1519,12 @@ function ul(t, e, n, i, s) {
|
|
|
1519
1519
|
}
|
|
1520
1520
|
for (const y in P)
|
|
1521
1521
|
r[y] = P[y];
|
|
1522
|
-
}),
|
|
1522
|
+
}), l && (f && u !== !1 && !ae(f) && Ni(t, f, (T) => {
|
|
1523
1523
|
for (const P in T)
|
|
1524
|
-
cl(
|
|
1525
|
-
}),
|
|
1524
|
+
cl(a, P);
|
|
1525
|
+
}), a.length && (r.willChange = a.join(","))), r;
|
|
1526
1526
|
}
|
|
1527
|
-
const { schedule: k, cancel:
|
|
1527
|
+
const { schedule: k, cancel: pt, state: K, steps: en } = or(typeof requestAnimationFrame < "u" ? requestAnimationFrame : H, !0), fl = {
|
|
1528
1528
|
useVisualState: wr({
|
|
1529
1529
|
scrapeMotionValuesFromProps: xr,
|
|
1530
1530
|
createRenderState: gr,
|
|
@@ -1574,10 +1574,10 @@ function $e(t, e = "page") {
|
|
|
1574
1574
|
};
|
|
1575
1575
|
}
|
|
1576
1576
|
const pl = (t) => (e) => Sr(e) && t(e, $e(e));
|
|
1577
|
-
function
|
|
1577
|
+
function ct(t, e, n, i) {
|
|
1578
1578
|
return at(t, e, pl(n), i);
|
|
1579
1579
|
}
|
|
1580
|
-
const ml = (t, e) => (n) => e(t(n)),
|
|
1580
|
+
const ml = (t, e) => (n) => e(t(n)), ut = (...t) => t.reduce(ml);
|
|
1581
1581
|
function Cr(t) {
|
|
1582
1582
|
let e = null;
|
|
1583
1583
|
return () => {
|
|
@@ -1617,18 +1617,18 @@ function $i(t, e) {
|
|
|
1617
1617
|
const n = e ? "pointerenter" : "pointerleave", i = e ? "onHoverStart" : "onHoverEnd", s = (o, r) => {
|
|
1618
1618
|
if (o.pointerType === "touch" || Rr())
|
|
1619
1619
|
return;
|
|
1620
|
-
const
|
|
1621
|
-
t.animationState &&
|
|
1622
|
-
const
|
|
1623
|
-
|
|
1620
|
+
const a = t.getProps();
|
|
1621
|
+
t.animationState && a.whileHover && t.animationState.setActive("whileHover", e);
|
|
1622
|
+
const l = a[i];
|
|
1623
|
+
l && k.postRender(() => l(o, r));
|
|
1624
1624
|
};
|
|
1625
|
-
return
|
|
1625
|
+
return ct(t.current, n, s, {
|
|
1626
1626
|
passive: !t.getProps()[i]
|
|
1627
1627
|
});
|
|
1628
1628
|
}
|
|
1629
1629
|
class gl extends wt {
|
|
1630
1630
|
mount() {
|
|
1631
|
-
this.unmount =
|
|
1631
|
+
this.unmount = ut($i(this.node, !0), $i(this.node, !1));
|
|
1632
1632
|
}
|
|
1633
1633
|
unmount() {
|
|
1634
1634
|
}
|
|
@@ -1650,7 +1650,7 @@ class yl extends wt {
|
|
|
1650
1650
|
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
1651
1651
|
}
|
|
1652
1652
|
mount() {
|
|
1653
|
-
this.unmount =
|
|
1653
|
+
this.unmount = ut(at(this.node.current, "focus", () => this.onFocus()), at(this.node.current, "blur", () => this.onBlur()));
|
|
1654
1654
|
}
|
|
1655
1655
|
unmount() {
|
|
1656
1656
|
}
|
|
@@ -1668,34 +1668,34 @@ class vl extends wt {
|
|
|
1668
1668
|
if (this.isPressing)
|
|
1669
1669
|
return;
|
|
1670
1670
|
this.removeEndListeners();
|
|
1671
|
-
const i = this.node.getProps(), o =
|
|
1671
|
+
const i = this.node.getProps(), o = ct(window, "pointerup", (a, l) => {
|
|
1672
1672
|
if (!this.checkPressEnd())
|
|
1673
1673
|
return;
|
|
1674
|
-
const { onTap: c, onTapCancel: u, globalTapTarget: f } = this.node.getProps(), d = !f && !Vr(this.node.current,
|
|
1675
|
-
d && k.update(() => d(
|
|
1674
|
+
const { onTap: c, onTapCancel: u, globalTapTarget: f } = this.node.getProps(), d = !f && !Vr(this.node.current, a.target) ? u : c;
|
|
1675
|
+
d && k.update(() => d(a, l));
|
|
1676
1676
|
}, {
|
|
1677
1677
|
passive: !(i.onTap || i.onPointerUp)
|
|
1678
|
-
}), r =
|
|
1678
|
+
}), r = ct(window, "pointercancel", (a, l) => this.cancelPress(a, l), {
|
|
1679
1679
|
passive: !(i.onTapCancel || i.onPointerCancel)
|
|
1680
1680
|
});
|
|
1681
|
-
this.removeEndListeners =
|
|
1681
|
+
this.removeEndListeners = ut(o, r), this.startPress(e, n);
|
|
1682
1682
|
}, this.startAccessiblePress = () => {
|
|
1683
1683
|
const e = (o) => {
|
|
1684
1684
|
if (o.key !== "Enter" || this.isPressing)
|
|
1685
1685
|
return;
|
|
1686
|
-
const r = (
|
|
1687
|
-
|
|
1686
|
+
const r = (a) => {
|
|
1687
|
+
a.key !== "Enter" || !this.checkPressEnd() || nn("up", (l, c) => {
|
|
1688
1688
|
const { onTap: u } = this.node.getProps();
|
|
1689
|
-
u && k.postRender(() => u(
|
|
1689
|
+
u && k.postRender(() => u(l, c));
|
|
1690
1690
|
});
|
|
1691
1691
|
};
|
|
1692
|
-
this.removeEndListeners(), this.removeEndListeners = at(this.node.current, "keyup", r), nn("down", (
|
|
1693
|
-
this.startPress(
|
|
1692
|
+
this.removeEndListeners(), this.removeEndListeners = at(this.node.current, "keyup", r), nn("down", (a, l) => {
|
|
1693
|
+
this.startPress(a, l);
|
|
1694
1694
|
});
|
|
1695
1695
|
}, n = at(this.node.current, "keydown", e), i = () => {
|
|
1696
1696
|
this.isPressing && nn("cancel", (o, r) => this.cancelPress(o, r));
|
|
1697
1697
|
}, s = at(this.node.current, "blur", i);
|
|
1698
|
-
this.removeAccessibleListeners =
|
|
1698
|
+
this.removeAccessibleListeners = ut(n, s);
|
|
1699
1699
|
};
|
|
1700
1700
|
}
|
|
1701
1701
|
startPress(e, n) {
|
|
@@ -1713,10 +1713,10 @@ class vl extends wt {
|
|
|
1713
1713
|
i && k.postRender(() => i(e, n));
|
|
1714
1714
|
}
|
|
1715
1715
|
mount() {
|
|
1716
|
-
const e = this.node.getProps(), n =
|
|
1716
|
+
const e = this.node.getProps(), n = ct(e.globalTapTarget ? window : this.node.current, "pointerdown", this.startPointerPress, {
|
|
1717
1717
|
passive: !(e.onTapStart || e.onPointerStart)
|
|
1718
1718
|
}), i = at(this.node.current, "focus", this.startAccessiblePress);
|
|
1719
|
-
this.removeStartListeners =
|
|
1719
|
+
this.removeStartListeners = ut(n, i);
|
|
1720
1720
|
}
|
|
1721
1721
|
unmount() {
|
|
1722
1722
|
this.removeStartListeners(), this.removeEndListeners(), this.removeAccessibleListeners();
|
|
@@ -1754,15 +1754,15 @@ class Sl extends wt {
|
|
|
1754
1754
|
root: n ? n.current : void 0,
|
|
1755
1755
|
rootMargin: i,
|
|
1756
1756
|
threshold: typeof s == "number" ? s : wl[s]
|
|
1757
|
-
},
|
|
1758
|
-
const { isIntersecting: c } =
|
|
1757
|
+
}, a = (l) => {
|
|
1758
|
+
const { isIntersecting: c } = l;
|
|
1759
1759
|
if (this.isInView === c || (this.isInView = c, o && !c && this.hasEnteredView))
|
|
1760
1760
|
return;
|
|
1761
1761
|
c && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", c);
|
|
1762
1762
|
const { onViewportEnter: u, onViewportLeave: f } = this.node.getProps(), d = c ? u : f;
|
|
1763
|
-
d && d(
|
|
1763
|
+
d && d(l);
|
|
1764
1764
|
};
|
|
1765
|
-
return Tl(this.node.current, r,
|
|
1765
|
+
return Tl(this.node.current, r, a);
|
|
1766
1766
|
}
|
|
1767
1767
|
mount() {
|
|
1768
1768
|
this.startObserver();
|
|
@@ -1808,7 +1808,7 @@ function Ke(t, e, n) {
|
|
|
1808
1808
|
const i = t.getProps();
|
|
1809
1809
|
return Zn(i, e, n !== void 0 ? n : i.custom, t);
|
|
1810
1810
|
}
|
|
1811
|
-
const
|
|
1811
|
+
const ft = (t) => t * 1e3, ht = (t) => t / 1e3, Rl = {
|
|
1812
1812
|
type: "spring",
|
|
1813
1813
|
stiffness: 500,
|
|
1814
1814
|
damping: 25,
|
|
@@ -1826,7 +1826,7 @@ const ut = (t) => t * 1e3, ft = (t) => t / 1e3, Rl = {
|
|
|
1826
1826
|
ease: [0.25, 0.1, 0.35, 1],
|
|
1827
1827
|
duration: 0.3
|
|
1828
1828
|
}, Ml = (t, { keyframes: e }) => e.length > 2 ? El : Tt.has(t) ? t.startsWith("scale") ? Vl(e[1]) : Rl : Dl;
|
|
1829
|
-
function kl({ when: t, delay: e, delayChildren: n, staggerChildren: i, staggerDirection: s, repeat: o, repeatType: r, repeatDelay:
|
|
1829
|
+
function kl({ when: t, delay: e, delayChildren: n, staggerChildren: i, staggerDirection: s, repeat: o, repeatType: r, repeatDelay: a, from: l, elapsed: c, ...u }) {
|
|
1830
1830
|
return !!Object.keys(u).length;
|
|
1831
1831
|
}
|
|
1832
1832
|
function Qn(t, e) {
|
|
@@ -1841,8 +1841,8 @@ let Re;
|
|
|
1841
1841
|
function Ol() {
|
|
1842
1842
|
Re = void 0;
|
|
1843
1843
|
}
|
|
1844
|
-
const
|
|
1845
|
-
now: () => (Re === void 0 &&
|
|
1844
|
+
const Pt = {
|
|
1845
|
+
now: () => (Re === void 0 && Pt.set(K.isProcessing || xa.useManualTiming ? K.timestamp : performance.now()), Re),
|
|
1846
1846
|
set: (t) => {
|
|
1847
1847
|
Re = t, queueMicrotask(Ol);
|
|
1848
1848
|
}
|
|
@@ -1863,7 +1863,7 @@ function _l(t) {
|
|
|
1863
1863
|
}
|
|
1864
1864
|
const Bl = 4;
|
|
1865
1865
|
function kr(t, e, n = 1) {
|
|
1866
|
-
|
|
1866
|
+
dt(n <= Bl, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
|
|
1867
1867
|
const [i, s] = _l(t);
|
|
1868
1868
|
if (!i)
|
|
1869
1869
|
return;
|
|
@@ -1920,7 +1920,7 @@ Kt.translateY = Kt.y;
|
|
|
1920
1920
|
const Lr = (t) => (e) => e.test(t), $l = {
|
|
1921
1921
|
test: (t) => t === "auto",
|
|
1922
1922
|
parse: (t) => t
|
|
1923
|
-
}, Or = [Ht, S, ot,
|
|
1923
|
+
}, Or = [Ht, S, ot, yt, Wa, Ua, $l], zi = (t) => Or.find(Lr(t)), Et = /* @__PURE__ */ new Set();
|
|
1924
1924
|
let xn = !1, bn = !1;
|
|
1925
1925
|
function jr() {
|
|
1926
1926
|
if (bn) {
|
|
@@ -1932,8 +1932,8 @@ function jr() {
|
|
|
1932
1932
|
i.render();
|
|
1933
1933
|
const s = n.get(i);
|
|
1934
1934
|
s && s.forEach(([o, r]) => {
|
|
1935
|
-
var
|
|
1936
|
-
(
|
|
1935
|
+
var a;
|
|
1936
|
+
(a = i.getValue(o)) === null || a === void 0 || a.set(r);
|
|
1937
1937
|
});
|
|
1938
1938
|
}), t.forEach((i) => i.measureEndState()), t.forEach((i) => {
|
|
1939
1939
|
i.suspendedScrollY !== void 0 && window.scrollTo(0, i.suspendedScrollY);
|
|
@@ -1961,14 +1961,14 @@ class ti {
|
|
|
1961
1961
|
for (let o = 0; o < e.length; o++)
|
|
1962
1962
|
if (e[o] === null)
|
|
1963
1963
|
if (o === 0) {
|
|
1964
|
-
const r = s == null ? void 0 : s.get(),
|
|
1964
|
+
const r = s == null ? void 0 : s.get(), a = e[e.length - 1];
|
|
1965
1965
|
if (r !== void 0)
|
|
1966
1966
|
e[0] = r;
|
|
1967
1967
|
else if (i && n) {
|
|
1968
|
-
const
|
|
1969
|
-
|
|
1968
|
+
const l = i.readValue(n, a);
|
|
1969
|
+
l != null && (e[0] = l);
|
|
1970
1970
|
}
|
|
1971
|
-
e[0] === void 0 && (e[0] =
|
|
1971
|
+
e[0] === void 0 && (e[0] = a), s && r === void 0 && s.set(e[0]);
|
|
1972
1972
|
} else
|
|
1973
1973
|
e[o] = e[o - 1];
|
|
1974
1974
|
}
|
|
@@ -1993,12 +1993,12 @@ class ti {
|
|
|
1993
1993
|
const ei = (t, e) => (n) => !!(me(n) && Ia.test(n) && n.startsWith(t) || e && !Na(n) && Object.prototype.hasOwnProperty.call(n, e)), _r = (t, e, n) => (i) => {
|
|
1994
1994
|
if (!me(i))
|
|
1995
1995
|
return i;
|
|
1996
|
-
const [s, o, r,
|
|
1996
|
+
const [s, o, r, a] = i.match($n);
|
|
1997
1997
|
return {
|
|
1998
1998
|
[t]: parseFloat(s),
|
|
1999
1999
|
[e]: parseFloat(o),
|
|
2000
2000
|
[n]: parseFloat(r),
|
|
2001
|
-
alpha:
|
|
2001
|
+
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
2002
2002
|
};
|
|
2003
2003
|
}, Gl = (t) => xt(0, 255, t), rn = {
|
|
2004
2004
|
...Ht,
|
|
@@ -2042,8 +2042,8 @@ function le(t) {
|
|
|
2042
2042
|
var: []
|
|
2043
2043
|
}, s = [];
|
|
2044
2044
|
let o = 0;
|
|
2045
|
-
const
|
|
2046
|
-
return { values: n, split:
|
|
2045
|
+
const a = e.replace(ql, (l) => (z.test(l) ? (i.color.push(o), s.push(Ir), n.push(z.parse(l))) : l.startsWith(Xl) ? (i.var.push(o), s.push(Yl), n.push(l)) : (i.number.push(o), s.push(Br), n.push(parseFloat(l))), ++o, Yi)).split(Yi);
|
|
2046
|
+
return { values: n, split: a, indexes: i, types: s };
|
|
2047
2047
|
}
|
|
2048
2048
|
function Nr(t) {
|
|
2049
2049
|
return le(t).values;
|
|
@@ -2054,8 +2054,8 @@ function Ur(t) {
|
|
|
2054
2054
|
let o = "";
|
|
2055
2055
|
for (let r = 0; r < i; r++)
|
|
2056
2056
|
if (o += e[r], s[r] !== void 0) {
|
|
2057
|
-
const
|
|
2058
|
-
|
|
2057
|
+
const a = n[r];
|
|
2058
|
+
a === Br ? o += ne(s[r]) : a === Ir ? o += z.transform(s[r]) : o += s[r];
|
|
2059
2059
|
}
|
|
2060
2060
|
return o;
|
|
2061
2061
|
};
|
|
@@ -2129,21 +2129,21 @@ class $r extends ti {
|
|
|
2129
2129
|
if (!n.current)
|
|
2130
2130
|
return;
|
|
2131
2131
|
super.readKeyframes();
|
|
2132
|
-
for (let
|
|
2133
|
-
let c = e[
|
|
2132
|
+
for (let l = 0; l < e.length; l++) {
|
|
2133
|
+
let c = e[l];
|
|
2134
2134
|
if (typeof c == "string" && (c = c.trim(), Gn(c))) {
|
|
2135
2135
|
const u = kr(c, n.current);
|
|
2136
|
-
u !== void 0 && (e[
|
|
2136
|
+
u !== void 0 && (e[l] = u), l === e.length - 1 && (this.finalKeyframe = c);
|
|
2137
2137
|
}
|
|
2138
2138
|
}
|
|
2139
2139
|
if (this.resolveNoneKeyframes(), !Il.has(i) || e.length !== 2)
|
|
2140
2140
|
return;
|
|
2141
|
-
const [s, o] = e, r = zi(s),
|
|
2142
|
-
if (r !==
|
|
2143
|
-
if (Ki(r) && Ki(
|
|
2144
|
-
for (let
|
|
2145
|
-
const c = e[
|
|
2146
|
-
typeof c == "string" && (e[
|
|
2141
|
+
const [s, o] = e, r = zi(s), a = zi(o);
|
|
2142
|
+
if (r !== a)
|
|
2143
|
+
if (Ki(r) && Ki(a))
|
|
2144
|
+
for (let l = 0; l < e.length; l++) {
|
|
2145
|
+
const c = e[l];
|
|
2146
|
+
typeof c == "string" && (e[l] = parseFloat(c));
|
|
2147
2147
|
}
|
|
2148
2148
|
else
|
|
2149
2149
|
this.needsMeasurement = !0;
|
|
@@ -2169,9 +2169,9 @@ class $r extends ti {
|
|
|
2169
2169
|
return;
|
|
2170
2170
|
const o = n.getValue(i);
|
|
2171
2171
|
o && o.jump(this.measuredOrigin, !1);
|
|
2172
|
-
const r = s.length - 1,
|
|
2173
|
-
s[r] = Kt[i](n.measureViewportBox(), window.getComputedStyle(n.current)),
|
|
2174
|
-
n.getValue(
|
|
2172
|
+
const r = s.length - 1, a = s[r];
|
|
2173
|
+
s[r] = Kt[i](n.measureViewportBox(), window.getComputedStyle(n.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), !((e = this.removedTransforms) === null || e === void 0) && e.length && this.removedTransforms.forEach(([l, c]) => {
|
|
2174
|
+
n.getValue(l).set(c);
|
|
2175
2175
|
}), this.resolveNoneKeyframes();
|
|
2176
2176
|
}
|
|
2177
2177
|
}
|
|
@@ -2196,11 +2196,11 @@ function oc(t, e, n, i) {
|
|
|
2196
2196
|
return !1;
|
|
2197
2197
|
if (e === "display" || e === "visibility")
|
|
2198
2198
|
return !0;
|
|
2199
|
-
const o = t[t.length - 1], r = Xi(s, e),
|
|
2200
|
-
return Gt(r ===
|
|
2199
|
+
const o = t[t.length - 1], r = Xi(s, e), a = Xi(o, e);
|
|
2200
|
+
return Gt(r === a, `You are trying to animate ${e} from "${s}" to "${o}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${o} via the \`style\` property.`), !r || !a ? !1 : rc(t) || n === "spring" && i;
|
|
2201
2201
|
}
|
|
2202
2202
|
class Gr {
|
|
2203
|
-
constructor({ autoplay: e = !0, delay: n = 0, type: i = "keyframes", repeat: s = 0, repeatDelay: o = 0, repeatType: r = "loop", ...
|
|
2203
|
+
constructor({ autoplay: e = !0, delay: n = 0, type: i = "keyframes", repeat: s = 0, repeatDelay: o = 0, repeatType: r = "loop", ...a }) {
|
|
2204
2204
|
this.isStopped = !1, this.hasAttemptedResolve = !1, this.options = {
|
|
2205
2205
|
autoplay: e,
|
|
2206
2206
|
delay: n,
|
|
@@ -2208,7 +2208,7 @@ class Gr {
|
|
|
2208
2208
|
repeat: s,
|
|
2209
2209
|
repeatDelay: o,
|
|
2210
2210
|
repeatType: r,
|
|
2211
|
-
...
|
|
2211
|
+
...a
|
|
2212
2212
|
}, this.updateFinishedPromise();
|
|
2213
2213
|
}
|
|
2214
2214
|
/**
|
|
@@ -2226,12 +2226,12 @@ class Gr {
|
|
|
2226
2226
|
*/
|
|
2227
2227
|
onKeyframesResolved(e, n) {
|
|
2228
2228
|
this.hasAttemptedResolve = !0;
|
|
2229
|
-
const { name: i, type: s, velocity: o, delay: r, onComplete:
|
|
2229
|
+
const { name: i, type: s, velocity: o, delay: r, onComplete: a, onUpdate: l, isGenerator: c } = this.options;
|
|
2230
2230
|
if (!c && !oc(e, i, s, o))
|
|
2231
2231
|
if (r)
|
|
2232
2232
|
this.options.duration = 0;
|
|
2233
2233
|
else {
|
|
2234
|
-
|
|
2234
|
+
l == null || l(Ge(e, this.options, n)), a == null || a(), this.resolveFinishedPromise();
|
|
2235
2235
|
return;
|
|
2236
2236
|
}
|
|
2237
2237
|
const u = this.initPlayback(e, n);
|
|
@@ -2268,9 +2268,9 @@ function zr(t, e, n) {
|
|
|
2268
2268
|
const on = 1e-3, lc = 0.01, qi = 10, cc = 0.05, uc = 1;
|
|
2269
2269
|
function fc({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: i = 1 }) {
|
|
2270
2270
|
let s, o;
|
|
2271
|
-
Gt(t <=
|
|
2271
|
+
Gt(t <= ft(qi), "Spring duration must be 10 seconds or less");
|
|
2272
2272
|
let r = 1 - e;
|
|
2273
|
-
r = xt(cc, uc, r), t = xt(lc, qi,
|
|
2273
|
+
r = xt(cc, uc, r), t = xt(lc, qi, ht(t)), r < 1 ? (s = (c) => {
|
|
2274
2274
|
const u = c * r, f = u * t, d = u - n, p = Sn(c, r), g = Math.exp(-f);
|
|
2275
2275
|
return on - d / p * g;
|
|
2276
2276
|
}, o = (c) => {
|
|
@@ -2283,15 +2283,15 @@ function fc({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: i = 1
|
|
|
2283
2283
|
const u = Math.exp(-c * t), f = (n - c) * (t * t);
|
|
2284
2284
|
return u * f;
|
|
2285
2285
|
});
|
|
2286
|
-
const
|
|
2287
|
-
if (t =
|
|
2286
|
+
const a = 5 / t, l = dc(s, o, a);
|
|
2287
|
+
if (t = ft(t), isNaN(l))
|
|
2288
2288
|
return {
|
|
2289
2289
|
stiffness: 100,
|
|
2290
2290
|
damping: 10,
|
|
2291
2291
|
duration: t
|
|
2292
2292
|
};
|
|
2293
2293
|
{
|
|
2294
|
-
const c = Math.pow(
|
|
2294
|
+
const c = Math.pow(l, 2) * i;
|
|
2295
2295
|
return {
|
|
2296
2296
|
stiffness: c,
|
|
2297
2297
|
damping: r * 2 * Math.sqrt(i * c),
|
|
@@ -2333,10 +2333,10 @@ function gc(t) {
|
|
|
2333
2333
|
return e;
|
|
2334
2334
|
}
|
|
2335
2335
|
function Yr({ keyframes: t, restDelta: e, restSpeed: n, ...i }) {
|
|
2336
|
-
const s = t[0], o = t[t.length - 1], r = { done: !1, value: s }, { stiffness:
|
|
2336
|
+
const s = t[0], o = t[t.length - 1], r = { done: !1, value: s }, { stiffness: a, damping: l, mass: c, duration: u, velocity: f, isResolvedFromDuration: d } = gc({
|
|
2337
2337
|
...i,
|
|
2338
|
-
velocity: -
|
|
2339
|
-
}), p = f || 0, g =
|
|
2338
|
+
velocity: -ht(i.velocity || 0)
|
|
2339
|
+
}), p = f || 0, g = l / (2 * Math.sqrt(a * c)), v = o - s, T = ht(Math.sqrt(a / c)), P = Math.abs(v) < 5;
|
|
2340
2340
|
n || (n = P ? 0.01 : 2), e || (e = P ? 5e-3 : 0.5);
|
|
2341
2341
|
let y;
|
|
2342
2342
|
if (g < 1) {
|
|
@@ -2370,11 +2370,11 @@ function Yr({ keyframes: t, restDelta: e, restSpeed: n, ...i }) {
|
|
|
2370
2370
|
}
|
|
2371
2371
|
};
|
|
2372
2372
|
}
|
|
2373
|
-
function Ji({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 325, bounceDamping: s = 10, bounceStiffness: o = 500, modifyTarget: r, min:
|
|
2373
|
+
function Ji({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 325, bounceDamping: s = 10, bounceStiffness: o = 500, modifyTarget: r, min: a, max: l, restDelta: c = 0.5, restSpeed: u }) {
|
|
2374
2374
|
const f = t[0], d = {
|
|
2375
2375
|
done: !1,
|
|
2376
2376
|
value: f
|
|
2377
|
-
}, p = (R) =>
|
|
2377
|
+
}, p = (R) => a !== void 0 && R < a || l !== void 0 && R > l, g = (R) => a === void 0 ? l : l === void 0 || Math.abs(a - R) < Math.abs(l - R) ? a : l;
|
|
2378
2378
|
let v = n * e;
|
|
2379
2379
|
const T = f + v, P = r === void 0 ? T : r(T);
|
|
2380
2380
|
P !== T && (v = P - f);
|
|
@@ -2404,10 +2404,10 @@ function Ji({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 3
|
|
|
2404
2404
|
}
|
|
2405
2405
|
const Xr = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, yc = 1e-7, vc = 12;
|
|
2406
2406
|
function Pc(t, e, n, i, s) {
|
|
2407
|
-
let o, r,
|
|
2407
|
+
let o, r, a = 0;
|
|
2408
2408
|
do
|
|
2409
2409
|
r = e + (n - e) / 2, o = Xr(r, i, s) - t, o > 0 ? n = r : e = r;
|
|
2410
|
-
while (Math.abs(o) > yc && ++
|
|
2410
|
+
while (Math.abs(o) > yc && ++a < vc);
|
|
2411
2411
|
return r;
|
|
2412
2412
|
}
|
|
2413
2413
|
function ye(t, e, n, i) {
|
|
@@ -2430,11 +2430,11 @@ const xc = ye(0.42, 0, 1, 1), bc = ye(0, 0, 0.58, 1), qr = ye(0.42, 0, 0.58, 1),
|
|
|
2430
2430
|
anticipate: Cc
|
|
2431
2431
|
}, ts = (t) => {
|
|
2432
2432
|
if (Array.isArray(t)) {
|
|
2433
|
-
|
|
2433
|
+
dt(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
2434
2434
|
const [e, n, i, s] = t;
|
|
2435
2435
|
return ye(e, n, i, s);
|
|
2436
2436
|
} else if (typeof t == "string")
|
|
2437
|
-
return
|
|
2437
|
+
return dt(Qi[t] !== void 0, `Invalid easing type '${t}'`), Qi[t];
|
|
2438
2438
|
return t;
|
|
2439
2439
|
}, ce = (t, e, n) => {
|
|
2440
2440
|
const i = e - t;
|
|
@@ -2449,8 +2449,8 @@ function Ac({ hue: t, saturation: e, lightness: n, alpha: i }) {
|
|
|
2449
2449
|
if (!e)
|
|
2450
2450
|
s = o = r = n;
|
|
2451
2451
|
else {
|
|
2452
|
-
const
|
|
2453
|
-
s = an(
|
|
2452
|
+
const a = n < 0.5 ? n * (1 + e) : n + e - n * e, l = 2 * n - a;
|
|
2453
|
+
s = an(l, a, t + 1 / 3), o = an(l, a, t), r = an(l, a, t - 1 / 3);
|
|
2454
2454
|
}
|
|
2455
2455
|
return {
|
|
2456
2456
|
red: Math.round(s * 255),
|
|
@@ -2511,14 +2511,14 @@ function kc(t, e) {
|
|
|
2511
2511
|
var n;
|
|
2512
2512
|
const i = [], s = { color: 0, var: 0, number: 0 };
|
|
2513
2513
|
for (let o = 0; o < e.values.length; o++) {
|
|
2514
|
-
const r = e.types[o],
|
|
2515
|
-
i[o] =
|
|
2514
|
+
const r = e.types[o], a = t.indexes[r][s[r]], l = (n = t.values[a]) !== null && n !== void 0 ? n : 0;
|
|
2515
|
+
i[o] = l, s[r]++;
|
|
2516
2516
|
}
|
|
2517
2517
|
return i;
|
|
2518
2518
|
}
|
|
2519
2519
|
const Lc = (t, e) => {
|
|
2520
2520
|
const n = bt.createTransformer(e), i = le(t), s = le(e);
|
|
2521
|
-
return i.indexes.var.length === s.indexes.var.length && i.indexes.color.length === s.indexes.color.length && i.indexes.number.length >= s.indexes.number.length ? Cn.has(t) && !s.values.length || Cn.has(e) && !i.values.length ? Ec(t, e) :
|
|
2521
|
+
return i.indexes.var.length === s.indexes.var.length && i.indexes.color.length === s.indexes.color.length && i.indexes.number.length >= s.indexes.number.length ? Cn.has(t) && !s.values.length || Cn.has(e) && !i.values.length ? Ec(t, e) : ut(eo(kc(i, s), s.values), n) : (Gt(!0, `Complex values '${t}' and '${e}' 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.`), Le(t, e));
|
|
2522
2522
|
};
|
|
2523
2523
|
function no(t, e, n) {
|
|
2524
2524
|
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? F(t, e, n) : ri(t)(t, e);
|
|
@@ -2526,31 +2526,31 @@ function no(t, e, n) {
|
|
|
2526
2526
|
function Oc(t, e, n) {
|
|
2527
2527
|
const i = [], s = n || no, o = t.length - 1;
|
|
2528
2528
|
for (let r = 0; r < o; r++) {
|
|
2529
|
-
let
|
|
2529
|
+
let a = s(t[r], t[r + 1]);
|
|
2530
2530
|
if (e) {
|
|
2531
|
-
const
|
|
2532
|
-
|
|
2531
|
+
const l = Array.isArray(e) ? e[r] || H : e;
|
|
2532
|
+
a = ut(l, a);
|
|
2533
2533
|
}
|
|
2534
|
-
i.push(
|
|
2534
|
+
i.push(a);
|
|
2535
2535
|
}
|
|
2536
2536
|
return i;
|
|
2537
2537
|
}
|
|
2538
2538
|
function jc(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
|
|
2539
2539
|
const o = t.length;
|
|
2540
|
-
if (
|
|
2540
|
+
if (dt(o === e.length, "Both input and output ranges must be the same length"), o === 1)
|
|
2541
2541
|
return () => e[0];
|
|
2542
2542
|
if (o === 2 && t[0] === t[1])
|
|
2543
2543
|
return () => e[1];
|
|
2544
2544
|
t[0] > t[o - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
2545
|
-
const r = Oc(e, i, s),
|
|
2545
|
+
const r = Oc(e, i, s), a = r.length, l = (c) => {
|
|
2546
2546
|
let u = 0;
|
|
2547
|
-
if (
|
|
2547
|
+
if (a > 1)
|
|
2548
2548
|
for (; u < t.length - 2 && !(c < t[u + 1]); u++)
|
|
2549
2549
|
;
|
|
2550
2550
|
const f = ce(t[u], t[u + 1], c);
|
|
2551
2551
|
return r[u](f);
|
|
2552
2552
|
};
|
|
2553
|
-
return n ? (c) =>
|
|
2553
|
+
return n ? (c) => l(xt(t[0], t[o - 1], c)) : l;
|
|
2554
2554
|
}
|
|
2555
2555
|
function Fc(t, e) {
|
|
2556
2556
|
const n = t[t.length - 1];
|
|
@@ -2578,12 +2578,12 @@ function Oe({ duration: t = 300, keyframes: e, times: n, ease: i = "easeInOut" }
|
|
|
2578
2578
|
// TODO Maybe we should warn here if there's a length mismatch
|
|
2579
2579
|
n && n.length === e.length ? n : _c(e),
|
|
2580
2580
|
t
|
|
2581
|
-
),
|
|
2581
|
+
), a = jc(r, e, {
|
|
2582
2582
|
ease: Array.isArray(s) ? s : Ic(e, s)
|
|
2583
2583
|
});
|
|
2584
2584
|
return {
|
|
2585
2585
|
calculatedDuration: t,
|
|
2586
|
-
next: (
|
|
2586
|
+
next: (l) => (o.value = a(l), o.done = l >= t, o)
|
|
2587
2587
|
};
|
|
2588
2588
|
}
|
|
2589
2589
|
const is = 2e4;
|
|
@@ -2599,12 +2599,12 @@ const Uc = (t) => {
|
|
|
2599
2599
|
const e = ({ timestamp: n }) => t(n);
|
|
2600
2600
|
return {
|
|
2601
2601
|
start: () => k.update(e, !0),
|
|
2602
|
-
stop: () =>
|
|
2602
|
+
stop: () => pt(e),
|
|
2603
2603
|
/**
|
|
2604
2604
|
* If we're processing this frame we can use the
|
|
2605
2605
|
* framelocked timestamp to keep things in sync.
|
|
2606
2606
|
*/
|
|
2607
|
-
now: () => K.isProcessing ? K.timestamp :
|
|
2607
|
+
now: () => K.isProcessing ? K.timestamp : Pt.now()
|
|
2608
2608
|
};
|
|
2609
2609
|
}, Wc = {
|
|
2610
2610
|
decay: Ji,
|
|
@@ -2619,18 +2619,18 @@ class oi extends Gr {
|
|
|
2619
2619
|
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
2620
2620
|
return;
|
|
2621
2621
|
this.teardown();
|
|
2622
|
-
const { onStop:
|
|
2623
|
-
|
|
2622
|
+
const { onStop: a } = this.options;
|
|
2623
|
+
a && a();
|
|
2624
2624
|
};
|
|
2625
|
-
const { name: i, motionValue: s, keyframes: o } = this.options, r = (
|
|
2625
|
+
const { name: i, motionValue: s, keyframes: o } = this.options, r = (a, l) => this.onKeyframesResolved(a, l);
|
|
2626
2626
|
i && s && s.owner ? this.resolver = s.owner.resolveKeyframes(o, r, i, s) : this.resolver = new e(o, r, i, s), this.resolver.scheduleResolve();
|
|
2627
2627
|
}
|
|
2628
2628
|
initPlayback(e) {
|
|
2629
|
-
const { type: n = "keyframes", repeat: i = 0, repeatDelay: s = 0, repeatType: o, velocity: r = 0 } = this.options,
|
|
2630
|
-
let
|
|
2631
|
-
|
|
2632
|
-
const u =
|
|
2633
|
-
o === "mirror" && (c =
|
|
2629
|
+
const { type: n = "keyframes", repeat: i = 0, repeatDelay: s = 0, repeatType: o, velocity: r = 0 } = this.options, a = Wc[n] || Oe;
|
|
2630
|
+
let l, c;
|
|
2631
|
+
a !== Oe && typeof e[0] != "number" && (process.env.NODE_ENV !== "production" && dt(e.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`), l = ut($c, no(e[0], e[1])), e = [0, 100]);
|
|
2632
|
+
const u = a({ ...this.options, keyframes: e });
|
|
2633
|
+
o === "mirror" && (c = a({
|
|
2634
2634
|
...this.options,
|
|
2635
2635
|
keyframes: [...e].reverse(),
|
|
2636
2636
|
velocity: -r
|
|
@@ -2639,7 +2639,7 @@ class oi extends Gr {
|
|
|
2639
2639
|
return {
|
|
2640
2640
|
generator: u,
|
|
2641
2641
|
mirroredGenerator: c,
|
|
2642
|
-
mapPercentToKeyframes:
|
|
2642
|
+
mapPercentToKeyframes: l,
|
|
2643
2643
|
calculatedDuration: f,
|
|
2644
2644
|
resolvedDuration: d,
|
|
2645
2645
|
totalDuration: p
|
|
@@ -2655,7 +2655,7 @@ class oi extends Gr {
|
|
|
2655
2655
|
const { keyframes: R } = this.options;
|
|
2656
2656
|
return { done: !0, value: R[R.length - 1] };
|
|
2657
2657
|
}
|
|
2658
|
-
const { finalKeyframe: s, generator: o, mirroredGenerator: r, mapPercentToKeyframes:
|
|
2658
|
+
const { finalKeyframe: s, generator: o, mirroredGenerator: r, mapPercentToKeyframes: a, keyframes: l, calculatedDuration: c, totalDuration: u, resolvedDuration: f } = i;
|
|
2659
2659
|
if (this.startTime === null)
|
|
2660
2660
|
return o.next(0);
|
|
2661
2661
|
const { delay: d, repeat: p, repeatType: g, repeatDelay: v, onUpdate: T } = this.options;
|
|
@@ -2668,29 +2668,29 @@ class oi extends Gr {
|
|
|
2668
2668
|
let _ = Math.floor(R), U = R % 1;
|
|
2669
2669
|
!U && R >= 1 && (U = 1), U === 1 && _--, _ = Math.min(_, p + 1), !!(_ % 2) && (g === "reverse" ? (U = 1 - U, v && (U -= v / f)) : g === "mirror" && (w = r)), x = xt(0, 1, U) * f;
|
|
2670
2670
|
}
|
|
2671
|
-
const A = y ? { done: !1, value:
|
|
2672
|
-
|
|
2671
|
+
const A = y ? { done: !1, value: l[0] } : w.next(x);
|
|
2672
|
+
a && (A.value = a(A.value));
|
|
2673
2673
|
let { done: L } = A;
|
|
2674
2674
|
!y && c !== null && (L = this.speed >= 0 ? this.currentTime >= u : this.currentTime <= 0);
|
|
2675
2675
|
const $ = this.holdTime === null && (this.state === "finished" || this.state === "running" && L);
|
|
2676
|
-
return $ && s !== void 0 && (A.value = Ge(
|
|
2676
|
+
return $ && s !== void 0 && (A.value = Ge(l, this.options, s)), T && T(A.value), $ && this.finish(), A;
|
|
2677
2677
|
}
|
|
2678
2678
|
get duration() {
|
|
2679
2679
|
const { resolved: e } = this;
|
|
2680
|
-
return e ?
|
|
2680
|
+
return e ? ht(e.calculatedDuration) : 0;
|
|
2681
2681
|
}
|
|
2682
2682
|
get time() {
|
|
2683
|
-
return
|
|
2683
|
+
return ht(this.currentTime);
|
|
2684
2684
|
}
|
|
2685
2685
|
set time(e) {
|
|
2686
|
-
e =
|
|
2686
|
+
e = ft(e), this.currentTime = e, this.holdTime !== null || this.speed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.speed);
|
|
2687
2687
|
}
|
|
2688
2688
|
get speed() {
|
|
2689
2689
|
return this.playbackSpeed;
|
|
2690
2690
|
}
|
|
2691
2691
|
set speed(e) {
|
|
2692
2692
|
const n = this.playbackSpeed !== e;
|
|
2693
|
-
this.playbackSpeed = e, n && (this.time =
|
|
2693
|
+
this.playbackSpeed = e, n && (this.time = ht(this.currentTime));
|
|
2694
2694
|
}
|
|
2695
2695
|
play() {
|
|
2696
2696
|
if (this.resolver.isScheduled || this.resolver.resume(), !this._resolved) {
|
|
@@ -2755,10 +2755,10 @@ function ro(t) {
|
|
|
2755
2755
|
if (t)
|
|
2756
2756
|
return io(t) ? Qt(t) : Array.isArray(t) ? t.map(Kc) : ai[t];
|
|
2757
2757
|
}
|
|
2758
|
-
function Gc(t, e, n, { delay: i = 0, duration: s = 300, repeat: o = 0, repeatType: r = "loop", ease:
|
|
2758
|
+
function Gc(t, e, n, { delay: i = 0, duration: s = 300, repeat: o = 0, repeatType: r = "loop", ease: a, times: l } = {}) {
|
|
2759
2759
|
const c = { [e]: n };
|
|
2760
|
-
|
|
2761
|
-
const u = ro(
|
|
2760
|
+
l && (c.offset = l);
|
|
2761
|
+
const u = ro(a);
|
|
2762
2762
|
return Array.isArray(u) && (c.easing = u), t.animate(c, {
|
|
2763
2763
|
delay: i,
|
|
2764
2764
|
duration: s,
|
|
@@ -2800,22 +2800,22 @@ class ss extends Gr {
|
|
|
2800
2800
|
}
|
|
2801
2801
|
initPlayback(e, n) {
|
|
2802
2802
|
var i;
|
|
2803
|
-
let { duration: s = 300, times: o, ease: r, type:
|
|
2804
|
-
if (!(!((i =
|
|
2803
|
+
let { duration: s = 300, times: o, ease: r, type: a, motionValue: l, name: c } = this.options;
|
|
2804
|
+
if (!(!((i = l.owner) === null || i === void 0) && i.current))
|
|
2805
2805
|
return !1;
|
|
2806
2806
|
if (Yc(this.options)) {
|
|
2807
2807
|
const { onComplete: f, onUpdate: d, motionValue: p, ...g } = this.options, v = Xc(e, g);
|
|
2808
|
-
e = v.keyframes, e.length === 1 && (e[1] = e[0]), s = v.duration, o = v.times, r = v.ease,
|
|
2808
|
+
e = v.keyframes, e.length === 1 && (e[1] = e[0]), s = v.duration, o = v.times, r = v.ease, a = "keyframes";
|
|
2809
2809
|
}
|
|
2810
|
-
const u = Gc(
|
|
2811
|
-
return u.startTime =
|
|
2810
|
+
const u = Gc(l.owner.current, c, e, { ...this.options, duration: s, times: o, ease: r });
|
|
2811
|
+
return u.startTime = Pt.now(), this.pendingTimeline ? (u.timeline = this.pendingTimeline, this.pendingTimeline = void 0) : u.onfinish = () => {
|
|
2812
2812
|
const { onComplete: f } = this.options;
|
|
2813
|
-
|
|
2813
|
+
l.set(Ge(e, this.options, n)), f && f(), this.cancel(), this.resolveFinishedPromise();
|
|
2814
2814
|
}, {
|
|
2815
2815
|
animation: u,
|
|
2816
2816
|
duration: s,
|
|
2817
2817
|
times: o,
|
|
2818
|
-
type:
|
|
2818
|
+
type: a,
|
|
2819
2819
|
ease: r,
|
|
2820
2820
|
keyframes: e
|
|
2821
2821
|
};
|
|
@@ -2825,21 +2825,21 @@ class ss extends Gr {
|
|
|
2825
2825
|
if (!e)
|
|
2826
2826
|
return 0;
|
|
2827
2827
|
const { duration: n } = e;
|
|
2828
|
-
return
|
|
2828
|
+
return ht(n);
|
|
2829
2829
|
}
|
|
2830
2830
|
get time() {
|
|
2831
2831
|
const { resolved: e } = this;
|
|
2832
2832
|
if (!e)
|
|
2833
2833
|
return 0;
|
|
2834
2834
|
const { animation: n } = e;
|
|
2835
|
-
return
|
|
2835
|
+
return ht(n.currentTime || 0);
|
|
2836
2836
|
}
|
|
2837
2837
|
set time(e) {
|
|
2838
2838
|
const { resolved: n } = this;
|
|
2839
2839
|
if (!n)
|
|
2840
2840
|
return;
|
|
2841
2841
|
const { animation: i } = n;
|
|
2842
|
-
i.currentTime =
|
|
2842
|
+
i.currentTime = ft(e);
|
|
2843
2843
|
}
|
|
2844
2844
|
get speed() {
|
|
2845
2845
|
const { resolved: e } = this;
|
|
@@ -2901,7 +2901,7 @@ class ss extends Gr {
|
|
|
2901
2901
|
const { resolved: e } = this;
|
|
2902
2902
|
if (!e)
|
|
2903
2903
|
return;
|
|
2904
|
-
const { animation: n, keyframes: i, duration: s, type: o, ease: r, times:
|
|
2904
|
+
const { animation: n, keyframes: i, duration: s, type: o, ease: r, times: a } = e;
|
|
2905
2905
|
if (n.playState === "idle" || n.playState === "finished")
|
|
2906
2906
|
return;
|
|
2907
2907
|
if (this.time) {
|
|
@@ -2911,13 +2911,13 @@ class ss extends Gr {
|
|
|
2911
2911
|
duration: s,
|
|
2912
2912
|
type: o,
|
|
2913
2913
|
ease: r,
|
|
2914
|
-
times:
|
|
2914
|
+
times: a,
|
|
2915
2915
|
isGenerator: !0
|
|
2916
|
-
}), g =
|
|
2916
|
+
}), g = ft(this.time);
|
|
2917
2917
|
c.setWithVelocity(p.sample(g - je).value, p.sample(g).value, je);
|
|
2918
2918
|
}
|
|
2919
|
-
const { onStop:
|
|
2920
|
-
|
|
2919
|
+
const { onStop: l } = this.options;
|
|
2920
|
+
l && l(), this.cancel();
|
|
2921
2921
|
}
|
|
2922
2922
|
complete() {
|
|
2923
2923
|
const { resolved: e } = this;
|
|
@@ -2928,12 +2928,12 @@ class ss extends Gr {
|
|
|
2928
2928
|
e && e.animation.cancel();
|
|
2929
2929
|
}
|
|
2930
2930
|
static supports(e) {
|
|
2931
|
-
const { motionValue: n, name: i, repeatDelay: s, repeatType: o, damping: r, type:
|
|
2931
|
+
const { motionValue: n, name: i, repeatDelay: s, repeatType: o, damping: r, type: a } = e;
|
|
2932
2932
|
return Hc() && i && br.has(i) && n && n.owner && n.owner.current instanceof HTMLElement && /**
|
|
2933
2933
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
2934
2934
|
* no way to read the value from WAAPI every frame.
|
|
2935
2935
|
*/
|
|
2936
|
-
!n.owner.getProps().onUpdate && !s && o !== "mirror" && r !== 0 &&
|
|
2936
|
+
!n.owner.getProps().onUpdate && !s && o !== "mirror" && r !== 0 && a !== "inertia";
|
|
2937
2937
|
}
|
|
2938
2938
|
}
|
|
2939
2939
|
function qc(t, e) {
|
|
@@ -2942,7 +2942,7 @@ function qc(t, e) {
|
|
|
2942
2942
|
const { currentTime: s } = e, r = (s === null ? 0 : s.value) / 100;
|
|
2943
2943
|
n !== r && t(r), n = r;
|
|
2944
2944
|
};
|
|
2945
|
-
return k.update(i, !0), () =>
|
|
2945
|
+
return k.update(i, !0), () => pt(i);
|
|
2946
2946
|
}
|
|
2947
2947
|
const Zc = Kr(() => window.ScrollTimeline !== void 0);
|
|
2948
2948
|
class Jc {
|
|
@@ -3011,34 +3011,34 @@ class Jc {
|
|
|
3011
3011
|
this.runAll("complete");
|
|
3012
3012
|
}
|
|
3013
3013
|
}
|
|
3014
|
-
const li = (t, e, n, i = {}, s, o, r) => (
|
|
3015
|
-
const
|
|
3014
|
+
const li = (t, e, n, i = {}, s, o, r) => (a) => {
|
|
3015
|
+
const l = Qn(i, t) || {}, c = l.delay || i.delay || 0;
|
|
3016
3016
|
let { elapsed: u = 0 } = i;
|
|
3017
|
-
u = u -
|
|
3017
|
+
u = u - ft(c);
|
|
3018
3018
|
let f = {
|
|
3019
3019
|
keyframes: Array.isArray(n) ? n : [null, n],
|
|
3020
3020
|
ease: "easeOut",
|
|
3021
3021
|
velocity: e.getVelocity(),
|
|
3022
|
-
...
|
|
3022
|
+
...l,
|
|
3023
3023
|
delay: -u,
|
|
3024
3024
|
onUpdate: (p) => {
|
|
3025
|
-
e.set(p),
|
|
3025
|
+
e.set(p), l.onUpdate && l.onUpdate(p);
|
|
3026
3026
|
},
|
|
3027
3027
|
onComplete: () => {
|
|
3028
|
-
|
|
3028
|
+
a(), l.onComplete && l.onComplete(), r && r();
|
|
3029
3029
|
},
|
|
3030
3030
|
onStop: r,
|
|
3031
3031
|
name: t,
|
|
3032
3032
|
motionValue: e,
|
|
3033
3033
|
element: o ? void 0 : s
|
|
3034
3034
|
};
|
|
3035
|
-
kl(
|
|
3035
|
+
kl(l) || (f = {
|
|
3036
3036
|
...f,
|
|
3037
3037
|
...Ml(t, f)
|
|
3038
|
-
}), f.duration && (f.duration =
|
|
3038
|
+
}), f.duration && (f.duration = ft(f.duration)), f.repeatDelay && (f.repeatDelay = ft(f.repeatDelay)), f.from !== void 0 && (f.keyframes[0] = f.from);
|
|
3039
3039
|
let d = !1;
|
|
3040
3040
|
if ((f.type === !1 || f.duration === 0 && !f.repeatDelay) && (f.duration = 0, f.delay === 0 && (d = !0)), d && !o && e.get() !== void 0) {
|
|
3041
|
-
const p = Ge(f.keyframes,
|
|
3041
|
+
const p = Ge(f.keyframes, l);
|
|
3042
3042
|
if (p !== void 0)
|
|
3043
3043
|
return k.update(() => {
|
|
3044
3044
|
f.onUpdate(p), f.onComplete();
|
|
@@ -3087,12 +3087,12 @@ class oo {
|
|
|
3087
3087
|
*/
|
|
3088
3088
|
constructor(e, n = {}) {
|
|
3089
3089
|
this.version = "11.3.21", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (i, s = !0) => {
|
|
3090
|
-
const o =
|
|
3090
|
+
const o = Pt.now();
|
|
3091
3091
|
this.updatedAt !== o && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(i), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), s && this.events.renderRequest && this.events.renderRequest.notify(this.current);
|
|
3092
3092
|
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
|
|
3093
3093
|
}
|
|
3094
3094
|
setCurrent(e) {
|
|
3095
|
-
this.current = e, this.updatedAt =
|
|
3095
|
+
this.current = e, this.updatedAt = Pt.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = Qc(this.current));
|
|
3096
3096
|
}
|
|
3097
3097
|
setPrevFrameValue(e = this.current) {
|
|
3098
3098
|
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -3213,7 +3213,7 @@ class oo {
|
|
|
3213
3213
|
* @public
|
|
3214
3214
|
*/
|
|
3215
3215
|
getVelocity() {
|
|
3216
|
-
const e =
|
|
3216
|
+
const e = Pt.now();
|
|
3217
3217
|
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > os)
|
|
3218
3218
|
return 0;
|
|
3219
3219
|
const n = Math.min(this.updatedAt - this.prevUpdatedAt, os);
|
|
@@ -3281,8 +3281,8 @@ function eu(t, e) {
|
|
|
3281
3281
|
let { transitionEnd: i = {}, transition: s = {}, ...o } = n || {};
|
|
3282
3282
|
o = { ...o, ...i };
|
|
3283
3283
|
for (const r in o) {
|
|
3284
|
-
const
|
|
3285
|
-
tu(t, r,
|
|
3284
|
+
const a = al(o[r]);
|
|
3285
|
+
tu(t, r, a);
|
|
3286
3286
|
}
|
|
3287
3287
|
}
|
|
3288
3288
|
function ao(t) {
|
|
@@ -3328,11 +3328,11 @@ function su({ protectedKeys: t, needsAnimating: e }, n) {
|
|
|
3328
3328
|
}
|
|
3329
3329
|
function lo(t, e, { delay: n = 0, transitionOverride: i, type: s } = {}) {
|
|
3330
3330
|
var o;
|
|
3331
|
-
let { transition: r = t.getDefaultTransition(), transitionEnd:
|
|
3331
|
+
let { transition: r = t.getDefaultTransition(), transitionEnd: a, ...l } = e;
|
|
3332
3332
|
i && (r = i);
|
|
3333
3333
|
const c = [], u = s && t.animationState && t.animationState.getState()[s];
|
|
3334
|
-
for (const f in
|
|
3335
|
-
const d = t.getValue(f, (o = t.latestValues[f]) !== null && o !== void 0 ? o : null), p =
|
|
3334
|
+
for (const f in l) {
|
|
3335
|
+
const d = t.getValue(f, (o = t.latestValues[f]) !== null && o !== void 0 ? o : null), p = l[f];
|
|
3336
3336
|
if (p === void 0 || u && su(u, f))
|
|
3337
3337
|
continue;
|
|
3338
3338
|
const g = {
|
|
@@ -3352,9 +3352,9 @@ function lo(t, e, { delay: n = 0, transitionOverride: i, type: s } = {}) {
|
|
|
3352
3352
|
const T = d.animation;
|
|
3353
3353
|
T && c.push(T);
|
|
3354
3354
|
}
|
|
3355
|
-
return
|
|
3355
|
+
return a && Promise.all(c).then(() => {
|
|
3356
3356
|
k.update(() => {
|
|
3357
|
-
|
|
3357
|
+
a && eu(t, a);
|
|
3358
3358
|
});
|
|
3359
3359
|
}), c;
|
|
3360
3360
|
}
|
|
@@ -3363,22 +3363,22 @@ function Rn(t, e, n = {}) {
|
|
|
3363
3363
|
const s = Ke(t, e, n.type === "exit" ? (i = t.presenceContext) === null || i === void 0 ? void 0 : i.custom : void 0);
|
|
3364
3364
|
let { transition: o = t.getDefaultTransition() || {} } = s || {};
|
|
3365
3365
|
n.transitionOverride && (o = n.transitionOverride);
|
|
3366
|
-
const r = s ? () => Promise.all(lo(t, s, n)) : () => Promise.resolve(),
|
|
3366
|
+
const r = s ? () => Promise.all(lo(t, s, n)) : () => Promise.resolve(), a = t.variantChildren && t.variantChildren.size ? (c = 0) => {
|
|
3367
3367
|
const { delayChildren: u = 0, staggerChildren: f, staggerDirection: d } = o;
|
|
3368
3368
|
return ru(t, e, u + c, f, d, n);
|
|
3369
|
-
} : () => Promise.resolve(), { when:
|
|
3370
|
-
if (
|
|
3371
|
-
const [c, u] =
|
|
3369
|
+
} : () => Promise.resolve(), { when: l } = o;
|
|
3370
|
+
if (l) {
|
|
3371
|
+
const [c, u] = l === "beforeChildren" ? [r, a] : [a, r];
|
|
3372
3372
|
return c().then(() => u());
|
|
3373
3373
|
} else
|
|
3374
|
-
return Promise.all([r(),
|
|
3374
|
+
return Promise.all([r(), a(n.delay)]);
|
|
3375
3375
|
}
|
|
3376
3376
|
function ru(t, e, n = 0, i = 0, s = 1, o) {
|
|
3377
|
-
const r = [],
|
|
3377
|
+
const r = [], a = (t.variantChildren.size - 1) * i, l = s === 1 ? (c = 0) => c * i : (c = 0) => a - c * i;
|
|
3378
3378
|
return Array.from(t.variantChildren).sort(ou).forEach((c, u) => {
|
|
3379
3379
|
c.notify("AnimationStart", e), r.push(Rn(c, e, {
|
|
3380
3380
|
...o,
|
|
3381
|
-
delay: n +
|
|
3381
|
+
delay: n + l(u)
|
|
3382
3382
|
}).then(() => c.notify("AnimationComplete", e)));
|
|
3383
3383
|
}), Promise.all(r);
|
|
3384
3384
|
}
|
|
@@ -3407,23 +3407,23 @@ function uu(t) {
|
|
|
3407
3407
|
}
|
|
3408
3408
|
function fu(t) {
|
|
3409
3409
|
let e = uu(t), n = as(), i = !0;
|
|
3410
|
-
const s = (
|
|
3410
|
+
const s = (l) => (c, u) => {
|
|
3411
3411
|
var f;
|
|
3412
|
-
const d = Ke(t, u,
|
|
3412
|
+
const d = Ke(t, u, l === "exit" ? (f = t.presenceContext) === null || f === void 0 ? void 0 : f.custom : void 0);
|
|
3413
3413
|
if (d) {
|
|
3414
3414
|
const { transition: p, transitionEnd: g, ...v } = d;
|
|
3415
3415
|
c = { ...c, ...v, ...g };
|
|
3416
3416
|
}
|
|
3417
3417
|
return c;
|
|
3418
3418
|
};
|
|
3419
|
-
function o(
|
|
3420
|
-
e =
|
|
3419
|
+
function o(l) {
|
|
3420
|
+
e = l(t);
|
|
3421
3421
|
}
|
|
3422
|
-
function r(
|
|
3422
|
+
function r(l) {
|
|
3423
3423
|
const c = t.getProps(), u = t.getVariantContext(!0) || {}, f = [], d = /* @__PURE__ */ new Set();
|
|
3424
3424
|
let p = {}, g = 1 / 0;
|
|
3425
3425
|
for (let T = 0; T < cu; T++) {
|
|
3426
|
-
const P = lu[T], y = n[P], x = c[P] !== void 0 ? c[P] : u[P], w = oe(x), A = P ===
|
|
3426
|
+
const P = lu[T], y = n[P], x = c[P] !== void 0 ? c[P] : u[P], w = oe(x), A = P === l ? y.isActive : null;
|
|
3427
3427
|
A === !1 && (g = T);
|
|
3428
3428
|
let L = x === u[P] && x !== c[P] && w;
|
|
3429
3429
|
if (L && i && t.manuallyAnimateOnMount && (L = !1), y.protectedKeys = { ...p }, // If it isn't active and hasn't *just* been set as inactive
|
|
@@ -3432,7 +3432,7 @@ function fu(t) {
|
|
|
3432
3432
|
ae(x) || typeof x == "boolean")
|
|
3433
3433
|
continue;
|
|
3434
3434
|
let R = hu(y.prevProp, x) || // If we're making this variant active, we want to always make it active
|
|
3435
|
-
P ===
|
|
3435
|
+
P === l && y.isActive && !L && w || // If we removed a higher-priority variant (i is in reverse order)
|
|
3436
3436
|
T > g && w, _ = !1;
|
|
3437
3437
|
const U = Array.isArray(x) ? x : [x];
|
|
3438
3438
|
let M = U.reduce(s(P), {});
|
|
@@ -3467,22 +3467,22 @@ function fu(t) {
|
|
|
3467
3467
|
let v = !!f.length;
|
|
3468
3468
|
return i && (c.initial === !1 || c.initial === c.animate) && !t.manuallyAnimateOnMount && (v = !1), i = !1, v ? e(f) : Promise.resolve();
|
|
3469
3469
|
}
|
|
3470
|
-
function l
|
|
3470
|
+
function a(l, c) {
|
|
3471
3471
|
var u;
|
|
3472
|
-
if (n[
|
|
3472
|
+
if (n[l].isActive === c)
|
|
3473
3473
|
return Promise.resolve();
|
|
3474
3474
|
(u = t.variantChildren) === null || u === void 0 || u.forEach((d) => {
|
|
3475
3475
|
var p;
|
|
3476
|
-
return (p = d.animationState) === null || p === void 0 ? void 0 : p.setActive(
|
|
3477
|
-
}), n[
|
|
3478
|
-
const f = r(
|
|
3476
|
+
return (p = d.animationState) === null || p === void 0 ? void 0 : p.setActive(l, c);
|
|
3477
|
+
}), n[l].isActive = c;
|
|
3478
|
+
const f = r(l);
|
|
3479
3479
|
for (const d in n)
|
|
3480
3480
|
n[d].protectedKeys = {};
|
|
3481
3481
|
return f;
|
|
3482
3482
|
}
|
|
3483
3483
|
return {
|
|
3484
3484
|
animateChanges: r,
|
|
3485
|
-
setActive:
|
|
3485
|
+
setActive: a,
|
|
3486
3486
|
setAnimateFunction: o,
|
|
3487
3487
|
getState: () => n,
|
|
3488
3488
|
reset: () => {
|
|
@@ -3597,16 +3597,16 @@ class co {
|
|
|
3597
3597
|
}, !Sr(e))
|
|
3598
3598
|
return;
|
|
3599
3599
|
this.dragSnapToOrigin = o, this.handlers = n, this.transformPagePoint = i, this.contextWindow = s || window;
|
|
3600
|
-
const r = $e(e),
|
|
3601
|
-
this.history = [{ ...
|
|
3600
|
+
const r = $e(e), a = cn(r, this.transformPagePoint), { point: l } = a, { timestamp: c } = K;
|
|
3601
|
+
this.history = [{ ...l, timestamp: c }];
|
|
3602
3602
|
const { onSessionStart: u } = n;
|
|
3603
|
-
u && u(e, un(
|
|
3603
|
+
u && u(e, un(a, this.history)), this.removeListeners = ut(ct(this.contextWindow, "pointermove", this.handlePointerMove), ct(this.contextWindow, "pointerup", this.handlePointerUp), ct(this.contextWindow, "pointercancel", this.handlePointerUp));
|
|
3604
3604
|
}
|
|
3605
3605
|
updateHandlers(e) {
|
|
3606
3606
|
this.handlers = e;
|
|
3607
3607
|
}
|
|
3608
3608
|
end() {
|
|
3609
|
-
this.removeListeners && this.removeListeners(),
|
|
3609
|
+
this.removeListeners && this.removeListeners(), pt(this.updatePoint);
|
|
3610
3610
|
}
|
|
3611
3611
|
}
|
|
3612
3612
|
function cn(t, e) {
|
|
@@ -3634,11 +3634,11 @@ function Pu(t, e) {
|
|
|
3634
3634
|
return { x: 0, y: 0 };
|
|
3635
3635
|
let n = t.length - 1, i = null;
|
|
3636
3636
|
const s = uo(t);
|
|
3637
|
-
for (; n >= 0 && (i = t[n], !(s.timestamp - i.timestamp >
|
|
3637
|
+
for (; n >= 0 && (i = t[n], !(s.timestamp - i.timestamp > ft(e))); )
|
|
3638
3638
|
n--;
|
|
3639
3639
|
if (!i)
|
|
3640
3640
|
return { x: 0, y: 0 };
|
|
3641
|
-
const o =
|
|
3641
|
+
const o = ht(s.timestamp - i.timestamp);
|
|
3642
3642
|
if (o === 0)
|
|
3643
3643
|
return { x: 0, y: 0 };
|
|
3644
3644
|
const r = {
|
|
@@ -3792,10 +3792,10 @@ function Ou(t, e, n, i = !1) {
|
|
|
3792
3792
|
return;
|
|
3793
3793
|
e.x = e.y = 1;
|
|
3794
3794
|
let o, r;
|
|
3795
|
-
for (let
|
|
3796
|
-
o = n[
|
|
3797
|
-
const { visualElement:
|
|
3798
|
-
|
|
3795
|
+
for (let a = 0; a < s; a++) {
|
|
3796
|
+
o = n[a], r = o.projectionDelta;
|
|
3797
|
+
const { visualElement: l } = o.options;
|
|
3798
|
+
l && l.props.style && l.props.style.display === "contents" || (i && o.options.layoutScroll && o.scroll && o !== o.root && Wt(t, {
|
|
3799
3799
|
x: -o.scroll.offset.x,
|
|
3800
3800
|
y: -o.scroll.offset.y
|
|
3801
3801
|
}), r && (e.x *= r.x.scale, e.y *= r.y.scale, go(t, r)), i && At(o.latestValues) && Wt(t, o.latestValues));
|
|
@@ -3859,7 +3859,7 @@ class _u {
|
|
|
3859
3859
|
return;
|
|
3860
3860
|
}
|
|
3861
3861
|
this.updateAxis("x", f.point, T), this.updateAxis("y", f.point, T), this.visualElement.render(), v && v(u, f);
|
|
3862
|
-
},
|
|
3862
|
+
}, a = (u, f) => this.stop(u, f), l = () => nt((u) => {
|
|
3863
3863
|
var f;
|
|
3864
3864
|
return this.getAnimationState(u) === "paused" && ((f = this.getAxisMotionValue(u).animation) === null || f === void 0 ? void 0 : f.play());
|
|
3865
3865
|
}), { dragSnapToOrigin: c } = this.getProps();
|
|
@@ -3867,8 +3867,8 @@ class _u {
|
|
|
3867
3867
|
onSessionStart: s,
|
|
3868
3868
|
onStart: o,
|
|
3869
3869
|
onMove: r,
|
|
3870
|
-
onSessionEnd:
|
|
3871
|
-
resumeAnimation:
|
|
3870
|
+
onSessionEnd: a,
|
|
3871
|
+
resumeAnimation: l
|
|
3872
3872
|
}, {
|
|
3873
3873
|
transformPagePoint: this.visualElement.getTransformPagePoint(),
|
|
3874
3874
|
dragSnapToOrigin: c,
|
|
@@ -3913,23 +3913,23 @@ class _u {
|
|
|
3913
3913
|
if (!e || !Bt(e))
|
|
3914
3914
|
return !1;
|
|
3915
3915
|
const i = e.current;
|
|
3916
|
-
|
|
3916
|
+
dt(i !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
|
|
3917
3917
|
const { projection: s } = this.visualElement;
|
|
3918
3918
|
if (!s || !s.layout)
|
|
3919
3919
|
return !1;
|
|
3920
3920
|
const o = ju(i, s.root, this.visualElement.getTransformPagePoint());
|
|
3921
3921
|
let r = Vu(s.layout.layoutBox, o);
|
|
3922
3922
|
if (n) {
|
|
3923
|
-
const
|
|
3924
|
-
this.hasMutatedConstraints = !!
|
|
3923
|
+
const a = n(ku(r));
|
|
3924
|
+
this.hasMutatedConstraints = !!a, a && (r = po(a));
|
|
3925
3925
|
}
|
|
3926
3926
|
return r;
|
|
3927
3927
|
}
|
|
3928
3928
|
startAnimation(e) {
|
|
3929
|
-
const { drag: n, dragMomentum: i, dragElastic: s, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd:
|
|
3929
|
+
const { drag: n, dragMomentum: i, dragElastic: s, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, c = nt((u) => {
|
|
3930
3930
|
if (!Se(u, n, this.currentDirection))
|
|
3931
3931
|
return;
|
|
3932
|
-
let f =
|
|
3932
|
+
let f = l && l[u] || {};
|
|
3933
3933
|
r && (f = { min: 0, max: 0 });
|
|
3934
3934
|
const d = s ? 200 : 1e6, p = s ? 40 : 1e7, g = {
|
|
3935
3935
|
type: "inertia",
|
|
@@ -3944,7 +3944,7 @@ class _u {
|
|
|
3944
3944
|
};
|
|
3945
3945
|
return this.startAxisValueAnimation(u, g);
|
|
3946
3946
|
});
|
|
3947
|
-
return Promise.all(c).then(
|
|
3947
|
+
return Promise.all(c).then(a);
|
|
3948
3948
|
}
|
|
3949
3949
|
startAxisValueAnimation(e, n) {
|
|
3950
3950
|
const i = this.getAxisMotionValue(e);
|
|
@@ -3980,8 +3980,8 @@ class _u {
|
|
|
3980
3980
|
return;
|
|
3981
3981
|
const { projection: s } = this.visualElement, o = this.getAxisMotionValue(n);
|
|
3982
3982
|
if (s && s.layout) {
|
|
3983
|
-
const { min: r, max:
|
|
3984
|
-
o.set(e[n] - F(r,
|
|
3983
|
+
const { min: r, max: a } = s.layout.layoutBox[n];
|
|
3984
|
+
o.set(e[n] - F(r, a, 0.5));
|
|
3985
3985
|
}
|
|
3986
3986
|
});
|
|
3987
3987
|
}
|
|
@@ -3999,44 +3999,44 @@ class _u {
|
|
|
3999
3999
|
this.stopAnimation();
|
|
4000
4000
|
const s = { x: 0, y: 0 };
|
|
4001
4001
|
nt((r) => {
|
|
4002
|
-
const
|
|
4003
|
-
if (
|
|
4004
|
-
const
|
|
4005
|
-
s[r] = Eu({ min:
|
|
4002
|
+
const a = this.getAxisMotionValue(r);
|
|
4003
|
+
if (a && this.constraints !== !1) {
|
|
4004
|
+
const l = a.get();
|
|
4005
|
+
s[r] = Eu({ min: l, max: l }, this.constraints[r]);
|
|
4006
4006
|
}
|
|
4007
4007
|
});
|
|
4008
4008
|
const { transformTemplate: o } = this.visualElement.getProps();
|
|
4009
4009
|
this.visualElement.current.style.transform = o ? o({}, "") : "none", i.root && i.root.updateScroll(), i.updateLayout(), this.resolveConstraints(), nt((r) => {
|
|
4010
4010
|
if (!Se(r, e, null))
|
|
4011
4011
|
return;
|
|
4012
|
-
const
|
|
4013
|
-
|
|
4012
|
+
const a = this.getAxisMotionValue(r), { min: l, max: c } = this.constraints[r];
|
|
4013
|
+
a.set(F(l, c, s[r]));
|
|
4014
4014
|
});
|
|
4015
4015
|
}
|
|
4016
4016
|
addListeners() {
|
|
4017
4017
|
if (!this.visualElement.current)
|
|
4018
4018
|
return;
|
|
4019
4019
|
Fu.set(this.visualElement, this);
|
|
4020
|
-
const e = this.visualElement.current, n =
|
|
4020
|
+
const e = this.visualElement.current, n = ct(e, "pointerdown", (l) => {
|
|
4021
4021
|
const { drag: c, dragListener: u = !0 } = this.getProps();
|
|
4022
|
-
c && u && this.start(
|
|
4022
|
+
c && u && this.start(l);
|
|
4023
4023
|
}), i = () => {
|
|
4024
|
-
const { dragConstraints:
|
|
4025
|
-
Bt(
|
|
4024
|
+
const { dragConstraints: l } = this.getProps();
|
|
4025
|
+
Bt(l) && l.current && (this.constraints = this.resolveRefConstraints());
|
|
4026
4026
|
}, { projection: s } = this.visualElement, o = s.addEventListener("measure", i);
|
|
4027
4027
|
s && !s.layout && (s.root && s.root.updateScroll(), s.updateLayout()), k.read(i);
|
|
4028
|
-
const r = at(window, "resize", () => this.scalePositionWithinConstraints()),
|
|
4028
|
+
const r = at(window, "resize", () => this.scalePositionWithinConstraints()), a = s.addEventListener("didUpdate", ({ delta: l, hasLayoutChanged: c }) => {
|
|
4029
4029
|
this.isDragging && c && (nt((u) => {
|
|
4030
4030
|
const f = this.getAxisMotionValue(u);
|
|
4031
|
-
f && (this.originPoint[u] +=
|
|
4031
|
+
f && (this.originPoint[u] += l[u].translate, f.set(f.get() + l[u].translate));
|
|
4032
4032
|
}), this.visualElement.render());
|
|
4033
4033
|
});
|
|
4034
4034
|
return () => {
|
|
4035
|
-
r(), n(), o(),
|
|
4035
|
+
r(), n(), o(), a && a();
|
|
4036
4036
|
};
|
|
4037
4037
|
}
|
|
4038
4038
|
getProps() {
|
|
4039
|
-
const e = this.visualElement.getProps(), { drag: n = !1, dragDirectionLock: i = !1, dragPropagation: s = !1, dragConstraints: o = !1, dragElastic: r = Vn, dragMomentum:
|
|
4039
|
+
const e = this.visualElement.getProps(), { drag: n = !1, dragDirectionLock: i = !1, dragPropagation: s = !1, dragConstraints: o = !1, dragElastic: r = Vn, dragMomentum: a = !0 } = e;
|
|
4040
4040
|
return {
|
|
4041
4041
|
...e,
|
|
4042
4042
|
drag: n,
|
|
@@ -4044,7 +4044,7 @@ class _u {
|
|
|
4044
4044
|
dragPropagation: s,
|
|
4045
4045
|
dragConstraints: o,
|
|
4046
4046
|
dragElastic: r,
|
|
4047
|
-
dragMomentum:
|
|
4047
|
+
dragMomentum: a
|
|
4048
4048
|
};
|
|
4049
4049
|
}
|
|
4050
4050
|
}
|
|
@@ -4092,7 +4092,7 @@ class Nu extends wt {
|
|
|
4092
4092
|
};
|
|
4093
4093
|
}
|
|
4094
4094
|
mount() {
|
|
4095
|
-
this.removePointerDownListener =
|
|
4095
|
+
this.removePointerDownListener = ct(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
|
|
4096
4096
|
}
|
|
4097
4097
|
update() {
|
|
4098
4098
|
this.session && this.session.updateHandlers(this.createPanHandlers());
|
|
@@ -4106,8 +4106,8 @@ function Uu() {
|
|
|
4106
4106
|
if (t === null)
|
|
4107
4107
|
return [!0, null];
|
|
4108
4108
|
const { isPresent: e, onExitComplete: n, register: i } = t, s = On();
|
|
4109
|
-
|
|
4110
|
-
const o =
|
|
4109
|
+
lt(() => i(s), []);
|
|
4110
|
+
const o = vt(() => n && n(s), [s, n]);
|
|
4111
4111
|
return !e && n ? [!1, o] : [!0];
|
|
4112
4112
|
}
|
|
4113
4113
|
const Ve = {
|
|
@@ -4142,9 +4142,9 @@ const Jt = {
|
|
|
4142
4142
|
const i = t, s = bt.parse(t);
|
|
4143
4143
|
if (s.length > 5)
|
|
4144
4144
|
return i;
|
|
4145
|
-
const o = bt.createTransformer(t), r = typeof s[0] != "number" ? 1 : 0,
|
|
4146
|
-
s[0 + r] /=
|
|
4147
|
-
const c = F(
|
|
4145
|
+
const o = bt.createTransformer(t), r = typeof s[0] != "number" ? 1 : 0, a = n.x.scale * e.x, l = n.y.scale * e.y;
|
|
4146
|
+
s[0 + r] /= a, s[1 + r] /= l;
|
|
4147
|
+
const c = F(a, l, 0.5);
|
|
4148
4148
|
return typeof s[2 + r] == "number" && (s[2 + r] /= c), typeof s[3 + r] == "number" && (s[3 + r] /= c), o(s);
|
|
4149
4149
|
}
|
|
4150
4150
|
};
|
|
@@ -4166,8 +4166,8 @@ class $u extends ra {
|
|
|
4166
4166
|
getSnapshotBeforeUpdate(e) {
|
|
4167
4167
|
const { layoutDependency: n, visualElement: i, drag: s, isPresent: o } = this.props, r = i.projection;
|
|
4168
4168
|
return r && (r.isPresent = o, s || e.layoutDependency !== n || n === void 0 ? r.willUpdate() : this.safeToRemove(), e.isPresent !== o && (o ? r.promote() : r.relegate() || k.postRender(() => {
|
|
4169
|
-
const
|
|
4170
|
-
(!
|
|
4169
|
+
const a = r.getStack();
|
|
4170
|
+
(!a || !a.members.length) && this.safeToRemove();
|
|
4171
4171
|
}))), null;
|
|
4172
4172
|
}
|
|
4173
4173
|
componentDidUpdate() {
|
|
@@ -4216,11 +4216,11 @@ function Hu(t, e, n, i, s, o) {
|
|
|
4216
4216
|
zu(i)
|
|
4217
4217
|
), t.opacityExit = F(e.opacity !== void 0 ? e.opacity : 1, 0, Yu(i))) : o && (t.opacity = F(e.opacity !== void 0 ? e.opacity : 1, n.opacity !== void 0 ? n.opacity : 1, i));
|
|
4218
4218
|
for (let r = 0; r < Gu; r++) {
|
|
4219
|
-
const
|
|
4220
|
-
let
|
|
4221
|
-
if (
|
|
4219
|
+
const a = `border${xo[r]}Radius`;
|
|
4220
|
+
let l = Vs(e, a), c = Vs(n, a);
|
|
4221
|
+
if (l === void 0 && c === void 0)
|
|
4222
4222
|
continue;
|
|
4223
|
-
|
|
4223
|
+
l || (l = 0), c || (c = 0), l === 0 || c === 0 || Rs(l) === Rs(c) ? (t[a] = Math.max(F(As(l), As(c), i), 0), (ot.test(c) || ot.test(l)) && (t[a] += "%")) : t[a] = c;
|
|
4224
4224
|
}
|
|
4225
4225
|
(e.rotate || n.rotate) && (t.rotate = F(e.rotate || 0, n.rotate || 0, i));
|
|
4226
4226
|
}
|
|
@@ -4246,8 +4246,8 @@ function Ms(t, e, n, i, s) {
|
|
|
4246
4246
|
function Xu(t, e = 0, n = 1, i = 0.5, s, o = t, r = t) {
|
|
4247
4247
|
if (ot.test(e) && (e = parseFloat(e), e = F(r.min, r.max, e / 100) - r.min), typeof e != "number")
|
|
4248
4248
|
return;
|
|
4249
|
-
let
|
|
4250
|
-
t === o && (
|
|
4249
|
+
let a = F(o.min, o.max, i);
|
|
4250
|
+
t === o && (a -= e), t.min = Ms(t.min, e, n, a, s), t.max = Ms(t.max, e, n, a, s);
|
|
4251
4251
|
}
|
|
4252
4252
|
function ks(t, e, [n, i, s], o, r) {
|
|
4253
4253
|
Xu(t, e[n], e[i], e[s], e.scale, o, r);
|
|
@@ -4341,8 +4341,8 @@ function tf(t, e, n) {
|
|
|
4341
4341
|
const { transformPerspective: c, rotate: u, rotateX: f, rotateY: d, skewX: p, skewY: g } = n;
|
|
4342
4342
|
c && (i = `perspective(${c}px) ${i}`), u && (i += `rotate(${u}deg) `), f && (i += `rotateX(${f}deg) `), d && (i += `rotateY(${d}deg) `), p && (i += `skewX(${p}deg) `), g && (i += `skewY(${g}deg) `);
|
|
4343
4343
|
}
|
|
4344
|
-
const
|
|
4345
|
-
return (
|
|
4344
|
+
const a = t.x.scale * e.x, l = t.y.scale * e.y;
|
|
4345
|
+
return (a !== 1 || l !== 1) && (i += `scale(${a}, ${l})`), i || "none";
|
|
4346
4346
|
}
|
|
4347
4347
|
const ef = (t, e) => t.depth - e.depth;
|
|
4348
4348
|
class nf {
|
|
@@ -4360,11 +4360,11 @@ class nf {
|
|
|
4360
4360
|
}
|
|
4361
4361
|
}
|
|
4362
4362
|
function sf(t, e) {
|
|
4363
|
-
const n =
|
|
4363
|
+
const n = Pt.now(), i = ({ timestamp: s }) => {
|
|
4364
4364
|
const o = s - n;
|
|
4365
|
-
o >= e && (
|
|
4365
|
+
o >= e && (pt(i), t(o - e));
|
|
4366
4366
|
};
|
|
4367
|
-
return k.read(i, !0), () =>
|
|
4367
|
+
return k.read(i, !0), () => pt(i);
|
|
4368
4368
|
}
|
|
4369
4369
|
function rf(t) {
|
|
4370
4370
|
return t instanceof SVGElement && t.tagName !== "svg";
|
|
@@ -4392,22 +4392,22 @@ function So(t) {
|
|
|
4392
4392
|
}
|
|
4393
4393
|
function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, checkIsScrollRoot: i, resetTransform: s }) {
|
|
4394
4394
|
return class {
|
|
4395
|
-
constructor(r = {},
|
|
4395
|
+
constructor(r = {}, a = e == null ? void 0 : e()) {
|
|
4396
4396
|
this.id = lf++, this.animationId = 0, this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = !1, this.isAnimationBlocked = !1, this.isLayoutDirty = !1, this.isProjectionDirty = !1, this.isSharedProjectionDirty = !1, this.isTransformDirty = !1, this.updateManuallyBlocked = !1, this.updateBlockedByResize = !1, this.isUpdating = !1, this.isSVG = !1, this.needsReset = !1, this.shouldResetTransform = !1, this.hasCheckedOptimisedAppear = !1, this.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.updateScheduled = !1, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
|
|
4397
4397
|
this.isUpdating && (this.isUpdating = !1, this.clearAllSnapshots());
|
|
4398
4398
|
}, this.updateProjection = () => {
|
|
4399
4399
|
this.projectionUpdateScheduled = !1, te && (Rt.totalNodes = Rt.resolvedTargetDeltas = Rt.recalculatedProjection = 0), this.nodes.forEach(ff), this.nodes.forEach(gf), this.nodes.forEach(yf), this.nodes.forEach(hf), te && window.MotionDebug.record(Rt);
|
|
4400
|
-
}, this.resolvedRelativeTargetAt = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = r, this.root =
|
|
4401
|
-
for (let
|
|
4402
|
-
this.path[
|
|
4400
|
+
}, this.resolvedRelativeTargetAt = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = r, this.root = a ? a.root || a : this, this.path = a ? [...a.path, a] : [], this.parent = a, this.depth = a ? a.depth + 1 : 0;
|
|
4401
|
+
for (let l = 0; l < this.path.length; l++)
|
|
4402
|
+
this.path[l].shouldResetTransform = !0;
|
|
4403
4403
|
this.root === this && (this.nodes = new nf());
|
|
4404
4404
|
}
|
|
4405
|
-
addEventListener(r,
|
|
4406
|
-
return this.eventHandlers.has(r) || this.eventHandlers.set(r, new ci()), this.eventHandlers.get(r).add(
|
|
4405
|
+
addEventListener(r, a) {
|
|
4406
|
+
return this.eventHandlers.has(r) || this.eventHandlers.set(r, new ci()), this.eventHandlers.get(r).add(a);
|
|
4407
4407
|
}
|
|
4408
|
-
notifyListeners(r, ...
|
|
4409
|
-
const
|
|
4410
|
-
|
|
4408
|
+
notifyListeners(r, ...a) {
|
|
4409
|
+
const l = this.eventHandlers.get(r);
|
|
4410
|
+
l && l.notify(...a);
|
|
4411
4411
|
}
|
|
4412
4412
|
hasListeners(r) {
|
|
4413
4413
|
return this.eventHandlers.has(r);
|
|
@@ -4415,19 +4415,19 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4415
4415
|
/**
|
|
4416
4416
|
* Lifecycles
|
|
4417
4417
|
*/
|
|
4418
|
-
mount(r,
|
|
4418
|
+
mount(r, a = this.root.hasTreeAnimated) {
|
|
4419
4419
|
if (this.instance)
|
|
4420
4420
|
return;
|
|
4421
4421
|
this.isSVG = rf(r), this.instance = r;
|
|
4422
|
-
const { layoutId:
|
|
4423
|
-
if (u && !u.current && u.mount(r), this.root.nodes.add(this), this.parent && this.parent.children.add(this),
|
|
4422
|
+
const { layoutId: l, layout: c, visualElement: u } = this.options;
|
|
4423
|
+
if (u && !u.current && u.mount(r), this.root.nodes.add(this), this.parent && this.parent.children.add(this), a && (c || l) && (this.isLayoutDirty = !0), t) {
|
|
4424
4424
|
let f;
|
|
4425
4425
|
const d = () => this.root.updateBlockedByResize = !1;
|
|
4426
4426
|
t(r, () => {
|
|
4427
4427
|
this.root.updateBlockedByResize = !0, f && f(), f = sf(d, 250), Ve.hasAnimatedSinceResize && (Ve.hasAnimatedSinceResize = !1, this.nodes.forEach(Us));
|
|
4428
4428
|
});
|
|
4429
4429
|
}
|
|
4430
|
-
|
|
4430
|
+
l && this.root.registerSharedNode(l, this), this.options.animate !== !1 && u && (l || c) && this.addEventListener("didUpdate", ({ delta: f, hasLayoutChanged: d, hasRelativeTargetChanged: p, layout: g }) => {
|
|
4431
4431
|
if (this.isTreeAnimationBlocked()) {
|
|
4432
4432
|
this.target = void 0, this.relativeTarget = void 0;
|
|
4433
4433
|
return;
|
|
@@ -4449,7 +4449,7 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4449
4449
|
unmount() {
|
|
4450
4450
|
this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this);
|
|
4451
4451
|
const r = this.getStack();
|
|
4452
|
-
r && r.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0,
|
|
4452
|
+
r && r.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, pt(this.updateProjection);
|
|
4453
4453
|
}
|
|
4454
4454
|
// only on the root
|
|
4455
4455
|
blockUpdate() {
|
|
@@ -4484,8 +4484,8 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4484
4484
|
const f = this.path[u];
|
|
4485
4485
|
f.shouldResetTransform = !0, f.updateScroll("snapshot"), f.options.layoutRoot && f.willUpdate(!1);
|
|
4486
4486
|
}
|
|
4487
|
-
const { layoutId:
|
|
4488
|
-
if (
|
|
4487
|
+
const { layoutId: a, layout: l } = this.options;
|
|
4488
|
+
if (a === void 0 && !l)
|
|
4489
4489
|
return;
|
|
4490
4490
|
const c = this.getTransformTemplate();
|
|
4491
4491
|
this.prevTransformTemplateValue = c ? c(this.latestValues, "") : void 0, this.updateSnapshot(), r && this.notifyListeners("willUpdate");
|
|
@@ -4496,8 +4496,8 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4496
4496
|
return;
|
|
4497
4497
|
}
|
|
4498
4498
|
this.isUpdating || this.nodes.forEach(pf), this.isUpdating = !1, this.nodes.forEach(mf), this.nodes.forEach(cf), this.nodes.forEach(uf), this.clearAllSnapshots();
|
|
4499
|
-
const
|
|
4500
|
-
K.delta = xt(0, 1e3 / 60,
|
|
4499
|
+
const a = Pt.now();
|
|
4500
|
+
K.delta = xt(0, 1e3 / 60, a - K.timestamp), K.timestamp = a, K.isProcessing = !0, en.update.process(K), en.preRender.process(K), en.render.process(K), K.isProcessing = !1;
|
|
4501
4501
|
}
|
|
4502
4502
|
didUpdate() {
|
|
4503
4503
|
this.updateScheduled || (this.updateScheduled = !0, Bn.read(this.scheduleUpdate));
|
|
@@ -4523,90 +4523,90 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4523
4523
|
if (!this.instance || (this.updateScroll(), !(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty))
|
|
4524
4524
|
return;
|
|
4525
4525
|
if (this.resumeFrom && !this.resumeFrom.instance)
|
|
4526
|
-
for (let
|
|
4527
|
-
this.path[
|
|
4526
|
+
for (let l = 0; l < this.path.length; l++)
|
|
4527
|
+
this.path[l].updateScroll();
|
|
4528
4528
|
const r = this.layout;
|
|
4529
4529
|
this.layout = this.measure(!1), this.layoutCorrected = N(), this.isLayoutDirty = !1, this.projectionDelta = void 0, this.notifyListeners("measure", this.layout.layoutBox);
|
|
4530
|
-
const { visualElement:
|
|
4531
|
-
|
|
4530
|
+
const { visualElement: a } = this.options;
|
|
4531
|
+
a && a.notify("LayoutMeasure", this.layout.layoutBox, r ? r.layoutBox : void 0);
|
|
4532
4532
|
}
|
|
4533
4533
|
updateScroll(r = "measure") {
|
|
4534
|
-
let
|
|
4535
|
-
if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === r && (
|
|
4536
|
-
const
|
|
4534
|
+
let a = !!(this.options.layoutScroll && this.instance);
|
|
4535
|
+
if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === r && (a = !1), a) {
|
|
4536
|
+
const l = i(this.instance);
|
|
4537
4537
|
this.scroll = {
|
|
4538
4538
|
animationId: this.root.animationId,
|
|
4539
4539
|
phase: r,
|
|
4540
|
-
isRoot:
|
|
4540
|
+
isRoot: l,
|
|
4541
4541
|
offset: n(this.instance),
|
|
4542
|
-
wasRoot: this.scroll ? this.scroll.isRoot :
|
|
4542
|
+
wasRoot: this.scroll ? this.scroll.isRoot : l
|
|
4543
4543
|
};
|
|
4544
4544
|
}
|
|
4545
4545
|
}
|
|
4546
4546
|
resetTransform() {
|
|
4547
4547
|
if (!s)
|
|
4548
4548
|
return;
|
|
4549
|
-
const r = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout,
|
|
4550
|
-
r && (
|
|
4549
|
+
const r = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout, a = this.projectionDelta && !To(this.projectionDelta), l = this.getTransformTemplate(), c = l ? l(this.latestValues, "") : void 0, u = c !== this.prevTransformTemplateValue;
|
|
4550
|
+
r && (a || At(this.latestValues) || u) && (s(this.instance, c), this.shouldResetTransform = !1, this.scheduleRender());
|
|
4551
4551
|
}
|
|
4552
4552
|
measure(r = !0) {
|
|
4553
|
-
const
|
|
4554
|
-
let
|
|
4555
|
-
return r && (
|
|
4553
|
+
const a = this.measurePageBox();
|
|
4554
|
+
let l = this.removeElementScroll(a);
|
|
4555
|
+
return r && (l = this.removeTransform(l)), wf(l), {
|
|
4556
4556
|
animationId: this.root.animationId,
|
|
4557
|
-
measuredBox:
|
|
4558
|
-
layoutBox:
|
|
4557
|
+
measuredBox: a,
|
|
4558
|
+
layoutBox: l,
|
|
4559
4559
|
latestValues: {},
|
|
4560
4560
|
source: this.id
|
|
4561
4561
|
};
|
|
4562
4562
|
}
|
|
4563
4563
|
measurePageBox() {
|
|
4564
4564
|
var r;
|
|
4565
|
-
const { visualElement:
|
|
4566
|
-
if (!
|
|
4565
|
+
const { visualElement: a } = this.options;
|
|
4566
|
+
if (!a)
|
|
4567
4567
|
return N();
|
|
4568
|
-
const
|
|
4568
|
+
const l = a.measureViewportBox();
|
|
4569
4569
|
if (!(((r = this.scroll) === null || r === void 0 ? void 0 : r.wasRoot) || this.path.some(Sf))) {
|
|
4570
4570
|
const { scroll: u } = this.root;
|
|
4571
|
-
u && (Ut(
|
|
4571
|
+
u && (Ut(l.x, u.offset.x), Ut(l.y, u.offset.y));
|
|
4572
4572
|
}
|
|
4573
|
-
return
|
|
4573
|
+
return l;
|
|
4574
4574
|
}
|
|
4575
4575
|
removeElementScroll(r) {
|
|
4576
|
-
var
|
|
4577
|
-
const
|
|
4578
|
-
if (et(
|
|
4579
|
-
return
|
|
4576
|
+
var a;
|
|
4577
|
+
const l = N();
|
|
4578
|
+
if (et(l, r), !((a = this.scroll) === null || a === void 0) && a.wasRoot)
|
|
4579
|
+
return l;
|
|
4580
4580
|
for (let c = 0; c < this.path.length; c++) {
|
|
4581
4581
|
const u = this.path[c], { scroll: f, options: d } = u;
|
|
4582
|
-
u !== this.root && f && d.layoutScroll && (f.wasRoot && et(
|
|
4582
|
+
u !== this.root && f && d.layoutScroll && (f.wasRoot && et(l, r), Ut(l.x, f.offset.x), Ut(l.y, f.offset.y));
|
|
4583
4583
|
}
|
|
4584
|
-
return
|
|
4584
|
+
return l;
|
|
4585
4585
|
}
|
|
4586
|
-
applyTransform(r,
|
|
4587
|
-
const
|
|
4588
|
-
et(
|
|
4586
|
+
applyTransform(r, a = !1) {
|
|
4587
|
+
const l = N();
|
|
4588
|
+
et(l, r);
|
|
4589
4589
|
for (let c = 0; c < this.path.length; c++) {
|
|
4590
4590
|
const u = this.path[c];
|
|
4591
|
-
!
|
|
4591
|
+
!a && u.options.layoutScroll && u.scroll && u !== u.root && Wt(l, {
|
|
4592
4592
|
x: -u.scroll.offset.x,
|
|
4593
4593
|
y: -u.scroll.offset.y
|
|
4594
|
-
}), At(u.latestValues) && Wt(
|
|
4594
|
+
}), At(u.latestValues) && Wt(l, u.latestValues);
|
|
4595
4595
|
}
|
|
4596
|
-
return At(this.latestValues) && Wt(
|
|
4596
|
+
return At(this.latestValues) && Wt(l, this.latestValues), l;
|
|
4597
4597
|
}
|
|
4598
4598
|
removeTransform(r) {
|
|
4599
|
-
const
|
|
4600
|
-
et(
|
|
4601
|
-
for (let
|
|
4602
|
-
const c = this.path[
|
|
4599
|
+
const a = N();
|
|
4600
|
+
et(a, r);
|
|
4601
|
+
for (let l = 0; l < this.path.length; l++) {
|
|
4602
|
+
const c = this.path[l];
|
|
4603
4603
|
if (!c.instance || !At(c.latestValues))
|
|
4604
4604
|
continue;
|
|
4605
4605
|
En(c.latestValues) && c.updateSnapshot();
|
|
4606
4606
|
const u = N(), f = c.measurePageBox();
|
|
4607
|
-
et(u, f), Ls(
|
|
4607
|
+
et(u, f), Ls(a, c.latestValues, c.snapshot ? c.snapshot.layoutBox : void 0, u);
|
|
4608
4608
|
}
|
|
4609
|
-
return At(this.latestValues) && Ls(
|
|
4609
|
+
return At(this.latestValues) && Ls(a, this.latestValues), a;
|
|
4610
4610
|
}
|
|
4611
4611
|
setTargetDelta(r) {
|
|
4612
4612
|
this.targetDelta = r, this.root.scheduleUpdateProjection(), this.isProjectionDirty = !0;
|
|
@@ -4625,11 +4625,11 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4625
4625
|
this.relativeParent && this.relativeParent.resolvedRelativeTargetAt !== K.timestamp && this.relativeParent.resolveTargetDelta(!0);
|
|
4626
4626
|
}
|
|
4627
4627
|
resolveTargetDelta(r = !1) {
|
|
4628
|
-
var
|
|
4629
|
-
const
|
|
4630
|
-
this.isProjectionDirty || (this.isProjectionDirty =
|
|
4631
|
-
const c = !!this.resumingFrom || this !==
|
|
4632
|
-
if (!(r || c && this.isSharedProjectionDirty || this.isProjectionDirty || !((
|
|
4628
|
+
var a;
|
|
4629
|
+
const l = this.getLead();
|
|
4630
|
+
this.isProjectionDirty || (this.isProjectionDirty = l.isProjectionDirty), this.isTransformDirty || (this.isTransformDirty = l.isTransformDirty), this.isSharedProjectionDirty || (this.isSharedProjectionDirty = l.isSharedProjectionDirty);
|
|
4631
|
+
const c = !!this.resumingFrom || this !== l;
|
|
4632
|
+
if (!(r || c && this.isSharedProjectionDirty || this.isProjectionDirty || !((a = this.parent) === null || a === void 0) && a.isProjectionDirty || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize))
|
|
4633
4633
|
return;
|
|
4634
4634
|
const { layout: f, layoutId: d } = this.options;
|
|
4635
4635
|
if (!(!this.layout || !(f || d))) {
|
|
@@ -4656,17 +4656,17 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4656
4656
|
}
|
|
4657
4657
|
calcProjection() {
|
|
4658
4658
|
var r;
|
|
4659
|
-
const
|
|
4659
|
+
const a = this.getLead(), l = !!this.resumingFrom || this !== a;
|
|
4660
4660
|
let c = !0;
|
|
4661
|
-
if ((this.isProjectionDirty || !((r = this.parent) === null || r === void 0) && r.isProjectionDirty) && (c = !1),
|
|
4661
|
+
if ((this.isProjectionDirty || !((r = this.parent) === null || r === void 0) && r.isProjectionDirty) && (c = !1), l && (this.isSharedProjectionDirty || this.isTransformDirty) && (c = !1), this.resolvedRelativeTargetAt === K.timestamp && (c = !1), c)
|
|
4662
4662
|
return;
|
|
4663
4663
|
const { layout: u, layoutId: f } = this.options;
|
|
4664
4664
|
if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(u || f))
|
|
4665
4665
|
return;
|
|
4666
4666
|
et(this.layoutCorrected, this.layout.layoutBox);
|
|
4667
4667
|
const d = this.treeScale.x, p = this.treeScale.y;
|
|
4668
|
-
Ou(this.layoutCorrected, this.treeScale, this.path,
|
|
4669
|
-
const { target: g } =
|
|
4668
|
+
Ou(this.layoutCorrected, this.treeScale, this.path, l), a.layout && !a.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (a.target = a.layout.layoutBox, a.targetWithTransforms = N());
|
|
4669
|
+
const { target: g } = a;
|
|
4670
4670
|
if (!g) {
|
|
4671
4671
|
this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
|
|
4672
4672
|
return;
|
|
@@ -4680,20 +4680,20 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4680
4680
|
this.isVisible = !0;
|
|
4681
4681
|
}
|
|
4682
4682
|
scheduleRender(r = !0) {
|
|
4683
|
-
var
|
|
4684
|
-
if ((
|
|
4685
|
-
const
|
|
4686
|
-
|
|
4683
|
+
var a;
|
|
4684
|
+
if ((a = this.options.visualElement) === null || a === void 0 || a.scheduleRender(), r) {
|
|
4685
|
+
const l = this.getStack();
|
|
4686
|
+
l && l.scheduleRender();
|
|
4687
4687
|
}
|
|
4688
4688
|
this.resumingFrom && !this.resumingFrom.instance && (this.resumingFrom = void 0);
|
|
4689
4689
|
}
|
|
4690
4690
|
createProjectionDeltas() {
|
|
4691
4691
|
this.prevProjectionDelta = Nt(), this.projectionDelta = Nt(), this.projectionDeltaWithTransform = Nt();
|
|
4692
4692
|
}
|
|
4693
|
-
setAnimationOrigin(r,
|
|
4694
|
-
const
|
|
4695
|
-
(!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !
|
|
4696
|
-
const d = N(), p =
|
|
4693
|
+
setAnimationOrigin(r, a = !1) {
|
|
4694
|
+
const l = this.snapshot, c = l ? l.latestValues : {}, u = { ...this.latestValues }, f = Nt();
|
|
4695
|
+
(!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !a;
|
|
4696
|
+
const d = N(), p = l ? l.source : void 0, g = this.layout ? this.layout.source : void 0, v = p !== g, T = this.getStack(), P = !T || T.members.length <= 1, y = !!(v && !P && this.options.crossfade === !0 && !this.path.some(bf));
|
|
4697
4697
|
this.animationProgress = 0;
|
|
4698
4698
|
let x;
|
|
4699
4699
|
this.mixTargetDelta = (w) => {
|
|
@@ -4702,11 +4702,11 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4702
4702
|
}, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
|
|
4703
4703
|
}
|
|
4704
4704
|
startAnimation(r) {
|
|
4705
|
-
this.notifyListeners("animationStart"), this.currentAnimation && this.currentAnimation.stop(), this.resumingFrom && this.resumingFrom.currentAnimation && this.resumingFrom.currentAnimation.stop(), this.pendingAnimation && (
|
|
4705
|
+
this.notifyListeners("animationStart"), this.currentAnimation && this.currentAnimation.stop(), this.resumingFrom && this.resumingFrom.currentAnimation && this.resumingFrom.currentAnimation.stop(), this.pendingAnimation && (pt(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = k.update(() => {
|
|
4706
4706
|
Ve.hasAnimatedSinceResize = !0, this.currentAnimation = of(0, Is, {
|
|
4707
4707
|
...r,
|
|
4708
|
-
onUpdate: (
|
|
4709
|
-
this.mixTargetDelta(
|
|
4708
|
+
onUpdate: (a) => {
|
|
4709
|
+
this.mixTargetDelta(a), r.onUpdate && r.onUpdate(a);
|
|
4710
4710
|
},
|
|
4711
4711
|
onComplete: () => {
|
|
4712
4712
|
r.onComplete && r.onComplete(), this.completeAnimation();
|
|
@@ -4724,24 +4724,24 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4724
4724
|
}
|
|
4725
4725
|
applyTransformsToTarget() {
|
|
4726
4726
|
const r = this.getLead();
|
|
4727
|
-
let { targetWithTransforms:
|
|
4728
|
-
if (!(!
|
|
4727
|
+
let { targetWithTransforms: a, target: l, layout: c, latestValues: u } = r;
|
|
4728
|
+
if (!(!a || !l || !c)) {
|
|
4729
4729
|
if (this !== r && this.layout && c && Ao(this.options.animationType, this.layout.layoutBox, c.layoutBox)) {
|
|
4730
|
-
|
|
4730
|
+
l = this.target || N();
|
|
4731
4731
|
const f = Z(this.layout.layoutBox.x);
|
|
4732
|
-
|
|
4732
|
+
l.x.min = r.target.x.min, l.x.max = l.x.min + f;
|
|
4733
4733
|
const d = Z(this.layout.layoutBox.y);
|
|
4734
|
-
|
|
4734
|
+
l.y.min = r.target.y.min, l.y.max = l.y.min + d;
|
|
4735
4735
|
}
|
|
4736
|
-
et(
|
|
4736
|
+
et(a, l), Wt(a, u), ie(this.projectionDeltaWithTransform, this.layoutCorrected, a, u);
|
|
4737
4737
|
}
|
|
4738
4738
|
}
|
|
4739
|
-
registerSharedNode(r,
|
|
4740
|
-
this.sharedNodes.has(r) || this.sharedNodes.set(r, new Qu()), this.sharedNodes.get(r).add(
|
|
4741
|
-
const c =
|
|
4742
|
-
|
|
4739
|
+
registerSharedNode(r, a) {
|
|
4740
|
+
this.sharedNodes.has(r) || this.sharedNodes.set(r, new Qu()), this.sharedNodes.get(r).add(a);
|
|
4741
|
+
const c = a.options.initialPromotionConfig;
|
|
4742
|
+
a.promote({
|
|
4743
4743
|
transition: c ? c.transition : void 0,
|
|
4744
|
-
preserveFollowOpacity: c && c.shouldPreserveFollowOpacity ? c.shouldPreserveFollowOpacity(
|
|
4744
|
+
preserveFollowOpacity: c && c.shouldPreserveFollowOpacity ? c.shouldPreserveFollowOpacity(a) : void 0
|
|
4745
4745
|
});
|
|
4746
4746
|
}
|
|
4747
4747
|
isLead() {
|
|
@@ -4750,22 +4750,22 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4750
4750
|
}
|
|
4751
4751
|
getLead() {
|
|
4752
4752
|
var r;
|
|
4753
|
-
const { layoutId:
|
|
4754
|
-
return
|
|
4753
|
+
const { layoutId: a } = this.options;
|
|
4754
|
+
return a ? ((r = this.getStack()) === null || r === void 0 ? void 0 : r.lead) || this : this;
|
|
4755
4755
|
}
|
|
4756
4756
|
getPrevLead() {
|
|
4757
4757
|
var r;
|
|
4758
|
-
const { layoutId:
|
|
4759
|
-
return
|
|
4758
|
+
const { layoutId: a } = this.options;
|
|
4759
|
+
return a ? (r = this.getStack()) === null || r === void 0 ? void 0 : r.prevLead : void 0;
|
|
4760
4760
|
}
|
|
4761
4761
|
getStack() {
|
|
4762
4762
|
const { layoutId: r } = this.options;
|
|
4763
4763
|
if (r)
|
|
4764
4764
|
return this.root.sharedNodes.get(r);
|
|
4765
4765
|
}
|
|
4766
|
-
promote({ needsReset: r, transition:
|
|
4766
|
+
promote({ needsReset: r, transition: a, preserveFollowOpacity: l } = {}) {
|
|
4767
4767
|
const c = this.getStack();
|
|
4768
|
-
c && c.promote(this,
|
|
4768
|
+
c && c.promote(this, l), r && (this.projectionDelta = void 0, this.needsReset = !0), a && this.setOptions({ transition: a });
|
|
4769
4769
|
}
|
|
4770
4770
|
relegate() {
|
|
4771
4771
|
const r = this.getStack();
|
|
@@ -4775,12 +4775,12 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4775
4775
|
const { visualElement: r } = this.options;
|
|
4776
4776
|
if (!r)
|
|
4777
4777
|
return;
|
|
4778
|
-
let
|
|
4779
|
-
const { latestValues:
|
|
4780
|
-
if ((
|
|
4778
|
+
let a = !1;
|
|
4779
|
+
const { latestValues: l } = r;
|
|
4780
|
+
if ((l.z || l.rotate || l.rotateX || l.rotateY || l.rotateZ || l.skewX || l.skewY) && (a = !0), !a)
|
|
4781
4781
|
return;
|
|
4782
4782
|
const c = {};
|
|
4783
|
-
|
|
4783
|
+
l.z && dn("z", r, c, this.animationValues);
|
|
4784
4784
|
for (let u = 0; u < hn.length; u++)
|
|
4785
4785
|
dn(`rotate${hn[u]}`, r, c, this.animationValues), dn(`skew${hn[u]}`, r, c, this.animationValues);
|
|
4786
4786
|
r.render();
|
|
@@ -4789,7 +4789,7 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4789
4789
|
r.scheduleRender();
|
|
4790
4790
|
}
|
|
4791
4791
|
getProjectionStyles(r) {
|
|
4792
|
-
var
|
|
4792
|
+
var a, l;
|
|
4793
4793
|
if (!this.instance || this.isSVG)
|
|
4794
4794
|
return;
|
|
4795
4795
|
if (!this.isVisible)
|
|
@@ -4807,7 +4807,7 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4807
4807
|
const d = f.animationValues || f.latestValues;
|
|
4808
4808
|
this.applyTransformsToTarget(), c.transform = tf(this.projectionDeltaWithTransform, this.treeScale, d), u && (c.transform = u(d, c.transform));
|
|
4809
4809
|
const { x: p, y: g } = this.projectionDelta;
|
|
4810
|
-
c.transformOrigin = `${p.origin * 100}% ${g.origin * 100}% 0`, f.animationValues ? c.opacity = f === this ? (
|
|
4810
|
+
c.transformOrigin = `${p.origin * 100}% ${g.origin * 100}% 0`, f.animationValues ? c.opacity = f === this ? (l = (a = d.opacity) !== null && a !== void 0 ? a : this.latestValues.opacity) !== null && l !== void 0 ? l : 1 : this.preserveOpacity ? this.latestValues.opacity : d.opacityExit : c.opacity = f === this ? d.opacity !== void 0 ? d.opacity : "" : d.opacityExit !== void 0 ? d.opacityExit : 0;
|
|
4811
4811
|
for (const v in Me) {
|
|
4812
4812
|
if (d[v] === void 0)
|
|
4813
4813
|
continue;
|
|
@@ -4827,8 +4827,8 @@ function Co({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4827
4827
|
// Only run on root
|
|
4828
4828
|
resetTree() {
|
|
4829
4829
|
this.root.nodes.forEach((r) => {
|
|
4830
|
-
var
|
|
4831
|
-
return (
|
|
4830
|
+
var a;
|
|
4831
|
+
return (a = r.currentAnimation) === null || a === void 0 ? void 0 : a.stop();
|
|
4832
4832
|
}), this.root.nodes.forEach(Ns), this.root.sharedNodes.clear();
|
|
4833
4833
|
}
|
|
4834
4834
|
};
|
|
@@ -4848,11 +4848,11 @@ function uf(t) {
|
|
|
4848
4848
|
const d = r ? n.measuredBox[f] : n.layoutBox[f], p = Z(i[f]);
|
|
4849
4849
|
d.max = d.min + p, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = !0, t.relativeTarget[f].max = t.relativeTarget[f].min + p);
|
|
4850
4850
|
});
|
|
4851
|
-
const l = Nt();
|
|
4852
|
-
ie(l, i, n.layoutBox);
|
|
4853
4851
|
const a = Nt();
|
|
4854
|
-
|
|
4855
|
-
const
|
|
4852
|
+
ie(a, i, n.layoutBox);
|
|
4853
|
+
const l = Nt();
|
|
4854
|
+
r ? ie(l, t.applyTransform(s, !0), n.measuredBox) : ie(l, i, n.layoutBox);
|
|
4855
|
+
const c = !To(a);
|
|
4856
4856
|
let u = !1;
|
|
4857
4857
|
if (!t.resumeFrom) {
|
|
4858
4858
|
const f = t.getClosestProjectingParent();
|
|
@@ -4869,8 +4869,8 @@ function uf(t) {
|
|
|
4869
4869
|
t.notifyListeners("didUpdate", {
|
|
4870
4870
|
layout: i,
|
|
4871
4871
|
snapshot: n,
|
|
4872
|
-
delta:
|
|
4873
|
-
layoutDelta:
|
|
4872
|
+
delta: l,
|
|
4873
|
+
layoutDelta: a,
|
|
4874
4874
|
hasLayoutChanged: c,
|
|
4875
4875
|
hasRelativeTargetChanged: u
|
|
4876
4876
|
});
|
|
@@ -5026,25 +5026,25 @@ class kf {
|
|
|
5026
5026
|
scrapeMotionValuesFromProps(e, n, i) {
|
|
5027
5027
|
return {};
|
|
5028
5028
|
}
|
|
5029
|
-
constructor({ parent: e, props: n, presenceContext: i, reducedMotionConfig: s, blockInitialAnimation: o, visualState: r },
|
|
5029
|
+
constructor({ parent: e, props: n, presenceContext: i, reducedMotionConfig: s, blockInitialAnimation: o, visualState: r }, a = {}) {
|
|
5030
5030
|
this.applyWillChange = !1, this.resolveKeyframes = (d, p, g, v) => new this.KeyframeResolver(d, p, g, v, this), this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = ti, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
5031
5031
|
this.isRenderScheduled = !1, this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
5032
5032
|
}, this.isRenderScheduled = !1, this.scheduleRender = () => {
|
|
5033
5033
|
this.isRenderScheduled || (this.isRenderScheduled = !0, k.render(this.render, !1, !0));
|
|
5034
5034
|
};
|
|
5035
|
-
const { latestValues:
|
|
5036
|
-
this.latestValues =
|
|
5035
|
+
const { latestValues: l, renderState: c } = r;
|
|
5036
|
+
this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = e, this.props = n, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = s, this.options = a, this.blockInitialAnimation = !!o, this.isControllingVariants = Ne(n), this.isVariantNode = cr(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
5037
5037
|
const { willChange: u, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
5038
5038
|
for (const d in f) {
|
|
5039
5039
|
const p = f[d];
|
|
5040
|
-
|
|
5040
|
+
l[d] !== void 0 && Y(p) && p.set(l[d], !1);
|
|
5041
5041
|
}
|
|
5042
5042
|
}
|
|
5043
5043
|
mount(e) {
|
|
5044
5044
|
this.current = e, zs.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, i) => this.bindToMotionValue(i, n)), Vo.current || Rf(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : Mn.current, process.env.NODE_ENV !== "production" && ui(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
5045
5045
|
}
|
|
5046
5046
|
unmount() {
|
|
5047
|
-
zs.delete(this.current), this.projection && this.projection.unmount(),
|
|
5047
|
+
zs.delete(this.current), this.projection && this.projection.unmount(), pt(this.notifyUpdate), pt(this.render), this.valueSubscriptions.forEach((e) => e()), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
5048
5048
|
for (const e in this.events)
|
|
5049
5049
|
this.events[e].clear();
|
|
5050
5050
|
for (const e in this.features) {
|
|
@@ -5332,8 +5332,8 @@ function Uf({ children: t, isPresent: e }) {
|
|
|
5332
5332
|
left: 0
|
|
5333
5333
|
}), { nonce: o } = G(Fn);
|
|
5334
5334
|
return tr(() => {
|
|
5335
|
-
const { width: r, height:
|
|
5336
|
-
if (e || !i.current || !r || !
|
|
5335
|
+
const { width: r, height: a, top: l, left: c } = s.current;
|
|
5336
|
+
if (e || !i.current || !r || !a)
|
|
5337
5337
|
return;
|
|
5338
5338
|
i.current.dataset.motionPopId = n;
|
|
5339
5339
|
const u = document.createElement("style");
|
|
@@ -5341,8 +5341,8 @@ function Uf({ children: t, isPresent: e }) {
|
|
|
5341
5341
|
[data-motion-pop-id="${n}"] {
|
|
5342
5342
|
position: absolute !important;
|
|
5343
5343
|
width: ${r}px !important;
|
|
5344
|
-
height: ${
|
|
5345
|
-
top: ${
|
|
5344
|
+
height: ${a}px !important;
|
|
5345
|
+
top: ${l}px !important;
|
|
5346
5346
|
left: ${c}px !important;
|
|
5347
5347
|
}
|
|
5348
5348
|
`), () => {
|
|
@@ -5351,20 +5351,20 @@ function Uf({ children: t, isPresent: e }) {
|
|
|
5351
5351
|
}, [e]), j.jsx(Nf, { isPresent: e, childRef: i, sizeRef: s, children: kn.cloneElement(t, { ref: i }) });
|
|
5352
5352
|
}
|
|
5353
5353
|
const Wf = ({ children: t, initial: e, isPresent: n, onExitComplete: i, custom: s, presenceAffectsLayout: o, mode: r }) => {
|
|
5354
|
-
const
|
|
5354
|
+
const a = Jn($f), l = On(), c = Dt(
|
|
5355
5355
|
() => ({
|
|
5356
|
-
id:
|
|
5356
|
+
id: l,
|
|
5357
5357
|
initial: e,
|
|
5358
5358
|
isPresent: n,
|
|
5359
5359
|
custom: s,
|
|
5360
5360
|
onExitComplete: (u) => {
|
|
5361
|
-
|
|
5362
|
-
for (const f of
|
|
5361
|
+
a.set(u, !0);
|
|
5362
|
+
for (const f of a.values())
|
|
5363
5363
|
if (!f)
|
|
5364
5364
|
return;
|
|
5365
5365
|
i && i();
|
|
5366
5366
|
},
|
|
5367
|
-
register: (u) => (
|
|
5367
|
+
register: (u) => (a.set(u, !1), () => a.delete(u))
|
|
5368
5368
|
}),
|
|
5369
5369
|
/**
|
|
5370
5370
|
* If the presence of a child affects the layout of the components around it,
|
|
@@ -5374,9 +5374,9 @@ const Wf = ({ children: t, initial: e, isPresent: n, onExitComplete: i, custom:
|
|
|
5374
5374
|
o ? [Math.random()] : [n]
|
|
5375
5375
|
);
|
|
5376
5376
|
return Dt(() => {
|
|
5377
|
-
|
|
5377
|
+
a.forEach((u, f) => a.set(f, !1));
|
|
5378
5378
|
}, [n]), kn.useEffect(() => {
|
|
5379
|
-
!n && !
|
|
5379
|
+
!n && !a.size && i && i();
|
|
5380
5380
|
}, [n]), r === "popLayout" && (t = j.jsx(Uf, { isPresent: n, children: t })), j.jsx(Be.Provider, { value: c, children: t });
|
|
5381
5381
|
};
|
|
5382
5382
|
function $f() {
|
|
@@ -5390,29 +5390,29 @@ function Xs(t) {
|
|
|
5390
5390
|
}), e;
|
|
5391
5391
|
}
|
|
5392
5392
|
const Kf = ({ children: t, exitBeforeEnter: e, custom: n, initial: i = !0, onExitComplete: s, presenceAffectsLayout: o = !0, mode: r = "sync" }) => {
|
|
5393
|
-
|
|
5394
|
-
const
|
|
5393
|
+
dt(!e, "Replace exitBeforeEnter with mode='wait'");
|
|
5394
|
+
const a = Dt(() => Xs(t), [t]), l = a.map(Ce), c = it(!0), u = it(a), f = Jn(() => /* @__PURE__ */ new Map()), [d, p] = _t(a), [g, v] = _t(a);
|
|
5395
5395
|
ir(() => {
|
|
5396
|
-
c.current = !1, u.current =
|
|
5396
|
+
c.current = !1, u.current = a;
|
|
5397
5397
|
for (let y = 0; y < g.length; y++) {
|
|
5398
5398
|
const x = Ce(g[y]);
|
|
5399
|
-
|
|
5399
|
+
l.includes(x) ? f.delete(x) : f.get(x) !== !0 && f.set(x, !1);
|
|
5400
5400
|
}
|
|
5401
|
-
}, [g,
|
|
5401
|
+
}, [g, l.length, l.join("-")]);
|
|
5402
5402
|
const T = [];
|
|
5403
|
-
if (
|
|
5404
|
-
let y = [...
|
|
5403
|
+
if (a !== d) {
|
|
5404
|
+
let y = [...a];
|
|
5405
5405
|
for (let x = 0; x < g.length; x++) {
|
|
5406
5406
|
const w = g[x], A = Ce(w);
|
|
5407
|
-
|
|
5407
|
+
l.includes(A) || (y.splice(x, 0, w), T.push(w));
|
|
5408
5408
|
}
|
|
5409
|
-
r === "wait" && T.length && (y = T), v(Xs(y)), p(
|
|
5409
|
+
r === "wait" && T.length && (y = T), v(Xs(y)), p(a);
|
|
5410
5410
|
return;
|
|
5411
5411
|
}
|
|
5412
5412
|
process.env.NODE_ENV !== "production" && r === "wait" && g.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
5413
5413
|
const { forceRender: P } = G(Un);
|
|
5414
5414
|
return j.jsx(j.Fragment, { children: g.map((y) => {
|
|
5415
|
-
const x = Ce(y), w =
|
|
5415
|
+
const x = Ce(y), w = a === g || l.includes(x), A = () => {
|
|
5416
5416
|
if (f.has(x))
|
|
5417
5417
|
f.set(x, !0);
|
|
5418
5418
|
else
|
|
@@ -5487,15 +5487,15 @@ function Zf(t) {
|
|
|
5487
5487
|
var Jf = Zf();
|
|
5488
5488
|
const Zs = ({
|
|
5489
5489
|
onKeyDown: t
|
|
5490
|
-
}) => (
|
|
5490
|
+
}) => (lt(() => (document.addEventListener("keydown", t), () => {
|
|
5491
5491
|
document.removeEventListener("keydown", t);
|
|
5492
5492
|
}), []), null), Js = ({
|
|
5493
5493
|
onMousedown: t
|
|
5494
|
-
}) => (
|
|
5494
|
+
}) => (lt(() => (document.addEventListener("mousedown", t), () => {
|
|
5495
5495
|
document.removeEventListener("mousedown", t);
|
|
5496
5496
|
}), []), null), Qf = ({
|
|
5497
5497
|
onPickerHide: t
|
|
5498
|
-
}) => (
|
|
5498
|
+
}) => (lt(() => () => {
|
|
5499
5499
|
t();
|
|
5500
5500
|
}, []), null), th = "acrool-react-picker__root", eh = "acrool-react-picker__main-el", nh = "acrool-react-picker__picker-el", mn = {
|
|
5501
5501
|
root: th,
|
|
@@ -5529,23 +5529,23 @@ const Zs = ({
|
|
|
5529
5529
|
}, n) => {
|
|
5530
5530
|
const i = it(null), s = pa();
|
|
5531
5531
|
return Qs(() => {
|
|
5532
|
-
let o = st.bottom, r =
|
|
5533
|
-
const
|
|
5532
|
+
let o = st.bottom, r = mt.left;
|
|
5533
|
+
const a = (l) => {
|
|
5534
5534
|
var c;
|
|
5535
5535
|
if (s.isVisible && e.current && i.current) {
|
|
5536
|
-
const u = ((c =
|
|
5536
|
+
const u = ((c = l == null ? void 0 : l[0]) == null ? void 0 : c.contentRect) ?? i.current.getBoundingClientRect(), f = u.height, d = u.width, p = e.current.getBoundingClientRect(), g = p.height;
|
|
5537
5537
|
p.width;
|
|
5538
5538
|
const v = p.bottom, T = p.top, P = p.left, y = p.right, x = window.pageYOffset || document.documentElement.scrollTop, w = window.pageXOffset || document.documentElement.scrollLeft, A = window.innerWidth || document.documentElement.clientWidth, L = window.innerHeight || document.documentElement.clientHeight, $ = 15, R = v + f < L, _ = T - (f + $) > 0;
|
|
5539
5539
|
o === st.bottom ? !R && _ && (o = st.top) : o === st.top && (R && !_ || !R && !_) && (o = st.bottom);
|
|
5540
5540
|
const U = P + d < A, M = y - (d + $) > 0;
|
|
5541
|
-
r ===
|
|
5541
|
+
r === mt.left ? !U && M && (r = mt.right) : r === mt.right && (U && !M || !U && !M) && (r = mt.left), s.setVertical(o), i.current.style.top = o === st.bottom ? `${v + x}px` : `${v + x - (f + g)}px`, i.current.style.left = r === mt.left ? `${P + w}px` : `${y + w - d}px`, i.current.style.transformOrigin = o === st.bottom ? "top" : "bottom", requestAnimationFrame(a);
|
|
5542
5542
|
}
|
|
5543
5543
|
};
|
|
5544
5544
|
if (e.current && i.current) {
|
|
5545
5545
|
i.current.style.display = "block";
|
|
5546
|
-
const
|
|
5547
|
-
return
|
|
5548
|
-
|
|
5546
|
+
const l = new ResizeObserver(a);
|
|
5547
|
+
return l.observe(i.current), () => {
|
|
5548
|
+
l.disconnect();
|
|
5549
5549
|
};
|
|
5550
5550
|
}
|
|
5551
5551
|
}, [s.isVisible, e, i]), /* @__PURE__ */ j.jsx(j.Fragment, { children: /* @__PURE__ */ j.jsx(
|
|
@@ -5566,37 +5566,39 @@ const Zs = ({
|
|
|
5566
5566
|
function dh(t, e, n) {
|
|
5567
5567
|
const i = De(t);
|
|
5568
5568
|
return De((o, r) => {
|
|
5569
|
-
const [
|
|
5570
|
-
|
|
5569
|
+
const [a, l] = _t(!1), [c, u] = _t(!1), [f, d] = _t(st.bottom), [p, g] = _t(), v = it(null), T = it(null), P = it(null), y = it(p), x = (n == null ? void 0 : n.isEnableClickOutSiteHidden) !== !1, w = (n == null ? void 0 : n.isEnableHideSave) !== !1;
|
|
5570
|
+
lt(() => {
|
|
5571
5571
|
g(o.value);
|
|
5572
|
-
}, [JSON.stringify(o.value)]),
|
|
5572
|
+
}, [JSON.stringify(o.value)]), lt(() => {
|
|
5573
5573
|
y.current = p;
|
|
5574
|
-
}, [p])
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
}, []),
|
|
5574
|
+
}, [p]), lt(() => {
|
|
5575
|
+
a && g(o.value);
|
|
5576
|
+
}, [a, o.value]);
|
|
5577
|
+
const A = vt((M) => {
|
|
5578
|
+
[Ft.Tab].includes(M.key) && (l(!1), T.current.focus(), u(!1));
|
|
5579
|
+
}, []), L = vt((M) => {
|
|
5580
|
+
([Ft.ArrowUp, Ft.ArrowDown, Ft.Enter].includes(M.key) || M.code === "Space") && (M.stopPropagation(), l(!0));
|
|
5581
|
+
}, []), $ = vt((M) => {
|
|
5580
5582
|
!v.current && P.current && !P.current.contains(M.target) && u(!1);
|
|
5581
|
-
}, []), R =
|
|
5582
|
-
v.current && !v.current.contains(M.target) && P.current && !P.current.contains(M.target) && (
|
|
5583
|
-
}, []), _ =
|
|
5583
|
+
}, []), R = vt((M) => {
|
|
5584
|
+
v.current && !v.current.contains(M.target) && P.current && !P.current.contains(M.target) && (l(!1), u(!1));
|
|
5585
|
+
}, []), _ = vt(() => {
|
|
5584
5586
|
if (typeof (o == null ? void 0 : o.onChange) > "u") {
|
|
5585
|
-
|
|
5587
|
+
gt.warning("@acrool/react-picker", "createPicker component props onChange is undefined, is no call");
|
|
5586
5588
|
return;
|
|
5587
5589
|
}
|
|
5588
5590
|
typeof y.current < "u" && w && JSON.stringify(p) !== JSON.stringify(y.current) && o.onChange(y.current);
|
|
5589
|
-
}, [p, o.onChange, w]), U =
|
|
5590
|
-
[Ft.Escape].includes(M.key) &&
|
|
5591
|
-
}, [
|
|
5591
|
+
}, [p, o.onChange, w]), U = vt((M) => {
|
|
5592
|
+
[Ft.Escape].includes(M.key) && a && (M.stopPropagation(), l(!1));
|
|
5593
|
+
}, [a]);
|
|
5592
5594
|
return /* @__PURE__ */ j.jsx(
|
|
5593
5595
|
jn.Provider,
|
|
5594
5596
|
{
|
|
5595
5597
|
value: {
|
|
5596
|
-
hide: () => requestAnimationFrame(() =>
|
|
5597
|
-
show: () =>
|
|
5598
|
-
toggle: () =>
|
|
5599
|
-
isVisible:
|
|
5598
|
+
hide: () => requestAnimationFrame(() => l(!1)),
|
|
5599
|
+
show: () => l(!0),
|
|
5600
|
+
toggle: () => l((M) => !M),
|
|
5601
|
+
isVisible: a,
|
|
5600
5602
|
inputFocus: () => u(!0),
|
|
5601
5603
|
inputBlur: () => u(!1),
|
|
5602
5604
|
isInputFocus: c,
|
|
@@ -5613,7 +5615,7 @@ function dh(t, e, n) {
|
|
|
5613
5615
|
ref: Do(r, T)
|
|
5614
5616
|
}
|
|
5615
5617
|
) }),
|
|
5616
|
-
/* @__PURE__ */ j.jsx(Kf, { children:
|
|
5618
|
+
/* @__PURE__ */ j.jsx(Kf, { children: a && /* @__PURE__ */ j.jsx(
|
|
5617
5619
|
nr,
|
|
5618
5620
|
{
|
|
5619
5621
|
id: `acrool-react-picker-${Jf().toLowerCase()}`,
|
|
@@ -5628,8 +5630,8 @@ function dh(t, e, n) {
|
|
|
5628
5630
|
)
|
|
5629
5631
|
}
|
|
5630
5632
|
) }),
|
|
5631
|
-
|
|
5632
|
-
x &&
|
|
5633
|
+
a && /* @__PURE__ */ j.jsx(Qf, { onPickerHide: _ }),
|
|
5634
|
+
x && a && /* @__PURE__ */ j.jsx(Js, { onMousedown: R }),
|
|
5633
5635
|
c && /* @__PURE__ */ j.jsx(Js, { onMousedown: $ }),
|
|
5634
5636
|
c && /* @__PURE__ */ j.jsx(Zs, { onKeyDown: L }),
|
|
5635
5637
|
c && /* @__PURE__ */ j.jsx(Zs, { onKeyDown: A })
|
|
@@ -5639,7 +5641,7 @@ function dh(t, e, n) {
|
|
|
5639
5641
|
});
|
|
5640
5642
|
}
|
|
5641
5643
|
export {
|
|
5642
|
-
|
|
5644
|
+
mt as EHorizontal,
|
|
5643
5645
|
Ft as EKeyboardKey,
|
|
5644
5646
|
st as EVertical,
|
|
5645
5647
|
uh as PickerProviderConsumer,
|