@helsenorge/designsystem-react 8.6.0 → 9.0.0-beta.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.
Files changed (95) hide show
  1. package/Button.js +7 -7
  2. package/Button.js.map +1 -1
  3. package/CHANGELOG.md +27 -3
  4. package/Checkbox.js +42 -42
  5. package/Checkbox.js.map +1 -1
  6. package/ErrorWrapper.js.map +1 -1
  7. package/FormGroup.js +47 -40
  8. package/FormGroup.js.map +1 -1
  9. package/Icon.js +21 -21
  10. package/Icon.js.map +1 -1
  11. package/Input.js +98 -88
  12. package/Input.js.map +1 -1
  13. package/Label.js +28 -28
  14. package/Label.js.map +1 -1
  15. package/MaxCharacters.js +2 -2
  16. package/MaxCharacters.js.map +1 -1
  17. package/RadioButton.js +61 -61
  18. package/RadioButton.js.map +1 -1
  19. package/Select.js +34 -33
  20. package/Select.js.map +1 -1
  21. package/Slider.js +218 -0
  22. package/Slider.js.map +1 -0
  23. package/StatusDot.js +15 -15
  24. package/StatusDot.js.map +1 -1
  25. package/TabList.js +88 -53
  26. package/TabList.js.map +1 -1
  27. package/TabPanel.js +7 -7
  28. package/TabPanel.js.map +1 -1
  29. package/Textarea.js +59 -58
  30. package/Textarea.js.map +1 -1
  31. package/Trigger.js +33 -33
  32. package/Trigger.js.map +1 -1
  33. package/components/Button/Button.d.ts +2 -2
  34. package/components/Checkbox/Checkbox.d.ts +4 -3
  35. package/components/Checkbox/styles.module.scss +0 -14
  36. package/components/Checkbox/styles.module.scss.d.ts +0 -1
  37. package/components/Dropdown/Dropdown.d.ts +2 -2
  38. package/components/Dropdown/index.js +25 -25
  39. package/components/Dropdown/index.js.map +1 -1
  40. package/components/ErrorWrapper/ErrorWrapper.d.ts +3 -0
  41. package/components/ExpanderList/ExpanderList.d.ts +4 -6
  42. package/components/ExpanderList/index.js +118 -126
  43. package/components/ExpanderList/index.js.map +1 -1
  44. package/components/ExpanderList/styles.module.scss +165 -49
  45. package/components/ExpanderList/styles.module.scss.d.ts +29 -5
  46. package/components/FormGroup/FormGroup.d.ts +2 -2
  47. package/components/Icon/Icon.d.ts +4 -4
  48. package/components/Icons/NoAccess.js +7 -7
  49. package/components/Icons/NoAccess.js.map +1 -1
  50. package/components/Input/Input.d.ts +4 -3
  51. package/components/Label/Label.d.ts +4 -4
  52. package/components/Label/SubLabel.d.ts +2 -2
  53. package/components/MaxCharacters/MaxCharacters.d.ts +2 -2
  54. package/components/RadioButton/RadioButton.d.ts +5 -4
  55. package/components/RadioButton/styles.module.scss +0 -15
  56. package/components/RadioButton/styles.module.scss.d.ts +0 -1
  57. package/components/Select/Select.d.ts +4 -3
  58. package/components/SharingStatus/SharingStatus.d.ts +1 -1
  59. package/components/SharingStatus/index.js +5 -5
  60. package/components/SharingStatus/index.js.map +1 -1
  61. package/components/SharingStatus/styles.module.scss +0 -16
  62. package/components/SharingStatus/styles.module.scss.d.ts +0 -4
  63. package/components/Slider/Slider.d.ts +9 -4
  64. package/components/Slider/index.js +3 -189
  65. package/components/Slider/index.js.map +1 -1
  66. package/components/Slider/styles.module.scss +19 -6
  67. package/components/Slider/styles.module.scss.d.ts +3 -0
  68. package/components/StatusDot/StatusDot.d.ts +3 -3
  69. package/components/StatusDot/index.js +3 -3
  70. package/components/Tabs/TabList/TabList.d.ts +3 -3
  71. package/components/Tabs/TabList/styles.module.scss +63 -51
  72. package/components/Tabs/TabList/styles.module.scss.d.ts +7 -3
  73. package/components/Tabs/TabPanel/TabPanel.d.ts +1 -2
  74. package/components/Tabs/TabPanel/styles.module.scss +11 -26
  75. package/components/Tabs/TabPanel/styles.module.scss.d.ts +0 -2
  76. package/components/Tabs/Tabs.d.ts +3 -3
  77. package/components/Tabs/index.js +60 -75
  78. package/components/Tabs/index.js.map +1 -1
  79. package/components/Tabs/styles.module.scss +5 -9
  80. package/components/Tabs/styles.module.scss.d.ts +0 -1
  81. package/components/Textarea/Textarea.d.ts +4 -3
  82. package/components/Toggle/index.js +1204 -1170
  83. package/components/Toggle/index.js.map +1 -1
  84. package/components/Trigger/Trigger.d.ts +2 -2
  85. package/components/Validation/index.js +39 -32
  86. package/components/Validation/index.js.map +1 -1
  87. package/constants.d.ts +1 -1
  88. package/constants.js +1 -1
  89. package/constants.js.map +1 -1
  90. package/docs/FormExample/FormExample.d.ts +3 -1
  91. package/index.js +23 -23
  92. package/package.json +4 -4
  93. package/utils/component.d.ts +1 -0
  94. package/utils/component.js +7 -3
  95. package/utils/component.js.map +1 -1
@@ -1,43 +1,43 @@
1
- import { jsxs as Q, Fragment as ut, jsx as E } from "react/jsx-runtime";
2
- import { useRef as kn, useEffect as ye, useState as ct } from "react";
1
+ import { jsxs as te, Fragment as dt, jsx as K } from "react/jsx-runtime";
2
+ import { useRef as jn, useEffect as ge, useState as pt } from "react";
3
3
  import W from "classnames";
4
- import { AnalyticsId as Ln } from "../../constants.js";
5
- import { usePseudoClasses as Wn } from "../../hooks/usePseudoClasses.js";
6
- import { useUuid as J } from "../../hooks/useUuid.js";
4
+ import { AnalyticsId as Gn } from "../../constants.js";
5
+ import { usePseudoClasses as zn } from "../../hooks/usePseudoClasses.js";
6
+ import { useUuid as ne } from "../../hooks/useUuid.js";
7
7
  import M from "./styles.module.scss";
