react-voice-visualizer-avc
Version:
React library for audio recording and visualization using Web Audio API
1,270 lines (1,269 loc) • 257 kB
JavaScript
(function(){"use strict";(i=>{try{if(typeof window>"u")return;var e=document.createElement("style");e.appendChild(document.createTextNode(i)),document.head.appendChild(e)}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})(".voice-visualizer__buttons-container{display:flex;justify-content:space-between;align-items:center;column-gap:20px;row-gap:15px;flex-wrap:wrap}.voice-visualizer__btn-center{box-sizing:border-box;flex-shrink:0;width:60px;height:60px;padding:0;display:flex;justify-content:center;align-items:center;border-radius:50%;background-color:#fff;border:4px solid #c5c5c5;outline:none;cursor:pointer;transition:border-color .3s,background-color .3s}.voice-visualizer__btn-center:disabled{opacity:.85;cursor:default}.voice-visualizer__btn-center:hover{background-color:#eaeaea;border:4px solid #9f9f9f}.voice-visualizer__btn-center>img{width:auto;height:50%;max-height:30px}.voice-visualizer__btn-center.voice-visualizer__btn-center-pause{background-color:#ff3030}.voice-visualizer__btn-center.voice-visualizer__btn-center-pause:hover{background-color:#ff4f4f}.voice-visualizer__btn-center.voice-visualizer__btn-center-pause>img{height:50%;max-height:16px}.voice-visualizer__btn-center.voice-visualizer__btn-center--border-transparent{border-color:transparent}.voice-visualizer__btn-center.voice-visualizer__btn-center--border-transparent:hover{background-color:#fff}.voice-visualizer__btn-left{box-sizing:border-box;flex-shrink:0;width:60px;height:60px;padding:0;display:flex;justify-content:center;align-items:center;border-radius:50%;background-color:#ff3030;border:4px solid #c5c5c5;outline:none;cursor:pointer;transition:border-color .3s,background-color .3s,opacity .3s}.voice-visualizer__btn-container{display:flex;justify-content:flex-end}.voice-visualizer__btn-left:hover{background-color:#ff4f4f}.voice-visualizer__btn-left:disabled{opacity:.6;background-color:#ff3030;cursor:default}.voice-visualizer__btn-left.voice-visualizer__btn-left-microphone{background-color:#fff}.voice-visualizer__btn-left.voice-visualizer__btn-left-microphone>img{width:auto;height:50%;max-height:30px}.voice-visualizer__btn-left>img{width:auto;height:50%;max-height:16px}.voice-visualizer__btn-left:hover{border:4px solid #9f9f9f}.voice-visualizer__btn{box-sizing:border-box;min-height:60px;padding:5px 20px;border-radius:40px;font-size:15px;background-color:#f0f0f0;transition:background-color .3s,opacity .3s}.voice-visualizer__btn:disabled{opacity:.8;background-color:#f0f0f0;cursor:default}.voice-visualizer__btn:hover{background-color:#bebebe}.voice-visualizer__canvas-container{display:flex;flex-direction:row-reverse;position:relative;width:fit-content;margin:0 auto;overflow:hidden}.voice-visualizer__canvas-container canvas{display:block}.voice-visualizer__canvas-microphone-btn{position:absolute;top:50%;left:50%;width:auto;max-width:12%;min-width:24px;height:50%;max-height:100px;background-color:transparent;border:none;outline:none;transform:translate(-50%,-50%)}.voice-visualizer__canvas-microphone-icon{width:100%;height:100%;will-change:transform;transition:transform .3s}.voice-visualizer__canvas-microphone-btn:hover .voice-visualizer__canvas-microphone-icon{transform:scale(1.03)}.voice-visualizer__canvas-audio-wave-icon{position:absolute;top:50%;left:50%;width:auto;max-width:40%;height:40%;max-height:100px;transform:translate(-118%,-50%) scale(-1)}.voice-visualizer__canvas-audio-wave-icon2{transform:translate(18%,-50%)}.voice-visualizer__canvas-audio-processing{position:absolute;top:50%;left:50%;margin:0;transform:translate(-50%,-50%)}.voice-visualizer__progress-indicator-hovered{position:absolute;top:0;pointer-events:none;height:100%;width:1px;background-color:#85858599}.voice-visualizer__progress-indicator-hovered-time{position:absolute;top:3%;left:1px;width:fit-content;margin:0;padding:0 7px;opacity:.8;font-size:12px;border-radius:0 4px 4px 0;background-color:#575757;text-align:left}.voice-visualizer__progress-indicator-hovered-time.voice-visualizer__progress-indicator-hovered-time-left{left:unset;right:1px;border-radius:4px 0 0 4px}.voice-visualizer__progress-indicator{position:absolute;top:0;pointer-events:none;height:100%;width:1px;background-color:#efefef}.voice-visualizer__progress-indicator-time{position:absolute;top:3%;left:1px;width:fit-content;box-sizing:border-box;min-width:37px;margin:0;padding:0 7px;font-size:12px;border-radius:0 4px 4px 0;text-align:left;color:#000;font-weight:500;background-color:#efefef}.voice-visualizer__progress-indicator-time.voice-visualizer__progress-indicator-time-left{left:unset;right:1px;border-radius:4px 0 0 4px}.voice-visualizer__audio-info-container{box-sizing:border-box;height:55px;display:flex;align-items:center;justify-content:center;gap:30px}.voice-visualizer__audio-info-time{margin:15px 0;min-width:38px;text-align:left}.voice-visualizer__visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:4px solid #c5c5c5;white-space:nowrap;clip-path:inset(100%);clip:rect(0 0 0 0);overflow:hidden}.voice-visualizer__relative{position:relative}.voice-visualizer__spinner-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:52px;height:52px;display:flex;justify-content:center;align-items:center}.voice-visualizer__spinner{flex-shrink:0;width:100%;height:100%;border:4px solid rgba(197,197,197,.5);border-radius:50%;border-top-color:#b7b7b7;animation:voice-visualizer__spin 1s ease-in-out infinite;-webkit-animation:voice-visualizer__spin 1s ease-in-out infinite}@keyframes voice-visualizer__spin{to{transform:rotate(360deg)}}@-webkit-keyframes voice-visualizer__spin{to{transform:rotate(360deg)}}")})();
var Ts = Object.defineProperty;
var Cs = (e, t, r) => t in e ? Ts(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
var Ot = (e, t, r) => (Cs(e, typeof t != "symbol" ? t + "" : t, r), r);
import { jsx as G, jsxs as Ze, Fragment as eo } from "react/jsx-runtime";
import * as _ from "react";
import kt, { useState as oe, useRef as $e, useCallback as xs, useLayoutEffect as ui, forwardRef as Cn, useContext as $s, Children as Os, isValidElement as nr, cloneElement as or, useEffect as Be, createElement as rn } from "react";
const xn = ({
canvas: e,
backgroundColor: t
}) => {
const r = e.height, n = e.width, o = Math.round(n / 2), i = e.getContext("2d");
return i ? (i.clearRect(0, 0, n, r), t !== "transparent" && (i.fillStyle = t, i.fillRect(0, 0, n, r)), { context: i, height: r, width: n, halfWidth: o }) : null;
}, dr = ({
context: e,
color: t,
rounded: r,
x: n,
y: o,
w: i,
h: s
}) => {
e.fillStyle = t, e.beginPath(), e.roundRect ? (e.roundRect(n, o, i, s, r), e.fill()) : e.fillRect(n, o, i, s);
}, Rs = ({
barsData: e,
canvas: t,
barWidth: r,
gap: n,
backgroundColor: o,
mainBarColor: i,
secondaryBarColor: s,
currentAudioTime: a = 0,
rounded: c,
duration: f
}) => {
const d = xn({ canvas: t, backgroundColor: o });
if (!d)
return;
const { context: p, height: m } = d, v = a / f;
e.forEach((g, l) => {
const b = l / e.length, S = v > b;
dr({
context: p,
color: S ? s : i,
rounded: c,
x: l * (r + n * r),
y: m / 2 - g.max,
h: g.max * 2,
w: r
});
});
};
function Ps({
context: e,
color: t,
rounded: r,
width: n,
height: o,
barWidth: i
}) {
dr({
context: e,
color: t,
rounded: r,
x: n / 2 + i / 2,
y: o / 2 - 1,
h: 2,
w: n - (n / 2 + i / 2)
});
}
const As = ({
audioData: e,
unit: t,
index: r,
index2: n,
canvas: o,
isRecordingInProgress: i,
isPausedRecording: s,
picks: a,
backgroundColor: c,
barWidth: f,
mainBarColor: d,
secondaryBarColor: p,
rounded: m,
animateCurrentPick: v,
fullscreen: g
}) => {
const l = xn({ canvas: o, backgroundColor: c });
if (!l)
return;
const { context: b, height: S, width: A, halfWidth: C } = l;
if (e != null && e.length && i) {
const h = Math.max(...e);
if (!s) {
if (n.current >= f) {
n.current = 0;
const R = (S - h / 258 * S) / S * 100, V = (-S + h / 258 * S * 2) / S * 100, L = r.current === f ? {
startY: R,
barHeight: V
} : null;
r.current >= t ? r.current = f : r.current += f, a.length > (g ? A : C) / f && a.pop(), a.unshift(L);
}
n.current += 1;
}
!g && E(), v && dr({
context: b,
rounded: m,
color: d,
x: g ? A : C,
y: S - h / 258 * S,
h: -S + h / 258 * S * 2,
w: f
});
let x = (g ? A : C) - n.current;
a.forEach((R) => {
R && dr({
context: b,
color: d,
rounded: m,
x,
y: R.startY * S / 100 > S / 2 - 1 ? S / 2 - 1 : R.startY * S / 100,
h: R.barHeight * S / 100 > 2 ? R.barHeight * S / 100 : 2,
w: f
}), x -= f;
});
} else
a.length = 0;
function E() {
Ps({
context: b,
color: p,
rounded: m,
width: A,
height: S,
barWidth: f
});
}
}, li = (e) => {
const t = Math.floor(e / 3600), r = Math.floor(e % 3600 / 60), n = e % 60, o = Math.floor(
(n - Math.floor(n)) * 1e3
);
return t > 0 ? `${String(t).padStart(2, "0")}:${String(r).padStart(
2,
"0"
)}:${String(Math.floor(n)).padStart(2, "0")}:${String(
o
).charAt(0)}` : r > 0 ? `${String(r).padStart(2, "0")}:${String(
Math.floor(n)
).padStart(2, "0")}:${String(o).charAt(0)}` : `${String(Math.floor(n)).padStart(2, "0")}:${String(
o
).charAt(0)}`;
}, _s = (e) => {
const t = Math.floor(e / 1e3), r = Math.floor(t / 3600), n = Math.floor(t % 3600 / 60), o = t % 60;
return r > 0 ? `${String(r).padStart(2, "0")}:${String(n).padStart(
2,
"0"
)}:${String(o).padStart(2, "0")}` : `${String(n).padStart(2, "0")}:${String(o).padStart(2, "0")}`;
};
function to(e) {
if (typeof e == "string") {
const t = Number(e);
if (!Number.isNaN(t))
return `${Math.trunc(t / 2) * 2}px`;
}
return e;
}
const ks = ({
bufferData: e,
height: t,
width: r,
barWidth: n,
gap: o
}) => {
const i = r / (n + o * n), s = Math.floor(e.length / i), a = t / 2;
let c = [], f = 0;
for (let d = 0; d < i; d++) {
const p = [];
let m = 0;
for (let g = 0; g < s && d * s + g < e.length; g++) {
const l = e[d * s + g];
l > 0 && (p.push(l), m++);
}
const v = p.reduce((g, l) => g + l, 0) / m;
v > f && (f = v), c.push({ max: v });
}
if (a * 0.95 > f * a) {
const d = a * 0.95 / f;
c = c.map((p) => ({
max: p.max > 0.01 ? p.max * d : 1
}));
}
return c;
}, Is = (e) => {
if (!e)
return "";
const t = e.match(/audio\/([^;]+)/);
return t && t.length >= 2 ? `.${t[1]}` : "";
}, Ms = (e) => {
const t = Math.floor(e / 3600), r = Math.floor(e % 3600 / 60), n = e % 60, o = Math.floor(
(n - Math.floor(n)) * 1e3
);
return t > 0 ? `${String(t).padStart(2, "0")}:${String(r).padStart(
2,
"0"
)}:${String(Math.floor(n)).padStart(2, "0")}}h` : r > 0 ? `${String(r).padStart(2, "0")}:${String(
Math.floor(n)
).padStart(2, "0")}m` : `${String(Math.floor(n)).padStart(2, "0")}:${String(
o
).charAt(0)}${String(o).charAt(1)}s`;
}, Ns = (e) => {
onmessage = (t) => {
postMessage(e(t.data));
};
};
function zs({
fn: e,
initialValue: t,
onMessageReceived: r
}) {
const [n, o] = oe(t);
return {
result: n,
setResult: o,
run: (s) => {
const a = new Worker(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
URL.createObjectURL(new Blob([`(${Ns})(${e})`]))
);
a.onmessage = (c) => {
c.data && (o(c.data), r && r(), a.terminate());
}, a.onerror = (c) => {
console.error(c.message), a.terminate();
}, a.postMessage(s);
}
};
}
const Fs = (e, t = 250) => {
const r = $e();
return xs(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(...n) => {
const o = () => {
clearTimeout(r.current), e(...n);
};
clearTimeout(r.current), r.current = setTimeout(o, t);
},
[e, t]
);
};
function Ds(e) {
const t = $e(e);
return ui(() => {
t.current = e;
}, [e]), t;
}
const Bs = ({
color: e = "#000000",
stroke: t = 2,
className: r
}) => /* @__PURE__ */ G(
"svg",
{
viewBox: "0 0 23 33",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
className: r,
children: /* @__PURE__ */ G(
"path",
{
d: "M1.1 16.72c0 3 .96 5.8 3.61 7.95a9.96 9.96 0 0 0 6.5 2.17m0 0v4.34h4.34-8.67m4.34-4.34c2.35 0 4.42-.48 6.5-2.17a9.87 9.87 0 0 0 3.61-7.95M11.22 1.82c-1.45 0-2.5.37-3.3.93a5.6 5.6 0 0 0-1.84 2.4c-.9 2.06-1.1 4.77-1.1 7.24 0 2.46.2 5.17 1.1 7.24a5.6 5.6 0 0 0 1.84 2.4c.8.55 1.85.92 3.3.92 1.44 0 2.5-.37 3.29-.93a5.6 5.6 0 0 0 1.84-2.4c.9-2.06 1.1-4.77 1.1-7.23 0-2.47-.2-5.18-1.1-7.24a5.6 5.6 0 0 0-1.84-2.4 5.52 5.52 0 0 0-3.3-.93Z",
stroke: e,
strokeWidth: t,
strokeLinecap: "round",
strokeLinejoin: "round"
}
)
}
), ro = ({
color: e = "#FFFFFF",
reflect: t
}) => /* @__PURE__ */ G(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0.92 17.54 48.27 14.92",
className: `voice-visualizer__canvas-audio-wave-icon ${t ? "voice-visualizer__canvas-audio-wave-icon2" : ""}`,
children: /* @__PURE__ */ G(
"path",
{
d: "M.92 24.63h.21v.75H.92zm.42-1.39h.21v3.52h-.21zm.43.68h.21v2.17h-.21zM2.2 22h.21v6.01H2.2zm.43-1.27h.21v8.55h-.21zm.43 2.07h.21v4.4h-.21zm.43 1.22h.21v1.97h-.21zm.43.47h.21v1.03h-.21zm.43-1.66h.21v4.35h-.21zm.43-1.74h.21v7.82h-.21zm.43 1.94h.21v3.94h-.21zm.43 1.07h.21v1.81h-.21zm.42-.94h.21v3.68h-.21zm.43.91h.21v1.86h-.21zm.43-.23h.21v2.33h-.21zm.43.46h.21v1.4h-.21zm.43-.7h.21v2.8h-.21zm.43-1.6h.21v6.01h-.21zm.43-2.23h.21v10.46h-.21zm.43-1.4h.21v13.26h-.21zm.43.62h.21v12.02H9.5zm.43 1.64h.21v8.75h-.21zm.43 1.37h.21v6.01h-.21zm.43-1.87H11v9.74h-.21zm.42 1.32h.21v7.1h-.21zm.43-2.64h.21v12.38h-.21zm.43 1.61h.21v9.17h-.21zM12.5 22h.21v6.01h-.21zm.43 1.32h.21v3.37h-.21zm.43-2.51h.21v8.39h-.21zm.43.59H14v7.2h-.21zm.43 1.79h.21v3.62h-.21zm.43.41h.21v2.8h-.21zm.43.57h.21v1.66h-.21zm.43-1.11h.21v3.88h-.21zm.42-2.98h.21v9.84h-.21zm.43 1.06h.21v7.72h-.21zm.43 3.19H17v1.35h-.21zm.86-2.33h.21v6.01h-.21zm-.43 1.4h.21v3.21h-.21zm1.29.15h.21v2.9h-.21zm.43.68h.21v1.55h-.21zm-.86-.76h.21v3.05h-.21zm1.29-.05h.21v3.16h-.21zm.43-.64h.21v4.45h-.21zm.43.38h.21v3.68h-.21zm.42-.49h.21v4.66h-.21zm.43 1.32h.21v2.02h-.21zm.43.37h.21v1.29h-.21zm.43.31h.21v.67h-.21zm.43-.39h.21v1.45h-.21zm.43-1.35h.21v4.14h-.21zm.86.73h.21v2.69h-.21zm-.43.44h.21v1.81h-.21zm1.29-3.45h.21v8.7h-.21zm.43 1.71h.21v5.28h-.21zm-.86-2.3h.21v9.89h-.21zm1.29 3.36h.21v3.16h-.21zM25.8 22h.21v6.01h-.21zm.43 1.42h.21v3.16h-.21zm.43.88h.21v1.4h-.21zm.43-.93h.21v3.26h-.21zm.43-1.37h.21v6.01h-.21zm.43-.93h.21v7.87h-.21zm.43-.76h.21v9.38h-.21zm.43 1.69h.21v6.01h-.21zm.86 1.92h.21v2.17h-.21zm-.43-.6h.21v3.37h-.21zm1.28.05h.21v3.26h-.21zm.43.67h.21v1.91h-.21zm-.85-.51h.21v2.95h-.21zm1.28-.13h.21v3.21h-.21zm.43-1.4h.21v6.01h-.21zm.43-.99h.21v7.98h-.21zm.43 1.77h.21v4.45h-.21zm.43-1.22h.21v6.89h-.21zm.43 1.6h.21v3.68h-.21zm.43-.28h.21v4.25h-.21zm.43-.6h.21v5.44h-.21zm.43-.28h.21v6.01h-.21zm.85 2.02h.21v1.97h-.21zm-.43-.57h.21v3.11h-.21zm1.29.93h.21v1.24h-.21zm.43-.65h.21v2.54h-.21zm-.86-.28h.21v3.11h-.21zm1.29.83h.21v1.45h-.21zm.43-.99h.21v3.42h-.21zm.43-.1h.21v3.62h-.21zm.43-.7h.21v5.02h-.21zm.43.8h.21v3.42h-.21zm.43-1.29h.21v6.01h-.21zm.42-1.71h.21v9.43h-.21zm.43 2.38h.21v4.66h-.21zm.43.65h.21v3.37h-.21zm.86.08h.21v3.21h-.21zm-.43.54h.21v2.12h-.21zm1.29-.05h.21v2.23h-.21zm.43.28h.21v1.66h-.21zm-.86.16h.21v1.35h-.21zm1.29.21h.21v.93h-.21zm.43-6.04h.21v13h-.21zm.43.8h.21v11.4h-.21zm.43-1.76h.21v14.92h-.21zm.42 1.09h.21v12.74h-.21zm.43 1.17h.21v10.41h-.21zm.43 1.32h.21v7.77h-.21zm.43 1.6h.21v4.56h-.21zm.43 1.17h.21v2.23h-.21zm.86-.08h.21v2.38h-.21zm-.43-.34h.21v3.05h-.21zm1.29-.1h.21v3.26h-.21zm.43.93h.21v1.4h-.21zm-.86-.02h.21v1.45h-.21z",
fill: e
}
)
}
);
function Ls(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var nn = { exports: {} }, Jt = { exports: {} }, ee = {};
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var no;
function js() {
if (no)
return ee;
no = 1;
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, c = e ? Symbol.for("react.async_mode") : 60111, f = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, p = e ? Symbol.for("react.suspense") : 60113, m = e ? Symbol.for("react.suspense_list") : 60120, v = e ? Symbol.for("react.memo") : 60115, g = e ? Symbol.for("react.lazy") : 60116, l = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, S = e ? Symbol.for("react.responder") : 60118, A = e ? Symbol.for("react.scope") : 60119;
function C(h) {
if (typeof h == "object" && h !== null) {
var x = h.$$typeof;
switch (x) {
case t:
switch (h = h.type, h) {
case c:
case f:
case n:
case i:
case o:
case p:
return h;
default:
switch (h = h && h.$$typeof, h) {
case a:
case d:
case g:
case v:
case s:
return h;
default:
return x;
}
}
case r:
return x;
}
}
}
function E(h) {
return C(h) === f;
}
return ee.AsyncMode = c, ee.ConcurrentMode = f, ee.ContextConsumer = a, ee.ContextProvider = s, ee.Element = t, ee.ForwardRef = d, ee.Fragment = n, ee.Lazy = g, ee.Memo = v, ee.Portal = r, ee.Profiler = i, ee.StrictMode = o, ee.Suspense = p, ee.isAsyncMode = function(h) {
return E(h) || C(h) === c;
}, ee.isConcurrentMode = E, ee.isContextConsumer = function(h) {
return C(h) === a;
}, ee.isContextProvider = function(h) {
return C(h) === s;
}, ee.isElement = function(h) {
return typeof h == "object" && h !== null && h.$$typeof === t;
}, ee.isForwardRef = function(h) {
return C(h) === d;
}, ee.isFragment = function(h) {
return C(h) === n;
}, ee.isLazy = function(h) {
return C(h) === g;
}, ee.isMemo = function(h) {
return C(h) === v;
}, ee.isPortal = function(h) {
return C(h) === r;
}, ee.isProfiler = function(h) {
return C(h) === i;
}, ee.isStrictMode = function(h) {
return C(h) === o;
}, ee.isSuspense = function(h) {
return C(h) === p;
}, ee.isValidElementType = function(h) {
return typeof h == "string" || typeof h == "function" || h === n || h === f || h === i || h === o || h === p || h === m || typeof h == "object" && h !== null && (h.$$typeof === g || h.$$typeof === v || h.$$typeof === s || h.$$typeof === a || h.$$typeof === d || h.$$typeof === b || h.$$typeof === S || h.$$typeof === A || h.$$typeof === l);
}, ee.typeOf = C, ee;
}
var te = {};
/** @license React v16.13.1
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var oo;
function Vs() {
return oo || (oo = 1, process.env.NODE_ENV !== "production" && function() {
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, c = e ? Symbol.for("react.async_mode") : 60111, f = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, p = e ? Symbol.for("react.suspense") : 60113, m = e ? Symbol.for("react.suspense_list") : 60120, v = e ? Symbol.for("react.memo") : 60115, g = e ? Symbol.for("react.lazy") : 60116, l = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, S = e ? Symbol.for("react.responder") : 60118, A = e ? Symbol.for("react.scope") : 60119;
function C(w) {
return typeof w == "string" || typeof w == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
w === n || w === f || w === i || w === o || w === p || w === m || typeof w == "object" && w !== null && (w.$$typeof === g || w.$$typeof === v || w.$$typeof === s || w.$$typeof === a || w.$$typeof === d || w.$$typeof === b || w.$$typeof === S || w.$$typeof === A || w.$$typeof === l);
}
function E(w) {
if (typeof w == "object" && w !== null) {
var he = w.$$typeof;
switch (he) {
case t:
var me = w.type;
switch (me) {
case c:
case f:
case n:
case i:
case o:
case p:
return me;
default:
var Te = me && me.$$typeof;
switch (Te) {
case a:
case d:
case g:
case v:
case s:
return Te;
default:
return he;
}
}
case r:
return he;
}
}
}
var h = c, x = f, R = a, V = s, L = t, u = d, O = n, k = g, M = v, U = r, ce = i, Z = o, fe = p, de = !1;
function X(w) {
return de || (de = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), $(w) || E(w) === c;
}
function $(w) {
return E(w) === f;
}
function P(w) {
return E(w) === a;
}
function z(w) {
return E(w) === s;
}
function j(w) {
return typeof w == "object" && w !== null && w.$$typeof === t;
}
function N(w) {
return E(w) === d;
}
function Y(w) {
return E(w) === n;
}
function F(w) {
return E(w) === g;
}
function D(w) {
return E(w) === v;
}
function W(w) {
return E(w) === r;
}
function H(w) {
return E(w) === i;
}
function I(w) {
return E(w) === o;
}
function ie(w) {
return E(w) === p;
}
te.AsyncMode = h, te.ConcurrentMode = x, te.ContextConsumer = R, te.ContextProvider = V, te.Element = L, te.ForwardRef = u, te.Fragment = O, te.Lazy = k, te.Memo = M, te.Portal = U, te.Profiler = ce, te.StrictMode = Z, te.Suspense = fe, te.isAsyncMode = X, te.isConcurrentMode = $, te.isContextConsumer = P, te.isContextProvider = z, te.isElement = j, te.isForwardRef = N, te.isFragment = Y, te.isLazy = F, te.isMemo = D, te.isPortal = W, te.isProfiler = H, te.isStrictMode = I, te.isSuspense = ie, te.isValidElementType = C, te.typeOf = E;
}()), te;
}
var io;
function fi() {
return io || (io = 1, process.env.NODE_ENV === "production" ? Jt.exports = js() : Jt.exports = Vs()), Jt.exports;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var Vr, so;
function Us() {
if (so)
return Vr;
so = 1;
var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable;
function n(i) {
if (i == null)
throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(i);
}
function o() {
try {
if (!Object.assign)
return !1;
var i = new String("abc");
if (i[5] = "de", Object.getOwnPropertyNames(i)[0] === "5")
return !1;
for (var s = {}, a = 0; a < 10; a++)
s["_" + String.fromCharCode(a)] = a;
var c = Object.getOwnPropertyNames(s).map(function(d) {
return s[d];
});
if (c.join("") !== "0123456789")
return !1;
var f = {};
return "abcdefghijklmnopqrst".split("").forEach(function(d) {
f[d] = d;
}), Object.keys(Object.assign({}, f)).join("") === "abcdefghijklmnopqrst";
} catch {
return !1;
}
}
return Vr = o() ? Object.assign : function(i, s) {
for (var a, c = n(i), f, d = 1; d < arguments.length; d++) {
a = Object(arguments[d]);
for (var p in a)
t.call(a, p) && (c[p] = a[p]);
if (e) {
f = e(a);
for (var m = 0; m < f.length; m++)
r.call(a, f[m]) && (c[f[m]] = a[f[m]]);
}
}
return c;
}, Vr;
}
var Ur, ao;
function $n() {
if (ao)
return Ur;
ao = 1;
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
return Ur = e, Ur;
}
var Yr, co;
function di() {
return co || (co = 1, Yr = Function.call.bind(Object.prototype.hasOwnProperty)), Yr;
}
var Wr, uo;
function Ys() {
if (uo)
return Wr;
uo = 1;
var e = function() {
};
if (process.env.NODE_ENV !== "production") {
var t = $n(), r = {}, n = di();
e = function(i) {
var s = "Warning: " + i;
typeof console < "u" && console.error(s);
try {
throw new Error(s);
} catch {
}
};
}
function o(i, s, a, c, f) {
if (process.env.NODE_ENV !== "production") {
for (var d in i)
if (n(i, d)) {
var p;
try {
if (typeof i[d] != "function") {
var m = Error(
(c || "React class") + ": " + a + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
);
throw m.name = "Invariant Violation", m;
}
p = i[d](s, d, c, a, null, t);
} catch (g) {
p = g;
}
if (p && !(p instanceof Error) && e(
(c || "React class") + ": type specification of " + a + " `" + d + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof p + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
), p instanceof Error && !(p.message in r)) {
r[p.message] = !0;
var v = f ? f() : "";
e(
"Failed " + a + " type: " + p.message + (v ?? "")
);
}
}
}
}
return o.resetWarningCache = function() {
process.env.NODE_ENV !== "production" && (r = {});
}, Wr = o, Wr;
}
var Hr, lo;
function Ws() {
if (lo)
return Hr;
lo = 1;
var e = fi(), t = Us(), r = $n(), n = di(), o = Ys(), i = function() {
};
process.env.NODE_ENV !== "production" && (i = function(a) {
var c = "Warning: " + a;
typeof console < "u" && console.error(c);
try {
throw new Error(c);
} catch {
}
});
function s() {
return null;
}
return Hr = function(a, c) {
var f = typeof Symbol == "function" && Symbol.iterator, d = "@@iterator";
function p($) {
var P = $ && (f && $[f] || $[d]);
if (typeof P == "function")
return P;
}
var m = "<<anonymous>>", v = {
array: S("array"),
bigint: S("bigint"),
bool: S("boolean"),
func: S("function"),
number: S("number"),
object: S("object"),
string: S("string"),
symbol: S("symbol"),
any: A(),
arrayOf: C,
element: E(),
elementType: h(),
instanceOf: x,
node: u(),
objectOf: V,
oneOf: R,
oneOfType: L,
shape: k,
exact: M
};
function g($, P) {
return $ === P ? $ !== 0 || 1 / $ === 1 / P : $ !== $ && P !== P;
}
function l($, P) {
this.message = $, this.data = P && typeof P == "object" ? P : {}, this.stack = "";
}
l.prototype = Error.prototype;
function b($) {
if (process.env.NODE_ENV !== "production")
var P = {}, z = 0;
function j(Y, F, D, W, H, I, ie) {
if (W = W || m, I = I || D, ie !== r) {
if (c) {
var w = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
);
throw w.name = "Invariant Violation", w;
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
var he = W + ":" + D;
!P[he] && // Avoid spamming the console because they are often not actionable except for lib authors
z < 3 && (i(
"You are manually calling a React.PropTypes validation function for the `" + I + "` prop on `" + W + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
), P[he] = !0, z++);
}
}
return F[D] == null ? Y ? F[D] === null ? new l("The " + H + " `" + I + "` is marked as required " + ("in `" + W + "`, but its value is `null`.")) : new l("The " + H + " `" + I + "` is marked as required in " + ("`" + W + "`, but its value is `undefined`.")) : null : $(F, D, W, H, I);
}
var N = j.bind(null, !1);
return N.isRequired = j.bind(null, !0), N;
}
function S($) {
function P(z, j, N, Y, F, D) {
var W = z[j], H = Z(W);
if (H !== $) {
var I = fe(W);
return new l(
"Invalid " + Y + " `" + F + "` of type " + ("`" + I + "` supplied to `" + N + "`, expected ") + ("`" + $ + "`."),
{ expectedType: $ }
);
}
return null;
}
return b(P);
}
function A() {
return b(s);
}
function C($) {
function P(z, j, N, Y, F) {
if (typeof $ != "function")
return new l("Property `" + F + "` of component `" + N + "` has invalid PropType notation inside arrayOf.");
var D = z[j];
if (!Array.isArray(D)) {
var W = Z(D);
return new l("Invalid " + Y + " `" + F + "` of type " + ("`" + W + "` supplied to `" + N + "`, expected an array."));
}
for (var H = 0; H < D.length; H++) {
var I = $(D, H, N, Y, F + "[" + H + "]", r);
if (I instanceof Error)
return I;
}
return null;
}
return b(P);
}
function E() {
function $(P, z, j, N, Y) {
var F = P[z];
if (!a(F)) {
var D = Z(F);
return new l("Invalid " + N + " `" + Y + "` of type " + ("`" + D + "` supplied to `" + j + "`, expected a single ReactElement."));
}
return null;
}
return b($);
}
function h() {
function $(P, z, j, N, Y) {
var F = P[z];
if (!e.isValidElementType(F)) {
var D = Z(F);
return new l("Invalid " + N + " `" + Y + "` of type " + ("`" + D + "` supplied to `" + j + "`, expected a single ReactElement type."));
}
return null;
}
return b($);
}
function x($) {
function P(z, j, N, Y, F) {
if (!(z[j] instanceof $)) {
var D = $.name || m, W = X(z[j]);
return new l("Invalid " + Y + " `" + F + "` of type " + ("`" + W + "` supplied to `" + N + "`, expected ") + ("instance of `" + D + "`."));
}
return null;
}
return b(P);
}
function R($) {
if (!Array.isArray($))
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i(
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
) : i("Invalid argument supplied to oneOf, expected an array.")), s;
function P(z, j, N, Y, F) {
for (var D = z[j], W = 0; W < $.length; W++)
if (g(D, $[W]))
return null;
var H = JSON.stringify($, function(ie, w) {
var he = fe(w);
return he === "symbol" ? String(w) : w;
});
return new l("Invalid " + Y + " `" + F + "` of value `" + String(D) + "` " + ("supplied to `" + N + "`, expected one of " + H + "."));
}
return b(P);
}
function V($) {
function P(z, j, N, Y, F) {
if (typeof $ != "function")
return new l("Property `" + F + "` of component `" + N + "` has invalid PropType notation inside objectOf.");
var D = z[j], W = Z(D);
if (W !== "object")
return new l("Invalid " + Y + " `" + F + "` of type " + ("`" + W + "` supplied to `" + N + "`, expected an object."));
for (var H in D)
if (n(D, H)) {
var I = $(D, H, N, Y, F + "." + H, r);
if (I instanceof Error)
return I;
}
return null;
}
return b(P);
}
function L($) {
if (!Array.isArray($))
return process.env.NODE_ENV !== "production" && i("Invalid argument supplied to oneOfType, expected an instance of array."), s;
for (var P = 0; P < $.length; P++) {
var z = $[P];
if (typeof z != "function")
return i(
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + de(z) + " at index " + P + "."
), s;
}
function j(N, Y, F, D, W) {
for (var H = [], I = 0; I < $.length; I++) {
var ie = $[I], w = ie(N, Y, F, D, W, r);
if (w == null)
return null;
w.data && n(w.data, "expectedType") && H.push(w.data.expectedType);
}
var he = H.length > 0 ? ", expected one of type [" + H.join(", ") + "]" : "";
return new l("Invalid " + D + " `" + W + "` supplied to " + ("`" + F + "`" + he + "."));
}
return b(j);
}
function u() {
function $(P, z, j, N, Y) {
return U(P[z]) ? null : new l("Invalid " + N + " `" + Y + "` supplied to " + ("`" + j + "`, expected a ReactNode."));
}
return b($);
}
function O($, P, z, j, N) {
return new l(
($ || "React class") + ": " + P + " type `" + z + "." + j + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + N + "`."
);
}
function k($) {
function P(z, j, N, Y, F) {
var D = z[j], W = Z(D);
if (W !== "object")
return new l("Invalid " + Y + " `" + F + "` of type `" + W + "` " + ("supplied to `" + N + "`, expected `object`."));
for (var H in $) {
var I = $[H];
if (typeof I != "function")
return O(N, Y, F, H, fe(I));
var ie = I(D, H, N, Y, F + "." + H, r);
if (ie)
return ie;
}
return null;
}
return b(P);
}
function M($) {
function P(z, j, N, Y, F) {
var D = z[j], W = Z(D);
if (W !== "object")
return new l("Invalid " + Y + " `" + F + "` of type `" + W + "` " + ("supplied to `" + N + "`, expected `object`."));
var H = t({}, z[j], $);
for (var I in H) {
var ie = $[I];
if (n($, I) && typeof ie != "function")
return O(N, Y, F, I, fe(ie));
if (!ie)
return new l(
"Invalid " + Y + " `" + F + "` key `" + I + "` supplied to `" + N + "`.\nBad object: " + JSON.stringify(z[j], null, " ") + `
Valid keys: ` + JSON.stringify(Object.keys($), null, " ")
);
var w = ie(D, I, N, Y, F + "." + I, r);
if (w)
return w;
}
return null;
}
return b(P);
}
function U($) {
switch (typeof $) {
case "number":
case "string":
case "undefined":
return !0;
case "boolean":
return !$;
case "object":
if (Array.isArray($))
return $.every(U);
if ($ === null || a($))
return !0;
var P = p($);
if (P) {
var z = P.call($), j;
if (P !== $.entries) {
for (; !(j = z.next()).done; )
if (!U(j.value))
return !1;
} else
for (; !(j = z.next()).done; ) {
var N = j.value;
if (N && !U(N[1]))
return !1;
}
} else
return !1;
return !0;
default:
return !1;
}
}
function ce($, P) {
return $ === "symbol" ? !0 : P ? P["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && P instanceof Symbol : !1;
}
function Z($) {
var P = typeof $;
return Array.isArray($) ? "array" : $ instanceof RegExp ? "object" : ce(P, $) ? "symbol" : P;
}
function fe($) {
if (typeof $ > "u" || $ === null)
return "" + $;
var P = Z($);
if (P === "object") {
if ($ instanceof Date)
return "date";
if ($ instanceof RegExp)
return "regexp";
}
return P;
}
function de($) {
var P = fe($);
switch (P) {
case "array":
case "object":
return "an " + P;
case "boolean":
case "date":
case "regexp":
return "a " + P;
default:
return P;
}
}
function X($) {
return !$.constructor || !$.constructor.name ? m : $.constructor.name;
}
return v.checkPropTypes = o, v.resetWarningCache = o.resetWarningCache, v.PropTypes = v, v;
}, Hr;
}
var qr, fo;
function Hs() {
if (fo)
return qr;
fo = 1;
var e = $n();
function t() {
}
function r() {
}
return r.resetWarningCache = t, qr = function() {
function n(s, a, c, f, d, p) {
if (p !== e) {
var m = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
);
throw m.name = "Invariant Violation", m;
}
}
n.isRequired = n;
function o() {
return n;
}
var i = {
array: n,
bigint: n,
bool: n,
func: n,
number: n,
object: n,
string: n,
symbol: n,
any: n,
arrayOf: o,
element: n,
elementType: n,
instanceOf: o,
node: n,
objectOf: o,
oneOf: o,
oneOfType: o,
shape: o,
exact: o,
checkPropTypes: r,
resetWarningCache: t
};
return i.PropTypes = i, i;
}, qr;
}
if (process.env.NODE_ENV !== "production") {
var qs = fi(), Gs = !0;
nn.exports = Ws()(qs.isElement, Gs);
} else
nn.exports = Hs()();
var Ks = nn.exports;
const y = /* @__PURE__ */ Ls(Ks);
function pi(e) {
var t, r, n = "";
if (typeof e == "string" || typeof e == "number")
n += e;
else if (typeof e == "object")
if (Array.isArray(e)) {
var o = e.length;
for (t = 0; t < o; t++)
e[t] && (r = pi(e[t])) && (n && (n += " "), n += r);
} else
for (r in e)
e[r] && (n && (n += " "), n += r);
return n;
}
function _e() {
for (var e, t, r = 0, n = "", o = arguments.length; r < o; r++)
(e = arguments[r]) && (t = pi(e)) && (n && (n += " "), n += t);
return n;
}
function hi(e, t) {
return process.env.NODE_ENV === "production" ? () => null : function(...n) {
return e(...n) || t(...n);
};
}
function Sr(e, t, r = void 0) {
const n = {};
for (const o in e) {
const i = e[o];
let s = "", a = !0;
for (let c = 0; c < i.length; c += 1) {
const f = i[c];
f && (s += (a === !0 ? "" : " ") + t(f), a = !1, r && r[f] && (s += " " + r[f]));
}
n[o] = s;
}
return n;
}
function et(e, ...t) {
const r = new URL(`https://mui.com/production-error/?code=${e}`);
return t.forEach((n) => r.searchParams.append("args[]", n)), `Minified MUI error #${e}; visit ${r} for the full message.`;
}
function Xs(e, t = Number.MIN_SAFE_INTEGER, r = Number.MAX_SAFE_INTEGER) {
return Math.max(t, Math.min(e, r));
}
function On(e, t = 0, r = 1) {
return process.env.NODE_ENV !== "production" && (e < t || e > r) && console.error(`MUI: The value provided ${e} is out of range [${t}, ${r}].`), Xs(e, t, r);
}
function Qs(e) {
e = e.slice(1);
const t = new RegExp(`.{1,${e.length >= 6 ? 2 : 1}}`, "g");
let r = e.match(t);
return r && r[0].length === 1 && (r = r.map((n) => n + n)), process.env.NODE_ENV !== "production" && e.length !== e.trim().length && console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`), r ? `rgb${r.length === 4 ? "a" : ""}(${r.map((n, o) => o < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1e3) / 1e3).join(", ")})` : "";
}
function tt(e) {
if (e.type)
return e;
if (e.charAt(0) === "#")
return tt(Qs(e));
const t = e.indexOf("("), r = e.substring(0, t);
if (!["rgb", "rgba", "hsl", "hsla", "color"].includes(r))
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported \`${e}\` color.
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : et(9, e));
let n = e.substring(t + 1, e.length - 1), o;
if (r === "color") {
if (n = n.split(" "), o = n.shift(), n.length === 4 && n[3].charAt(0) === "/" && (n[3] = n[3].slice(1)), !["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].includes(o))
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: unsupported \`${o}\` color space.
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : et(10, o));
} else
n = n.split(",");
return n = n.map((i) => parseFloat(i)), {
type: r,
values: n,
colorSpace: o
};
}
const Js = (e) => {
const t = tt(e);
return t.values.slice(0, 3).map((r, n) => t.type.includes("hsl") && n !== 0 ? `${r}%` : r).join(" ");
}, It = (e, t) => {
try {
return Js(e);
} catch {
return t && process.env.NODE_ENV !== "production" && console.warn(t), e;
}
};
function Er(e) {
const {
type: t,
colorSpace: r
} = e;
let {
values: n
} = e;
return t.includes("rgb") ? n = n.map((o, i) => i < 3 ? parseInt(o, 10) : o) : t.includes("hsl") && (n[1] = `${n[1]}%`, n[2] = `${n[2]}%`), t.includes("color") ? n = `${r} ${n.join(" ")}` : n = `${n.join(", ")}`, `${t}(${n})`;
}
function mi(e) {
e = tt(e);
const {
values: t
} = e, r = t[0], n = t[1] / 100, o = t[2] / 100, i = n * Math.min(o, 1 - o), s = (f, d = (f + r / 30) % 12) => o - i * Math.max(Math.min(d - 3, 9 - d, 1), -1);
let a = "rgb";
const c = [Math.round(s(0) * 255), Math.round(s(8) * 255), Math.round(s(4) * 255)];
return e.type === "hsla" && (a += "a", c.push(t[3])), Er({
type: a,
values: c
});
}
function on(e) {
e = tt(e);
let t = e.type === "hsl" || e.type === "hsla" ? tt(mi(e)).values : e.values;
return t = t.map((r) => (e.type !== "color" && (r /= 255), r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4)), Number((0.2126 * t[0] + 0.7152 * t[1] + 0.0722 * t[2]).toFixed(3));
}
function po(e, t) {
const r = on(e), n = on(t);
return (Math.max(r, n) + 0.05) / (Math.min(r, n) + 0.05);
}
function sn(e, t) {
return e = tt(e), t = On(t), (e.type === "rgb" || e.type === "hsl") && (e.type += "a"), e.type === "color" ? e.values[3] = `/${t}` : e.values[3] = t, Er(e);
}
function Zt(e, t, r) {
try {
return sn(e, t);
} catch {
return r && process.env.NODE_ENV !== "production" && console.warn(r), e;
}
}
function Rn(e, t) {
if (e = tt(e), t = On(t), e.type.includes("hsl"))
e.values[2] *= 1 - t;
else if (e.type.includes("rgb") || e.type.includes("color"))
for (let r = 0; r < 3; r += 1)
e.values[r] *= 1 - t;
return Er(e);
}
function ue(e, t, r) {
try {
return Rn(e, t);
} catch {
return r && process.env.NODE_ENV !== "production" && console.warn(r), e;
}
}
function Pn(e, t) {
if (e = tt(e), t = On(t), e.type.includes("hsl"))
e.values[2] += (100 - e.values[2]) * t;
else if (e.type.includes("rgb"))
for (let r = 0; r < 3; r += 1)
e.values[r] += (255 - e.values[r]) * t;
else if (e.type.includes("color"))
for (let r = 0; r < 3; r += 1)
e.values[r] += (1 - e.values[r]) * t;
return Er(e);
}
function le(e, t, r) {
try {
return Pn(e, t);
} catch {
return r && process.env.NODE_ENV !== "production" && console.warn(r), e;
}
}
function Zs(e, t = 0.15) {
return on(e) > 0.5 ? Rn(e, t) : Pn(e, t);
}
function er(e, t, r) {
try {
return Zs(e, t);
} catch {
return r && process.env.NODE_ENV !== "production" && console.warn(r), e;
}
}
function Ie(e) {
if (typeof e != "string")
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: `capitalize(string)` expects a string argument." : et(7));
return e.charAt(0).toUpperCase() + e.slice(1);
}
function We(e) {
if (typeof e != "object" || e === null)
return !1;
const t = Object.getPrototypeOf(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}
function gi(e) {
if (/* @__PURE__ */ _.isValidElement(e) || !We(e))
return e;
const t = {};
return Object.keys(e).forEach((r) => {
t[r] = gi(e[r]);
}), t;
}
function Re(e, t, r = {
clone: !0
}) {
const n = r.clone ? {
...e
} : e;
return We(e) && We(t) && Object.keys(t).forEach((o) => {
/* @__PURE__ */ _.isValidElement(t[o]) ? n[o] = t[o] : We(t[o]) && // Avoid prototype pollution
Object.prototype.hasOwnProperty.call(e, o) && We(e[o]) ? n[o] = Re(e[o], t[o], r) : r.clone ? n[o] = We(t[o]) ? gi(t[o]) : t[o] : n[o] = t[o];
}), n;
}
function Nt(e, t) {
return t ? Re(e, t, {
clone: !1
// No need to clone deep, it's way faster.
}) : e;
}
const ea = process.env.NODE_ENV !== "production" ? y.oneOfType([y.number, y.string, y.object, y.array]) : {}, rt = ea;
function ta(e, t) {
if (!e.containerQueries)
return t;
const r = Object.keys(t).filter((n) => n.startsWith("@container")).sort((n, o) => {
var s, a;
const i = /min-width:\s*([0-9.]+)/;
return +(((s = n.match(i)) == null ? void 0 : s[1]) || 0) - +(((a = o.match(i)) == null ? void 0 : a[1]) || 0);
});
return r.length ? r.reduce((n, o) => {
const i = t[o];
return delete n[o], n[o] = i, n;
}, {
...t
}) : t;
}
function ra(e, t) {
return t === "@" || t.startsWith("@") && (e.some((r) => t.startsWith(`@${r}`)) || !!t.match(/^@\d/));
}
function na(e, t) {
const r = t.match(/^@([^/]+)?\/?(.+)?$/);
if (!r) {
if (process.env.NODE_ENV !== "production")
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.` : et(18, `(${t})`));
return null;
}
const [, n, o] = r, i = Number.isNaN(+n) ? n || 0 : +n;
return e.containerQueries(o).up(i);
}
function oa(e) {
const t = (i, s) => i.replace("@media", s ? `@container ${s}` : "@container");
function r(i, s) {
i.up = (...a) => t(e.breakpoints.up(...a), s), i.down = (...a) => t(e.breakpoints.down(...a), s), i.between = (...a) => t(e.breakpoints.between(...a), s), i.only = (...a) => t(e.breakpoints.only(...a), s), i.not = (...a) => {
const c = t(e.breakpoints.not(...a), s);
return c.includes("not all and") ? c.replace("not all and ", "").replace("min-width:", "width<").replace("max-width:", "width>").replace("and", "or") : c;
};
}
const n = {}, o = (i) => (r(n, i), n);
return r(o), {
...e,
containerQueries: o
};
}
const wr = {
xs: 0,
// phone
sm: 600,
// tablet
md: 900,
// small laptop
lg: 1200,
// desktop
xl: 1536
// large screen
}, ho = {
// Sorted ASC by size. That's important.
// It can't be configured as it's used statically for propTypes.
keys: ["xs", "sm", "md", "lg", "xl"],
up: (e) => `@media (min-width:${wr[e]}px)`
}, ia = {
containerQueries: (e) => ({
up: (t) => {
let r = typeof t == "number" ? t : wr[t] || t;
return typeof r == "number" && (r = `${r}px`), e ? `@container ${e} (min-width:${r})` : `@container (min-width:${r})`;
}
})
};
function Le(e, t, r) {
const n = e.theme || {};
if (Array.isArray(t)) {
const i = n.breakpoints || ho;
return t.reduce((s, a, c) => (s[i.up(i.keys[c])] = r(t[c]), s), {});
}
if (typeof t == "object") {
const i = n.breakpoints || ho;
return Object.keys(t).reduce((s, a) => {
if (ra(i.keys, a)) {
const c = na(n.containerQueries ? n : ia, a);
c && (s[c] = r(t[a], a));
} else if (Object.keys(i.values || wr).includes(a)) {
const c = i.up(a);
s[c] = r(t[a], a);
} else {
const c = a;
s[c] = t[c];
}
return s;
}, {});
}
return r(t);
}
function yi(e = {}) {
var r;
return ((r = e.keys) == null ? void 0 : r.reduce((n, o) => {
const i = e.up(o);
return n[i] = {}, n;
}, {})) || {};
}
function vi(e, t) {
return e.reduce((r, n) => {
const o = r[n];