urbi-exhibitions
Version:
1,661 lines • 183 kB
JavaScript
import { jsx as D, Fragment as ei, jsxs as kt } from "react/jsx-runtime";
import * as Bt from "react";
import Bo, { memo as ht, useState as nt, useRef as K, useMemo as V, useEffect as $, createContext as At, useId as He, useContext as B, useInsertionEffect as ni, useCallback as F, Children as No, isValidElement as jo, useLayoutEffect as _o, forwardRef as Uo, Fragment as si, createElement as Ko, Component as $o } from "react";
import { c as Wt } from "../cn-BYe7EnTr.js";
import { u as Go, a as Wo } from "../geolocationContext-CrlpiBBb.js";
import { u as ii } from "../mapContext-C4SIZcBe.js";
import { d as Rn } from "../index-Brsqgp8S.js";
import { load as zo } from "@2gis/mapgl";
import { GltfPlugin as Ho } from "@2gis/mapgl-gltf";
import { i as Yo } from "../clientSW-DAQRhLqS.js";
const Xo = 500, qo = ht(
({ children: t, className: e }) => {
const [n, s] = nt(), i = K(void 0), r = V(() => {
if (n)
return t !== n ? "opacity-0 animate-fadeOut" : "opacity-1 animate-fadeIn";
}, [t, n]);
return $(() => {
if (clearTimeout(i.current), !n) {
s(t);
return;
}
t !== n && (i.current = setTimeout(() => {
s(t);
}, Xo));
}, [n, t]), /* @__PURE__ */ D("div", { className: Wt(r, e), children: n });
}
), Ye = At({});
function Xe(t) {
const e = K(null);
return e.current === null && (e.current = t()), e.current;
}
const ce = /* @__PURE__ */ At(null), qe = At({
transformPagePoint: (t) => t,
isStatic: !1,
reducedMotion: "never"
});
class Zo 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 Jo({ children: t, isPresent: e, anchorX: n }) {
const s = He(), i = K(null), r = K({
width: 0,
height: 0,
top: 0,
left: 0,
right: 0
}), { nonce: o } = B(qe);
return ni(() => {
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]), D(Zo, { 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 = Xe(tr), u = He(), c = F((f) => {
l.set(f, !0);
for (const d of l.values())
if (!d)
return;
s && s();
}, [l, s]), h = V(
() => ({
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 V(() => {
l.forEach((f, d) => l.set(d, !1));
}, [n]), Bt.useEffect(() => {
!n && !l.size && s && s();
}, [n]), o === "popLayout" && (t = D(Jo, { isPresent: n, anchorX: a, children: t })), D(ce.Provider, { value: h, children: t });
};
function tr() {
return /* @__PURE__ */ new Map();
}
function oi(t = !0) {
const e = B(ce);
if (e === null)
return [!0, null];
const { isPresent: n, onExitComplete: s, register: i } = e, r = He();
$(() => {
if (t)
return i(r);
}, [t]);
const o = F(() => t && s && s(r), [r, s, t]);
return !n && s ? [!1, o] : [!0];
}
const qt = (t) => t.key || "";
function Ln(t) {
const e = [];
return No.forEach(t, (n) => {
jo(n) && e.push(n);
}), e;
}
const Ze = typeof window < "u", ri = Ze ? _o : $, er = ({ children: t, custom: e, initial: n = !0, onExitComplete: s, presenceAffectsLayout: i = !0, mode: r = "sync", propagate: o = !1, anchorX: a = "left" }) => {
const [l, u] = oi(o), c = V(() => Ln(t), [t]), h = o && !l ? [] : c.map(qt), f = K(!0), d = K(c), m = Xe(() => /* @__PURE__ */ new Map()), [p, v] = nt(c), [g, y] = nt(c);
ri(() => {
f.current = !1, d.current = c;
for (let x = 0; x < g.length; x++) {
const S = qt(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], A = qt(w);
h.includes(A) || (x.splice(S, 0, w), T.push(w));
}
return r === "wait" && T.length && (x = T), y(Ln(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: b } = B(Ye);
return D(ei, { children: g.map((x) => {
const S = qt(x), w = o && !l ? !1 : c === g || h.includes(S), A = () => {
if (m.has(S))
m.set(S, !0);
else
return;
let E = !0;
m.forEach((I) => {
I || (E = !1);
}), E && (b == null || b(), y(d.current), o && (u == null || u()), s && s());
};
return D(Qo, { isPresent: w, initial: !f.current || n ? void 0 : !1, custom: e, presenceAffectsLayout: i, mode: r, onExitComplete: w ? void 0 : A, anchorX: a, children: x }, S);
}) });
}, G = /* @__NO_SIDE_EFFECTS__ */ (t) => t;
let bt = G, st = G;
process.env.NODE_ENV !== "production" && (bt = (t, e) => {
!t && typeof console < "u" && console.warn(e);
}, st = (t, e) => {
if (!t)
throw new Error(e);
});
const nr = {
useManualTiming: !1
}, Zt = [
"read",
// Read
"resolveKeyframes",
// Write/Read/Write/Read
"update",
// Compute
"preRender",
// Compute
"render",
// Write
"postRender"
// Compute
], In = {
value: null
};
function sr(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 && In.value && In.value.frameloop[e].push(l), l = 0, n.clear(), i = !1, r && (r = !1, c.process(h));
}
};
return c;
}
const ir = 40;
function ai(t, e) {
let n = !1, s = !0;
const i = {
delta: 0,
timestamp: 0,
isProcessing: !1
}, r = () => n = !0, o = Zt.reduce((g, y) => (g[y] = sr(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, ir), 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: Zt.reduce((g, y) => {
const T = o[y];
return g[y] = (b, x = !1, S = !1) => (n || m(), T.schedule(b, x, S)), g;
}, {}), cancel: (g) => {
for (let y = 0; y < Zt.length; y++)
o[Zt[y]].cancel(g);
}, state: i, steps: o };
}
const { schedule: C, cancel: it, state: O, steps: ye } = ai(typeof requestAnimationFrame < "u" ? requestAnimationFrame : G, !0), li = At({ strict: !1 }), Fn = {
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"]
}, xt = {};
for (const t in Fn)
xt[t] = {
isEnabled: (e) => Fn[t].some((n) => !!e[n])
};
function or(t) {
for (const e in t)
xt[e] = {
...xt[e],
...t[e]
};
}
const rr = /* @__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") || rr.has(t);
}
let ci = (t) => !ie(t);
function ar(t) {
t && (ci = (e) => e.startsWith("on") ? !ie(e) : t(e));
}
try {
ar(require("@emotion/is-prop-valid").default);
} catch {
}
function lr(t, e, n) {
const s = {};
for (const i in t)
i === "values" && typeof t.values == "object" || (ci(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 On = /* @__PURE__ */ new Set();
function ue(t, e, n) {
t || On.has(e) || (console.warn(e), On.add(e));
}
function cr(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__ */ At({});
function fe(t) {
return t !== null && typeof t == "object" && typeof t.start == "function";
}
function Nt(t) {
return typeof t == "string" || Array.isArray(t);
}
const Je = [
"animate",
"whileInView",
"whileFocus",
"whileHover",
"whileTap",
"whileDrag",
"exit"
], Qe = ["initial", ...Je];
function de(t) {
return fe(t.animate) || Qe.some((e) => Nt(t[e]));
}
function ui(t) {
return !!(de(t) || t.variants);
}
function ur(t, e) {
if (de(t)) {
const { initial: n, animate: s } = t;
return {
initial: n === !1 || Nt(n) ? n : void 0,
animate: Nt(s) ? s : void 0
};
}
return t.inherit !== !1 ? e : {};
}
function hr(t) {
const { initial: e, animate: n } = ur(t, B(he));
return V(() => ({ initial: e, animate: n }), [kn(e), kn(n)]);
}
function kn(t) {
return Array.isArray(t) ? t.join(" ") : t;
}
const fr = Symbol.for("motionComponentSymbol");
function mt(t) {
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
}
function dr(t, e, n) {
return F(
(s) => {
s && t.onMount && t.onMount(s), e && (s ? e.mount(s) : e.unmount()), n && (typeof n == "function" ? n(s) : mt(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 tn = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), mr = "framerAppearId", hi = "data-" + tn(mr), { schedule: en } = ai(queueMicrotask, !1), fi = At({});
function pr(t, e, n, s, i) {
var r, o;
const { visualElement: a } = B(he), l = B(li), u = B(ce), c = B(qe).reducedMotion, h = K(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 = B(fi);
f && !f.projection && i && (f.type === "html" || f.type === "svg") && gr(h.current, n, i, d);
const m = K(!1);
ni(() => {
f && m.current && f.update(n, u);
});
const p = n[hi], v = K(!!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 ri(() => {
f && (m.current = !0, window.MotionIsMounted = !0, f.updateFeatures(), en.render(f.render), v.current && f.animationState && f.animationState.animateChanges());
}), $(() => {
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 gr(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 : di(t.parent)), t.projection.setOptions({
layoutId: i,
layout: r,
alwaysMeasureLayout: !!o || a && mt(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 di(t) {
if (t)
return t.options.allowProjection !== !1 ? t.projection : di(t.parent);
}
function yr({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: s, Component: i }) {
var r, o;
t && or(t);
function a(u, c) {
let h;
const f = {
...B(qe),
...u,
layoutId: vr(u)
}, { isStatic: d } = f, m = hr(u), p = s(u, d);
if (!d && Ze) {
Tr(f, t);
const v = xr(f);
h = v.MeasureLayout, m.visualElement = pr(i, p, f, e, v.ProjectionNode);
}
return kt(he.Provider, { value: m, children: [h && m.visualElement ? D(h, { visualElement: m.visualElement, ...f }) : null, n(i, u, dr(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 = Uo(a);
return l[fr] = i, l;
}
function vr({ layoutId: t }) {
const e = B(Ye).id;
return e && t !== void 0 ? e + "-" + t : t;
}
function Tr(t, e) {
const n = B(li).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) : st(!1, s);
}
}
function xr(t) {
const { drag: e, layout: n } = xt;
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 mi = (t) => (e) => typeof e == "string" && e.startsWith(t), nn = /* @__PURE__ */ mi("--"), Pr = /* @__PURE__ */ mi("var(--"), sn = (t) => Pr(t) ? Sr.test(t.split("/*")[0].trim()) : !1, Sr = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, jt = {};
function Ar(t) {
for (const e in t)
jt[e] = t[e], nn(e) && (jt[e].isCSSVariable = !0);
}
const wt = [
"transformPerspective",
"x",
"y",
"z",
"translateX",
"translateY",
"translateZ",
"scale",
"scaleX",
"scaleY",
"rotate",
"rotateX",
"rotateY",
"rotateZ",
"skew",
"skewX",
"skewY"
], ft = new Set(wt);
function pi(t, { layout: e, layoutId: n }) {
return ft.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!jt[t] || t === "opacity");
}
const N = (t) => !!(t && t.getVelocity), gi = (t, e) => e && typeof t == "number" ? e.transform(t) : t, tt = (t, e, n) => n > e ? e : n < t ? t : n, Ct = {
test: (t) => typeof t == "number",
parse: parseFloat,
transform: (t) => t
}, _t = {
...Ct,
transform: (t) => tt(0, 1, t)
}, Jt = {
...Ct,
default: 1
}, zt = (t) => ({
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
parse: parseFloat,
transform: (e) => `${e}${t}`
}), et = /* @__PURE__ */ zt("deg"), X = /* @__PURE__ */ zt("%"), P = /* @__PURE__ */ zt("px"), br = /* @__PURE__ */ zt("vh"), wr = /* @__PURE__ */ zt("vw"), Bn = {
...X,
parse: (t) => X.parse(t) / 100,
transform: (t) => X.transform(t * 100)
}, Cr = {
// 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
}, Vr = {
rotate: et,
rotateX: et,
rotateY: et,
rotateZ: et,
scale: Jt,
scaleX: Jt,
scaleY: Jt,
scaleZ: Jt,
skew: et,
skewX: et,
skewY: et,
distance: P,
translateX: P,
translateY: P,
translateZ: P,
x: P,
y: P,
z: P,
perspective: P,
transformPerspective: P,
opacity: _t,
originX: Bn,
originY: Bn,
originZ: P
}, Nn = {
...Ct,
transform: Math.round
}, on = {
...Cr,
...Vr,
zIndex: Nn,
size: P,
// SVG
fillOpacity: _t,
strokeOpacity: _t,
numOctaves: Nn
}, Dr = {
x: "translateX",
y: "translateY",
z: "translateZ",
transformPerspective: "perspective"
}, Er = wt.length;
function Mr(t, e, n) {
let s = "", i = !0;
for (let r = 0; r < Er; r++) {
const o = wt[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 = gi(a, on[o]);
if (!l) {
i = !1;
const c = Dr[o] || o;
s += `${c}(${u}) `;
}
n && (e[o] = u);
}
}
return s = s.trim(), n ? s = n(e, i ? "" : s) : i && (s = "none"), s;
}
function rn(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 (ft.has(l)) {
o = !0;
continue;
} else if (nn(l)) {
i[l] = u;
continue;
} else {
const c = gi(u, on[l]);
l.startsWith("origin") ? (a = !0, r[l] = c) : s[l] = c;
}
}
if (e.transform || (o || n ? s.transform = Mr(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 an = () => ({
style: {},
transform: {},
transformOrigin: {},
vars: {}
});
function yi(t, e, n) {
for (const s in e)
!N(e[s]) && !pi(s, n) && (t[s] = e[s]);
}
function Rr({ transformTemplate: t }, e) {
return V(() => {
const n = an();
return rn(n, e, t), Object.assign({}, n.vars, n.style);
}, [e]);
}
function Lr(t, e) {
const n = t.style || {}, s = {};
return yi(s, n, t), Object.assign(s, Rr(t, e)), s;
}
function Ir(t, e) {
const n = {}, s = Lr(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 Fr = [
"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 ln(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
*/
!!(Fr.indexOf(t) > -1 || /**
* If it contains a capital letter, it's an SVG component
*/
/[A-Z]/u.test(t))
)
);
}
const Or = {
offset: "stroke-dashoffset",
array: "stroke-dasharray"
}, kr = {
offset: "strokeDashoffset",
array: "strokeDasharray"
};
function Br(t, e, n = 1, s = 0, i = !0) {
t.pathLength = 1;
const r = i ? Or : kr;
t[r.offset] = P.transform(-s);
const o = P.transform(e), a = P.transform(n);
t[r.array] = `${o} ${a}`;
}
function jn(t, e, n) {
return typeof t == "string" ? t : P.transform(e + n * t);
}
function Nr(t, e, n) {
const s = jn(e, t.x, t.width), i = jn(n, t.y, t.height);
return `${s} ${i}`;
}
function cn(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 (rn(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 = Nr(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 && Br(f, o, a, l, !1);
}
const vi = () => ({
...an(),
attrs: {}
}), un = (t) => typeof t == "string" && t.toLowerCase() === "svg";
function jr(t, e, n, s) {
const i = V(() => {
const r = vi();
return cn(r, e, un(s), t.transformTemplate), {
...r.attrs,
style: { ...r.style }
};
}, [e]);
if (t.style) {
const r = {};
yi(r, t.style, t), i.style = { ...r, ...i.style };
}
return i;
}
function _r(t = !1) {
return (n, s, i, { latestValues: r }, o) => {
const l = (ln(n) ? jr : Ir)(s, r, o, n), u = lr(s, typeof n == "string", t), c = n !== si ? { ...u, ...l, ref: i } : {}, { children: h } = s, f = V(() => N(h) ? h.get() : h, [h]);
return Ko(n, {
...c,
children: f
});
};
}
function _n(t) {
const e = [{}, {}];
return t == null || t.values.forEach((n, s) => {
e[0][s] = n.get(), e[1][s] = n.getVelocity();
}), e;
}
function hn(t, e, n, s) {
if (typeof e == "function") {
const [i, r] = _n(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] = _n(s);
e = e(n !== void 0 ? n : t.custom, i, r);
}
return e;
}
const Me = (t) => Array.isArray(t), Ur = (t) => !!(t && typeof t == "object" && t.mix && t.toValue), Kr = (t) => Me(t) ? t[t.length - 1] || 0 : t;
function ee(t) {
const e = N(t) ? t.get() : t;
return Ur(e) ? e.toValue() : e;
}
function $r({ scrapeMotionValuesFromProps: t, createRenderState: e, onUpdate: n }, s, i, r) {
const o = {
latestValues: Gr(s, i, r, t),
renderState: e()
};
return n && (o.onMount = (a) => n({ props: s, current: a, ...o }), o.onUpdate = (a) => n(a)), o;
}
const Ti = (t) => (e, n) => {
const s = B(he), i = B(ce), r = () => $r(t, e, s, i);
return n ? r() : Xe(r);
};
function Gr(t, e, n, s) {
const i = {}, r = s(t, {});
for (const f in r)
i[f] = ee(r[f]);
let { initial: o, animate: a } = t;
const l = de(t), u = ui(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 = hn(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 b = c ? T.length - 1 : 0;
T = T[b];
}
T !== null && (i[y] = T);
}
for (const y in p)
i[y] = p[y];
}
}
}
return i;
}
function fn(t, e, n) {
var s;
const { style: i } = t, r = {};
for (const o in i)
(N(i[o]) || e.style && N(e.style[o]) || pi(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 Wr = {
useVisualState: Ti({
scrapeMotionValuesFromProps: fn,
createRenderState: an
})
};
function xi(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 Pi(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 Si = /* @__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 Ai(t, e, n, s) {
Pi(t, e, void 0, s);
for (const i in e.attrs)
t.setAttribute(Si.has(i) ? i : tn(i), e.attrs[i]);
}
function bi(t, e, n) {
const s = fn(t, e, n);
for (const i in t)
if (N(t[i]) || N(e[i])) {
const r = wt.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
s[r] = t[i];
}
return s;
}
const Un = ["x", "y", "width", "height", "cx", "cy", "r"], zr = {
useVisualState: Ti({
scrapeMotionValuesFromProps: bi,
createRenderState: vi,
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 (ft.has(a)) {
r = !0;
break;
}
}
if (!r)
return;
let o = !e;
if (e)
for (let a = 0; a < Un.length; a++) {
const l = Un[a];
t[l] !== e[l] && (o = !0);
}
o && C.read(() => {
xi(n, s), C.render(() => {
cn(s, i, un(n.tagName), t.transformTemplate), Ai(n, s);
});
});
}
})
};
function Hr(t, e) {
return function(s, { forwardMotionProps: i } = { forwardMotionProps: !1 }) {
const o = {
...ln(s) ? zr : Wr,
preloadedFeatures: t,
useRender: _r(i),
createVisualElement: e,
Component: s
};
return yr(o);
};
}
function Ut(t, e, n) {
const s = t.getProps();
return hn(s, e, n !== void 0 ? n : s.custom, t);
}
function dn(t, e) {
return t ? t[e] || t.default || t : void 0;
}
const wi = /* @__PURE__ */ new Set([
"width",
"height",
"top",
"left",
"right",
"bottom",
...wt
]);
let ne;
function Yr() {
ne = void 0;
}
const q = {
now: () => (ne === void 0 && q.set(O.isProcessing || nr.useManualTiming ? O.timestamp : performance.now()), ne),
set: (t) => {
ne = t, queueMicrotask(Yr);
}
};
function mn(t, e) {
t.indexOf(e) === -1 && t.push(e);
}
function pn(t, e) {
const n = t.indexOf(e);
n > -1 && t.splice(n, 1);
}
class gn {
constructor() {
this.subscriptions = [];
}
add(e) {
return mn(this.subscriptions, e), () => pn(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 Ci(t, e) {
return e ? t * (1e3 / e) : 0;
}
const Kn = 30, Xr = (t) => !isNaN(parseFloat(t));
class qr {
/**
* @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 = q.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 = q.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = Xr(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 gn());
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 = q.now();
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Kn)
return 0;
const n = Math.min(this.updatedAt - this.prevUpdatedAt, Kn);
return Ci(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 Kt(t, e) {
return new qr(t, e);
}
function Zr(t, e, n) {
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, Kt(n));
}
function Jr(t, e) {
const n = Ut(t, e);
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
r = { ...r, ...s };
for (const o in r) {
const a = Kr(r[o]);
Zr(t, o, a);
}
}
function Qr(t) {
return !!(N(t) && t.add);
}
function Re(t, e) {
const n = t.getValue("willChange");
if (Qr(n))
return n.add(e);
}
function Vi(t) {
return t.props[hi];
}
// @__NO_SIDE_EFFECTS__
function yn(t) {
let e;
return () => (e === void 0 && (e = t()), e);
}
const ta = /* @__PURE__ */ yn(() => window.ScrollTimeline !== void 0);
class ea {
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 (ta() && 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 na extends ea {
then(e, n) {
return Promise.all(this.animations).then(e).catch(n);
}
}
const Z = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, Q = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3;
function vn(t) {
return typeof t == "function";
}
function $n(t, e) {
t.timeline = e, t.onfinish = null;
}
const Tn = (t) => Array.isArray(t) && typeof t[0] == "number", sa = {
linearEasing: void 0
};
function ia(t, e) {
const n = /* @__PURE__ */ yn(t);
return () => {
var s;
return (s = sa[e]) !== null && s !== void 0 ? s : n();
};
}
const oe = /* @__PURE__ */ ia(() => {
try {
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
} catch {
return !1;
}
return !0;
}, "linearEasing"), Pt = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
const s = e - t;
return s === 0 ? 1 : (n - t) / s;
}, Di = (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__ */ Pt(0, i - 1, r)) + ", ";
return `linear(${s.substring(0, s.length - 2)})`;
};
function Ei(t) {
return !!(typeof t == "function" && oe() || !t || typeof t == "string" && (t in Le || oe()) || Tn(t) || Array.isArray(t) && t.every(Ei));
}
const Et = ([t, e, n, s]) => `cubic-bezier(${t}, ${e}, ${n}, ${s})`, Le = {
linear: "linear",
ease: "ease",
easeIn: "ease-in",
easeOut: "ease-out",
easeInOut: "ease-in-out",
circIn: /* @__PURE__ */ Et([0, 0.65, 0.55, 1]),
circOut: /* @__PURE__ */ Et([0.55, 0, 1, 0.45]),
backIn: /* @__PURE__ */ Et([0.31, 0.01, 0.66, -0.59]),
backOut: /* @__PURE__ */ Et([0.33, 1.53, 0.69, 0.99])
};
function Mi(t, e) {
if (t)
return typeof t == "function" && oe() ? Di(t, e) : Tn(t) ? Et(t) : Array.isArray(t) ? t.map((n) => Mi(n, e) || Le.easeOut) : Le[t];
}
const Ri = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, oa = 1e-7, ra = 12;
function aa(t, e, n, s, i) {
let r, o, a = 0;
do
o = e + (n - e) / 2, r = Ri(o, s, i) - t, r > 0 ? n = o : e = o;
while (Math.abs(r) > oa && ++a < ra);
return o;
}
function Ht(t, e, n, s) {
if (t === e && n === s)
return G;
const i = (r) => aa(r, 0, 1, t, n);
return (r) => r === 0 || r === 1 ? r : Ri(i(r), e, s);
}
const Li = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Ii = (t) => (e) => 1 - t(1 - e), Fi = /* @__PURE__ */ Ht(0.33, 1.53, 0.69, 0.99), xn = /* @__PURE__ */ Ii(Fi), Oi = /* @__PURE__ */ Li(xn), ki = (t) => (t *= 2) < 1 ? 0.5 * xn(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), Pn = (t) => 1 - Math.sin(Math.acos(t)), Bi = Ii(Pn), Ni = Li(Pn), ji = (t) => /^0[^.\s]+$/u.test(t);
function la(t) {
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || ji(t) : !0;
}
const Rt = (t) => Math.round(t * 1e5) / 1e5, Sn = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
function ca(t) {
return t == null;
}
const ua = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, An = (t, e) => (n) => !!(typeof n == "string" && ua.test(n) && n.startsWith(t) || e && !ca(n) && Object.prototype.hasOwnProperty.call(n, e)), _i = (t, e, n) => (s) => {
if (typeof s != "string")
return s;
const [i, r, o, a] = s.match(Sn);
return {
[t]: parseFloat(i),
[e]: parseFloat(r),
[n]: parseFloat(o),
alpha: a !== void 0 ? parseFloat(a) : 1
};
}, ha = (t) => tt(0, 255, t), ve = {
...Ct,
transform: (t) => Math.round(ha(t))
}, ct = {
test: /* @__PURE__ */ An("rgb", "red"),
parse: /* @__PURE__ */ _i("red", "green", "blue"),
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + ve.transform(t) + ", " + ve.transform(e) + ", " + ve.transform(n) + ", " + Rt(_t.transform(s)) + ")"
};
function fa(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 Ie = {
test: /* @__PURE__ */ An("#"),
parse: fa,
transform: ct.transform
}, pt = {
test: /* @__PURE__ */ An("hsl", "hue"),
parse: /* @__PURE__ */ _i("hue", "saturation", "lightness"),
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + X.transform(Rt(e)) + ", " + X.transform(Rt(n)) + ", " + Rt(_t.transform(s)) + ")"
}, k = {
test: (t) => ct.test(t) || Ie.test(t) || pt.test(t),
parse: (t) => ct.test(t) ? ct.parse(t) : pt.test(t) ? pt.parse(t) : Ie.parse(t),
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? ct.transform(t) : pt.transform(t)
}, da = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
function ma(t) {
var e, n;
return isNaN(t) && typeof t == "string" && (((e = t.match(Sn)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(da)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
}
const Ui = "number", Ki = "color", pa = "var", ga = "var(", Gn = "${}", ya = /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 $t(t) {
const e = t.toString(), n = [], s = {
color: [],
number: [],
var: []
}, i = [];
let r = 0;
const a = e.replace(ya, (l) => (k.test(l) ? (s.color.push(r), i.push(Ki), n.push(k.parse(l))) : l.startsWith(ga) ? (s.var.push(r), i.push(pa), n.push(l)) : (s.number.push(r), i.push(Ui), n.push(parseFloat(l))), ++r, Gn)).split(Gn);
return { values: n, split: a, indexes: s, types: i };
}
function $i(t) {
return $t(t).values;
}
function Gi(t) {
const { split: e, types: n } = $t(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 === Ui ? r += Rt(i[o]) : a === Ki ? r += k.transform(i[o]) : r += i[o];
}
return r;
};
}
const va = (t) => typeof t == "number" ? 0 : t;
function Ta(t) {
const e = $i(t);
return Gi(t)(e.map(va));
}
const ot = {
test: ma,
parse: $i,
createTransformer: Gi,
getAnimatableNone: Ta
}, xa = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
function Pa(t) {
const [e, n] = t.slice(0, -1).split("(");
if (e === "drop-shadow")
return t;
const [s] = n.match(Sn) || [];
if (!s)
return t;
const i = n.replace(s, "");
let r = xa.has(e) ? 1 : 0;
return s !== n && (r *= 100), e + "(" + r + i + ")";
}
const Sa = /\b([a-z-]*)\(.*?\)/gu, Fe = {
...ot,
getAnimatableNone: (t) => {
const e = t.match(Sa);
return e ? e.map(Pa).join(" ") : t;
}
}, Aa = {
...on,
// Color props
color: k,
backgroundColor: k,
outlineColor: k,
fill: k,
stroke: k,
// Border props
borderColor: k,
borderTopColor: k,
borderRightColor: k,
borderBottomColor: k,
borderLeftColor: k,
filter: Fe,
WebkitFilter: Fe
}, bn = (t) => Aa[t];
function Wi(t, e) {
let n = bn(t);
return n !== Fe && (n = ot), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
}
const ba = /* @__PURE__ */ new Set(["auto", "none", "0"]);
function wa(t, e, n) {
let s = 0, i;
for (; s < t.length && !i; ) {
const r = t[s];
typeof r == "string" && !ba.has(r) && $t(r).values.length && (i = t[s]), s++;
}
if (i && n)
for (const r of e)
t[r] = Wi(n, i);
}
const Wn = (t) => t === Ct || t === P, zn = (t, e) => parseFloat(t.split(", ")[e]), Hn = (t, e) => (n, { transform: s }) => {
if (s === "none" || !s)
return 0;
const i = s.match(/^matrix3d\((.+)\)$/u);
if (i)
return zn(i[1], e);
{
const r = s.match(/^matrix\((.+)\)$/u);
return r ? zn(r[1], t) : 0;
}
}, Ca = /* @__PURE__ */ new Set(["x", "y", "z"]), Va = wt.filter((t) => !Ca.has(t));
function Da(t) {
const e = [];
return Va.forEach((n) => {
const s = t.getValue(n);
s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
}), e;
}
const St = {
// 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: Hn(4, 13),
y: Hn(5, 14)
};
St.translateX = St.x;
St.translateY = St.y;
const ut = /* @__PURE__ */ new Set();
let Oe = !1, ke = !1;
function zi() {
if (ke) {
const t = Array.from(ut).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
e.forEach((s) => {
const i = Da(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);
});
}
ke = !1, Oe = !1, ut.forEach((t) => t.complete()), ut.clear();
}
function Hi() {
ut.forEach((t) => {
t.readKeyframes(), t.needsMeasurement && (ke = !0);
});
}
function Ea() {
Hi(), zi();
}
class wn {
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 ? (ut.add(this), Oe || (Oe = !0, C.read(Hi), C.resolveKeyframes(zi))) : (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), ut.delete(this);
}
cancel() {
this.isComplete || (this.isScheduled = !1, ut.delete(this));
}
resume() {
this.isComplete || this.scheduleResolve();
}
}
const Yi = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), Ma = (
// 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 Ra(t) {
const e = Ma.exec(t);
if (!e)
return [,];
const [, n, s, i] = e;
return [`--${n ?? s}`, i];
}
const La = 4;
function Xi(t, e, n = 1) {
st(n <= La, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular