@telegraph/tag 0.0.94 → 0.0.95

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.
@@ -1,55 +1,58 @@
1
- import { jsx as F, jsxs as ut } from "react/jsx-runtime";
2
- import { Button as we } from "@telegraph/button";
3
- import { Icon as Bs } from "@telegraph/icon";
4
- import { Stack as Ks } from "@telegraph/layout";
5
- import { Tooltip as $s } from "@telegraph/tooltip";
6
- import { Text as Ws } from "@telegraph/typography";
7
- import { clsx as js } from "clsx";
8
- import { X as pn, Check as _s, Copy as Gs } from "lucide-react";
9
- import G, { createContext as ee, useRef as ue, useLayoutEffect as zs, useEffect as ct, useState as Us, useContext as E, useMemo as De, useCallback as Hs, useInsertionEffect as Ys, forwardRef as Xs, Fragment as mn, createElement as qs } from "react";
10
- const Zs = ee({});
11
- function Js(e) {
12
- const t = ue(null);
1
+ import { jsx as F, jsxs as lt } from "react/jsx-runtime";
2
+ import { Button as Se } from "@telegraph/button";
3
+ import { Icon as js } from "@telegraph/icon";
4
+ import { Stack as _s } from "@telegraph/layout";
5
+ import { Tooltip as Gs } from "@telegraph/tooltip";
6
+ import { Text as zs } from "@telegraph/typography";
7
+ import { clsx as Hs } from "clsx";
8
+ import { X as yn, Check as Us, Copy as Ys } from "lucide-react";
9
+ import z, { createContext as se, useRef as fe, useLayoutEffect as Xs, useEffect as ft, useState as qs, useContext as E, useMemo as Oe, Fragment as bn, createElement as Zs, useCallback as Js, useInsertionEffect as Qs, forwardRef as ei } from "react";
10
+ const ti = se({});
11
+ function ni(e) {
12
+ const t = fe(null);
13
13
  return t.current === null && (t.current = e()), t.current;
14
14
  }
15
- const lt = typeof window < "u", Qs = lt ? zs : ct, gn = /* @__PURE__ */ ee(null);
16
- function ei(e, t) {
15
+ const dt = typeof window < "u", si = dt ? Xs : ft, Tn = /* @__PURE__ */ se(null);
16
+ function ii(e, t) {
17
17
  e.indexOf(t) === -1 && e.push(t);
18
18
  }
19
- function ti(e, t) {
19
+ function ri(e, t) {
20
20
  const n = e.indexOf(t);
21
21
  n > -1 && e.splice(n, 1);
22
22
  }
23
- const H = (e, t, n) => n > t ? t : n < e ? e : n;
24
- let pe = () => {
25
- }, Y = () => {
23
+ const Y = (e, t, n) => n > t ? t : n < e ? e : n;
24
+ function ze(e, t) {
25
+ return t ? `${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}` : e;
26
+ }
27
+ let ge = () => {
28
+ }, X = () => {
26
29
  };
27
- process.env.NODE_ENV !== "production" && (pe = (e, t) => {
28
- !e && typeof console < "u" && console.warn(t);
29
- }, Y = (e, t) => {
30
+ process.env.NODE_ENV !== "production" && (ge = (e, t, n) => {
31
+ !e && typeof console < "u" && console.warn(ze(t, n));
32
+ }, X = (e, t, n) => {
30
33
  if (!e)
31
- throw new Error(t);
34
+ throw new Error(ze(t, n));
32
35
  });
33
- const K = {}, yn = (e) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);
34
- function ni(e) {
36
+ const K = {}, vn = (e) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);
37
+ function oi(e) {
35
38
  return typeof e == "object" && e !== null;
36
39
  }
37
- const bn = (e) => /^0[^.\s]+$/u.test(e);
40
+ const wn = (e) => /^0[^.\s]+$/u.test(e);
38
41
  // @__NO_SIDE_EFFECTS__
39
- function ft(e) {
42
+ function ht(e) {
40
43
  let t;
41
44
  return () => (t === void 0 && (t = e()), t);
42
45
  }
43
- const te = /* @__NO_SIDE_EFFECTS__ */ (e) => e, si = (e, t) => (n) => t(e(n)), Re = (...e) => e.reduce(si), vn = /* @__NO_SIDE_EFFECTS__ */ (e, t, n) => {
46
+ const ie = /* @__NO_SIDE_EFFECTS__ */ (e) => e, ai = (e, t) => (n) => t(e(n)), Ie = (...e) => e.reduce(ai), Vn = /* @__NO_SIDE_EFFECTS__ */ (e, t, n) => {
44
47
  const s = t - e;
45
48
  return s === 0 ? 1 : (n - e) / s;
46
49
  };
47
- class Tn {
50
+ class Sn {
48
51
  constructor() {
49
52
  this.subscriptions = [];
50
53
  }
51
54
  add(t) {
52
- return ei(this.subscriptions, t), () => ti(this.subscriptions, t);
55
+ return ii(this.subscriptions, t), () => ri(this.subscriptions, t);
53
56
  }
54
57
  notify(t, n, s) {
55
58
  const i = this.subscriptions.length;
@@ -70,48 +73,48 @@ class Tn {
70
73
  }
71
74
  }
72
75
  const N = /* @__NO_SIDE_EFFECTS__ */ (e) => e * 1e3, B = /* @__NO_SIDE_EFFECTS__ */ (e) => e / 1e3;
73
- function wn(e, t) {
76
+ function xn(e, t) {
74
77
  return t ? e * (1e3 / t) : 0;
75
78
  }
76
- const kt = /* @__PURE__ */ new Set();
77
- function Vn(e, t, n) {
78
- e || kt.has(t) || (console.warn(t), kt.add(t));
79
+ const Bt = /* @__PURE__ */ new Set();
80
+ function An(e, t, n) {
81
+ e || Bt.has(t) || (console.warn(ze(t, n)), Bt.add(t));
79
82
  }
80
- const Sn = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e, ii = 1e-7, ri = 12;
81
- function oi(e, t, n, s, i) {
83
+ const Mn = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e, ui = 1e-7, ci = 12;
84
+ function li(e, t, n, s, i) {
82
85
  let r, o, a = 0;
83
86
  do
84
- o = t + (n - t) / 2, r = Sn(o, s, i) - e, r > 0 ? n = o : t = o;
85
- while (Math.abs(r) > ii && ++a < ri);
87
+ o = t + (n - t) / 2, r = Mn(o, s, i) - e, r > 0 ? n = o : t = o;
88
+ while (Math.abs(r) > ui && ++a < ci);
86
89
  return o;
87
90
  }
88
- function me(e, t, n, s) {
91
+ function ye(e, t, n, s) {
89
92
  if (e === t && n === s)
90
- return te;
91
- const i = (r) => oi(r, 0, 1, e, n);
92
- return (r) => r === 0 || r === 1 ? r : Sn(i(r), t, s);
93
- }
94
- const xn = (e) => (t) => t <= 0.5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, An = (e) => (t) => 1 - e(1 - t), Mn = /* @__PURE__ */ me(0.33, 1.53, 0.69, 0.99), dt = /* @__PURE__ */ An(Mn), Cn = /* @__PURE__ */ xn(dt), Pn = (e) => (e *= 2) < 1 ? 0.5 * dt(e) : 0.5 * (2 - Math.pow(2, -10 * (e - 1))), ht = (e) => 1 - Math.sin(Math.acos(e)), ai = An(ht), Fn = xn(ht), ui = /* @__PURE__ */ me(0.42, 0, 1, 1), ci = /* @__PURE__ */ me(0, 0, 0.58, 1), Dn = /* @__PURE__ */ me(0.42, 0, 0.58, 1), li = (e) => Array.isArray(e) && typeof e[0] != "number", Rn = (e) => Array.isArray(e) && typeof e[0] == "number", Nt = {
95
- linear: te,
96
- easeIn: ui,
97
- easeInOut: Dn,
98
- easeOut: ci,
99
- circIn: ht,
100
- circInOut: Fn,
101
- circOut: ai,
102
- backIn: dt,
103
- backInOut: Cn,
104
- backOut: Mn,
105
- anticipate: Pn
106
- }, fi = (e) => typeof e == "string", Lt = (e) => {
107
- if (Rn(e)) {
108
- Y(e.length === 4, "Cubic bezier arrays must contain four numerical values.");
93
+ return ie;
94
+ const i = (r) => li(r, 0, 1, e, n);
95
+ return (r) => r === 0 || r === 1 ? r : Mn(i(r), t, s);
96
+ }
97
+ const Cn = (e) => (t) => t <= 0.5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, Pn = (e) => (t) => 1 - e(1 - t), Fn = /* @__PURE__ */ ye(0.33, 1.53, 0.69, 0.99), pt = /* @__PURE__ */ Pn(Fn), Dn = /* @__PURE__ */ Cn(pt), Rn = (e) => (e *= 2) < 1 ? 0.5 * pt(e) : 0.5 * (2 - Math.pow(2, -10 * (e - 1))), mt = (e) => 1 - Math.sin(Math.acos(e)), fi = Pn(mt), On = Cn(mt), di = /* @__PURE__ */ ye(0.42, 0, 1, 1), hi = /* @__PURE__ */ ye(0, 0, 0.58, 1), In = /* @__PURE__ */ ye(0.42, 0, 0.58, 1), pi = (e) => Array.isArray(e) && typeof e[0] != "number", kn = (e) => Array.isArray(e) && typeof e[0] == "number", Kt = {
98
+ linear: ie,
99
+ easeIn: di,
100
+ easeInOut: In,
101
+ easeOut: hi,
102
+ circIn: mt,
103
+ circInOut: On,
104
+ circOut: fi,
105
+ backIn: pt,
106
+ backInOut: Dn,
107
+ backOut: Fn,
108
+ anticipate: Rn
109
+ }, mi = (e) => typeof e == "string", $t = (e) => {
110
+ if (kn(e)) {
111
+ X(e.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
109
112
  const [t, n, s, i] = e;
110
- return me(t, n, s, i);
111
- } else if (fi(e))
112
- return Y(Nt[e] !== void 0, `Invalid easing type '${e}'`), Nt[e];
113
+ return ye(t, n, s, i);
114
+ } else if (mi(e))
115
+ return X(Kt[e] !== void 0, `Invalid easing type '${e}'`, "invalid-easing-type"), Kt[e];
113
116
  return e;
114
- }, ve = [
117
+ }, we = [
115
118
  "setup",
116
119
  // Compute
117
120
  "read",
@@ -129,7 +132,7 @@ const xn = (e) => (t) => t <= 0.5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, An
129
132
  "postRender"
130
133
  // Compute
131
134
  ];
132
- function di(e, t) {
135
+ function gi(e, t) {
133
136
  let n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), i = !1, r = !1;
134
137
  const o = /* @__PURE__ */ new WeakSet();
135
138
  let a = {
@@ -144,9 +147,9 @@ function di(e, t) {
144
147
  /**
145
148
  * Schedule a process to run on the next frame.
146
149
  */
147
- schedule: (u, d = !1, f = !1) => {
148
- const y = f && i ? n : s;
149
- return d && o.add(u), y.has(u) || y.add(u), u;
150
+ schedule: (u, f = !1, d = !1) => {
151
+ const y = d && i ? n : s;
152
+ return f && o.add(u), y.has(u) || y.add(u), u;
150
153
  },
151
154
  /**
152
155
  * Cancel the provided callback from running on the next frame.
@@ -167,70 +170,70 @@ function di(e, t) {
167
170
  };
168
171
  return l;
169
172
  }
170
- const hi = 40;
171
- function On(e, t) {
173
+ const yi = 40;
174
+ function En(e, t) {
172
175
  let n = !1, s = !0;
173
176
  const i = {
174
177
  delta: 0,
175
178
  timestamp: 0,
176
179
  isProcessing: !1
177
- }, r = () => n = !0, o = ve.reduce((g, x) => (g[x] = di(r), g), {}), { setup: a, read: c, resolveKeyframes: l, preUpdate: u, update: d, preRender: f, render: h, postRender: y } = o, b = () => {
180
+ }, r = () => n = !0, o = we.reduce((g, x) => (g[x] = gi(r), g), {}), { setup: a, read: c, resolveKeyframes: l, preUpdate: u, update: f, preRender: d, render: h, postRender: y } = o, b = () => {
178
181
  const g = K.useManualTiming ? i.timestamp : performance.now();
179
- n = !1, K.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(g - i.timestamp, hi), 1)), i.timestamp = g, i.isProcessing = !0, a.process(i), c.process(i), l.process(i), u.process(i), d.process(i), f.process(i), h.process(i), y.process(i), i.isProcessing = !1, n && t && (s = !1, e(b));
180
- }, T = () => {
182
+ n = !1, K.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(g - i.timestamp, yi), 1)), i.timestamp = g, i.isProcessing = !0, a.process(i), c.process(i), l.process(i), u.process(i), f.process(i), d.process(i), h.process(i), y.process(i), i.isProcessing = !1, n && t && (s = !1, e(b));
183
+ }, v = () => {
181
184
  n = !0, s = !0, i.isProcessing || e(b);
182
185
  };
183
- return { schedule: ve.reduce((g, x) => {
184
- const v = o[x];
185
- return g[x] = (S, C = !1, w = !1) => (n || T(), v.schedule(S, C, w)), g;
186
+ return { schedule: we.reduce((g, x) => {
187
+ const T = o[x];
188
+ return g[x] = (S, C = !1, w = !1) => (n || v(), T.schedule(S, C, w)), g;
186
189
  }, {}), cancel: (g) => {
187
- for (let x = 0; x < ve.length; x++)
188
- o[ve[x]].cancel(g);
190
+ for (let x = 0; x < we.length; x++)
191
+ o[we[x]].cancel(g);
189
192
  }, state: i, steps: o };
190
193
  }
191
- const { schedule: k, cancel: ze, state: xe } = /* @__PURE__ */ On(typeof requestAnimationFrame < "u" ? requestAnimationFrame : te, !0);
192
- let Ve;
193
- function pi() {
194
- Ve = void 0;
194
+ const { schedule: L, cancel: He, state: Me } = /* @__PURE__ */ En(typeof requestAnimationFrame < "u" ? requestAnimationFrame : ie, !0);
195
+ let xe;
196
+ function bi() {
197
+ xe = void 0;
195
198
  }
196
- const I = {
197
- now: () => (Ve === void 0 && I.set(xe.isProcessing || K.useManualTiming ? xe.timestamp : performance.now()), Ve),
199
+ const k = {
200
+ now: () => (xe === void 0 && k.set(Me.isProcessing || K.useManualTiming ? Me.timestamp : performance.now()), xe),
198
201
  set: (e) => {
199
- Ve = e, queueMicrotask(pi);
202
+ xe = e, queueMicrotask(bi);
200
203
  }
201
- }, In = (e) => (t) => typeof t == "string" && t.startsWith(e), En = /* @__PURE__ */ In("--"), mi = /* @__PURE__ */ In("var(--"), pt = (e) => mi(e) ? gi.test(e.split("/*")[0].trim()) : !1, gi = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, ne = {
204
+ }, Ln = (e) => (t) => typeof t == "string" && t.startsWith(e), Nn = /* @__PURE__ */ Ln("--"), Ti = /* @__PURE__ */ Ln("var(--"), gt = (e) => Ti(e) ? vi.test(e.split("/*")[0].trim()) : !1, vi = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, re = {
202
205
  test: (e) => typeof e == "number",
203
206
  parse: parseFloat,
204
207
  transform: (e) => e
205
- }, le = {
206
- ...ne,
207
- transform: (e) => H(0, 1, e)
208
- }, Te = {
209
- ...ne,
208
+ }, he = {
209
+ ...re,
210
+ transform: (e) => Y(0, 1, e)
211
+ }, Ve = {
212
+ ...re,
210
213
  default: 1
211
- }, ce = (e) => Math.round(e * 1e5) / 1e5, mt = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
212
- function yi(e) {
214
+ }, de = (e) => Math.round(e * 1e5) / 1e5, yt = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
215
+ function wi(e) {
213
216
  return e == null;
214
217
  }
215
- const bi = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, gt = (e, t) => (n) => !!(typeof n == "string" && bi.test(n) && n.startsWith(e) || t && !yi(n) && Object.prototype.hasOwnProperty.call(n, t)), kn = (e, t, n) => (s) => {
218
+ const Vi = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, bt = (e, t) => (n) => !!(typeof n == "string" && Vi.test(n) && n.startsWith(e) || t && !wi(n) && Object.prototype.hasOwnProperty.call(n, t)), Bn = (e, t, n) => (s) => {
216
219
  if (typeof s != "string")
217
220
  return s;
218
- const [i, r, o, a] = s.match(mt);
221
+ const [i, r, o, a] = s.match(yt);
219
222
  return {
220
223
  [e]: parseFloat(i),
221
224
  [t]: parseFloat(r),
222
225
  [n]: parseFloat(o),
223
226
  alpha: a !== void 0 ? parseFloat(a) : 1
224
227
  };
225
- }, vi = (e) => H(0, 255, e), Be = {
226
- ...ne,
227
- transform: (e) => Math.round(vi(e))
228
- }, j = {
229
- test: /* @__PURE__ */ gt("rgb", "red"),
230
- parse: /* @__PURE__ */ kn("red", "green", "blue"),
231
- transform: ({ red: e, green: t, blue: n, alpha: s = 1 }) => "rgba(" + Be.transform(e) + ", " + Be.transform(t) + ", " + Be.transform(n) + ", " + ce(le.transform(s)) + ")"
228
+ }, Si = (e) => Y(0, 255, e), Be = {
229
+ ...re,
230
+ transform: (e) => Math.round(Si(e))
231
+ }, _ = {
232
+ test: /* @__PURE__ */ bt("rgb", "red"),
233
+ parse: /* @__PURE__ */ Bn("red", "green", "blue"),
234
+ transform: ({ red: e, green: t, blue: n, alpha: s = 1 }) => "rgba(" + Be.transform(e) + ", " + Be.transform(t) + ", " + Be.transform(n) + ", " + de(he.transform(s)) + ")"
232
235
  };
233
- function Ti(e) {
236
+ function xi(e) {
234
237
  let t = "", n = "", s = "", i = "";
235
238
  return e.length > 5 ? (t = e.substring(1, 3), n = e.substring(3, 5), s = e.substring(5, 7), i = e.substring(7, 9)) : (t = e.substring(1, 2), n = e.substring(2, 3), s = e.substring(3, 4), i = e.substring(4, 5), t += t, n += n, s += s, i += i), {
236
239
  red: parseInt(t, 16),
@@ -240,75 +243,75 @@ function Ti(e) {
240
243
  };
241
244
  }
242
245
  const Ue = {
243
- test: /* @__PURE__ */ gt("#"),
244
- parse: Ti,
245
- transform: j.transform
246
- }, ge = /* @__NO_SIDE_EFFECTS__ */ (e) => ({
246
+ test: /* @__PURE__ */ bt("#"),
247
+ parse: xi,
248
+ transform: _.transform
249
+ }, be = /* @__NO_SIDE_EFFECTS__ */ (e) => ({
247
250
  test: (t) => typeof t == "string" && t.endsWith(e) && t.split(" ").length === 1,
248
251
  parse: parseFloat,
249
252
  transform: (t) => `${t}${e}`
250
- }), $ = /* @__PURE__ */ ge("deg"), J = /* @__PURE__ */ ge("%"), m = /* @__PURE__ */ ge("px"), wi = /* @__PURE__ */ ge("vh"), Vi = /* @__PURE__ */ ge("vw"), Bt = {
251
- ...J,
252
- parse: (e) => J.parse(e) / 100,
253
- transform: (e) => J.transform(e * 100)
254
- }, q = {
255
- test: /* @__PURE__ */ gt("hsl", "hue"),
256
- parse: /* @__PURE__ */ kn("hue", "saturation", "lightness"),
257
- transform: ({ hue: e, saturation: t, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(e) + ", " + J.transform(ce(t)) + ", " + J.transform(ce(n)) + ", " + ce(le.transform(s)) + ")"
253
+ }), $ = /* @__PURE__ */ be("deg"), ee = /* @__PURE__ */ be("%"), m = /* @__PURE__ */ be("px"), Ai = /* @__PURE__ */ be("vh"), Mi = /* @__PURE__ */ be("vw"), Wt = {
254
+ ...ee,
255
+ parse: (e) => ee.parse(e) / 100,
256
+ transform: (e) => ee.transform(e * 100)
257
+ }, J = {
258
+ test: /* @__PURE__ */ bt("hsl", "hue"),
259
+ parse: /* @__PURE__ */ Bn("hue", "saturation", "lightness"),
260
+ transform: ({ hue: e, saturation: t, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(e) + ", " + ee.transform(de(t)) + ", " + ee.transform(de(n)) + ", " + de(he.transform(s)) + ")"
258
261
  }, M = {
259
- test: (e) => j.test(e) || Ue.test(e) || q.test(e),
260
- parse: (e) => j.test(e) ? j.parse(e) : q.test(e) ? q.parse(e) : Ue.parse(e),
261
- transform: (e) => typeof e == "string" ? e : e.hasOwnProperty("red") ? j.transform(e) : q.transform(e),
262
+ test: (e) => _.test(e) || Ue.test(e) || J.test(e),
263
+ parse: (e) => _.test(e) ? _.parse(e) : J.test(e) ? J.parse(e) : Ue.parse(e),
264
+ transform: (e) => typeof e == "string" ? e : e.hasOwnProperty("red") ? _.transform(e) : J.transform(e),
262
265
  getAnimatableNone: (e) => {
263
266
  const t = M.parse(e);
264
267
  return t.alpha = 0, M.transform(t);
265
268
  }
266
- }, Si = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
267
- function xi(e) {
269
+ }, Ci = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
270
+ function Pi(e) {
268
271
  var t, n;
269
- return isNaN(e) && typeof e == "string" && (((t = e.match(mt)) == null ? void 0 : t.length) || 0) + (((n = e.match(Si)) == null ? void 0 : n.length) || 0) > 0;
272
+ return isNaN(e) && typeof e == "string" && (((t = e.match(yt)) == null ? void 0 : t.length) || 0) + (((n = e.match(Ci)) == null ? void 0 : n.length) || 0) > 0;
270
273
  }
271
- const Nn = "number", Ln = "color", Ai = "var", Mi = "var(", Kt = "${}", Ci = /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;
272
- function fe(e) {
274
+ const Kn = "number", $n = "color", Fi = "var", Di = "var(", jt = "${}", Ri = /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;
275
+ function pe(e) {
273
276
  const t = e.toString(), n = [], s = {
274
277
  color: [],
275
278
  number: [],
276
279
  var: []
277
280
  }, i = [];
278
281
  let r = 0;
279
- const a = t.replace(Ci, (c) => (M.test(c) ? (s.color.push(r), i.push(Ln), n.push(M.parse(c))) : c.startsWith(Mi) ? (s.var.push(r), i.push(Ai), n.push(c)) : (s.number.push(r), i.push(Nn), n.push(parseFloat(c))), ++r, Kt)).split(Kt);
282
+ const a = t.replace(Ri, (c) => (M.test(c) ? (s.color.push(r), i.push($n), n.push(M.parse(c))) : c.startsWith(Di) ? (s.var.push(r), i.push(Fi), n.push(c)) : (s.number.push(r), i.push(Kn), n.push(parseFloat(c))), ++r, jt)).split(jt);
280
283
  return { values: n, split: a, indexes: s, types: i };
281
284
  }
282
- function Bn(e) {
283
- return fe(e).values;
285
+ function Wn(e) {
286
+ return pe(e).values;
284
287
  }
285
- function Kn(e) {
286
- const { split: t, types: n } = fe(e), s = t.length;
288
+ function jn(e) {
289
+ const { split: t, types: n } = pe(e), s = t.length;
287
290
  return (i) => {
288
291
  let r = "";
289
292
  for (let o = 0; o < s; o++)
290
293
  if (r += t[o], i[o] !== void 0) {
291
294
  const a = n[o];
292
- a === Nn ? r += ce(i[o]) : a === Ln ? r += M.transform(i[o]) : r += i[o];
295
+ a === Kn ? r += de(i[o]) : a === $n ? r += M.transform(i[o]) : r += i[o];
293
296
  }
294
297
  return r;
295
298
  };
296
299
  }
297
- const Pi = (e) => typeof e == "number" ? 0 : M.test(e) ? M.getAnimatableNone(e) : e;
298
- function Fi(e) {
299
- const t = Bn(e);
300
- return Kn(e)(t.map(Pi));
300
+ const Oi = (e) => typeof e == "number" ? 0 : M.test(e) ? M.getAnimatableNone(e) : e;
301
+ function Ii(e) {
302
+ const t = Wn(e);
303
+ return jn(e)(t.map(Oi));
301
304
  }
302
- const se = {
303
- test: xi,
304
- parse: Bn,
305
- createTransformer: Kn,
306
- getAnimatableNone: Fi
305
+ const oe = {
306
+ test: Pi,
307
+ parse: Wn,
308
+ createTransformer: jn,
309
+ getAnimatableNone: Ii
307
310
  };
308
311
  function Ke(e, t, n) {
309
312
  return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
310
313
  }
311
- function Di({ hue: e, saturation: t, lightness: n, alpha: s }) {
314
+ function ki({ hue: e, saturation: t, lightness: n, alpha: s }) {
312
315
  e /= 360, t /= 100, n /= 100;
313
316
  let i = 0, r = 0, o = 0;
314
317
  if (!t)
@@ -324,55 +327,55 @@ function Di({ hue: e, saturation: t, lightness: n, alpha: s }) {
324
327
  alpha: s
325
328
  };
326
329
  }
327
- function Ae(e, t) {
330
+ function Ce(e, t) {
328
331
  return (n) => n > 0 ? t : e;
329
332
  }
330
- const Oe = (e, t, n) => e + (t - e) * n, $e = (e, t, n) => {
333
+ const ke = (e, t, n) => e + (t - e) * n, $e = (e, t, n) => {
331
334
  const s = e * e, i = n * (t * t - s) + s;
332
335
  return i < 0 ? 0 : Math.sqrt(i);
333
- }, Ri = [Ue, j, q], Oi = (e) => Ri.find((t) => t.test(e));
334
- function $t(e) {
335
- const t = Oi(e);
336
- if (pe(!!t, `'${e}' is not an animatable color. Use the equivalent color code instead.`), !t)
336
+ }, Ei = [Ue, _, J], Li = (e) => Ei.find((t) => t.test(e));
337
+ function _t(e) {
338
+ const t = Li(e);
339
+ if (ge(!!t, `'${e}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"), !t)
337
340
  return !1;
338
341
  let n = t.parse(e);
339
- return t === q && (n = Di(n)), n;
342
+ return t === J && (n = ki(n)), n;
340
343
  }
341
- const Wt = (e, t) => {
342
- const n = $t(e), s = $t(t);
344
+ const Gt = (e, t) => {
345
+ const n = _t(e), s = _t(t);
343
346
  if (!n || !s)
344
- return Ae(e, t);
347
+ return Ce(e, t);
345
348
  const i = { ...n };
346
- return (r) => (i.red = $e(n.red, s.red, r), i.green = $e(n.green, s.green, r), i.blue = $e(n.blue, s.blue, r), i.alpha = Oe(n.alpha, s.alpha, r), j.transform(i));
347
- }, He = /* @__PURE__ */ new Set(["none", "hidden"]);
348
- function Ii(e, t) {
349
- return He.has(e) ? (n) => n <= 0 ? e : t : (n) => n >= 1 ? t : e;
349
+ return (r) => (i.red = $e(n.red, s.red, r), i.green = $e(n.green, s.green, r), i.blue = $e(n.blue, s.blue, r), i.alpha = ke(n.alpha, s.alpha, r), _.transform(i));
350
+ }, Ye = /* @__PURE__ */ new Set(["none", "hidden"]);
351
+ function Ni(e, t) {
352
+ return Ye.has(e) ? (n) => n <= 0 ? e : t : (n) => n >= 1 ? t : e;
350
353
  }
351
- function Ei(e, t) {
352
- return (n) => Oe(e, t, n);
354
+ function Bi(e, t) {
355
+ return (n) => ke(e, t, n);
353
356
  }
354
- function yt(e) {
355
- return typeof e == "number" ? Ei : typeof e == "string" ? pt(e) ? Ae : M.test(e) ? Wt : Li : Array.isArray(e) ? $n : typeof e == "object" ? M.test(e) ? Wt : ki : Ae;
357
+ function Tt(e) {
358
+ return typeof e == "number" ? Bi : typeof e == "string" ? gt(e) ? Ce : M.test(e) ? Gt : Wi : Array.isArray(e) ? _n : typeof e == "object" ? M.test(e) ? Gt : Ki : Ce;
356
359
  }
357
- function $n(e, t) {
358
- const n = [...e], s = n.length, i = e.map((r, o) => yt(r)(r, t[o]));
360
+ function _n(e, t) {
361
+ const n = [...e], s = n.length, i = e.map((r, o) => Tt(r)(r, t[o]));
359
362
  return (r) => {
360
363
  for (let o = 0; o < s; o++)
361
364
  n[o] = i[o](r);
362
365
  return n;
363
366
  };
364
367
  }
365
- function ki(e, t) {
368
+ function Ki(e, t) {
366
369
  const n = { ...e, ...t }, s = {};
367
370
  for (const i in n)
368
- e[i] !== void 0 && t[i] !== void 0 && (s[i] = yt(e[i])(e[i], t[i]));
371
+ e[i] !== void 0 && t[i] !== void 0 && (s[i] = Tt(e[i])(e[i], t[i]));
369
372
  return (i) => {
370
373
  for (const r in s)
371
374
  n[r] = s[r](i);
372
375
  return n;
373
376
  };
374
377
  }
375
- function Ni(e, t) {
378
+ function $i(e, t) {
376
379
  const n = [], s = { color: 0, var: 0, number: 0 };
377
380
  for (let i = 0; i < t.values.length; i++) {
378
381
  const r = t.types[i], o = e.indexes[r][s[r]], a = e.values[o] ?? 0;
@@ -380,51 +383,51 @@ function Ni(e, t) {
380
383
  }
381
384
  return n;
382
385
  }
383
- const Li = (e, t) => {
384
- const n = se.createTransformer(t), s = fe(e), i = fe(t);
385
- 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 ? He.has(e) && !i.values.length || He.has(t) && !s.values.length ? Ii(e, t) : Re($n(Ni(s, i), i.values), n) : (pe(!0, `Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), Ae(e, t));
386
+ const Wi = (e, t) => {
387
+ const n = oe.createTransformer(t), s = pe(e), i = pe(t);
388
+ 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 ? Ye.has(e) && !i.values.length || Ye.has(t) && !s.values.length ? Ni(e, t) : Ie(_n($i(s, i), i.values), n) : (ge(!0, `Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), Ce(e, t));
386
389
  };
387
- function Wn(e, t, n) {
388
- return typeof e == "number" && typeof t == "number" && typeof n == "number" ? Oe(e, t, n) : yt(e)(e, t);
390
+ function Gn(e, t, n) {
391
+ return typeof e == "number" && typeof t == "number" && typeof n == "number" ? ke(e, t, n) : Tt(e)(e, t);
389
392
  }
390
- const Bi = (e) => {
393
+ const ji = (e) => {
391
394
  const t = ({ timestamp: n }) => e(n);
392
395
  return {
393
- start: (n = !0) => k.update(t, n),
394
- stop: () => ze(t),
396
+ start: (n = !0) => L.update(t, n),
397
+ stop: () => He(t),
395
398
  /**
396
399
  * If we're processing this frame we can use the
397
400
  * framelocked timestamp to keep things in sync.
398
401
  */
399
- now: () => xe.isProcessing ? xe.timestamp : I.now()
402
+ now: () => Me.isProcessing ? Me.timestamp : k.now()
400
403
  };
401
- }, jn = (e, t, n = 10) => {
404
+ }, zn = (e, t, n = 10) => {
402
405
  let s = "";
403
406
  const i = Math.max(Math.round(t / n), 2);
404
407
  for (let r = 0; r < i; r++)
405
408
  s += Math.round(e(r / (i - 1)) * 1e4) / 1e4 + ", ";
406
409
  return `linear(${s.substring(0, s.length - 2)})`;
407
- }, Me = 2e4;
408
- function bt(e) {
410
+ }, Pe = 2e4;
411
+ function vt(e) {
409
412
  let t = 0;
410
413
  const n = 50;
411
414
  let s = e.next(t);
412
- for (; !s.done && t < Me; )
415
+ for (; !s.done && t < Pe; )
413
416
  t += n, s = e.next(t);
414
- return t >= Me ? 1 / 0 : t;
417
+ return t >= Pe ? 1 / 0 : t;
415
418
  }
416
- function Ki(e, t = 100, n) {
417
- const s = n({ ...e, keyframes: [0, t] }), i = Math.min(bt(s), Me);
419
+ function _i(e, t = 100, n) {
420
+ const s = n({ ...e, keyframes: [0, t] }), i = Math.min(vt(s), Pe);
418
421
  return {
419
422
  type: "keyframes",
420
423
  ease: (r) => s.next(i * r).value / t,
421
424
  duration: /* @__PURE__ */ B(i)
422
425
  };
423
426
  }
424
- const $i = 5;
425
- function _n(e, t, n) {
426
- const s = Math.max(t - $i, 0);
427
- return wn(n - e(s), t - s);
427
+ const Gi = 5;
428
+ function Hn(e, t, n) {
429
+ const s = Math.max(t - Gi, 0);
430
+ return xn(n - e(s), t - s);
428
431
  }
429
432
  const A = {
430
433
  // Default spring physics
@@ -455,24 +458,24 @@ const A = {
455
458
  minDamping: 0.05,
456
459
  maxDamping: 1
457
460
  }, We = 1e-3;
458
- function Wi({ duration: e = A.duration, bounce: t = A.bounce, velocity: n = A.velocity, mass: s = A.mass }) {
461
+ function zi({ duration: e = A.duration, bounce: t = A.bounce, velocity: n = A.velocity, mass: s = A.mass }) {
459
462
  let i, r;
460
- pe(e <= /* @__PURE__ */ N(A.maxDuration), "Spring duration must be 10 seconds or less");
463
+ ge(e <= /* @__PURE__ */ N(A.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
461
464
  let o = 1 - t;
462
- o = H(A.minDamping, A.maxDamping, o), e = H(A.minDuration, A.maxDuration, /* @__PURE__ */ B(e)), o < 1 ? (i = (l) => {
463
- const u = l * o, d = u * e, f = u - n, h = Ye(l, o), y = Math.exp(-d);
464
- return We - f / h * y;
465
+ o = Y(A.minDamping, A.maxDamping, o), e = Y(A.minDuration, A.maxDuration, /* @__PURE__ */ B(e)), o < 1 ? (i = (l) => {
466
+ const u = l * o, f = u * e, d = u - n, h = Xe(l, o), y = Math.exp(-f);
467
+ return We - d / h * y;
465
468
  }, r = (l) => {
466
- const d = l * o * e, f = d * n + n, h = Math.pow(o, 2) * Math.pow(l, 2) * e, y = Math.exp(-d), b = Ye(Math.pow(l, 2), o);
467
- return (-i(l) + We > 0 ? -1 : 1) * ((f - h) * y) / b;
469
+ const f = l * o * e, d = f * n + n, h = Math.pow(o, 2) * Math.pow(l, 2) * e, y = Math.exp(-f), b = Xe(Math.pow(l, 2), o);
470
+ return (-i(l) + We > 0 ? -1 : 1) * ((d - h) * y) / b;
468
471
  }) : (i = (l) => {
469
- const u = Math.exp(-l * e), d = (l - n) * e + 1;
470
- return -We + u * d;
472
+ const u = Math.exp(-l * e), f = (l - n) * e + 1;
473
+ return -We + u * f;
471
474
  }, r = (l) => {
472
- const u = Math.exp(-l * e), d = (n - l) * (e * e);
473
- return u * d;
475
+ const u = Math.exp(-l * e), f = (n - l) * (e * e);
476
+ return u * f;
474
477
  });
475
- const a = 5 / e, c = _i(i, r, a);
478
+ const a = 5 / e, c = Ui(i, r, a);
476
479
  if (e = /* @__PURE__ */ N(e), isNaN(c))
477
480
  return {
478
481
  stiffness: A.stiffness,
@@ -488,21 +491,21 @@ function Wi({ duration: e = A.duration, bounce: t = A.bounce, velocity: n = A.ve
488
491
  };
489
492
  }
490
493
  }
491
- const ji = 12;
492
- function _i(e, t, n) {
494
+ const Hi = 12;
495
+ function Ui(e, t, n) {
493
496
  let s = n;
494
- for (let i = 1; i < ji; i++)
497
+ for (let i = 1; i < Hi; i++)
495
498
  s = s - e(s) / t(s);
496
499
  return s;
497
500
  }
498
- function Ye(e, t) {
501
+ function Xe(e, t) {
499
502
  return e * Math.sqrt(1 - t * t);
500
503
  }
501
- const Gi = ["duration", "bounce"], zi = ["stiffness", "damping", "mass"];
502
- function jt(e, t) {
504
+ const Yi = ["duration", "bounce"], Xi = ["stiffness", "damping", "mass"];
505
+ function zt(e, t) {
503
506
  return t.some((n) => e[n] !== void 0);
504
507
  }
505
- function Ui(e) {
508
+ function qi(e) {
506
509
  let t = {
507
510
  velocity: A.velocity,
508
511
  stiffness: A.stiffness,
@@ -511,9 +514,9 @@ function Ui(e) {
511
514
  isResolvedFromDuration: !1,
512
515
  ...e
513
516
  };
514
- if (!jt(e, zi) && jt(e, Gi))
517
+ if (!zt(e, Xi) && zt(e, Yi))
515
518
  if (e.visualDuration) {
516
- const n = e.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * H(0.05, 1, 1 - (e.bounce || 0)) * Math.sqrt(i);
519
+ const n = e.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * Y(0.05, 1, 1 - (e.bounce || 0)) * Math.sqrt(i);
517
520
  t = {
518
521
  ...t,
519
522
  mass: A.mass,
@@ -521,7 +524,7 @@ function Ui(e) {
521
524
  damping: r
522
525
  };
523
526
  } else {
524
- const n = Wi(e);
527
+ const n = zi(e);
525
528
  t = {
526
529
  ...t,
527
530
  ...n,
@@ -530,78 +533,78 @@ function Ui(e) {
530
533
  }
531
534
  return t;
532
535
  }
533
- function Ce(e = A.visualDuration, t = A.bounce) {
536
+ function Fe(e = A.visualDuration, t = A.bounce) {
534
537
  const n = typeof e != "object" ? {
535
538
  visualDuration: e,
536
539
  keyframes: [0, 1],
537
540
  bounce: t
538
541
  } : e;
539
542
  let { restSpeed: s, restDelta: i } = n;
540
- const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: c, damping: l, mass: u, duration: d, velocity: f, isResolvedFromDuration: h } = Ui({
543
+ const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: c, damping: l, mass: u, duration: f, velocity: d, isResolvedFromDuration: h } = qi({
541
544
  ...n,
542
545
  velocity: -/* @__PURE__ */ B(n.velocity || 0)
543
- }), y = f || 0, b = l / (2 * Math.sqrt(c * u)), T = o - r, p = /* @__PURE__ */ B(Math.sqrt(c / u)), V = Math.abs(T) < 5;
546
+ }), y = d || 0, b = l / (2 * Math.sqrt(c * u)), v = o - r, p = /* @__PURE__ */ B(Math.sqrt(c / u)), V = Math.abs(v) < 5;
544
547
  s || (s = V ? A.restSpeed.granular : A.restSpeed.default), i || (i = V ? A.restDelta.granular : A.restDelta.default);
545
548
  let g;
546
549
  if (b < 1) {
547
- const v = Ye(p, b);
550
+ const T = Xe(p, b);
548
551
  g = (S) => {
549
552
  const C = Math.exp(-b * p * S);
550
- return o - C * ((y + b * p * T) / v * Math.sin(v * S) + T * Math.cos(v * S));
553
+ return o - C * ((y + b * p * v) / T * Math.sin(T * S) + v * Math.cos(T * S));
551
554
  };
552
555
  } else if (b === 1)
553
- g = (v) => o - Math.exp(-p * v) * (T + (y + p * T) * v);
556
+ g = (T) => o - Math.exp(-p * T) * (v + (y + p * v) * T);
554
557
  else {
555
- const v = p * Math.sqrt(b * b - 1);
558
+ const T = p * Math.sqrt(b * b - 1);
556
559
  g = (S) => {
557
- const C = Math.exp(-b * p * S), w = Math.min(v * S, 300);
558
- return o - C * ((y + b * p * T) * Math.sinh(w) + v * T * Math.cosh(w)) / v;
560
+ const C = Math.exp(-b * p * S), w = Math.min(T * S, 300);
561
+ return o - C * ((y + b * p * v) * Math.sinh(w) + T * v * Math.cosh(w)) / T;
559
562
  };
560
563
  }
561
564
  const x = {
562
- calculatedDuration: h && d || null,
563
- next: (v) => {
564
- const S = g(v);
565
+ calculatedDuration: h && f || null,
566
+ next: (T) => {
567
+ const S = g(T);
565
568
  if (h)
566
- a.done = v >= d;
569
+ a.done = T >= f;
567
570
  else {
568
- let C = v === 0 ? y : 0;
569
- b < 1 && (C = v === 0 ? /* @__PURE__ */ N(y) : _n(g, v, S));
571
+ let C = T === 0 ? y : 0;
572
+ b < 1 && (C = T === 0 ? /* @__PURE__ */ N(y) : Hn(g, T, S));
570
573
  const w = Math.abs(C) <= s, R = Math.abs(o - S) <= i;
571
574
  a.done = w && R;
572
575
  }
573
576
  return a.value = a.done ? o : S, a;
574
577
  },
575
578
  toString: () => {
576
- const v = Math.min(bt(x), Me), S = jn((C) => x.next(v * C).value, v, 30);
577
- return v + "ms " + S;
579
+ const T = Math.min(vt(x), Pe), S = zn((C) => x.next(T * C).value, T, 30);
580
+ return T + "ms " + S;
578
581
  },
579
582
  toTransition: () => {
580
583
  }
581
584
  };
582
585
  return x;
583
586
  }
584
- Ce.applyToOptions = (e) => {
585
- const t = Ki(e, 100, Ce);
587
+ Fe.applyToOptions = (e) => {
588
+ const t = _i(e, 100, Fe);
586
589
  return e.ease = t.ease, e.duration = /* @__PURE__ */ N(t.duration), e.type = "keyframes", e;
587
590
  };
588
- function Xe({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: c, restDelta: l = 0.5, restSpeed: u }) {
589
- const d = e[0], f = {
591
+ function qe({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: c, restDelta: l = 0.5, restSpeed: u }) {
592
+ const f = e[0], d = {
590
593
  done: !1,
591
- value: d
594
+ value: f
592
595
  }, h = (w) => a !== void 0 && w < a || c !== void 0 && w > c, y = (w) => a === void 0 ? c : c === void 0 || Math.abs(a - w) < Math.abs(c - w) ? a : c;
593
596
  let b = n * t;
594
- const T = d + b, p = o === void 0 ? T : o(T);
595
- p !== T && (b = p - d);
597
+ const v = f + b, p = o === void 0 ? v : o(v);
598
+ p !== v && (b = p - f);
596
599
  const V = (w) => -b * Math.exp(-w / s), g = (w) => p + V(w), x = (w) => {
597
600
  const R = V(w), O = g(w);
598
- f.done = Math.abs(R) <= l, f.value = f.done ? p : O;
601
+ d.done = Math.abs(R) <= l, d.value = d.done ? p : O;
599
602
  };
600
- let v, S;
603
+ let T, S;
601
604
  const C = (w) => {
602
- h(f.value) && (v = w, S = Ce({
603
- keyframes: [f.value, y(f.value)],
604
- velocity: _n(g, w, f.value),
605
+ h(d.value) && (T = w, S = Fe({
606
+ keyframes: [d.value, y(d.value)],
607
+ velocity: Hn(g, w, d.value),
605
608
  // TODO: This should be passing * 1000
606
609
  damping: i,
607
610
  stiffness: r,
@@ -613,92 +616,92 @@ function Xe({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: s = 3
613
616
  calculatedDuration: null,
614
617
  next: (w) => {
615
618
  let R = !1;
616
- return !S && v === void 0 && (R = !0, x(w), C(w)), v !== void 0 && w >= v ? S.next(w - v) : (!R && x(w), f);
619
+ return !S && T === void 0 && (R = !0, x(w), C(w)), T !== void 0 && w >= T ? S.next(w - T) : (!R && x(w), d);
617
620
  }
618
621
  };
619
622
  }
620
- function Hi(e, t, n) {
621
- const s = [], i = n || K.mix || Wn, r = e.length - 1;
623
+ function Zi(e, t, n) {
624
+ const s = [], i = n || K.mix || Gn, r = e.length - 1;
622
625
  for (let o = 0; o < r; o++) {
623
626
  let a = i(e[o], e[o + 1]);
624
627
  if (t) {
625
- const c = Array.isArray(t) ? t[o] || te : t;
626
- a = Re(c, a);
628
+ const c = Array.isArray(t) ? t[o] || ie : t;
629
+ a = Ie(c, a);
627
630
  }
628
631
  s.push(a);
629
632
  }
630
633
  return s;
631
634
  }
632
- function Yi(e, t, { clamp: n = !0, ease: s, mixer: i } = {}) {
635
+ function Ji(e, t, { clamp: n = !0, ease: s, mixer: i } = {}) {
633
636
  const r = e.length;
634
- if (Y(r === t.length, "Both input and output ranges must be the same length"), r === 1)
637
+ if (X(r === t.length, "Both input and output ranges must be the same length", "range-length"), r === 1)
635
638
  return () => t[0];
636
639
  if (r === 2 && t[0] === t[1])
637
640
  return () => t[1];
638
641
  const o = e[0] === e[1];
639
642
  e[0] > e[r - 1] && (e = [...e].reverse(), t = [...t].reverse());
640
- const a = Hi(t, s, i), c = a.length, l = (u) => {
643
+ const a = Zi(t, s, i), c = a.length, l = (u) => {
641
644
  if (o && u < e[0])
642
645
  return t[0];
643
- let d = 0;
646
+ let f = 0;
644
647
  if (c > 1)
645
- for (; d < e.length - 2 && !(u < e[d + 1]); d++)
648
+ for (; f < e.length - 2 && !(u < e[f + 1]); f++)
646
649
  ;
647
- const f = /* @__PURE__ */ vn(e[d], e[d + 1], u);
648
- return a[d](f);
650
+ const d = /* @__PURE__ */ Vn(e[f], e[f + 1], u);
651
+ return a[f](d);
649
652
  };
650
- return n ? (u) => l(H(e[0], e[r - 1], u)) : l;
653
+ return n ? (u) => l(Y(e[0], e[r - 1], u)) : l;
651
654
  }
652
- function Xi(e, t) {
655
+ function Qi(e, t) {
653
656
  const n = e[e.length - 1];
654
657
  for (let s = 1; s <= t; s++) {
655
- const i = /* @__PURE__ */ vn(0, t, s);
656
- e.push(Oe(n, 1, i));
658
+ const i = /* @__PURE__ */ Vn(0, t, s);
659
+ e.push(ke(n, 1, i));
657
660
  }
658
661
  }
659
- function qi(e) {
662
+ function er(e) {
660
663
  const t = [0];
661
- return Xi(t, e.length - 1), t;
664
+ return Qi(t, e.length - 1), t;
662
665
  }
663
- function Zi(e, t) {
666
+ function tr(e, t) {
664
667
  return e.map((n) => n * t);
665
668
  }
666
- function Ji(e, t) {
667
- return e.map(() => t || Dn).splice(0, e.length - 1);
669
+ function nr(e, t) {
670
+ return e.map(() => t || In).splice(0, e.length - 1);
668
671
  }
669
- function Z({ duration: e = 300, keyframes: t, times: n, ease: s = "easeInOut" }) {
670
- const i = li(s) ? s.map(Lt) : Lt(s), r = {
672
+ function Q({ duration: e = 300, keyframes: t, times: n, ease: s = "easeInOut" }) {
673
+ const i = pi(s) ? s.map($t) : $t(s), r = {
671
674
  done: !1,
672
675
  value: t[0]
673
- }, o = Zi(
676
+ }, o = tr(
674
677
  // Only use the provided offsets if they're the correct length
675
678
  // TODO Maybe we should warn here if there's a length mismatch
676
- n && n.length === t.length ? n : qi(t),
679
+ n && n.length === t.length ? n : er(t),
677
680
  e
678
- ), a = Yi(o, t, {
679
- ease: Array.isArray(i) ? i : Ji(t, i)
681
+ ), a = Ji(o, t, {
682
+ ease: Array.isArray(i) ? i : nr(t, i)
680
683
  });
681
684
  return {
682
685
  calculatedDuration: e,
683
686
  next: (c) => (r.value = a(c), r.done = c >= e, r)
684
687
  };
685
688
  }
686
- const Qi = (e) => e !== null;
687
- function vt(e, { repeat: t, repeatType: n = "loop" }, s, i = 1) {
688
- const r = e.filter(Qi), a = i < 0 || t && n !== "loop" && t % 2 === 1 ? 0 : r.length - 1;
689
+ const sr = (e) => e !== null;
690
+ function wt(e, { repeat: t, repeatType: n = "loop" }, s, i = 1) {
691
+ const r = e.filter(sr), a = i < 0 || t && n !== "loop" && t % 2 === 1 ? 0 : r.length - 1;
689
692
  return !a || s === void 0 ? r[a] : s;
690
693
  }
691
- const er = {
692
- decay: Xe,
693
- inertia: Xe,
694
- tween: Z,
695
- keyframes: Z,
696
- spring: Ce
694
+ const ir = {
695
+ decay: qe,
696
+ inertia: qe,
697
+ tween: Q,
698
+ keyframes: Q,
699
+ spring: Fe
697
700
  };
698
- function Gn(e) {
699
- typeof e.type == "string" && (e.type = er[e.type]);
701
+ function Un(e) {
702
+ typeof e.type == "string" && (e.type = ir[e.type]);
700
703
  }
701
- class Tt {
704
+ class Vt {
702
705
  constructor() {
703
706
  this.updateFinished();
704
707
  }
@@ -722,28 +725,28 @@ class Tt {
722
725
  return this.finished.then(t, n);
723
726
  }
724
727
  }
725
- const tr = (e) => e / 100;
726
- class wt extends Tt {
728
+ const rr = (e) => e / 100;
729
+ class St extends Vt {
727
730
  constructor(t) {
728
731
  super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = () => {
729
732
  var s, i;
730
733
  const { motionValue: n } = this.options;
731
- n && n.updatedAt !== I.now() && this.tick(I.now()), this.isStopped = !0, this.state !== "idle" && (this.teardown(), (i = (s = this.options).onStop) == null || i.call(s));
734
+ n && n.updatedAt !== k.now() && this.tick(k.now()), this.isStopped = !0, this.state !== "idle" && (this.teardown(), (i = (s = this.options).onStop) == null || i.call(s));
732
735
  }, this.options = t, this.initAnimation(), this.play(), t.autoplay === !1 && this.pause();
733
736
  }
734
737
  initAnimation() {
735
738
  const { options: t } = this;
736
- Gn(t);
737
- const { type: n = Z, repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = t;
739
+ Un(t);
740
+ const { type: n = Q, repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = t;
738
741
  let { keyframes: a } = t;
739
- const c = n || Z;
740
- process.env.NODE_ENV !== "production" && c !== Z && Y(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`), c !== Z && typeof a[0] != "number" && (this.mixKeyframes = Re(tr, Wn(a[0], a[1])), a = [0, 100]);
742
+ const c = n || Q;
743
+ process.env.NODE_ENV !== "production" && c !== Q && X(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`, "spring-two-frames"), c !== Q && typeof a[0] != "number" && (this.mixKeyframes = Ie(rr, Gn(a[0], a[1])), a = [0, 100]);
741
744
  const l = c({ ...t, keyframes: a });
742
745
  r === "mirror" && (this.mirroredGenerator = c({
743
746
  ...t,
744
747
  keyframes: [...a].reverse(),
745
748
  velocity: -o
746
- })), l.calculatedDuration === null && (l.calculatedDuration = bt(l));
749
+ })), l.calculatedDuration === null && (l.calculatedDuration = vt(l));
747
750
  const { calculatedDuration: u } = l;
748
751
  this.calculatedDuration = u, this.resolvedDuration = u + i, this.totalDuration = this.resolvedDuration * (s + 1) - i, this.generator = l;
749
752
  }
@@ -755,22 +758,22 @@ class wt extends Tt {
755
758
  const { generator: s, totalDuration: i, mixKeyframes: r, mirroredGenerator: o, resolvedDuration: a, calculatedDuration: c } = this;
756
759
  if (this.startTime === null)
757
760
  return s.next(0);
758
- const { delay: l = 0, keyframes: u, repeat: d, repeatType: f, repeatDelay: h, type: y, onUpdate: b, finalKeyframe: T } = this.options;
761
+ const { delay: l = 0, keyframes: u, repeat: f, repeatType: d, repeatDelay: h, type: y, onUpdate: b, finalKeyframe: v } = this.options;
759
762
  this.speed > 0 ? this.startTime = Math.min(this.startTime, t) : this.speed < 0 && (this.startTime = Math.min(t - i / this.speed, this.startTime)), n ? this.currentTime = t : this.updateTime(t);
760
763
  const p = this.currentTime - l * (this.playbackSpeed >= 0 ? 1 : -1), V = this.playbackSpeed >= 0 ? p < 0 : p > i;
761
764
  this.currentTime = Math.max(p, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = i);
762
765
  let g = this.currentTime, x = s;
763
- if (d) {
766
+ if (f) {
764
767
  const w = Math.min(this.currentTime, i) / a;
765
768
  let R = Math.floor(w), O = w % 1;
766
- !O && w >= 1 && (O = 1), O === 1 && R--, R = Math.min(R, d + 1), !!(R % 2) && (f === "reverse" ? (O = 1 - O, h && (O -= h / a)) : f === "mirror" && (x = o)), g = H(0, 1, O) * a;
769
+ !O && w >= 1 && (O = 1), O === 1 && R--, R = Math.min(R, f + 1), !!(R % 2) && (d === "reverse" ? (O = 1 - O, h && (O -= h / a)) : d === "mirror" && (x = o)), g = Y(0, 1, O) * a;
767
770
  }
768
- const v = V ? { done: !1, value: u[0] } : x.next(g);
769
- r && (v.value = r(v.value));
770
- let { done: S } = v;
771
+ const T = V ? { done: !1, value: u[0] } : x.next(g);
772
+ r && (T.value = r(T.value));
773
+ let { done: S } = T;
771
774
  !V && c !== null && (S = this.playbackSpeed >= 0 ? this.currentTime >= i : this.currentTime <= 0);
772
775
  const C = this.holdTime === null && (this.state === "finished" || this.state === "running" && S);
773
- return C && y !== Xe && (v.value = vt(u, this.options, T, this.speed)), b && b(v.value), C && this.finish(), v;
776
+ return C && y !== qe && (T.value = wt(u, this.options, v, this.speed)), b && b(T.value), C && this.finish(), T;
774
777
  }
775
778
  /**
776
779
  * Allows the returned animation to be awaited or promise-chained. Currently
@@ -794,7 +797,7 @@ class wt extends Tt {
794
797
  return this.playbackSpeed;
795
798
  }
796
799
  set speed(t) {
797
- this.updateTime(I.now());
800
+ this.updateTime(k.now());
798
801
  const n = this.playbackSpeed !== t;
799
802
  this.playbackSpeed = t, n && (this.time = /* @__PURE__ */ B(this.currentTime));
800
803
  }
@@ -802,13 +805,13 @@ class wt extends Tt {
802
805
  var i, r;
803
806
  if (this.isStopped)
804
807
  return;
805
- const { driver: t = Bi, startTime: n } = this.options;
808
+ const { driver: t = ji, startTime: n } = this.options;
806
809
  this.driver || (this.driver = t((o) => this.tick(o))), (r = (i = this.options).onPlay) == null || r.call(i);
807
810
  const s = this.driver.now();
808
811
  this.state === "finished" ? (this.updateFinished(), this.startTime = s) : this.holdTime !== null ? this.startTime = s - this.holdTime : this.startTime || (this.startTime = n ?? s), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
809
812
  }
810
813
  pause() {
811
- this.state = "paused", this.updateTime(I.now()), this.holdTime = this.currentTime;
814
+ this.state = "paused", this.updateTime(k.now()), this.holdTime = this.currentTime;
812
815
  }
813
816
  complete() {
814
817
  this.state !== "running" && this.play(), this.state = "finished", this.holdTime = null;
@@ -835,14 +838,14 @@ class wt extends Tt {
835
838
  return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), (n = this.driver) == null || n.stop(), t.observe(this);
836
839
  }
837
840
  }
838
- function nr(e) {
841
+ function or(e) {
839
842
  for (let t = 1; t < e.length; t++)
840
843
  e[t] ?? (e[t] = e[t - 1]);
841
844
  }
842
- const _ = (e) => e * 180 / Math.PI, qe = (e) => {
843
- const t = _(Math.atan2(e[1], e[0]));
844
- return Ze(t);
845
- }, sr = {
845
+ const G = (e) => e * 180 / Math.PI, Ze = (e) => {
846
+ const t = G(Math.atan2(e[1], e[0]));
847
+ return Je(t);
848
+ }, ar = {
846
849
  x: 4,
847
850
  y: 5,
848
851
  translateX: 4,
@@ -850,56 +853,56 @@ const _ = (e) => e * 180 / Math.PI, qe = (e) => {
850
853
  scaleX: 0,
851
854
  scaleY: 3,
852
855
  scale: (e) => (Math.abs(e[0]) + Math.abs(e[3])) / 2,
853
- rotate: qe,
854
- rotateZ: qe,
855
- skewX: (e) => _(Math.atan(e[1])),
856
- skewY: (e) => _(Math.atan(e[2])),
856
+ rotate: Ze,
857
+ rotateZ: Ze,
858
+ skewX: (e) => G(Math.atan(e[1])),
859
+ skewY: (e) => G(Math.atan(e[2])),
857
860
  skew: (e) => (Math.abs(e[1]) + Math.abs(e[2])) / 2
858
- }, Ze = (e) => (e = e % 360, e < 0 && (e += 360), e), _t = qe, Gt = (e) => Math.sqrt(e[0] * e[0] + e[1] * e[1]), zt = (e) => Math.sqrt(e[4] * e[4] + e[5] * e[5]), ir = {
861
+ }, Je = (e) => (e = e % 360, e < 0 && (e += 360), e), Ht = Ze, Ut = (e) => Math.sqrt(e[0] * e[0] + e[1] * e[1]), Yt = (e) => Math.sqrt(e[4] * e[4] + e[5] * e[5]), ur = {
859
862
  x: 12,
860
863
  y: 13,
861
864
  z: 14,
862
865
  translateX: 12,
863
866
  translateY: 13,
864
867
  translateZ: 14,
865
- scaleX: Gt,
866
- scaleY: zt,
867
- scale: (e) => (Gt(e) + zt(e)) / 2,
868
- rotateX: (e) => Ze(_(Math.atan2(e[6], e[5]))),
869
- rotateY: (e) => Ze(_(Math.atan2(-e[2], e[0]))),
870
- rotateZ: _t,
871
- rotate: _t,
872
- skewX: (e) => _(Math.atan(e[4])),
873
- skewY: (e) => _(Math.atan(e[1])),
868
+ scaleX: Ut,
869
+ scaleY: Yt,
870
+ scale: (e) => (Ut(e) + Yt(e)) / 2,
871
+ rotateX: (e) => Je(G(Math.atan2(e[6], e[5]))),
872
+ rotateY: (e) => Je(G(Math.atan2(-e[2], e[0]))),
873
+ rotateZ: Ht,
874
+ rotate: Ht,
875
+ skewX: (e) => G(Math.atan(e[4])),
876
+ skewY: (e) => G(Math.atan(e[1])),
874
877
  skew: (e) => (Math.abs(e[1]) + Math.abs(e[4])) / 2
875
878
  };
876
- function Je(e) {
879
+ function Qe(e) {
877
880
  return e.includes("scale") ? 1 : 0;
878
881
  }
879
- function Qe(e, t) {
882
+ function et(e, t) {
880
883
  if (!e || e === "none")
881
- return Je(t);
884
+ return Qe(t);
882
885
  const n = e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
883
886
  let s, i;
884
887
  if (n)
885
- s = ir, i = n;
888
+ s = ur, i = n;
886
889
  else {
887
890
  const a = e.match(/^matrix\(([-\d.e\s,]+)\)$/u);
888
- s = sr, i = a;
891
+ s = ar, i = a;
889
892
  }
890
893
  if (!i)
891
- return Je(t);
892
- const r = s[t], o = i[1].split(",").map(or);
894
+ return Qe(t);
895
+ const r = s[t], o = i[1].split(",").map(lr);
893
896
  return typeof r == "function" ? r(o) : o[r];
894
897
  }
895
- const rr = (e, t) => {
898
+ const cr = (e, t) => {
896
899
  const { transform: n = "none" } = getComputedStyle(e);
897
- return Qe(n, t);
900
+ return et(n, t);
898
901
  };
899
- function or(e) {
902
+ function lr(e) {
900
903
  return parseFloat(e.trim());
901
904
  }
902
- const ie = [
905
+ const ae = [
903
906
  "transformPerspective",
904
907
  "x",
905
908
  "y",
@@ -917,15 +920,15 @@ const ie = [
917
920
  "skew",
918
921
  "skewX",
919
922
  "skewY"
920
- ], re = new Set(ie), Ut = (e) => e === ne || e === m, ar = /* @__PURE__ */ new Set(["x", "y", "z"]), ur = ie.filter((e) => !ar.has(e));
921
- function cr(e) {
923
+ ], ue = new Set(ae), Xt = (e) => e === re || e === m, fr = /* @__PURE__ */ new Set(["x", "y", "z"]), dr = ae.filter((e) => !fr.has(e));
924
+ function hr(e) {
922
925
  const t = [];
923
- return ur.forEach((n) => {
926
+ return dr.forEach((n) => {
924
927
  const s = e.getValue(n);
925
928
  s !== void 0 && (t.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
926
929
  }), t;
927
930
  }
928
- const z = {
931
+ const H = {
929
932
  // Dimensions
930
933
  width: ({ x: e }, { paddingLeft: t = "0", paddingRight: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
931
934
  height: ({ y: e }, { paddingTop: t = "0", paddingBottom: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
@@ -934,18 +937,18 @@ const z = {
934
937
  bottom: ({ y: e }, { top: t }) => parseFloat(t) + (e.max - e.min),
935
938
  right: ({ x: e }, { left: t }) => parseFloat(t) + (e.max - e.min),
936
939
  // Transform
937
- x: (e, { transform: t }) => Qe(t, "x"),
938
- y: (e, { transform: t }) => Qe(t, "y")
940
+ x: (e, { transform: t }) => et(t, "x"),
941
+ y: (e, { transform: t }) => et(t, "y")
939
942
  };
940
- z.translateX = z.x;
941
- z.translateY = z.y;
943
+ H.translateX = H.x;
944
+ H.translateY = H.y;
942
945
  const U = /* @__PURE__ */ new Set();
943
- let et = !1, tt = !1, nt = !1;
944
- function zn() {
945
- if (tt) {
946
+ let tt = !1, nt = !1, st = !1;
947
+ function Yn() {
948
+ if (nt) {
946
949
  const e = Array.from(U).filter((s) => s.needsMeasurement), t = new Set(e.map((s) => s.element)), n = /* @__PURE__ */ new Map();
947
950
  t.forEach((s) => {
948
- const i = cr(s);
951
+ const i = hr(s);
949
952
  i.length && (n.set(s, i), s.render());
950
953
  }), e.forEach((s) => s.measureInitialState()), t.forEach((s) => {
951
954
  s.render();
@@ -958,22 +961,22 @@ function zn() {
958
961
  s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
959
962
  });
960
963
  }
961
- tt = !1, et = !1, U.forEach((e) => e.complete(nt)), U.clear();
964
+ nt = !1, tt = !1, U.forEach((e) => e.complete(st)), U.clear();
962
965
  }
963
- function Un() {
966
+ function Xn() {
964
967
  U.forEach((e) => {
965
- e.readKeyframes(), e.needsMeasurement && (tt = !0);
968
+ e.readKeyframes(), e.needsMeasurement && (nt = !0);
966
969
  });
967
970
  }
968
- function lr() {
969
- nt = !0, Un(), zn(), nt = !1;
971
+ function pr() {
972
+ st = !0, Xn(), Yn(), st = !1;
970
973
  }
971
- class Vt {
974
+ class xt {
972
975
  constructor(t, n, s, i, r, o = !1) {
973
976
  this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...t], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = o;
974
977
  }
975
978
  scheduleResolve() {
976
- this.state = "scheduled", this.isAsync ? (U.add(this), et || (et = !0, k.read(Un), k.resolveKeyframes(zn))) : (this.readKeyframes(), this.complete());
979
+ this.state = "scheduled", this.isAsync ? (U.add(this), tt || (tt = !0, L.read(Xn), L.resolveKeyframes(Yn))) : (this.readKeyframes(), this.complete());
977
980
  }
978
981
  readKeyframes() {
979
982
  const { unresolvedKeyframes: t, name: n, element: s, motionValue: i } = this;
@@ -987,7 +990,7 @@ class Vt {
987
990
  }
988
991
  t[0] === void 0 && (t[0] = o), i && r === void 0 && i.set(t[0]);
989
992
  }
990
- nr(t);
993
+ or(t);
991
994
  }
992
995
  setFinalKeyframe() {
993
996
  }
@@ -1007,71 +1010,71 @@ class Vt {
1007
1010
  this.state === "pending" && this.scheduleResolve();
1008
1011
  }
1009
1012
  }
1010
- const fr = (e) => e.startsWith("--");
1011
- function dr(e, t, n) {
1012
- fr(t) ? e.style.setProperty(t, n) : e.style[t] = n;
1013
+ const mr = (e) => e.startsWith("--");
1014
+ function gr(e, t, n) {
1015
+ mr(t) ? e.style.setProperty(t, n) : e.style[t] = n;
1013
1016
  }
1014
- const hr = /* @__PURE__ */ ft(() => window.ScrollTimeline !== void 0), pr = {};
1015
- function mr(e, t) {
1016
- const n = /* @__PURE__ */ ft(e);
1017
- return () => pr[t] ?? n();
1017
+ const yr = /* @__PURE__ */ ht(() => window.ScrollTimeline !== void 0), br = {};
1018
+ function Tr(e, t) {
1019
+ const n = /* @__PURE__ */ ht(e);
1020
+ return () => br[t] ?? n();
1018
1021
  }
1019
- const Hn = /* @__PURE__ */ mr(() => {
1022
+ const qn = /* @__PURE__ */ Tr(() => {
1020
1023
  try {
1021
1024
  document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
1022
1025
  } catch {
1023
1026
  return !1;
1024
1027
  }
1025
1028
  return !0;
1026
- }, "linearEasing"), ae = ([e, t, n, s]) => `cubic-bezier(${e}, ${t}, ${n}, ${s})`, Ht = {
1029
+ }, "linearEasing"), le = ([e, t, n, s]) => `cubic-bezier(${e}, ${t}, ${n}, ${s})`, qt = {
1027
1030
  linear: "linear",
1028
1031
  ease: "ease",
1029
1032
  easeIn: "ease-in",
1030
1033
  easeOut: "ease-out",
1031
1034
  easeInOut: "ease-in-out",
1032
- circIn: /* @__PURE__ */ ae([0, 0.65, 0.55, 1]),
1033
- circOut: /* @__PURE__ */ ae([0.55, 0, 1, 0.45]),
1034
- backIn: /* @__PURE__ */ ae([0.31, 0.01, 0.66, -0.59]),
1035
- backOut: /* @__PURE__ */ ae([0.33, 1.53, 0.69, 0.99])
1035
+ circIn: /* @__PURE__ */ le([0, 0.65, 0.55, 1]),
1036
+ circOut: /* @__PURE__ */ le([0.55, 0, 1, 0.45]),
1037
+ backIn: /* @__PURE__ */ le([0.31, 0.01, 0.66, -0.59]),
1038
+ backOut: /* @__PURE__ */ le([0.33, 1.53, 0.69, 0.99])
1036
1039
  };
1037
- function Yn(e, t) {
1040
+ function Zn(e, t) {
1038
1041
  if (e)
1039
- return typeof e == "function" ? Hn() ? jn(e, t) : "ease-out" : Rn(e) ? ae(e) : Array.isArray(e) ? e.map((n) => Yn(n, t) || Ht.easeOut) : Ht[e];
1042
+ return typeof e == "function" ? qn() ? zn(e, t) : "ease-out" : kn(e) ? le(e) : Array.isArray(e) ? e.map((n) => Zn(n, t) || qt.easeOut) : qt[e];
1040
1043
  }
1041
- function gr(e, t, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a = "easeOut", times: c } = {}, l = void 0) {
1044
+ function vr(e, t, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a = "easeOut", times: c } = {}, l = void 0) {
1042
1045
  const u = {
1043
1046
  [t]: n
1044
1047
  };
1045
1048
  c && (u.offset = c);
1046
- const d = Yn(a, i);
1047
- Array.isArray(d) && (u.easing = d);
1048
- const f = {
1049
+ const f = Zn(a, i);
1050
+ Array.isArray(f) && (u.easing = f);
1051
+ const d = {
1049
1052
  delay: s,
1050
1053
  duration: i,
1051
- easing: Array.isArray(d) ? "linear" : d,
1054
+ easing: Array.isArray(f) ? "linear" : f,
1052
1055
  fill: "both",
1053
1056
  iterations: r + 1,
1054
1057
  direction: o === "reverse" ? "alternate" : "normal"
1055
1058
  };
1056
- return l && (f.pseudoElement = l), e.animate(u, f);
1059
+ return l && (d.pseudoElement = l), e.animate(u, d);
1057
1060
  }
1058
- function Xn(e) {
1061
+ function Jn(e) {
1059
1062
  return typeof e == "function" && "applyToOptions" in e;
1060
1063
  }
1061
- function yr({ type: e, ...t }) {
1062
- return Xn(e) && Hn() ? e.applyToOptions(t) : (t.duration ?? (t.duration = 300), t.ease ?? (t.ease = "easeOut"), t);
1064
+ function wr({ type: e, ...t }) {
1065
+ return Jn(e) && qn() ? e.applyToOptions(t) : (t.duration ?? (t.duration = 300), t.ease ?? (t.ease = "easeOut"), t);
1063
1066
  }
1064
- class br extends Tt {
1067
+ class Vr extends Vt {
1065
1068
  constructor(t) {
1066
1069
  if (super(), this.finishedTime = null, this.isStopped = !1, !t)
1067
1070
  return;
1068
1071
  const { element: n, name: s, keyframes: i, pseudoElement: r, allowFlatten: o = !1, finalKeyframe: a, onComplete: c } = t;
1069
- this.isPseudoElement = !!r, this.allowFlatten = o, this.options = t, Y(typeof t.type != "string", `animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);
1070
- const l = yr(t);
1071
- this.animation = gr(n, s, i, l, r), l.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
1072
+ this.isPseudoElement = !!r, this.allowFlatten = o, this.options = t, X(typeof t.type != "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring");
1073
+ const l = wr(t);
1074
+ this.animation = vr(n, s, i, l, r), l.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
1072
1075
  if (this.finishedTime = this.time, !r) {
1073
- const u = vt(i, this.options, a, this.speed);
1074
- this.updateMotionValue ? this.updateMotionValue(u) : dr(n, s, u), this.animation.cancel();
1076
+ const u = wt(i, this.options, a, this.speed);
1077
+ this.updateMotionValue ? this.updateMotionValue(u) : gr(n, s, u), this.animation.cancel();
1075
1078
  }
1076
1079
  c == null || c(), this.notifyFinished();
1077
1080
  };
@@ -1150,24 +1153,24 @@ class br extends Tt {
1150
1153
  */
1151
1154
  attachTimeline({ timeline: t, observe: n }) {
1152
1155
  var s;
1153
- return this.allowFlatten && ((s = this.animation.effect) == null || s.updateTiming({ easing: "linear" })), this.animation.onfinish = null, t && hr() ? (this.animation.timeline = t, te) : n(this);
1156
+ return this.allowFlatten && ((s = this.animation.effect) == null || s.updateTiming({ easing: "linear" })), this.animation.onfinish = null, t && yr() ? (this.animation.timeline = t, ie) : n(this);
1154
1157
  }
1155
1158
  }
1156
- const qn = {
1157
- anticipate: Pn,
1158
- backInOut: Cn,
1159
- circInOut: Fn
1159
+ const Qn = {
1160
+ anticipate: Rn,
1161
+ backInOut: Dn,
1162
+ circInOut: On
1160
1163
  };
1161
- function vr(e) {
1162
- return e in qn;
1164
+ function Sr(e) {
1165
+ return e in Qn;
1163
1166
  }
1164
- function Tr(e) {
1165
- typeof e.ease == "string" && vr(e.ease) && (e.ease = qn[e.ease]);
1167
+ function xr(e) {
1168
+ typeof e.ease == "string" && Sr(e.ease) && (e.ease = Qn[e.ease]);
1166
1169
  }
1167
- const Yt = 10;
1168
- class wr extends br {
1170
+ const Zt = 10;
1171
+ class Ar extends Vr {
1169
1172
  constructor(t) {
1170
- Tr(t), Gn(t), super(t), t.startTime && (this.startTime = t.startTime), this.options = t;
1173
+ xr(t), Un(t), super(t), t.startTime && (this.startTime = t.startTime), this.options = t;
1171
1174
  }
1172
1175
  /**
1173
1176
  * WAAPI doesn't natively have any interruption capabilities.
@@ -1185,17 +1188,17 @@ class wr extends br {
1185
1188
  n.set(t);
1186
1189
  return;
1187
1190
  }
1188
- const a = new wt({
1191
+ const a = new St({
1189
1192
  ...o,
1190
1193
  autoplay: !1
1191
1194
  }), c = /* @__PURE__ */ N(this.finishedTime ?? this.time);
1192
- n.setWithVelocity(a.sample(c - Yt).value, a.sample(c).value, Yt), a.stop();
1195
+ n.setWithVelocity(a.sample(c - Zt).value, a.sample(c).value, Zt), a.stop();
1193
1196
  }
1194
1197
  }
1195
- const Xt = (e, t) => t === "zIndex" ? !1 : !!(typeof e == "number" || Array.isArray(e) || typeof e == "string" && // It's animatable if we have a string
1196
- (se.test(e) || e === "0") && // And it contains numbers and/or colors
1198
+ const Jt = (e, t) => t === "zIndex" ? !1 : !!(typeof e == "number" || Array.isArray(e) || typeof e == "string" && // It's animatable if we have a string
1199
+ (oe.test(e) || e === "0") && // And it contains numbers and/or colors
1197
1200
  !e.startsWith("url("));
1198
- function Vr(e) {
1201
+ function Mr(e) {
1199
1202
  const t = e[0];
1200
1203
  if (e.length === 1)
1201
1204
  return !0;
@@ -1203,47 +1206,47 @@ function Vr(e) {
1203
1206
  if (e[n] !== t)
1204
1207
  return !0;
1205
1208
  }
1206
- function Sr(e, t, n, s) {
1209
+ function Cr(e, t, n, s) {
1207
1210
  const i = e[0];
1208
1211
  if (i === null)
1209
1212
  return !1;
1210
1213
  if (t === "display" || t === "visibility")
1211
1214
  return !0;
1212
- const r = e[e.length - 1], o = Xt(i, t), a = Xt(r, t);
1213
- return pe(o === a, `You are trying to animate ${t} 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 || !a ? !1 : Vr(e) || (n === "spring" || Xn(n)) && s;
1215
+ const r = e[e.length - 1], o = Jt(i, t), a = Jt(r, t);
1216
+ return ge(o === a, `You are trying to animate ${t} from "${i}" to "${r}". "${o ? r : i}" is not an animatable value.`, "value-not-animatable"), !o || !a ? !1 : Mr(e) || (n === "spring" || Jn(n)) && s;
1214
1217
  }
1215
- function Zn(e) {
1216
- return ni(e) && "offsetHeight" in e;
1218
+ function it(e) {
1219
+ e.duration = 0, e.type;
1217
1220
  }
1218
- const xr = /* @__PURE__ */ new Set([
1221
+ const Pr = /* @__PURE__ */ new Set([
1219
1222
  "opacity",
1220
1223
  "clipPath",
1221
1224
  "filter",
1222
1225
  "transform"
1223
1226
  // TODO: Could be re-enabled now we have support for linear() easing
1224
1227
  // "background-color"
1225
- ]), Ar = /* @__PURE__ */ ft(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
1226
- function Mr(e) {
1227
- var l;
1228
+ ]), Fr = /* @__PURE__ */ ht(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
1229
+ function Dr(e) {
1230
+ var u;
1228
1231
  const { motionValue: t, name: n, repeatDelay: s, repeatType: i, damping: r, type: o } = e;
1229
- if (!Zn((l = t == null ? void 0 : t.owner) == null ? void 0 : l.current))
1232
+ if (!(((u = t == null ? void 0 : t.owner) == null ? void 0 : u.current) instanceof HTMLElement))
1230
1233
  return !1;
1231
- const { onUpdate: a, transformTemplate: c } = t.owner.getProps();
1232
- return Ar() && n && xr.has(n) && (n !== "transform" || !c) && /**
1234
+ const { onUpdate: c, transformTemplate: l } = t.owner.getProps();
1235
+ return Fr() && n && Pr.has(n) && (n !== "transform" || !l) && /**
1233
1236
  * If we're outputting values to onUpdate then we can't use WAAPI as there's
1234
1237
  * no way to read the value from WAAPI every frame.
1235
1238
  */
1236
- !a && !s && i !== "mirror" && r !== 0 && o !== "inertia";
1239
+ !c && !s && i !== "mirror" && r !== 0 && o !== "inertia";
1237
1240
  }
1238
- const Cr = 40;
1239
- class Pr extends Tt {
1240
- constructor({ autoplay: t = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", keyframes: a, name: c, motionValue: l, element: u, ...d }) {
1241
+ const Rr = 40;
1242
+ class Or extends Vt {
1243
+ constructor({ autoplay: t = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", keyframes: a, name: c, motionValue: l, element: u, ...f }) {
1241
1244
  var y;
1242
1245
  super(), this.stop = () => {
1243
- var b, T;
1244
- this._animation && (this._animation.stop(), (b = this.stopTimeline) == null || b.call(this)), (T = this.keyframeResolver) == null || T.cancel();
1245
- }, this.createdAt = I.now();
1246
- const f = {
1246
+ var b, v;
1247
+ this._animation && (this._animation.stop(), (b = this.stopTimeline) == null || b.call(this)), (v = this.keyframeResolver) == null || v.cancel();
1248
+ }, this.createdAt = k.now();
1249
+ const d = {
1247
1250
  autoplay: t,
1248
1251
  delay: n,
1249
1252
  type: s,
@@ -1253,24 +1256,24 @@ class Pr extends Tt {
1253
1256
  name: c,
1254
1257
  motionValue: l,
1255
1258
  element: u,
1256
- ...d
1257
- }, h = (u == null ? void 0 : u.KeyframeResolver) || Vt;
1258
- this.keyframeResolver = new h(a, (b, T, p) => this.onKeyframesResolved(b, T, f, !p), c, l, u), (y = this.keyframeResolver) == null || y.scheduleResolve();
1259
+ ...f
1260
+ }, h = (u == null ? void 0 : u.KeyframeResolver) || xt;
1261
+ this.keyframeResolver = new h(a, (b, v, p) => this.onKeyframesResolved(b, v, d, !p), c, l, u), (y = this.keyframeResolver) == null || y.scheduleResolve();
1259
1262
  }
1260
1263
  onKeyframesResolved(t, n, s, i) {
1261
1264
  this.keyframeResolver = void 0;
1262
1265
  const { name: r, type: o, velocity: a, delay: c, isHandoff: l, onUpdate: u } = s;
1263
- this.resolvedAt = I.now(), Sr(t, r, o, a) || ((K.instantAnimations || !c) && (u == null || u(vt(t, s, n))), t[0] = t[t.length - 1], s.duration = 0, s.repeat = 0);
1264
- const f = {
1265
- startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt > Cr ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
1266
+ this.resolvedAt = k.now(), Cr(t, r, o, a) || ((K.instantAnimations || !c) && (u == null || u(wt(t, s, n))), t[0] = t[t.length - 1], it(s), s.repeat = 0);
1267
+ const d = {
1268
+ startTime: i ? this.resolvedAt ? this.resolvedAt - this.createdAt > Rr ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
1266
1269
  finalKeyframe: n,
1267
1270
  ...s,
1268
1271
  keyframes: t
1269
- }, h = !l && Mr(f) ? new wr({
1270
- ...f,
1271
- element: f.motionValue.owner.current
1272
- }) : new wt(f);
1273
- h.finished.then(() => this.notifyFinished()).catch(te), this.pendingTimeline && (this.stopTimeline = h.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = h;
1272
+ }, h = !l && Dr(d) ? new Ar({
1273
+ ...d,
1274
+ element: d.motionValue.owner.current
1275
+ }) : new St(d);
1276
+ h.finished.then(() => this.notifyFinished()).catch(ie), this.pendingTimeline && (this.stopTimeline = h.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = h;
1274
1277
  }
1275
1278
  get finished() {
1276
1279
  return this._animation ? this.animation.finished : this._finished;
@@ -1281,7 +1284,7 @@ class Pr extends Tt {
1281
1284
  }
1282
1285
  get animation() {
1283
1286
  var t;
1284
- return this._animation || ((t = this.keyframeResolver) == null || t.resume(), lr()), this._animation;
1287
+ return this._animation || ((t = this.keyframeResolver) == null || t.resume(), pr()), this._animation;
1285
1288
  }
1286
1289
  get duration() {
1287
1290
  return this.animation.duration;
@@ -1321,78 +1324,78 @@ class Pr extends Tt {
1321
1324
  this._animation && this.animation.cancel(), (t = this.keyframeResolver) == null || t.cancel();
1322
1325
  }
1323
1326
  }
1324
- const Fr = (
1327
+ const Ir = (
1325
1328
  // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
1326
1329
  /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
1327
1330
  );
1328
- function Dr(e) {
1329
- const t = Fr.exec(e);
1331
+ function kr(e) {
1332
+ const t = Ir.exec(e);
1330
1333
  if (!t)
1331
1334
  return [,];
1332
1335
  const [, n, s, i] = t;
1333
1336
  return [`--${n ?? s}`, i];
1334
1337
  }
1335
- const Rr = 4;
1336
- function Jn(e, t, n = 1) {
1337
- Y(n <= Rr, `Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);
1338
- const [s, i] = Dr(e);
1338
+ const Er = 4;
1339
+ function es(e, t, n = 1) {
1340
+ X(n <= Er, `Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
1341
+ const [s, i] = kr(e);
1339
1342
  if (!s)
1340
1343
  return;
1341
1344
  const r = window.getComputedStyle(t).getPropertyValue(s);
1342
1345
  if (r) {
1343
1346
  const o = r.trim();
1344
- return yn(o) ? parseFloat(o) : o;
1347
+ return vn(o) ? parseFloat(o) : o;
1345
1348
  }
1346
- return pt(i) ? Jn(i, t, n + 1) : i;
1349
+ return gt(i) ? es(i, t, n + 1) : i;
1347
1350
  }
1348
- function Qn(e, t) {
1351
+ function ts(e, t) {
1349
1352
  return (e == null ? void 0 : e[t]) ?? (e == null ? void 0 : e.default) ?? e;
1350
1353
  }
1351
- const es = /* @__PURE__ */ new Set([
1354
+ const ns = /* @__PURE__ */ new Set([
1352
1355
  "width",
1353
1356
  "height",
1354
1357
  "top",
1355
1358
  "left",
1356
1359
  "right",
1357
1360
  "bottom",
1358
- ...ie
1359
- ]), Or = {
1361
+ ...ae
1362
+ ]), Lr = {
1360
1363
  test: (e) => e === "auto",
1361
1364
  parse: (e) => e
1362
- }, ts = (e) => (t) => t.test(e), ns = [ne, m, J, $, Vi, wi, Or], qt = (e) => ns.find(ts(e));
1363
- function Ir(e) {
1364
- return typeof e == "number" ? e === 0 : e !== null ? e === "none" || e === "0" || bn(e) : !0;
1365
+ }, ss = (e) => (t) => t.test(e), is = [re, m, ee, $, Mi, Ai, Lr], Qt = (e) => is.find(ss(e));
1366
+ function Nr(e) {
1367
+ return typeof e == "number" ? e === 0 : e !== null ? e === "none" || e === "0" || wn(e) : !0;
1365
1368
  }
1366
- const Er = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
1367
- function kr(e) {
1369
+ const Br = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
1370
+ function Kr(e) {
1368
1371
  const [t, n] = e.slice(0, -1).split("(");
1369
1372
  if (t === "drop-shadow")
1370
1373
  return e;
1371
- const [s] = n.match(mt) || [];
1374
+ const [s] = n.match(yt) || [];
1372
1375
  if (!s)
1373
1376
  return e;
1374
1377
  const i = n.replace(s, "");
1375
- let r = Er.has(t) ? 1 : 0;
1378
+ let r = Br.has(t) ? 1 : 0;
1376
1379
  return s !== n && (r *= 100), t + "(" + r + i + ")";
1377
1380
  }
1378
- const Nr = /\b([a-z-]*)\(.*?\)/gu, st = {
1379
- ...se,
1381
+ const $r = /\b([a-z-]*)\(.*?\)/gu, rt = {
1382
+ ...oe,
1380
1383
  getAnimatableNone: (e) => {
1381
- const t = e.match(Nr);
1382
- return t ? t.map(kr).join(" ") : e;
1384
+ const t = e.match($r);
1385
+ return t ? t.map(Kr).join(" ") : e;
1383
1386
  }
1384
- }, Zt = {
1385
- ...ne,
1387
+ }, en = {
1388
+ ...re,
1386
1389
  transform: Math.round
1387
- }, Lr = {
1390
+ }, Wr = {
1388
1391
  rotate: $,
1389
1392
  rotateX: $,
1390
1393
  rotateY: $,
1391
1394
  rotateZ: $,
1392
- scale: Te,
1393
- scaleX: Te,
1394
- scaleY: Te,
1395
- scaleZ: Te,
1395
+ scale: Ve,
1396
+ scaleX: Ve,
1397
+ scaleY: Ve,
1398
+ scaleZ: Ve,
1396
1399
  skew: $,
1397
1400
  skewX: $,
1398
1401
  skewY: $,
@@ -1405,11 +1408,11 @@ const Nr = /\b([a-z-]*)\(.*?\)/gu, st = {
1405
1408
  z: m,
1406
1409
  perspective: m,
1407
1410
  transformPerspective: m,
1408
- opacity: le,
1409
- originX: Bt,
1410
- originY: Bt,
1411
+ opacity: he,
1412
+ originX: Wt,
1413
+ originY: Wt,
1411
1414
  originZ: m
1412
- }, St = {
1415
+ }, At = {
1413
1416
  // Border props
1414
1417
  borderWidth: m,
1415
1418
  borderTopWidth: m,
@@ -1445,14 +1448,14 @@ const Nr = /\b([a-z-]*)\(.*?\)/gu, st = {
1445
1448
  // Misc
1446
1449
  backgroundPositionX: m,
1447
1450
  backgroundPositionY: m,
1448
- ...Lr,
1449
- zIndex: Zt,
1451
+ ...Wr,
1452
+ zIndex: en,
1450
1453
  // SVG
1451
- fillOpacity: le,
1452
- strokeOpacity: le,
1453
- numOctaves: Zt
1454
- }, Br = {
1455
- ...St,
1454
+ fillOpacity: he,
1455
+ strokeOpacity: he,
1456
+ numOctaves: en
1457
+ }, jr = {
1458
+ ...At,
1456
1459
  // Color props
1457
1460
  color: M,
1458
1461
  backgroundColor: M,
@@ -1465,25 +1468,25 @@ const Nr = /\b([a-z-]*)\(.*?\)/gu, st = {
1465
1468
  borderRightColor: M,
1466
1469
  borderBottomColor: M,
1467
1470
  borderLeftColor: M,
1468
- filter: st,
1469
- WebkitFilter: st
1470
- }, ss = (e) => Br[e];
1471
- function is(e, t) {
1472
- let n = ss(e);
1473
- return n !== st && (n = se), n.getAnimatableNone ? n.getAnimatableNone(t) : void 0;
1474
- }
1475
- const Kr = /* @__PURE__ */ new Set(["auto", "none", "0"]);
1476
- function $r(e, t, n) {
1471
+ filter: rt,
1472
+ WebkitFilter: rt
1473
+ }, rs = (e) => jr[e];
1474
+ function os(e, t) {
1475
+ let n = rs(e);
1476
+ return n !== rt && (n = oe), n.getAnimatableNone ? n.getAnimatableNone(t) : void 0;
1477
+ }
1478
+ const _r = /* @__PURE__ */ new Set(["auto", "none", "0"]);
1479
+ function Gr(e, t, n) {
1477
1480
  let s = 0, i;
1478
1481
  for (; s < e.length && !i; ) {
1479
1482
  const r = e[s];
1480
- typeof r == "string" && !Kr.has(r) && fe(r).values.length && (i = e[s]), s++;
1483
+ typeof r == "string" && !_r.has(r) && pe(r).values.length && (i = e[s]), s++;
1481
1484
  }
1482
1485
  if (i && n)
1483
1486
  for (const r of t)
1484
- e[r] = is(n, i);
1487
+ e[r] = os(n, i);
1485
1488
  }
1486
- class Wr extends Vt {
1489
+ class zr extends xt {
1487
1490
  constructor(t, n, s, i, r) {
1488
1491
  super(t, n, s, i, r, !0);
1489
1492
  }
@@ -1494,33 +1497,33 @@ class Wr extends Vt {
1494
1497
  super.readKeyframes();
1495
1498
  for (let c = 0; c < t.length; c++) {
1496
1499
  let l = t[c];
1497
- if (typeof l == "string" && (l = l.trim(), pt(l))) {
1498
- const u = Jn(l, n.current);
1500
+ if (typeof l == "string" && (l = l.trim(), gt(l))) {
1501
+ const u = es(l, n.current);
1499
1502
  u !== void 0 && (t[c] = u), c === t.length - 1 && (this.finalKeyframe = l);
1500
1503
  }
1501
1504
  }
1502
- if (this.resolveNoneKeyframes(), !es.has(s) || t.length !== 2)
1505
+ if (this.resolveNoneKeyframes(), !ns.has(s) || t.length !== 2)
1503
1506
  return;
1504
- const [i, r] = t, o = qt(i), a = qt(r);
1507
+ const [i, r] = t, o = Qt(i), a = Qt(r);
1505
1508
  if (o !== a)
1506
- if (Ut(o) && Ut(a))
1509
+ if (Xt(o) && Xt(a))
1507
1510
  for (let c = 0; c < t.length; c++) {
1508
1511
  const l = t[c];
1509
1512
  typeof l == "string" && (t[c] = parseFloat(l));
1510
1513
  }
1511
- else z[s] && (this.needsMeasurement = !0);
1514
+ else H[s] && (this.needsMeasurement = !0);
1512
1515
  }
1513
1516
  resolveNoneKeyframes() {
1514
1517
  const { unresolvedKeyframes: t, name: n } = this, s = [];
1515
1518
  for (let i = 0; i < t.length; i++)
1516
- (t[i] === null || Ir(t[i])) && s.push(i);
1517
- s.length && $r(t, s, n);
1519
+ (t[i] === null || Nr(t[i])) && s.push(i);
1520
+ s.length && Gr(t, s, n);
1518
1521
  }
1519
1522
  measureInitialState() {
1520
1523
  const { element: t, unresolvedKeyframes: n, name: s } = this;
1521
1524
  if (!t || !t.current)
1522
1525
  return;
1523
- s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = z[s](t.measureViewportBox(), window.getComputedStyle(t.current)), n[0] = this.measuredOrigin;
1526
+ s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = H[s](t.measureViewportBox(), window.getComputedStyle(t.current)), n[0] = this.measuredOrigin;
1524
1527
  const i = n[n.length - 1];
1525
1528
  i !== void 0 && t.getValue(s, i).jump(i, !1);
1526
1529
  }
@@ -1532,12 +1535,12 @@ class Wr extends Vt {
1532
1535
  const i = t.getValue(n);
1533
1536
  i && i.jump(this.measuredOrigin, !1);
1534
1537
  const r = s.length - 1, o = s[r];
1535
- s[r] = z[n](t.measureViewportBox(), window.getComputedStyle(t.current)), o !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = o), (a = this.removedTransforms) != null && a.length && this.removedTransforms.forEach(([c, l]) => {
1538
+ s[r] = H[n](t.measureViewportBox(), window.getComputedStyle(t.current)), o !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = o), (a = this.removedTransforms) != null && a.length && this.removedTransforms.forEach(([c, l]) => {
1536
1539
  t.getValue(c).set(l);
1537
1540
  }), this.resolveNoneKeyframes();
1538
1541
  }
1539
1542
  }
1540
- function jr(e, t, n) {
1543
+ function Hr(e, t, n) {
1541
1544
  if (e instanceof EventTarget)
1542
1545
  return [e];
1543
1546
  if (typeof e == "string") {
@@ -1547,8 +1550,12 @@ function jr(e, t, n) {
1547
1550
  }
1548
1551
  return Array.from(e);
1549
1552
  }
1550
- const rs = (e, t) => t && typeof e == "number" ? t.transform(e) : e, Jt = 30, _r = (e) => !isNaN(parseFloat(e));
1551
- class Gr {
1553
+ const as = (e, t) => t && typeof e == "number" ? t.transform(e) : e;
1554
+ function Ur(e) {
1555
+ return oi(e) && "offsetHeight" in e;
1556
+ }
1557
+ const tn = 30, Yr = (e) => !isNaN(parseFloat(e));
1558
+ class Xr {
1552
1559
  /**
1553
1560
  * @param init - The initiating value
1554
1561
  * @param config - Optional configuration options
@@ -1556,17 +1563,16 @@ class Gr {
1556
1563
  * - `transformer`: A function to transform incoming values with.
1557
1564
  */
1558
1565
  constructor(t, n = {}) {
1559
- this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s, i = !0) => {
1560
- var o, a;
1561
- const r = I.now();
1562
- if (this.updatedAt !== r && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && ((o = this.events.change) == null || o.notify(this.current), this.dependents))
1563
- for (const c of this.dependents)
1564
- c.dirty();
1565
- i && ((a = this.events.renderRequest) == null || a.notify(this.current));
1566
+ this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s) => {
1567
+ var r;
1568
+ const i = k.now();
1569
+ if (this.updatedAt !== i && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && ((r = this.events.change) == null || r.notify(this.current), this.dependents))
1570
+ for (const o of this.dependents)
1571
+ o.dirty();
1566
1572
  }, this.hasAnimated = !1, this.setCurrent(t), this.owner = n.owner;
1567
1573
  }
1568
1574
  setCurrent(t) {
1569
- this.current = t, this.updatedAt = I.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = _r(this.current));
1575
+ this.current = t, this.updatedAt = k.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = Yr(this.current));
1570
1576
  }
1571
1577
  setPrevFrameValue(t = this.current) {
1572
1578
  this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt;
@@ -1612,13 +1618,13 @@ class Gr {
1612
1618
  * @deprecated
1613
1619
  */
1614
1620
  onChange(t) {
1615
- return process.env.NODE_ENV !== "production" && Vn(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", t);
1621
+ return process.env.NODE_ENV !== "production" && An(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", t);
1616
1622
  }
1617
1623
  on(t, n) {
1618
- this.events[t] || (this.events[t] = new Tn());
1624
+ this.events[t] || (this.events[t] = new Sn());
1619
1625
  const s = this.events[t].add(n);
1620
1626
  return t === "change" ? () => {
1621
- s(), k.read(() => {
1627
+ s(), L.read(() => {
1622
1628
  this.events.change.getSize() || this.stop();
1623
1629
  });
1624
1630
  } : s;
@@ -1648,8 +1654,8 @@ class Gr {
1648
1654
  *
1649
1655
  * @public
1650
1656
  */
1651
- set(t, n = !0) {
1652
- !n || !this.passiveEffect ? this.updateAndNotify(t, n) : this.passiveEffect(t, this.updateAndNotify);
1657
+ set(t) {
1658
+ this.passiveEffect ? this.passiveEffect(t, this.updateAndNotify) : this.updateAndNotify(t);
1653
1659
  }
1654
1660
  setWithVelocity(t, n, s) {
1655
1661
  this.set(n), this.prev = void 0, this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt - s;
@@ -1695,11 +1701,11 @@ class Gr {
1695
1701
  * @public
1696
1702
  */
1697
1703
  getVelocity() {
1698
- const t = I.now();
1699
- if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt > Jt)
1704
+ const t = k.now();
1705
+ if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt > tn)
1700
1706
  return 0;
1701
- const n = Math.min(this.updatedAt - this.prevUpdatedAt, Jt);
1702
- return wn(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
1707
+ const n = Math.min(this.updatedAt - this.prevUpdatedAt, tn);
1708
+ return xn(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
1703
1709
  }
1704
1710
  /**
1705
1711
  * Registers a new animation to control this `MotionValue`. Only one
@@ -1751,35 +1757,35 @@ class Gr {
1751
1757
  (t = this.dependents) == null || t.clear(), (n = this.events.destroy) == null || n.notify(), this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
1752
1758
  }
1753
1759
  }
1754
- function Pe(e, t) {
1755
- return new Gr(e, t);
1760
+ function De(e, t) {
1761
+ return new Xr(e, t);
1756
1762
  }
1757
- const { schedule: zr } = /* @__PURE__ */ On(queueMicrotask, !1), Ur = {
1763
+ const { schedule: qr } = /* @__PURE__ */ En(queueMicrotask, !1), Zr = {
1758
1764
  y: !1
1759
1765
  };
1760
- function Hr() {
1761
- return Ur.y;
1766
+ function Jr() {
1767
+ return Zr.y;
1762
1768
  }
1763
- function os(e, t) {
1764
- const n = jr(e), s = new AbortController(), i = {
1769
+ function us(e, t) {
1770
+ const n = Hr(e), s = new AbortController(), i = {
1765
1771
  passive: !0,
1766
1772
  ...t,
1767
1773
  signal: s.signal
1768
1774
  };
1769
1775
  return [n, i, () => s.abort()];
1770
1776
  }
1771
- function Qt(e) {
1772
- return !(e.pointerType === "touch" || Hr());
1777
+ function nn(e) {
1778
+ return !(e.pointerType === "touch" || Jr());
1773
1779
  }
1774
- function Yr(e, t, n = {}) {
1775
- const [s, i, r] = os(e, n), o = (a) => {
1776
- if (!Qt(a))
1780
+ function Qr(e, t, n = {}) {
1781
+ const [s, i, r] = us(e, n), o = (a) => {
1782
+ if (!nn(a))
1777
1783
  return;
1778
1784
  const { target: c } = a, l = t(c, a);
1779
1785
  if (typeof l != "function" || !c)
1780
1786
  return;
1781
- const u = (d) => {
1782
- Qt(d) && (l(d), c.removeEventListener("pointerleave", u));
1787
+ const u = (f) => {
1788
+ nn(f) && (l(f), c.removeEventListener("pointerleave", u));
1783
1789
  };
1784
1790
  c.addEventListener("pointerleave", u, i);
1785
1791
  };
@@ -1787,18 +1793,18 @@ function Yr(e, t, n = {}) {
1787
1793
  a.addEventListener("pointerenter", o, i);
1788
1794
  }), r;
1789
1795
  }
1790
- const as = (e, t) => t ? e === t ? !0 : as(e, t.parentElement) : !1, Xr = (e) => e.pointerType === "mouse" ? typeof e.button != "number" || e.button <= 0 : e.isPrimary !== !1, qr = /* @__PURE__ */ new Set([
1796
+ const cs = (e, t) => t ? e === t ? !0 : cs(e, t.parentElement) : !1, eo = (e) => e.pointerType === "mouse" ? typeof e.button != "number" || e.button <= 0 : e.isPrimary !== !1, to = /* @__PURE__ */ new Set([
1791
1797
  "BUTTON",
1792
1798
  "INPUT",
1793
1799
  "SELECT",
1794
1800
  "TEXTAREA",
1795
1801
  "A"
1796
1802
  ]);
1797
- function Zr(e) {
1798
- return qr.has(e.tagName) || e.tabIndex !== -1;
1803
+ function no(e) {
1804
+ return to.has(e.tagName) || e.tabIndex !== -1;
1799
1805
  }
1800
- const Se = /* @__PURE__ */ new WeakSet();
1801
- function en(e) {
1806
+ const Ae = /* @__PURE__ */ new WeakSet();
1807
+ function sn(e) {
1802
1808
  return (t) => {
1803
1809
  t.key === "Enter" && e(t);
1804
1810
  };
@@ -1806,48 +1812,48 @@ function en(e) {
1806
1812
  function je(e, t) {
1807
1813
  e.dispatchEvent(new PointerEvent("pointer" + t, { isPrimary: !0, bubbles: !0 }));
1808
1814
  }
1809
- const Jr = (e, t) => {
1815
+ const so = (e, t) => {
1810
1816
  const n = e.currentTarget;
1811
1817
  if (!n)
1812
1818
  return;
1813
- const s = en(() => {
1814
- if (Se.has(n))
1819
+ const s = sn(() => {
1820
+ if (Ae.has(n))
1815
1821
  return;
1816
1822
  je(n, "down");
1817
- const i = en(() => {
1823
+ const i = sn(() => {
1818
1824
  je(n, "up");
1819
1825
  }), r = () => je(n, "cancel");
1820
1826
  n.addEventListener("keyup", i, t), n.addEventListener("blur", r, t);
1821
1827
  });
1822
1828
  n.addEventListener("keydown", s, t), n.addEventListener("blur", () => n.removeEventListener("keydown", s), t);
1823
1829
  };
1824
- function tn(e) {
1825
- return Xr(e) && !0;
1830
+ function rn(e) {
1831
+ return eo(e) && !0;
1826
1832
  }
1827
- function Qr(e, t, n = {}) {
1828
- const [s, i, r] = os(e, n), o = (a) => {
1833
+ function io(e, t, n = {}) {
1834
+ const [s, i, r] = us(e, n), o = (a) => {
1829
1835
  const c = a.currentTarget;
1830
- if (!tn(a))
1836
+ if (!rn(a))
1831
1837
  return;
1832
- Se.add(c);
1838
+ Ae.add(c);
1833
1839
  const l = t(c, a), u = (h, y) => {
1834
- window.removeEventListener("pointerup", d), window.removeEventListener("pointercancel", f), Se.has(c) && Se.delete(c), tn(h) && typeof l == "function" && l(h, { success: y });
1835
- }, d = (h) => {
1836
- u(h, c === window || c === document || n.useGlobalTarget || as(c, h.target));
1840
+ window.removeEventListener("pointerup", f), window.removeEventListener("pointercancel", d), Ae.has(c) && Ae.delete(c), rn(h) && typeof l == "function" && l(h, { success: y });
1837
1841
  }, f = (h) => {
1842
+ u(h, c === window || c === document || n.useGlobalTarget || cs(c, h.target));
1843
+ }, d = (h) => {
1838
1844
  u(h, !1);
1839
1845
  };
1840
- window.addEventListener("pointerup", d, i), window.addEventListener("pointercancel", f, i);
1846
+ window.addEventListener("pointerup", f, i), window.addEventListener("pointercancel", d, i);
1841
1847
  };
1842
1848
  return s.forEach((a) => {
1843
- (n.useGlobalTarget ? window : a).addEventListener("pointerdown", o, i), Zn(a) && (a.addEventListener("focus", (l) => Jr(l, i)), !Zr(a) && !a.hasAttribute("tabindex") && (a.tabIndex = 0));
1849
+ (n.useGlobalTarget ? window : a).addEventListener("pointerdown", o, i), Ur(a) && (a.addEventListener("focus", (l) => so(l, i)), !no(a) && !a.hasAttribute("tabindex") && (a.tabIndex = 0));
1844
1850
  }), r;
1845
1851
  }
1846
- const D = (e) => !!(e && e.getVelocity), eo = [...ns, M, se], to = (e) => eo.find(ts(e)), us = ee({
1852
+ const D = (e) => !!(e && e.getVelocity), ro = [...is, M, oe], oo = (e) => ro.find(ss(e)), ls = se({
1847
1853
  transformPagePoint: (e) => e,
1848
1854
  isStatic: !1,
1849
1855
  reducedMotion: "never"
1850
- }), xt = ee({ strict: !1 }), nn = {
1856
+ }), Mt = se({ strict: !1 }), on = {
1851
1857
  animation: [
1852
1858
  "animate",
1853
1859
  "variants",
@@ -1866,34 +1872,34 @@ const D = (e) => !!(e && e.getVelocity), eo = [...ns, M, se], to = (e) => eo.fin
1866
1872
  pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
1867
1873
  inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
1868
1874
  layout: ["layout", "layoutId"]
1869
- }, Q = {};
1870
- for (const e in nn)
1871
- Q[e] = {
1872
- isEnabled: (t) => nn[e].some((n) => !!t[n])
1875
+ }, ne = {};
1876
+ for (const e in on)
1877
+ ne[e] = {
1878
+ isEnabled: (t) => on[e].some((n) => !!t[n])
1873
1879
  };
1874
- function sn(e) {
1880
+ function an(e) {
1875
1881
  for (const t in e)
1876
- Q[t] = {
1877
- ...Q[t],
1882
+ ne[t] = {
1883
+ ...ne[t],
1878
1884
  ...e[t]
1879
1885
  };
1880
1886
  }
1881
- function no({ children: e, features: t, strict: n = !1 }) {
1882
- const [, s] = Us(!_e(t)), i = ue(void 0);
1887
+ function ao({ children: e, features: t, strict: n = !1 }) {
1888
+ const [, s] = qs(!_e(t)), i = fe(void 0);
1883
1889
  if (!_e(t)) {
1884
1890
  const { renderer: r, ...o } = t;
1885
- i.current = r, sn(o);
1891
+ i.current = r, an(o);
1886
1892
  }
1887
- return ct(() => {
1893
+ return ft(() => {
1888
1894
  _e(t) && t().then(({ renderer: r, ...o }) => {
1889
- sn(o), i.current = r, s(!0);
1895
+ an(o), i.current = r, s(!0);
1890
1896
  });
1891
- }, []), F(xt.Provider, { value: { renderer: i.current, strict: n }, children: e });
1897
+ }, []), F(Mt.Provider, { value: { renderer: i.current, strict: n }, children: e });
1892
1898
  }
1893
1899
  function _e(e) {
1894
1900
  return typeof e == "function";
1895
1901
  }
1896
- const so = /* @__PURE__ */ new Set([
1902
+ const uo = /* @__PURE__ */ new Set([
1897
1903
  "animate",
1898
1904
  "exit",
1899
1905
  "variants",
@@ -1925,32 +1931,32 @@ const so = /* @__PURE__ */ new Set([
1925
1931
  "ignoreStrict",
1926
1932
  "viewport"
1927
1933
  ]);
1928
- function Fe(e) {
1929
- return e.startsWith("while") || e.startsWith("drag") && e !== "draggable" || e.startsWith("layout") || e.startsWith("onTap") || e.startsWith("onPan") || e.startsWith("onLayout") || so.has(e);
1934
+ function Re(e) {
1935
+ return e.startsWith("while") || e.startsWith("drag") && e !== "draggable" || e.startsWith("layout") || e.startsWith("onTap") || e.startsWith("onPan") || e.startsWith("onLayout") || uo.has(e);
1930
1936
  }
1931
- let cs = (e) => !Fe(e);
1932
- function io(e) {
1933
- typeof e == "function" && (cs = (t) => t.startsWith("on") ? !Fe(t) : e(t));
1937
+ let fs = (e) => !Re(e);
1938
+ function co(e) {
1939
+ typeof e == "function" && (fs = (t) => t.startsWith("on") ? !Re(t) : e(t));
1934
1940
  }
1935
1941
  try {
1936
- io(require("@emotion/is-prop-valid").default);
1942
+ co(require("@emotion/is-prop-valid").default);
1937
1943
  } catch {
1938
1944
  }
1939
- function ro(e, t, n) {
1945
+ function lo(e, t, n) {
1940
1946
  const s = {};
1941
1947
  for (const i in e)
1942
- i === "values" && typeof e.values == "object" || (cs(i) || n === !0 && Fe(i) || !t && !Fe(i) || // If trying to use native HTML drag events, forward drag listeners
1948
+ i === "values" && typeof e.values == "object" || (fs(i) || n === !0 && Re(i) || !t && !Re(i) || // If trying to use native HTML drag events, forward drag listeners
1943
1949
  e.draggable && i.startsWith("onDrag")) && (s[i] = e[i]);
1944
1950
  return s;
1945
1951
  }
1946
- const Ie = /* @__PURE__ */ ee({});
1947
- function Ee(e) {
1952
+ const Ee = /* @__PURE__ */ se({});
1953
+ function Le(e) {
1948
1954
  return e !== null && typeof e == "object" && typeof e.start == "function";
1949
1955
  }
1950
- function de(e) {
1956
+ function me(e) {
1951
1957
  return typeof e == "string" || Array.isArray(e);
1952
1958
  }
1953
- const At = [
1959
+ const Ct = [
1954
1960
  "animate",
1955
1961
  "whileInView",
1956
1962
  "whileFocus",
@@ -1958,158 +1964,52 @@ const At = [
1958
1964
  "whileTap",
1959
1965
  "whileDrag",
1960
1966
  "exit"
1961
- ], Mt = ["initial", ...At];
1962
- function ke(e) {
1963
- return Ee(e.animate) || Mt.some((t) => de(e[t]));
1967
+ ], Pt = ["initial", ...Ct];
1968
+ function Ne(e) {
1969
+ return Le(e.animate) || Pt.some((t) => me(e[t]));
1964
1970
  }
1965
- function ls(e) {
1966
- return !!(ke(e) || e.variants);
1971
+ function ds(e) {
1972
+ return !!(Ne(e) || e.variants);
1967
1973
  }
1968
- function oo(e, t) {
1969
- if (ke(e)) {
1974
+ function fo(e, t) {
1975
+ if (Ne(e)) {
1970
1976
  const { initial: n, animate: s } = e;
1971
1977
  return {
1972
- initial: n === !1 || de(n) ? n : void 0,
1973
- animate: de(s) ? s : void 0
1978
+ initial: n === !1 || me(n) ? n : void 0,
1979
+ animate: me(s) ? s : void 0
1974
1980
  };
1975
1981
  }
1976
1982
  return e.inherit !== !1 ? t : {};
1977
1983
  }
1978
- function ao(e) {
1979
- const { initial: t, animate: n } = oo(e, E(Ie));
1980
- return De(() => ({ initial: t, animate: n }), [rn(t), rn(n)]);
1984
+ function ho(e) {
1985
+ const { initial: t, animate: n } = fo(e, E(Ee));
1986
+ return Oe(() => ({ initial: t, animate: n }), [un(t), un(n)]);
1981
1987
  }
1982
- function rn(e) {
1988
+ function un(e) {
1983
1989
  return Array.isArray(e) ? e.join(" ") : e;
1984
1990
  }
1985
- const uo = Symbol.for("motionComponentSymbol");
1986
- function fs(e) {
1987
- return e && typeof e == "object" && Object.prototype.hasOwnProperty.call(e, "current");
1988
- }
1989
- function co(e, t, n) {
1990
- return Hs(
1991
- (s) => {
1992
- s && e.onMount && e.onMount(s), t && (s ? t.mount(s) : t.unmount()), n && (typeof n == "function" ? n(s) : fs(n) && (n.current = s));
1993
- },
1994
- /**
1995
- * Only pass a new ref callback to React if we've received a visual element
1996
- * factory. Otherwise we'll be mounting/remounting every time externalRef
1997
- * or other dependencies change.
1998
- */
1999
- [t]
2000
- );
2001
- }
2002
- const Ct = (e) => e.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), lo = "framerAppearId", ds = "data-" + Ct(lo), fo = ee({});
2003
- function ho(e, t, n, s, i) {
2004
- var b, T;
2005
- const { visualElement: r } = E(Ie), o = E(xt), a = E(gn), c = E(us).reducedMotion, l = ue(null);
2006
- s = s || o.renderer, !l.current && s && (l.current = s(e, {
2007
- visualState: t,
2008
- parent: r,
2009
- props: n,
2010
- presenceContext: a,
2011
- blockInitialAnimation: a ? a.initial === !1 : !1,
2012
- reducedMotionConfig: c
2013
- }));
2014
- const u = l.current, d = E(fo);
2015
- u && !u.projection && i && (u.type === "html" || u.type === "svg") && po(l.current, n, i, d);
2016
- const f = ue(!1);
2017
- Ys(() => {
2018
- u && f.current && u.update(n, a);
2019
- });
2020
- const h = n[ds], y = ue(!!h && !((b = window.MotionHandoffIsComplete) != null && b.call(window, h)) && ((T = window.MotionHasOptimisedAnimation) == null ? void 0 : T.call(window, h)));
2021
- return Qs(() => {
2022
- u && (f.current = !0, window.MotionIsMounted = !0, u.updateFeatures(), zr.render(u.render), y.current && u.animationState && u.animationState.animateChanges());
2023
- }), ct(() => {
2024
- u && (!y.current && u.animationState && u.animationState.animateChanges(), y.current && (queueMicrotask(() => {
2025
- var p;
2026
- (p = window.MotionHandoffMarkAsComplete) == null || p.call(window, h);
2027
- }), y.current = !1));
2028
- }), u;
2029
- }
2030
- function po(e, t, n, s) {
2031
- const { layoutId: i, layout: r, drag: o, dragConstraints: a, layoutScroll: c, layoutRoot: l, layoutCrossfade: u } = t;
2032
- e.projection = new n(e.latestValues, t["data-framer-portal-id"] ? void 0 : hs(e.parent)), e.projection.setOptions({
2033
- layoutId: i,
2034
- layout: r,
2035
- alwaysMeasureLayout: !!o || a && fs(a),
2036
- visualElement: e,
2037
- /**
2038
- * TODO: Update options in an effect. This could be tricky as it'll be too late
2039
- * to update by the time layout animations run.
2040
- * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
2041
- * ensuring it gets called if there's no potential layout animations.
2042
- *
2043
- */
2044
- animationType: typeof r == "string" ? r : "both",
2045
- initialPromotionConfig: s,
2046
- crossfade: u,
2047
- layoutScroll: c,
2048
- layoutRoot: l
2049
- });
2050
- }
2051
- function hs(e) {
2052
- if (e)
2053
- return e.options.allowProjection !== !1 ? e.projection : hs(e.parent);
2054
- }
2055
- function mo({ preloadedFeatures: e, createVisualElement: t, useRender: n, useVisualState: s, Component: i }) {
2056
- function r(a, c) {
2057
- let l;
2058
- const u = {
2059
- ...E(us),
2060
- ...a,
2061
- layoutId: go(a)
2062
- }, { isStatic: d } = u, f = ao(a), h = s(a, d);
2063
- if (!d && lt) {
2064
- yo(u, e);
2065
- const y = bo(u);
2066
- l = y.MeasureLayout, f.visualElement = ho(i, h, u, t, y.ProjectionNode);
2067
- }
2068
- return ut(Ie.Provider, { value: f, children: [l && f.visualElement ? F(l, { visualElement: f.visualElement, ...u }) : null, n(i, a, co(h, f.visualElement, c), h, d, f.visualElement)] });
2069
- }
2070
- r.displayName = `motion.${typeof i == "string" ? i : `create(${i.displayName ?? i.name ?? ""})`}`;
2071
- const o = Xs(r);
2072
- return o[uo] = i, o;
2073
- }
2074
- function go({ layoutId: e }) {
2075
- const t = E(Zs).id;
2076
- return t && e !== void 0 ? t + "-" + e : e;
2077
- }
2078
- function yo(e, t) {
2079
- E(xt).strict, process.env.NODE_ENV;
2080
- }
2081
- function bo(e) {
2082
- const { drag: t, layout: n } = Q;
2083
- if (!t && !n)
2084
- return {};
2085
- const s = { ...t, ...n };
2086
- return {
2087
- MeasureLayout: t != null && t.isEnabled(e) || n != null && n.isEnabled(e) ? s.MeasureLayout : void 0,
2088
- ProjectionNode: s.ProjectionNode
2089
- };
2090
- }
2091
- const vo = {};
2092
- function ps(e, { layout: t, layoutId: n }) {
2093
- return re.has(e) || e.startsWith("origin") || (t || n !== void 0) && (!!vo[e] || e === "opacity");
1991
+ const po = {};
1992
+ function hs(e, { layout: t, layoutId: n }) {
1993
+ return ue.has(e) || e.startsWith("origin") || (t || n !== void 0) && (!!po[e] || e === "opacity");
2094
1994
  }
2095
- const To = {
1995
+ const mo = {
2096
1996
  x: "translateX",
2097
1997
  y: "translateY",
2098
1998
  z: "translateZ",
2099
1999
  transformPerspective: "perspective"
2100
- }, wo = ie.length;
2101
- function Vo(e, t, n) {
2000
+ }, go = ae.length;
2001
+ function yo(e, t, n) {
2102
2002
  let s = "", i = !0;
2103
- for (let r = 0; r < wo; r++) {
2104
- const o = ie[r], a = e[o];
2003
+ for (let r = 0; r < go; r++) {
2004
+ const o = ae[r], a = e[o];
2105
2005
  if (a === void 0)
2106
2006
  continue;
2107
2007
  let c = !0;
2108
2008
  if (typeof a == "number" ? c = a === (o.startsWith("scale") ? 1 : 0) : c = parseFloat(a) === 0, !c || n) {
2109
- const l = rs(a, St[o]);
2009
+ const l = as(a, At[o]);
2110
2010
  if (!c) {
2111
2011
  i = !1;
2112
- const u = To[o] || o;
2012
+ const u = mo[o] || o;
2113
2013
  s += `${u}(${l}) `;
2114
2014
  }
2115
2015
  n && (t[o] = l);
@@ -2117,66 +2017,66 @@ function Vo(e, t, n) {
2117
2017
  }
2118
2018
  return s = s.trim(), n ? s = n(t, i ? "" : s) : i && (s = "none"), s;
2119
2019
  }
2120
- function Pt(e, t, n) {
2020
+ function Ft(e, t, n) {
2121
2021
  const { style: s, vars: i, transformOrigin: r } = e;
2122
2022
  let o = !1, a = !1;
2123
2023
  for (const c in t) {
2124
2024
  const l = t[c];
2125
- if (re.has(c)) {
2025
+ if (ue.has(c)) {
2126
2026
  o = !0;
2127
2027
  continue;
2128
- } else if (En(c)) {
2028
+ } else if (Nn(c)) {
2129
2029
  i[c] = l;
2130
2030
  continue;
2131
2031
  } else {
2132
- const u = rs(l, St[c]);
2032
+ const u = as(l, At[c]);
2133
2033
  c.startsWith("origin") ? (a = !0, r[c] = u) : s[c] = u;
2134
2034
  }
2135
2035
  }
2136
- if (t.transform || (o || n ? s.transform = Vo(t, e.transform, n) : s.transform && (s.transform = "none")), a) {
2036
+ if (t.transform || (o || n ? s.transform = yo(t, e.transform, n) : s.transform && (s.transform = "none")), a) {
2137
2037
  const { originX: c = "50%", originY: l = "50%", originZ: u = 0 } = r;
2138
2038
  s.transformOrigin = `${c} ${l} ${u}`;
2139
2039
  }
2140
2040
  }
2141
- const Ft = () => ({
2041
+ const Dt = () => ({
2142
2042
  style: {},
2143
2043
  transform: {},
2144
2044
  transformOrigin: {},
2145
2045
  vars: {}
2146
2046
  });
2147
- function ms(e, t, n) {
2047
+ function ps(e, t, n) {
2148
2048
  for (const s in t)
2149
- !D(t[s]) && !ps(s, n) && (e[s] = t[s]);
2049
+ !D(t[s]) && !hs(s, n) && (e[s] = t[s]);
2150
2050
  }
2151
- function So({ transformTemplate: e }, t) {
2152
- return De(() => {
2153
- const n = Ft();
2154
- return Pt(n, t, e), Object.assign({}, n.vars, n.style);
2051
+ function bo({ transformTemplate: e }, t) {
2052
+ return Oe(() => {
2053
+ const n = Dt();
2054
+ return Ft(n, t, e), Object.assign({}, n.vars, n.style);
2155
2055
  }, [t]);
2156
2056
  }
2157
- function xo(e, t) {
2057
+ function To(e, t) {
2158
2058
  const n = e.style || {}, s = {};
2159
- return ms(s, n, e), Object.assign(s, So(e, t)), s;
2059
+ return ps(s, n, e), Object.assign(s, bo(e, t)), s;
2160
2060
  }
2161
- function Ao(e, t) {
2162
- const n = {}, s = xo(e, t);
2061
+ function vo(e, t) {
2062
+ const n = {}, s = To(e, t);
2163
2063
  return e.drag && e.dragListener !== !1 && (n.draggable = !1, s.userSelect = s.WebkitUserSelect = s.WebkitTouchCallout = "none", s.touchAction = e.drag === !0 ? "none" : `pan-${e.drag === "x" ? "y" : "x"}`), e.tabIndex === void 0 && (e.onTap || e.onTapStart || e.whileTap) && (n.tabIndex = 0), n.style = s, n;
2164
2064
  }
2165
- const Mo = {
2065
+ const wo = {
2166
2066
  offset: "stroke-dashoffset",
2167
2067
  array: "stroke-dasharray"
2168
- }, Co = {
2068
+ }, Vo = {
2169
2069
  offset: "strokeDashoffset",
2170
2070
  array: "strokeDasharray"
2171
2071
  };
2172
- function Po(e, t, n = 1, s = 0, i = !0) {
2072
+ function So(e, t, n = 1, s = 0, i = !0) {
2173
2073
  e.pathLength = 1;
2174
- const r = i ? Mo : Co;
2074
+ const r = i ? wo : Vo;
2175
2075
  e[r.offset] = m.transform(-s);
2176
2076
  const o = m.transform(t), a = m.transform(n);
2177
2077
  e[r.array] = `${o} ${a}`;
2178
2078
  }
2179
- function gs(e, {
2079
+ function ms(e, {
2180
2080
  attrX: t,
2181
2081
  attrY: n,
2182
2082
  attrScale: s,
@@ -2186,33 +2086,33 @@ function gs(e, {
2186
2086
  // This is object creation, which we try to avoid per-frame.
2187
2087
  ...a
2188
2088
  }, c, l, u) {
2189
- if (Pt(e, a, l), c) {
2089
+ if (Ft(e, a, l), c) {
2190
2090
  e.style.viewBox && (e.attrs.viewBox = e.style.viewBox);
2191
2091
  return;
2192
2092
  }
2193
2093
  e.attrs = e.style, e.style = {};
2194
- const { attrs: d, style: f } = e;
2195
- d.transform && (f.transform = d.transform, delete d.transform), (f.transform || d.transformOrigin) && (f.transformOrigin = d.transformOrigin ?? "50% 50%", delete d.transformOrigin), f.transform && (f.transformBox = (u == null ? void 0 : u.transformBox) ?? "fill-box", delete d.transformBox), t !== void 0 && (d.x = t), n !== void 0 && (d.y = n), s !== void 0 && (d.scale = s), i !== void 0 && Po(d, i, r, o, !1);
2094
+ const { attrs: f, style: d } = e;
2095
+ f.transform && (d.transform = f.transform, delete f.transform), (d.transform || f.transformOrigin) && (d.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), d.transform && (d.transformBox = (u == null ? void 0 : u.transformBox) ?? "fill-box", delete f.transformBox), t !== void 0 && (f.x = t), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), i !== void 0 && So(f, i, r, o, !1);
2196
2096
  }
2197
- const ys = () => ({
2198
- ...Ft(),
2097
+ const gs = () => ({
2098
+ ...Dt(),
2199
2099
  attrs: {}
2200
- }), bs = (e) => typeof e == "string" && e.toLowerCase() === "svg";
2201
- function Fo(e, t, n, s) {
2202
- const i = De(() => {
2203
- const r = ys();
2204
- return gs(r, t, bs(s), e.transformTemplate, e.style), {
2100
+ }), ys = (e) => typeof e == "string" && e.toLowerCase() === "svg";
2101
+ function xo(e, t, n, s) {
2102
+ const i = Oe(() => {
2103
+ const r = gs();
2104
+ return ms(r, t, ys(s), e.transformTemplate, e.style), {
2205
2105
  ...r.attrs,
2206
2106
  style: { ...r.style }
2207
2107
  };
2208
2108
  }, [t]);
2209
2109
  if (e.style) {
2210
2110
  const r = {};
2211
- ms(r, e.style, e), i.style = { ...r, ...i.style };
2111
+ ps(r, e.style, e), i.style = { ...r, ...i.style };
2212
2112
  }
2213
2113
  return i;
2214
2114
  }
2215
- const Do = [
2115
+ const Ao = [
2216
2116
  "animate",
2217
2117
  "circle",
2218
2118
  "defs",
@@ -2239,7 +2139,7 @@ const Do = [
2239
2139
  "use",
2240
2140
  "view"
2241
2141
  ];
2242
- function Dt(e) {
2142
+ function Rt(e) {
2243
2143
  return (
2244
2144
  /**
2245
2145
  * If it's not a string, it's a custom React component. Currently we only support
@@ -2252,68 +2152,62 @@ function Dt(e) {
2252
2152
  /**
2253
2153
  * If it's in our list of lowercase SVG tags, it's an SVG component
2254
2154
  */
2255
- !!(Do.indexOf(e) > -1 || /**
2155
+ !!(Ao.indexOf(e) > -1 || /**
2256
2156
  * If it contains a capital letter, it's an SVG component
2257
2157
  */
2258
2158
  /[A-Z]/u.test(e))
2259
2159
  )
2260
2160
  );
2261
2161
  }
2262
- function Ro(e = !1) {
2263
- return (n, s, i, { latestValues: r }, o) => {
2264
- const c = (Dt(n) ? Fo : Ao)(s, r, o, n), l = ro(s, typeof n == "string", e), u = n !== mn ? { ...l, ...c, ref: i } : {}, { children: d } = s, f = De(() => D(d) ? d.get() : d, [d]);
2265
- return qs(n, {
2266
- ...u,
2267
- children: f
2268
- });
2269
- };
2162
+ function Mo(e, t, n, { latestValues: s }, i, r = !1) {
2163
+ const a = (Rt(e) ? xo : vo)(t, s, i, e), c = lo(t, typeof e == "string", r), l = e !== bn ? { ...c, ...a, ref: n } : {}, { children: u } = t, f = Oe(() => D(u) ? u.get() : u, [u]);
2164
+ return Zs(e, {
2165
+ ...l,
2166
+ children: f
2167
+ });
2270
2168
  }
2271
- function on(e) {
2169
+ function cn(e) {
2272
2170
  const t = [{}, {}];
2273
2171
  return e == null || e.values.forEach((n, s) => {
2274
2172
  t[0][s] = n.get(), t[1][s] = n.getVelocity();
2275
2173
  }), t;
2276
2174
  }
2277
- function Rt(e, t, n, s) {
2175
+ function Ot(e, t, n, s) {
2278
2176
  if (typeof t == "function") {
2279
- const [i, r] = on(s);
2177
+ const [i, r] = cn(s);
2280
2178
  t = t(n !== void 0 ? n : e.custom, i, r);
2281
2179
  }
2282
2180
  if (typeof t == "string" && (t = e.variants && e.variants[t]), typeof t == "function") {
2283
- const [i, r] = on(s);
2181
+ const [i, r] = cn(s);
2284
2182
  t = t(n !== void 0 ? n : e.custom, i, r);
2285
2183
  }
2286
2184
  return t;
2287
2185
  }
2288
- function Oo(e) {
2186
+ function Co(e) {
2289
2187
  return D(e) ? e.get() : e;
2290
2188
  }
2291
- function Io({ scrapeMotionValuesFromProps: e, createRenderState: t }, n, s, i) {
2189
+ function Po({ scrapeMotionValuesFromProps: e, createRenderState: t }, n, s, i) {
2292
2190
  return {
2293
- latestValues: Eo(n, s, i, e),
2191
+ latestValues: Fo(n, s, i, e),
2294
2192
  renderState: t()
2295
2193
  };
2296
2194
  }
2297
- const vs = (e) => (t, n) => {
2298
- const s = E(Ie), i = E(gn), r = () => Io(e, t, s, i);
2299
- return n ? r() : Js(r);
2300
- };
2301
- function Eo(e, t, n, s) {
2195
+ function Fo(e, t, n, s) {
2302
2196
  const i = {}, r = s(e, {});
2303
- for (const f in r)
2304
- i[f] = Oo(r[f]);
2197
+ for (const d in r)
2198
+ i[d] = Co(r[d]);
2305
2199
  let { initial: o, animate: a } = e;
2306
- const c = ke(e), l = ls(e);
2200
+ const c = Ne(e), l = ds(e);
2307
2201
  t && l && !c && e.inherit !== !1 && (o === void 0 && (o = t.initial), a === void 0 && (a = t.animate));
2308
2202
  let u = n ? n.initial === !1 : !1;
2309
2203
  u = u || o === !1;
2310
- const d = u ? a : o;
2311
- if (d && typeof d != "boolean" && !Ee(d)) {
2312
- const f = Array.isArray(d) ? d : [d];
2313
- for (let h = 0; h < f.length; h++) {
2314
- const y = Rt(e, f[h]);
2204
+ const f = u ? a : o;
2205
+ if (f && typeof f != "boolean" && !Le(f)) {
2206
+ const d = Array.isArray(f) ? f : [f];
2207
+ for (let h = 0; h < d.length; h++) {
2208
+ const y = Ot(e, d[h]);
2315
2209
  if (y) {
2316
- const { transitionEnd: b, transition: T, ...p } = y;
2210
+ const { transitionEnd: b, transition: v, ...p } = y;
2317
2211
  for (const V in p) {
2318
2212
  let g = p[V];
2319
2213
  if (Array.isArray(g)) {
@@ -2329,941 +2223,1059 @@ function Eo(e, t, n, s) {
2329
2223
  }
2330
2224
  return i;
2331
2225
  }
2332
- function Ot(e, t, n) {
2226
+ const bs = (e) => (t, n) => {
2227
+ const s = E(Ee), i = E(Tn), r = () => Po(e, t, s, i);
2228
+ return n ? r() : ni(r);
2229
+ };
2230
+ function It(e, t, n) {
2333
2231
  var r;
2334
2232
  const { style: s } = e, i = {};
2335
2233
  for (const o in s)
2336
- (D(s[o]) || t.style && D(t.style[o]) || ps(o, e) || ((r = n == null ? void 0 : n.getValue(o)) == null ? void 0 : r.liveStyle) !== void 0) && (i[o] = s[o]);
2234
+ (D(s[o]) || t.style && D(t.style[o]) || hs(o, e) || ((r = n == null ? void 0 : n.getValue(o)) == null ? void 0 : r.liveStyle) !== void 0) && (i[o] = s[o]);
2337
2235
  return i;
2338
2236
  }
2339
- const ko = {
2340
- useVisualState: vs({
2341
- scrapeMotionValuesFromProps: Ot,
2342
- createRenderState: Ft
2343
- })
2344
- };
2237
+ const Do = /* @__PURE__ */ bs({
2238
+ scrapeMotionValuesFromProps: It,
2239
+ createRenderState: Dt
2240
+ });
2345
2241
  function Ts(e, t, n) {
2346
- const s = Ot(e, t, n);
2242
+ const s = It(e, t, n);
2347
2243
  for (const i in e)
2348
2244
  if (D(e[i]) || D(t[i])) {
2349
- const r = ie.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
2245
+ const r = ae.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
2350
2246
  s[r] = e[i];
2351
2247
  }
2352
2248
  return s;
2353
2249
  }
2354
- const No = {
2355
- useVisualState: vs({
2356
- scrapeMotionValuesFromProps: Ts,
2357
- createRenderState: ys
2358
- })
2359
- };
2360
- function Lo(e, t) {
2361
- return function(s, { forwardMotionProps: i } = { forwardMotionProps: !1 }) {
2362
- const o = {
2363
- ...Dt(s) ? No : ko,
2364
- preloadedFeatures: e,
2365
- useRender: Ro(i),
2366
- createVisualElement: t,
2367
- Component: s
2368
- };
2369
- return mo(o);
2370
- };
2371
- }
2372
- const Bo = /* @__PURE__ */ Lo();
2373
- function he(e, t, n) {
2374
- const s = e.getProps();
2375
- return Rt(s, t, n !== void 0 ? n : s.custom, e);
2250
+ const Ro = /* @__PURE__ */ bs({
2251
+ scrapeMotionValuesFromProps: Ts,
2252
+ createRenderState: gs
2253
+ }), Oo = Symbol.for("motionComponentSymbol");
2254
+ function vs(e) {
2255
+ return e && typeof e == "object" && Object.prototype.hasOwnProperty.call(e, "current");
2376
2256
  }
2377
- const it = (e) => Array.isArray(e);
2378
- function Ko(e, t, n) {
2379
- e.hasValue(t) ? e.getValue(t).set(n) : e.addValue(t, Pe(n));
2257
+ function Io(e, t, n) {
2258
+ return Js(
2259
+ (s) => {
2260
+ s && e.onMount && e.onMount(s), t && (s ? t.mount(s) : t.unmount()), n && (typeof n == "function" ? n(s) : vs(n) && (n.current = s));
2261
+ },
2262
+ /**
2263
+ * Only pass a new ref callback to React if we've received a visual element
2264
+ * factory. Otherwise we'll be mounting/remounting every time externalRef
2265
+ * or other dependencies change.
2266
+ */
2267
+ [t]
2268
+ );
2380
2269
  }
2381
- function $o(e) {
2382
- return it(e) ? e[e.length - 1] || 0 : e;
2270
+ const kt = (e) => e.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), ko = "framerAppearId", ws = "data-" + kt(ko), Eo = se({});
2271
+ function Lo(e, t, n, s, i) {
2272
+ var b, v;
2273
+ const { visualElement: r } = E(Ee), o = E(Mt), a = E(Tn), c = E(ls).reducedMotion, l = fe(null);
2274
+ s = s || o.renderer, !l.current && s && (l.current = s(e, {
2275
+ visualState: t,
2276
+ parent: r,
2277
+ props: n,
2278
+ presenceContext: a,
2279
+ blockInitialAnimation: a ? a.initial === !1 : !1,
2280
+ reducedMotionConfig: c
2281
+ }));
2282
+ const u = l.current, f = E(Eo);
2283
+ u && !u.projection && i && (u.type === "html" || u.type === "svg") && No(l.current, n, i, f);
2284
+ const d = fe(!1);
2285
+ Qs(() => {
2286
+ u && d.current && u.update(n, a);
2287
+ });
2288
+ const h = n[ws], y = fe(!!h && !((b = window.MotionHandoffIsComplete) != null && b.call(window, h)) && ((v = window.MotionHasOptimisedAnimation) == null ? void 0 : v.call(window, h)));
2289
+ return si(() => {
2290
+ u && (d.current = !0, window.MotionIsMounted = !0, u.updateFeatures(), u.scheduleRenderMicrotask(), y.current && u.animationState && u.animationState.animateChanges());
2291
+ }), ft(() => {
2292
+ u && (!y.current && u.animationState && u.animationState.animateChanges(), y.current && (queueMicrotask(() => {
2293
+ var p;
2294
+ (p = window.MotionHandoffMarkAsComplete) == null || p.call(window, h);
2295
+ }), y.current = !1), u.enteringChildren = void 0);
2296
+ }), u;
2383
2297
  }
2384
- function Wo(e, t) {
2385
- const n = he(e, t);
2386
- let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
2387
- r = { ...r, ...s };
2388
- for (const o in r) {
2389
- const a = $o(r[o]);
2390
- Ko(e, o, a);
2391
- }
2298
+ function No(e, t, n, s) {
2299
+ const { layoutId: i, layout: r, drag: o, dragConstraints: a, layoutScroll: c, layoutRoot: l, layoutCrossfade: u } = t;
2300
+ e.projection = new n(e.latestValues, t["data-framer-portal-id"] ? void 0 : Vs(e.parent)), e.projection.setOptions({
2301
+ layoutId: i,
2302
+ layout: r,
2303
+ alwaysMeasureLayout: !!o || a && vs(a),
2304
+ visualElement: e,
2305
+ /**
2306
+ * TODO: Update options in an effect. This could be tricky as it'll be too late
2307
+ * to update by the time layout animations run.
2308
+ * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
2309
+ * ensuring it gets called if there's no potential layout animations.
2310
+ *
2311
+ */
2312
+ animationType: typeof r == "string" ? r : "both",
2313
+ initialPromotionConfig: s,
2314
+ crossfade: u,
2315
+ layoutScroll: c,
2316
+ layoutRoot: l
2317
+ });
2392
2318
  }
2393
- function jo(e) {
2394
- return !!(D(e) && e.add);
2319
+ function Vs(e) {
2320
+ if (e)
2321
+ return e.options.allowProjection !== !1 ? e.projection : Vs(e.parent);
2395
2322
  }
2396
- function _o(e, t) {
2397
- const n = e.getValue("willChange");
2398
- if (jo(n))
2399
- return n.add(t);
2400
- if (!n && K.WillChange) {
2401
- const s = new K.WillChange("auto");
2402
- e.addValue("willChange", s), s.add(t);
2323
+ function Bo(e, { forwardMotionProps: t = !1 } = {}, n, s) {
2324
+ const i = Rt(e) ? Ro : Do;
2325
+ function r(a, c) {
2326
+ let l;
2327
+ const u = {
2328
+ ...E(ls),
2329
+ ...a,
2330
+ layoutId: Ko(a)
2331
+ }, { isStatic: f } = u, d = ho(a), h = i(a, f);
2332
+ if (!f && dt) {
2333
+ $o(u, n);
2334
+ const y = Wo(u);
2335
+ l = y.MeasureLayout, d.visualElement = Lo(e, h, u, s, y.ProjectionNode);
2336
+ }
2337
+ return lt(Ee.Provider, { value: d, children: [l && d.visualElement ? F(l, { visualElement: d.visualElement, ...u }) : null, Mo(e, a, Io(h, d.visualElement, c), h, f, t)] });
2403
2338
  }
2339
+ r.displayName = `motion.${typeof e == "string" ? e : `create(${e.displayName ?? e.name ?? ""})`}`;
2340
+ const o = ei(r);
2341
+ return o[Oo] = e, o;
2404
2342
  }
2405
- function Go(e) {
2406
- return e.props[ds];
2407
- }
2408
- const zo = (e) => e !== null;
2409
- function Uo(e, { repeat: t, repeatType: n = "loop" }, s) {
2410
- const i = e.filter(zo), r = t && n !== "loop" && t % 2 === 1 ? 0 : i.length - 1;
2411
- return i[r];
2343
+ function Ko({ layoutId: e }) {
2344
+ const t = E(ti).id;
2345
+ return t && e !== void 0 ? t + "-" + e : e;
2412
2346
  }
2413
- const Ho = {
2414
- type: "spring",
2415
- stiffness: 500,
2416
- damping: 25,
2417
- restSpeed: 10
2418
- }, Yo = (e) => ({
2419
- type: "spring",
2420
- stiffness: 550,
2421
- damping: e === 0 ? 2 * Math.sqrt(550) : 30,
2422
- restSpeed: 10
2423
- }), Xo = {
2424
- type: "keyframes",
2425
- duration: 0.8
2426
- }, qo = {
2427
- type: "keyframes",
2428
- ease: [0.25, 0.1, 0.35, 1],
2429
- duration: 0.3
2430
- }, Zo = (e, { keyframes: t }) => t.length > 2 ? Xo : re.has(e) ? e.startsWith("scale") ? Yo(t[1]) : Ho : qo;
2431
- function Jo({ when: e, delay: t, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: c, elapsed: l, ...u }) {
2432
- return !!Object.keys(u).length;
2347
+ function $o(e, t) {
2348
+ E(Mt).strict, process.env.NODE_ENV;
2433
2349
  }
2434
- const Qo = (e, t, n, s = {}, i, r) => (o) => {
2435
- const a = Qn(s, e) || {}, c = a.delay || s.delay || 0;
2436
- let { elapsed: l = 0 } = s;
2437
- l = l - /* @__PURE__ */ N(c);
2438
- const u = {
2439
- keyframes: Array.isArray(n) ? n : [null, n],
2440
- ease: "easeOut",
2441
- velocity: t.getVelocity(),
2442
- ...a,
2443
- delay: -l,
2444
- onUpdate: (f) => {
2445
- t.set(f), a.onUpdate && a.onUpdate(f);
2446
- },
2447
- onComplete: () => {
2448
- o(), a.onComplete && a.onComplete();
2449
- },
2450
- name: e,
2451
- motionValue: t,
2452
- element: r ? void 0 : i
2350
+ function Wo(e) {
2351
+ const { drag: t, layout: n } = ne;
2352
+ if (!t && !n)
2353
+ return {};
2354
+ const s = { ...t, ...n };
2355
+ return {
2356
+ MeasureLayout: t != null && t.isEnabled(e) || n != null && n.isEnabled(e) ? s.MeasureLayout : void 0,
2357
+ ProjectionNode: s.ProjectionNode
2453
2358
  };
2454
- Jo(a) || Object.assign(u, Zo(e, u)), u.duration && (u.duration = /* @__PURE__ */ N(u.duration)), u.repeatDelay && (u.repeatDelay = /* @__PURE__ */ N(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
2455
- let d = !1;
2456
- if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (u.duration = 0, u.delay === 0 && (d = !0)), (K.instantAnimations || K.skipAnimations) && (d = !0, u.duration = 0, u.delay = 0), u.allowFlatten = !a.type && !a.ease, d && !r && t.get() !== void 0) {
2457
- const f = Uo(u.keyframes, a);
2458
- if (f !== void 0) {
2459
- k.update(() => {
2460
- u.onUpdate(f), u.onComplete();
2461
- });
2462
- return;
2463
- }
2464
- }
2465
- return a.isSync ? new wt(u) : new Pr(u);
2466
- };
2467
- function ea({ protectedKeys: e, needsAnimating: t }, n) {
2468
- const s = e.hasOwnProperty(n) && t[n] !== !0;
2469
- return t[n] = !1, s;
2470
2359
  }
2471
- function ws(e, t, { delay: n = 0, transitionOverride: s, type: i } = {}) {
2472
- let { transition: r = e.getDefaultTransition(), transitionEnd: o, ...a } = t;
2473
- s && (r = s);
2474
- const c = [], l = i && e.animationState && e.animationState.getState()[i];
2475
- for (const u in a) {
2476
- const d = e.getValue(u, e.latestValues[u] ?? null), f = a[u];
2477
- if (f === void 0 || l && ea(l, u))
2478
- continue;
2479
- const h = {
2480
- delay: n,
2481
- ...Qn(r || {}, u)
2482
- }, y = d.get();
2483
- if (y !== void 0 && !d.isAnimating && !Array.isArray(f) && f === y && !h.velocity)
2484
- continue;
2485
- let b = !1;
2486
- if (window.MotionHandoffAnimation) {
2487
- const p = Go(e);
2488
- if (p) {
2489
- const V = window.MotionHandoffAnimation(p, u, k);
2490
- V !== null && (h.startTime = V, b = !0);
2491
- }
2492
- }
2493
- _o(e, u), d.start(Qo(u, d, f, e.shouldReduceMotion && es.has(u) ? { type: !1 } : h, e, b));
2494
- const T = d.animation;
2495
- T && c.push(T);
2496
- }
2497
- return o && Promise.all(c).then(() => {
2498
- k.update(() => {
2499
- o && Wo(e, o);
2500
- });
2501
- }), c;
2360
+ function jo({ top: e, left: t, right: n, bottom: s }) {
2361
+ return {
2362
+ x: { min: t, max: n },
2363
+ y: { min: e, max: s }
2364
+ };
2502
2365
  }
2503
- function rt(e, t, n = {}) {
2504
- var c;
2505
- const s = he(e, t, n.type === "exit" ? (c = e.presenceContext) == null ? void 0 : c.custom : void 0);
2506
- let { transition: i = e.getDefaultTransition() || {} } = s || {};
2507
- n.transitionOverride && (i = n.transitionOverride);
2508
- const r = s ? () => Promise.all(ws(e, s, n)) : () => Promise.resolve(), o = e.variantChildren && e.variantChildren.size ? (l = 0) => {
2509
- const { delayChildren: u = 0, staggerChildren: d, staggerDirection: f } = i;
2510
- return ta(e, t, l, u, d, f, n);
2511
- } : () => Promise.resolve(), { when: a } = i;
2512
- if (a) {
2513
- const [l, u] = a === "beforeChildren" ? [r, o] : [o, r];
2514
- return l().then(() => u());
2515
- } else
2516
- return Promise.all([r(), o(n.delay)]);
2366
+ function _o(e, t) {
2367
+ if (!t)
2368
+ return e;
2369
+ const n = t({ x: e.left, y: e.top }), s = t({ x: e.right, y: e.bottom });
2370
+ return {
2371
+ top: n.y,
2372
+ left: n.x,
2373
+ bottom: s.y,
2374
+ right: s.x
2375
+ };
2517
2376
  }
2518
- function ta(e, t, n = 0, s = 0, i = 0, r = 1, o) {
2519
- const a = [], c = e.variantChildren.size, l = (c - 1) * i, u = typeof s == "function", d = u ? (f) => s(f, c) : (
2520
- // Support deprecated staggerChildren
2521
- r === 1 ? (f = 0) => f * i : (f = 0) => l - f * i
2522
- );
2523
- return Array.from(e.variantChildren).sort(na).forEach((f, h) => {
2524
- f.notify("AnimationStart", t), a.push(rt(f, t, {
2525
- ...o,
2526
- delay: n + (u ? 0 : s) + d(h)
2527
- }).then(() => f.notify("AnimationComplete", t)));
2528
- }), Promise.all(a);
2377
+ function Go(e, t) {
2378
+ return jo(_o(e.getBoundingClientRect(), t));
2529
2379
  }
2530
- function na(e, t) {
2531
- return e.sortNodePosition(t);
2380
+ const ln = () => ({ min: 0, max: 0 }), Ss = () => ({
2381
+ x: ln(),
2382
+ y: ln()
2383
+ }), ot = { current: null }, xs = { current: !1 };
2384
+ function zo() {
2385
+ if (xs.current = !0, !!dt)
2386
+ if (window.matchMedia) {
2387
+ const e = window.matchMedia("(prefers-reduced-motion)"), t = () => ot.current = e.matches;
2388
+ e.addEventListener("change", t), t();
2389
+ } else
2390
+ ot.current = !1;
2532
2391
  }
2533
- function sa(e, t, n = {}) {
2534
- e.notify("AnimationStart", t);
2535
- let s;
2536
- if (Array.isArray(t)) {
2537
- const i = t.map((r) => rt(e, r, n));
2538
- s = Promise.all(i);
2539
- } else if (typeof t == "string")
2540
- s = rt(e, t, n);
2541
- else {
2542
- const i = typeof t == "function" ? he(e, t, n.custom) : t;
2543
- s = Promise.all(ws(e, i, n));
2392
+ const Ho = /* @__PURE__ */ new WeakMap();
2393
+ function Uo(e, t, n) {
2394
+ for (const s in t) {
2395
+ const i = t[s], r = n[s];
2396
+ if (D(i))
2397
+ e.addValue(s, i);
2398
+ else if (D(r))
2399
+ e.addValue(s, De(i, { owner: e }));
2400
+ else if (r !== i)
2401
+ if (e.hasValue(s)) {
2402
+ const o = e.getValue(s);
2403
+ o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
2404
+ } else {
2405
+ const o = e.getStaticValue(s);
2406
+ e.addValue(s, De(o !== void 0 ? o : i, { owner: e }));
2407
+ }
2544
2408
  }
2545
- return s.then(() => {
2546
- e.notify("AnimationComplete", t);
2547
- });
2548
- }
2549
- function Vs(e, t) {
2550
- if (!Array.isArray(t))
2551
- return !1;
2552
- const n = t.length;
2553
- if (n !== e.length)
2554
- return !1;
2555
- for (let s = 0; s < n; s++)
2556
- if (t[s] !== e[s])
2557
- return !1;
2558
- return !0;
2409
+ for (const s in n)
2410
+ t[s] === void 0 && e.removeValue(s);
2411
+ return t;
2559
2412
  }
2560
- const ia = Mt.length;
2561
- function Ss(e) {
2562
- if (!e)
2563
- return;
2564
- if (!e.isControllingVariants) {
2565
- const n = e.parent ? Ss(e.parent) || {} : {};
2566
- return e.props.initial !== void 0 && (n.initial = e.props.initial), n;
2413
+ const fn = [
2414
+ "AnimationStart",
2415
+ "AnimationComplete",
2416
+ "Update",
2417
+ "BeforeLayoutMeasure",
2418
+ "LayoutMeasure",
2419
+ "LayoutAnimationStart",
2420
+ "LayoutAnimationComplete"
2421
+ ];
2422
+ class Yo {
2423
+ /**
2424
+ * This method takes React props and returns found MotionValues. For example, HTML
2425
+ * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
2426
+ *
2427
+ * This isn't an abstract method as it needs calling in the constructor, but it is
2428
+ * intended to be one.
2429
+ */
2430
+ scrapeMotionValuesFromProps(t, n, s) {
2431
+ return {};
2567
2432
  }
2568
- const t = {};
2569
- for (let n = 0; n < ia; n++) {
2570
- const s = Mt[n], i = e.props[s];
2571
- (de(i) || i === !1) && (t[s] = i);
2433
+ constructor({ parent: t, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: o }, a = {}) {
2434
+ this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = xt, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
2435
+ this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
2436
+ }, this.renderScheduledAt = 0, this.scheduleRender = () => {
2437
+ const d = k.now();
2438
+ this.renderScheduledAt < d && (this.renderScheduledAt = d, L.render(this.render, !1, !0));
2439
+ };
2440
+ const { latestValues: c, renderState: l } = o;
2441
+ this.latestValues = c, this.baseTarget = { ...c }, this.initialValues = n.initial ? { ...c } : {}, this.renderState = l, this.parent = t, this.props = n, this.presenceContext = s, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!r, this.isControllingVariants = Ne(n), this.isVariantNode = ds(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(t && t.current);
2442
+ const { willChange: u, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
2443
+ for (const d in f) {
2444
+ const h = f[d];
2445
+ c[d] !== void 0 && D(h) && h.set(c[d]);
2446
+ }
2572
2447
  }
2573
- return t;
2574
- }
2575
- const ra = [...At].reverse(), oa = At.length;
2576
- function aa(e) {
2577
- return (t) => Promise.all(t.map(({ animation: n, options: s }) => sa(e, n, s)));
2578
- }
2579
- function ua(e) {
2580
- let t = aa(e), n = an(), s = !0;
2581
- const i = (c) => (l, u) => {
2582
- var f;
2583
- const d = he(e, u, c === "exit" ? (f = e.presenceContext) == null ? void 0 : f.custom : void 0);
2584
- if (d) {
2585
- const { transition: h, transitionEnd: y, ...b } = d;
2586
- l = { ...l, ...b, ...y };
2448
+ mount(t) {
2449
+ var n;
2450
+ this.current = t, Ho.set(t, this), this.projection && !this.projection.instance && this.projection.mount(t), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((s, i) => this.bindToMotionValue(i, s)), xs.current || zo(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : ot.current, process.env.NODE_ENV !== "production" && An(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), (n = this.parent) == null || n.addChild(this), this.update(this.props, this.presenceContext);
2451
+ }
2452
+ unmount() {
2453
+ var t;
2454
+ this.projection && this.projection.unmount(), He(this.notifyUpdate), He(this.render), this.valueSubscriptions.forEach((n) => n()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), (t = this.parent) == null || t.removeChild(this);
2455
+ for (const n in this.events)
2456
+ this.events[n].clear();
2457
+ for (const n in this.features) {
2458
+ const s = this.features[n];
2459
+ s && (s.unmount(), s.isMounted = !1);
2587
2460
  }
2588
- return l;
2589
- };
2590
- function r(c) {
2591
- t = c(e);
2461
+ this.current = null;
2592
2462
  }
2593
- function o(c) {
2594
- const { props: l } = e, u = Ss(e.parent) || {}, d = [], f = /* @__PURE__ */ new Set();
2595
- let h = {}, y = 1 / 0;
2596
- for (let T = 0; T < oa; T++) {
2597
- const p = ra[T], V = n[p], g = l[p] !== void 0 ? l[p] : u[p], x = de(g), v = p === c ? V.isActive : null;
2598
- v === !1 && (y = T);
2599
- let S = g === u[p] && g !== l[p] && x;
2600
- if (S && s && e.manuallyAnimateOnMount && (S = !1), V.protectedKeys = { ...h }, // If it isn't active and hasn't *just* been set as inactive
2601
- !V.isActive && v === null || // If we didn't and don't have any defined prop for this animation type
2602
- !g && !V.prevProp || // Or if the prop doesn't define an animation
2603
- Ee(g) || typeof g == "boolean")
2463
+ addChild(t) {
2464
+ this.children.add(t), this.enteringChildren ?? (this.enteringChildren = /* @__PURE__ */ new Set()), this.enteringChildren.add(t);
2465
+ }
2466
+ removeChild(t) {
2467
+ this.children.delete(t), this.enteringChildren && this.enteringChildren.delete(t);
2468
+ }
2469
+ bindToMotionValue(t, n) {
2470
+ this.valueSubscriptions.has(t) && this.valueSubscriptions.get(t)();
2471
+ const s = ue.has(t);
2472
+ s && this.onBindTransform && this.onBindTransform();
2473
+ const i = n.on("change", (o) => {
2474
+ this.latestValues[t] = o, this.props.onUpdate && L.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
2475
+ });
2476
+ let r;
2477
+ window.MotionCheckAppearSync && (r = window.MotionCheckAppearSync(this, t, n)), this.valueSubscriptions.set(t, () => {
2478
+ i(), r && r(), n.owner && n.stop();
2479
+ });
2480
+ }
2481
+ sortNodePosition(t) {
2482
+ return !this.current || !this.sortInstanceNodePosition || this.type !== t.type ? 0 : this.sortInstanceNodePosition(this.current, t.current);
2483
+ }
2484
+ updateFeatures() {
2485
+ let t = "animation";
2486
+ for (t in ne) {
2487
+ const n = ne[t];
2488
+ if (!n)
2604
2489
  continue;
2605
- const C = ca(V.prevProp, g);
2606
- let w = C || // If we're making this variant active, we want to always make it active
2607
- p === c && V.isActive && !S && x || // If we removed a higher-priority variant (i is in reverse order)
2608
- T > y && x, R = !1;
2609
- const O = Array.isArray(g) ? g : [g];
2610
- let X = O.reduce(i(p), {});
2611
- v === !1 && (X = {});
2612
- const { prevResolvedValues: It = {} } = V, Ls = {
2613
- ...It,
2614
- ...X
2615
- }, Et = (P) => {
2616
- w = !0, f.has(P) && (R = !0, f.delete(P)), V.needsAnimating[P] = !0;
2617
- const L = e.getValue(P);
2618
- L && (L.liveStyle = !1);
2619
- };
2620
- for (const P in Ls) {
2621
- const L = X[P], Ne = It[P];
2622
- if (h.hasOwnProperty(P))
2623
- continue;
2624
- let Le = !1;
2625
- it(L) && it(Ne) ? Le = !Vs(L, Ne) : Le = L !== Ne, Le ? L != null ? Et(P) : f.add(P) : L !== void 0 && f.has(P) ? Et(P) : V.protectedKeys[P] = !0;
2626
- }
2627
- V.prevProp = g, V.prevResolvedValues = X, V.isActive && (h = { ...h, ...X }), s && e.blockInitialAnimation && (w = !1), w && (!(S && C) || R) && d.push(...O.map((P) => ({
2628
- animation: P,
2629
- options: { type: p }
2630
- })));
2631
- }
2632
- if (f.size) {
2633
- const T = {};
2634
- if (typeof l.initial != "boolean") {
2635
- const p = he(e, Array.isArray(l.initial) ? l.initial[0] : l.initial);
2636
- p && p.transition && (T.transition = p.transition);
2490
+ const { isEnabled: s, Feature: i } = n;
2491
+ if (!this.features[t] && i && s(this.props) && (this.features[t] = new i(this)), this.features[t]) {
2492
+ const r = this.features[t];
2493
+ r.isMounted ? r.update() : (r.mount(), r.isMounted = !0);
2637
2494
  }
2638
- f.forEach((p) => {
2639
- const V = e.getBaseTarget(p), g = e.getValue(p);
2640
- g && (g.liveStyle = !0), T[p] = V ?? null;
2641
- }), d.push({ animation: T });
2642
2495
  }
2643
- let b = !!d.length;
2644
- return s && (l.initial === !1 || l.initial === l.animate) && !e.manuallyAnimateOnMount && (b = !1), s = !1, b ? t(d) : Promise.resolve();
2645
2496
  }
2646
- function a(c, l) {
2647
- var d;
2648
- if (n[c].isActive === l)
2649
- return Promise.resolve();
2650
- (d = e.variantChildren) == null || d.forEach((f) => {
2651
- var h;
2652
- return (h = f.animationState) == null ? void 0 : h.setActive(c, l);
2653
- }), n[c].isActive = l;
2654
- const u = o(c);
2655
- for (const f in n)
2656
- n[f].protectedKeys = {};
2657
- return u;
2497
+ triggerBuild() {
2498
+ this.build(this.renderState, this.latestValues, this.props);
2658
2499
  }
2659
- return {
2660
- animateChanges: o,
2661
- setActive: a,
2662
- setAnimateFunction: r,
2663
- getState: () => n,
2664
- reset: () => {
2665
- n = an(), s = !0;
2666
- }
2667
- };
2668
- }
2669
- function ca(e, t) {
2670
- return typeof t == "string" ? t !== e : Array.isArray(t) ? !Vs(t, e) : !1;
2671
- }
2672
- function W(e = !1) {
2673
- return {
2674
- isActive: e,
2675
- protectedKeys: {},
2676
- needsAnimating: {},
2677
- prevResolvedValues: {}
2678
- };
2679
- }
2680
- function an() {
2681
- return {
2682
- animate: W(!0),
2683
- whileInView: W(),
2684
- whileHover: W(),
2685
- whileTap: W(),
2686
- whileDrag: W(),
2687
- whileFocus: W(),
2688
- exit: W()
2689
- };
2690
- }
2691
- class oe {
2692
- constructor(t) {
2693
- this.isMounted = !1, this.node = t;
2500
+ /**
2501
+ * Measure the current viewport box with or without transforms.
2502
+ * Only measures axis-aligned boxes, rotate and skew must be manually
2503
+ * removed with a re-render to work.
2504
+ */
2505
+ measureViewportBox() {
2506
+ return this.current ? this.measureInstanceViewportBox(this.current, this.props) : Ss();
2694
2507
  }
2695
- update() {
2508
+ getStaticValue(t) {
2509
+ return this.latestValues[t];
2510
+ }
2511
+ setStaticValue(t, n) {
2512
+ this.latestValues[t] = n;
2696
2513
  }
2697
- }
2698
- class la extends oe {
2699
2514
  /**
2700
- * We dynamically generate the AnimationState manager as it contains a reference
2701
- * to the underlying animation library. We only want to load that if we load this,
2702
- * so people can optionally code split it out using the `m` component.
2515
+ * Update the provided props. Ensure any newly-added motion values are
2516
+ * added to our map, old ones removed, and listeners updated.
2703
2517
  */
2704
- constructor(t) {
2705
- super(t), t.animationState || (t.animationState = ua(t));
2518
+ update(t, n) {
2519
+ (t.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = t, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
2520
+ for (let s = 0; s < fn.length; s++) {
2521
+ const i = fn[s];
2522
+ this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
2523
+ const r = "on" + i, o = t[r];
2524
+ o && (this.propEventSubscriptions[i] = this.on(i, o));
2525
+ }
2526
+ this.prevMotionValues = Uo(this, this.scrapeMotionValuesFromProps(t, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
2706
2527
  }
2707
- updateAnimationControlsSubscription() {
2708
- const { animate: t } = this.node.getProps();
2709
- Ee(t) && (this.unmountControls = t.subscribe(this.node));
2528
+ getProps() {
2529
+ return this.props;
2710
2530
  }
2711
2531
  /**
2712
- * Subscribe any provided AnimationControls to the component's VisualElement
2532
+ * Returns the variant definition with a given name.
2713
2533
  */
2714
- mount() {
2715
- this.updateAnimationControlsSubscription();
2534
+ getVariant(t) {
2535
+ return this.props.variants ? this.props.variants[t] : void 0;
2716
2536
  }
2717
- update() {
2718
- const { animate: t } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
2719
- t !== n && this.updateAnimationControlsSubscription();
2537
+ /**
2538
+ * Returns the defined default transition on this component.
2539
+ */
2540
+ getDefaultTransition() {
2541
+ return this.props.transition;
2720
2542
  }
2721
- unmount() {
2722
- var t;
2723
- this.node.animationState.reset(), (t = this.unmountControls) == null || t.call(this);
2543
+ getTransformPagePoint() {
2544
+ return this.props.transformPagePoint;
2724
2545
  }
2725
- }
2726
- let fa = 0;
2727
- class da extends oe {
2728
- constructor() {
2729
- super(...arguments), this.id = fa++;
2546
+ getClosestVariantNode() {
2547
+ return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
2730
2548
  }
2731
- update() {
2732
- if (!this.node.presenceContext)
2733
- return;
2734
- const { isPresent: t, onExitComplete: n } = this.node.presenceContext, { isPresent: s } = this.node.prevPresenceContext || {};
2735
- if (!this.node.animationState || t === s)
2736
- return;
2737
- const i = this.node.animationState.setActive("exit", !t);
2738
- n && !t && i.then(() => {
2739
- n(this.id);
2740
- });
2549
+ /**
2550
+ * Add a child visual element to our set of children.
2551
+ */
2552
+ addVariantChild(t) {
2553
+ const n = this.getClosestVariantNode();
2554
+ if (n)
2555
+ return n.variantChildren && n.variantChildren.add(t), () => n.variantChildren.delete(t);
2741
2556
  }
2742
- mount() {
2743
- const { register: t, onExitComplete: n } = this.node.presenceContext || {};
2744
- n && n(this.id), t && (this.unmount = t(this.id));
2557
+ /**
2558
+ * Add a motion value and bind it to this visual element.
2559
+ */
2560
+ addValue(t, n) {
2561
+ const s = this.values.get(t);
2562
+ n !== s && (s && this.removeValue(t), this.bindToMotionValue(t, n), this.values.set(t, n), this.latestValues[t] = n.get());
2745
2563
  }
2746
- unmount() {
2564
+ /**
2565
+ * Remove a motion value and unbind any active subscriptions.
2566
+ */
2567
+ removeValue(t) {
2568
+ this.values.delete(t);
2569
+ const n = this.valueSubscriptions.get(t);
2570
+ n && (n(), this.valueSubscriptions.delete(t)), delete this.latestValues[t], this.removeValueFromRenderState(t, this.renderState);
2747
2571
  }
2748
- }
2749
- const ha = {
2750
- animation: {
2751
- Feature: la
2752
- },
2753
- exit: {
2754
- Feature: da
2572
+ /**
2573
+ * Check whether we have a motion value for this key
2574
+ */
2575
+ hasValue(t) {
2576
+ return this.values.has(t);
2755
2577
  }
2756
- };
2757
- function un(e, t, n, s = { passive: !0 }) {
2758
- return e.addEventListener(t, n, s), () => e.removeEventListener(t, n);
2759
- }
2760
- function xs(e) {
2761
- return {
2762
- point: {
2763
- x: e.pageX,
2764
- y: e.pageY
2765
- }
2766
- };
2767
- }
2768
- function pa({ top: e, left: t, right: n, bottom: s }) {
2769
- return {
2770
- x: { min: t, max: n },
2771
- y: { min: e, max: s }
2772
- };
2773
- }
2774
- function ma(e, t) {
2775
- if (!t)
2776
- return e;
2777
- const n = t({ x: e.left, y: e.top }), s = t({ x: e.right, y: e.bottom });
2778
- return {
2779
- top: n.y,
2780
- left: n.x,
2781
- bottom: s.y,
2782
- right: s.x
2783
- };
2784
- }
2785
- const cn = () => ({ min: 0, max: 0 }), As = () => ({
2786
- x: cn(),
2787
- y: cn()
2788
- });
2789
- function ga(e, t) {
2790
- return pa(ma(e.getBoundingClientRect(), t));
2791
- }
2792
- function ln(e, t, n) {
2793
- const { props: s } = e;
2794
- e.animationState && s.whileHover && e.animationState.setActive("whileHover", n === "Start");
2795
- const i = "onHover" + n, r = s[i];
2796
- r && k.postRender(() => r(t, xs(t)));
2797
- }
2798
- class ya extends oe {
2799
- mount() {
2800
- const { current: t } = this.node;
2801
- t && (this.unmount = Yr(t, (n, s) => (ln(this.node, s, "Start"), (i) => ln(this.node, i, "End"))));
2578
+ getValue(t, n) {
2579
+ if (this.props.values && this.props.values[t])
2580
+ return this.props.values[t];
2581
+ let s = this.values.get(t);
2582
+ return s === void 0 && n !== void 0 && (s = De(n === null ? void 0 : n, { owner: this }), this.addValue(t, s)), s;
2802
2583
  }
2803
- unmount() {
2584
+ /**
2585
+ * If we're trying to animate to a previously unencountered value,
2586
+ * we need to check for it in our state and as a last resort read it
2587
+ * directly from the instance (which might have performance implications).
2588
+ */
2589
+ readValue(t, n) {
2590
+ let s = this.latestValues[t] !== void 0 || !this.current ? this.latestValues[t] : this.getBaseTargetFromProps(this.props, t) ?? this.readValueFromInstance(this.current, t, this.options);
2591
+ return s != null && (typeof s == "string" && (vn(s) || wn(s)) ? s = parseFloat(s) : !oo(s) && oe.test(n) && (s = os(t, n)), this.setBaseTarget(t, D(s) ? s.get() : s)), D(s) ? s.get() : s;
2804
2592
  }
2805
- }
2806
- class ba extends oe {
2807
- constructor() {
2808
- super(...arguments), this.isActive = !1;
2593
+ /**
2594
+ * Set the base target to later animate back to. This is currently
2595
+ * only hydrated on creation and when we first read a value.
2596
+ */
2597
+ setBaseTarget(t, n) {
2598
+ this.baseTarget[t] = n;
2809
2599
  }
2810
- onFocus() {
2811
- let t = !1;
2812
- try {
2813
- t = this.node.current.matches(":focus-visible");
2814
- } catch {
2815
- t = !0;
2600
+ /**
2601
+ * Find the base target for a value thats been removed from all animation
2602
+ * props.
2603
+ */
2604
+ getBaseTarget(t) {
2605
+ var r;
2606
+ const { initial: n } = this.props;
2607
+ let s;
2608
+ if (typeof n == "string" || typeof n == "object") {
2609
+ const o = Ot(this.props, n, (r = this.presenceContext) == null ? void 0 : r.custom);
2610
+ o && (s = o[t]);
2816
2611
  }
2817
- !t || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
2612
+ if (n && s !== void 0)
2613
+ return s;
2614
+ const i = this.getBaseTargetFromProps(this.props, t);
2615
+ return i !== void 0 && !D(i) ? i : this.initialValues[t] !== void 0 && s === void 0 ? void 0 : this.baseTarget[t];
2818
2616
  }
2819
- onBlur() {
2820
- !this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
2617
+ on(t, n) {
2618
+ return this.events[t] || (this.events[t] = new Sn()), this.events[t].add(n);
2821
2619
  }
2822
- mount() {
2823
- this.unmount = Re(un(this.node.current, "focus", () => this.onFocus()), un(this.node.current, "blur", () => this.onBlur()));
2620
+ notify(t, ...n) {
2621
+ this.events[t] && this.events[t].notify(...n);
2824
2622
  }
2825
- unmount() {
2623
+ scheduleRenderMicrotask() {
2624
+ qr.render(this.render);
2826
2625
  }
2827
2626
  }
2828
- function fn(e, t, n) {
2829
- const { props: s } = e;
2830
- if (e.current instanceof HTMLButtonElement && e.current.disabled)
2831
- return;
2832
- e.animationState && s.whileTap && e.animationState.setActive("whileTap", n === "Start");
2833
- const i = "onTap" + (n === "End" ? "" : n), r = s[i];
2834
- r && k.postRender(() => r(t, xs(t)));
2835
- }
2836
- class va extends oe {
2837
- mount() {
2838
- const { current: t } = this.node;
2839
- t && (this.unmount = Qr(t, (n, s) => (fn(this.node, s, "Start"), (i, { success: r }) => fn(this.node, i, r ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
2627
+ class As extends Yo {
2628
+ constructor() {
2629
+ super(...arguments), this.KeyframeResolver = zr;
2840
2630
  }
2841
- unmount() {
2631
+ sortInstanceNodePosition(t, n) {
2632
+ return t.compareDocumentPosition(n) & 2 ? 1 : -1;
2633
+ }
2634
+ getBaseTargetFromProps(t, n) {
2635
+ return t.style ? t.style[n] : void 0;
2636
+ }
2637
+ removeValueFromRenderState(t, { vars: n, style: s }) {
2638
+ delete n[t], delete s[t];
2639
+ }
2640
+ handleChildMotionValue() {
2641
+ this.childSubscription && (this.childSubscription(), delete this.childSubscription);
2642
+ const { children: t } = this.props;
2643
+ D(t) && (this.childSubscription = t.on("change", (n) => {
2644
+ this.current && (this.current.textContent = `${n}`);
2645
+ }));
2842
2646
  }
2843
2647
  }
2844
- const ot = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), Ta = (e) => {
2845
- const t = ot.get(e.target);
2846
- t && t(e);
2847
- }, wa = (e) => {
2848
- e.forEach(Ta);
2849
- };
2850
- function Va({ root: e, ...t }) {
2851
- const n = e || document;
2852
- Ge.has(n) || Ge.set(n, {});
2853
- const s = Ge.get(n), i = JSON.stringify(t);
2854
- return s[i] || (s[i] = new IntersectionObserver(wa, { root: e, ...t })), s[i];
2648
+ function Ms(e, { style: t, vars: n }, s, i) {
2649
+ const r = e.style;
2650
+ let o;
2651
+ for (o in t)
2652
+ r[o] = t[o];
2653
+ i == null || i.applyProjectionStyles(r, s);
2654
+ for (o in n)
2655
+ r.setProperty(o, n[o]);
2855
2656
  }
2856
- function Sa(e, t, n) {
2857
- const s = Va(t);
2858
- return ot.set(e, n), s.observe(e), () => {
2859
- ot.delete(e), s.unobserve(e);
2860
- };
2657
+ function Xo(e) {
2658
+ return window.getComputedStyle(e);
2861
2659
  }
2862
- const xa = {
2863
- some: 0,
2864
- all: 1
2865
- };
2866
- class Aa extends oe {
2660
+ class qo extends As {
2867
2661
  constructor() {
2868
- super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
2662
+ super(...arguments), this.type = "html", this.renderInstance = Ms;
2869
2663
  }
2870
- startObserver() {
2871
- this.unmount();
2872
- const { viewport: t = {} } = this.node.getProps(), { root: n, margin: s, amount: i = "some", once: r } = t, o = {
2873
- root: n ? n.current : void 0,
2874
- rootMargin: s,
2875
- threshold: typeof i == "number" ? i : xa[i]
2876
- }, a = (c) => {
2877
- const { isIntersecting: l } = c;
2878
- if (this.isInView === l || (this.isInView = l, r && !l && this.hasEnteredView))
2879
- return;
2880
- l && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", l);
2881
- const { onViewportEnter: u, onViewportLeave: d } = this.node.getProps(), f = l ? u : d;
2882
- f && f(c);
2883
- };
2884
- return Sa(this.node.current, o, a);
2664
+ readValueFromInstance(t, n) {
2665
+ var s;
2666
+ if (ue.has(n))
2667
+ return (s = this.projection) != null && s.isProjecting ? Qe(n) : cr(t, n);
2668
+ {
2669
+ const i = Xo(t), r = (Nn(n) ? i.getPropertyValue(n) : i[n]) || 0;
2670
+ return typeof r == "string" ? r.trim() : r;
2671
+ }
2885
2672
  }
2886
- mount() {
2887
- this.startObserver();
2673
+ measureInstanceViewportBox(t, { transformPagePoint: n }) {
2674
+ return Go(t, n);
2888
2675
  }
2889
- update() {
2890
- if (typeof IntersectionObserver > "u")
2891
- return;
2892
- const { props: t, prevProps: n } = this.node;
2893
- ["amount", "margin", "root"].some(Ma(t, n)) && this.startObserver();
2676
+ build(t, n, s) {
2677
+ Ft(t, n, s.transformTemplate);
2894
2678
  }
2895
- unmount() {
2679
+ scrapeMotionValuesFromProps(t, n, s) {
2680
+ return It(t, n, s);
2896
2681
  }
2897
2682
  }
2898
- function Ma({ viewport: e = {} }, { viewport: t = {} } = {}) {
2899
- return (n) => e[n] !== t[n];
2683
+ const Cs = /* @__PURE__ */ new Set([
2684
+ "baseFrequency",
2685
+ "diffuseConstant",
2686
+ "kernelMatrix",
2687
+ "kernelUnitLength",
2688
+ "keySplines",
2689
+ "keyTimes",
2690
+ "limitingConeAngle",
2691
+ "markerHeight",
2692
+ "markerWidth",
2693
+ "numOctaves",
2694
+ "targetX",
2695
+ "targetY",
2696
+ "surfaceScale",
2697
+ "specularConstant",
2698
+ "specularExponent",
2699
+ "stdDeviation",
2700
+ "tableValues",
2701
+ "viewBox",
2702
+ "gradientTransform",
2703
+ "pathLength",
2704
+ "startOffset",
2705
+ "textLength",
2706
+ "lengthAdjust"
2707
+ ]);
2708
+ function Zo(e, t, n, s) {
2709
+ Ms(e, t, void 0, s);
2710
+ for (const i in t.attrs)
2711
+ e.setAttribute(Cs.has(i) ? i : kt(i), t.attrs[i]);
2900
2712
  }
2901
- const Ca = {
2902
- inView: {
2903
- Feature: Aa
2904
- },
2905
- tap: {
2906
- Feature: va
2907
- },
2908
- focus: {
2909
- Feature: ba
2910
- },
2911
- hover: {
2912
- Feature: ya
2713
+ class Jo extends As {
2714
+ constructor() {
2715
+ super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = Ss;
2913
2716
  }
2914
- }, at = { current: null }, Ms = { current: !1 };
2915
- function Pa() {
2916
- if (Ms.current = !0, !!lt)
2917
- if (window.matchMedia) {
2918
- const e = window.matchMedia("(prefers-reduced-motion)"), t = () => at.current = e.matches;
2919
- e.addEventListener("change", t), t();
2920
- } else
2921
- at.current = !1;
2922
- }
2923
- const Fa = /* @__PURE__ */ new WeakMap();
2924
- function Da(e, t, n) {
2925
- for (const s in t) {
2926
- const i = t[s], r = n[s];
2927
- if (D(i))
2928
- e.addValue(s, i);
2929
- else if (D(r))
2930
- e.addValue(s, Pe(i, { owner: e }));
2931
- else if (r !== i)
2932
- if (e.hasValue(s)) {
2933
- const o = e.getValue(s);
2934
- o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
2935
- } else {
2936
- const o = e.getStaticValue(s);
2937
- e.addValue(s, Pe(o !== void 0 ? o : i, { owner: e }));
2938
- }
2717
+ getBaseTargetFromProps(t, n) {
2718
+ return t[n];
2719
+ }
2720
+ readValueFromInstance(t, n) {
2721
+ if (ue.has(n)) {
2722
+ const s = rs(n);
2723
+ return s && s.default || 0;
2724
+ }
2725
+ return n = Cs.has(n) ? n : kt(n), t.getAttribute(n);
2939
2726
  }
2940
- for (const s in n)
2941
- t[s] === void 0 && e.removeValue(s);
2942
- return t;
2943
- }
2944
- const dn = [
2945
- "AnimationStart",
2946
- "AnimationComplete",
2947
- "Update",
2948
- "BeforeLayoutMeasure",
2949
- "LayoutMeasure",
2950
- "LayoutAnimationStart",
2951
- "LayoutAnimationComplete"
2952
- ];
2953
- class Ra {
2954
- /**
2955
- * This method takes React props and returns found MotionValues. For example, HTML
2956
- * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
2957
- *
2958
- * This isn't an abstract method as it needs calling in the constructor, but it is
2959
- * intended to be one.
2960
- */
2961
2727
  scrapeMotionValuesFromProps(t, n, s) {
2962
- return {};
2728
+ return Ts(t, n, s);
2963
2729
  }
2964
- constructor({ parent: t, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: o }, a = {}) {
2965
- this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = Vt, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
2966
- this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
2967
- }, this.renderScheduledAt = 0, this.scheduleRender = () => {
2968
- const f = I.now();
2969
- this.renderScheduledAt < f && (this.renderScheduledAt = f, k.render(this.render, !1, !0));
2970
- };
2971
- const { latestValues: c, renderState: l } = o;
2972
- this.latestValues = c, this.baseTarget = { ...c }, this.initialValues = n.initial ? { ...c } : {}, this.renderState = l, this.parent = t, this.props = n, this.presenceContext = s, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!r, this.isControllingVariants = ke(n), this.isVariantNode = ls(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(t && t.current);
2973
- const { willChange: u, ...d } = this.scrapeMotionValuesFromProps(n, {}, this);
2974
- for (const f in d) {
2975
- const h = d[f];
2976
- c[f] !== void 0 && D(h) && h.set(c[f], !1);
2977
- }
2730
+ build(t, n, s) {
2731
+ ms(t, n, this.isSVGTag, s.transformTemplate, s.style);
2732
+ }
2733
+ renderInstance(t, n, s, i) {
2734
+ Zo(t, n, s, i);
2978
2735
  }
2979
2736
  mount(t) {
2980
- this.current = t, Fa.set(t, this), this.projection && !this.projection.instance && this.projection.mount(t), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), Ms.current || Pa(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : at.current, process.env.NODE_ENV !== "production" && Vn(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);
2737
+ this.isSVGTag = ys(t.tagName), super.mount(t);
2981
2738
  }
2982
- unmount() {
2983
- this.projection && this.projection.unmount(), ze(this.notifyUpdate), ze(this.render), this.valueSubscriptions.forEach((t) => t()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
2984
- for (const t in this.events)
2985
- this.events[t].clear();
2986
- for (const t in this.features) {
2987
- const n = this.features[t];
2988
- n && (n.unmount(), n.isMounted = !1);
2989
- }
2990
- this.current = null;
2739
+ }
2740
+ const Qo = (e, t) => Rt(e) ? new Jo(t) : new qo(t, {
2741
+ allowProjection: e !== bn
2742
+ });
2743
+ function te(e, t, n) {
2744
+ const s = e.getProps();
2745
+ return Ot(s, t, n !== void 0 ? n : s.custom, e);
2746
+ }
2747
+ const at = (e) => Array.isArray(e);
2748
+ function ea(e, t, n) {
2749
+ e.hasValue(t) ? e.getValue(t).set(n) : e.addValue(t, De(n));
2750
+ }
2751
+ function ta(e) {
2752
+ return at(e) ? e[e.length - 1] || 0 : e;
2753
+ }
2754
+ function na(e, t) {
2755
+ const n = te(e, t);
2756
+ let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
2757
+ r = { ...r, ...s };
2758
+ for (const o in r) {
2759
+ const a = ta(r[o]);
2760
+ ea(e, o, a);
2991
2761
  }
2992
- bindToMotionValue(t, n) {
2993
- this.valueSubscriptions.has(t) && this.valueSubscriptions.get(t)();
2994
- const s = re.has(t);
2995
- s && this.onBindTransform && this.onBindTransform();
2996
- const i = n.on("change", (a) => {
2997
- this.latestValues[t] = a, this.props.onUpdate && k.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
2998
- }), r = n.on("renderRequest", this.scheduleRender);
2999
- let o;
3000
- window.MotionCheckAppearSync && (o = window.MotionCheckAppearSync(this, t, n)), this.valueSubscriptions.set(t, () => {
3001
- i(), r(), o && o(), n.owner && n.stop();
3002
- });
2762
+ }
2763
+ function sa(e) {
2764
+ return !!(D(e) && e.add);
2765
+ }
2766
+ function ia(e, t) {
2767
+ const n = e.getValue("willChange");
2768
+ if (sa(n))
2769
+ return n.add(t);
2770
+ if (!n && K.WillChange) {
2771
+ const s = new K.WillChange("auto");
2772
+ e.addValue("willChange", s), s.add(t);
3003
2773
  }
3004
- sortNodePosition(t) {
3005
- return !this.current || !this.sortInstanceNodePosition || this.type !== t.type ? 0 : this.sortInstanceNodePosition(this.current, t.current);
2774
+ }
2775
+ function ra(e) {
2776
+ return e.props[ws];
2777
+ }
2778
+ const oa = (e) => e !== null;
2779
+ function aa(e, { repeat: t, repeatType: n = "loop" }, s) {
2780
+ const i = e.filter(oa), r = t && n !== "loop" && t % 2 === 1 ? 0 : i.length - 1;
2781
+ return i[r];
2782
+ }
2783
+ const ua = {
2784
+ type: "spring",
2785
+ stiffness: 500,
2786
+ damping: 25,
2787
+ restSpeed: 10
2788
+ }, ca = (e) => ({
2789
+ type: "spring",
2790
+ stiffness: 550,
2791
+ damping: e === 0 ? 2 * Math.sqrt(550) : 30,
2792
+ restSpeed: 10
2793
+ }), la = {
2794
+ type: "keyframes",
2795
+ duration: 0.8
2796
+ }, fa = {
2797
+ type: "keyframes",
2798
+ ease: [0.25, 0.1, 0.35, 1],
2799
+ duration: 0.3
2800
+ }, da = (e, { keyframes: t }) => t.length > 2 ? la : ue.has(e) ? e.startsWith("scale") ? ca(t[1]) : ua : fa;
2801
+ function ha({ when: e, delay: t, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: c, elapsed: l, ...u }) {
2802
+ return !!Object.keys(u).length;
2803
+ }
2804
+ const pa = (e, t, n, s = {}, i, r) => (o) => {
2805
+ const a = ts(s, e) || {}, c = a.delay || s.delay || 0;
2806
+ let { elapsed: l = 0 } = s;
2807
+ l = l - /* @__PURE__ */ N(c);
2808
+ const u = {
2809
+ keyframes: Array.isArray(n) ? n : [null, n],
2810
+ ease: "easeOut",
2811
+ velocity: t.getVelocity(),
2812
+ ...a,
2813
+ delay: -l,
2814
+ onUpdate: (d) => {
2815
+ t.set(d), a.onUpdate && a.onUpdate(d);
2816
+ },
2817
+ onComplete: () => {
2818
+ o(), a.onComplete && a.onComplete();
2819
+ },
2820
+ name: e,
2821
+ motionValue: t,
2822
+ element: r ? void 0 : i
2823
+ };
2824
+ ha(a) || Object.assign(u, da(e, u)), u.duration && (u.duration = /* @__PURE__ */ N(u.duration)), u.repeatDelay && (u.repeatDelay = /* @__PURE__ */ N(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
2825
+ let f = !1;
2826
+ if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (it(u), u.delay === 0 && (f = !0)), (K.instantAnimations || K.skipAnimations) && (f = !0, it(u), u.delay = 0), u.allowFlatten = !a.type && !a.ease, f && !r && t.get() !== void 0) {
2827
+ const d = aa(u.keyframes, a);
2828
+ if (d !== void 0) {
2829
+ L.update(() => {
2830
+ u.onUpdate(d), u.onComplete();
2831
+ });
2832
+ return;
2833
+ }
3006
2834
  }
3007
- updateFeatures() {
3008
- let t = "animation";
3009
- for (t in Q) {
3010
- const n = Q[t];
3011
- if (!n)
3012
- continue;
3013
- const { isEnabled: s, Feature: i } = n;
3014
- if (!this.features[t] && i && s(this.props) && (this.features[t] = new i(this)), this.features[t]) {
3015
- const r = this.features[t];
3016
- r.isMounted ? r.update() : (r.mount(), r.isMounted = !0);
2835
+ return a.isSync ? new St(u) : new Or(u);
2836
+ };
2837
+ function ma({ protectedKeys: e, needsAnimating: t }, n) {
2838
+ const s = e.hasOwnProperty(n) && t[n] !== !0;
2839
+ return t[n] = !1, s;
2840
+ }
2841
+ function Ps(e, t, { delay: n = 0, transitionOverride: s, type: i } = {}) {
2842
+ let { transition: r = e.getDefaultTransition(), transitionEnd: o, ...a } = t;
2843
+ s && (r = s);
2844
+ const c = [], l = i && e.animationState && e.animationState.getState()[i];
2845
+ for (const u in a) {
2846
+ const f = e.getValue(u, e.latestValues[u] ?? null), d = a[u];
2847
+ if (d === void 0 || l && ma(l, u))
2848
+ continue;
2849
+ const h = {
2850
+ delay: n,
2851
+ ...ts(r || {}, u)
2852
+ }, y = f.get();
2853
+ if (y !== void 0 && !f.isAnimating && !Array.isArray(d) && d === y && !h.velocity)
2854
+ continue;
2855
+ let b = !1;
2856
+ if (window.MotionHandoffAnimation) {
2857
+ const p = ra(e);
2858
+ if (p) {
2859
+ const V = window.MotionHandoffAnimation(p, u, L);
2860
+ V !== null && (h.startTime = V, b = !0);
3017
2861
  }
3018
2862
  }
2863
+ ia(e, u), f.start(pa(u, f, d, e.shouldReduceMotion && ns.has(u) ? { type: !1 } : h, e, b));
2864
+ const v = f.animation;
2865
+ v && c.push(v);
3019
2866
  }
3020
- triggerBuild() {
3021
- this.build(this.renderState, this.latestValues, this.props);
3022
- }
3023
- /**
3024
- * Measure the current viewport box with or without transforms.
3025
- * Only measures axis-aligned boxes, rotate and skew must be manually
3026
- * removed with a re-render to work.
3027
- */
3028
- measureViewportBox() {
3029
- return this.current ? this.measureInstanceViewportBox(this.current, this.props) : As();
2867
+ return o && Promise.all(c).then(() => {
2868
+ L.update(() => {
2869
+ o && na(e, o);
2870
+ });
2871
+ }), c;
2872
+ }
2873
+ function Fs(e, t, n, s = 0, i = 1) {
2874
+ const r = Array.from(e).sort((l, u) => l.sortNodePosition(u)).indexOf(t), o = e.size, a = (o - 1) * s;
2875
+ return typeof n == "function" ? n(r, o) : i === 1 ? r * s : a - r * s;
2876
+ }
2877
+ function ut(e, t, n = {}) {
2878
+ var c;
2879
+ const s = te(e, t, n.type === "exit" ? (c = e.presenceContext) == null ? void 0 : c.custom : void 0);
2880
+ let { transition: i = e.getDefaultTransition() || {} } = s || {};
2881
+ n.transitionOverride && (i = n.transitionOverride);
2882
+ const r = s ? () => Promise.all(Ps(e, s, n)) : () => Promise.resolve(), o = e.variantChildren && e.variantChildren.size ? (l = 0) => {
2883
+ const { delayChildren: u = 0, staggerChildren: f, staggerDirection: d } = i;
2884
+ return ga(e, t, l, u, f, d, n);
2885
+ } : () => Promise.resolve(), { when: a } = i;
2886
+ if (a) {
2887
+ const [l, u] = a === "beforeChildren" ? [r, o] : [o, r];
2888
+ return l().then(() => u());
2889
+ } else
2890
+ return Promise.all([r(), o(n.delay)]);
2891
+ }
2892
+ function ga(e, t, n = 0, s = 0, i = 0, r = 1, o) {
2893
+ const a = [];
2894
+ for (const c of e.variantChildren)
2895
+ c.notify("AnimationStart", t), a.push(ut(c, t, {
2896
+ ...o,
2897
+ delay: n + (typeof s == "function" ? 0 : s) + Fs(e.variantChildren, c, s, i, r)
2898
+ }).then(() => c.notify("AnimationComplete", t)));
2899
+ return Promise.all(a);
2900
+ }
2901
+ function ya(e, t, n = {}) {
2902
+ e.notify("AnimationStart", t);
2903
+ let s;
2904
+ if (Array.isArray(t)) {
2905
+ const i = t.map((r) => ut(e, r, n));
2906
+ s = Promise.all(i);
2907
+ } else if (typeof t == "string")
2908
+ s = ut(e, t, n);
2909
+ else {
2910
+ const i = typeof t == "function" ? te(e, t, n.custom) : t;
2911
+ s = Promise.all(Ps(e, i, n));
3030
2912
  }
3031
- getStaticValue(t) {
3032
- return this.latestValues[t];
2913
+ return s.then(() => {
2914
+ e.notify("AnimationComplete", t);
2915
+ });
2916
+ }
2917
+ function Ds(e, t) {
2918
+ if (!Array.isArray(t))
2919
+ return !1;
2920
+ const n = t.length;
2921
+ if (n !== e.length)
2922
+ return !1;
2923
+ for (let s = 0; s < n; s++)
2924
+ if (t[s] !== e[s])
2925
+ return !1;
2926
+ return !0;
2927
+ }
2928
+ const ba = Pt.length;
2929
+ function Rs(e) {
2930
+ if (!e)
2931
+ return;
2932
+ if (!e.isControllingVariants) {
2933
+ const n = e.parent ? Rs(e.parent) || {} : {};
2934
+ return e.props.initial !== void 0 && (n.initial = e.props.initial), n;
3033
2935
  }
3034
- setStaticValue(t, n) {
3035
- this.latestValues[t] = n;
2936
+ const t = {};
2937
+ for (let n = 0; n < ba; n++) {
2938
+ const s = Pt[n], i = e.props[s];
2939
+ (me(i) || i === !1) && (t[s] = i);
3036
2940
  }
3037
- /**
3038
- * Update the provided props. Ensure any newly-added motion values are
3039
- * added to our map, old ones removed, and listeners updated.
3040
- */
3041
- update(t, n) {
3042
- (t.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = t, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
3043
- for (let s = 0; s < dn.length; s++) {
3044
- const i = dn[s];
3045
- this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
3046
- const r = "on" + i, o = t[r];
3047
- o && (this.propEventSubscriptions[i] = this.on(i, o));
2941
+ return t;
2942
+ }
2943
+ const Ta = [...Ct].reverse(), va = Ct.length;
2944
+ function wa(e) {
2945
+ return (t) => Promise.all(t.map(({ animation: n, options: s }) => ya(e, n, s)));
2946
+ }
2947
+ function Va(e) {
2948
+ let t = wa(e), n = dn(), s = !0;
2949
+ const i = (c) => (l, u) => {
2950
+ var d;
2951
+ const f = te(e, u, c === "exit" ? (d = e.presenceContext) == null ? void 0 : d.custom : void 0);
2952
+ if (f) {
2953
+ const { transition: h, transitionEnd: y, ...b } = f;
2954
+ l = { ...l, ...b, ...y };
3048
2955
  }
3049
- this.prevMotionValues = Da(this, this.scrapeMotionValuesFromProps(t, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
3050
- }
3051
- getProps() {
3052
- return this.props;
3053
- }
3054
- /**
3055
- * Returns the variant definition with a given name.
3056
- */
3057
- getVariant(t) {
3058
- return this.props.variants ? this.props.variants[t] : void 0;
3059
- }
3060
- /**
3061
- * Returns the defined default transition on this component.
3062
- */
3063
- getDefaultTransition() {
3064
- return this.props.transition;
3065
- }
3066
- getTransformPagePoint() {
3067
- return this.props.transformPagePoint;
3068
- }
3069
- getClosestVariantNode() {
3070
- return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
3071
- }
3072
- /**
3073
- * Add a child visual element to our set of children.
3074
- */
3075
- addVariantChild(t) {
3076
- const n = this.getClosestVariantNode();
3077
- if (n)
3078
- return n.variantChildren && n.variantChildren.add(t), () => n.variantChildren.delete(t);
2956
+ return l;
2957
+ };
2958
+ function r(c) {
2959
+ t = c(e);
3079
2960
  }
3080
- /**
3081
- * Add a motion value and bind it to this visual element.
3082
- */
3083
- addValue(t, n) {
3084
- const s = this.values.get(t);
3085
- n !== s && (s && this.removeValue(t), this.bindToMotionValue(t, n), this.values.set(t, n), this.latestValues[t] = n.get());
2961
+ function o(c) {
2962
+ const { props: l } = e, u = Rs(e.parent) || {}, f = [], d = /* @__PURE__ */ new Set();
2963
+ let h = {}, y = 1 / 0;
2964
+ for (let v = 0; v < va; v++) {
2965
+ const p = Ta[v], V = n[p], g = l[p] !== void 0 ? l[p] : u[p], x = me(g), T = p === c ? V.isActive : null;
2966
+ T === !1 && (y = v);
2967
+ let S = g === u[p] && g !== l[p] && x;
2968
+ if (S && s && e.manuallyAnimateOnMount && (S = !1), V.protectedKeys = { ...h }, // If it isn't active and hasn't *just* been set as inactive
2969
+ !V.isActive && T === null || // If we didn't and don't have any defined prop for this animation type
2970
+ !g && !V.prevProp || // Or if the prop doesn't define an animation
2971
+ Le(g) || typeof g == "boolean")
2972
+ continue;
2973
+ const C = Sa(V.prevProp, g);
2974
+ let w = C || // If we're making this variant active, we want to always make it active
2975
+ p === c && V.isActive && !S && x || // If we removed a higher-priority variant (i is in reverse order)
2976
+ v > y && x, R = !1;
2977
+ const O = Array.isArray(g) ? g : [g];
2978
+ let q = O.reduce(i(p), {});
2979
+ T === !1 && (q = {});
2980
+ const { prevResolvedValues: Et = {} } = V, $s = {
2981
+ ...Et,
2982
+ ...q
2983
+ }, Lt = (P) => {
2984
+ w = !0, d.has(P) && (R = !0, d.delete(P)), V.needsAnimating[P] = !0;
2985
+ const I = e.getValue(P);
2986
+ I && (I.liveStyle = !1);
2987
+ };
2988
+ for (const P in $s) {
2989
+ const I = q[P], W = Et[P];
2990
+ if (h.hasOwnProperty(P))
2991
+ continue;
2992
+ let Z = !1;
2993
+ at(I) && at(W) ? Z = !Ds(I, W) : Z = I !== W, Z ? I != null ? Lt(P) : d.add(P) : I !== void 0 && d.has(P) ? Lt(P) : V.protectedKeys[P] = !0;
2994
+ }
2995
+ V.prevProp = g, V.prevResolvedValues = q, V.isActive && (h = { ...h, ...q }), s && e.blockInitialAnimation && (w = !1);
2996
+ const Nt = S && C;
2997
+ w && (!Nt || R) && f.push(...O.map((P) => {
2998
+ const I = { type: p };
2999
+ if (typeof P == "string" && s && !Nt && e.manuallyAnimateOnMount && e.parent) {
3000
+ const { parent: W } = e, Z = te(W, P);
3001
+ if (W.enteringChildren && Z) {
3002
+ const { delayChildren: Ws } = Z.transition || {};
3003
+ I.delay = Fs(W.enteringChildren, e, Ws);
3004
+ }
3005
+ }
3006
+ return {
3007
+ animation: P,
3008
+ options: I
3009
+ };
3010
+ }));
3011
+ }
3012
+ if (d.size) {
3013
+ const v = {};
3014
+ if (typeof l.initial != "boolean") {
3015
+ const p = te(e, Array.isArray(l.initial) ? l.initial[0] : l.initial);
3016
+ p && p.transition && (v.transition = p.transition);
3017
+ }
3018
+ d.forEach((p) => {
3019
+ const V = e.getBaseTarget(p), g = e.getValue(p);
3020
+ g && (g.liveStyle = !0), v[p] = V ?? null;
3021
+ }), f.push({ animation: v });
3022
+ }
3023
+ let b = !!f.length;
3024
+ return s && (l.initial === !1 || l.initial === l.animate) && !e.manuallyAnimateOnMount && (b = !1), s = !1, b ? t(f) : Promise.resolve();
3086
3025
  }
3087
- /**
3088
- * Remove a motion value and unbind any active subscriptions.
3089
- */
3090
- removeValue(t) {
3091
- this.values.delete(t);
3092
- const n = this.valueSubscriptions.get(t);
3093
- n && (n(), this.valueSubscriptions.delete(t)), delete this.latestValues[t], this.removeValueFromRenderState(t, this.renderState);
3026
+ function a(c, l) {
3027
+ var f;
3028
+ if (n[c].isActive === l)
3029
+ return Promise.resolve();
3030
+ (f = e.variantChildren) == null || f.forEach((d) => {
3031
+ var h;
3032
+ return (h = d.animationState) == null ? void 0 : h.setActive(c, l);
3033
+ }), n[c].isActive = l;
3034
+ const u = o(c);
3035
+ for (const d in n)
3036
+ n[d].protectedKeys = {};
3037
+ return u;
3094
3038
  }
3095
- /**
3096
- * Check whether we have a motion value for this key
3097
- */
3098
- hasValue(t) {
3099
- return this.values.has(t);
3039
+ return {
3040
+ animateChanges: o,
3041
+ setActive: a,
3042
+ setAnimateFunction: r,
3043
+ getState: () => n,
3044
+ reset: () => {
3045
+ n = dn(), s = !0;
3046
+ }
3047
+ };
3048
+ }
3049
+ function Sa(e, t) {
3050
+ return typeof t == "string" ? t !== e : Array.isArray(t) ? !Ds(t, e) : !1;
3051
+ }
3052
+ function j(e = !1) {
3053
+ return {
3054
+ isActive: e,
3055
+ protectedKeys: {},
3056
+ needsAnimating: {},
3057
+ prevResolvedValues: {}
3058
+ };
3059
+ }
3060
+ function dn() {
3061
+ return {
3062
+ animate: j(!0),
3063
+ whileInView: j(),
3064
+ whileHover: j(),
3065
+ whileTap: j(),
3066
+ whileDrag: j(),
3067
+ whileFocus: j(),
3068
+ exit: j()
3069
+ };
3070
+ }
3071
+ class ce {
3072
+ constructor(t) {
3073
+ this.isMounted = !1, this.node = t;
3100
3074
  }
3101
- getValue(t, n) {
3102
- if (this.props.values && this.props.values[t])
3103
- return this.props.values[t];
3104
- let s = this.values.get(t);
3105
- return s === void 0 && n !== void 0 && (s = Pe(n === null ? void 0 : n, { owner: this }), this.addValue(t, s)), s;
3075
+ update() {
3106
3076
  }
3077
+ }
3078
+ class xa extends ce {
3107
3079
  /**
3108
- * If we're trying to animate to a previously unencountered value,
3109
- * we need to check for it in our state and as a last resort read it
3110
- * directly from the instance (which might have performance implications).
3080
+ * We dynamically generate the AnimationState manager as it contains a reference
3081
+ * to the underlying animation library. We only want to load that if we load this,
3082
+ * so people can optionally code split it out using the `m` component.
3111
3083
  */
3112
- readValue(t, n) {
3113
- let s = this.latestValues[t] !== void 0 || !this.current ? this.latestValues[t] : this.getBaseTargetFromProps(this.props, t) ?? this.readValueFromInstance(this.current, t, this.options);
3114
- return s != null && (typeof s == "string" && (yn(s) || bn(s)) ? s = parseFloat(s) : !to(s) && se.test(n) && (s = is(t, n)), this.setBaseTarget(t, D(s) ? s.get() : s)), D(s) ? s.get() : s;
3084
+ constructor(t) {
3085
+ super(t), t.animationState || (t.animationState = Va(t));
3115
3086
  }
3116
- /**
3117
- * Set the base target to later animate back to. This is currently
3118
- * only hydrated on creation and when we first read a value.
3119
- */
3120
- setBaseTarget(t, n) {
3121
- this.baseTarget[t] = n;
3087
+ updateAnimationControlsSubscription() {
3088
+ const { animate: t } = this.node.getProps();
3089
+ Le(t) && (this.unmountControls = t.subscribe(this.node));
3122
3090
  }
3123
3091
  /**
3124
- * Find the base target for a value thats been removed from all animation
3125
- * props.
3092
+ * Subscribe any provided AnimationControls to the component's VisualElement
3126
3093
  */
3127
- getBaseTarget(t) {
3128
- var r;
3129
- const { initial: n } = this.props;
3130
- let s;
3131
- if (typeof n == "string" || typeof n == "object") {
3132
- const o = Rt(this.props, n, (r = this.presenceContext) == null ? void 0 : r.custom);
3133
- o && (s = o[t]);
3134
- }
3135
- if (n && s !== void 0)
3136
- return s;
3137
- const i = this.getBaseTargetFromProps(this.props, t);
3138
- return i !== void 0 && !D(i) ? i : this.initialValues[t] !== void 0 && s === void 0 ? void 0 : this.baseTarget[t];
3094
+ mount() {
3095
+ this.updateAnimationControlsSubscription();
3139
3096
  }
3140
- on(t, n) {
3141
- return this.events[t] || (this.events[t] = new Tn()), this.events[t].add(n);
3097
+ update() {
3098
+ const { animate: t } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
3099
+ t !== n && this.updateAnimationControlsSubscription();
3142
3100
  }
3143
- notify(t, ...n) {
3144
- this.events[t] && this.events[t].notify(...n);
3101
+ unmount() {
3102
+ var t;
3103
+ this.node.animationState.reset(), (t = this.unmountControls) == null || t.call(this);
3145
3104
  }
3146
3105
  }
3147
- class Cs extends Ra {
3106
+ let Aa = 0;
3107
+ class Ma extends ce {
3148
3108
  constructor() {
3149
- super(...arguments), this.KeyframeResolver = Wr;
3109
+ super(...arguments), this.id = Aa++;
3150
3110
  }
3151
- sortInstanceNodePosition(t, n) {
3152
- return t.compareDocumentPosition(n) & 2 ? 1 : -1;
3111
+ update() {
3112
+ if (!this.node.presenceContext)
3113
+ return;
3114
+ const { isPresent: t, onExitComplete: n } = this.node.presenceContext, { isPresent: s } = this.node.prevPresenceContext || {};
3115
+ if (!this.node.animationState || t === s)
3116
+ return;
3117
+ const i = this.node.animationState.setActive("exit", !t);
3118
+ n && !t && i.then(() => {
3119
+ n(this.id);
3120
+ });
3153
3121
  }
3154
- getBaseTargetFromProps(t, n) {
3155
- return t.style ? t.style[n] : void 0;
3122
+ mount() {
3123
+ const { register: t, onExitComplete: n } = this.node.presenceContext || {};
3124
+ n && n(this.id), t && (this.unmount = t(this.id));
3156
3125
  }
3157
- removeValueFromRenderState(t, { vars: n, style: s }) {
3158
- delete n[t], delete s[t];
3126
+ unmount() {
3159
3127
  }
3160
- handleChildMotionValue() {
3161
- this.childSubscription && (this.childSubscription(), delete this.childSubscription);
3162
- const { children: t } = this.props;
3163
- D(t) && (this.childSubscription = t.on("change", (n) => {
3164
- this.current && (this.current.textContent = `${n}`);
3165
- }));
3128
+ }
3129
+ const Ca = {
3130
+ animation: {
3131
+ Feature: xa
3132
+ },
3133
+ exit: {
3134
+ Feature: Ma
3166
3135
  }
3136
+ };
3137
+ function hn(e, t, n, s = { passive: !0 }) {
3138
+ return e.addEventListener(t, n, s), () => e.removeEventListener(t, n);
3167
3139
  }
3168
- function Ps(e, { style: t, vars: n }, s, i) {
3169
- const r = e.style;
3170
- let o;
3171
- for (o in t)
3172
- r[o] = t[o];
3173
- i == null || i.applyProjectionStyles(r, s);
3174
- for (o in n)
3175
- r.setProperty(o, n[o]);
3140
+ function Os(e) {
3141
+ return {
3142
+ point: {
3143
+ x: e.pageX,
3144
+ y: e.pageY
3145
+ }
3146
+ };
3176
3147
  }
3177
- function Oa(e) {
3178
- return window.getComputedStyle(e);
3148
+ function pn(e, t, n) {
3149
+ const { props: s } = e;
3150
+ e.animationState && s.whileHover && e.animationState.setActive("whileHover", n === "Start");
3151
+ const i = "onHover" + n, r = s[i];
3152
+ r && L.postRender(() => r(t, Os(t)));
3153
+ }
3154
+ class Pa extends ce {
3155
+ mount() {
3156
+ const { current: t } = this.node;
3157
+ t && (this.unmount = Qr(t, (n, s) => (pn(this.node, s, "Start"), (i) => pn(this.node, i, "End"))));
3158
+ }
3159
+ unmount() {
3160
+ }
3179
3161
  }
3180
- class Ia extends Cs {
3162
+ class Fa extends ce {
3181
3163
  constructor() {
3182
- super(...arguments), this.type = "html", this.renderInstance = Ps;
3164
+ super(...arguments), this.isActive = !1;
3183
3165
  }
3184
- readValueFromInstance(t, n) {
3185
- var s;
3186
- if (re.has(n))
3187
- return (s = this.projection) != null && s.isProjecting ? Je(n) : rr(t, n);
3188
- {
3189
- const i = Oa(t), r = (En(n) ? i.getPropertyValue(n) : i[n]) || 0;
3190
- return typeof r == "string" ? r.trim() : r;
3166
+ onFocus() {
3167
+ let t = !1;
3168
+ try {
3169
+ t = this.node.current.matches(":focus-visible");
3170
+ } catch {
3171
+ t = !0;
3191
3172
  }
3173
+ !t || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
3192
3174
  }
3193
- measureInstanceViewportBox(t, { transformPagePoint: n }) {
3194
- return ga(t, n);
3175
+ onBlur() {
3176
+ !this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
3195
3177
  }
3196
- build(t, n, s) {
3197
- Pt(t, n, s.transformTemplate);
3178
+ mount() {
3179
+ this.unmount = Ie(hn(this.node.current, "focus", () => this.onFocus()), hn(this.node.current, "blur", () => this.onBlur()));
3198
3180
  }
3199
- scrapeMotionValuesFromProps(t, n, s) {
3200
- return Ot(t, n, s);
3181
+ unmount() {
3201
3182
  }
3202
3183
  }
3203
- const Fs = /* @__PURE__ */ new Set([
3204
- "baseFrequency",
3205
- "diffuseConstant",
3206
- "kernelMatrix",
3207
- "kernelUnitLength",
3208
- "keySplines",
3209
- "keyTimes",
3210
- "limitingConeAngle",
3211
- "markerHeight",
3212
- "markerWidth",
3213
- "numOctaves",
3214
- "targetX",
3215
- "targetY",
3216
- "surfaceScale",
3217
- "specularConstant",
3218
- "specularExponent",
3219
- "stdDeviation",
3220
- "tableValues",
3221
- "viewBox",
3222
- "gradientTransform",
3223
- "pathLength",
3224
- "startOffset",
3225
- "textLength",
3226
- "lengthAdjust"
3227
- ]);
3228
- function Ea(e, t, n, s) {
3229
- Ps(e, t, void 0, s);
3230
- for (const i in t.attrs)
3231
- e.setAttribute(Fs.has(i) ? i : Ct(i), t.attrs[i]);
3184
+ function mn(e, t, n) {
3185
+ const { props: s } = e;
3186
+ if (e.current instanceof HTMLButtonElement && e.current.disabled)
3187
+ return;
3188
+ e.animationState && s.whileTap && e.animationState.setActive("whileTap", n === "Start");
3189
+ const i = "onTap" + (n === "End" ? "" : n), r = s[i];
3190
+ r && L.postRender(() => r(t, Os(t)));
3232
3191
  }
3233
- class ka extends Cs {
3234
- constructor() {
3235
- super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = As;
3192
+ class Da extends ce {
3193
+ mount() {
3194
+ const { current: t } = this.node;
3195
+ t && (this.unmount = io(t, (n, s) => (mn(this.node, s, "Start"), (i, { success: r }) => mn(this.node, i, r ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
3236
3196
  }
3237
- getBaseTargetFromProps(t, n) {
3238
- return t[n];
3197
+ unmount() {
3239
3198
  }
3240
- readValueFromInstance(t, n) {
3241
- if (re.has(n)) {
3242
- const s = ss(n);
3243
- return s && s.default || 0;
3244
- }
3245
- return n = Fs.has(n) ? n : Ct(n), t.getAttribute(n);
3199
+ }
3200
+ const ct = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), Ra = (e) => {
3201
+ const t = ct.get(e.target);
3202
+ t && t(e);
3203
+ }, Oa = (e) => {
3204
+ e.forEach(Ra);
3205
+ };
3206
+ function Ia({ root: e, ...t }) {
3207
+ const n = e || document;
3208
+ Ge.has(n) || Ge.set(n, {});
3209
+ const s = Ge.get(n), i = JSON.stringify(t);
3210
+ return s[i] || (s[i] = new IntersectionObserver(Oa, { root: e, ...t })), s[i];
3211
+ }
3212
+ function ka(e, t, n) {
3213
+ const s = Ia(t);
3214
+ return ct.set(e, n), s.observe(e), () => {
3215
+ ct.delete(e), s.unobserve(e);
3216
+ };
3217
+ }
3218
+ const Ea = {
3219
+ some: 0,
3220
+ all: 1
3221
+ };
3222
+ class La extends ce {
3223
+ constructor() {
3224
+ super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
3246
3225
  }
3247
- scrapeMotionValuesFromProps(t, n, s) {
3248
- return Ts(t, n, s);
3226
+ startObserver() {
3227
+ this.unmount();
3228
+ const { viewport: t = {} } = this.node.getProps(), { root: n, margin: s, amount: i = "some", once: r } = t, o = {
3229
+ root: n ? n.current : void 0,
3230
+ rootMargin: s,
3231
+ threshold: typeof i == "number" ? i : Ea[i]
3232
+ }, a = (c) => {
3233
+ const { isIntersecting: l } = c;
3234
+ if (this.isInView === l || (this.isInView = l, r && !l && this.hasEnteredView))
3235
+ return;
3236
+ l && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", l);
3237
+ const { onViewportEnter: u, onViewportLeave: f } = this.node.getProps(), d = l ? u : f;
3238
+ d && d(c);
3239
+ };
3240
+ return ka(this.node.current, o, a);
3249
3241
  }
3250
- build(t, n, s) {
3251
- gs(t, n, this.isSVGTag, s.transformTemplate, s.style);
3242
+ mount() {
3243
+ this.startObserver();
3252
3244
  }
3253
- renderInstance(t, n, s, i) {
3254
- Ea(t, n, s, i);
3245
+ update() {
3246
+ if (typeof IntersectionObserver > "u")
3247
+ return;
3248
+ const { props: t, prevProps: n } = this.node;
3249
+ ["amount", "margin", "root"].some(Na(t, n)) && this.startObserver();
3255
3250
  }
3256
- mount(t) {
3257
- this.isSVGTag = bs(t.tagName), super.mount(t);
3251
+ unmount() {
3252
+ }
3253
+ }
3254
+ function Na({ viewport: e = {} }, { viewport: t = {} } = {}) {
3255
+ return (n) => e[n] !== t[n];
3256
+ }
3257
+ const Ba = {
3258
+ inView: {
3259
+ Feature: La
3260
+ },
3261
+ tap: {
3262
+ Feature: Da
3263
+ },
3264
+ focus: {
3265
+ Feature: Fa
3266
+ },
3267
+ hover: {
3268
+ Feature: Pa
3258
3269
  }
3270
+ }, Ka = {
3271
+ renderer: Qo,
3272
+ ...Ca,
3273
+ ...Ba
3274
+ };
3275
+ function $a(e, t) {
3276
+ return Bo(e, t);
3259
3277
  }
3260
- const Na = (e, t) => Dt(e) ? new ka(t) : new Ia(t, {
3261
- allowProjection: e !== mn
3262
- }), La = {
3263
- renderer: Na,
3264
- ...ha,
3265
- ...Ca
3266
- }, hn = /* @__PURE__ */ Bo("span"), Ba = {
3278
+ const gn = /* @__PURE__ */ $a("span"), Wa = {
3267
3279
  Root: {
3268
3280
  0: {
3269
3281
  h: "5"
@@ -3275,7 +3287,7 @@ const Na = (e, t) => Dt(e) ? new ka(t) : new Ia(t, {
3275
3287
  h: "8"
3276
3288
  }
3277
3289
  }
3278
- }, Ds = {
3290
+ }, Is = {
3279
3291
  Root: {
3280
3292
  0: "1",
3281
3293
  1: "1_5",
@@ -3286,7 +3298,7 @@ const Na = (e, t) => Dt(e) ? new ka(t) : new Ia(t, {
3286
3298
  1: "1_5",
3287
3299
  2: "2"
3288
3300
  }
3289
- }, ye = {
3301
+ }, Te = {
3290
3302
  Root: {
3291
3303
  solid: {
3292
3304
  default: "gray-12",
@@ -3375,47 +3387,47 @@ const Na = (e, t) => Dt(e) ? new ka(t) : new Ia(t, {
3375
3387
  purple: "purple"
3376
3388
  }
3377
3389
  }
3378
- }, be = G.createContext({
3390
+ }, ve = z.createContext({
3379
3391
  size: "1",
3380
3392
  color: "default",
3381
3393
  variant: "soft"
3382
- }), Rs = ({
3394
+ }), ks = ({
3383
3395
  as: e = "span",
3384
3396
  size: t = "1",
3385
3397
  color: n = "default",
3386
3398
  variant: s = "soft",
3387
3399
  className: i,
3388
3400
  ...r
3389
- }) => /* @__PURE__ */ F(be.Provider, { value: { size: t, color: n, variant: s }, children: /* @__PURE__ */ F(
3390
- Ks,
3401
+ }) => /* @__PURE__ */ F(ve.Provider, { value: { size: t, color: n, variant: s }, children: /* @__PURE__ */ F(
3402
+ _s,
3391
3403
  {
3392
3404
  as: e,
3393
3405
  align: "center",
3394
3406
  rounded: "1",
3395
3407
  display: "inline-flex",
3396
- pl: Ds.Root[t],
3397
- backgroundColor: ye.Root[s][n],
3398
- h: Ba.Root[t].h,
3399
- className: js("tgph-tag", i),
3408
+ pl: Is.Root[t],
3409
+ backgroundColor: Te.Root[s][n],
3410
+ h: Wa.Root[t].h,
3411
+ className: Hs("tgph-tag", i),
3400
3412
  ...r,
3401
3413
  "data-tag": !0
3402
3414
  }
3403
- ) }), Os = ({
3415
+ ) }), Es = ({
3404
3416
  as: e = "span",
3405
3417
  maxW: t = "40",
3406
3418
  overflow: n = "hidden",
3407
3419
  style: s,
3408
3420
  ...i
3409
3421
  }) => {
3410
- const r = G.useContext(be);
3422
+ const r = z.useContext(ve);
3411
3423
  return /* @__PURE__ */ F(
3412
- Ws,
3424
+ zs,
3413
3425
  {
3414
3426
  as: e,
3415
3427
  size: r.size,
3416
- color: ye.Text[r.variant][r.color],
3428
+ color: Te.Text[r.variant][r.color],
3417
3429
  weight: "medium",
3418
- mr: Ds.Text[r.size],
3430
+ mr: Is.Text[r.size],
3419
3431
  maxW: t,
3420
3432
  overflow: n,
3421
3433
  internal_optionalAs: !0,
@@ -3427,22 +3439,22 @@ const Na = (e, t) => Dt(e) ? new ka(t) : new Ia(t, {
3427
3439
  ...i
3428
3440
  }
3429
3441
  );
3430
- }, Is = ({ onClick: e, textToCopy: t, ...n }) => {
3431
- const s = G.useContext(be), [i, r] = G.useState(!1);
3432
- return G.useEffect(() => {
3442
+ }, Ls = ({ onClick: e, textToCopy: t, ...n }) => {
3443
+ const s = z.useContext(ve), [i, r] = z.useState(!1);
3444
+ return z.useEffect(() => {
3433
3445
  if (i) {
3434
3446
  const o = setTimeout(() => r(!1), 2e3);
3435
3447
  return () => clearTimeout(o);
3436
3448
  }
3437
- }, [i]), /* @__PURE__ */ F(no, { features: La, children: /* @__PURE__ */ F($s, { label: "Copy text", children: /* @__PURE__ */ ut(
3438
- we.Root,
3449
+ }, [i]), /* @__PURE__ */ F(ao, { features: Ka, children: /* @__PURE__ */ F(Gs, { label: "Copy text", children: /* @__PURE__ */ lt(
3450
+ Se.Root,
3439
3451
  {
3440
3452
  onClick: (o) => {
3441
3453
  var a;
3442
3454
  e == null || e(o), r(!0), t && navigator.clipboard.writeText(t), (a = o.currentTarget) == null || a.blur();
3443
3455
  },
3444
3456
  size: s.size,
3445
- color: ye.Button[s.variant][s.color],
3457
+ color: Te.Button[s.variant][s.color],
3446
3458
  variant: s.variant,
3447
3459
  roundedTopRight: "1",
3448
3460
  roundedBottomRight: "1",
@@ -3454,25 +3466,25 @@ const Na = (e, t) => Dt(e) ? new ka(t) : new Ia(t, {
3454
3466
  ...n,
3455
3467
  children: [
3456
3468
  /* @__PURE__ */ F(
3457
- we.Icon,
3469
+ Se.Icon,
3458
3470
  {
3459
- as: hn,
3471
+ as: gn,
3460
3472
  initial: !1,
3461
3473
  animate: { y: i ? 0 : "150%", opacity: 1 },
3462
3474
  transition: { duration: 0.15, type: "spring", bounce: 0 },
3463
- icon: _s,
3475
+ icon: Us,
3464
3476
  alt: "Copied text",
3465
3477
  "aria-hidden": !i
3466
3478
  }
3467
3479
  ),
3468
3480
  /* @__PURE__ */ F(
3469
- we.Icon,
3481
+ Se.Icon,
3470
3482
  {
3471
- as: hn,
3483
+ as: gn,
3472
3484
  initial: !1,
3473
3485
  animate: { y: i ? "-150%" : 0, opacity: 1 },
3474
3486
  transition: { duration: 0.15, type: "spring", bounce: 0 },
3475
- icon: Gs,
3487
+ icon: Ys,
3476
3488
  position: "absolute",
3477
3489
  alt: "Copy text",
3478
3490
  "aria-hidden": i
@@ -3481,15 +3493,15 @@ const Na = (e, t) => Dt(e) ? new ka(t) : new Ia(t, {
3481
3493
  ]
3482
3494
  }
3483
3495
  ) }) });
3484
- }, Es = ({ ...e }) => {
3485
- const t = G.useContext(be);
3496
+ }, Ns = ({ ...e }) => {
3497
+ const t = z.useContext(ve);
3486
3498
  return /* @__PURE__ */ F(
3487
- we,
3499
+ Se,
3488
3500
  {
3489
3501
  size: t.size,
3490
- color: ye.Button[t.variant][t.color],
3502
+ color: Te.Button[t.variant][t.color],
3491
3503
  variant: t.variant,
3492
- icon: { icon: pn, alt: "close" },
3504
+ icon: { icon: yn, alt: "close" },
3493
3505
  roundedTopRight: "1",
3494
3506
  roundedBottomRight: "1",
3495
3507
  roundedTopLeft: "0",
@@ -3497,25 +3509,25 @@ const Na = (e, t) => Dt(e) ? new ka(t) : new Ia(t, {
3497
3509
  ...e
3498
3510
  }
3499
3511
  );
3500
- }, ks = ({
3512
+ }, Bs = ({
3501
3513
  icon: e,
3502
3514
  alt: t,
3503
3515
  "aria-hidden": n,
3504
3516
  ...s
3505
3517
  }) => {
3506
- const i = G.useContext(be), r = t ? { alt: t } : { "aria-hidden": n };
3518
+ const i = z.useContext(ve), r = t ? { alt: t } : { "aria-hidden": n };
3507
3519
  return /* @__PURE__ */ F(
3508
- Bs,
3520
+ js,
3509
3521
  {
3510
3522
  icon: e,
3511
3523
  size: i.size,
3512
- color: ye.Icon[i.variant][i.color],
3524
+ color: Te.Icon[i.variant][i.color],
3513
3525
  mr: "1",
3514
3526
  ...r,
3515
3527
  ...s
3516
3528
  }
3517
3529
  );
3518
- }, Ns = ({
3530
+ }, Ks = ({
3519
3531
  color: e = "default",
3520
3532
  size: t = "1",
3521
3533
  variant: n = "soft",
@@ -3526,21 +3538,21 @@ const Na = (e, t) => Dt(e) ? new ka(t) : new Ia(t, {
3526
3538
  textProps: a = { maxW: "40" },
3527
3539
  children: c,
3528
3540
  ...l
3529
- }) => /* @__PURE__ */ ut(Rs, { color: e, size: t, variant: n, ...l, children: [
3530
- s && /* @__PURE__ */ F(ks, { ...s }),
3531
- /* @__PURE__ */ F(Os, { as: "span", ...a, children: c }),
3532
- i && /* @__PURE__ */ F(Es, { onClick: i, icon: { icon: pn, alt: "Remove" } }),
3533
- r && /* @__PURE__ */ F(Is, { onClick: r, textToCopy: o })
3541
+ }) => /* @__PURE__ */ lt(ks, { color: e, size: t, variant: n, ...l, children: [
3542
+ s && /* @__PURE__ */ F(Bs, { ...s }),
3543
+ /* @__PURE__ */ F(Es, { as: "span", ...a, children: c }),
3544
+ i && /* @__PURE__ */ F(Ns, { onClick: i, icon: { icon: yn, alt: "Remove" } }),
3545
+ r && /* @__PURE__ */ F(Ls, { onClick: r, textToCopy: o })
3534
3546
  ] });
3535
- Object.assign(Ns, {
3536
- Root: Rs,
3537
- Button: Es,
3538
- Text: Os,
3539
- Icon: ks,
3540
- CopyButton: Is
3547
+ Object.assign(Ks, {
3548
+ Root: ks,
3549
+ Button: Ns,
3550
+ Text: Es,
3551
+ Icon: Bs,
3552
+ CopyButton: Ls
3541
3553
  });
3542
- const qa = Ns;
3554
+ const Ja = Ks;
3543
3555
  export {
3544
- qa as Tag
3556
+ Ja as Tag
3545
3557
  };
3546
3558
  //# sourceMappingURL=index.mjs.map