UNPKG

urbi-exhibitions

Version:
1,660 lines 180 kB
import { jsx as V, Fragment as Ys, jsxs as Ft } from "react/jsx-runtime"; import * as Bt from "react"; import Eo, { memo as ut, useState as se, useRef as z, useMemo as B, useEffect as Z, createContext as St, useId as We, useContext as F, useInsertionEffect as Xs, useCallback as et, Children as Mo, isValidElement as Ro, useLayoutEffect as Lo, forwardRef as Io, Fragment as qs, createElement as Oo, Component as Fo } from "react"; import { c as Gt } from "../cn-BYe7EnTr.js"; import { d as Bo, b as ko, e as No } from "../index-DkCgMG8a.js"; import { u as jo, c as _o, d as Uo, b as Zs, a as Ko } from "../mapContext-IRKlk7O4.js"; import { load as $o } from "@2gis/mapgl"; import { GltfPlugin as Go } from "@2gis/mapgl-gltf"; import { i as Wo } from "../clientSW-DAQRhLqS.js"; const zo = 500, Ho = ut( ({ children: t, className: e }) => { const [n, s] = se(), i = z(void 0), r = B(() => { if (n) return t !== n ? "opacity-0 animate-fadeOut" : "opacity-100 animate-fadeIn"; }, [t, n]); return Z(() => { if (clearTimeout(i.current), !n) { s(t); return; } t !== n && (i.current = setTimeout(() => { s(t); }, zo)); }, [n, t]), /* @__PURE__ */ V("div", { className: Gt(r, e), children: n }); } ), ze = St({}); function He(t) { const e = z(null); return e.current === null && (e.current = t()), e.current; } const ce = /* @__PURE__ */ St(null), Ye = St({ transformPagePoint: (t) => t, isStatic: !1, reducedMotion: "never" }); class Yo extends Bt.Component { getSnapshotBeforeUpdate(e) { const n = this.props.childRef.current; if (n && e.isPresent && !this.props.isPresent) { const s = n.offsetParent, i = s instanceof HTMLElement && s.offsetWidth || 0, r = this.props.sizeRef.current; r.height = n.offsetHeight || 0, r.width = n.offsetWidth || 0, r.top = n.offsetTop, r.left = n.offsetLeft, r.right = i - r.width - r.left; } return null; } /** * Required with getSnapshotBeforeUpdate to stop React complaining. */ componentDidUpdate() { } render() { return this.props.children; } } function Xo({ children: t, isPresent: e, anchorX: n }) { const s = We(), i = z(null), r = z({ width: 0, height: 0, top: 0, left: 0, right: 0 }), { nonce: o } = F(Ye); return Xs(() => { const { width: a, height: l, top: u, left: c, right: h } = r.current; if (e || !i.current || !a || !l) return; const f = n === "left" ? `left: ${c}` : `right: ${h}`; i.current.dataset.motionPopId = s; const d = document.createElement("style"); return o && (d.nonce = o), document.head.appendChild(d), d.sheet && d.sheet.insertRule(` [data-motion-pop-id="${s}"] { position: absolute !important; width: ${a}px !important; height: ${l}px !important; ${f}px !important; top: ${u}px !important; } `), () => { document.head.removeChild(d); }; }, [e]), V(Yo, { isPresent: e, childRef: i, sizeRef: r, children: Bt.cloneElement(t, { ref: i }) }); } const qo = ({ children: t, initial: e, isPresent: n, onExitComplete: s, custom: i, presenceAffectsLayout: r, mode: o, anchorX: a }) => { const l = He(Zo), u = We(), c = et((f) => { l.set(f, !0); for (const d of l.values()) if (!d) return; s && s(); }, [l, s]), h = B( () => ({ id: u, initial: e, isPresent: n, custom: i, onExitComplete: c, register: (f) => (l.set(f, !1), () => l.delete(f)) }), /** * If the presence of a child affects the layout of the components around it, * we want to make a new context value to ensure they get re-rendered * so they can detect that layout change. */ r ? [Math.random(), c] : [n, c] ); return B(() => { l.forEach((f, d) => l.set(d, !1)); }, [n]), Bt.useEffect(() => { !n && !l.size && s && s(); }, [n]), o === "popLayout" && (t = V(Xo, { isPresent: n, anchorX: a, children: t })), V(ce.Provider, { value: h, children: t }); }; function Zo() { return /* @__PURE__ */ new Map(); } function Js(t = !0) { const e = F(ce); if (e === null) return [!0, null]; const { isPresent: n, onExitComplete: s, register: i } = e, r = We(); Z(() => { if (t) return i(r); }, [t]); const o = et(() => t && s && s(r), [r, s, t]); return !n && s ? [!1, o] : [!0]; } const Xt = (t) => t.key || ""; function Dn(t) { const e = []; return Mo.forEach(t, (n) => { Ro(n) && e.push(n); }), e; } const Xe = typeof window < "u", Qs = Xe ? Lo : Z, Jo = ({ children: t, custom: e, initial: n = !0, onExitComplete: s, presenceAffectsLayout: i = !0, mode: r = "sync", propagate: o = !1, anchorX: a = "left" }) => { const [l, u] = Js(o), c = B(() => Dn(t), [t]), h = o && !l ? [] : c.map(Xt), f = z(!0), d = z(c), m = He(() => /* @__PURE__ */ new Map()), [p, v] = se(c), [g, y] = se(c); Qs(() => { f.current = !1, d.current = c; for (let x = 0; x < g.length; x++) { const S = Xt(g[x]); h.includes(S) ? m.delete(S) : m.get(S) !== !0 && m.set(S, !1); } }, [g, h.length, h.join("-")]); const T = []; if (c !== p) { let x = [...c]; for (let S = 0; S < g.length; S++) { const w = g[S], b = Xt(w); h.includes(b) || (x.splice(S, 0, w), T.push(w)); } return r === "wait" && T.length && (x = T), y(Dn(x)), v(c), null; } process.env.NODE_ENV !== "production" && r === "wait" && g.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); const { forceRender: A } = F(ze); return V(Ys, { children: g.map((x) => { const S = Xt(x), w = o && !l ? !1 : c === g || h.includes(S), b = () => { if (m.has(S)) m.set(S, !0); else return; let D = !0; m.forEach((L) => { L || (D = !1); }), D && (A == null || A(), y(d.current), o && (u == null || u()), s && s()); }; return V(qo, { isPresent: w, initial: !f.current || n ? void 0 : !1, custom: e, presenceAffectsLayout: i, mode: r, onExitComplete: w ? void 0 : b, anchorX: a, children: x }, S); }) }); }, U = /* @__NO_SIDE_EFFECTS__ */ (t) => t; let bt = U, nt = U; process.env.NODE_ENV !== "production" && (bt = (t, e) => { !t && typeof console < "u" && console.warn(e); }, nt = (t, e) => { if (!t) throw new Error(e); }); const Qo = { useManualTiming: !1 }, qt = [ "read", // Read "resolveKeyframes", // Write/Read/Write/Read "update", // Compute "preRender", // Compute "render", // Write "postRender" // Compute ], En = { value: null }; function tr(t, e) { let n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), i = !1, r = !1; const o = /* @__PURE__ */ new WeakSet(); let a = { delta: 0, timestamp: 0, isProcessing: !1 }, l = 0; function u(h) { o.has(h) && (c.schedule(h), t()), l++, h(a); } const c = { /** * Schedule a process to run on the next frame. */ schedule: (h, f = !1, d = !1) => { const p = d && i ? n : s; return f && o.add(h), p.has(h) || p.add(h), h; }, /** * Cancel the provided callback from running on the next frame. */ cancel: (h) => { s.delete(h), o.delete(h); }, /** * Execute all schedule callbacks. */ process: (h) => { if (a = h, i) { r = !0; return; } i = !0, [n, s] = [s, n], n.forEach(u), e && En.value && En.value.frameloop[e].push(l), l = 0, n.clear(), i = !1, r && (r = !1, c.process(h)); } }; return c; } const er = 40; function ti(t, e) { let n = !1, s = !0; const i = { delta: 0, timestamp: 0, isProcessing: !1 }, r = () => n = !0, o = qt.reduce((g, y) => (g[y] = tr(r, e ? y : void 0), g), {}), { read: a, resolveKeyframes: l, update: u, preRender: c, render: h, postRender: f } = o, d = () => { const g = performance.now(); n = !1, i.delta = s ? 1e3 / 60 : Math.max(Math.min(g - i.timestamp, er), 1), i.timestamp = g, i.isProcessing = !0, a.process(i), l.process(i), u.process(i), c.process(i), h.process(i), f.process(i), i.isProcessing = !1, n && e && (s = !1, t(d)); }, m = () => { n = !0, s = !0, i.isProcessing || t(d); }; return { schedule: qt.reduce((g, y) => { const T = o[y]; return g[y] = (A, x = !1, S = !1) => (n || m(), T.schedule(A, x, S)), g; }, {}), cancel: (g) => { for (let y = 0; y < qt.length; y++) o[qt[y]].cancel(g); }, state: i, steps: o }; } const { schedule: C, cancel: st, state: I, steps: ye } = ti(typeof requestAnimationFrame < "u" ? requestAnimationFrame : U, !0), ei = St({ strict: !1 }), Mn = { animation: [ "animate", "variants", "whileHover", "whileTap", "exit", "whileInView", "whileFocus", "whileDrag" ], exit: ["exit"], drag: ["drag", "dragControls"], focus: ["whileFocus"], hover: ["whileHover", "onHoverStart", "onHoverEnd"], tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], inView: ["whileInView", "onViewportEnter", "onViewportLeave"], layout: ["layout", "layoutId"] }, Tt = {}; for (const t in Mn) Tt[t] = { isEnabled: (e) => Mn[t].some((n) => !!e[n]) }; function nr(t) { for (const e in t) Tt[e] = { ...Tt[e], ...t[e] }; } const sr = /* @__PURE__ */ new Set([ "animate", "exit", "variants", "initial", "style", "values", "variants", "transition", "transformTemplate", "custom", "inherit", "onBeforeLayoutMeasure", "onAnimationStart", "onAnimationComplete", "onUpdate", "onDragStart", "onDrag", "onDragEnd", "onMeasureDragConstraints", "onDirectionLock", "onDragTransitionEnd", "_dragX", "_dragY", "onHoverStart", "onHoverEnd", "onViewportEnter", "onViewportLeave", "globalTapTarget", "ignoreStrict", "viewport" ]); function ie(t) { return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || sr.has(t); } let ni = (t) => !ie(t); function ir(t) { t && (ni = (e) => e.startsWith("on") ? !ie(e) : t(e)); } try { ir(require("@emotion/is-prop-valid").default); } catch { } function or(t, e, n) { const s = {}; for (const i in t) i === "values" && typeof t.values == "object" || (ni(i) || n === !0 && ie(i) || !e && !ie(i) || // If trying to use native HTML drag events, forward drag listeners t.draggable && i.startsWith("onDrag")) && (s[i] = t[i]); return s; } const Rn = /* @__PURE__ */ new Set(); function ue(t, e, n) { t || Rn.has(e) || (console.warn(e), Rn.add(e)); } function rr(t) { if (typeof Proxy > "u") return t; const e = /* @__PURE__ */ new Map(), n = (...s) => (process.env.NODE_ENV !== "production" && ue(!1, "motion() is deprecated. Use motion.create() instead."), t(...s)); return new Proxy(n, { /** * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. * The prop name is passed through as `key` and we can use that to generate a `motion` * DOM component with that name. */ get: (s, i) => i === "create" ? t : (e.has(i) || e.set(i, t(i)), e.get(i)) }); } const he = /* @__PURE__ */ St({}); function fe(t) { return t !== null && typeof t == "object" && typeof t.start == "function"; } function kt(t) { return typeof t == "string" || Array.isArray(t); } const qe = [ "animate", "whileInView", "whileFocus", "whileHover", "whileTap", "whileDrag", "exit" ], Ze = ["initial", ...qe]; function de(t) { return fe(t.animate) || Ze.some((e) => kt(t[e])); } function si(t) { return !!(de(t) || t.variants); } function ar(t, e) { if (de(t)) { const { initial: n, animate: s } = t; return { initial: n === !1 || kt(n) ? n : void 0, animate: kt(s) ? s : void 0 }; } return t.inherit !== !1 ? e : {}; } function lr(t) { const { initial: e, animate: n } = ar(t, F(he)); return B(() => ({ initial: e, animate: n }), [Ln(e), Ln(n)]); } function Ln(t) { return Array.isArray(t) ? t.join(" ") : t; } const cr = Symbol.for("motionComponentSymbol"); function dt(t) { return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current"); } function ur(t, e, n) { return et( (s) => { s && t.onMount && t.onMount(s), e && (s ? e.mount(s) : e.unmount()), n && (typeof n == "function" ? n(s) : dt(n) && (n.current = s)); }, /** * Only pass a new ref callback to React if we've received a visual element * factory. Otherwise we'll be mounting/remounting every time externalRef * or other dependencies change. */ [e] ); } const Je = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), hr = "framerAppearId", ii = "data-" + Je(hr), { schedule: Qe } = ti(queueMicrotask, !1), oi = St({}); function fr(t, e, n, s, i) { var r, o; const { visualElement: a } = F(he), l = F(ei), u = F(ce), c = F(Ye).reducedMotion, h = z(null); s = s || l.renderer, !h.current && s && (h.current = s(t, { visualState: e, parent: a, props: n, presenceContext: u, blockInitialAnimation: u ? u.initial === !1 : !1, reducedMotionConfig: c })); const f = h.current, d = F(oi); f && !f.projection && i && (f.type === "html" || f.type === "svg") && dr(h.current, n, i, d); const m = z(!1); Xs(() => { f && m.current && f.update(n, u); }); const p = n[ii], v = z(!!p && !(!((r = window.MotionHandoffIsComplete) === null || r === void 0) && r.call(window, p)) && ((o = window.MotionHasOptimisedAnimation) === null || o === void 0 ? void 0 : o.call(window, p))); return Qs(() => { f && (m.current = !0, window.MotionIsMounted = !0, f.updateFeatures(), Qe.render(f.render), v.current && f.animationState && f.animationState.animateChanges()); }), Z(() => { f && (!v.current && f.animationState && f.animationState.animateChanges(), v.current && (queueMicrotask(() => { var g; (g = window.MotionHandoffMarkAsComplete) === null || g === void 0 || g.call(window, p); }), v.current = !1)); }), f; } function dr(t, e, n, s) { const { layoutId: i, layout: r, drag: o, dragConstraints: a, layoutScroll: l, layoutRoot: u } = e; t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : ri(t.parent)), t.projection.setOptions({ layoutId: i, layout: r, alwaysMeasureLayout: !!o || a && dt(a), visualElement: t, /** * TODO: Update options in an effect. This could be tricky as it'll be too late * to update by the time layout animations run. * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, * ensuring it gets called if there's no potential layout animations. * */ animationType: typeof r == "string" ? r : "both", initialPromotionConfig: s, layoutScroll: l, layoutRoot: u }); } function ri(t) { if (t) return t.options.allowProjection !== !1 ? t.projection : ri(t.parent); } function mr({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: s, Component: i }) { var r, o; t && nr(t); function a(u, c) { let h; const f = { ...F(Ye), ...u, layoutId: pr(u) }, { isStatic: d } = f, m = lr(u), p = s(u, d); if (!d && Xe) { gr(f, t); const v = yr(f); h = v.MeasureLayout, m.visualElement = fr(i, p, f, e, v.ProjectionNode); } return Ft(he.Provider, { value: m, children: [h && m.visualElement ? V(h, { visualElement: m.visualElement, ...f }) : null, n(i, u, ur(p, m.visualElement, c), p, d, m.visualElement)] }); } a.displayName = `motion.${typeof i == "string" ? i : `create(${(o = (r = i.displayName) !== null && r !== void 0 ? r : i.name) !== null && o !== void 0 ? o : ""})`}`; const l = Io(a); return l[cr] = i, l; } function pr({ layoutId: t }) { const e = F(ze).id; return e && t !== void 0 ? e + "-" + t : t; } function gr(t, e) { const n = F(ei).strict; if (process.env.NODE_ENV !== "production" && e && n) { const s = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; t.ignoreStrict ? bt(!1, s) : nt(!1, s); } } function yr(t) { const { drag: e, layout: n } = Tt; if (!e && !n) return {}; const s = { ...e, ...n }; return { MeasureLayout: e != null && e.isEnabled(t) || n != null && n.isEnabled(t) ? s.MeasureLayout : void 0, ProjectionNode: s.ProjectionNode }; } const ai = (t) => (e) => typeof e == "string" && e.startsWith(t), tn = /* @__PURE__ */ ai("--"), vr = /* @__PURE__ */ ai("var(--"), en = (t) => vr(t) ? Tr.test(t.split("/*")[0].trim()) : !1, Tr = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, Nt = {}; function xr(t) { for (const e in t) Nt[e] = t[e], tn(e) && (Nt[e].isCSSVariable = !0); } const At = [ "transformPerspective", "x", "y", "z", "translateX", "translateY", "translateZ", "scale", "scaleX", "scaleY", "rotate", "rotateX", "rotateY", "rotateZ", "skew", "skewX", "skewY" ], ht = new Set(At); function li(t, { layout: e, layoutId: n }) { return ht.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Nt[t] || t === "opacity"); } const k = (t) => !!(t && t.getVelocity), ci = (t, e) => e && typeof t == "number" ? e.transform(t) : t, Q = (t, e, n) => n > e ? e : n < t ? t : n, wt = { test: (t) => typeof t == "number", parse: parseFloat, transform: (t) => t }, jt = { ...wt, transform: (t) => Q(0, 1, t) }, Zt = { ...wt, default: 1 }, Wt = (t) => ({ test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1, parse: parseFloat, transform: (e) => `${e}${t}` }), tt = /* @__PURE__ */ Wt("deg"), H = /* @__PURE__ */ Wt("%"), P = /* @__PURE__ */ Wt("px"), Pr = /* @__PURE__ */ Wt("vh"), Sr = /* @__PURE__ */ Wt("vw"), In = { ...H, parse: (t) => H.parse(t) / 100, transform: (t) => H.transform(t * 100) }, br = { // Border props borderWidth: P, borderTopWidth: P, borderRightWidth: P, borderBottomWidth: P, borderLeftWidth: P, borderRadius: P, radius: P, borderTopLeftRadius: P, borderTopRightRadius: P, borderBottomRightRadius: P, borderBottomLeftRadius: P, // Positioning props width: P, maxWidth: P, height: P, maxHeight: P, top: P, right: P, bottom: P, left: P, // Spacing props padding: P, paddingTop: P, paddingRight: P, paddingBottom: P, paddingLeft: P, margin: P, marginTop: P, marginRight: P, marginBottom: P, marginLeft: P, // Misc backgroundPositionX: P, backgroundPositionY: P }, Ar = { rotate: tt, rotateX: tt, rotateY: tt, rotateZ: tt, scale: Zt, scaleX: Zt, scaleY: Zt, scaleZ: Zt, skew: tt, skewX: tt, skewY: tt, distance: P, translateX: P, translateY: P, translateZ: P, x: P, y: P, z: P, perspective: P, transformPerspective: P, opacity: jt, originX: In, originY: In, originZ: P }, On = { ...wt, transform: Math.round }, nn = { ...br, ...Ar, zIndex: On, size: P, // SVG fillOpacity: jt, strokeOpacity: jt, numOctaves: On }, wr = { x: "translateX", y: "translateY", z: "translateZ", transformPerspective: "perspective" }, Cr = At.length; function Vr(t, e, n) { let s = "", i = !0; for (let r = 0; r < Cr; r++) { const o = At[r], a = t[o]; if (a === void 0) continue; let l = !0; if (typeof a == "number" ? l = a === (o.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) { const u = ci(a, nn[o]); if (!l) { i = !1; const c = wr[o] || o; s += `${c}(${u}) `; } n && (e[o] = u); } } return s = s.trim(), n ? s = n(e, i ? "" : s) : i && (s = "none"), s; } function sn(t, e, n) { const { style: s, vars: i, transformOrigin: r } = t; let o = !1, a = !1; for (const l in e) { const u = e[l]; if (ht.has(l)) { o = !0; continue; } else if (tn(l)) { i[l] = u; continue; } else { const c = ci(u, nn[l]); l.startsWith("origin") ? (a = !0, r[l] = c) : s[l] = c; } } if (e.transform || (o || n ? s.transform = Vr(e, t.transform, n) : s.transform && (s.transform = "none")), a) { const { originX: l = "50%", originY: u = "50%", originZ: c = 0 } = r; s.transformOrigin = `${l} ${u} ${c}`; } } const on = () => ({ style: {}, transform: {}, transformOrigin: {}, vars: {} }); function ui(t, e, n) { for (const s in e) !k(e[s]) && !li(s, n) && (t[s] = e[s]); } function Dr({ transformTemplate: t }, e) { return B(() => { const n = on(); return sn(n, e, t), Object.assign({}, n.vars, n.style); }, [e]); } function Er(t, e) { const n = t.style || {}, s = {}; return ui(s, n, t), Object.assign(s, Dr(t, e)), s; } function Mr(t, e) { const n = {}, s = Er(t, e); return t.drag && t.dragListener !== !1 && (n.draggable = !1, s.userSelect = s.WebkitUserSelect = s.WebkitTouchCallout = "none", s.touchAction = t.drag === !0 ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = s, n; } const Rr = [ "animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "switch", "symbol", "svg", "text", "tspan", "use", "view" ]; function rn(t) { return ( /** * If it's not a string, it's a custom React component. Currently we only support * HTML custom React components. */ typeof t != "string" || /** * If it contains a dash, the element is a custom HTML webcomponent. */ t.includes("-") ? !1 : ( /** * If it's in our list of lowercase SVG tags, it's an SVG component */ !!(Rr.indexOf(t) > -1 || /** * If it contains a capital letter, it's an SVG component */ /[A-Z]/u.test(t)) ) ); } const Lr = { offset: "stroke-dashoffset", array: "stroke-dasharray" }, Ir = { offset: "strokeDashoffset", array: "strokeDasharray" }; function Or(t, e, n = 1, s = 0, i = !0) { t.pathLength = 1; const r = i ? Lr : Ir; t[r.offset] = P.transform(-s); const o = P.transform(e), a = P.transform(n); t[r.array] = `${o} ${a}`; } function Fn(t, e, n) { return typeof t == "string" ? t : P.transform(e + n * t); } function Fr(t, e, n) { const s = Fn(e, t.x, t.width), i = Fn(n, t.y, t.height); return `${s} ${i}`; } function an(t, { attrX: e, attrY: n, attrScale: s, originX: i, originY: r, pathLength: o, pathSpacing: a = 1, pathOffset: l = 0, // This is object creation, which we try to avoid per-frame. ...u }, c, h) { if (sn(t, u, h), c) { t.style.viewBox && (t.attrs.viewBox = t.style.viewBox); return; } t.attrs = t.style, t.style = {}; const { attrs: f, style: d, dimensions: m } = t; f.transform && (m && (d.transform = f.transform), delete f.transform), m && (i !== void 0 || r !== void 0 || d.transform) && (d.transformOrigin = Fr(m, i !== void 0 ? i : 0.5, r !== void 0 ? r : 0.5)), e !== void 0 && (f.x = e), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), o !== void 0 && Or(f, o, a, l, !1); } const hi = () => ({ ...on(), attrs: {} }), ln = (t) => typeof t == "string" && t.toLowerCase() === "svg"; function Br(t, e, n, s) { const i = B(() => { const r = hi(); return an(r, e, ln(s), t.transformTemplate), { ...r.attrs, style: { ...r.style } }; }, [e]); if (t.style) { const r = {}; ui(r, t.style, t), i.style = { ...r, ...i.style }; } return i; } function kr(t = !1) { return (n, s, i, { latestValues: r }, o) => { const l = (rn(n) ? Br : Mr)(s, r, o, n), u = or(s, typeof n == "string", t), c = n !== qs ? { ...u, ...l, ref: i } : {}, { children: h } = s, f = B(() => k(h) ? h.get() : h, [h]); return Oo(n, { ...c, children: f }); }; } function Bn(t) { const e = [{}, {}]; return t == null || t.values.forEach((n, s) => { e[0][s] = n.get(), e[1][s] = n.getVelocity(); }), e; } function cn(t, e, n, s) { if (typeof e == "function") { const [i, r] = Bn(s); e = e(n !== void 0 ? n : t.custom, i, r); } if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") { const [i, r] = Bn(s); e = e(n !== void 0 ? n : t.custom, i, r); } return e; } const Ee = (t) => Array.isArray(t), Nr = (t) => !!(t && typeof t == "object" && t.mix && t.toValue), jr = (t) => Ee(t) ? t[t.length - 1] || 0 : t; function te(t) { const e = k(t) ? t.get() : t; return Nr(e) ? e.toValue() : e; } function _r({ scrapeMotionValuesFromProps: t, createRenderState: e, onUpdate: n }, s, i, r) { const o = { latestValues: Ur(s, i, r, t), renderState: e() }; return n && (o.onMount = (a) => n({ props: s, current: a, ...o }), o.onUpdate = (a) => n(a)), o; } const fi = (t) => (e, n) => { const s = F(he), i = F(ce), r = () => _r(t, e, s, i); return n ? r() : He(r); }; function Ur(t, e, n, s) { const i = {}, r = s(t, {}); for (const f in r) i[f] = te(r[f]); let { initial: o, animate: a } = t; const l = de(t), u = si(t); e && u && !l && t.inherit !== !1 && (o === void 0 && (o = e.initial), a === void 0 && (a = e.animate)); let c = n ? n.initial === !1 : !1; c = c || o === !1; const h = c ? a : o; if (h && typeof h != "boolean" && !fe(h)) { const f = Array.isArray(h) ? h : [h]; for (let d = 0; d < f.length; d++) { const m = cn(t, f[d]); if (m) { const { transitionEnd: p, transition: v, ...g } = m; for (const y in g) { let T = g[y]; if (Array.isArray(T)) { const A = c ? T.length - 1 : 0; T = T[A]; } T !== null && (i[y] = T); } for (const y in p) i[y] = p[y]; } } } return i; } function un(t, e, n) { var s; const { style: i } = t, r = {}; for (const o in i) (k(i[o]) || e.style && k(e.style[o]) || li(o, t) || ((s = n == null ? void 0 : n.getValue(o)) === null || s === void 0 ? void 0 : s.liveStyle) !== void 0) && (r[o] = i[o]); return r; } const Kr = { useVisualState: fi({ scrapeMotionValuesFromProps: un, createRenderState: on }) }; function di(t, e) { try { e.dimensions = typeof t.getBBox == "function" ? t.getBBox() : t.getBoundingClientRect(); } catch { e.dimensions = { x: 0, y: 0, width: 0, height: 0 }; } } function mi(t, { style: e, vars: n }, s, i) { Object.assign(t.style, e, i && i.getProjectionStyles(s)); for (const r in n) t.style.setProperty(r, n[r]); } const pi = /* @__PURE__ */ new Set([ "baseFrequency", "diffuseConstant", "kernelMatrix", "kernelUnitLength", "keySplines", "keyTimes", "limitingConeAngle", "markerHeight", "markerWidth", "numOctaves", "targetX", "targetY", "surfaceScale", "specularConstant", "specularExponent", "stdDeviation", "tableValues", "viewBox", "gradientTransform", "pathLength", "startOffset", "textLength", "lengthAdjust" ]); function gi(t, e, n, s) { mi(t, e, void 0, s); for (const i in e.attrs) t.setAttribute(pi.has(i) ? i : Je(i), e.attrs[i]); } function yi(t, e, n) { const s = un(t, e, n); for (const i in t) if (k(t[i]) || k(e[i])) { const r = At.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i; s[r] = t[i]; } return s; } const kn = ["x", "y", "width", "height", "cx", "cy", "r"], $r = { useVisualState: fi({ scrapeMotionValuesFromProps: yi, createRenderState: hi, onUpdate: ({ props: t, prevProps: e, current: n, renderState: s, latestValues: i }) => { if (!n) return; let r = !!t.drag; if (!r) { for (const a in i) if (ht.has(a)) { r = !0; break; } } if (!r) return; let o = !e; if (e) for (let a = 0; a < kn.length; a++) { const l = kn[a]; t[l] !== e[l] && (o = !0); } o && C.read(() => { di(n, s), C.render(() => { an(s, i, ln(n.tagName), t.transformTemplate), gi(n, s); }); }); } }) }; function Gr(t, e) { return function(s, { forwardMotionProps: i } = { forwardMotionProps: !1 }) { const o = { ...rn(s) ? $r : Kr, preloadedFeatures: t, useRender: kr(i), createVisualElement: e, Component: s }; return mr(o); }; } function _t(t, e, n) { const s = t.getProps(); return cn(s, e, n !== void 0 ? n : s.custom, t); } function hn(t, e) { return t ? t[e] || t.default || t : void 0; } const vi = /* @__PURE__ */ new Set([ "width", "height", "top", "left", "right", "bottom", ...At ]); let ee; function Wr() { ee = void 0; } const Y = { now: () => (ee === void 0 && Y.set(I.isProcessing || Qo.useManualTiming ? I.timestamp : performance.now()), ee), set: (t) => { ee = t, queueMicrotask(Wr); } }; function fn(t, e) { t.indexOf(e) === -1 && t.push(e); } function dn(t, e) { const n = t.indexOf(e); n > -1 && t.splice(n, 1); } class mn { constructor() { this.subscriptions = []; } add(e) { return fn(this.subscriptions, e), () => dn(this.subscriptions, e); } notify(e, n, s) { const i = this.subscriptions.length; if (i) if (i === 1) this.subscriptions[0](e, n, s); else for (let r = 0; r < i; r++) { const o = this.subscriptions[r]; o && o(e, n, s); } } getSize() { return this.subscriptions.length; } clear() { this.subscriptions.length = 0; } } function Ti(t, e) { return e ? t * (1e3 / e) : 0; } const Nn = 30, zr = (t) => !isNaN(parseFloat(t)); class Hr { /** * @param init - The initiating value * @param config - Optional configuration options * * - `transformer`: A function to transform incoming values with. * * @internal */ constructor(e, n = {}) { this.version = "12.4.10", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s, i = !0) => { const r = Y.now(); this.updatedAt !== r && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), i && this.events.renderRequest && this.events.renderRequest.notify(this.current); }, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner; } setCurrent(e) { this.current = e, this.updatedAt = Y.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = zr(this.current)); } setPrevFrameValue(e = this.current) { this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt; } /** * Adds a function that will be notified when the `MotionValue` is updated. * * It returns a function that, when called, will cancel the subscription. * * When calling `onChange` inside a React component, it should be wrapped with the * `useEffect` hook. As it returns an unsubscribe function, this should be returned * from the `useEffect` function to ensure you don't add duplicate subscribers.. * * ```jsx * export const MyComponent = () => { * const x = useMotionValue(0) * const y = useMotionValue(0) * const opacity = useMotionValue(1) * * useEffect(() => { * function updateOpacity() { * const maxXY = Math.max(x.get(), y.get()) * const newOpacity = transform(maxXY, [0, 100], [1, 0]) * opacity.set(newOpacity) * } * * const unsubscribeX = x.on("change", updateOpacity) * const unsubscribeY = y.on("change", updateOpacity) * * return () => { * unsubscribeX() * unsubscribeY() * } * }, []) * * return <motion.div style={{ x }} /> * } * ``` * * @param subscriber - A function that receives the latest value. * @returns A function that, when called, will cancel this subscription. * * @deprecated */ onChange(e) { return process.env.NODE_ENV !== "production" && ue(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e); } on(e, n) { this.events[e] || (this.events[e] = new mn()); const s = this.events[e].add(n); return e === "change" ? () => { s(), C.read(() => { this.events.change.getSize() || this.stop(); }); } : s; } clearListeners() { for (const e in this.events) this.events[e].clear(); } /** * Attaches a passive effect to the `MotionValue`. * * @internal */ attach(e, n) { this.passiveEffect = e, this.stopPassiveEffect = n; } /** * Sets the state of the `MotionValue`. * * @remarks * * ```jsx * const x = useMotionValue(0) * x.set(10) * ``` * * @param latest - Latest value to set. * @param render - Whether to notify render subscribers. Defaults to `true` * * @public */ set(e, n = !0) { !n || !this.passiveEffect ? this.updateAndNotify(e, n) : this.passiveEffect(e, this.updateAndNotify); } setWithVelocity(e, n, s) { this.set(n), this.prev = void 0, this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt - s; } /** * Set the state of the `MotionValue`, stopping any active animations, * effects, and resets velocity to `0`. */ jump(e, n = !0) { this.updateAndNotify(e), this.prev = e, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect(); } /** * Returns the latest state of `MotionValue` * * @returns - The latest state of `MotionValue` * * @public */ get() { return this.current; } /** * @public */ getPrevious() { return this.prev; } /** * Returns the latest velocity of `MotionValue` * * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. * * @public */ getVelocity() { const e = Y.now(); if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Nn) return 0; const n = Math.min(this.updatedAt - this.prevUpdatedAt, Nn); return Ti(parseFloat(this.current) - parseFloat(this.prevFrameValue), n); } /** * Registers a new animation to control this `MotionValue`. Only one * animation can drive a `MotionValue` at one time. * * ```jsx * value.start() * ``` * * @param animation - A function that starts the provided animation * * @internal */ start(e) { return this.stop(), new Promise((n) => { this.hasAnimated = !0, this.animation = e(n), this.events.animationStart && this.events.animationStart.notify(); }).then(() => { this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation(); }); } /** * Stop the currently active animation. * * @public */ stop() { this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation(); } /** * Returns `true` if this value is currently animating. * * @public */ isAnimating() { return !!this.animation; } clearAnimation() { delete this.animation; } /** * Destroy and clean up subscribers to this `MotionValue`. * * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually * created a `MotionValue` via the `motionValue` function. * * @public */ destroy() { this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect(); } } function Ut(t, e) { return new Hr(t, e); } function Yr(t, e, n) { t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, Ut(n)); } function Xr(t, e) { const n = _t(t, e); let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {}; r = { ...r, ...s }; for (const o in r) { const a = jr(r[o]); Yr(t, o, a); } } function qr(t) { return !!(k(t) && t.add); } function Me(t, e) { const n = t.getValue("willChange"); if (qr(n)) return n.add(e); } function xi(t) { return t.props[ii]; } // @__NO_SIDE_EFFECTS__ function pn(t) { let e; return () => (e === void 0 && (e = t()), e); } const Zr = /* @__PURE__ */ pn(() => window.ScrollTimeline !== void 0); class Jr { constructor(e) { this.stop = () => this.runAll("stop"), this.animations = e.filter(Boolean); } get finished() { return Promise.all(this.animations.map((e) => "finished" in e ? e.finished : e)); } /** * TODO: Filter out cancelled or stopped animations before returning */ getAll(e) { return this.animations[0][e]; } setAll(e, n) { for (let s = 0; s < this.animations.length; s++) this.animations[s][e] = n; } attachTimeline(e, n) { const s = this.animations.map((i) => { if (Zr() && i.attachTimeline) return i.attachTimeline(e); if (typeof n == "function") return n(i); }); return () => { s.forEach((i, r) => { i && i(), this.animations[r].stop(); }); }; } get time() { return this.getAll("time"); } set time(e) { this.setAll("time", e); } get speed() { return this.getAll("speed"); } set speed(e) { this.setAll("speed", e); } get startTime() { return this.getAll("startTime"); } get duration() { let e = 0; for (let n = 0; n < this.animations.length; n++) e = Math.max(e, this.animations[n].duration); return e; } runAll(e) { this.animations.forEach((n) => n[e]()); } flatten() { this.runAll("flatten"); } play() { this.runAll("play"); } pause() { this.runAll("pause"); } cancel() { this.runAll("cancel"); } complete() { this.runAll("complete"); } } class Qr extends Jr { then(e, n) { return Promise.all(this.animations).then(e).catch(n); } } const X = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, J = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3; function gn(t) { return typeof t == "function"; } function jn(t, e) { t.timeline = e, t.onfinish = null; } const yn = (t) => Array.isArray(t) && typeof t[0] == "number", ta = { linearEasing: void 0 }; function ea(t, e) { const n = /* @__PURE__ */ pn(t); return () => { var s; return (s = ta[e]) !== null && s !== void 0 ? s : n(); }; } const oe = /* @__PURE__ */ ea(() => { try { document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" }); } catch { return !1; } return !0; }, "linearEasing"), xt = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => { const s = e - t; return s === 0 ? 1 : (n - t) / s; }, Pi = (t, e, n = 10) => { let s = ""; const i = Math.max(Math.round(e / n), 2); for (let r = 0; r < i; r++) s += t(/* @__PURE__ */ xt(0, i - 1, r)) + ", "; return `linear(${s.substring(0, s.length - 2)})`; }; function Si(t) { return !!(typeof t == "function" && oe() || !t || typeof t == "string" && (t in Re || oe()) || yn(t) || Array.isArray(t) && t.every(Si)); } const Dt = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, Re = { linear: "linear", ease: "ease", easeIn: "ease-in", easeOut: "ease-out", easeInOut: "ease-in-out", circIn: /* @__PURE__ */ Dt([0, 0.65, 0.55, 1]), circOut: /* @__PURE__ */ Dt([0.55, 0, 1, 0.45]), backIn: /* @__PURE__ */ Dt([0.31, 0.01, 0.66, -0.59]), backOut: /* @__PURE__ */ Dt([0.33, 1.53, 0.69, 0.99]) }; function bi(t, e) { if (t) return typeof t == "function" && oe() ? Pi(t, e) : yn(t) ? Dt(t) : Array.isArray(t) ? t.map((n) => bi(n, e) || Re.easeOut) : Re[t]; } const Ai = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, na = 1e-7, sa = 12; function ia(t, e, n, s, i) { let r, o, a = 0; do o = e + (n - e) / 2, r = Ai(o, s, i) - t, r > 0 ? n = o : e = o; while (Math.abs(r) > na && ++a < sa); return o; } function zt(t, e, n, s) { if (t === e && n === s) return U; const i = (r) => ia(r, 0, 1, t, n); return (r) => r === 0 || r === 1 ? r : Ai(i(r), e, s); } const wi = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Ci = (t) => (e) => 1 - t(1 - e), Vi = /* @__PURE__ */ zt(0.33, 1.53, 0.69, 0.99), vn = /* @__PURE__ */ Ci(Vi), Di = /* @__PURE__ */ wi(vn), Ei = (t) => (t *= 2) < 1 ? 0.5 * vn(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), Tn = (t) => 1 - Math.sin(Math.acos(t)), Mi = Ci(Tn), Ri = wi(Tn), Li = (t) => /^0[^.\s]+$/u.test(t); function oa(t) { return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Li(t) : !0; } const Mt = (t) => Math.round(t * 1e5) / 1e5, xn = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; function ra(t) { return t == null; } const aa = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, Pn = (t, e) => (n) => !!(typeof n == "string" && aa.test(n) && n.startsWith(t) || e && !ra(n) && Object.prototype.hasOwnProperty.call(n, e)), Ii = (t, e, n) => (s) => { if (typeof s != "string") return s; const [i, r, o, a] = s.match(xn); return { [t]: parseFloat(i), [e]: parseFloat(r), [n]: parseFloat(o), alpha: a !== void 0 ? parseFloat(a) : 1 }; }, la = (t) => Q(0, 255, t), ve = { ...wt, transform: (t) => Math.round(la(t)) }, lt = { test: /* @__PURE__ */ Pn("rgb", "red"), parse: /* @__PURE__ */ Ii("red", "green", "blue"), transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + ve.transform(t) + ", " + ve.transform(e) + ", " + ve.transform(n) + ", " + Mt(jt.transform(s)) + ")" }; function ca(t) { let e = "", n = "", s = "", i = ""; return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), { red: parseInt(e, 16), green: parseInt(n, 16), blue: parseInt(s, 16), alpha: i ? parseInt(i, 16) / 255 : 1 }; } const Le = { test: /* @__PURE__ */ Pn("#"), parse: ca, transform: lt.transform }, mt = { test: /* @__PURE__ */ Pn("hsl", "hue"), parse: /* @__PURE__ */ Ii("hue", "saturation", "lightness"), transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + H.transform(Mt(e)) + ", " + H.transform(Mt(n)) + ", " + Mt(jt.transform(s)) + ")" }, O = { test: (t) => lt.test(t) || Le.test(t) || mt.test(t), parse: (t) => lt.test(t) ? lt.parse(t) : mt.test(t) ? mt.parse(t) : Le.parse(t), transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? lt.transform(t) : mt.transform(t) }, ua = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; function ha(t) { var e, n; return isNaN(t) && typeof t == "string" && (((e = t.match(xn)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(ua)) === null || n === void 0 ? void 0 : n.length) || 0) > 0; } const Oi = "number", Fi = "color", fa = "var", da = "var(", _n = "${}", ma = /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; function Kt(t) { const e = t.toString(), n = [], s = { color: [], number: [], var: [] }, i = []; let r = 0; const a = e.replace(ma, (l) => (O.test(l) ? (s.color.push(r), i.push(Fi), n.push(O.parse(l))) : l.startsWith(da) ? (s.var.push(r), i.push(fa), n.push(l)) : (s.number.push(r), i.push(Oi), n.push(parseFloat(l))), ++r, _n)).split(_n); return { values: n, split: a, indexes: s, types: i }; } function Bi(t) { return Kt(t).values; } function ki(t) { const { split: e, types: n } = Kt(t), s = e.length; return (i) => { let r = ""; for (let o = 0; o < s; o++) if (r += e[o], i[o] !== void 0) { const a = n[o]; a === Oi ? r += Mt(i[o]) : a === Fi ? r += O.transform(i[o]) : r += i[o]; } return r; }; } const pa = (t) => typeof t == "number" ? 0 : t; function ga(t) { const e = Bi(t); return ki(t)(e.map(pa)); } const it = { test: ha, parse: Bi, createTransformer: ki, getAnimatableNone: ga }, ya = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]); function va(t) { const [e, n] = t.slice(0, -1).split("("); if (e === "drop-shadow") return t; const [s] = n.match(xn) || []; if (!s) return t; const i = n.replace(s, ""); let r = ya.has(e) ? 1 : 0; return s !== n && (r *= 100), e + "(" + r + i + ")"; } const Ta = /\b([a-z-]*)\(.*?\)/gu, Ie = { ...it, getAnimatableNone: (t) => { const e = t.match(Ta); return e ? e.map(va).join(" ") : t; } }, xa = { ...nn, // Color props color: O, backgroundColor: O, outlineColor: O, fill: O, stroke: O, // Border props borderColor: O, borderTopColor: O, borderRightColor: O, borderBottomColor: O, borderLeftColor: O, filter: Ie, WebkitFilter: Ie }, Sn = (t) => xa[t]; function Ni(t, e) { let n = Sn(t); return n !== Ie && (n = it), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0; } const Pa = /* @__PURE__ */ new Set(["auto", "none", "0"]); function Sa(t, e, n) { let s = 0, i; for (; s < t.length && !i; ) { const r = t[s]; typeof r == "string" && !Pa.has(r) && Kt(r).values.length && (i = t[s]), s++; } if (i && n) for (const r of e) t[r] = Ni(n, i); } const Un = (t) => t === wt || t === P, Kn = (t, e) => parseFloat(t.split(", ")[e]), $n = (t, e) => (n, { transform: s }) => { if (s === "none" || !s) return 0; const i = s.match(/^matrix3d\((.+)\)$/u); if (i) return Kn(i[1], e); { const r = s.match(/^matrix\((.+)\)$/u); return r ? Kn(r[1], t) : 0; } }, ba = /* @__PURE__ */ new Set(["x", "y", "z"]), Aa = At.filter((t) => !ba.has(t)); function wa(t) { const e = []; return Aa.forEach((n) => { const s = t.getValue(n); s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0)); }), e; } const Pt = { // Dimensions width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n), height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n), top: (t, { top: e }) => parseFloat(e), left: (t, { left: e }) => parseFloat(e), bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min), right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min), // Transform x: $n(4, 13), y: $n(5, 14) }; Pt.translateX = Pt.x; Pt.translateY = Pt.y; const ct = /* @__PURE__ */ new Set(); let Oe = !1, Fe = !1; function ji() { if (Fe) { const t = Array.from(ct).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map(); e.forEach((s) => { const i = wa(s); i.length && (n.set(s, i), s.render()); }), t.forEach((s) => s.measureInitialState()), e.forEach((s) => { s.render(); const i = n.get(s); i && i.forEach(([r, o]) => { var a; (a = s.getValue(r)) === null || a === void 0 || a.set(o); }); }), t.forEach((s) => s.measureEndState()), t.forEach((s) => { s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY); }); } Fe = !1, Oe = !1, ct.forEach((t) => t.complete()), ct.clear(); } function _i() { ct.forEach((t) => { t.readKeyframes(), t.needsMeasurement && (Fe = !0); }); } function Ca() { _i(), ji(); } class bn { constructor(e, n, s, i, r, o = !1) { this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = o; } scheduleResolve() { this.isScheduled = !0, this.isAsync ? (ct.add(this), Oe || (Oe = !0, C.read(_i), C.resolveKeyframes(ji))) : (this.readKeyframes(), this.complete()); } readKeyframes() { const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this; for (let r = 0; r < e.length; r++) if (e[r] === null) if (r === 0) { const o = i == null ? void 0 : i.get(), a = e[e.length - 1]; if (o !== void 0) e[0] = o; else if (s && n) { const l = s.readValue(n, a); l != null && (e[0] = l); } e[0] === void 0 && (e[0] = a), i && o === void 0 && i.set(e[0]); } else e[r] = e[r - 1]; } setFinalKeyframe() { } measureInitialState() { } renderEndStyles() { } measureEndState() { } complete() { this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), ct.delete(this); } cancel() { this.isComplete || (this.isScheduled = !1, ct.delete(this)); } resume() { this.isComplete || this.scheduleResolve(); } } const Ui = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), Va = ( // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u ); function Da(t) { const e = Va.exec(t); if (!e) return [,]; const [, n, s, i] = e; return [`--${n ?? s}`, i]; } const Ea = 4; function Ki(t, e, n = 1) { nt(n <= Ea, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback depe