8
- const ht = /* @__PURE__ */ new Set();
9
- function Le(t, e, n) {
10
- t || ht.has(e) || (console.warn(e), ht.add(e));
8
+ const mt = /* @__PURE__ */ new Set();
9
+ function We(t, e, n) {
10
+ t || mt.has(e) || (console.warn(e), mt.add(e));
11
11
  }
12
- function $n(t) {
12
+ function qn(t) {
13
13
  return t !== null && typeof t == "object" && typeof t.start == "function";
14
14
  }
15
- const Un = (t) => Array.isArray(t);
16
- function Bt(t) {
15
+ const Yn = (t) => Array.isArray(t);
16
+ function Hn(t) {
17
17
  return typeof t == "string" || Array.isArray(t);
18
18
  }
19
- function ft(t) {
19
+ function gt(t) {
20
20
  const e = [{}, {}];
21
21
  return t == null || t.values.forEach((n, s) => {
22
22
  e[0][s] = n.get(), e[1][s] = n.getVelocity();
23
23
  }), e;
24
24
  }
25
- function kt(t, e, n, s) {
25
+ function Ut(t, e, n, s) {
26
26
  if (typeof e == "function") {
27
- const [i, r] = ft(s);
28
- e = e(n !== void 0 ? n : t.custom, i, r);
27
+ const [r, i] = gt(s);
28
+ e = e(n !== void 0 ? n : t.custom, r, i);
29
29
  }
30
30
  if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
31
- const [i, r] = ft(s);
32
- e = e(n !== void 0 ? n : t.custom, i, r);
31
+ const [r, i] = gt(s);
32
+ e = e(n !== void 0 ? n : t.custom, r, i);
33
33
  }
34
34
  return e;
35
35
  }
36
- function jn(t, e, n) {
36
+ function Xn(t, e, n) {
37
37
  const s = t.getProps();
38
- return kt(s, e, s.custom, t);
38
+ return Ut(s, e, s.custom, t);
39
39
  }
40
- const Gn = [
40
+ const Zn = [
41
41
  "animate",
42
42
  "whileInView",
43
43
  "whileFocus",
@@ -45,7 +45,7 @@ const Gn = [
45
45
  "whileTap",
46
46
  "whileDrag",
47
47
  "exit"
48
- ], We = ["initial", ...Gn], oe = [
48
+ ], Qn = ["initial", ...Zn], le = [
49
49
  "transformPerspective",
50
50
  "x",
51
51
  "y",
@@ -63,78 +63,75 @@ const Gn = [
63
63
  "skew",
64
64
  "skewX",
65
65
  "skewY"
66
- ], L = new Set(oe), O = (t) => t * 1e3, I = (t) => t / 1e3, zn = {
66
+ ], G = new Set(le), E = (t) => t * 1e3, I = (t) => t / 1e3, Jn = {
67
67
  type: "spring",
68
68
  stiffness: 500,
69
69
  damping: 25,
70
70
  restSpeed: 10
71
- }, qn = (t) => ({
71
+ }, es = (t) => ({
72
72
  type: "spring",
73
73
  stiffness: 550,
74
74
  damping: t === 0 ? 2 * Math.sqrt(550) : 30,
75
75
  restSpeed: 10
76
- }), Yn = {
76
+ }), ts = {
77
77
  type: "keyframes",
78
78
  duration: 0.8
79
- }, Hn = {
79
+ }, ns = {
80
80
  type: "keyframes",
81
81
  ease: [0.25, 0.1, 0.35, 1],
82
82
  duration: 0.3
83
- }, Xn = (t, { keyframes: e }) => e.length > 2 ? Yn : L.has(t) ? t.startsWith("scale") ? qn(e[1]) : zn : Hn;
84
- function Zn({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: l, from: a, elapsed: u, ...c }) {
85
- return !!Object.keys(c).length;
86
- }
87
- function Lt(t, e) {
88
- return t[e] || t.default || t;
83
+ }, ss = (t, { keyframes: e }) => e.length > 2 ? ts : G.has(t) ? t.startsWith("scale") ? es(e[1]) : Jn : ns;
84
+ function jt(t, e) {
85
+ return t ? t[e] || t.default || t : void 0;
89
86
  }
90
- const Qn = {
87
+ const rs = {
91
88
  skipAnimations: !1,
92
89
  useManualTiming: !1
93
- }, Jn = (t) => t !== null;
94
- function xe(t, { repeat: e, repeatType: n = "loop" }, s) {
95
- const i = t.filter(Jn), r = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
96
- return !r || s === void 0 ? i[r] : s;
97
- }
98
- const B = (t) => t;
99
- function es(t) {
100
- let e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = !1, i = !1;
101
- const r = /* @__PURE__ */ new WeakSet();
90
+ }, is = (t) => t !== null;
91
+ function Se(t, { repeat: e, repeatType: n = "loop" }, s) {
92
+ const r = t.filter(is), i = e && n !== "loop" && e % 2 === 1 ? 0 : r.length - 1;
93
+ return !i || s === void 0 ? r[i] : s;
94
+ }
95
+ const L = (t) => t;
96
+ function os(t) {
97
+ let e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = !1, r = !1;
98
+ const i = /* @__PURE__ */ new WeakSet();
102
99
  let o = {
103
100
  delta: 0,
104
101
  timestamp: 0,
105
102
  isProcessing: !1
106
103
  };
107
- function l(u) {
108
- r.has(u) && (a.schedule(u), t()), u(o);
104
+ function a(u) {
105
+ i.has(u) && (l.schedule(u), t()), u(o);
109
106
  }
110
- const a = {
107
+ const l = {
111
108
  /**
112
109
  * Schedule a process to run on the next frame.
113
110
  */
114
- schedule: (u, c = !1, h = !1) => {
115
- const d = h && s ? e : n;
116
- return c && r.add(u), d.has(u) || d.add(u), u;
111
+ schedule: (u, c = !1, f = !1) => {
112
+ const g = f && s ? e : n;
113
+ return c && i.add(u), g.has(u) || g.add(u), u;
117
114
  },
118
115
  /**
119
116
  * Cancel the provided callback from running on the next frame.
120
117
  */
121
118
  cancel: (u) => {
122
- n.delete(u), r.delete(u);
119
+ n.delete(u), i.delete(u);
123
120
  },
124
121
  /**
125
122
  * Execute all schedule callbacks.
126
123
  */
127
124
  process: (u) => {
128
125
  if (o = u, s) {
129
- i = !0;
126
+ r = !0;
130
127
  return;
131
128
  }
132
- s = !0, [e, n] = [n, e], n.clear(), e.forEach(l), s = !1, i && (i = !1, a.process(u));
129
+ s = !0, [e, n] = [n, e], n.clear(), e.forEach(a), s = !1, r && (r = !1, l.process(u));
133
130
  }
134
131
  };
135
- return a;
132
+ return l;
136
133
  }
137
- const me = [
134
+ const pe = [
138
135
  "read",
139
136
  // Read
140
137
  "resolveKeyframes",
@@ -147,88 +144,95 @@ const me = [
147
144
  // Write
148
145
  "postRender"
149
146
  // Compute
150
- ], ts = 40;
151
- function ns(t, e) {
147
+ ], as = 40;
148
+ function ls(t, e) {
152
149
  let n = !1, s = !0;
153
- const i = {
150
+ const r = {
154
151
  delta: 0,
155
152
  timestamp: 0,
156
153
  isProcessing: !1
157
- }, r = () => n = !0, o = me.reduce((m, S) => (m[S] = es(r), m), {}), { read: l, resolveKeyframes: a, update: u, preRender: c, render: h, postRender: f } = o, d = () => {
154
+ }, i = () => n = !0, o = pe.reduce((m, y) => (m[y] = os(i), m), {}), { read: a, resolveKeyframes: l, update: u, preRender: c, render: f, postRender: h } = o, g = () => {
158
155
  const m = performance.now();
159
- n = !1, i.delta = s ? 1e3 / 60 : Math.max(Math.min(m - i.timestamp, ts), 1), i.timestamp = m, i.isProcessing = !0, l.process(i), a.process(i), u.process(i), c.process(i), h.process(i), f.process(i), i.isProcessing = !1, n && e && (s = !1, t(d));
160
- }, y = () => {
161
- n = !0, s = !0, i.isProcessing || t(d);
156
+ n = !1, r.delta = s ? 1e3 / 60 : Math.max(Math.min(m - r.timestamp, as), 1), r.timestamp = m, r.isProcessing = !0, a.process(r), l.process(r), u.process(r), c.process(r), f.process(r), h.process(r), r.isProcessing = !1, n && e && (s = !1, t(g));
157
+ }, p = () => {
158
+ n = !0, s = !0, r.isProcessing || t(g);
162
159
  };
163
- return { schedule: me.reduce((m, S) => {
164
- const V = o[S];
165
- return m[S] = (w, T = !1, x = !1) => (n || y(), V.schedule(w, T, x)), m;
160
+ return { schedule: pe.reduce((m, y) => {
161
+ const S = o[y];
162
+ return m[y] = (w, v = !1, x = !1) => (n || p(), S.schedule(w, v, x)), m;
166
163
  }, {}), cancel: (m) => {
167
- for (let S = 0; S < me.length; S++)
168
- o[me[S]].cancel(m);
169
- }, state: i, steps: o };
164
+ for (let y = 0; y < pe.length; y++)
165
+ o[pe[y]].cancel(m);
166
+ }, state: r, steps: o };
167
+ }
168
+ const { schedule: _, cancel: Re, state: ve, steps: to } = ls(typeof requestAnimationFrame < "u" ? requestAnimationFrame : L, !0), Gt = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, us = 1e-7, cs = 12;
169
+ function fs(t, e, n, s, r) {
170
+ let i, o, a = 0;
171
+ do
172
+ o = e + (n - e) / 2, i = Gt(o, s, r) - t, i > 0 ? n = o : e = o;
173
+ while (Math.abs(i) > us && ++a < cs);
174
+ return o;
170
175
  }
171
- const { schedule: _, cancel: be, state: Te, steps: Ur } = ns(typeof requestAnimationFrame < "u" ? requestAnimationFrame : B, !0), Wt = (t) => /^0[^.\s]+$/u.test(t);
172
- function ss(t) {
173
- return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Wt(t) : !0;
176
+ function ue(t, e, n, s) {
177
+ if (t === e && n === s)
178
+ return L;
179
+ const r = (i) => fs(i, 0, 1, t, n);
180
+ return (i) => i === 0 || i === 1 ? i : Gt(r(i), e, s);
174
181
  }
175
- let ae = B, k = B;
176
- process.env.NODE_ENV !== "production" && (ae = (t, e) => {
182
+ const zt = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, qt = (t) => (e) => 1 - t(1 - e), Yt = /* @__PURE__ */ ue(0.33, 1.53, 0.69, 0.99), Ue = /* @__PURE__ */ qt(Yt), Ht = /* @__PURE__ */ zt(Ue), Xt = (t) => (t *= 2) < 1 ? 0.5 * Ue(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), je = (t) => 1 - Math.sin(Math.acos(t)), hs = qt(je), Zt = zt(je), Qt = (t) => /^0[^.\s]+$/u.test(t);
183
+ function ds(t) {
184
+ return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Qt(t) : !0;
185
+ }
186
+ let ce = L, $ = L;
187
+ process.env.NODE_ENV !== "production" && (ce = (t, e) => {
177
188
  !t && typeof console < "u" && console.warn(e);
178
- }, k = (t, e) => {
189
+ }, $ = (t, e) => {
179
190
  if (!t)
180
191
  throw new Error(e);
181
192
  });
182
- const $t = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), Ut = (t) => (e) => typeof e == "string" && e.startsWith(t), jt = Ut("--"), is = Ut("var(--"), $e = (t) => is(t) ? rs.test(t.split("/*")[0].trim()) : !1, rs = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, os = (
193
+ const Jt = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), en = (t) => (e) => typeof e == "string" && e.startsWith(t), tn = /* @__PURE__ */ en("--"), ps = /* @__PURE__ */ en("var(--"), Ge = (t) => ps(t) ? ms.test(t.split("/*")[0].trim()) : !1, ms = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, gs = (
183
194
  // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
184
195
  /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
185
196
  );
186
- function as(t) {
187
- const e = os.exec(t);
197
+ function ys(t) {
198
+ const e = gs.exec(t);
188
199
  if (!e)
189
200
  return [,];
190
- const [, n, s, i] = e;
191
- return [`--${n ?? s}`, i];
201
+ const [, n, s, r] = e;
202
+ return [`--${n ?? s}`, r];
192
203
  }
193
- const ls = 4;
194
- function Gt(t, e, n = 1) {
195
- k(n <= ls, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
196
- const [s, i] = as(t);
204
+ const vs = 4;
205
+ function nn(t, e, n = 1) {
206
+ $(n <= vs, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
207
+ const [s, r] = ys(t);
197
208
  if (!s)
198
209
  return;
199
- const r = window.getComputedStyle(e).getPropertyValue(s);
200
- if (r) {
201
- const o = r.trim();
202
- return $t(o) ? parseFloat(o) : o;
210
+ const i = window.getComputedStyle(e).getPropertyValue(s);
211
+ if (i) {
212
+ const o = i.trim();
213
+ return Jt(o) ? parseFloat(o) : o;
203
214
  }
204
- return $e(i) ? Gt(i, e, n + 1) : i;
215
+ return Ge(r) ? nn(r, e, n + 1) : r;
205
216
  }
206
- const q = (t, e, n) => n > e ? e : n < t ? t : n, H = {
217
+ const Y = (t, e, n) => n > e ? e : n < t ? t : n, Z = {
207
218
  test: (t) => typeof t == "number",
208
219
  parse: parseFloat,
209
220
  transform: (t) => t
210
- }, te = {
211
- ...H,
212
- transform: (t) => q(0, 1, t)
213
- }, ge = {
214
- ...H,
221
+ }, ie = {
222
+ ...Z,
223
+ transform: (t) => Y(0, 1, t)
224
+ }, me = {
225
+ ...Z,
215
226
  default: 1
216
- }, ne = (t) => Math.round(t * 1e5) / 1e5, Ue = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu, us = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu, cs = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;
217
- function le(t) {
218
- return typeof t == "string";
219
- }
220
- function hs(t) {
221
- return t == null;
222
- }
223
- const ue = (t) => ({
224
- test: (e) => le(e) && e.endsWith(t) && e.split(" ").length === 1,
227
+ }, fe = (t) => ({
228
+ test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
225
229
  parse: parseFloat,
226
230
  transform: (e) => `${e}${t}`
227
- }), K = /* @__PURE__ */ ue("deg"), z = /* @__PURE__ */ ue("%"), p = /* @__PURE__ */ ue("px"), fs = /* @__PURE__ */ ue("vh"), ds = /* @__PURE__ */ ue("vw"), dt = {
228
- ...z,
229
- parse: (t) => z.parse(t) / 100,
230
- transform: (t) => z.transform(t * 100)
231
- }, ps = /* @__PURE__ */ new Set([
231
+ }), B = /* @__PURE__ */ fe("deg"), q = /* @__PURE__ */ fe("%"), d = /* @__PURE__ */ fe("px"), bs = /* @__PURE__ */ fe("vh"), Ts = /* @__PURE__ */ fe("vw"), yt = {
232
+ ...q,
233
+ parse: (t) => q.parse(t) / 100,
234
+ transform: (t) => q.transform(t * 100)
235
+ }, Vs = /* @__PURE__ */ new Set([
232
236
  "width",
233
237
  "height",
234
238
  "top",
@@ -239,25 +243,25 @@ const ue = (t) => ({
239
243
  "y",
240
244
  "translateX",
241
245
  "translateY"
242
- ]), pt = (t) => t === H || t === p, mt = (t, e) => parseFloat(t.split(", ")[e]), gt = (t, e) => (n, { transform: s }) => {
246
+ ]), vt = (t) => t === Z || t === d, bt = (t, e) => parseFloat(t.split(", ")[e]), Tt = (t, e) => (n, { transform: s }) => {
243
247
  if (s === "none" || !s)
244
248
  return 0;
245
- const i = s.match(/^matrix3d\((.+)\)$/u);
246
- if (i)
247
- return mt(i[1], e);
249
+ const r = s.match(/^matrix3d\((.+)\)$/u);
250
+ if (r)
251
+ return bt(r[1], e);
248
252
  {
249
- const r = s.match(/^matrix\((.+)\)$/u);
250
- return r ? mt(r[1], t) : 0;
253
+ const i = s.match(/^matrix\((.+)\)$/u);
254
+ return i ? bt(i[1], t) : 0;
251
255
  }
252
- }, ms = /* @__PURE__ */ new Set(["x", "y", "z"]), gs = oe.filter((t) => !ms.has(t));
253
- function ys(t) {
256
+ }, ws = /* @__PURE__ */ new Set(["x", "y", "z"]), Ss = le.filter((t) => !ws.has(t));
257
+ function xs(t) {
254
258
  const e = [];
255
- return gs.forEach((n) => {
259
+ return Ss.forEach((n) => {
256
260
  const s = t.getValue(n);
257
261
  s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
258
262
  }), e;
259
263
  }
260
- const Y = {
264
+ const H = {
261
265
  // Dimensions
262
266
  width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
263
267
  height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
@@ -266,65 +270,65 @@ const Y = {
266
270
  bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
267
271
  right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
268
272
  // Transform
269
- x: gt(4, 13),
270
- y: gt(5, 14)
273
+ x: Tt(4, 13),
274
+ y: Tt(5, 14)
271
275
  };
272
- Y.translateX = Y.x;
273
- Y.translateY = Y.y;
274
- const zt = (t) => (e) => e.test(t), vs = {
276
+ H.translateX = H.x;
277
+ H.translateY = H.y;
278
+ const sn = (t) => (e) => e.test(t), As = {
275
279
  test: (t) => t === "auto",
276
280
  parse: (t) => t
277
- }, qt = [H, p, z, K, ds, fs, vs], yt = (t) => qt.find(zt(t)), U = /* @__PURE__ */ new Set();
278
- let De = !1, Ne = !1;
279
- function Yt() {
280
- if (Ne) {
281
- const t = Array.from(U).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
281
+ }, rn = [Z, d, q, B, Ts, bs, As], Vt = (t) => rn.find(sn(t)), j = /* @__PURE__ */ new Set();
282
+ let De = !1, Ee = !1;
283
+ function on() {
284
+ if (Ee) {
285
+ const t = Array.from(j).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
282
286
  e.forEach((s) => {
283
- const i = ys(s);
284
- i.length && (n.set(s, i), s.render());
287
+ const r = xs(s);
288
+ r.length && (n.set(s, r), s.render());
285
289
  }), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
286
290
  s.render();
287
- const i = n.get(s);
288
- i && i.forEach(([r, o]) => {
289
- var l;
290
- (l = s.getValue(r)) === null || l === void 0 || l.set(o);
291
+ const r = n.get(s);
292
+ r && r.forEach(([i, o]) => {
293
+ var a;
294
+ (a = s.getValue(i)) === null || a === void 0 || a.set(o);
291
295
  });
292
296
  }), t.forEach((s) => s.measureEndState()), t.forEach((s) => {
293
297
  s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
294
298
  });
295
299
  }
296
- Ne = !1, De = !1, U.forEach((t) => t.complete()), U.clear();
300
+ Ee = !1, De = !1, j.forEach((t) => t.complete()), j.clear();
297
301
  }
298
- function Ht() {
299
- U.forEach((t) => {
300
- t.readKeyframes(), t.needsMeasurement && (Ne = !0);
302
+ function an() {
303
+ j.forEach((t) => {
304
+ t.readKeyframes(), t.needsMeasurement && (Ee = !0);
301
305
  });
302
306
  }
303
- function bs() {
304
- Ht(), Yt();
307
+ function Ms() {
308
+ an(), on();
305
309
  }
306
- class je {
307
- constructor(e, n, s, i, r, o = !1) {
308
- this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = o;
310
+ class ze {
311
+ constructor(e, n, s, r, i, o = !1) {
312
+ this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = r, this.element = i, this.isAsync = o;
309
313
  }
310
314
  scheduleResolve() {
311
- this.isScheduled = !0, this.isAsync ? (U.add(this), De || (De = !0, _.read(Ht), _.resolveKeyframes(Yt))) : (this.readKeyframes(), this.complete());
315
+ this.isScheduled = !0, this.isAsync ? (j.add(this), De || (De = !0, _.read(an), _.resolveKeyframes(on))) : (this.readKeyframes(), this.complete());
312
316
  }
313
317
  readKeyframes() {
314
- const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
315
- for (let r = 0; r < e.length; r++)
316
- if (e[r] === null)
317
- if (r === 0) {
318
- const o = i == null ? void 0 : i.get(), l = e[e.length - 1];
318
+ const { unresolvedKeyframes: e, name: n, element: s, motionValue: r } = this;
319
+ for (let i = 0; i < e.length; i++)
320
+ if (e[i] === null)
321
+ if (i === 0) {
322
+ const o = r == null ? void 0 : r.get(), a = e[e.length - 1];
319
323
  if (o !== void 0)
320
324
  e[0] = o;
321
325
  else if (s && n) {
322
- const a = s.readValue(n, l);
323
- a != null && (e[0] = a);
326
+ const l = s.readValue(n, a);
327
+ l != null && (e[0] = l);
324
328
  }
325
- e[0] === void 0 && (e[0] = l), i && o === void 0 && i.set(e[0]);
329
+ e[0] === void 0 && (e[0] = a), r && o === void 0 && r.set(e[0]);
326
330
  } else
327
- e[r] = e[r - 1];
331
+ e[i] = e[i - 1];
328
332
  }
329
333
  setFinalKeyframe() {
330
334
  }
@@ -335,185 +339,192 @@ class je {
335
339
  measureEndState() {
336
340
  }
337
341
  complete() {
338
- this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), U.delete(this);
342
+ this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), j.delete(this);
339
343
  }
340
344
  cancel() {
341
- this.isComplete || (this.isScheduled = !1, U.delete(this));
345
+ this.isComplete || (this.isScheduled = !1, j.delete(this));
342
346
  }
343
347
  resume() {
344
348
  this.isComplete || this.scheduleResolve();
345
349
  }
346
350
  }
347
- const Ge = (t, e) => (n) => !!(le(n) && cs.test(n) && n.startsWith(t) || e && !hs(n) && Object.prototype.hasOwnProperty.call(n, e)), Xt = (t, e, n) => (s) => {
348
- if (!le(s))
351
+ const re = (t) => Math.round(t * 1e5) / 1e5, qe = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
352
+ function Cs(t) {
353
+ return t == null;
354
+ }
355
+ const Fs = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, Ye = (t, e) => (n) => !!(typeof n == "string" && Fs.test(n) && n.startsWith(t) || e && !Cs(n) && Object.prototype.hasOwnProperty.call(n, e)), ln = (t, e, n) => (s) => {
356
+ if (typeof s != "string")
349
357
  return s;
350
- const [i, r, o, l] = s.match(Ue);
358
+ const [r, i, o, a] = s.match(qe);
351
359
  return {
352
- [t]: parseFloat(i),
353
- [e]: parseFloat(r),
360
+ [t]: parseFloat(r),
361
+ [e]: parseFloat(i),
354
362
  [n]: parseFloat(o),
355
- alpha: l !== void 0 ? parseFloat(l) : 1
363
+ alpha: a !== void 0 ? parseFloat(a) : 1
356
364
  };
357
- }, Ts = (t) => q(0, 255, t), Ce = {
358
- ...H,
359
- transform: (t) => Math.round(Ts(t))
360
- }, $ = {
361
- test: /* @__PURE__ */ Ge("rgb", "red"),
362
- parse: /* @__PURE__ */ Xt("red", "green", "blue"),
363
- transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Ce.transform(t) + ", " + Ce.transform(e) + ", " + Ce.transform(n) + ", " + ne(te.transform(s)) + ")"
365
+ }, Ps = (t) => Y(0, 255, t), Ce = {
366
+ ...Z,
367
+ transform: (t) => Math.round(Ps(t))
368
+ }, U = {
369
+ test: /* @__PURE__ */ Ye("rgb", "red"),
370
+ parse: /* @__PURE__ */ ln("red", "green", "blue"),
371
+ transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Ce.transform(t) + ", " + Ce.transform(e) + ", " + Ce.transform(n) + ", " + re(ie.transform(s)) + ")"
364
372
  };
365
- function Vs(t) {
366
- let e = "", n = "", s = "", i = "";
367
- return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), {
373
+ function Os(t) {
374
+ let e = "", n = "", s = "", r = "";
375
+ return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), r = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), r = t.substring(4, 5), e += e, n += n, s += s, r += r), {
368
376
  red: parseInt(e, 16),
369
377
  green: parseInt(n, 16),
370
378
  blue: parseInt(s, 16),
371
- alpha: i ? parseInt(i, 16) / 255 : 1
379
+ alpha: r ? parseInt(r, 16) / 255 : 1
372
380
  };
373
381
  }
374
- const Oe = {
375
- test: /* @__PURE__ */ Ge("#"),
376
- parse: Vs,
377
- transform: $.transform
378
- }, G = {
379
- test: /* @__PURE__ */ Ge("hsl", "hue"),
380
- parse: /* @__PURE__ */ Xt("hue", "saturation", "lightness"),
381
- transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + z.transform(ne(e)) + ", " + z.transform(ne(n)) + ", " + ne(te.transform(s)) + ")"
382
+ const Ne = {
383
+ test: /* @__PURE__ */ Ye("#"),
384
+ parse: Os,
385
+ transform: U.transform
386
+ }, z = {
387
+ test: /* @__PURE__ */ Ye("hsl", "hue"),
388
+ parse: /* @__PURE__ */ ln("hue", "saturation", "lightness"),
389
+ transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + q.transform(re(e)) + ", " + q.transform(re(n)) + ", " + re(ie.transform(s)) + ")"
382
390
  }, C = {
383
- test: (t) => $.test(t) || Oe.test(t) || G.test(t),
384
- parse: (t) => $.test(t) ? $.parse(t) : G.test(t) ? G.parse(t) : Oe.parse(t),
385
- transform: (t) => le(t) ? t : t.hasOwnProperty("red") ? $.transform(t) : G.transform(t)
386
- };
387
- function ws(t) {
391
+ test: (t) => U.test(t) || Ne.test(t) || z.test(t),
392
+ parse: (t) => U.test(t) ? U.parse(t) : z.test(t) ? z.parse(t) : Ne.parse(t),
393
+ transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? U.transform(t) : z.transform(t)
394
+ }, Rs = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
395
+ function Ds(t) {
388
396
  var e, n;
389
- return isNaN(t) && le(t) && (((e = t.match(Ue)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(us)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
397
+ return isNaN(t) && typeof t == "string" && (((e = t.match(qe)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(Rs)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
390
398
  }
391
- const Zt = "number", Qt = "color", Ss = "var", xs = "var(", vt = "${}", As = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
392
- function se(t) {
399
+ const un = "number", cn = "color", Es = "var", Ns = "var(", wt = "${}", Is = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
400
+ function oe(t) {
393
401
  const e = t.toString(), n = [], s = {
394
402
  color: [],
395
403
  number: [],
396
404
  var: []
397
- }, i = [];
398
- let r = 0;
399
- const l = e.replace(As, (a) => (C.test(a) ? (s.color.push(r), i.push(Qt), n.push(C.parse(a))) : a.startsWith(xs) ? (s.var.push(r), i.push(Ss), n.push(a)) : (s.number.push(r), i.push(Zt), n.push(parseFloat(a))), ++r, vt)).split(vt);
400
- return { values: n, split: l, indexes: s, types: i };
405
+ }, r = [];
406
+ let i = 0;
407
+ const a = e.replace(Is, (l) => (C.test(l) ? (s.color.push(i), r.push(cn), n.push(C.parse(l))) : l.startsWith(Ns) ? (s.var.push(i), r.push(Es), n.push(l)) : (s.number.push(i), r.push(un), n.push(parseFloat(l))), ++i, wt)).split(wt);
408
+ return { values: n, split: a, indexes: s, types: r };
401
409
  }
402
- function Jt(t) {
403
- return se(t).values;
410
+ function fn(t) {
411
+ return oe(t).values;
404
412
  }
405
- function en(t) {
406
- const { split: e, types: n } = se(t), s = e.length;
407
- return (i) => {
408
- let r = "";
413
+ function hn(t) {
414
+ const { split: e, types: n } = oe(t), s = e.length;
415
+ return (r) => {
416
+ let i = "";
409
417
  for (let o = 0; o < s; o++)
410
- if (r += e[o], i[o] !== void 0) {
411
- const l = n[o];
412
- l === Zt ? r += ne(i[o]) : l === Qt ? r += C.transform(i[o]) : r += i[o];
418
+ if (i += e[o], r[o] !== void 0) {
419
+ const a = n[o];
420
+ a === un ? i += re(r[o]) : a === cn ? i += C.transform(r[o]) : i += r[o];
413
421
  }
414
- return r;
422
+ return i;
415
423
  };
416
424
  }
417
- const Ms = (t) => typeof t == "number" ? 0 : t;
418
- function Cs(t) {
419
- const e = Jt(t);
420
- return en(t)(e.map(Ms));
421
- }
422
- const X = {
423
- test: ws,
424
- parse: Jt,
425
- createTransformer: en,
426
- getAnimatableNone: Cs
427
- }, Fs = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
428
- function Ps(t) {
425
+ const _s = (t) => typeof t == "number" ? 0 : t;
426
+ function Ks(t) {
427
+ const e = fn(t);
428
+ return hn(t)(e.map(_s));
429
+ }
430
+ const Q = {
431
+ test: Ds,
432
+ parse: fn,
433
+ createTransformer: hn,
434
+ getAnimatableNone: Ks
435
+ }, Bs = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
436
+ function ks(t) {
429
437
  const [e, n] = t.slice(0, -1).split("(");
430
438
  if (e === "drop-shadow")
431
439
  return t;
432
- const [s] = n.match(Ue) || [];
440
+ const [s] = n.match(qe) || [];
433
441
  if (!s)
434
442
  return t;
435
- const i = n.replace(s, "");
436
- let r = Fs.has(e) ? 1 : 0;
437
- return s !== n && (r *= 100), e + "(" + r + i + ")";
443
+ const r = n.replace(s, "");
444
+ let i = Bs.has(e) ? 1 : 0;
445
+ return s !== n && (i *= 100), e + "(" + i + r + ")";
438
446
  }
439
- const Rs = /\b([a-z-]*)\(.*?\)/gu, _e = {
440
- ...X,
447
+ const Ls = /\b([a-z-]*)\(.*?\)/gu, Ie = {
448
+ ...Q,
441
449
  getAnimatableNone: (t) => {
442
- const e = t.match(Rs);
443
- return e ? e.map(Ps).join(" ") : t;
450
+ const e = t.match(Ls);
451
+ return e ? e.map(ks).join(" ") : t;
444
452
  }
445
- }, bt = {
446
- ...H,
447
- transform: Math.round
448
- }, ze = {
453
+ }, $s = {
449
454
  // Border props
450
- borderWidth: p,
451
- borderTopWidth: p,
452
- borderRightWidth: p,
453
- borderBottomWidth: p,
454
- borderLeftWidth: p,
455
- borderRadius: p,
456
- radius: p,
457
- borderTopLeftRadius: p,
458
- borderTopRightRadius: p,
459
- borderBottomRightRadius: p,
460
- borderBottomLeftRadius: p,
455
+ borderWidth: d,
456
+ borderTopWidth: d,
457
+ borderRightWidth: d,
458
+ borderBottomWidth: d,
459
+ borderLeftWidth: d,
460
+ borderRadius: d,
461
+ radius: d,
462
+ borderTopLeftRadius: d,
463
+ borderTopRightRadius: d,
464
+ borderBottomRightRadius: d,
465
+ borderBottomLeftRadius: d,
461
466
  // Positioning props
462
- width: p,
463
- maxWidth: p,
464
- height: p,
465
- maxHeight: p,
466
- size: p,
467
- top: p,
468
- right: p,
469
- bottom: p,
470
- left: p,
467
+ width: d,
468
+ maxWidth: d,
469
+ height: d,
470
+ maxHeight: d,
471
+ top: d,
472
+ right: d,
473
+ bottom: d,
474
+ left: d,
471
475
  // Spacing props
472
- padding: p,
473
- paddingTop: p,
474
- paddingRight: p,
475
- paddingBottom: p,
476
- paddingLeft: p,
477
- margin: p,
478
- marginTop: p,
479
- marginRight: p,
480
- marginBottom: p,
481
- marginLeft: p,
482
- // Transform props
483
- rotate: K,
484
- rotateX: K,
485
- rotateY: K,
486
- rotateZ: K,
487
- scale: ge,
488
- scaleX: ge,
489
- scaleY: ge,
490
- scaleZ: ge,
491
- skew: K,
492
- skewX: K,
493
- skewY: K,
494
- distance: p,
495
- translateX: p,
496
- translateY: p,
497
- translateZ: p,
498
- x: p,
499
- y: p,
500
- z: p,
501
- perspective: p,
502
- transformPerspective: p,
503
- opacity: te,
504
- originX: dt,
505
- originY: dt,
506
- originZ: p,
476
+ padding: d,
477
+ paddingTop: d,
478
+ paddingRight: d,
479
+ paddingBottom: d,
480
+ paddingLeft: d,
481
+ margin: d,
482
+ marginTop: d,
483
+ marginRight: d,
484
+ marginBottom: d,
485
+ marginLeft: d,
507
486
  // Misc
508
- zIndex: bt,
509
- backgroundPositionX: p,
510
- backgroundPositionY: p,
487
+ backgroundPositionX: d,
488
+ backgroundPositionY: d
489
+ }, Ws = {
490
+ rotate: B,
491
+ rotateX: B,
492
+ rotateY: B,
493
+ rotateZ: B,
494
+ scale: me,
495
+ scaleX: me,
496
+ scaleY: me,
497
+ scaleZ: me,
498
+ skew: B,
499
+ skewX: B,
500
+ skewY: B,
501
+ distance: d,
502
+ translateX: d,
503
+ translateY: d,
504
+ translateZ: d,
505
+ x: d,
506
+ y: d,
507
+ z: d,
508
+ perspective: d,
509
+ transformPerspective: d,
510
+ opacity: ie,
511
+ originX: yt,
512
+ originY: yt,
513
+ originZ: d
514
+ }, St = {
515
+ ...Z,
516
+ transform: Math.round
517
+ }, He = {
518
+ ...$s,
519
+ ...Ws,
520
+ zIndex: St,
521
+ size: d,
511
522
  // SVG
512
- fillOpacity: te,
513
- strokeOpacity: te,
514
- numOctaves: bt
515
- }, Ds = {
516
- ...ze,
523
+ fillOpacity: ie,
524
+ strokeOpacity: ie,
525
+ numOctaves: St
526
+ }, Us = {
527
+ ...He,
517
528
  // Color props
518
529
  color: C,
519
530
  backgroundColor: C,
@@ -526,96 +537,95 @@ const Rs = /\b([a-z-]*)\(.*?\)/gu, _e = {
526
537
  borderRightColor: C,
527
538
  borderBottomColor: C,
528
539
  borderLeftColor: C,
529
- filter: _e,
530
- WebkitFilter: _e
531
- }, qe = (t) => Ds[t];
532
- function tn(t, e) {
533
- let n = qe(t);
534
- return n !== _e && (n = X), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
535
- }
536
- const Ns = /* @__PURE__ */ new Set(["auto", "none", "0"]);
537
- function Os(t, e, n) {
538
- let s = 0, i;
539
- for (; s < t.length && !i; ) {
540
- const r = t[s];
541
- typeof r == "string" && !Ns.has(r) && se(r).values.length && (i = t[s]), s++;
540
+ filter: Ie,
541
+ WebkitFilter: Ie
542
+ }, Xe = (t) => Us[t];
543
+ function dn(t, e) {
544
+ let n = Xe(t);
545
+ return n !== Ie && (n = Q), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
546
+ }
547
+ const js = /* @__PURE__ */ new Set(["auto", "none", "0"]);
548
+ function Gs(t, e, n) {
549
+ let s = 0, r;
550
+ for (; s < t.length && !r; ) {
551
+ const i = t[s];
552
+ typeof i == "string" && !js.has(i) && oe(i).values.length && (r = t[s]), s++;
542
553
  }
543
- if (i && n)
544
- for (const r of e)
545
- t[r] = tn(n, i);
554
+ if (r && n)
555
+ for (const i of e)
556
+ t[i] = dn(n, r);
546
557
  }
547
- class nn extends je {
548
- constructor(e, n, s, i, r) {
549
- super(e, n, s, i, r, !0);
558
+ class pn extends ze {
559
+ constructor(e, n, s, r, i) {
560
+ super(e, n, s, r, i, !0);
550
561
  }
551
562
  readKeyframes() {
552
563
  const { unresolvedKeyframes: e, element: n, name: s } = this;
553
564
  if (!n || !n.current)
554
565
  return;
555
566
  super.readKeyframes();
556
- for (let a = 0; a < e.length; a++) {
557
- let u = e[a];
558
- if (typeof u == "string" && (u = u.trim(), $e(u))) {
559
- const c = Gt(u, n.current);
560
- c !== void 0 && (e[a] = c), a === e.length - 1 && (this.finalKeyframe = u);
567
+ for (let l = 0; l < e.length; l++) {
568
+ let u = e[l];
569
+ if (typeof u == "string" && (u = u.trim(), Ge(u))) {
570
+ const c = nn(u, n.current);
571
+ c !== void 0 && (e[l] = c), l === e.length - 1 && (this.finalKeyframe = u);
561
572
  }
562
573
  }
563
- if (this.resolveNoneKeyframes(), !ps.has(s) || e.length !== 2)
574
+ if (this.resolveNoneKeyframes(), !Vs.has(s) || e.length !== 2)
564
575
  return;
565
- const [i, r] = e, o = yt(i), l = yt(r);
566
- if (o !== l)
567
- if (pt(o) && pt(l))
568
- for (let a = 0; a < e.length; a++) {
569
- const u = e[a];
570
- typeof u == "string" && (e[a] = parseFloat(u));
576
+ const [r, i] = e, o = Vt(r), a = Vt(i);
577
+ if (o !== a)
578
+ if (vt(o) && vt(a))
579
+ for (let l = 0; l < e.length; l++) {
580
+ const u = e[l];
581
+ typeof u == "string" && (e[l] = parseFloat(u));
571
582
  }
572
583
  else
573
584
  this.needsMeasurement = !0;
574
585
  }
575
586
  resolveNoneKeyframes() {
576
587
  const { unresolvedKeyframes: e, name: n } = this, s = [];
577
- for (let i = 0; i < e.length; i++)
578
- ss(e[i]) && s.push(i);
579
- s.length && Os(e, s, n);
588
+ for (let r = 0; r < e.length; r++)
589
+ ds(e[r]) && s.push(r);
590
+ s.length && Gs(e, s, n);
580
591
  }
581
592
  measureInitialState() {
582
593
  const { element: e, unresolvedKeyframes: n, name: s } = this;
583
594
  if (!e || !e.current)
584
595
  return;
585
- s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Y[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
586
- const i = n[n.length - 1];
587
- i !== void 0 && e.getValue(s, i).jump(i, !1);
596
+ s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = H[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
597
+ const r = n[n.length - 1];
598
+ r !== void 0 && e.getValue(s, r).jump(r, !1);
588
599
  }
589
600
  measureEndState() {
590
601
  var e;
591
- const { element: n, name: s, unresolvedKeyframes: i } = this;
602
+ const { element: n, name: s, unresolvedKeyframes: r } = this;
592
603
  if (!n || !n.current)
593
604
  return;
594
- const r = n.getValue(s);
595
- r && r.jump(this.measuredOrigin, !1);
596
- const o = i.length - 1, l = i[o];
597
- i[o] = Y[s](n.measureViewportBox(), window.getComputedStyle(n.current)), l !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = l), !((e = this.removedTransforms) === null || e === void 0) && e.length && this.removedTransforms.forEach(([a, u]) => {
598
- n.getValue(a).set(u);
605
+ const i = n.getValue(s);
606
+ i && i.jump(this.measuredOrigin, !1);
607
+ const o = r.length - 1, a = r[o];
608
+ r[o] = H[s](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, u]) => {
609
+ n.getValue(l).set(u);
599
610
  }), this.resolveNoneKeyframes();
600
611
  }
601
612
  }
602
- function sn(t) {
603
- let e;
604
- return () => (e === void 0 && (e = t()), e);
613
+ function xe(t) {
614
+ return typeof t == "function";
605
615
  }
606
- let ve;
607
- function _s() {
608
- ve = void 0;
616
+ let ye;
617
+ function zs() {
618
+ ye = void 0;
609
619
  }
610
- const j = {
611
- now: () => (ve === void 0 && j.set(Te.isProcessing || Qn.useManualTiming ? Te.timestamp : performance.now()), ve),
620
+ const k = {
621
+ now: () => (ye === void 0 && k.set(ve.isProcessing || rs.useManualTiming ? ve.timestamp : performance.now()), ye),
612
622
  set: (t) => {
613
- ve = t, queueMicrotask(_s);
623
+ ye = t, queueMicrotask(zs);
614
624
  }
615
- }, Tt = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
616
- (X.test(t) || t === "0") && // And it contains numbers and/or colors
625
+ }, xt = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
626
+ (Q.test(t) || t === "0") && // And it contains numbers and/or colors
617
627
  !t.startsWith("url("));
618
- function Is(t) {
628
+ function qs(t) {
619
629
  const e = t[0];
620
630
  if (t.length === 1)
621
631
  return !0;
@@ -623,26 +633,26 @@ function Is(t) {
623
633
  if (t[n] !== e)
624
634
  return !0;
625
635
  }
626
- function Es(t, e, n, s) {
627
- const i = t[0];
628
- if (i === null)
636
+ function Ys(t, e, n, s) {
637
+ const r = t[0];
638
+ if (r === null)
629
639
  return !1;
630
640
  if (e === "display" || e === "visibility")
631
641
  return !0;
632
- const r = t[t.length - 1], o = Tt(i, e), l = Tt(r, e);
633
- return ae(o === l, `You are trying to animate ${e} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`), !o || !l ? !1 : Is(t) || n === "spring" && s;
642
+ const i = t[t.length - 1], o = xt(r, e), a = xt(i, e);
643
+ return ce(o === a, `You are trying to animate ${e} from "${r}" to "${i}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${i} via the \`style\` property.`), !o || !a ? !1 : qs(t) || (n === "spring" || xe(n)) && s;
634
644
  }
635
- const Ks = 40;
636
- class rn {
637
- constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", ...l }) {
638
- this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = j.now(), this.options = {
645
+ const Hs = 40;
646
+ class mn {
647
+ constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: r = 0, repeatDelay: i = 0, repeatType: o = "loop", ...a }) {
648
+ this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = k.now(), this.options = {
639
649
  autoplay: e,
640
650
  delay: n,
641
651
  type: s,
642
- repeat: i,
643
- repeatDelay: r,
652
+ repeat: r,
653
+ repeatDelay: i,
644
654
  repeatType: o,
645
- ...l
655
+ ...a
646
656
  }, this.updateFinishedPromise();
647
657
  }
648
658
  /**
@@ -656,7 +666,7 @@ class rn {
656
666
  * to avoid a sudden jump into the animation.
657
667
  */
658
668
  calcStartTime() {
659
- return this.resolvedAt ? this.resolvedAt - this.createdAt > Ks ? this.resolvedAt : this.createdAt : this.createdAt;
669
+ return this.resolvedAt ? this.resolvedAt - this.createdAt > Hs ? this.resolvedAt : this.createdAt : this.createdAt;
660
670
  }
661
671
  /**
662
672
  * A getter for resolved data. If keyframes are not yet resolved, accessing
@@ -664,7 +674,7 @@ class rn {
664
674
  * This is a deoptimisation, but at its worst still batches read/writes.
665
675
  */
666
676
  get resolved() {
667
- return !this._resolved && !this.hasAttemptedResolve && bs(), this._resolved;
677
+ return !this._resolved && !this.hasAttemptedResolve && Ms(), this._resolved;
668
678
  }
669
679
  /**
670
680
  * A method to be called when the keyframes resolver completes. This method
@@ -672,13 +682,13 @@ class rn {
672
682
  * Otherwise, it will call initPlayback on the implementing class.
673
683
  */
674
684
  onKeyframesResolved(e, n) {
675
- this.resolvedAt = j.now(), this.hasAttemptedResolve = !0;
676
- const { name: s, type: i, velocity: r, delay: o, onComplete: l, onUpdate: a, isGenerator: u } = this.options;
677
- if (!u && !Es(e, s, i, r))
685
+ this.resolvedAt = k.now(), this.hasAttemptedResolve = !0;
686
+ const { name: s, type: r, velocity: i, delay: o, onComplete: a, onUpdate: l, isGenerator: u } = this.options;
687
+ if (!u && !Ys(e, s, r, i))
678
688
  if (o)
679
689
  this.options.duration = 0;
680
690
  else {
681
- a == null || a(xe(e, this.options, n)), l == null || l(), this.resolveFinishedPromise();
691
+ l == null || l(Se(e, this.options, n)), a == null || a(), this.resolveFinishedPromise();
682
692
  return;
683
693
  }
684
694
  const c = this.initPlayback(e, n);
@@ -704,41 +714,41 @@ class rn {
704
714
  });
705
715
  }
706
716
  }
707
- function on(t, e) {
717
+ function gn(t, e) {
708
718
  return e ? t * (1e3 / e) : 0;
709
719
  }
710
- const Bs = 5;
711
- function an(t, e, n) {
712
- const s = Math.max(e - Bs, 0);
713
- return on(n - t(s), e - s);
720
+ const Xs = 5;
721
+ function yn(t, e, n) {
722
+ const s = Math.max(e - Xs, 0);
723
+ return gn(n - t(s), e - s);
714
724
  }
715
- const Fe = 1e-3, ks = 0.01, Vt = 10, Ls = 0.05, Ws = 1;
716
- function $s({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: s = 1 }) {
717
- let i, r;
718
- ae(t <= O(Vt), "Spring duration must be 10 seconds or less");
725
+ const Fe = 1e-3, Zs = 0.01, At = 10, Qs = 0.05, Js = 1;
726
+ function er({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: s = 1 }) {
727
+ let r, i;
728
+ ce(t <= E(At), "Spring duration must be 10 seconds or less");
719
729
  let o = 1 - e;
720
- o = q(Ls, Ws, o), t = q(ks, Vt, I(t)), o < 1 ? (i = (u) => {
721
- const c = u * o, h = c * t, f = c - n, d = Ie(u, o), y = Math.exp(-h);
722
- return Fe - f / d * y;
723
- }, r = (u) => {
724
- const h = u * o * t, f = h * n + n, d = Math.pow(o, 2) * Math.pow(u, 2) * t, y = Math.exp(-h), v = Ie(Math.pow(u, 2), o);
725
- return (-i(u) + Fe > 0 ? -1 : 1) * ((f - d) * y) / v;
726
- }) : (i = (u) => {
727
- const c = Math.exp(-u * t), h = (u - n) * t + 1;
728
- return -Fe + c * h;
729
- }, r = (u) => {
730
- const c = Math.exp(-u * t), h = (n - u) * (t * t);
731
- return c * h;
730
+ o = Y(Qs, Js, o), t = Y(Zs, At, I(t)), o < 1 ? (r = (u) => {
731
+ const c = u * o, f = c * t, h = c - n, g = _e(u, o), p = Math.exp(-f);
732
+ return Fe - h / g * p;
733
+ }, i = (u) => {
734
+ const f = u * o * t, h = f * n + n, g = Math.pow(o, 2) * Math.pow(u, 2) * t, p = Math.exp(-f), b = _e(Math.pow(u, 2), o);
735
+ return (-r(u) + Fe > 0 ? -1 : 1) * ((h - g) * p) / b;
736
+ }) : (r = (u) => {
737
+ const c = Math.exp(-u * t), f = (u - n) * t + 1;
738
+ return -Fe + c * f;
739
+ }, i = (u) => {
740
+ const c = Math.exp(-u * t), f = (n - u) * (t * t);
741
+ return c * f;
732
742
  });
733
- const l = 5 / t, a = js(i, r, l);
734
- if (t = O(t), isNaN(a))
743
+ const a = 5 / t, l = nr(r, i, a);
744
+ if (t = E(t), isNaN(l))
735
745
  return {
736
746
  stiffness: 100,
737
747
  damping: 10,
738
748
  duration: t
739
749
  };
740
750
  {
741
- const u = Math.pow(a, 2) * s;
751
+ const u = Math.pow(l, 2) * s;
742
752
  return {
743
753
  stiffness: u,
744
754
  damping: o * 2 * Math.sqrt(s * u),
@@ -746,21 +756,21 @@ function $s({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: s = 1
746
756
  };
747
757
  }
748
758
  }
749
- const Us = 12;
750
- function js(t, e, n) {
759
+ const tr = 12;
760
+ function nr(t, e, n) {
751
761
  let s = n;
752
- for (let i = 1; i < Us; i++)
762
+ for (let r = 1; r < tr; r++)
753
763
  s = s - t(s) / e(s);
754
764
  return s;
755
765
  }
756
- function Ie(t, e) {
766
+ function _e(t, e) {
757
767
  return t * Math.sqrt(1 - e * e);
758
768
  }
759
- const Gs = ["duration", "bounce"], zs = ["stiffness", "damping", "mass"];
760
- function wt(t, e) {
769
+ const sr = ["duration", "bounce"], rr = ["stiffness", "damping", "mass"];
770
+ function Mt(t, e) {
761
771
  return e.some((n) => t[n] !== void 0);
762
772
  }
763
- function qs(t) {
773
+ function ir(t) {
764
774
  let e = {
765
775
  velocity: 0,
766
776
  stiffness: 100,
@@ -769,8 +779,8 @@ function qs(t) {
769
779
  isResolvedFromDuration: !1,
770
780
  ...t
771
781
  };
772
- if (!wt(t, zs) && wt(t, Gs)) {
773
- const n = $s(t);
782
+ if (!Mt(t, rr) && Mt(t, sr)) {
783
+ const n = er(t);
774
784
  e = {
775
785
  ...e,
776
786
  ...n,
@@ -779,317 +789,303 @@ function qs(t) {
779
789
  }
780
790
  return e;
781
791
  }
782
- function Ye({ keyframes: t, restDelta: e, restSpeed: n, ...s }) {
783
- const i = t[0], r = t[t.length - 1], o = { done: !1, value: i }, { stiffness: l, damping: a, mass: u, duration: c, velocity: h, isResolvedFromDuration: f } = qs({
792
+ function Ze({ keyframes: t, restDelta: e, restSpeed: n, ...s }) {
793
+ const r = t[0], i = t[t.length - 1], o = { done: !1, value: r }, { stiffness: a, damping: l, mass: u, duration: c, velocity: f, isResolvedFromDuration: h } = ir({
784
794
  ...s,
785
795
  velocity: -I(s.velocity || 0)
786
- }), d = h || 0, y = a / (2 * Math.sqrt(l * u)), v = r - i, b = I(Math.sqrt(l / u)), m = Math.abs(v) < 5;
796
+ }), g = f || 0, p = l / (2 * Math.sqrt(a * u)), b = i - r, T = I(Math.sqrt(a / u)), m = Math.abs(b) < 5;
787
797
  n || (n = m ? 0.01 : 2), e || (e = m ? 5e-3 : 0.5);
788
- let S;
789
- if (y < 1) {
790
- const V = Ie(b, y);
791
- S = (w) => {
792
- const T = Math.exp(-y * b * w);
793
- return r - T * ((d + y * b * v) / V * Math.sin(V * w) + v * Math.cos(V * w));
798
+ let y;
799
+ if (p < 1) {
800
+ const S = _e(T, p);
801
+ y = (w) => {
802
+ const v = Math.exp(-p * T * w);
803
+ return i - v * ((g + p * T * b) / S * Math.sin(S * w) + b * Math.cos(S * w));
794
804
  };
795
- } else if (y === 1)
796
- S = (V) => r - Math.exp(-b * V) * (v + (d + b * v) * V);
805
+ } else if (p === 1)
806
+ y = (S) => i - Math.exp(-T * S) * (b + (g + T * b) * S);
797
807
  else {
798
- const V = b * Math.sqrt(y * y - 1);
799
- S = (w) => {
800
- const T = Math.exp(-y * b * w), x = Math.min(V * w, 300);
801
- return r - T * ((d + y * b * v) * Math.sinh(x) + V * v * Math.cosh(x)) / V;
808
+ const S = T * Math.sqrt(p * p - 1);
809
+ y = (w) => {
810
+ const v = Math.exp(-p * T * w), x = Math.min(S * w, 300);
811
+ return i - v * ((g + p * T * b) * Math.sinh(x) + S * b * Math.cosh(x)) / S;
802
812
  };
803
813
  }
804
814
  return {
805
- calculatedDuration: f && c || null,
806
- next: (V) => {
807
- const w = S(V);
808
- if (f)
809
- o.done = V >= c;
815
+ calculatedDuration: h && c || null,
816
+ next: (S) => {
817
+ const w = y(S);
818
+ if (h)
819
+ o.done = S >= c;
810
820
  else {
811
- let T = 0;
812
- y < 1 && (T = V === 0 ? O(d) : an(S, V, w));
813
- const x = Math.abs(T) <= n, F = Math.abs(r - w) <= e;
821
+ let v = 0;
822
+ p < 1 && (v = S === 0 ? E(g) : yn(y, S, w));
823
+ const x = Math.abs(v) <= n, F = Math.abs(i - w) <= e;
814
824
  o.done = x && F;
815
825
  }
816
- return o.value = o.done ? r : w, o;
826
+ return o.value = o.done ? i : w, o;
817
827
  }
818
828
  };
819
829
  }
820
- function St({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: l, max: a, restDelta: u = 0.5, restSpeed: c }) {
821
- const h = t[0], f = {
830
+ function Ct({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: r = 10, bounceStiffness: i = 500, modifyTarget: o, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
831
+ const f = t[0], h = {
822
832
  done: !1,
823
- value: h
824
- }, d = (g) => l !== void 0 && g < l || a !== void 0 && g > a, y = (g) => l === void 0 ? a : a === void 0 || Math.abs(l - g) < Math.abs(a - g) ? l : a;
825
- let v = n * e;
826
- const b = h + v, m = o === void 0 ? b : o(b);
827
- m !== b && (v = m - h);
828
- const S = (g) => -v * Math.exp(-g / s), V = (g) => m + S(g), w = (g) => {
829
- const P = S(g), A = V(g);
830
- f.done = Math.abs(P) <= u, f.value = f.done ? m : A;
833
+ value: f
834
+ }, g = (V) => a !== void 0 && V < a || l !== void 0 && V > l, p = (V) => a === void 0 ? l : l === void 0 || Math.abs(a - V) < Math.abs(l - V) ? a : l;
835
+ let b = n * e;
836
+ const T = f + b, m = o === void 0 ? T : o(T);
837
+ m !== T && (b = m - f);
838
+ const y = (V) => -b * Math.exp(-V / s), S = (V) => m + y(V), w = (V) => {
839
+ const A = y(V), P = S(V);
840
+ h.done = Math.abs(A) <= u, h.value = h.done ? m : P;
831
841
  };
832
- let T, x;
833
- const F = (g) => {
834
- d(f.value) && (T = g, x = Ye({
835
- keyframes: [f.value, y(f.value)],
836
- velocity: an(V, g, f.value),
842
+ let v, x;
843
+ const F = (V) => {
844
+ g(h.value) && (v = V, x = Ze({
845
+ keyframes: [h.value, p(h.value)],
846
+ velocity: yn(S, V, h.value),
837
847
  // TODO: This should be passing * 1000
838
- damping: i,
839
- stiffness: r,
848
+ damping: r,
849
+ stiffness: i,
840
850
  restDelta: u,
841
851
  restSpeed: c
842
852
  }));
843
853
  };
844
854
  return F(0), {
845
855
  calculatedDuration: null,
846
- next: (g) => {
847
- let P = !1;
848
- return !x && T === void 0 && (P = !0, w(g), F(g)), T !== void 0 && g >= T ? x.next(g - T) : (!P && w(g), f);
856
+ next: (V) => {
857
+ let A = !1;
858
+ return !x && v === void 0 && (A = !0, w(V), F(V)), v !== void 0 && V >= v ? x.next(V - v) : (!A && w(V), h);
849
859
  }
850
860
  };
851
861
  }
852
- const ln = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, Ys = 1e-7, Hs = 12;
853
- function Xs(t, e, n, s, i) {
854
- let r, o, l = 0;
855
- do
856
- o = e + (n - e) / 2, r = ln(o, s, i) - t, r > 0 ? n = o : e = o;
857
- while (Math.abs(r) > Ys && ++l < Hs);
858
- return o;
859
- }
860
- function ce(t, e, n, s) {
861
- if (t === e && n === s)
862
- return B;
863
- const i = (r) => Xs(r, 0, 1, t, n);
864
- return (r) => r === 0 || r === 1 ? r : ln(i(r), e, s);
865
- }
866
- const Zs = /* @__PURE__ */ ce(0.42, 0, 1, 1), Qs = /* @__PURE__ */ ce(0, 0, 0.58, 1), un = /* @__PURE__ */ ce(0.42, 0, 0.58, 1), cn = (t) => Array.isArray(t) && typeof t[0] != "number", hn = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, fn = (t) => (e) => 1 - t(1 - e), He = (t) => 1 - Math.sin(Math.acos(t)), Js = fn(He), ei = hn(He), dn = /* @__PURE__ */ ce(0.33, 1.53, 0.69, 0.99), Xe = /* @__PURE__ */ fn(dn), ti = /* @__PURE__ */ hn(Xe), ni = (t) => (t *= 2) < 1 ? 0.5 * Xe(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), xt = {
867
- linear: B,
868
- easeIn: Zs,
869
- easeInOut: un,
870
- easeOut: Qs,
871
- circIn: He,
872
- circInOut: ei,
873
- circOut: Js,
874
- backIn: Xe,
875
- backInOut: ti,
876
- backOut: dn,
877
- anticipate: ni
878
- }, At = (t) => {
879
- if (Array.isArray(t)) {
880
- k(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
881
- const [e, n, s, i] = t;
882
- return ce(e, n, s, i);
862
+ const or = /* @__PURE__ */ ue(0.42, 0, 1, 1), ar = /* @__PURE__ */ ue(0, 0, 0.58, 1), vn = /* @__PURE__ */ ue(0.42, 0, 0.58, 1), bn = (t) => Array.isArray(t) && typeof t[0] != "number", Qe = (t) => Array.isArray(t) && typeof t[0] == "number", Ft = {
863
+ linear: L,
864
+ easeIn: or,
865
+ easeInOut: vn,
866
+ easeOut: ar,
867
+ circIn: je,
868
+ circInOut: Zt,
869
+ circOut: hs,
870
+ backIn: Ue,
871
+ backInOut: Ht,
872
+ backOut: Yt,
873
+ anticipate: Xt
874
+ }, Pt = (t) => {
875
+ if (Qe(t)) {
876
+ $(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
877
+ const [e, n, s, r] = t;
878
+ return ue(e, n, s, r);
883
879
  } else if (typeof t == "string")
884
- return k(xt[t] !== void 0, `Invalid easing type '${t}'`), xt[t];
880
+ return $(Ft[t] !== void 0, `Invalid easing type '${t}'`), Ft[t];
885
881
  return t;
886
- }, si = (t, e) => (n) => e(t(n)), Ze = (...t) => t.reduce(si), Qe = (t, e, n) => {
882
+ }, lr = (t, e) => (n) => e(t(n)), Je = (...t) => t.reduce(lr), Ae = (t, e, n) => {
887
883
  const s = e - t;
888
884
  return s === 0 ? 1 : (n - t) / s;
889
885
  }, he = (t, e, n) => t + (e - t) * n;
890
886
  function Pe(t, e, n) {
891
887
  return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
892
888
  }
893
- function ii({ hue: t, saturation: e, lightness: n, alpha: s }) {
889
+ function ur({ hue: t, saturation: e, lightness: n, alpha: s }) {
894
890
  t /= 360, e /= 100, n /= 100;
895
- let i = 0, r = 0, o = 0;
891
+ let r = 0, i = 0, o = 0;
896
892
  if (!e)
897
- i = r = o = n;
893
+ r = i = o = n;
898
894
  else {
899
- const l = n < 0.5 ? n * (1 + e) : n + e - n * e, a = 2 * n - l;
900
- i = Pe(a, l, t + 1 / 3), r = Pe(a, l, t), o = Pe(a, l, t - 1 / 3);
895
+ const a = n < 0.5 ? n * (1 + e) : n + e - n * e, l = 2 * n - a;
896
+ r = Pe(l, a, t + 1 / 3), i = Pe(l, a, t), o = Pe(l, a, t - 1 / 3);
901
897
  }
902
898
  return {
903
- red: Math.round(i * 255),
904
- green: Math.round(r * 255),
899
+ red: Math.round(r * 255),
900
+ green: Math.round(i * 255),
905
901
  blue: Math.round(o * 255),
906
902
  alpha: s
907
903
  };
908
904
  }
909
- function Ve(t, e) {
905
+ function be(t, e) {
910
906
  return (n) => n > 0 ? e : t;
911
907
  }
912
- const Re = (t, e, n) => {
913
- const s = t * t, i = n * (e * e - s) + s;
914
- return i < 0 ? 0 : Math.sqrt(i);
915
- }, ri = [Oe, $, G], oi = (t) => ri.find((e) => e.test(t));
916
- function Mt(t) {
917
- const e = oi(t);
918
- if (ae(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
908
+ const Oe = (t, e, n) => {
909
+ const s = t * t, r = n * (e * e - s) + s;
910
+ return r < 0 ? 0 : Math.sqrt(r);
911
+ }, cr = [Ne, U, z], fr = (t) => cr.find((e) => e.test(t));
912
+ function Ot(t) {
913
+ const e = fr(t);
914
+ if (ce(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
919
915
  return !1;
920
916
  let n = e.parse(t);
921
- return e === G && (n = ii(n)), n;
917
+ return e === z && (n = ur(n)), n;
922
918
  }
923
- const Ct = (t, e) => {
924
- const n = Mt(t), s = Mt(e);
919
+ const Rt = (t, e) => {
920
+ const n = Ot(t), s = Ot(e);
925
921
  if (!n || !s)
926
- return Ve(t, e);
927
- const i = { ...n };
928
- return (r) => (i.red = Re(n.red, s.red, r), i.green = Re(n.green, s.green, r), i.blue = Re(n.blue, s.blue, r), i.alpha = he(n.alpha, s.alpha, r), $.transform(i));
929
- }, Ee = /* @__PURE__ */ new Set(["none", "hidden"]);
930
- function ai(t, e) {
931
- return Ee.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
932
- }
933
- function li(t, e) {
922
+ return be(t, e);
923
+ const r = { ...n };
924
+ return (i) => (r.red = Oe(n.red, s.red, i), r.green = Oe(n.green, s.green, i), r.blue = Oe(n.blue, s.blue, i), r.alpha = he(n.alpha, s.alpha, i), U.transform(r));
925
+ }, Ke = /* @__PURE__ */ new Set(["none", "hidden"]);
926
+ function hr(t, e) {
927
+ return Ke.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
928
+ }
929
+ function dr(t, e) {
934
930
  return (n) => he(t, e, n);
935
931
  }
936
- function Je(t) {
937
- return typeof t == "number" ? li : typeof t == "string" ? $e(t) ? Ve : C.test(t) ? Ct : hi : Array.isArray(t) ? pn : typeof t == "object" ? C.test(t) ? Ct : ui : Ve;
932
+ function et(t) {
933
+ return typeof t == "number" ? dr : typeof t == "string" ? Ge(t) ? be : C.test(t) ? Rt : gr : Array.isArray(t) ? Tn : typeof t == "object" ? C.test(t) ? Rt : pr : be;
938
934
  }
939
- function pn(t, e) {
940
- const n = [...t], s = n.length, i = t.map((r, o) => Je(r)(r, e[o]));
941
- return (r) => {
935
+ function Tn(t, e) {
936
+ const n = [...t], s = n.length, r = t.map((i, o) => et(i)(i, e[o]));
937
+ return (i) => {
942
938
  for (let o = 0; o < s; o++)
943
- n[o] = i[o](r);
939
+ n[o] = r[o](i);
944
940
  return n;
945
941
  };
946
942
  }
947
- function ui(t, e) {
943
+ function pr(t, e) {
948
944
  const n = { ...t, ...e }, s = {};
949
- for (const i in n)
950
- t[i] !== void 0 && e[i] !== void 0 && (s[i] = Je(t[i])(t[i], e[i]));
951
- return (i) => {
952
- for (const r in s)
953
- n[r] = s[r](i);
945
+ for (const r in n)
946
+ t[r] !== void 0 && e[r] !== void 0 && (s[r] = et(t[r])(t[r], e[r]));
947
+ return (r) => {
948
+ for (const i in s)
949
+ n[i] = s[i](r);
954
950
  return n;
955
951
  };
956
952
  }
957
- function ci(t, e) {
953
+ function mr(t, e) {
958
954
  var n;
959
- const s = [], i = { color: 0, var: 0, number: 0 };
960
- for (let r = 0; r < e.values.length; r++) {
961
- const o = e.types[r], l = t.indexes[o][i[o]], a = (n = t.values[l]) !== null && n !== void 0 ? n : 0;
962
- s[r] = a, i[o]++;
955
+ const s = [], r = { color: 0, var: 0, number: 0 };
956
+ for (let i = 0; i < e.values.length; i++) {
957
+ const o = e.types[i], a = t.indexes[o][r[o]], l = (n = t.values[a]) !== null && n !== void 0 ? n : 0;
958
+ s[i] = l, r[o]++;
963
959
  }
964
960
  return s;
965
961
  }
966
- const hi = (t, e) => {
967
- const n = X.createTransformer(e), s = se(t), i = se(e);
968
- return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? Ee.has(t) && !i.values.length || Ee.has(e) && !s.values.length ? ai(t, e) : Ze(pn(ci(s, i), i.values), n) : (ae(!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.`), Ve(t, e));
962
+ const gr = (t, e) => {
963
+ const n = Q.createTransformer(e), s = oe(t), r = oe(e);
964
+ return s.indexes.var.length === r.indexes.var.length && s.indexes.color.length === r.indexes.color.length && s.indexes.number.length >= r.indexes.number.length ? Ke.has(t) && !r.values.length || Ke.has(e) && !s.values.length ? hr(t, e) : Je(Tn(mr(s, r), r.values), n) : (ce(!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.`), be(t, e));
969
965
  };
970
- function mn(t, e, n) {
971
- return typeof t == "number" && typeof e == "number" && typeof n == "number" ? he(t, e, n) : Je(t)(t, e);
966
+ function Vn(t, e, n) {
967
+ return typeof t == "number" && typeof e == "number" && typeof n == "number" ? he(t, e, n) : et(t)(t, e);
972
968
  }
973
- function fi(t, e, n) {
974
- const s = [], i = n || mn, r = t.length - 1;
975
- for (let o = 0; o < r; o++) {
976
- let l = i(t[o], t[o + 1]);
969
+ function yr(t, e, n) {
970
+ const s = [], r = n || Vn, i = t.length - 1;
971
+ for (let o = 0; o < i; o++) {
972
+ let a = r(t[o], t[o + 1]);
977
973
  if (e) {
978
- const a = Array.isArray(e) ? e[o] || B : e;
979
- l = Ze(a, l);
974
+ const l = Array.isArray(e) ? e[o] || L : e;
975
+ a = Je(l, a);
980
976
  }
981
- s.push(l);
977
+ s.push(a);
982
978
  }
983
979
  return s;
984
980
  }
985
- function di(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
986
- const r = t.length;
987
- if (k(r === e.length, "Both input and output ranges must be the same length"), r === 1)
981
+ function vr(t, e, { clamp: n = !0, ease: s, mixer: r } = {}) {
982
+ const i = t.length;
983
+ if ($(i === e.length, "Both input and output ranges must be the same length"), i === 1)
988
984
  return () => e[0];
989
- if (r === 2 && t[0] === t[1])
985
+ if (i === 2 && t[0] === t[1])
990
986
  return () => e[1];
991
- t[0] > t[r - 1] && (t = [...t].reverse(), e = [...e].reverse());
992
- const o = fi(e, s, i), l = o.length, a = (u) => {
987
+ t[0] > t[i - 1] && (t = [...t].reverse(), e = [...e].reverse());
988
+ const o = yr(e, s, r), a = o.length, l = (u) => {
993
989
  let c = 0;
994
- if (l > 1)
990
+ if (a > 1)
995
991
  for (; c < t.length - 2 && !(u < t[c + 1]); c++)
996
992
  ;
997
- const h = Qe(t[c], t[c + 1], u);
998
- return o[c](h);
993
+ const f = Ae(t[c], t[c + 1], u);
994
+ return o[c](f);
999
995
  };
1000
- return n ? (u) => a(q(t[0], t[r - 1], u)) : a;
996
+ return n ? (u) => l(Y(t[0], t[i - 1], u)) : l;
1001
997
  }
1002
- function gn(t, e) {
998
+ function wn(t, e) {
1003
999
  const n = t[t.length - 1];
1004
1000
  for (let s = 1; s <= e; s++) {
1005
- const i = Qe(0, e, s);
1006
- t.push(he(n, 1, i));
1001
+ const r = Ae(0, e, s);
1002
+ t.push(he(n, 1, r));
1007
1003
  }
1008
1004
  }
1009
- function yn(t) {
1005
+ function Sn(t) {
1010
1006
  const e = [0];
1011
- return gn(e, t.length - 1), e;
1007
+ return wn(e, t.length - 1), e;
1012
1008
  }
1013
- function pi(t, e) {
1009
+ function br(t, e) {
1014
1010
  return t.map((n) => n * e);
1015
1011
  }
1016
- function mi(t, e) {
1017
- return t.map(() => e || un).splice(0, t.length - 1);
1012
+ function Tr(t, e) {
1013
+ return t.map(() => e || vn).splice(0, t.length - 1);
1018
1014
  }
1019
- function we({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
1020
- const i = cn(s) ? s.map(At) : At(s), r = {
1015
+ function Te({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
1016
+ const r = bn(s) ? s.map(Pt) : Pt(s), i = {
1021
1017
  done: !1,
1022
1018
  value: e[0]
1023
- }, o = pi(
1019
+ }, o = br(
1024
1020
  // Only use the provided offsets if they're the correct length
1025
1021
  // TODO Maybe we should warn here if there's a length mismatch
1026
- n && n.length === e.length ? n : yn(e),
1022
+ n && n.length === e.length ? n : Sn(e),
1027
1023
  t
1028
- ), l = di(o, e, {
1029
- ease: Array.isArray(i) ? i : mi(e, i)
1024
+ ), a = vr(o, e, {
1025
+ ease: Array.isArray(r) ? r : Tr(e, r)
1030
1026
  });
1031
1027
  return {
1032
1028
  calculatedDuration: t,
1033
- next: (a) => (r.value = l(a), r.done = a >= t, r)
1029
+ next: (l) => (i.value = a(l), i.done = l >= t, i)
1034
1030
  };
1035
1031
  }
1036
- const Ke = 2e4;
1037
- function vn(t) {
1032
+ const Be = 2e4;
1033
+ function xn(t) {
1038
1034
  let e = 0;
1039
1035
  const n = 50;
1040
1036
  let s = t.next(e);
1041
- for (; !s.done && e < Ke; )
1037
+ for (; !s.done && e < Be; )
1042
1038
  e += n, s = t.next(e);
1043
- return e >= Ke ? 1 / 0 : e;
1039
+ return e >= Be ? 1 / 0 : e;
1044
1040
  }
1045
- const gi = (t) => {
1041
+ const Vr = (t) => {
1046
1042
  const e = ({ timestamp: n }) => t(n);
1047
1043
  return {
1048
1044
  start: () => _.update(e, !0),
1049
- stop: () => be(e),
1045
+ stop: () => Re(e),
1050
1046
  /**
1051
1047
  * If we're processing this frame we can use the
1052
1048
  * framelocked timestamp to keep things in sync.
1053
1049
  */
1054
- now: () => Te.isProcessing ? Te.timestamp : j.now()
1050
+ now: () => ve.isProcessing ? ve.timestamp : k.now()
1055
1051
  };
1056
- }, yi = {
1057
- decay: St,
1058
- inertia: St,
1059
- tween: we,
1060
- keyframes: we,
1061
- spring: Ye
1062
- }, vi = (t) => t / 100;
1063
- class et extends rn {
1052
+ }, wr = {
1053
+ decay: Ct,
1054
+ inertia: Ct,
1055
+ tween: Te,
1056
+ keyframes: Te,
1057
+ spring: Ze
1058
+ }, Sr = (t) => t / 100;
1059
+ class tt extends mn {
1064
1060
  constructor(e) {
1065
1061
  super(e), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
1066
1062
  if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
1067
1063
  return;
1068
1064
  this.teardown();
1069
- const { onStop: a } = this.options;
1070
- a && a();
1065
+ const { onStop: l } = this.options;
1066
+ l && l();
1071
1067
  };
1072
- const { name: n, motionValue: s, element: i, keyframes: r } = this.options, o = (i == null ? void 0 : i.KeyframeResolver) || je, l = (a, u) => this.onKeyframesResolved(a, u);
1073
- this.resolver = new o(r, l, n, s, i), this.resolver.scheduleResolve();
1068
+ const { name: n, motionValue: s, element: r, keyframes: i } = this.options, o = (r == null ? void 0 : r.KeyframeResolver) || ze, a = (l, u) => this.onKeyframesResolved(l, u);
1069
+ this.resolver = new o(i, a, n, s, r), this.resolver.scheduleResolve();
1074
1070
  }
1075
1071
  initPlayback(e) {
1076
- const { type: n = "keyframes", repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = this.options, l = yi[n] || we;
1077
- let a, u;
1078
- l !== we && typeof e[0] != "number" && (process.env.NODE_ENV !== "production" && k(e.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`), a = Ze(vi, mn(e[0], e[1])), e = [0, 100]);
1079
- const c = l({ ...this.options, keyframes: e });
1080
- r === "mirror" && (u = l({
1072
+ const { type: n = "keyframes", repeat: s = 0, repeatDelay: r = 0, repeatType: i, velocity: o = 0 } = this.options, a = xe(n) ? n : wr[n] || Te;
1073
+ let l, u;
1074
+ a !== Te && typeof e[0] != "number" && (process.env.NODE_ENV !== "production" && $(e.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`), l = Je(Sr, Vn(e[0], e[1])), e = [0, 100]);
1075
+ const c = a({ ...this.options, keyframes: e });
1076
+ i === "mirror" && (u = a({
1081
1077
  ...this.options,
1082
1078
  keyframes: [...e].reverse(),
1083
1079
  velocity: -o
1084
- })), c.calculatedDuration === null && (c.calculatedDuration = vn(c));
1085
- const { calculatedDuration: h } = c, f = h + i, d = f * (s + 1) - i;
1080
+ })), c.calculatedDuration === null && (c.calculatedDuration = xn(c));
1081
+ const { calculatedDuration: f } = c, h = f + r, g = h * (s + 1) - r;
1086
1082
  return {
1087
1083
  generator: c,
1088
1084
  mirroredGenerator: u,
1089
- mapPercentToKeyframes: a,
1090
- calculatedDuration: h,
1091
- resolvedDuration: f,
1092
- totalDuration: d
1085
+ mapPercentToKeyframes: l,
1086
+ calculatedDuration: f,
1087
+ resolvedDuration: h,
1088
+ totalDuration: g
1093
1089
  };
1094
1090
  }
1095
1091
  onPostResolved() {
@@ -1099,28 +1095,28 @@ class et extends rn {
1099
1095
  tick(e, n = !1) {
1100
1096
  const { resolved: s } = this;
1101
1097
  if (!s) {
1102
- const { keyframes: g } = this.options;
1103
- return { done: !0, value: g[g.length - 1] };
1098
+ const { keyframes: V } = this.options;
1099
+ return { done: !0, value: V[V.length - 1] };
1104
1100
  }
1105
- const { finalKeyframe: i, generator: r, mirroredGenerator: o, mapPercentToKeyframes: l, keyframes: a, calculatedDuration: u, totalDuration: c, resolvedDuration: h } = s;
1101
+ const { finalKeyframe: r, generator: i, mirroredGenerator: o, mapPercentToKeyframes: a, keyframes: l, calculatedDuration: u, totalDuration: c, resolvedDuration: f } = s;
1106
1102
  if (this.startTime === null)
1107
- return r.next(0);
1108
- const { delay: f, repeat: d, repeatType: y, repeatDelay: v, onUpdate: b } = this.options;
1103
+ return i.next(0);
1104
+ const { delay: h, repeat: g, repeatType: p, repeatDelay: b, onUpdate: T } = this.options;
1109
1105
  this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - c / this.speed, this.startTime)), n ? this.currentTime = e : this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = Math.round(e - this.startTime) * this.speed;
1110
- const m = this.currentTime - f * (this.speed >= 0 ? 1 : -1), S = this.speed >= 0 ? m < 0 : m > c;
1106
+ const m = this.currentTime - h * (this.speed >= 0 ? 1 : -1), y = this.speed >= 0 ? m < 0 : m > c;
1111
1107
  this.currentTime = Math.max(m, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = c);
1112
- let V = this.currentTime, w = r;
1113
- if (d) {
1114
- const g = Math.min(this.currentTime, c) / h;
1115
- let P = Math.floor(g), A = g % 1;
1116
- !A && g >= 1 && (A = 1), A === 1 && P--, P = Math.min(P, d + 1), !!(P % 2) && (y === "reverse" ? (A = 1 - A, v && (A -= v / h)) : y === "mirror" && (w = o)), V = q(0, 1, A) * h;
1108
+ let S = this.currentTime, w = i;
1109
+ if (g) {
1110
+ const V = Math.min(this.currentTime, c) / f;
1111
+ let A = Math.floor(V), P = V % 1;
1112
+ !P && V >= 1 && (P = 1), P === 1 && A--, A = Math.min(A, g + 1), !!(A % 2) && (p === "reverse" ? (P = 1 - P, b && (P -= b / f)) : p === "mirror" && (w = o)), S = Y(0, 1, P) * f;
1117
1113
  }
1118
- const T = S ? { done: !1, value: a[0] } : w.next(V);
1119
- l && (T.value = l(T.value));
1120
- let { done: x } = T;
1121
- !S && u !== null && (x = this.speed >= 0 ? this.currentTime >= c : this.currentTime <= 0);
1114
+ const v = y ? { done: !1, value: l[0] } : w.next(S);
1115
+ a && (v.value = a(v.value));
1116
+ let { done: x } = v;
1117
+ !y && u !== null && (x = this.speed >= 0 ? this.currentTime >= c : this.currentTime <= 0);
1122
1118
  const F = this.holdTime === null && (this.state === "finished" || this.state === "running" && x);
1123
- return F && i !== void 0 && (T.value = xe(a, this.options, i)), b && b(T.value), F && this.finish(), T;
1119
+ return F && r !== void 0 && (v.value = Se(l, this.options, r)), T && T(v.value), F && this.finish(), v;
1124
1120
  }
1125
1121
  get duration() {
1126
1122
  const { resolved: e } = this;
@@ -1130,7 +1126,7 @@ class et extends rn {
1130
1126
  return I(this.currentTime);
1131
1127
  }
1132
1128
  set time(e) {
1133
- e = O(e), this.currentTime = e, this.holdTime !== null || this.speed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.speed);
1129
+ e = E(e), this.currentTime = e, this.holdTime !== null || this.speed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.speed);
1134
1130
  }
1135
1131
  get speed() {
1136
1132
  return this.playbackSpeed;
@@ -1146,10 +1142,10 @@ class et extends rn {
1146
1142
  }
1147
1143
  if (this.isStopped)
1148
1144
  return;
1149
- const { driver: e = gi, onPlay: n, startTime: s } = this.options;
1150
- this.driver || (this.driver = e((r) => this.tick(r))), n && n();
1151
- const i = this.driver.now();
1152
- this.holdTime !== null ? this.startTime = i - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = i) : this.startTime = s ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
1145
+ const { driver: e = Vr, onPlay: n, startTime: s } = this.options;
1146
+ this.driver || (this.driver = e((i) => this.tick(i))), n && n();
1147
+ const r = this.driver.now();
1148
+ this.holdTime !== null ? this.startTime = r - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = r) : this.startTime = s ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
1153
1149
  }
1154
1150
  pause() {
1155
1151
  var e;
@@ -1180,7 +1176,7 @@ class et extends rn {
1180
1176
  return this.startTime = 0, this.tick(e, !0);
1181
1177
  }
1182
1178
  }
1183
- const bn = /* @__PURE__ */ new Set([
1179
+ const xr = /* @__PURE__ */ new Set([
1184
1180
  "opacity",
1185
1181
  "clipPath",
1186
1182
  "filter",
@@ -1188,47 +1184,75 @@ const bn = /* @__PURE__ */ new Set([
1188
1184
  // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
1189
1185
  // or until we implement support for linear() easing.
1190
1186
  // "background-color"
1191
- ]), Tn = (t) => Array.isArray(t) && typeof t[0] == "number";
1192
- function Vn(t) {
1193
- return !!(!t || typeof t == "string" && t in tt || Tn(t) || Array.isArray(t) && t.every(Vn));
1187
+ ]), Ar = 10, Mr = (t, e) => {
1188
+ let n = "";
1189
+ const s = Math.max(Math.round(e / Ar), 2);
1190
+ for (let r = 0; r < s; r++)
1191
+ n += t(Ae(0, s - 1, r)) + ", ";
1192
+ return `linear(${n.substring(0, n.length - 2)})`;
1193
+ };
1194
+ function nt(t) {
1195
+ let e;
1196
+ return () => (e === void 0 && (e = t()), e);
1197
+ }
1198
+ const Cr = {
1199
+ linearEasing: void 0
1200
+ };
1201
+ function Fr(t, e) {
1202
+ const n = nt(t);
1203
+ return () => {
1204
+ var s;
1205
+ return (s = Cr[e]) !== null && s !== void 0 ? s : n();
1206
+ };
1207
+ }
1208
+ const Ve = /* @__PURE__ */ Fr(() => {
1209
+ try {
1210
+ document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
1211
+ } catch {
1212
+ return !1;
1213
+ }
1214
+ return !0;
1215
+ }, "linearEasing");
1216
+ function An(t) {
1217
+ return !!(typeof t == "function" && Ve() || !t || typeof t == "string" && (t in ke || Ve()) || Qe(t) || Array.isArray(t) && t.every(An));
1194
1218
  }
1195
- const ee = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, tt = {
1219
+ const se = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, ke = {
1196
1220
  linear: "linear",
1197
1221
  ease: "ease",
1198
1222
  easeIn: "ease-in",
1199
1223
  easeOut: "ease-out",
1200
1224
  easeInOut: "ease-in-out",
1201
- circIn: /* @__PURE__ */ ee([0, 0.65, 0.55, 1]),
1202
- circOut: /* @__PURE__ */ ee([0.55, 0, 1, 0.45]),
1203
- backIn: /* @__PURE__ */ ee([0.31, 0.01, 0.66, -0.59]),
1204
- backOut: /* @__PURE__ */ ee([0.33, 1.53, 0.69, 0.99])
1225
+ circIn: /* @__PURE__ */ se([0, 0.65, 0.55, 1]),
1226
+ circOut: /* @__PURE__ */ se([0.55, 0, 1, 0.45]),
1227
+ backIn: /* @__PURE__ */ se([0.31, 0.01, 0.66, -0.59]),
1228
+ backOut: /* @__PURE__ */ se([0.33, 1.53, 0.69, 0.99])
1205
1229
  };
1206
- function bi(t) {
1207
- return wn(t) || tt.easeOut;
1208
- }
1209
- function wn(t) {
1230
+ function Mn(t, e) {
1210
1231
  if (t)
1211
- return Tn(t) ? ee(t) : Array.isArray(t) ? t.map(bi) : tt[t];
1232
+ return typeof t == "function" && Ve() ? Mr(t, e) : Qe(t) ? se(t) : Array.isArray(t) ? t.map((n) => Mn(n, e) || ke.easeOut) : ke[t];
1212
1233
  }
1213
- function Ti(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: l, times: a } = {}) {
1234
+ function Pr(t, e, n, { delay: s = 0, duration: r = 300, repeat: i = 0, repeatType: o = "loop", ease: a, times: l } = {}) {
1214
1235
  const u = { [e]: n };
1215
- a && (u.offset = a);
1216
- const c = wn(l);
1236
+ l && (u.offset = l);
1237
+ const c = Mn(a, r);
1217
1238
  return Array.isArray(c) && (u.easing = c), t.animate(u, {
1218
1239
  delay: s,
1219
- duration: i,
1240
+ duration: r,
1220
1241
  easing: Array.isArray(c) ? "linear" : c,
1221
1242
  fill: "both",
1222
- iterations: r + 1,
1243
+ iterations: i + 1,
1223
1244
  direction: o === "reverse" ? "alternate" : "normal"
1224
1245
  });
1225
1246
  }
1226
- const Vi = /* @__PURE__ */ sn(() => Object.hasOwnProperty.call(Element.prototype, "animate")), Se = 10, wi = 2e4;
1227
- function Si(t) {
1228
- return t.type === "spring" || !Vn(t.ease);
1247
+ function Dt(t, e) {
1248
+ t.timeline = e, t.onfinish = null;
1249
+ }
1250
+ const Or = /* @__PURE__ */ nt(() => Object.hasOwnProperty.call(Element.prototype, "animate")), we = 10, Rr = 2e4;
1251
+ function Dr(t) {
1252
+ return xe(t.type) || t.type === "spring" || !An(t.ease);
1229
1253
  }
1230
- function xi(t, e) {
1231
- const n = new et({
1254
+ function Er(t, e) {
1255
+ const n = new tt({
1232
1256
  ...e,
1233
1257
  keyframes: t,
1234
1258
  repeat: 0,
@@ -1236,41 +1260,49 @@ function xi(t, e) {
1236
1260
  isGenerator: !0
1237
1261
  });
1238
1262
  let s = { done: !1, value: t[0] };
1239
- const i = [];
1240
- let r = 0;
1241
- for (; !s.done && r < wi; )
1242
- s = n.sample(r), i.push(s.value), r += Se;
1263
+ const r = [];
1264
+ let i = 0;
1265
+ for (; !s.done && i < Rr; )
1266
+ s = n.sample(i), r.push(s.value), i += we;
1243
1267
  return {
1244
1268
  times: void 0,
1245
- keyframes: i,
1246
- duration: r - Se,
1269
+ keyframes: r,
1270
+ duration: i - we,
1247
1271
  ease: "linear"
1248
1272
  };
1249
1273
  }
1250
- class Ft extends rn {
1274
+ const Cn = {
1275
+ anticipate: Xt,
1276
+ backInOut: Ht,
1277
+ circInOut: Zt
1278
+ };
1279
+ function Nr(t) {
1280
+ return t in Cn;
1281
+ }
1282
+ class Et extends mn {
1251
1283
  constructor(e) {
1252
1284
  super(e);
1253
- const { name: n, motionValue: s, element: i, keyframes: r } = this.options;
1254
- this.resolver = new nn(r, (o, l) => this.onKeyframesResolved(o, l), n, s, i), this.resolver.scheduleResolve();
1285
+ const { name: n, motionValue: s, element: r, keyframes: i } = this.options;
1286
+ this.resolver = new pn(i, (o, a) => this.onKeyframesResolved(o, a), n, s, r), this.resolver.scheduleResolve();
1255
1287
  }
1256
1288
  initPlayback(e, n) {
1257
1289
  var s;
1258
- let { duration: i = 300, times: r, ease: o, type: l, motionValue: a, name: u, startTime: c } = this.options;
1259
- if (!(!((s = a.owner) === null || s === void 0) && s.current))
1290
+ let { duration: r = 300, times: i, ease: o, type: a, motionValue: l, name: u, startTime: c } = this.options;
1291
+ if (!(!((s = l.owner) === null || s === void 0) && s.current))
1260
1292
  return !1;
1261
- if (Si(this.options)) {
1262
- const { onComplete: f, onUpdate: d, motionValue: y, element: v, ...b } = this.options, m = xi(e, b);
1263
- e = m.keyframes, e.length === 1 && (e[1] = e[0]), i = m.duration, r = m.times, o = m.ease, l = "keyframes";
1293
+ if (typeof o == "string" && Ve() && Nr(o) && (o = Cn[o]), Dr(this.options)) {
1294
+ const { onComplete: h, onUpdate: g, motionValue: p, element: b, ...T } = this.options, m = Er(e, T);
1295
+ e = m.keyframes, e.length === 1 && (e[1] = e[0]), r = m.duration, i = m.times, o = m.ease, a = "keyframes";
1264
1296
  }
1265
- const h = Ti(a.owner.current, u, e, { ...this.options, duration: i, times: r, ease: o });
1266
- return h.startTime = c ?? this.calcStartTime(), this.pendingTimeline ? (h.timeline = this.pendingTimeline, this.pendingTimeline = void 0) : h.onfinish = () => {
1267
- const { onComplete: f } = this.options;
1268
- a.set(xe(e, this.options, n)), f && f(), this.cancel(), this.resolveFinishedPromise();
1297
+ const f = Pr(l.owner.current, u, e, { ...this.options, duration: r, times: i, ease: o });
1298
+ return f.startTime = c ?? this.calcStartTime(), this.pendingTimeline ? (Dt(f, this.pendingTimeline), this.pendingTimeline = void 0) : f.onfinish = () => {
1299
+ const { onComplete: h } = this.options;
1300
+ l.set(Se(e, this.options, n)), h && h(), this.cancel(), this.resolveFinishedPromise();
1269
1301
  }, {
1270
- animation: h,
1271
- duration: i,
1272
- times: r,
1273
- type: l,
1302
+ animation: f,
1303
+ duration: r,
1304
+ times: i,
1305
+ type: a,
1274
1306
  ease: o,
1275
1307
  keyframes: e
1276
1308
  };
@@ -1294,7 +1326,7 @@ class Ft extends rn {
1294
1326
  if (!n)
1295
1327
  return;
1296
1328
  const { animation: s } = n;
1297
- s.currentTime = O(e);
1329
+ s.currentTime = E(e);
1298
1330
  }
1299
1331
  get speed() {
1300
1332
  const { resolved: e } = this;
@@ -1334,11 +1366,11 @@ class Ft extends rn {
1334
1366
  else {
1335
1367
  const { resolved: n } = this;
1336
1368
  if (!n)
1337
- return B;
1369
+ return L;
1338
1370
  const { animation: s } = n;
1339
- s.timeline = e, s.onfinish = null;
1371
+ Dt(s, e);
1340
1372
  }
1341
- return B;
1373
+ return L;
1342
1374
  }
1343
1375
  play() {
1344
1376
  if (this.isStopped)
@@ -1363,23 +1395,23 @@ class Ft extends rn {
1363
1395
  const { resolved: e } = this;
1364
1396
  if (!e)
1365
1397
  return;
1366
- const { animation: n, keyframes: s, duration: i, type: r, ease: o, times: l } = e;
1398
+ const { animation: n, keyframes: s, duration: r, type: i, ease: o, times: a } = e;
1367
1399
  if (n.playState === "idle" || n.playState === "finished")
1368
1400
  return;
1369
1401
  if (this.time) {
1370
- const { motionValue: u, onUpdate: c, onComplete: h, element: f, ...d } = this.options, y = new et({
1371
- ...d,
1402
+ const { motionValue: u, onUpdate: c, onComplete: f, element: h, ...g } = this.options, p = new tt({
1403
+ ...g,
1372
1404
  keyframes: s,
1373
- duration: i,
1374
- type: r,
1405
+ duration: r,
1406
+ type: i,
1375
1407
  ease: o,
1376
- times: l,
1408
+ times: a,
1377
1409
  isGenerator: !0
1378
- }), v = O(this.time);
1379
- u.setWithVelocity(y.sample(v - Se).value, y.sample(v).value, Se);
1410
+ }), b = E(this.time);
1411
+ u.setWithVelocity(p.sample(b - we).value, p.sample(b).value, we);
1380
1412
  }
1381
- const { onStop: a } = this.options;
1382
- a && a(), this.cancel();
1413
+ const { onStop: l } = this.options;
1414
+ l && l(), this.cancel();
1383
1415
  }
1384
1416
  complete() {
1385
1417
  const { resolved: e } = this;
@@ -1390,24 +1422,16 @@ class Ft extends rn {
1390
1422
  e && e.animation.cancel();
1391
1423
  }
1392
1424
  static supports(e) {
1393
- const { motionValue: n, name: s, repeatDelay: i, repeatType: r, damping: o, type: l } = e;
1394
- return Vi() && s && bn.has(s) && n && n.owner && n.owner.current instanceof HTMLElement && /**
1425
+ const { motionValue: n, name: s, repeatDelay: r, repeatType: i, damping: o, type: a } = e;
1426
+ return Or() && s && xr.has(s) && n && n.owner && n.owner.current instanceof HTMLElement && /**
1395
1427
  * If we're outputting values to onUpdate then we can't use WAAPI as there's
1396
1428
  * no way to read the value from WAAPI every frame.
1397
1429
  */
1398
- !n.owner.getProps().onUpdate && !i && r !== "mirror" && o !== 0 && l !== "inertia";
1430
+ !n.owner.getProps().onUpdate && !r && i !== "mirror" && o !== 0 && a !== "inertia";
1399
1431
  }
1400
1432
  }
1401
- function Ai(t, e) {
1402
- let n;
1403
- const s = () => {
1404
- const { currentTime: i } = e, o = (i === null ? 0 : i.value) / 100;
1405
- n !== o && t(o), n = o;
1406
- };
1407
- return _.update(s, !0), () => be(s);
1408
- }
1409
- const Mi = sn(() => window.ScrollTimeline !== void 0);
1410
- class nt {
1433
+ const Ir = nt(() => window.ScrollTimeline !== void 0);
1434
+ class Fn {
1411
1435
  constructor(e) {
1412
1436
  this.stop = () => this.runAll("stop"), this.animations = e.filter(Boolean);
1413
1437
  }
@@ -1424,18 +1448,11 @@ class nt {
1424
1448
  for (let s = 0; s < this.animations.length; s++)
1425
1449
  this.animations[s][e] = n;
1426
1450
  }
1427
- attachTimeline(e) {
1428
- const n = this.animations.map((s) => {
1429
- if (Mi() && s.attachTimeline)
1430
- s.attachTimeline(e);
1431
- else
1432
- return s.pause(), Ai((i) => {
1433
- s.time = s.duration * i;
1434
- }, e);
1435
- });
1451
+ attachTimeline(e, n) {
1452
+ const s = this.animations.map((r) => Ir() && r.attachTimeline ? r.attachTimeline(e) : n(r));
1436
1453
  return () => {
1437
- n.forEach((s, i) => {
1438
- s && s(), this.animations[i].stop();
1454
+ s.forEach((r, i) => {
1455
+ r && r(), this.animations[i].stop();
1439
1456
  });
1440
1457
  };
1441
1458
  }
@@ -1476,63 +1493,65 @@ class nt {
1476
1493
  this.runAll("complete");
1477
1494
  }
1478
1495
  }
1479
- const Sn = (t, e, n, s = {}, i, r, o) => (l) => {
1480
- const a = Lt(s, t) || {}, u = a.delay || s.delay || 0;
1481
- let { elapsed: c = 0 } = s;
1482
- c = c - O(u);
1483
- let h = {
1496
+ function _r({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: r, repeat: i, repeatType: o, repeatDelay: a, from: l, elapsed: u, ...c }) {
1497
+ return !!Object.keys(c).length;
1498
+ }
1499
+ const Pn = (t, e, n, s = {}, r, i) => (o) => {
1500
+ const a = jt(s, t) || {}, l = a.delay || s.delay || 0;
1501
+ let { elapsed: u = 0 } = s;
1502
+ u = u - E(l);
1503
+ let c = {
1484
1504
  keyframes: Array.isArray(n) ? n : [null, n],
1485
1505
  ease: "easeOut",
1486
1506
  velocity: e.getVelocity(),
1487
1507
  ...a,
1488
- delay: -c,
1489
- onUpdate: (d) => {
1490
- e.set(d), a.onUpdate && a.onUpdate(d);
1508
+ delay: -u,
1509
+ onUpdate: (h) => {
1510
+ e.set(h), a.onUpdate && a.onUpdate(h);
1491
1511
  },
1492
1512
  onComplete: () => {
1493
- l(), a.onComplete && a.onComplete(), o && o();
1513
+ o(), a.onComplete && a.onComplete();
1494
1514
  },
1495
- onStop: o,
1496
1515
  name: t,
1497
1516
  motionValue: e,
1498
- element: r ? void 0 : i
1517
+ element: i ? void 0 : r
1499
1518
  };
1500
- Zn(a) || (h = {
1501
- ...h,
1502
- ...Xn(t, h)
1503
- }), h.duration && (h.duration = O(h.duration)), h.repeatDelay && (h.repeatDelay = O(h.repeatDelay)), h.from !== void 0 && (h.keyframes[0] = h.from);
1519
+ _r(a) || (c = {
1520
+ ...c,
1521
+ ...ss(t, c)
1522
+ }), c.duration && (c.duration = E(c.duration)), c.repeatDelay && (c.repeatDelay = E(c.repeatDelay)), c.from !== void 0 && (c.keyframes[0] = c.from);
1504
1523
  let f = !1;
1505
- if ((h.type === !1 || h.duration === 0 && !h.repeatDelay) && (h.duration = 0, h.delay === 0 && (f = !0)), f && !r && e.get() !== void 0) {
1506
- const d = xe(h.keyframes, a);
1507
- if (d !== void 0)
1524
+ if ((c.type === !1 || c.duration === 0 && !c.repeatDelay) && (c.duration = 0, c.delay === 0 && (f = !0)), f && !i && e.get() !== void 0) {
1525
+ const h = Se(c.keyframes, a);
1526
+ if (h !== void 0)
1508
1527
  return _.update(() => {
1509
- h.onUpdate(d), h.onComplete();
1510
- }), new nt([]);
1528
+ c.onUpdate(h), c.onComplete();
1529
+ }), new Fn([]);
1511
1530
  }
1512
- return !r && Ft.supports(h) ? new Ft(h) : new et(h);
1513
- }, Ci = (t) => Un(t) ? t[t.length - 1] || 0 : t;
1514
- function Fi(t, e) {
1531
+ return !i && Et.supports(c) ? new Et(c) : new tt(c);
1532
+ }, Kr = (t) => Yn(t) ? t[t.length - 1] || 0 : t;
1533
+ function Br(t, e) {
1515
1534
  t.indexOf(e) === -1 && t.push(e);
1516
1535
  }
1517
- function st(t, e) {
1536
+ function On(t, e) {
1518
1537
  const n = t.indexOf(e);
1519
1538
  n > -1 && t.splice(n, 1);
1520
1539
  }
1521
- class xn {
1540
+ class Rn {
1522
1541
  constructor() {
1523
1542
  this.subscriptions = [];
1524
1543
  }
1525
1544
  add(e) {
1526
- return Fi(this.subscriptions, e), () => st(this.subscriptions, e);
1545
+ return Br(this.subscriptions, e), () => On(this.subscriptions, e);
1527
1546
  }
1528
1547
  notify(e, n, s) {
1529
- const i = this.subscriptions.length;
1530
- if (i)
1531
- if (i === 1)
1548
+ const r = this.subscriptions.length;
1549
+ if (r)
1550
+ if (r === 1)
1532
1551
  this.subscriptions[0](e, n, s);
1533
1552
  else
1534
- for (let r = 0; r < i; r++) {
1535
- const o = this.subscriptions[r];
1553
+ for (let i = 0; i < r; i++) {
1554
+ const o = this.subscriptions[i];
1536
1555
  o && o(e, n, s);
1537
1556
  }
1538
1557
  }
@@ -1543,8 +1562,8 @@ class xn {
1543
1562
  this.subscriptions.length = 0;
1544
1563
  }
1545
1564
  }
1546
- const Pt = 30, Pi = (t) => !isNaN(parseFloat(t));
1547
- class An {
1565
+ const Nt = 30, kr = (t) => !isNaN(parseFloat(t));
1566
+ class Lr {
1548
1567
  /**
1549
1568
  * @param init - The initiating value
1550
1569
  * @param config - Optional configuration options
@@ -1554,13 +1573,13 @@ class An {
1554
1573
  * @internal
1555
1574
  */
1556
1575
  constructor(e, n = {}) {
1557
- this.version = "11.5.4", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s, i = !0) => {
1558
- const r = j.now();
1559
- this.updatedAt !== r && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), i && this.events.renderRequest && this.events.renderRequest.notify(this.current);
1576
+ this.version = "11.11.9", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s, r = !0) => {
1577
+ const i = k.now();
1578
+ this.updatedAt !== i && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), r && this.events.renderRequest && this.events.renderRequest.notify(this.current);
1560
1579
  }, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
1561
1580
  }
1562
1581
  setCurrent(e) {
1563
- this.current = e, this.updatedAt = j.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = Pi(this.current));
1582
+ this.current = e, this.updatedAt = k.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = kr(this.current));
1564
1583
  }
1565
1584
  setPrevFrameValue(e = this.current) {
1566
1585
  this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
@@ -1606,10 +1625,10 @@ class An {
1606
1625
  * @deprecated
1607
1626
  */
1608
1627
  onChange(e) {
1609
- return process.env.NODE_ENV !== "production" && Le(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
1628
+ return process.env.NODE_ENV !== "production" && We(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
1610
1629
  }
1611
1630
  on(e, n) {
1612
- this.events[e] || (this.events[e] = new xn());
1631
+ this.events[e] || (this.events[e] = new Rn());
1613
1632
  const s = this.events[e].add(n);
1614
1633
  return e === "change" ? () => {
1615
1634
  s(), _.read(() => {
@@ -1681,11 +1700,11 @@ class An {
1681
1700
  * @public
1682
1701
  */
1683
1702
  getVelocity() {
1684
- const e = j.now();
1685
- if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Pt)
1703
+ const e = k.now();
1704
+ if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Nt)
1686
1705
  return 0;
1687
- const n = Math.min(this.updatedAt - this.prevUpdatedAt, Pt);
1688
- return on(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
1706
+ const n = Math.min(this.updatedAt - this.prevUpdatedAt, Nt);
1707
+ return gn(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
1689
1708
  }
1690
1709
  /**
1691
1710
  * Registers a new animation to control this `MotionValue`. Only one
@@ -1738,112 +1757,82 @@ class An {
1738
1757
  this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
1739
1758
  }
1740
1759
  }
1741
- function ie(t, e) {
1742
- return new An(t, e);
1760
+ function ae(t, e) {
1761
+ return new Lr(t, e);
1743
1762
  }
1744
- function Ri(t, e, n) {
1745
- t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, ie(n));
1763
+ function $r(t, e, n) {
1764
+ t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, ae(n));
1746
1765
  }
1747
- function Di(t, e) {
1748
- const n = jn(t, e);
1749
- let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
1750
- r = { ...r, ...s };
1751
- for (const o in r) {
1752
- const l = Ci(r[o]);
1753
- Ri(t, o, l);
1766
+ function Wr(t, e) {
1767
+ const n = Xn(t, e);
1768
+ let { transitionEnd: s = {}, transition: r = {}, ...i } = n || {};
1769
+ i = { ...i, ...s };
1770
+ for (const o in i) {
1771
+ const a = Kr(i[o]);
1772
+ $r(t, o, a);
1754
1773
  }
1755
1774
  }
1756
- const Ae = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Ni = "framerAppearId", Oi = "data-" + Ae(Ni);
1757
- function _i(t) {
1758
- return t.props[Oi];
1759
- }
1760
- function Ii(t) {
1761
- if (L.has(t))
1762
- return "transform";
1763
- if (bn.has(t))
1764
- return Ae(t);
1765
- }
1766
- class Ei extends An {
1767
- constructor() {
1768
- super(...arguments), this.output = [], this.counts = /* @__PURE__ */ new Map();
1769
- }
1770
- add(e) {
1771
- const n = Ii(e);
1772
- if (!n)
1773
- return;
1774
- const s = this.counts.get(n) || 0;
1775
- this.counts.set(n, s + 1), s === 0 && (this.output.push(n), this.update());
1776
- let i = !1;
1777
- return () => {
1778
- if (i)
1779
- return;
1780
- i = !0;
1781
- const r = this.counts.get(n) - 1;
1782
- this.counts.set(n, r), r === 0 && (st(this.output, n), this.update());
1783
- };
1784
- }
1785
- update() {
1786
- this.set(this.output.length ? this.output.join(", ") : "auto");
1787
- }
1775
+ const st = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Ur = "framerAppearId", jr = "data-" + st(Ur);
1776
+ function Gr(t) {
1777
+ return t.props[jr];
1788
1778
  }
1789
- const R = (t) => !!(t && t.getVelocity);
1790
- function Ki(t) {
1791
- return !!(R(t) && t.add);
1779
+ const O = (t) => !!(t && t.getVelocity);
1780
+ function zr(t) {
1781
+ return !!(O(t) && t.add);
1792
1782
  }
1793
- function Bi(t, e) {
1794
- var n;
1783
+ function qr(t, e) {
1795
1784
  if (!t.applyWillChange)
1796
1785
  return;
1797
- let s = t.getValue("willChange");
1798
- if (!s && !(!((n = t.props.style) === null || n === void 0) && n.willChange) && (s = new Ei("auto"), t.addValue("willChange", s)), Ki(s))
1799
- return s.add(e);
1786
+ const n = t.getValue("willChange");
1787
+ if (zr(n))
1788
+ return n.add(e);
1800
1789
  }
1801
- function ki({ protectedKeys: t, needsAnimating: e }, n) {
1790
+ function Yr({ protectedKeys: t, needsAnimating: e }, n) {
1802
1791
  const s = t.hasOwnProperty(n) && e[n] !== !0;
1803
1792
  return e[n] = !1, s;
1804
1793
  }
1805
- function Li(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
1806
- var r;
1807
- let { transition: o = t.getDefaultTransition(), transitionEnd: l, ...a } = e;
1794
+ function Hr(t, e, { delay: n = 0, transitionOverride: s, type: r } = {}) {
1795
+ var i;
1796
+ let { transition: o = t.getDefaultTransition(), transitionEnd: a, ...l } = e;
1808
1797
  s && (o = s);
1809
- const u = [], c = i && t.animationState && t.animationState.getState()[i];
1810
- for (const h in a) {
1811
- const f = t.getValue(h, (r = t.latestValues[h]) !== null && r !== void 0 ? r : null), d = a[h];
1812
- if (d === void 0 || c && ki(c, h))
1798
+ const u = [], c = r && t.animationState && t.animationState.getState()[r];
1799
+ for (const f in l) {
1800
+ const h = t.getValue(f, (i = t.latestValues[f]) !== null && i !== void 0 ? i : null), g = l[f];
1801
+ if (g === void 0 || c && Yr(c, f))
1813
1802
  continue;
1814
- const y = {
1803
+ const p = {
1815
1804
  delay: n,
1816
- ...Lt(o || {}, h)
1805
+ ...jt(o || {}, f)
1817
1806
  };
1818
- let v = !1;
1807
+ let b = !1;
1819
1808
  if (window.MotionHandoffAnimation) {
1820
- const m = _i(t);
1809
+ const m = Gr(t);
1821
1810
  if (m) {
1822
- const S = window.MotionHandoffAnimation(m, h, _);
1823
- S !== null && (y.startTime = S, v = !0);
1811
+ const y = window.MotionHandoffAnimation(m, f, _);
1812
+ y !== null && (p.startTime = y, b = !0);
1824
1813
  }
1825
1814
  }
1826
- f.start(Sn(h, f, d, t.shouldReduceMotion && L.has(h) ? { type: !1 } : y, t, v, Bi(t, h)));
1827
- const b = f.animation;
1828
- b && u.push(b);
1815
+ qr(t, f), h.start(Pn(f, h, g, t.shouldReduceMotion && G.has(f) ? { type: !1 } : p, t, b));
1816
+ const T = h.animation;
1817
+ T && u.push(T);
1829
1818
  }
1830
- return l && Promise.all(u).then(() => {
1819
+ return a && Promise.all(u).then(() => {
1831
1820
  _.update(() => {
1832
- l && Di(t, l);
1821
+ a && Wr(t, a);
1833
1822
  });
1834
1823
  }), u;
1835
1824
  }
1836
- const Rt = () => ({ min: 0, max: 0 }), Mn = () => ({
1837
- x: Rt(),
1838
- y: Rt()
1825
+ const It = () => ({ min: 0, max: 0 }), rt = () => ({
1826
+ x: It(),
1827
+ y: It()
1839
1828
  });
1840
- function Wi({ top: t, left: e, right: n, bottom: s }) {
1829
+ function Xr({ top: t, left: e, right: n, bottom: s }) {
1841
1830
  return {
1842
1831
  x: { min: e, max: n },
1843
1832
  y: { min: t, max: s }
1844
1833
  };
1845
1834
  }
1846
- function $i(t, e) {
1835
+ function Zr(t, e) {
1847
1836
  if (!e)
1848
1837
  return t;
1849
1838
  const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
@@ -1854,25 +1843,25 @@ function $i(t, e) {
1854
1843
  right: s.x
1855
1844
  };
1856
1845
  }
1857
- function Ui(t, e) {
1858
- return Wi($i(t.getBoundingClientRect(), e));
1846
+ function Qr(t, e) {
1847
+ return Xr(Zr(t.getBoundingClientRect(), e));
1859
1848
  }
1860
- const ji = {};
1861
- function Gi(t) {
1849
+ const Jr = {};
1850
+ function ei(t) {
1862
1851
  return t instanceof SVGElement && t.tagName !== "svg";
1863
1852
  }
1864
- function Cn(t, e, n) {
1865
- const s = R(t) ? t : ie(t);
1866
- return s.start(Sn("", s, e, n)), s.animation;
1853
+ function ti(t, e, n) {
1854
+ const s = O(t) ? t : ae(t);
1855
+ return s.start(Pn("", s, e, n)), s.animation;
1867
1856
  }
1868
- const zi = typeof window < "u";
1869
- function Fn(t) {
1870
- return $n(t.animate) || We.some((e) => Bt(t[e]));
1857
+ const ni = typeof window < "u";
1858
+ function Dn(t) {
1859
+ return qn(t.animate) || Qn.some((e) => Hn(t[e]));
1871
1860
  }
1872
- function qi(t) {
1873
- return !!(Fn(t) || t.variants);
1861
+ function si(t) {
1862
+ return !!(Dn(t) || t.variants);
1874
1863
  }
1875
- const Dt = {
1864
+ const _t = {
1876
1865
  animation: [
1877
1866
  "animate",
1878
1867
  "variants",
@@ -1891,17 +1880,17 @@ const Dt = {
1891
1880
  pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
1892
1881
  inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
1893
1882
  layout: ["layout", "layoutId"]
1894
- }, Be = {};
1895
- for (const t in Dt)
1896
- Be[t] = {
1897
- isEnabled: (e) => Dt[t].some((n) => !!e[n])
1883
+ }, Le = {};
1884
+ for (const t in _t)
1885
+ Le[t] = {
1886
+ isEnabled: (e) => _t[t].some((n) => !!e[n])
1898
1887
  };
1899
- function Pn(t, { style: e, vars: n }, s, i) {
1900
- Object.assign(t.style, e, i && i.getProjectionStyles(s));
1901
- for (const r in n)
1902
- t.style.setProperty(r, n[r]);
1888
+ function En(t, { style: e, vars: n }, s, r) {
1889
+ Object.assign(t.style, e, r && r.getProjectionStyles(s));
1890
+ for (const i in n)
1891
+ t.style.setProperty(i, n[i]);
1903
1892
  }
1904
- const Rn = /* @__PURE__ */ new Set([
1893
+ const Nn = /* @__PURE__ */ new Set([
1905
1894
  "baseFrequency",
1906
1895
  "diffuseConstant",
1907
1896
  "kernelMatrix",
@@ -1926,151 +1915,151 @@ const Rn = /* @__PURE__ */ new Set([
1926
1915
  "textLength",
1927
1916
  "lengthAdjust"
1928
1917
  ]);
1929
- function Yi(t, e, n, s) {
1930
- Pn(t, e, void 0, s);
1931
- for (const i in e.attrs)
1932
- t.setAttribute(Rn.has(i) ? i : Ae(i), e.attrs[i]);
1918
+ function ri(t, e, n, s) {
1919
+ En(t, e, void 0, s);
1920
+ for (const r in e.attrs)
1921
+ t.setAttribute(Nn.has(r) ? r : st(r), e.attrs[r]);
1933
1922
  }
1934
- function Hi(t, { layout: e, layoutId: n }) {
1935
- return L.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!ji[t] || t === "opacity");
1923
+ function ii(t, { layout: e, layoutId: n }) {
1924
+ return G.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Jr[t] || t === "opacity");
1936
1925
  }
1937
- function Dn(t, e, n) {
1926
+ function In(t, e, n) {
1938
1927
  var s;
1939
- const { style: i } = t, r = {};
1940
- for (const o in i)
1941
- (R(i[o]) || e.style && R(e.style[o]) || Hi(o, t) || ((s = n == null ? void 0 : n.getValue(o)) === null || s === void 0 ? void 0 : s.liveStyle) !== void 0) && (r[o] = i[o]);
1942
- return n && i && typeof i.willChange == "string" && (n.applyWillChange = !1), r;
1943
- }
1944
- function Xi(t, e, n) {
1945
- const s = Dn(t, e, n);
1946
- for (const i in t)
1947
- if (R(t[i]) || R(e[i])) {
1948
- const r = oe.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
1949
- s[r] = t[i];
1928
+ const { style: r } = t, i = {};
1929
+ for (const o in r)
1930
+ (O(r[o]) || e.style && O(e.style[o]) || ii(o, t) || ((s = n == null ? void 0 : n.getValue(o)) === null || s === void 0 ? void 0 : s.liveStyle) !== void 0) && (i[o] = r[o]);
1931
+ return n && r && typeof r.willChange == "string" && (n.applyWillChange = !1), i;
1932
+ }
1933
+ function oi(t, e, n) {
1934
+ const s = In(t, e, n);
1935
+ for (const r in t)
1936
+ if (O(t[r]) || O(e[r])) {
1937
+ const i = le.indexOf(r) !== -1 ? "attr" + r.charAt(0).toUpperCase() + r.substring(1) : r;
1938
+ s[i] = t[r];
1950
1939
  }
1951
1940
  return s;
1952
1941
  }
1953
- function Nt(t) {
1954
- const e = kn(null);
1942
+ function Kt(t) {
1943
+ const e = jn(null);
1955
1944
  return e.current === null && (e.current = t()), e.current;
1956
1945
  }
1957
- const Nn = (t, e) => e && typeof t == "number" ? e.transform(t) : t, Zi = {
1946
+ const _n = (t, e) => e && typeof t == "number" ? e.transform(t) : t, ai = {
1958
1947
  x: "translateX",
1959
1948
  y: "translateY",
1960
1949
  z: "translateZ",
1961
1950
  transformPerspective: "perspective"
1962
- }, Qi = oe.length;
1963
- function Ji(t, e, n) {
1964
- let s = "", i = !0;
1965
- for (let r = 0; r < Qi; r++) {
1966
- const o = oe[r], l = t[o];
1967
- if (l === void 0)
1951
+ }, li = le.length;
1952
+ function ui(t, e, n) {
1953
+ let s = "", r = !0;
1954
+ for (let i = 0; i < li; i++) {
1955
+ const o = le[i], a = t[o];
1956
+ if (a === void 0)
1968
1957
  continue;
1969
- let a = !0;
1970
- if (typeof l == "number" ? a = l === (o.startsWith("scale") ? 1 : 0) : a = parseFloat(l) === 0, !a || n) {
1971
- const u = Nn(l, ze[o]);
1972
- if (!a) {
1973
- i = !1;
1974
- const c = Zi[o] || o;
1958
+ let l = !0;
1959
+ if (typeof a == "number" ? l = a === (o.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) {
1960
+ const u = _n(a, He[o]);
1961
+ if (!l) {
1962
+ r = !1;
1963
+ const c = ai[o] || o;
1975
1964
  s += `${c}(${u}) `;
1976
1965
  }
1977
1966
  n && (e[o] = u);
1978
1967
  }
1979
1968
  }
1980
- return s = s.trim(), n ? s = n(e, i ? "" : s) : i && (s = "none"), s;
1969
+ return s = s.trim(), n ? s = n(e, r ? "" : s) : r && (s = "none"), s;
1981
1970
  }
1982
- function On(t, e, n) {
1983
- const { style: s, vars: i, transformOrigin: r } = t;
1984
- let o = !1, l = !1;
1985
- for (const a in e) {
1986
- const u = e[a];
1987
- if (L.has(a)) {
1971
+ function Kn(t, e, n) {
1972
+ const { style: s, vars: r, transformOrigin: i } = t;
1973
+ let o = !1, a = !1;
1974
+ for (const l in e) {
1975
+ const u = e[l];
1976
+ if (G.has(l)) {
1988
1977
  o = !0;
1989
1978
  continue;
1990
- } else if (jt(a)) {
1991
- i[a] = u;
1979
+ } else if (tn(l)) {
1980
+ r[l] = u;
1992
1981
  continue;
1993
1982
  } else {
1994
- const c = Nn(u, ze[a]);
1995
- a.startsWith("origin") ? (l = !0, r[a] = c) : s[a] = c;
1983
+ const c = _n(u, He[l]);
1984
+ l.startsWith("origin") ? (a = !0, i[l] = c) : s[l] = c;
1996
1985
  }
1997
1986
  }
1998
- if (e.transform || (o || n ? s.transform = Ji(e, t.transform, n) : s.transform && (s.transform = "none")), l) {
1999
- const { originX: a = "50%", originY: u = "50%", originZ: c = 0 } = r;
2000
- s.transformOrigin = `${a} ${u} ${c}`;
1987
+ if (e.transform || (o || n ? s.transform = ui(e, t.transform, n) : s.transform && (s.transform = "none")), a) {
1988
+ const { originX: l = "50%", originY: u = "50%", originZ: c = 0 } = i;
1989
+ s.transformOrigin = `${l} ${u} ${c}`;
2001
1990
  }
2002
1991
  }
2003
- function Ot(t, e, n) {
2004
- return typeof t == "string" ? t : p.transform(e + n * t);
1992
+ function Bt(t, e, n) {
1993
+ return typeof t == "string" ? t : d.transform(e + n * t);
2005
1994
  }
2006
- function er(t, e, n) {
2007
- const s = Ot(e, t.x, t.width), i = Ot(n, t.y, t.height);
2008
- return `${s} ${i}`;
1995
+ function ci(t, e, n) {
1996
+ const s = Bt(e, t.x, t.width), r = Bt(n, t.y, t.height);
1997
+ return `${s} ${r}`;
2009
1998
  }
2010
- const tr = {
1999
+ const fi = {
2011
2000
  offset: "stroke-dashoffset",
2012
2001
  array: "stroke-dasharray"
2013
- }, nr = {
2002
+ }, hi = {
2014
2003
  offset: "strokeDashoffset",
2015
2004
  array: "strokeDasharray"
2016
2005
  };
2017
- function sr(t, e, n = 1, s = 0, i = !0) {
2006
+ function di(t, e, n = 1, s = 0, r = !0) {
2018
2007
  t.pathLength = 1;
2019
- const r = i ? tr : nr;
2020
- t[r.offset] = p.transform(-s);
2021
- const o = p.transform(e), l = p.transform(n);
2022
- t[r.array] = `${o} ${l}`;
2008
+ const i = r ? fi : hi;
2009
+ t[i.offset] = d.transform(-s);
2010
+ const o = d.transform(e), a = d.transform(n);
2011
+ t[i.array] = `${o} ${a}`;
2023
2012
  }
2024
- function ir(t, {
2013
+ function pi(t, {
2025
2014
  attrX: e,
2026
2015
  attrY: n,
2027
2016
  attrScale: s,
2028
- originX: i,
2029
- originY: r,
2017
+ originX: r,
2018
+ originY: i,
2030
2019
  pathLength: o,
2031
- pathSpacing: l = 1,
2032
- pathOffset: a = 0,
2020
+ pathSpacing: a = 1,
2021
+ pathOffset: l = 0,
2033
2022
  // This is object creation, which we try to avoid per-frame.
2034
2023
  ...u
2035
- }, c, h) {
2036
- if (On(t, u, h), c) {
2024
+ }, c, f) {
2025
+ if (Kn(t, u, f), c) {
2037
2026
  t.style.viewBox && (t.attrs.viewBox = t.style.viewBox);
2038
2027
  return;
2039
2028
  }
2040
2029
  t.attrs = t.style, t.style = {};
2041
- const { attrs: f, style: d, dimensions: y } = t;
2042
- f.transform && (y && (d.transform = f.transform), delete f.transform), y && (i !== void 0 || r !== void 0 || d.transform) && (d.transformOrigin = er(y, i !== void 0 ? i : 0.5, r !== void 0 ? r : 0.5)), e !== void 0 && (f.x = e), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), o !== void 0 && sr(f, o, l, a, !1);
2030
+ const { attrs: h, style: g, dimensions: p } = t;
2031
+ h.transform && (p && (g.transform = h.transform), delete h.transform), p && (r !== void 0 || i !== void 0 || g.transform) && (g.transformOrigin = ci(p, r !== void 0 ? r : 0.5, i !== void 0 ? i : 0.5)), e !== void 0 && (h.x = e), n !== void 0 && (h.y = n), s !== void 0 && (h.scale = s), o !== void 0 && di(h, o, a, l, !1);
2043
2032
  }
2044
- const rr = (t) => typeof t == "string" && t.toLowerCase() === "svg", ke = { current: null }, _n = { current: !1 };
2045
- function or() {
2046
- if (_n.current = !0, !!zi)
2033
+ const mi = (t) => typeof t == "string" && t.toLowerCase() === "svg", $e = { current: null }, Bn = { current: !1 };
2034
+ function gi() {
2035
+ if (Bn.current = !0, !!ni)
2047
2036
  if (window.matchMedia) {
2048
- const t = window.matchMedia("(prefers-reduced-motion)"), e = () => ke.current = t.matches;
2037
+ const t = window.matchMedia("(prefers-reduced-motion)"), e = () => $e.current = t.matches;
2049
2038
  t.addListener(e), e();
2050
2039
  } else
2051
- ke.current = !1;
2040
+ $e.current = !1;
2052
2041
  }
2053
- function ar(t, e, n) {
2042
+ function yi(t, e, n) {
2054
2043
  for (const s in e) {
2055
- const i = e[s], r = n[s];
2056
- if (R(i))
2057
- t.addValue(s, i), process.env.NODE_ENV === "development" && Le(i.version === "11.5.4", `Attempting to mix Framer Motion versions ${i.version} with 11.5.4 may not work as expected.`);
2058
- else if (R(r))
2059
- t.addValue(s, ie(i, { owner: t }));
2060
- else if (r !== i)
2044
+ const r = e[s], i = n[s];
2045
+ if (O(r))
2046
+ t.addValue(s, r), process.env.NODE_ENV === "development" && We(r.version === "11.11.9", `Attempting to mix Framer Motion versions ${r.version} with 11.11.9 may not work as expected.`);
2047
+ else if (O(i))
2048
+ t.addValue(s, ae(r, { owner: t }));
2049
+ else if (i !== r)
2061
2050
  if (t.hasValue(s)) {
2062
2051
  const o = t.getValue(s);
2063
- o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
2052
+ o.liveStyle === !0 ? o.jump(r) : o.hasAnimated || o.set(r);
2064
2053
  } else {
2065
2054
  const o = t.getStaticValue(s);
2066
- t.addValue(s, ie(o !== void 0 ? o : i, { owner: t }));
2055
+ t.addValue(s, ae(o !== void 0 ? o : r, { owner: t }));
2067
2056
  }
2068
2057
  }
2069
2058
  for (const s in n)
2070
2059
  e[s] === void 0 && t.removeValue(s);
2071
2060
  return e;
2072
2061
  }
2073
- const re = /* @__PURE__ */ new WeakMap(), lr = [...qt, C, X], ur = (t) => lr.find(zt(t)), _t = [
2062
+ const X = /* @__PURE__ */ new WeakMap(), vi = [...rn, C, Q], bi = (t) => vi.find(sn(t)), kt = [
2074
2063
  "AnimationStart",
2075
2064
  "AnimationComplete",
2076
2065
  "Update",
@@ -2078,8 +2067,8 @@ const re = /* @__PURE__ */ new WeakMap(), lr = [...qt, C, X], ur = (t) => lr.fin
2078
2067
  "LayoutMeasure",
2079
2068
  "LayoutAnimationStart",
2080
2069
  "LayoutAnimationComplete"
2081
- ], cr = We.length;
2082
- class hr {
2070
+ ];
2071
+ class kn {
2083
2072
  /**
2084
2073
  * This method takes React props and returns found MotionValues. For example, HTML
2085
2074
  * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
@@ -2090,25 +2079,26 @@ class hr {
2090
2079
  scrapeMotionValuesFromProps(e, n, s) {
2091
2080
  return {};
2092
2081
  }
2093
- constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: o }, l = {}) {
2094
- this.applyWillChange = !1, this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = je, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
2095
- this.isRenderScheduled = !1, this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
2096
- }, this.isRenderScheduled = !1, this.scheduleRender = () => {
2097
- this.isRenderScheduled || (this.isRenderScheduled = !0, _.render(this.render, !1, !0));
2082
+ constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: r, blockInitialAnimation: i, visualState: o }, a = {}) {
2083
+ this.applyWillChange = !1, this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = ze, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
2084
+ this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
2085
+ }, this.renderScheduledAt = 0, this.scheduleRender = () => {
2086
+ const h = k.now();
2087
+ this.renderScheduledAt < h && (this.renderScheduledAt = h, _.render(this.render, !1, !0));
2098
2088
  };
2099
- const { latestValues: a, renderState: u } = o;
2100
- this.latestValues = a, this.baseTarget = { ...a }, this.initialValues = n.initial ? { ...a } : {}, this.renderState = u, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = i, this.options = l, this.blockInitialAnimation = !!r, this.isControllingVariants = Fn(n), this.isVariantNode = qi(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
2101
- const { willChange: c, ...h } = this.scrapeMotionValuesFromProps(n, {}, this);
2102
- for (const f in h) {
2103
- const d = h[f];
2104
- a[f] !== void 0 && R(d) && d.set(a[f], !1);
2089
+ const { latestValues: l, renderState: u } = o;
2090
+ this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = u, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = r, this.options = a, this.blockInitialAnimation = !!i, this.isControllingVariants = Dn(n), this.isVariantNode = si(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
2091
+ const { willChange: c, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
2092
+ for (const h in f) {
2093
+ const g = f[h];
2094
+ l[h] !== void 0 && O(g) && g.set(l[h], !1);
2105
2095
  }
2106
2096
  }
2107
2097
  mount(e) {
2108
- this.current = e, re.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, s) => this.bindToMotionValue(s, n)), _n.current || or(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : ke.current, process.env.NODE_ENV !== "production" && Le(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);
2098
+ this.current = e, X.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, s) => this.bindToMotionValue(s, n)), Bn.current || gi(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : $e.current, process.env.NODE_ENV !== "production" && We(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);
2109
2099
  }
2110
2100
  unmount() {
2111
- re.delete(this.current), this.projection && this.projection.unmount(), be(this.notifyUpdate), be(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
2101
+ X.delete(this.current), this.projection && this.projection.unmount(), Re(this.notifyUpdate), Re(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
2112
2102
  for (const e in this.events)
2113
2103
  this.events[e].clear();
2114
2104
  for (const e in this.features) {
@@ -2119,12 +2109,12 @@ class hr {
2119
2109
  }
2120
2110
  bindToMotionValue(e, n) {
2121
2111
  this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
2122
- const s = L.has(e), i = n.on("change", (l) => {
2123
- this.latestValues[e] = l, this.props.onUpdate && _.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
2124
- }), r = n.on("renderRequest", this.scheduleRender);
2112
+ const s = G.has(e), r = n.on("change", (a) => {
2113
+ this.latestValues[e] = a, this.props.onUpdate && _.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
2114
+ }), i = n.on("renderRequest", this.scheduleRender);
2125
2115
  let o;
2126
2116
  window.MotionCheckAppearSync && (o = window.MotionCheckAppearSync(this, e, n)), this.valueSubscriptions.set(e, () => {
2127
- i(), r(), o && o(), n.owner && n.stop();
2117
+ r(), i(), o && o(), n.owner && n.stop();
2128
2118
  });
2129
2119
  }
2130
2120
  sortNodePosition(e) {
@@ -2132,14 +2122,14 @@ class hr {
2132
2122
  }
2133
2123
  updateFeatures() {
2134
2124
  let e = "animation";
2135
- for (e in Be) {
2136
- const n = Be[e];
2125
+ for (e in Le) {
2126
+ const n = Le[e];
2137
2127
  if (!n)
2138
2128
  continue;
2139
- const { isEnabled: s, Feature: i } = n;
2140
- if (!this.features[e] && i && s(this.props) && (this.features[e] = new i(this)), this.features[e]) {
2141
- const r = this.features[e];
2142
- r.isMounted ? r.update() : (r.mount(), r.isMounted = !0);
2129
+ const { isEnabled: s, Feature: r } = n;
2130
+ if (!this.features[e] && r && s(this.props) && (this.features[e] = new r(this)), this.features[e]) {
2131
+ const i = this.features[e];
2132
+ i.isMounted ? i.update() : (i.mount(), i.isMounted = !0);
2143
2133
  }
2144
2134
  }
2145
2135
  }
@@ -2152,7 +2142,7 @@ class hr {
2152
2142
  * removed with a re-render to work.
2153
2143
  */
2154
2144
  measureViewportBox() {
2155
- return this.current ? this.measureInstanceViewportBox(this.current, this.props) : Mn();
2145
+ return this.current ? this.measureInstanceViewportBox(this.current, this.props) : rt();
2156
2146
  }
2157
2147
  getStaticValue(e) {
2158
2148
  return this.latestValues[e];
@@ -2166,13 +2156,13 @@ class hr {
2166
2156
  */
2167
2157
  update(e, n) {
2168
2158
  (e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
2169
- for (let s = 0; s < _t.length; s++) {
2170
- const i = _t[s];
2171
- this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
2172
- const r = "on" + i, o = e[r];
2173
- o && (this.propEventSubscriptions[i] = this.on(i, o));
2159
+ for (let s = 0; s < kt.length; s++) {
2160
+ const r = kt[s];
2161
+ this.propEventSubscriptions[r] && (this.propEventSubscriptions[r](), delete this.propEventSubscriptions[r]);
2162
+ const i = "on" + r, o = e[i];
2163
+ o && (this.propEventSubscriptions[r] = this.on(r, o));
2174
2164
  }
2175
- this.prevMotionValues = ar(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
2165
+ this.prevMotionValues = yi(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
2176
2166
  }
2177
2167
  getProps() {
2178
2168
  return this.props;
@@ -2195,20 +2185,6 @@ class hr {
2195
2185
  getClosestVariantNode() {
2196
2186
  return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
2197
2187
  }
2198
- getVariantContext(e = !1) {
2199
- if (e)
2200
- return this.parent ? this.parent.getVariantContext() : void 0;
2201
- if (!this.isControllingVariants) {
2202
- const s = this.parent ? this.parent.getVariantContext() || {} : {};
2203
- return this.props.initial !== void 0 && (s.initial = this.props.initial), s;
2204
- }
2205
- const n = {};
2206
- for (let s = 0; s < cr; s++) {
2207
- const i = We[s], r = this.props[i];
2208
- (Bt(r) || r === !1) && (n[i] = r);
2209
- }
2210
- return n;
2211
- }
2212
2188
  /**
2213
2189
  * Add a child visual element to our set of children.
2214
2190
  */
@@ -2242,7 +2218,7 @@ class hr {
2242
2218
  if (this.props.values && this.props.values[e])
2243
2219
  return this.props.values[e];
2244
2220
  let s = this.values.get(e);
2245
- return s === void 0 && n !== void 0 && (s = ie(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
2221
+ return s === void 0 && n !== void 0 && (s = ae(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
2246
2222
  }
2247
2223
  /**
2248
2224
  * If we're trying to animate to a previously unencountered value,
@@ -2251,8 +2227,8 @@ class hr {
2251
2227
  */
2252
2228
  readValue(e, n) {
2253
2229
  var s;
2254
- let i = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (s = this.getBaseTargetFromProps(this.props, e)) !== null && s !== void 0 ? s : this.readValueFromInstance(this.current, e, this.options);
2255
- return i != null && (typeof i == "string" && ($t(i) || Wt(i)) ? i = parseFloat(i) : !ur(i) && X.test(n) && (i = tn(e, n)), this.setBaseTarget(e, R(i) ? i.get() : i)), R(i) ? i.get() : i;
2230
+ let r = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (s = this.getBaseTargetFromProps(this.props, e)) !== null && s !== void 0 ? s : this.readValueFromInstance(this.current, e, this.options);
2231
+ return r != null && (typeof r == "string" && (Jt(r) || Qt(r)) ? r = parseFloat(r) : !bi(r) && Q.test(n) && (r = dn(e, n)), this.setBaseTarget(e, O(r) ? r.get() : r)), O(r) ? r.get() : r;
2256
2232
  }
2257
2233
  /**
2258
2234
  * Set the base target to later animate back to. This is currently
@@ -2268,26 +2244,26 @@ class hr {
2268
2244
  getBaseTarget(e) {
2269
2245
  var n;
2270
2246
  const { initial: s } = this.props;
2271
- let i;
2247
+ let r;
2272
2248
  if (typeof s == "string" || typeof s == "object") {
2273
- const o = kt(this.props, s, (n = this.presenceContext) === null || n === void 0 ? void 0 : n.custom);
2274
- o && (i = o[e]);
2249
+ const o = Ut(this.props, s, (n = this.presenceContext) === null || n === void 0 ? void 0 : n.custom);
2250
+ o && (r = o[e]);
2275
2251
  }
2276
- if (s && i !== void 0)
2277
- return i;
2278
- const r = this.getBaseTargetFromProps(this.props, e);
2279
- return r !== void 0 && !R(r) ? r : this.initialValues[e] !== void 0 && i === void 0 ? void 0 : this.baseTarget[e];
2252
+ if (s && r !== void 0)
2253
+ return r;
2254
+ const i = this.getBaseTargetFromProps(this.props, e);
2255
+ return i !== void 0 && !O(i) ? i : this.initialValues[e] !== void 0 && r === void 0 ? void 0 : this.baseTarget[e];
2280
2256
  }
2281
2257
  on(e, n) {
2282
- return this.events[e] || (this.events[e] = new xn()), this.events[e].add(n);
2258
+ return this.events[e] || (this.events[e] = new Rn()), this.events[e].add(n);
2283
2259
  }
2284
2260
  notify(e, ...n) {
2285
2261
  this.events[e] && this.events[e].notify(...n);
2286
2262
  }
2287
2263
  }
2288
- class In extends hr {
2264
+ class Ln extends kn {
2289
2265
  constructor() {
2290
- super(...arguments), this.KeyframeResolver = nn;
2266
+ super(...arguments), this.KeyframeResolver = pn;
2291
2267
  }
2292
2268
  sortInstanceNodePosition(e, n) {
2293
2269
  return e.compareDocumentPosition(n) & 2 ? 1 : -1;
@@ -2299,315 +2275,373 @@ class In extends hr {
2299
2275
  delete n[e], delete s[e];
2300
2276
  }
2301
2277
  }
2302
- function fr(t) {
2278
+ function Ti(t) {
2303
2279
  return window.getComputedStyle(t);
2304
2280
  }
2305
- class dr extends In {
2281
+ class Vi extends Ln {
2306
2282
  constructor() {
2307
- super(...arguments), this.type = "html", this.applyWillChange = !0, this.renderInstance = Pn;
2283
+ super(...arguments), this.type = "html", this.applyWillChange = !0, this.renderInstance = En;
2308
2284
  }
2309
2285
  readValueFromInstance(e, n) {
2310
- if (L.has(n)) {
2311
- const s = qe(n);
2286
+ if (G.has(n)) {
2287
+ const s = Xe(n);
2312
2288
  return s && s.default || 0;
2313
2289
  } else {
2314
- const s = fr(e), i = (jt(n) ? s.getPropertyValue(n) : s[n]) || 0;
2315
- return typeof i == "string" ? i.trim() : i;
2290
+ const s = Ti(e), r = (tn(n) ? s.getPropertyValue(n) : s[n]) || 0;
2291
+ return typeof r == "string" ? r.trim() : r;
2316
2292
  }
2317
2293
  }
2318
2294
  measureInstanceViewportBox(e, { transformPagePoint: n }) {
2319
- return Ui(e, n);
2295
+ return Qr(e, n);
2320
2296
  }
2321
2297
  build(e, n, s) {
2322
- On(e, n, s.transformTemplate);
2298
+ Kn(e, n, s.transformTemplate);
2323
2299
  }
2324
2300
  scrapeMotionValuesFromProps(e, n, s) {
2325
- return Dn(e, n, s);
2301
+ return In(e, n, s);
2326
2302
  }
2327
2303
  handleChildMotionValue() {
2328
2304
  this.childSubscription && (this.childSubscription(), delete this.childSubscription);
2329
2305
  const { children: e } = this.props;
2330
- R(e) && (this.childSubscription = e.on("change", (n) => {
2306
+ O(e) && (this.childSubscription = e.on("change", (n) => {
2331
2307
  this.current && (this.current.textContent = `${n}`);
2332
2308
  }));
2333
2309
  }
2334
2310
  }
2335
- class pr extends In {
2311
+ class wi extends Ln {
2336
2312
  constructor() {
2337
- super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = Mn;
2313
+ super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = rt;
2338
2314
  }
2339
2315
  getBaseTargetFromProps(e, n) {
2340
2316
  return e[n];
2341
2317
  }
2342
2318
  readValueFromInstance(e, n) {
2343
- if (L.has(n)) {
2344
- const s = qe(n);
2319
+ if (G.has(n)) {
2320
+ const s = Xe(n);
2345
2321
  return s && s.default || 0;
2346
2322
  }
2347
- return n = Rn.has(n) ? n : Ae(n), e.getAttribute(n);
2323
+ return n = Nn.has(n) ? n : st(n), e.getAttribute(n);
2348
2324
  }
2349
2325
  scrapeMotionValuesFromProps(e, n, s) {
2350
- return Xi(e, n, s);
2326
+ return oi(e, n, s);
2351
2327
  }
2352
2328
  build(e, n, s) {
2353
- ir(e, n, this.isSVGTag, s.transformTemplate);
2329
+ pi(e, n, this.isSVGTag, s.transformTemplate);
2354
2330
  }
2355
- renderInstance(e, n, s, i) {
2356
- Yi(e, n, s, i);
2331
+ renderInstance(e, n, s, r) {
2332
+ ri(e, n, s, r);
2357
2333
  }
2358
2334
  mount(e) {
2359
- this.isSVGTag = rr(e.tagName), super.mount(e);
2335
+ this.isSVGTag = mi(e.tagName), super.mount(e);
2360
2336
  }
2361
2337
  }
2362
- function En(t, e, n) {
2338
+ function Si(t, e, n) {
2363
2339
  var s;
2364
2340
  if (typeof t == "string") {
2365
- let i = document;
2366
- e && (k(!!e.current, "Scope provided, but no element detected."), i = e.current), n ? ((s = n[t]) !== null && s !== void 0 || (n[t] = i.querySelectorAll(t)), t = n[t]) : t = i.querySelectorAll(t);
2341
+ let r = document;
2342
+ e && ($(!!e.current, "Scope provided, but no element detected."), r = e.current), n ? ((s = n[t]) !== null && s !== void 0 || (n[t] = r.querySelectorAll(t)), t = n[t]) : t = r.querySelectorAll(t);
2367
2343
  } else t instanceof Element && (t = [t]);
2368
2344
  return Array.from(t || []);
2369
2345
  }
2370
- function mr(t) {
2371
- return ye(() => () => t(), []);
2372
- }
2373
- function gr(t) {
2374
- return typeof t == "object" && !Array.isArray(t);
2375
- }
2376
- function yr(t) {
2377
- const e = {
2378
- presenceContext: null,
2379
- props: {},
2380
- visualState: {
2381
- renderState: {
2382
- transform: {},
2383
- transformOrigin: {},
2384
- style: {},
2385
- vars: {},
2386
- attrs: {}
2387
- },
2388
- latestValues: {}
2389
- }
2390
- }, n = Gi(t) ? new pr(e) : new dr(e);
2391
- n.mount(t), re.set(t, n);
2346
+ function xi(t) {
2347
+ return ge(() => () => t(), []);
2392
2348
  }
2393
- function vr(t, e = 100) {
2394
- const n = Ye({ keyframes: [0, e], ...t }), s = Math.min(vn(n), Ke);
2349
+ function Ai(t, e = 100, n) {
2350
+ const s = n({ ...t, keyframes: [0, e] }), r = Math.min(xn(s), Be);
2395
2351
  return {
2396
2352
  type: "keyframes",
2397
- ease: (i) => n.next(s * i).value / e,
2398
- duration: I(s)
2353
+ ease: (i) => s.next(r * i).value / e,
2354
+ duration: I(r)
2399
2355
  };
2400
2356
  }
2401
- function It(t, e, n, s) {
2402
- var i;
2403
- return typeof e == "number" ? e : e.startsWith("-") || e.startsWith("+") ? Math.max(0, t + parseFloat(e)) : e === "<" ? n : (i = s.get(e)) !== null && i !== void 0 ? i : t;
2357
+ function it(t) {
2358
+ return typeof t == "object" && !Array.isArray(t);
2359
+ }
2360
+ function $n(t, e, n, s) {
2361
+ return typeof t == "string" && it(e) ? Si(t, n, s) : t instanceof NodeList ? Array.from(t) : Array.isArray(t) ? t : [t];
2362
+ }
2363
+ function Lt(t, e, n, s) {
2364
+ var r;
2365
+ return typeof e == "number" ? e : e.startsWith("-") || e.startsWith("+") ? Math.max(0, t + parseFloat(e)) : e === "<" ? n : (r = s.get(e)) !== null && r !== void 0 ? r : t;
2404
2366
  }
2405
- const br = (t, e, n) => {
2367
+ const Mi = (t, e, n) => {
2406
2368
  const s = e - t;
2407
2369
  return ((n - t) % s + s) % s + t;
2408
2370
  };
2409
- function Tr(t, e) {
2410
- return cn(t) ? t[br(0, t.length, e)] : t;
2371
+ function Ci(t, e) {
2372
+ return bn(t) ? t[Mi(0, t.length, e)] : t;
2411
2373
  }
2412
- function Vr(t, e, n) {
2374
+ function Fi(t, e, n) {
2413
2375
  for (let s = 0; s < t.length; s++) {
2414
- const i = t[s];
2415
- i.at > e && i.at < n && (st(t, i), s--);
2376
+ const r = t[s];
2377
+ r.at > e && r.at < n && (On(t, r), s--);
2416
2378
  }
2417
2379
  }
2418
- function wr(t, e, n, s, i, r) {
2419
- Vr(t, i, r);
2380
+ function Pi(t, e, n, s, r, i) {
2381
+ Fi(t, r, i);
2420
2382
  for (let o = 0; o < e.length; o++)
2421
2383
  t.push({
2422
2384
  value: e[o],
2423
- at: he(i, r, s[o]),
2424
- easing: Tr(n, o)
2385
+ at: he(r, i, s[o]),
2386
+ easing: Ci(n, o)
2425
2387
  });
2426
2388
  }
2427
- function Sr(t, e) {
2389
+ function Oi(t, e) {
2428
2390
  return t.at === e.at ? t.value === null ? 1 : e.value === null ? -1 : 0 : t.at - e.at;
2429
2391
  }
2430
- const xr = "easeInOut";
2431
- function Ar(t, { defaultTransition: e = {}, ...n } = {}, s) {
2432
- const i = e.duration || 0.3, r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = {}, a = /* @__PURE__ */ new Map();
2433
- let u = 0, c = 0, h = 0;
2434
- for (let f = 0; f < t.length; f++) {
2435
- const d = t[f];
2436
- if (typeof d == "string") {
2437
- a.set(d, c);
2392
+ const Ri = "easeInOut";
2393
+ function Di(t, { defaultTransition: e = {}, ...n } = {}, s, r) {
2394
+ const i = e.duration || 0.3, o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = {}, u = /* @__PURE__ */ new Map();
2395
+ let c = 0, f = 0, h = 0;
2396
+ for (let g = 0; g < t.length; g++) {
2397
+ const p = t[g];
2398
+ if (typeof p == "string") {
2399
+ u.set(p, f);
2438
2400
  continue;
2439
- } else if (!Array.isArray(d)) {
2440
- a.set(d.name, It(c, d.at, u, a));
2401
+ } else if (!Array.isArray(p)) {
2402
+ u.set(p.name, Lt(f, p.at, c, u));
2441
2403
  continue;
2442
2404
  }
2443
- let [y, v, b = {}] = d;
2444
- b.at !== void 0 && (c = It(c, b.at, u, a));
2445
- let m = 0;
2446
- const S = (V, w, T, x = 0, F = 0) => {
2447
- const g = Mr(V), { delay: P = 0, times: A = yn(g), type: fe = "keyframes", ...Me } = w;
2448
- let { ease: de = e.ease || "easeOut", duration: N } = w;
2449
- const Z = typeof P == "function" ? P(x, F) : P, D = g.length;
2450
- if (D <= 2 && fe === "spring") {
2451
- let ot = 100;
2452
- if (D === 2 && Pr(g)) {
2453
- const Bn = g[1] - g[0];
2454
- ot = Math.abs(Bn);
2405
+ let [b, T, m = {}] = p;
2406
+ m.at !== void 0 && (f = Lt(f, m.at, c, u));
2407
+ let y = 0;
2408
+ const S = (w, v, x, F = 0, V = 0) => {
2409
+ const A = Ei(w), { delay: P = 0, times: N = Sn(A), type: J = "keyframes", ...Me } = v;
2410
+ let { ease: ee = e.ease || "easeOut", duration: D } = v;
2411
+ const R = typeof P == "function" ? P(F, V) : P, de = A.length, ot = xe(J) ? J : r == null ? void 0 : r[J];
2412
+ if (de <= 2 && ot) {
2413
+ let ct = 100;
2414
+ if (de === 2 && _i(A)) {
2415
+ const Un = A[1] - A[0];
2416
+ ct = Math.abs(Un);
2455
2417
  }
2456
- const at = { ...Me };
2457
- N !== void 0 && (at.duration = O(N));
2458
- const lt = vr(at, ot);
2459
- de = lt.ease, N = lt.duration;
2418
+ const ft = { ...Me };
2419
+ D !== void 0 && (ft.duration = E(D));
2420
+ const ht = Ai(ft, ct, ot);
2421
+ ee = ht.ease, D = ht.duration;
2460
2422
  }
2461
- N ?? (N = i);
2462
- const pe = c + Z, it = pe + N;
2463
- A.length === 1 && A[0] === 0 && (A[1] = 1);
2464
- const rt = A.length - g.length;
2465
- rt > 0 && gn(A, rt), g.length === 1 && g.unshift(null), wr(T, g, de, A, pe, it), m = Math.max(Z + N, m), h = Math.max(it, h);
2423
+ D ?? (D = i);
2424
+ const at = f + R, lt = at + D;
2425
+ N.length === 1 && N[0] === 0 && (N[1] = 1);
2426
+ const ut = N.length - A.length;
2427
+ ut > 0 && wn(N, ut), A.length === 1 && A.unshift(null), Pi(x, A, ee, N, at, lt), y = Math.max(R + D, y), h = Math.max(lt, h);
2466
2428
  };
2467
- if (R(y)) {
2468
- const V = Et(y, o);
2469
- S(v, b, Kt("default", V));
2429
+ if (O(b)) {
2430
+ const w = $t(b, a);
2431
+ S(T, m, Wt("default", w));
2470
2432
  } else {
2471
- const V = En(y, s, l), w = V.length;
2472
- for (let T = 0; T < w; T++) {
2473
- v = v, b = b;
2474
- const x = V[T], F = Et(x, o);
2475
- for (const g in v)
2476
- S(v[g], Cr(b, g), Kt(g, F), T, w);
2433
+ const w = $n(b, T, s, l), v = w.length;
2434
+ for (let x = 0; x < v; x++) {
2435
+ T = T, m = m;
2436
+ const F = w[x], V = $t(F, a);
2437
+ for (const A in T)
2438
+ S(T[A], Ni(m, A), Wt(A, V), x, v);
2477
2439
  }
2478
2440
  }
2479
- u = c, c += m;
2480
- }
2481
- return o.forEach((f, d) => {
2482
- for (const y in f) {
2483
- const v = f[y];
2484
- v.sort(Sr);
2485
- const b = [], m = [], S = [];
2486
- for (let w = 0; w < v.length; w++) {
2487
- const { at: T, value: x, easing: F } = v[w];
2488
- b.push(x), m.push(Qe(0, h, T)), S.push(F || "easeOut");
2441
+ c = f, f += y;
2442
+ }
2443
+ return a.forEach((g, p) => {
2444
+ for (const b in g) {
2445
+ const T = g[b];
2446
+ T.sort(Oi);
2447
+ const m = [], y = [], S = [];
2448
+ for (let v = 0; v < T.length; v++) {
2449
+ const { at: x, value: F, easing: V } = T[v];
2450
+ m.push(F), y.push(Ae(0, h, x)), S.push(V || "easeOut");
2489
2451
  }
2490
- m[0] !== 0 && (m.unshift(0), b.unshift(b[0]), S.unshift(xr)), m[m.length - 1] !== 1 && (m.push(1), b.push(null)), r.has(d) || r.set(d, {
2452
+ y[0] !== 0 && (y.unshift(0), m.unshift(m[0]), S.unshift(Ri)), y[y.length - 1] !== 1 && (y.push(1), m.push(null)), o.has(p) || o.set(p, {
2491
2453
  keyframes: {},
2492
2454
  transition: {}
2493
2455
  });
2494
- const V = r.get(d);
2495
- V.keyframes[y] = b, V.transition[y] = {
2456
+ const w = o.get(p);
2457
+ w.keyframes[b] = m, w.transition[b] = {
2496
2458
  ...e,
2497
2459
  duration: h,
2498
2460
  ease: S,
2499
- times: m,
2461
+ times: y,
2500
2462
  ...n
2501
2463
  };
2502
2464
  }
2503
- }), r;
2465
+ }), o;
2504
2466
  }
2505
- function Et(t, e) {
2467
+ function $t(t, e) {
2506
2468
  return !e.has(t) && e.set(t, {}), e.get(t);
2507
2469
  }
2508
- function Kt(t, e) {
2470
+ function Wt(t, e) {
2509
2471
  return e[t] || (e[t] = []), e[t];
2510
2472
  }
2511
- function Mr(t) {
2473
+ function Ei(t) {
2512
2474
  return Array.isArray(t) ? t : [t];
2513
2475
  }
2514
- function Cr(t, e) {
2515
- return t[e] ? {
2476
+ function Ni(t, e) {
2477
+ return t && t[e] ? {
2516
2478
  ...t,
2517
2479
  ...t[e]
2518
2480
  } : { ...t };
2519
2481
  }
2520
- const Fr = (t) => typeof t == "number", Pr = (t) => t.every(Fr);
2521
- function Kn(t, e, n, s) {
2522
- const i = En(t, s), r = i.length;
2523
- k(!!r, "No valid element provided.");
2524
- const o = [];
2525
- for (let l = 0; l < r; l++) {
2526
- const a = i[l];
2527
- re.has(a) || yr(a);
2528
- const u = re.get(a), c = { ...n };
2529
- typeof c.delay == "function" && (c.delay = c.delay(l, r)), o.push(...Li(u, { ...e, transition: c }, {}));
2530
- }
2531
- return new nt(o);
2532
- }
2533
- const Rr = (t) => Array.isArray(t) && Array.isArray(t[0]);
2534
- function Dr(t, e, n) {
2482
+ const Ii = (t) => typeof t == "number", _i = (t) => t.every(Ii);
2483
+ function Ki(t, e) {
2484
+ return t in e;
2485
+ }
2486
+ class Bi extends kn {
2487
+ constructor() {
2488
+ super(...arguments), this.type = "object";
2489
+ }
2490
+ readValueFromInstance(e, n) {
2491
+ if (Ki(n, e)) {
2492
+ const s = e[n];
2493
+ if (typeof s == "string" || typeof s == "number")
2494
+ return s;
2495
+ }
2496
+ }
2497
+ getBaseTargetFromProps() {
2498
+ }
2499
+ removeValueFromRenderState(e, n) {
2500
+ delete n.output[e];
2501
+ }
2502
+ measureInstanceViewportBox() {
2503
+ return rt();
2504
+ }
2505
+ build(e, n) {
2506
+ Object.assign(e.output, n);
2507
+ }
2508
+ renderInstance(e, { output: n }) {
2509
+ Object.assign(e, n);
2510
+ }
2511
+ sortInstanceNodePosition() {
2512
+ return 0;
2513
+ }
2514
+ }
2515
+ function ki(t) {
2516
+ const e = {
2517
+ presenceContext: null,
2518
+ props: {},
2519
+ visualState: {
2520
+ renderState: {
2521
+ transform: {},
2522
+ transformOrigin: {},
2523
+ style: {},
2524
+ vars: {},
2525
+ attrs: {}
2526
+ },
2527
+ latestValues: {}
2528
+ }
2529
+ }, n = ei(t) ? new wi(e) : new Vi(e);
2530
+ n.mount(t), X.set(t, n);
2531
+ }
2532
+ function Li(t) {
2533
+ const e = {
2534
+ presenceContext: null,
2535
+ props: {},
2536
+ visualState: {
2537
+ renderState: {
2538
+ output: {}
2539
+ },
2540
+ latestValues: {}
2541
+ }
2542
+ }, n = new Bi(e);
2543
+ n.mount(t), X.set(t, n);
2544
+ }
2545
+ function $i(t, e) {
2546
+ return O(t) || typeof t == "number" || typeof t == "string" && !it(e);
2547
+ }
2548
+ function Wn(t, e, n, s) {
2549
+ const r = [];
2550
+ if ($i(t, e))
2551
+ r.push(ti(t, it(e) && e.default || e, n && (n.default || n)));
2552
+ else {
2553
+ const i = $n(t, e, s), o = i.length;
2554
+ $(!!o, "No valid elements provided.");
2555
+ for (let a = 0; a < o; a++) {
2556
+ const l = i[a], u = l instanceof Element ? ki : Li;
2557
+ X.has(l) || u(l);
2558
+ const c = X.get(l), f = { ...n };
2559
+ "delay" in f && typeof f.delay == "function" && (f.delay = f.delay(a, o)), r.push(...Hr(c, { ...e, transition: f }, {}));
2560
+ }
2561
+ }
2562
+ return r;
2563
+ }
2564
+ function Wi(t, e, n) {
2535
2565
  const s = [];
2536
- return Ar(t, e, n).forEach(({ keyframes: r, transition: o }, l) => {
2537
- let a;
2538
- R(l) ? a = Cn(l, r.default, o.default) : a = Kn(l, r, o), s.push(a);
2539
- }), new nt(s);
2566
+ return Di(t, e, n, { spring: Ze }).forEach(({ keyframes: i, transition: o }, a) => {
2567
+ s.push(...Wn(a, i, o));
2568
+ }), s;
2540
2569
  }
2541
- const Nr = (t) => {
2542
- function e(n, s, i) {
2543
- let r;
2544
- return Rr(n) ? r = Dr(n, s, t) : gr(s) ? r = Kn(n, s, i, t) : r = Cn(n, s, i), t && t.animations.push(r), r;
2570
+ function Ui(t) {
2571
+ return Array.isArray(t) && Array.isArray(t[0]);
2572
+ }
2573
+ function ji(t) {
2574
+ function e(n, s, r) {
2575
+ let i = [];
2576
+ Ui(n) ? i = Wi(n, s, t) : i = Wn(n, s, r, t);
2577
+ const o = new Fn(i);
2578
+ return t && t.animations.push(o), o;
2545
2579
  }
2546
2580
  return e;
2547
- };
2548
- function Or() {
2549
- const t = Nt(() => ({
2581
+ }
2582
+ function Gi() {
2583
+ const t = Kt(() => ({
2550
2584
  current: null,
2551
2585
  // Will be hydrated by React
2552
2586
  animations: []
2553
- })), e = Nt(() => Nr(t));
2554
- return mr(() => {
2587
+ })), e = Kt(() => ji(t));
2588
+ return xi(() => {
2555
2589
  t.animations.forEach((n) => n.stop());
2556
2590
  }), [t, e];
2557
2591
  }
2558
- var _r = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t))(_r || {}), Ir = /* @__PURE__ */ ((t) => (t.onwhite = "onwhite", t.onneutral = "onneutral", t.onblueberry = "onblueberry", t))(Ir || {});
2559
- const jr = ({
2592
+ var zi = /* @__PURE__ */ ((t) => (t.left = "left", t.right = "right", t))(zi || {}), qi = /* @__PURE__ */ ((t) => (t.onwhite = "onwhite", t.onneutral = "onneutral", t.onblueberry = "onblueberry", t))(qi || {});
2593
+ const no = ({
2560
2594
  checked: t = !1,
2561
2595
  label: e,
2562
2596
  onChange: n,
2563
2597
  onColor: s = "onwhite",
2564
- subLabel: i,
2565
- togglePosition: r = "left",
2598
+ subLabel: r,
2599
+ togglePosition: i = "left",
2566
2600
  testId: o
2567
2601
  }) => {
2568
- const [l, a] = ct(t), [u, c] = ct(!1), [h, f] = Or(), d = J(), y = J(), v = J(), b = J(), m = J(), { refObject: S, isHovered: V, isActive: w } = Wn(h), T = V && !u, x = s === "onwhite";
2569
- ye(() => {
2602
+ const [a, l] = pt(t), [u, c] = pt(!1), [f, h] = Gi(), g = ne(), p = ne(), b = ne(), T = ne(), m = ne(), { refObject: y, isHovered: S, isActive: w } = zn(f), v = S && !u, x = s === "onwhite";
2603
+ ge(() => {
2570
2604
  if (u) {
2571
- const D = setTimeout(() => c(!1), 300);
2572
- return () => clearTimeout(D);
2605
+ const R = setTimeout(() => c(!1), 300);
2606
+ return () => clearTimeout(R);
2573
2607
  }
2574
- }, [u]), ye(() => {
2575
- a(t);
2576
- }, [t]), ye(() => {
2577
- f("#" + y, { background: F() }, { duration: 0.2, ease: "easeInOut" }), f(
2578
- "#" + v,
2579
- { background: l ? "var(--color-action-graphics-ondark)" : "var(--core-color-neutral-700)" },
2608
+ }, [u]), ge(() => {
2609
+ l(t);
2610
+ }, [t]), ge(() => {
2611
+ h("#" + p, { background: F() }, { duration: 0.2, ease: "easeInOut" }), h(
2612
+ "#" + b,
2613
+ { background: a ? "var(--color-action-graphics-ondark)" : "var(--core-color-neutral-700)" },
2580
2614
  { duration: 0.2, ease: "easeInOut" }
2581
- ), f("#" + v, { x: T ? 9 : l ? 18 : 0 }, { duration: 0.2, ease: "easeInOut" }), f("svg", { opacity: l ? 1 : 0 }, { duration: 0.2, ease: "easeInOut" });
2582
- }, [l, T, w]);
2583
- const F = () => l && w ? "var(--core-color-blueberry-800)" : l ? T ? "var(--color-action-graphics-onlight-hover)" : "var(--color-action-graphics-onlight)" : x && w ? "var(--core-color-neutral-400)" : x ? T ? "var(--core-color-neutral-200)" : "var(--core-color-neutral-50)" : w ? "var(--core-color-neutral-200)" : T ? "var(--core-color-neutral-50)" : "var(--core-color-white)", g = (D) => {
2584
- a(D.target.checked), c(!0), n == null || n(D);
2585
- }, P = W(M["toggle-container"]), A = W(M["toggle-container__row"], {
2586
- [M["toggle-container__row--right"]]: r === "right"
2615
+ ), h("#" + b, { x: v ? 9 : a ? 18 : 0 }, { duration: 0.2, ease: "easeInOut" }), h("svg", { opacity: a ? 1 : 0 }, { duration: 0.2, ease: "easeInOut" });
2616
+ }, [a, v, w]);
2617
+ const F = () => a && w ? "var(--core-color-blueberry-800)" : a ? v ? "var(--color-action-graphics-onlight-hover)" : "var(--color-action-graphics-onlight)" : x && w ? "var(--core-color-neutral-400)" : x ? v ? "var(--core-color-neutral-200)" : "var(--core-color-neutral-50)" : w ? "var(--core-color-neutral-200)" : v ? "var(--core-color-neutral-50)" : "var(--core-color-white)", V = (R) => {
2618
+ l(R.target.checked), c(!0), n == null || n(R);
2619
+ }, A = W(M["toggle-container"]), P = W(M["toggle-container__row"], {
2620
+ [M["toggle-container__row--right"]]: i === "right"
2587
2621
  /* right */
2588
- }), fe = W(M["toggle-container__sublabel"], {
2589
- [M["toggle-container__sublabel--toggle-right"]]: r === "right"
2622
+ }), N = W(M["toggle-container__sublabel"], {
2623
+ [M["toggle-container__sublabel--toggle-right"]]: i === "right"
2590
2624
  /* right */
2591
- }), Me = W(M["toggle-container__toggle"], {
2625
+ }), J = W(M["toggle-container__toggle"], {
2592
2626
  [M["toggle-container__toggle--ignore-hover"]]: u,
2593
2627
  [M["toggle-container__toggle--on-white"]]: s === "onwhite"
2594
2628
  /* onwhite */
2595
- }), de = W(M["toggle-container__toggle__dot"], {
2629
+ }), Me = W(M["toggle-container__toggle__dot"], {
2596
2630
  [M["toggle-container__toggle__dot--ignore-hover"]]: u
2597
- }), N = () => /* @__PURE__ */ Q("label", { ref: S, className: M["toggle-container__toggle-group"], children: [
2598
- /* @__PURE__ */ E(
2631
+ }), ee = () => /* @__PURE__ */ te("label", { ref: y, className: M["toggle-container__toggle-group"], children: [
2632
+ /* @__PURE__ */ K(
2599
2633
  "input",
2600
2634
  {
2601
- id: d,
2635
+ id: g,
2602
2636
  type: "checkbox",
2603
- checked: l,
2604
- onChange: g,
2637
+ checked: a,
2638
+ onChange: V,
2605
2639
  className: M["toggle-container__input"],
2606
- "aria-label": e.map((D) => D.text).join(" "),
2607
- "aria-describedby": i ? m : void 0
2640
+ "aria-label": e.map((R) => R.text).join(" "),
2641
+ "aria-describedby": r ? m : void 0
2608
2642
  }
2609
2643
  ),
2610
- /* @__PURE__ */ E("span", { id: y, className: Me, "aria-hidden": "true", children: /* @__PURE__ */ E("span", { id: v, className: de, "aria-hidden": "true", children: /* @__PURE__ */ E(
2644
+ /* @__PURE__ */ K("span", { id: p, className: J, "aria-hidden": "true", children: /* @__PURE__ */ K("span", { id: b, className: Me, "aria-hidden": "true", children: /* @__PURE__ */ K(
2611
2645
  "svg",
2612
2646
  {
2613
2647
  width: "17",
@@ -2615,42 +2649,42 @@ const jr = ({
2615
2649
  viewBox: "0 0 17 13",
2616
2650
  xmlns: "http://www.w3.org/2000/svg",
2617
2651
  className: M["toggle-container__toggle__dot__icon"],
2618
- children: /* @__PURE__ */ E("path", { d: "M15 2L6.80839 10.548L2 5.53145", fill: "none", strokeWidth: "3" })
2652
+ children: /* @__PURE__ */ K("path", { d: "M15 2L6.80839 10.548L2 5.53145", fill: "none", strokeWidth: "3" })
2619
2653
  }
2620
2654
  ) }) })
2621
- ] }), Z = () => /* @__PURE__ */ E(
2655
+ ] }), D = () => /* @__PURE__ */ K(
2622
2656
  "span",
2623
2657
  {
2624
- id: b,
2658
+ id: T,
2625
2659
  className: W(M["toggle-container__label"], {
2626
- [M["toggle-container__label--toggle-right"]]: r === "right"
2660
+ [M["toggle-container__label--toggle-right"]]: i === "right"
2627
2661
  /* right */
2628
2662
  }),
2629
- children: e.map((D) => {
2630
- const pe = W({
2631
- [M["toggle-container__label__text--semibold"]]: D.type === "semibold"
2663
+ children: e.map((R) => {
2664
+ const de = W({
2665
+ [M["toggle-container__label__text--semibold"]]: R.type === "semibold"
2632
2666
  });
2633
- return /* @__PURE__ */ E("span", { className: pe, children: D.text }, b + D.text);
2667
+ return /* @__PURE__ */ K("span", { className: de, children: R.text }, T + R.text);
2634
2668
  })
2635
2669
  }
2636
2670
  );
2637
- return /* @__PURE__ */ Q("div", { className: P, "data-testid": o, "data-analyticsid": Ln.Toggle, children: [
2638
- /* @__PURE__ */ Q("div", { className: A, children: [
2639
- r === "left" && /* @__PURE__ */ Q(ut, { children: [
2640
- N(),
2641
- Z()
2671
+ return /* @__PURE__ */ te("div", { className: A, "data-testid": o, "data-analyticsid": Gn.Toggle, children: [
2672
+ /* @__PURE__ */ te("div", { className: P, children: [
2673
+ i === "left" && /* @__PURE__ */ te(dt, { children: [
2674
+ ee(),
2675
+ D()
2642
2676
  ] }),
2643
- r === "right" && /* @__PURE__ */ Q(ut, { children: [
2644
- Z(),
2645
- N()
2677
+ i === "right" && /* @__PURE__ */ te(dt, { children: [
2678
+ D(),
2679
+ ee()
2646
2680
  ] })
2647
2681
  ] }),
2648
- i && /* @__PURE__ */ E("div", { id: m, className: fe, children: i })
2682
+ r && /* @__PURE__ */ K("div", { id: m, className: N, children: r })
2649
2683
  ] });
2650
2684
  };
2651
2685
  export {
2652
- Ir as ToggleOnColor,
2653
- _r as TogglePosition,
2654
- jr as default
2686
+ qi as ToggleOnColor,
2687
+ zi as TogglePosition,
2688
+ no as default
2655
2689
  };
2656
2690
  //# sourceMappingURL=index.js.map